/build/rpc / contracts / repo
repo.accept
- workflowrepo-lifecycle·step 3 of 10Workflow: repo-lifecycle · step 3 of 10
repo.accept "id" ( {"repay_address":"str","confirmed":bool} ) Record acceptance for a repo offer and return the canonical acceptance payload. IMPORTANT: Review terms carefully before accepting. Use 'confirmed' parameter to proceed. Arguments: 1. id (string, required) Repo offer identifier 2. options (json object, optional) Acceptance options { "repay_address": "str", (string, optional) Updated repayment address (bech32m) "confirmed": bool, (boolean, optional) Must be true after reviewing terms to accept } Result: { (json object) "accept_id" : "hex", (string, optional) Acceptance identifier (only if confirmed=true) "acceptance" : { (json object, optional) Canonical acceptance payload (only if confirmed=true) "version" : n, (numeric) Acceptance payload version "contract_type" : "str", (string) Contract type (repo) "offer_id" : "hex", (string) Offer identifier "id" : "hex", (string) Acceptance identifier "sinks_ack" : { (json object) Acknowledged sink set "repay_spk" : "hex" (string) Hex-encoded Taproot repayment script acknowledged by the counterparty }, "fs_policy_ack" : { (json object) Acknowledged Fair-Sign policy "require_adaptor" : true|false, (boolean) Require adaptor signatures (Fair-Sign) "reveal_lockstep" : true|false (boolean) Enforce lock-step final signature reveal }, "fs_tx_adaptor_point" : "hex", (string) Counterparty adaptor point (x-only, hex) "salt" : "hex", (string) Acceptance salt "commitment" : "hex", (string) Acceptance commitment "borrower_internal_key" : "hex", (string, optional) Borrower's internal key for vault construction (x-only, hex) "lender_internal_key" : "hex", (string, optional) Untweaked lender key (x-only, hex) "repay_templates" : [ (json array, optional) Pre-built repayment delivery templates { (json object) "purpose" : "str", (string) Template purpose (repay_principal, repay_interest, or repay_merged) "is_native" : true|false, (boolean) Whether repayment is native BTC "units" : n, (numeric) Raw units represented by the template "script_pubkey" : "hex", (string) Destination scriptPubKey "commitment" : "hex", (string) Commitment hash over script and TLV metadata "asset_id" : "hex", (string, optional) Asset identifier when non-native "vext" : "hex" (string, optional) Asset TLV bytes when non-native }, ... ], "default_collateral_template" : { (json object, optional) Pre-built collateral sweep template "purpose" : "str", (string) Template purpose (default_collateral) "is_native" : true|false, (boolean) Whether sweep is native BTC "units" : n, (numeric) Raw units represented by the template "script_pubkey" : "hex", (string) Destination scriptPubKey "commitment" : "hex", (string) Commitment hash over script and TLV metadata "asset_id" : "hex", (string, optional) Asset identifier when non-native "vext" : "hex" (string, optional) Asset TLV bytes when non-native } }, "terms" : {} (empty JSON object, optional) Contract terms for review (if confirmed is missing/false) "action_required" : "str", (string, optional) Instructions for user (if confirmed is missing/false) "warning" : "str" (string, optional) Warning message (if confirmed is missing/false) } Examples: > bitcoin-cli repo.accept "offer_id" (shows terms for review) > bitcoin-cli repo.accept "offer_id" '{"confirmed": true}' (accepts after review)
Signature
repo.accept(id: string, options?: object) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"repo.accept","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 | — | Acceptance options { "repay_address": "str", (string, optional) Updated repayment address (bech32m) "confirmed": bool, (boolean, optional) Must be true after reviewing terms to accept } |
Result
Type: any
{ (json object) "accept_id" : "hex", (string, optional) Acceptance identifier (only if confirmed=true) "acceptance" : { (json object, optional) Canonical acceptance payload (only if confirmed=true) "version" : n, (numeric) Acceptance payload version "contract_type" : "str", (string) Contract type (repo) "offer_id" : "hex", (string) Offer identifier "id" : "hex", (string) Acceptance identifier "sinks_ack" : { (json object) Acknowledged sink set "repay_spk" : "hex" (string) Hex-encoded Taproot repayment script acknowledged by the counterparty }, "fs_policy_ack" : { (json object) Acknowledged Fair-Sign policy "require_adaptor" : true|false, (boolean) Require adaptor signatures (Fair-Sign) "reveal_lockstep" : true|false (boolean) Enforce lock-step final signature reveal }, "fs_tx_adaptor_point" : "hex", (string) Counterparty adaptor point (x-only, hex) "salt" : "hex", (string) Acceptance salt "commitment" : "hex", (string) Acceptance commitment "borrower_internal_key" : "hex", (string, optional) Borrower's internal key for vault construction (x-only, hex) "lender_internal_key" : "hex", (string, optional) Untweaked lender key (x-only, hex) "repay_templates" : [ (json array, optional) Pre-built repayment delivery templates { (json object) "purpose" : "str", (string) Template purpose (repay_principal, repay_interest, or repay_merged) "is_native" : true|false, (boolean) Whether repayment is native BTC "units" : n, (numeric) Raw units represented by the template "script_pubkey" : "hex", (string) Destination scriptPubKey "commitment" : "hex", (string) Commitment hash over script and TLV metadata "asset_id" : "hex", (string, optional) Asset identifier when non-native "vext" : "hex" (string, optional) Asset TLV bytes when non-native }, ... ], "default_collateral_template" : { (json object, optional) Pre-built collateral sweep template "purpose" : "str", (string) Template purpose (default_collateral) "is_native" : true|false, (boolean) Whether sweep is native BTC "units" : n, (numeric) Raw units represented by the template "script_pubkey" : "hex", (string) Destination scriptPubKey "commitment" : "hex", (string) Commitment hash over script and TLV metadata "asset_id" : "hex", (string, optional) Asset identifier when non-native "vext" : "hex" (string, optional) Asset TLV bytes when non-native } }, "terms" : {} (empty JSON object, optional) Contract terms for review (if confirmed is missing/false) "action_required" : "str", (string, optional) Instructions for user (if confirmed is missing/false) "warning" : "str" (string, optional) Warning message (if confirmed is missing/false) }
Source: services/core-node/bcore/src/wallet/rpc/contracts.cpp:3286
C++ symbol: repo_accept