ADD: Quotes Endpoint V2
Swap
http -pb https://thornode.ninerealms.com/thorchain/quote/swap \
from_asset==AVAX.USDC-0XB97EF9EF8734C71904D8002F8B6BC66DD9C48A6E \
to_asset==BTC.BTC \
amount==100000000000 \
tolerance_bps==300 \
affiliate_bps==10 \
affiliate==t \
destination==bc1q3a2le4lazts64u8mqte5vuxvug25z5w6rhs95g
{
"expected_amount_out": "5883165",
"fees": {
"affiliate": "5958",
"asset": "BTC.BTC",
"outbound": "69000"
},
"inbound_address": "0x5acaed152386de95772468072e1b3fad2f4423f0",
"memo": "=:BTC.BTC:bc1q3a2le4lazts64u8mqte5vuxvug25z5w6rhs95g:5855757:t:10",
"outbound_delay_blocks": 8,
"outbound_delay_seconds": 4800,
"slippage_bps": 65
}
- Add:
router : {router}
ARC-20/ERC-20 token handling on EVM chains - Add:
expiry : {+15mins from now in UNIX seconds}
- Add:
warning : "Do not cache this response. Do not send funds after the expiry."
- Add:
notes : {specific_transaction_notes}"
(see below) - Add:
available : true | false
(inspects mimirs to assess if the tx will be processed) - Add:
dust_threshold
if non-zero.
Saver Deposit
http -pb https://thornode.ninerealms.com/thorchain/quote/saver/deposit \
asset==ETH.ETH \
amount==10000000 \
affiliate_bps==100 \
affiliate==tt
{
"expected_amount_out": "9899627",
"fees": {
"affiliate": "99996",
"asset": "ETH/ETH",
"outbound": "0"
},
"inbound_address": "0x4b61c2f47167282be172a653045824e8d96e9b0b",
"memo": "+:ETH/ETH::tt:100",
"slippage_bps": 0
}
- Change:
expected_amount_out -> expected_amount_deposit
- Remove: Affiliate handling does not work for savers deposits, remove it all for now
- Add:
expiry : {+15mins from now in UNIX seconds}
- Add:
warning : "Do not cache this response. Do not send funds after the expiry."
- Add:
notes : {specific_transaction_note}"
(see below) - Add:
available : true | false
(inspects mimirs to assess if the tx will be processed) - Add:
dust_threshold
Saver Withdraw
http -pb https://thornode.ninerealms.com/thorchain/quote/saver/withdraw \
asset==BTC.BTC \
withdraw_bps==5000 \
address==bc1q3a2le4lazts64u8mqte5vuxvug25z5w6rhs95g
{
"dust_amount": "15000",
"expected_amount_out": "3463788",
"fees": {
"affiliate": "0",
"asset": "BTC.BTC",
"outbound": "72000"
},
"inbound_address": "bc1qgg37ue3rcqzq8882zgdnwpes0m329cm49l0gn7",
"memo": "-:BTC/BTC:5000",
"outbound_delay_blocks": 4,
"outbound_delay_seconds": 2400,
"slippage_bps": 2
}
- Remove: Affiliate handling does not work for savers deposits, remove it all for now
- Add:
expiry : {+15mins from now in UNIX seconds}
- Add:
warning : "Do not cache this response. Do not send funds after the expiry."
- Add:
notes : {specific_transaction_note}"
(see below) - Add:
available : true | false
(inspects mimirs to assess if the tx will be processed) - Add:
dust_threshold
Specific Transaction Notes
Plain text, high-impact instruction to dev on nuances for that asset/chain. (Does not replace docs, just presents the gotchas).
UTXO chains
First output should be to inbound_address, second output should be change back to self, third output should be should be OP_RETURN, limited to 80 bytes.
Do not send below the dust threshold.
Do not use exotic spend scripts, locks or address formats (P2WSH with Bech32 address format preferred).
EVM CHAINS
Base Asset: Send the inbound_address the asset with the memo encoded in hex in the data field.
Tokens: First approve router to spend tokens from user: asset.approve(router, amount). Then call router.depositWithExpiry(inbound_address, asset, amount, memo, expiry). Asset is the token contract address. Amount should be in native asset decimals (eg 1e18 for most tokens). Do not send to or from contract addresses.
BFT CHAINS
Transfer the inbound_address the asset with the memo. Do not use multi-in, multi-out transactions.
Edited by THORChain