/build/rpc / assets / issuance
transferasset
transferasset [{"txid":"hex","vout":n,"asset_units":n},...] {"address":amount} "asset_id_or_ticker" ( {"address":amount} ) Create a raw asset transfer transaction preserving conservation (Δ=0). Note: This creates an unsigned transaction. Use fundrawtransaction to add fee inputs, then sign with signrawtransactionwithwallet and broadcast with sendrawtransaction. Arguments: 1. inputs (json array, required) Array of asset UTXOs to spend [ { (json object) "txid": "hex", (string, required) Transaction ID "vout": n, (numeric, required) Output number "asset_units": n, (numeric, required) Asset units in this UTXO }, ... ] 2. outputs (json object, required) Object with addresses and asset amounts { "address": amount, (numeric or string, required) Asset units to this address (raw units, not decimal) } 3. asset_id_or_ticker (string, required) Asset ID (hex) or ticker symbol 4. btc_amounts (json object, optional) BTC amounts for outputs (defaults to 0.00001 BTC each) { "address": amount, (numeric or string, required) BTC amount for this address } Result: "hex" (string) Raw transaction hex (unsigned) Examples: > bitcoin-cli transferasset '[{"txid":"abc...","vout":0,"asset_units":1000}]' '{"bc1q...":600, "bc1qchange...":400}' "GOLD"
Signature
transferasset(inputs: array, outputs: object, asset_id_or_ticker: string, btc_amounts?: object) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"transferasset","params":[[],{},"\"<asset_id_or_ticker>\"",{}]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| inputs | any[] | yes | Array of asset UTXOs to spend [ { (json object) "txid": "hex", (string, required) Transaction ID "vout": n, (numeric, required) Output number "asset_units": n, (numeric, required) Asset units in this UTXO }, ... ] |
| outputs | object | yes | Object with addresses and asset amounts { "address": amount, (numeric or string, required) Asset units to this address (raw units, not decimal) } |
| asset_id_or_ticker | string | yes | Asset ID (hex) or ticker symbol |
| btc_amounts | object | — | BTC amounts for outputs (defaults to 0.00001 BTC each) { "address": amount, (numeric or string, required) BTC amount for this address } |
Result
Type: any
"hex" (string) Raw transaction hex (unsigned)
Source: services/core-node/bcore/src/rpc/rawtransaction.cpp:2040
C++ symbol: transferasset