Language

Choose a language

/build/rpc / cosign / bulletin_board

cosign.list_offers

  • workflowspot-trade·step 3 of 9Workflow: spot-trade · step 3 of 9

cosign.list_offers ( "offer_type" min_amount max_amount "region" "payment_method" min_reputation force_refresh ) List available offers from the bulletin board with optional filters. Arguments: 1. offer_type (string, optional) Filter by offer type: buy|sell|swap 2. min_amount (numeric, optional) Minimum amount filter 3. max_amount (numeric, optional) Maximum amount filter 4. region (string, optional) Filter by region 5. payment_method (string, optional) Filter by payment method 6. min_reputation (numeric, optional) Minimum reputation filter 7. force_refresh (boolean, optional) Force refresh from Nostr relays (bypass cache) Result: { (json object) "success" : true|false, (boolean) Whether query succeeded "offers" : [ (json array) List of matching offers { (json object) "id" : "str", (string) Offer ID "offer_type" : "str", (string) buy|sell|swap "asset_send" : "str", (string) Asset being sent "asset_recv" : "str", (string) Asset being received "amount" : n, (numeric) Amount "price" : n, (numeric) Exchange rate "maker_pubkey" : "hex", (string) Maker's Nostr pubkey "created_at" : n, (numeric) Unix timestamp "expires_at" : n (numeric) Unix timestamp }, ... ] } Examples: > bitcoin-cli cosign.list_offers > bitcoin-cli cosign.list_offers "sell" 0.01 1.0 > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "cosign.list_offers", "params": []}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

cosign.list_offers(offer_type?: string, min_amount?: number, max_amount?: number, region?: string, payment_method?: string, min_reputation?: number, force_refresh?: boolean) → any

Code samples

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

Parameters

NameTypeReq.Description
offer_typestringFilter by offer type: buy|sell|swap
min_amountnumberMinimum amount filter
max_amountnumberMaximum amount filter
regionstringFilter by region
payment_methodstringFilter by payment method
min_reputationnumberMinimum reputation filter
force_refreshbooleanForce refresh from Nostr relays (bypass cache)

Result

Type:  any

{ (json object) "success" : true|false, (boolean) Whether query succeeded "offers" : [ (json array) List of matching offers { (json object) "id" : "str", (string) Offer ID "offer_type" : "str", (string) buy|sell|swap "asset_send" : "str", (string) Asset being sent "asset_recv" : "str", (string) Asset being received "amount" : n, (numeric) Amount "price" : n, (numeric) Exchange rate "maker_pubkey" : "hex", (string) Maker's Nostr pubkey "created_at" : n, (numeric) Unix timestamp "expires_at" : n (numeric) Unix timestamp }, ... ] }

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

C++ symbol: cosign_list_offers