/build/rpc / contracts / repo
repo.build_default_sweep
- workflowrepo-lifecycle·step 9 of 10Workflow: repo-lifecycle · step 9 of 10
repo.build_default_sweep "id" ( {"vault_txid":"hex","vault_vout":n,"vault_amount":n,"locktime":n,"fee_rate":n} ) Construct the default-path PSBT for an accepted repo contract. The PSBT spends the vault via the default leaf after maturity and delivers the collateral to the lender. Arguments: 1. id (string, required) Repo offer identifier 2. options (json object, optional) Optional builder settings { "vault_txid": "hex", (string, optional) Override vault outpoint txid (if registry unaware) "vault_vout": n, (numeric, optional) Override vault outpoint index "vault_amount": n, (numeric, optional) Vault amount (BTC) when tx not yet known to wallet "locktime": n, (numeric, optional) Override transaction nLockTime (defaults to maturity height) "fee_rate": n, (numeric, optional) Override fee rate in sat/vB (wallet estimate if omitted) } Result: { (json object) "psbt" : "str", (string, optional) Base64-encoded PSBT (watch-only path) "hex" : "hex", (string, optional) Complete transaction hex (hot wallet path) "txid" : "hex", (string, optional) Transaction ID (hot wallet path) "fee" : n, (numeric) Wallet-computed fee (in BTC) "changepos" : n, (numeric) Index of wallet change output or -1 if none "asset_change_output_index" : n, (numeric) Index of the asset change output or -1 if none "vault_input_index" : n, (numeric) Index of the covenant input "sweep_output_index" : n, (numeric) Index of the lender sweep output "complete" : true|false, (boolean) Whether the transaction is fully signed "signing_info" : { (json object, optional) Signing metadata for external signers (watch-only path) "leaf_hash" : "hex", (string) Default leaf hash "leaf_script" : "hex", (string) Default leaf script "lender_key" : "hex" (string) Lender's x-only pubkey } } Examples: > bitcoin-cli repo.build_default_sweep "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Signature
repo.build_default_sweep(id: string, options?: object) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"repo.build_default_sweep","params":["\"<id>\"",{}]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| id | string | yes | Repo offer identifier |
| options | object | — | Optional builder settings { "vault_txid": "hex", (string, optional) Override vault outpoint txid (if registry unaware) "vault_vout": n, (numeric, optional) Override vault outpoint index "vault_amount": n, (numeric, optional) Vault amount (BTC) when tx not yet known to wallet "locktime": n, (numeric, optional) Override transaction nLockTime (defaults to maturity height) "fee_rate": n, (numeric, optional) Override fee rate in sat/vB (wallet estimate if omitted) } |
Result
Type: any
{ (json object) "psbt" : "str", (string, optional) Base64-encoded PSBT (watch-only path) "hex" : "hex", (string, optional) Complete transaction hex (hot wallet path) "txid" : "hex", (string, optional) Transaction ID (hot wallet path) "fee" : n, (numeric) Wallet-computed fee (in BTC) "changepos" : n, (numeric) Index of wallet change output or -1 if none "asset_change_output_index" : n, (numeric) Index of the asset change output or -1 if none "vault_input_index" : n, (numeric) Index of the covenant input "sweep_output_index" : n, (numeric) Index of the lender sweep output "complete" : true|false, (boolean) Whether the transaction is fully signed "signing_info" : { (json object, optional) Signing metadata for external signers (watch-only path) "leaf_hash" : "hex", (string) Default leaf hash "leaf_script" : "hex", (string) Default leaf script "lender_key" : "hex" (string) Lender's x-only pubkey } }
Source: services/core-node/bcore/src/wallet/rpc/contracts.cpp:6105
C++ symbol: repo_build_default_sweep