Language

Choose a language

/build/rpc / contracts / repo

repo.collect_acceptance

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

repo.collect_acceptance "offer_id" "invite_link" ( timeout_ms ) Join a cosign session via invite link and collect acceptance data from counterparty. This is a convenience wrapper that combines cosign.join with cosign.recv and repo.import_acceptance. Arguments: 1. offer_id (string, required) Repo offer identifier 2. invite_link (string, required) Cosign invite link (cosign:?r=...) 3. timeout_ms (numeric, optional) Timeout for receiving acceptance (default: 30000ms) Result: { (json object) "accept_id" : "hex", (string) Acceptance identifier "acceptance" : { (json object) Imported acceptance payload "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 } }, "cosign" : { (json object) Cosign session details "session_id" : "str", (string) Cosign session identifier "peer_sas" : "str", (string) Peer Short Authentication String "messages_received" : n (numeric) Number of messages received } } Examples: > bitcoin-cli repo.collect_acceptance aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa "cosign:?r=abc123&t=websocket#c=alpha-bravo-charlie"

Signature

repo.collect_acceptance(offer_id: string, invite_link: string, timeout_ms?: number) → any

Code samples

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

Parameters

NameTypeReq.Description
offer_idstringyesRepo offer identifier
invite_linkstringyesCosign invite link (cosign:?r=...)
timeout_msnumberTimeout for receiving acceptance (default: 30000ms)

Result

Type:  any

{ (json object) "accept_id" : "hex", (string) Acceptance identifier "acceptance" : { (json object) Imported acceptance payload "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 } }, "cosign" : { (json object) Cosign session details "session_id" : "str", (string) Cosign session identifier "peer_sas" : "str", (string) Peer Short Authentication String "messages_received" : n (numeric) Number of messages received } }

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

C++ symbol: repo_collect_acceptance