For your convenience, environments, endpoints, request and response beans are defined in xmanager-protocol
.
Add it to your project with:
<dependency>
<groupId>com.github.Samourai-Wallet</groupId>
<artifactId>xmanager-protocol</artifactId>
<version>VERSION</version>
</dependency>
See JavaExample.java for client-side integration.
- MAINNET: https://xm.samourai.io:8080
- TESTNET: https://xm.samourai.io 8081
Request and responses are JSON.
Error response format:
{
"message":"..."
}
Parameters:
- id: service ID
Response:
{
"address":"bc1..."
}
Sample request:
curl -X POST -k -H 'Content-Type: application/json' -i 'https://xm.samourai.io:8081/rest/address' --data '{"id":"WHIRLPOOL"}'
Parameters:
- id: service ID
Response:
{
"address": "bc1...",
"index": 1234
}
Sample request:
curl -X POST -k -H 'Content-Type: application/json' -i 'https://xm.samourai.io:8081/rest/addressIndex' --data '{"id":"WHIRLPOOL"}'
Parameters:
- id: service ID
- address: address to verify
- index: address index to verify
Response:
{
"valid": true
}
Sample request:
curl -X POST -k -H 'Content-Type: application/json' -i 'https://xm.samourai.io:8081/rest/verifyAddressIndex' --data '{"id":"WHIRLPOOL", "address":"tb1q6m3urxjc8j2l8fltqj93jarmzn0975nnxuymnx", "index":0}'