Language

Choose a language

/build/rpc / cosign / bulletin_board

cosign.request_trade

cosign.request_trade "offer_id" ( "message" [{"utxo_ref":"str","address":"str","message":"str","signature":"str","asset_units":n,"asset_id":"str"},...] ) Request to trade on an offer (taker sends DM to maker). Arguments: 1. offer_id (string, required) Offer ID to request 2. message (string, optional) Optional message to maker 3. proof_of_funds (json array, optional) Array of BIP-322 ownership proofs for taker's assets [ { (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 request succeeded "request_id" : "str" (string) UUID of the trade request } Examples: > bitcoin-cli cosign.request_trade "abc123-def456" > bitcoin-cli cosign.request_trade "abc123-def456" "Interested in your offer" > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "cosign.request_trade", "params": ["abc123-def456"]}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

cosign.request_trade(offer_id: string, message?: string, proof_of_funds?: array) → any

Code samples

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

Parameters

NameTypeReq.Description
offer_idstringyesOffer ID to request
messagestringOptional message to maker
proof_of_fundsany[]Array of BIP-322 ownership proofs for taker's assets [ { (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 request succeeded "request_id" : "str" (string) UUID of the trade request }

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

C++ symbol: cosign_request_trade