Language

Choose a language

/build/rpc / contracts / spot

spot.list_offers

spot.list_offers List all spot swap offers known to the wallet. Result: [ (json array) { (json object) "version" : n, (numeric) Offer payload version "contract_type" : "str", (string) Contract type (spot) "id" : "hex", (string) Offer identifier "terms" : { (json object) Spot swap legs "alice_leg" : { (json object) Assets Alice delivers to Bob "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered }, "bob_leg" : { (json object) Assets Bob delivers to Alice "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered } }, "sinks" : { (json object) Receiving scripts "alice_recv_spk" : "hex", (string) Hex-encoded script where Alice receives Bob's leg "bob_recv_spk" : "hex" (string, optional) Hex-encoded script where Bob receives Alice's leg }, "fs_policy" : { (json object) 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) Global adaptor point (x-only, hex) "salt" : "hex", (string) Salt used for the commitment "commitment" : "hex", (string) Offer commitment "created_height" : n, (numeric) Wallet chain height when the offer was recorded "created_time" : xxx, (numeric) Wall-clock creation timestamp "alice_address" : "str", (string) Bech32m address Alice receives on "bob_address_hint" : "str", (string, optional) Bob's receive address if provided "acceptance" : { (json object, optional) Counterparty acceptance payload ... } }, ... ] Examples: > bitcoin-cli spot.list_offers

Signature

spot.list_offers() → any

Code samples

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

Parameters

No parameters.

Result

Type:  any

[ (json array) { (json object) "version" : n, (numeric) Offer payload version "contract_type" : "str", (string) Contract type (spot) "id" : "hex", (string) Offer identifier "terms" : { (json object) Spot swap legs "alice_leg" : { (json object) Assets Alice delivers to Bob "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered }, "bob_leg" : { (json object) Assets Bob delivers to Alice "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered } }, "sinks" : { (json object) Receiving scripts "alice_recv_spk" : "hex", (string) Hex-encoded script where Alice receives Bob's leg "bob_recv_spk" : "hex" (string, optional) Hex-encoded script where Bob receives Alice's leg }, "fs_policy" : { (json object) 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) Global adaptor point (x-only, hex) "salt" : "hex", (string) Salt used for the commitment "commitment" : "hex", (string) Offer commitment "created_height" : n, (numeric) Wallet chain height when the offer was recorded "created_time" : xxx, (numeric) Wall-clock creation timestamp "alice_address" : "str", (string) Bech32m address Alice receives on "bob_address_hint" : "str", (string, optional) Bob's receive address if provided "acceptance" : { (json object, optional) Counterparty acceptance payload ... } }, ... ]

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

C++ symbol: spot_list_offers