On this page

latest contributor to this doc

Last Edit:

@gcharang

withdraw

withdraw coin to (amount max)

The withdraw method generates, signs, and returns a transaction that transfers the amount of coin to the address indicated in the to argument.

This method generates a raw transaction which should then be broadcast using send_raw_transaction.

StructureTypeDescription
coinstringthe name of the coin the user desires to withdraw
tostringcoins are withdrawn to this address
amountstring (numeric)the amount the user desires to withdraw, ignored when max=true
maxboolwithdraw the maximum available amount
feeobjectOptional. A standard FeeInfo object.

StructureTypeDescription
fromarray of stringscoins are withdrawn from this address; the array contains a single element, but transactions may be sent from several addresses (UTXO coins)
toarray of stringscoins are withdrawn to this address; this may contain the my_address address, where change from UTXO coins is sent
my_balance_changestring (numeric)the expected balance of change in my_address after the transaction broadcasts
received_by_mestring (numeric)the amount of coins received by my_address after the transaction broadcasts; the value may be above zero when the transaction requires that the Komodo DeFi Framework API send change to my_address
spent_by_mestring (numeric)the amount of coins spent by my_address; this value differ from the request amount, as the transaction fee is added here
total_amountstring (numeric)the total amount of coins transferred
fee_detailsobjectthe fee dsetails of the generated transaction; this value differs for utxo and ETH/ERC20 coins, check the examples for more details
tx_hashstringthe hash of the generated transaction
tx_hexstringtransaction bytes in hexadecimal format; use this value as input for the send_raw_transaction method
coinstringthe name of the coin the user wants to withdraw
kmd_rewardsobject (optional)an object containing information about accrued rewards; always exists if the coin is KMD
kmd_rewards.amountstring (numeric, optional)the amount of accrued rewards
kmd_rewards.claimed_by_mebool (optional)whether the rewards been claimed by me

Withdraw

POST
withdraw
{
  "method": "withdraw",
  "coin": "KMD",
  "to": "RJTYiYeJ8eVvJ53n2YbrVmxWNNMVZjDGLh",
  "amount": "10",
  "userpass": "RPC_UserP@SSW0RD"
}

Withdraw

POST
withdraw
{
  "method": "withdraw",
  "coin": "DOC",
  "to": "R9o9xTocqr6CeEDGDH6mEYpwLoMz6jNjMW",
  "amount": "1.0",
  "fee": {
    "type": "UtxoFixed",
    "amount": "0.1"
  },
  "userpass": "RPC_UserP@SSW0RD"
}

Withdraw

POST
withdraw
{
  "method": "withdraw",
  "coin": "DOC",
  "to": "R9o9xTocqr6CeEDGDH6mEYpwLoMz6jNjMW",
  "amount": "1.0",
  "fee": {
    "type": "UtxoPerKbyte",
    "amount": "1"
  },
  "userpass": "RPC_UserP@SSW0RD"
}

Withdraw

POST
withdraw
{
  "method": "withdraw",
  "coin": "ETH",
  "to": "0xbab36286672fbdc7b250804bf6d14be0df69fa28",
  "amount": 10,
  "userpass": "RPC_UserP@SSW0RD"
}

Withdraw

POST
withdraw
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "withdraw",
  "coin": "COIN_NAME",
  "to": "RECIPIENT_ADDRESS",
  "amount": "AMOUNT",
  "fee": {
    "type": "EthGas",
    "gas_price": "3.5",
    "gas": 55000
  }
}

Withdraw

POST
withdraw
{
  "method": "withdraw",
  "coin": "ETH",
  "to": "0xbab36286672fbdc7b250804bf6d14be0df69fa28",
  "max": true,
  "userpass": "RPC_UserP@SSW0RD"
}

Withdraw

POST
withdraw
{
  "method": "withdraw",
  "coin": "QRC20",
  "to": "qHmJ3KA6ZAjR9wGjpFASn4gtUSeFAqdZgs",
  "amount": 10,
  "userpass": "RPC_UserP@SSW0RD"
}

Withdraw

POST
withdraw
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "withdraw",
  "coin": "QRC20",
  "to": "qHmJ3KA6ZAjR9wGjpFASn4gtUSeFAqdZgs",
  "amount": 10,
  "fee": {
    "type": "Qrc20Gas",
    "gas_limit": 250000,
    "gas_price": 40
  }
}