Skip to main content

TransferTokens

warning

Deprecated. Consider using CreateTransactionGroup with one transfer transaction.

Send DeCash from one wallet to another. This endpoint work for both regular and delegated wallets.

Request Parameters

NameTypeDescription
assetIdstringThe ID of the DeCash asset that is being sent.
sender{address:string, amount:number|"max"}Object containing the address of the wallet that is sending the funds, and the amount that is being sent. Note that this account must have enough funds to cover both the amount, and the fee. If amount is set to max, then all of the funds of asset assetId are sent to receiver (minus the required fee).
receiverstringThe address of the account that is receiving the funds. Note that, if this account is not a Delegated Wallet, then it must be opted into the token that is being sent.

Responses

Regular response

NameTypeDescription
txnsArray<{txn:string, signers:string[]}>Array of objects each containing a transaction (in msgpack) and an array of signers (a list of addresses of the accounts that must sign the transaction). Transactions with an empty signers array shall not be signed.
info{fee:number}An object containing fee, the amount of DeCash that is being spent on fees in this transaction. (e.g. 1.05 USDD)

Validation errors

Returned when the parameters are invalid.

NameContent
Status code400
errorIdINVALID_PARAMS
messageValidation errors in TransferTokens request.
errorsArray of strings containing additional informations.

Sender not opted in

Returned when the sender has not yet opted into the token that is being sent.

NameContent
Status code400
errorIdSENDER_NOT_OPTED_IN
messageSender must opt in to the asset before sending funds.

Sender not enough funds

Returned when the sender does not have enough funds to pay both the transfer of the funds and the fee.

NameContent
Status code400
errorIdSENDER_NOT_ENOUGH_FUNDS
messageSender does not have enough funds to send the requested amount.

Receiver not opted in

Returned when a user is sending funds to a non-Delegated Wallet account that has not yet opted into the token that is being sent.

NameContent
Status code400
errorIdRECEIVER_NOT_OPTED_IN
messageReceiver must opt in to the asset before receiving funds.

Example Usage

const response = await fetch('https://delegator-dev01b.arringo.co/api-test/TransferTokens', {
method: 'POST',
body: JSON.stringify({
'assetId': 'USDD',
'sender': {
'address': 'V55LRWVEWZCXO5Z5A6LVEF4DK2AWE7VWKVUKBA6ZWCMA55ODBZKSDDQRBU',
'amount': 12.99
},
'receiver': 'YLCY7SE2XBY52EMOIBZAMXTSXPFVVECIQOHVBIWIR2Z5NT2QLLN2ADZZSE'})
});
const data = await response.json();

Example Success Response

{
"txns": [
{
"txn": "iqNhbXTOAAGGoKNmZWXND6CiZnbOASGEUKNnZW6sdGVzdG5ldC12MS4womdoxCBIY7UYpLPITsgQ8i1PEIHLD3HwWaesIN7GL39w5Qk6IqNncnDEIEb2Cre7tsl1gobXOwMfS5RuGGZr4Zv/+BnH4C71qQmNomx2zgEhiDijcmN2xCDM12b3NSoTfJdJSzDDROUq3CiWPHHdXRqae4X/G6GZuqNzbmTEIGvkIhQ8kyZFK6yPPqxPgOpyqgq3DUTTf62WCXzMNcePpHR5cGWjcGF5",
"signers": []
},
{
"txn": "iqRhYW10AaRhcmN2xCBr5CIUPJMmRSusjz6sT4DqcqoKtw1E03+tlgl8zDXHj6Jmds4BIYRQo2dlbqx0ZXN0bmV0LXYxLjCiZ2jEIEhjtRiks8hOyBDyLU8QgcsPcfBZp6wg3sYvf3DlCToio2dycMQgRvYKt7u2yXWChtc7Ax9LlG4YZmvhm//4GcfgLvWpCY2ibHbOASGIOKNzbmTEIGhMpbcjOw4l/o8bIBy+hdpNBG997YfUvGHdNOG1YLekpHR5cGWlYXhmZXKkeGFpZM4DGUVQ",
"signers": []
},
{
"txn": "iqRhYW10zQHzpGFyY3bEIBNQ55mZ26WVvI773GZWhIVHXUZ7NxklGPEN9Sc9xEOMomZ2zgEhhFCjZ2VurHRlc3RuZXQtdjEuMKJnaMQgSGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiKjZ3JwxCBG9gq3u7bJdYKG1zsDH0uUbhhma+Gb//gZx+Au9akJjaJsds4BIYg4o3NuZMQgaEyltyM7DiX+jxsgHL6F2k0Eb33th9S8Yd004bVgt6SkdHlwZaVheGZlcqR4YWlkzgMZRVA=",
"signers": []
},
{
"txn": "iaVjbG9zZcQga+QiFDyTJkUrrI8+rE+A6nKqCrcNRNN/rZYJfMw1x4+iZnbOASGEUKNnZW6sdGVzdG5ldC12MS4womdoxCBIY7UYpLPITsgQ8i1PEIHLD3HwWaesIN7GL39w5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