CloseDelegatedWallet
warning
This API endpoint is being deprecated in favor of TransferTokens which have the new "max" parameter.
Close the balance of a DeCash asset of a Delegated Wallet, sending the remaining funds to another (regular or delegated) wallet.
Request Parameters
Name | Type | Description |
---|---|---|
assetId | string | The ID of the DeCash asset that is being closed. |
sender | {address:string} | Object containing the address of the Delegated Wallet that is being closed. Note that this account must have enough funds to cover the fee. |
receiver | string | The address of the account that is receiving the remaining funds present in the sender wallet. 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
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 CloseDelegatedWallet 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/CloseDelegatedWallet', {
method: 'POST',
body: JSON.stringify({
'assetId': 'USDD',
'sender': {
'address': 'NBGKLNZDHMHCL7UPDMQBZPUF3JGQI3355WD5JPDB3U2ODNLAW6SDPO67JE',
},
'receiver': 'CNIOPGMZ3OSZLPEO7POGMVUEQVDV2RT3G4MSKGHRBX2SOPOEIOGBIFIMVQ'
}),
});
const data = await response.json();
Example Success Response
{
"txns": [
{
"txn": "iqNhbXTOAAGGoKNmZWXND6CiZnbOASGEBKNnZW6sdGVzdG5ldC12MS4womdoxCBIY7UYpLPITsgQ8i1PEIHLD3HwWaesIN7GL39w5Qk6IqNncnDEIO8DmPqrNPuFpH1g0l0aF64t+rph+CD3L2e4+1497b8fomx2zgEhh+yjcmN2xCDM12b3NSoTfJdJSzDDROUq3CiWPHHdXRqae4X/G6GZuqNzbmTEIGvkIhQ8kyZFK6yPPqxPgOpyqgq3DUTTf62WCXzMNcePpHR5cGWjcGF5",
"signers": []
},
{
"txn": "iqRhYW10AaRhcmN2xCBr5CIUPJMmRSusjz6sT4DqcqoKtw1E03+tlgl8zDXHj6Jmds4BIYQEo2dlbqx0ZXN0bmV0LXYxLjCiZ2jEIEhjtRiks8hOyBDyLU8QgcsPcfBZp6wg3sYvf3DlCToio2dycMQg7wOY+qs0+4WkfWDSXRoXri36umH4IPcvZ7j7Xj3tvx+ibHbOASGH7KNzbmTEIGhMpbcjOw4l/o8bIBy+hdpNBG997YfUvGHdNOG1YLekpHR5cGWlYXhmZXKkeGFpZM4DGUVQ",
"signers": []
},
{
"txn": "iqZhY2xvc2XEIBNQ55mZ26WVvI773GZWhIVHXUZ7NxklGPEN9Sc9xEOMpGFyY3bEIBNQ55mZ26WVvI773GZWhIVHXUZ7NxklGPEN9Sc9xEOMomZ2zgEhhASjZ2VurHRlc3RuZXQtdjEuMKJnaMQgSGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiKjZ3JwxCDvA5j6qzT7haR9YNJdGheuLfq6Yfgg9y9nuPtePe2/H6Jsds4BIYfso3NuZMQgaEyltyM7DiX+jxsgHL6F2k0Eb33th9S8Yd004bVgt6SkdHlwZaVheGZlcqR4YWlkzgMZRVA=",
"signers": []
},
{
"txn": "iaVjbG9zZcQga+QiFDyTJkUrrI8+rE+A6n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