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

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

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.

amountToWallet
required
string

amount of currencyTo that the provider agrees to send to the client in exchange from

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.

Responses
200

OK

post/swap
Request samples
application/json
{
  • "quoteId": "string",
  • "refundAddress": "string",
  • "refundAddressExtraId": "string",
  • "payoutAddress": "string",
  • "payoutAddressExtraId": "string",
  • "currencyFrom": "string",
  • "currencyTo": "string",
  • "payloadCurrencyFrom": "string",
  • "payloadCurrencyTo": "string",
  • "amountToWallet": "string",
  • "nonce": "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": {
    }
}