Language

Choose a language

/build/rpc / contracts / status

contract.status

  • workflowrepo-lifecycle·step 7 of 10Workflow: repo-lifecycle · step 7 of 10

contract.status "id" Return the current wallet view of a financing contract. Arguments: 1. id (string, required) Contract identifier Result: { (json object) Contract status payload "id" : "hex", (string) Contract identifier "kind" : "str", (string) Contract type (repo, spot, forward) "state" : "str", (string) Contract state (proposed, accepted, opened, repaid, defaulted, closed) "offer" : { (json object) Offer details ... }, "deadlines" : { (json object) Contract deadlines ... }, "utxos" : [ (json array) Associated UTXOs { (json object) "txid" : "hex", (string) Transaction ID "vout" : n, (numeric) Output index "amount" : n, (numeric) Output amount "role" : "str" (string) UTXO classification (vault, long_vault, short_vault, escrow) }, ... ], "closure" : { (json object, optional) Closure metadata when contract is repaid or defaulted "type" : "str", (string) Lifecycle outcome (repaid or defaulted) "txid" : "hex", (string) Lifecycle transaction id "height" : n, (numeric) Block height of lifecycle transaction "time" : xxx (numeric) Block time of lifecycle transaction }, "confs" : n, (numeric) Confirmations since creation "vault_script_hex" : "hex" (string, optional) Vault covenant script when available } Examples: > bitcoin-cli contract.status "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

Signature

contract.status(id: string) → any

Code samples

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

Parameters

NameTypeReq.Description
idstringyesContract identifier

Result

Type:  any

{ (json object) Contract status payload "id" : "hex", (string) Contract identifier "kind" : "str", (string) Contract type (repo, spot, forward) "state" : "str", (string) Contract state (proposed, accepted, opened, repaid, defaulted, closed) "offer" : { (json object) Offer details ... }, "deadlines" : { (json object) Contract deadlines ... }, "utxos" : [ (json array) Associated UTXOs { (json object) "txid" : "hex", (string) Transaction ID "vout" : n, (numeric) Output index "amount" : n, (numeric) Output amount "role" : "str" (string) UTXO classification (vault, long_vault, short_vault, escrow) }, ... ], "closure" : { (json object, optional) Closure metadata when contract is repaid or defaulted "type" : "str", (string) Lifecycle outcome (repaid or defaulted) "txid" : "hex", (string) Lifecycle transaction id "height" : n, (numeric) Block height of lifecycle transaction "time" : xxx (numeric) Block time of lifecycle transaction }, "confs" : n, (numeric) Confirmations since creation "vault_script_hex" : "hex" (string, optional) Vault covenant script when available }

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

C++ symbol: contract_status