ReDoc documentation

Partner Swap service (2.0)

Download OpenAPI specification:Download

getCrypto-currencies

Return a list of supported currencies.

Responses
200

OK

get/crypto-currencies
Response samples
application/json
[
  • {
    },
  • {
    }
]

getPairs

Return a list of supported pairs.

Responses
200

OK

get/pairs
Response samples
application/json
[
  • {
    },
  • {
    }
]

postQuote

Return a quote for a pair and amount.

Request
Request Body schema: application/json

Info for generating payload

from
required
string

currency id in your system.

to
required
string

currency id in your system.

amount
required
string

amount requested by the user, without the gas fee.

Responses
200

OK

400

Minimum/maximum error

404

When the pair is not found.

451

When the user's IP address or currency is in a restricted region.

post/quote
Request samples
application/json
{
  • "from": "btc",
  • "to": "eth",
  • "amount": "1"
}
Response samples
application/json
{
  • "quoteId": "CC14E626-CF1B-4EDA-AF5E-766FFD5A3457",
  • "amount": "1",
  • "amountTo": "270.864632",
  • "providerFees": "0.0001",
  • "referralFees": "0.0001",
  • "payoutNetworkFees": "0.0002",
  • "tradeMethod": "float",
  • "expiry": "2022-04-04T09:10:51+0000",
  • "minAmountFrom": "1",
  • "maxAmountFrom": "3",
  • "defaultSlippage": "0.1",
  • "minSlippage": "0.1",
  • "maxSlippage": "0.3"
}

getStatus

Returns the status of a quote / trade being executed.

Request
query Parameters
swapId
required
string
Example: swapId=1234
Responses
200

OK

get/status
Response samples
application/json
{
  • "status": "PENDING",
  • "amount": "1.337",
  • "payinTransactionId": "0xfffffffffffff",
  • "payoutTransactionId": "0xfffffffffffff",
  • "providerFees`": "0.0001",
  • "referralFees`": "0.0001",
  • "payoutNetworkFees": "0.0002"
}

postSwap

Generates a secure binary payload for the nano in order to authorize the transaction. The provider should validate consistency between quoteId and other inputs (addresses, amounts and currencies).

Request
Request Body schema: application/json

Info for generating payload

quoteId
required
string

previously generated quote id

refundAddress
required
string

user's refund address. This address is generaly the fromAddress.

refundAddressExtraId
required
string

tag or memo (optional).

payoutAddress
required
string

user's payout transaction address.

payoutAddressExtraId
required
string

tag or memo (optional).

currencyFrom
required
string

from currency id, using your identifiers (for checking purpose on your side only).

currencyTo
required
string

to currency id, using you identifiers (for checking purpose on your side only).

payloadCurrencyFrom
required
string

from currency id, using ledger's referencial. This value has to be used for currency_from field in the protobuf payload.

payloadCurrencyTo
required
string

to currency id, using ledger's referencial. This value has to used for currency_to field in the protobuf payload.

nonce
required
string

value to use for device_transaction_id_ng field in the protobuf payload. It will be an hex format of the byte array nonce received by the user.

slippage
string

Value between 0 to 1 (0.1 => 10%). Maximum difference between the amount the user has seen in his quote and the amount he might finally receive, as a ratio of the quoted amount. Otherwise, the user should be asked for his consent to the new trade or reimbursed in original coin.

Responses
200

OK

400

When the deposit wallet is not available.

404

Not found error

451

When the user's IP address is in a restricted region.

post/swap
Request samples
application/json
{
  • "quoteId": "string",
  • "refundAddress": "string",
  • "refundAddressExtraId": "string",
  • "payoutAddress": "string",
  • "payoutAddressExtraId": "string",
  • "currencyFrom": "string",
  • "currencyTo": "string",
  • "payloadCurrencyFrom": "string",
  • "payloadCurrencyTo": "string",
  • "nonce": "string",
  • "slippage": "string"
}
Response samples
application/json
{
  • "swapId": "SWAP-ID-165940",
  • "payinAddress": "0xa0b86991c627e936c1d19d4a2e90a2ce3606eb48",
  • "createAt": "2030-05-26T14:13:39",
  • "providerFees": "0.0001",
  • "referralFees": "0.0001",
  • "payoutNetworkFees": "0.0002",
  • "providerSig": {
    }
}