Language

Choose a language

/build/rpc / contracts / forward

forward.build_escrow_claim

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

forward.build_escrow_claim "id" {"txid":"hex","vout":n} ( {"manual_inputs":bool,"inputs":[{"txid":"hex","vout":n},...],"long_vault_txid":"hex","long_vault_vout":n,"short_vault_txid":"hex","short_vault_vout":n,"locktime":n} ) Construct Alice's escrow claim PSBT. Alice (long party) claims asset B from the B_ESCROW by paying asset A to Bob in the same transaction (BE-CLAIM leaf). Arguments: 1. id (string, required) Forward contract identifier 2. escrow_outpoint (json object, required) B_ESCROW outpoint { "txid": "hex", (string, required) B_ESCROW transaction ID "vout": n, (numeric, required) B_ESCROW output index } 3. options (json object, optional) Optional builder settings { "manual_inputs": bool, (boolean, optional) Disable automatic asset input selection "inputs": [ (json array, optional) Manual additional inputs { (json object, required) "txid": "hex", (string, required) Input txid "vout": n, (numeric, required) Input vout }, ... ], "long_vault_txid": "hex", (string, optional) Long party's IM vault txid (for B escrow claim: margin recovery + multi-asset support) "long_vault_vout": n, (numeric, optional) Long party's IM vault vout "short_vault_txid": "hex", (string, optional) Short party's IM vault txid (for A escrow claim: margin recovery + multi-asset support) "short_vault_vout": n, (numeric, optional) Short party's IM vault vout "locktime": n, (numeric, optional) Override transaction nLockTime } Result: { (json object) "psbt" : "str", (string) Base64-encoded PSBT "fee" : n, (numeric) Wallet-computed fee (in BTC) "escrow_input_index" : n, (numeric) Index of the B_ESCROW input "payment_output_index" : n, (numeric) Index of asset A payment to Bob "claim_output_index" : n, (numeric) Index of asset B claim to Alice "vault_input_index" : n, (numeric) Index of the IM vault input, or -1 if not included "margin_output_index" : n, (numeric) Index of the margin recovery output, or -1 if not included "changepos" : n, (numeric) Index of wallet change output or -1 "complete" : true|false, (boolean) Whether the PSBT contains all signatures "hex" : "hex", (string, optional) Signed transaction hex (present when complete=true) "txid" : "hex" (string, optional) Transaction id (present when complete=true) } Examples: > bitcoin-cli forward.build_escrow_claim "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "{\"txid\":\"...\", \"vout\":0}"

Signature

forward.build_escrow_claim(id: string, escrow_outpoint: object, options?: object) → any

Code samples

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

Parameters

NameTypeReq.Description
idstringyesForward contract identifier
escrow_outpointobjectyesB_ESCROW outpoint { "txid": "hex", (string, required) B_ESCROW transaction ID "vout": n, (numeric, required) B_ESCROW output index }
optionsobjectOptional builder settings { "manual_inputs": bool, (boolean, optional) Disable automatic asset input selection "inputs": [ (json array, optional) Manual additional inputs { (json object, required) "txid": "hex", (string, required) Input txid "vout": n, (numeric, required) Input vout }, ... ], "long_vault_txid": "hex", (string, optional) Long party's IM vault txid (for B escrow claim: margin recovery + multi-asset support) "long_vault_vout": n, (numeric, optional) Long party's IM vault vout "short_vault_txid": "hex", (string, optional) Short party's IM vault txid (for A escrow claim: margin recovery + multi-asset support) "short_vault_vout": n, (numeric, optional) Short party's IM vault vout "locktime": n, (numeric, optional) Override transaction nLockTime }

Result

Type:  any

{ (json object) "psbt" : "str", (string) Base64-encoded PSBT "fee" : n, (numeric) Wallet-computed fee (in BTC) "escrow_input_index" : n, (numeric) Index of the B_ESCROW input "payment_output_index" : n, (numeric) Index of asset A payment to Bob "claim_output_index" : n, (numeric) Index of asset B claim to Alice "vault_input_index" : n, (numeric) Index of the IM vault input, or -1 if not included "margin_output_index" : n, (numeric) Index of the margin recovery output, or -1 if not included "changepos" : n, (numeric) Index of wallet change output or -1 "complete" : true|false, (boolean) Whether the PSBT contains all signatures "hex" : "hex", (string, optional) Signed transaction hex (present when complete=true) "txid" : "hex" (string, optional) Transaction id (present when complete=true) }

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

C++ symbol: forward_build_escrow_claim