Skip to content

Latest commit

 

History

History
86 lines (68 loc) · 1.68 KB

README-API.md

File metadata and controls

86 lines (68 loc) · 1.68 KB

XManager API

Usage

Using xmanager-protocol

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.

Environments

Formats

Request and responses are JSON.

Error response

Error response format:

{
    "message":"..."
}

API

Get fee address: POST /rest/address

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"}'

Get fee address with index: POST /rest/addressIndex

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"}'

Verify fee address with index: POST /rest/verifyAddressIndex

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}'