On this page

Initialize Withdraw Task

API-v2task::withdraw::init

The task::withdraw::init method generates, signs, and returns a transaction that transfers the amount of coin to the address indicated in the to argument. The status of this method can be queried via the task::withdraw::status method.

It will return the transaction hex (via task::withdraw::status), which then needs to be broadcast with the sendrawtransaction to complete the withdrawal. This method is uses the same input fields as the standard v2 withdraw method, with additional optional fields to specify the from address when using a hardware or HD wallet. There are two way to indicate which HD address to send funds from:

  • Using derivation_path as a single input. E.g m/44'/20'/0'/0/2
  • Using account_id (0), chain (External) & address_id (2) inputs. The bracketed values are the equavalent of the derivation path above.

To cancel the transaction generation, use the withdraw_cancel method.

When used for ZHTLC coins like ARRR or ZOMBIE, it may take some time to complete.

ParameterTypeRequiredDefaultDescription
coinstring-The name of the coin the user desires to withdraw
tostring-Coins are withdrawn to this address
amountstring (numeric)-The amount the user desires to withdraw, ignored when max=true
memostring-Used for ZHTLC and Tendermint coins only. Attaches a memo to the transaction.
fromstring-Used only for transactions using a hardware wallet. For more information, see the Trezor Integration guide
from.derivation_pathstring-HD wallets only. Follows the format m/44'/COIN_ID'/ACCOUNT_ID'/CHAIN/ADDRESS_ID
from.account_idinteger-HD wallets only. Generally this will be 0 unless you have multiple accounts registered on your HD wallet
from.chainstring-HD wallets only. Internal, or External. External is used for addresses that are intended to be visible outside of the wallet (e.g. for receiving payments). Internal is used for addresses which are not meant to be visible outside of the wallet and is used to return the leftover change from a transaction.
from.address_idinteger-HD wallets only. Check the output from coin activation to find the ID of an address with balance.
maxboolfalseWithdraw the maximum available amount.
feeobject-Used only to set a custom fee, otherwise fee value will be derived from a deamon's estimatefee (or similar) RPC method
fee.typestring-Type of transaction fee; possible values: UtxoFixed or UtxoPerKbyte
fee.amountstring (numeric)-Fee amount in coin units, used only when type is UtxoFixed (fixed amount not depending on tx size) or UtxoPerKbyte (amount per Kbyte)

ParameterTypeDescription
task_idintegerAn identifying number which is used to query task status.

task::withdraw::init

POST
task::withdraw::init
{
  "mmrpc": "2.0",
  "userpass": "RPC_UserP@SSW0RD",
  "method": "task::withdraw::init",
  "params": {
    "coin": "SC",
    "to": "2c4a029ef67858d7c3ebf9ce7f1c257fd880b1b073fd3923091423e1658ae23d2b426be204db",
    "amount": "1"
  },
  "id": 0
}

task::withdraw::init

POST
task::withdraw::init
{
  "mmrpc": "2.0",
  "userpass": "RPC_UserP@SSW0RD",
  "method": "task::withdraw::init",
  "params": {
    "coin": "TSIA",
    "to": "2c4a029ef67858d7c3ebf9ce7f1c257fd880b1b073fd3923091423e1658ae23d2b426be204db",
    "max": true
  },
  "id": 0
}

task::withdraw::init

POST
task::withdraw::init
{
  "mmrpc": "2.0",
  "userpass": "RPC_UserP@SSW0RD",
  "method": "task::withdraw::init",
  "params": {
    "coin": "DOC",
    "to": "RGKiExg7Z1i94zrcYgKyknv7nDq3A8ud9p",
    "amount": "1",
    "fee": {
      "type": "UtxoFixed",
      "amount": "0.001"
    }
  },
  "id": 0
}

task::withdraw::init

POST
task::withdraw::init
{
  "mmrpc": "2.0",
  "userpass": "RPC_UserP@SSW0RD",
  "method": "task::withdraw::init",
  "params": {
    "coin": "DOC",
    "to": "RGKiExg7Z1i94zrcYgKyknv7nDq3A8ud9p",
    "amount": "1",
    "fee": {
      "type": "UtxoPerKbyte",
      "amount": "0.00097"
    }
  },
  "id": 0
}

task::withdraw::init

POST
task::withdraw::init
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::withdraw::init",
  "params": {
    "coin": "MARTY",
    "to": "RGKiExg7Z1i94zrcYgKyknv7nDq3A8ud9p",
    "amount": "1",
    "from": {
      "derivation_path": "m/44'/141'"
    }
  }
}

task::withdraw::init

POST
task::withdraw::init
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::withdraw::init",
  "params": {
    "coin": "MARTY",
    "to": "RGKiExg7Z1i94zrcYgKyknv7nDq3A8ud9p",
    "amount": "1",
    "from": {
      "account_id": 0,
      "chain": "External",
      "address_id": "0"
    }
  }
}

ParameterTypeDescription
NoSuchTaskstringThe specified task was not found or expired.
TaskFinishedstringThe task is already finished and cannot be canceled.