/build/rpc / cosign / bulletin_board
cosign.post_contract_offer
cosign.post_contract_offer "contract_type" "contract_payload" "maker_role" ( apr ltv tenor_days [{"utxo_ref":"str","address":"str","message":"str","signature":"str","asset_units":n,"asset_id":"str"},...] ) Post a contract offer (repo/forward/spot) to the bulletin board. Arguments: 1. contract_type (string, required) Contract type: repo|forward|spot 2. contract_payload (string, required) Full contract JSON from repo.propose/forward.propose 3. maker_role (string, required) Maker's role: lender|borrower|long|short 4. apr (numeric, optional) Annual percentage rate (for display/search) 5. ltv (numeric, optional) Loan-to-value ratio (repo contracts only) 6. tenor_days (numeric, optional) Days until maturity 7. proof_of_funds (json array, optional) Array of BIP-322 ownership proofs [ { (json object) "utxo_ref": "str", (string, required) UTXO reference (txid:vout) "address": "str", (string, required) Bitcoin address "message": "str", (string, required) Signed message: TENSORCASH_PROOF:{offer_id}:{role}:{asset_id} "signature": "str", (string, required) BIP-322 signature "asset_units": n, (numeric, required) Asset units in UTXO "asset_id": "str", (string, optional) Asset ID (hex) - required for multi-asset contracts }, ... ] Result: { (json object) "success" : true|false, (boolean) Whether post succeeded "offer_id" : "str" (string) UUID of the created contract offer } Examples: > bitcoin-cli cosign.post_contract_offer "repo" "{...contract_json...}" "lender" 5.2 80.0 14 > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "cosign.post_contract_offer", "params": ["repo","{...}","lender",5.2,80.0,14]}' -H 'content-type: application/json' http://127.0.0.1:8332/
Signature
cosign.post_contract_offer(contract_type: string, contract_payload: string, maker_role: string, apr?: number, ltv?: number, tenor_days?: number, proof_of_funds?: array) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"cosign.post_contract_offer","params":["\"<contract_type>\"","\"<contract_payload>\"","\"<maker_role>\"",0,0,0,[]]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| contract_type | string | yes | Contract type: repo|forward|spot |
| contract_payload | string | yes | Full contract JSON from repo.propose/forward.propose |
| maker_role | string | yes | Maker's role: lender|borrower|long|short |
| apr | number | — | Annual percentage rate (for display/search) |
| ltv | number | — | Loan-to-value ratio (repo contracts only) |
| tenor_days | number | — | Days until maturity |
| proof_of_funds | any[] | — | Array of BIP-322 ownership proofs [ { (json object) "utxo_ref": "str", (string, required) UTXO reference (txid:vout) "address": "str", (string, required) Bitcoin address "message": "str", (string, required) Signed message: TENSORCASH_PROOF:{offer_id}:{role}:{asset_id} "signature": "str", (string, required) BIP-322 signature "asset_units": n, (numeric, required) Asset units in UTXO "asset_id": "str", (string, optional) Asset ID (hex) - required for multi-asset contracts }, ... ] |
Result
Type: any
{ (json object) "success" : true|false, (boolean) Whether post succeeded "offer_id" : "str" (string) UUID of the created contract offer }
Source: services/core-node/bcore/src/rpc/cosign.cpp:1854
C++ symbol: cosign_post_contract_offer