ManyToOneTransfer
warning
Consider using CreateTransactionGroup endpoint for combining transfers.
Send funds from multiple Delegated Wallet (owned by the same account), to another (regular or delegated) wallet, allowing to save a bit on the transfer fees.
Request Parameters
Name | Type | Description |
---|---|---|
assetId | string | The ID of the DeCash asset that is being sent. |
senders | Array<{address:string, amount:number}> | Array of objects containing the address of the accounts that are sending the funds, and the respective amount that are being sent. Note that the account specified as the fee payer must have enough funds to cover both the amount , and the fee. This array can be 4 addresses at max. |
receiver | string | The 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. |
feePayer | string | OPTIONAL. The address of the account that will pay the fee for the whole group. By default, it is equal to the first sender. The specified address must be one of the senders. |
Responses
Regular response
Name | Type | Description |
---|---|---|
txns | Array<{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.
Name | Content |
---|---|
Status code | 400 |
errorId | INVALID_PARAMS |
message | Validation errors in ManyToOneTransfer request. |
errors | Array of strings containing additional informations. |
Sender not opted in
Returned when the sender has not yet opted into the token that is being sent.
Name | Content |
---|---|
Status code | 400 |
errorId | SENDER_NOT_OPTED_IN |
message | Sender 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.
Name | Content |
---|---|
Status code | 400 |
errorId | SENDER_NOT_ENOUGH_FUNDS |
message | Sender 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.
Name | Content |
---|---|
Status code | 400 |
errorId | RECEIVER_NOT_OPTED_IN |
message | Receiver must opt in to the asset before receiving funds. |
Example Usage
const response = await fetch('https://delegator-dev01b.arringo.co/api-test/ManyToOneTransfer', {
method: 'POST',
body: JSON.stringify({
'assetId': 'USDD',
'senders': [{
'address': 'NBGKLNZDHMHCL7UPDMQBZPUF3JGQI3355WD5JPDB3U2ODNLAW6SDPO67JE',
'amount': 5
}, {
'address': '5KZPR7ZLRZIVOQLPIBJJWM3N3MBTHHAFMK65NMZLJEJY4IHMDIH7WFFIOE',
'amount': 2.5
}],
'receiver': 'CNIOPGMZ3OSZLPEO7POGMVUEQVDV2RT3G4MSKGHRBX2SOPOEIOGBIFIMVQ'
})
});
const data = await response.json();
Example Success Response
{
"txns": [
{
"txn": "iqNhbXTOAAGGoKNmZWXNG1iiZnbOASGD46NnZW6sdGVzdG5ldC12MS4womdoxCBIY7UYpLPITsgQ8i1PEIHLD3HwWaesIN7GL39w5Qk6IqNncnDEIAI+pMgc52yXFnTJYkQeo4naJuyfh7HvRYCHvHRhIc+domx2zgEhh8ujcmN2xCDM12b3NSoTfJdJSzDDROUq3CiWPHHdXRqae4X/G6GZuqNzbmTEIGvkIhQ8kyZFK6yPPqxPgOpyqgq3DUTTf62WCXzMNcePpHR5cGWjcGF5",
"signers": []
},
{
"txn": "iaNhbXTOAAGGoKJmds4BIYPjo2dlbqx0ZXN0bmV0LXYxLjCiZ2jEIEhjtRiks8hOyBDyLU8QgcsPcfBZp6wg3sYvf3DlCToio2dycMQgAj6kyBznbJcWdMliRB6jidom7J+Hse9FgIe8dGEhz52ibHbOASGHy6NyY3bEIFOjz4p+f+5ipuxNu+El3rWI28uHGXuOGwebJt4Yw95Mo3NuZMQga+QiFDyTJkUrrI8+rE+A6nKqCrcNRNN/rZYJfMw1x4+kdHlwZaNwYXk=",
"signers": []
},
{
"txn": "iqRhYW10AqRhcmN2xCBr5CIUPJMmRSusjz6sT4DqcqoKtw1E03+tlgl8zDXHj6Jmds4BIYPjo2dlbqx0ZXN0bmV0LXYxLjCiZ2jEIEhjtRiks8hOyBDyLU8QgcsPcfBZp6wg3sYvf3DlCToio2dycMQgAj6kyBznbJcWdMliRB6jidom7J+Hse9FgIe8dGEhz52ibHbOASGHy6NzbmTEIGhM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