Language

Choose a language

/build/rpc / cosign / cross_chain

cosign.post_cross_chain_offer

  • workflowcross-chain-swap·step 1 of 7Workflow: cross-chain-swap · step 1 of 7

cosign.post_cross_chain_offer "contract_payload" ( [{"utxo_ref":"str","address":"str","message":"str","signature":"str","asset_units":n,"asset_id":"str"},...] ) Post a cross-chain settlement offer to the bulletin board. Validates the cross_chain_spot_v1 payload (addresses, timeouts, adapter consistency) then posts it as a SpotContract through the existing board path. Arguments: 1. contract_payload (string, required) Cross-chain spot v1 payload JSON (must have schema = "cross_chain_spot_v1") 2. 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 "signature": "str", (string, required) BIP-322 signature "asset_units": n, (numeric, required) Asset units in UTXO "asset_id": "str", (string, optional) Asset ID (hex) }, ... ] Result: { (json object) "success" : true|false, (boolean) Whether post succeeded "offer_id" : "str", (string) UUID of the created offer "schema" : "str", (string) Payload schema identifier "external_chain" : "str", (string) External chain (btc|ethereum|tron) "adapter" : "str", (string) Adapter kind "funding_order" : "str" (string) Funding order (tsc_first|external_first) } Examples: > bitcoin-cli cosign.post_cross_chain_offer "{...payload_json...}"

Signature

cosign.post_cross_chain_offer(contract_payload: string, proof_of_funds?: array) → any

Code samples

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

Parameters

NameTypeReq.Description
contract_payloadstringyesCross-chain spot v1 payload JSON (must have schema = "cross_chain_spot_v1")
proof_of_fundsany[]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 "signature": "str", (string, required) BIP-322 signature "asset_units": n, (numeric, required) Asset units in UTXO "asset_id": "str", (string, optional) Asset ID (hex) }, ... ]

Result

Type:  any

{ (json object) "success" : true|false, (boolean) Whether post succeeded "offer_id" : "str", (string) UUID of the created offer "schema" : "str", (string) Payload schema identifier "external_chain" : "str", (string) External chain (btc|ethereum|tron) "adapter" : "str", (string) Adapter kind "funding_order" : "str" (string) Funding order (tsc_first|external_first) }

Source: services/core-node/bcore/src/rpc/cosign.cpp:2246

C++ symbol: cosign_post_cross_chain_offer