Language

Choose a language

/build/rpc / contracts / forward

forward.build_im_timeout

  • workflowforward-lifecycle·step 10 of 10Workflow: forward-lifecycle · step 10 of 10

forward.build_im_timeout "id" "vault_type" ( {"vault_txid":"hex","vault_vout":n,"sweep_address":"str","locktime":n} ) Construct IM timeout sweep PSBT. Alice sweeps Bob's IM vault after deadline T if Bob failed to self-deliver. Bob sweeps Alice's IM vault after deadline T+K if Alice failed to pay asset A. Arguments: 1. id (string, required) Forward contract identifier 2. vault_type (string, required) Which vault to sweep: 'bob' (Alice sweeps after T) or 'alice' (Bob sweeps after T+K) 3. options (json object, optional) Optional builder settings { "vault_txid": "hex", (string, optional) Override vault outpoint txid "vault_vout": n, (numeric, optional) Override vault outpoint index "sweep_address": "str", (string, optional) Destination for swept IM (defaults to party's settlement address) "locktime": n, (numeric, optional) Override transaction nLockTime } Result: { (json object) "psbt" : "str", (string) Base64-encoded PSBT "hex" : "str", (string, optional) Hex-encoded signed transaction (when complete=true in hot wallet) "txid" : "str", (string, optional) Transaction ID (when complete=true in hot wallet) "fee" : n, (numeric) Wallet-computed fee (in BTC) "vault_input_index" : n, (numeric) Index of the IM vault input "sweep_output_index" : n, (numeric) Index of the sweep output "changepos" : n, (numeric) Index of wallet change output or -1 "complete" : true|false, (boolean) Whether the PSBT contains all signatures "signing_info" : { (json object, optional) Info for external signers (when complete=false) "timeout_pubkey" : "hex", (string) Timeout leaf signing public key "timeout_leaf_hash" : "hex", (string) Timeout leaf hash "timeout_height" : n (numeric) Timeout block height } } Examples: > bitcoin-cli forward.build_im_timeout "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "bob"

Signature

forward.build_im_timeout(id: string, vault_type: string, options?: object) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"forward.build_im_timeout","params":["\"<id>\"","\"<vault_type>\"",{}]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
idstringyesForward contract identifier
vault_typestringyesWhich vault to sweep: 'bob' (Alice sweeps after T) or 'alice' (Bob sweeps after T+K)
optionsobjectOptional builder settings { "vault_txid": "hex", (string, optional) Override vault outpoint txid "vault_vout": n, (numeric, optional) Override vault outpoint index "sweep_address": "str", (string, optional) Destination for swept IM (defaults to party's settlement address) "locktime": n, (numeric, optional) Override transaction nLockTime }

Result

Type:  any

{ (json object) "psbt" : "str", (string) Base64-encoded PSBT "hex" : "str", (string, optional) Hex-encoded signed transaction (when complete=true in hot wallet) "txid" : "str", (string, optional) Transaction ID (when complete=true in hot wallet) "fee" : n, (numeric) Wallet-computed fee (in BTC) "vault_input_index" : n, (numeric) Index of the IM vault input "sweep_output_index" : n, (numeric) Index of the sweep output "changepos" : n, (numeric) Index of wallet change output or -1 "complete" : true|false, (boolean) Whether the PSBT contains all signatures "signing_info" : { (json object, optional) Info for external signers (when complete=false) "timeout_pubkey" : "hex", (string) Timeout leaf signing public key "timeout_leaf_hash" : "hex", (string) Timeout leaf hash "timeout_height" : n (numeric) Timeout block height } }

Source: services/core-node/bcore/src/wallet/rpc/contracts.cpp:17865

C++ symbol: forward_build_im_timeout