Language

Choose a language

/build/rpc / contracts / forward

forward.export_offer

forward.export_offer "id" Export a forward contract offer for counterparty sharing (stub). Arguments: 1. id (string, required) Forward contract offer identifier Result: { (json object) "offer_id" : "hex", (string) Unique offer identifier "offer" : { (json object) Forward contract offer payload "offer_id" : "hex", (string) Offer ID "terms" : { (json object) Contract terms "long_party" : { (json object) Alice (long) party terms "deliver_leg" : { (json object) Asset this party must deliver "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 }, "margin_leg" : { (json object) Initial margin asset/amount "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 }, "margin_dest" : "str", (string) Bech32m address to receive IM refund "settlement_receive_dest" : "str" (string) Bech32m address to receive counterparty's delivery }, "short_party" : { (json object) Bob (short) party terms "deliver_leg" : { (json object) Asset this party must deliver "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 }, "margin_leg" : { (json object) Initial margin asset/amount "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 }, "margin_dest" : "str", (string) Bech32m address to receive IM refund "settlement_receive_dest" : "str" (string) Bech32m address to receive counterparty's delivery }, "deadline_short" : n, (numeric) Block height Bob must act by (T) "deadline_long" : n, (numeric) Block height Alice must act by (T+K) "premium_upfront" : { (json object, optional) Upfront premium asset/amount (P0, omitted if zero) "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 }, "premium_dest" : "str", (string, optional) Premium sink address if P0 > 0 "premium" : { (json object, optional) Combined premium object (GUI compatibility) "units" : n, (numeric) Premium amount in base units "is_native" : true|false, (boolean) True if premium is in native currency "asset_id" : "hex", (string, optional) Asset identifier if non-native "decimals" : n, (numeric, optional) Decimal places for display "payee_dest" : "str", (string) Address receiving the premium "payer" : "str" (string, optional) Which party pays (long or short) }, "safety_k" : n, (numeric) Safety window before deadlines "reorg_conf" : n (numeric) Confirmations past deadline before timeout }, "commitment_hex" : "hex" (string) Offer commitment } } Examples: > bitcoin-cli forward.export_offer "<offer_id_hex>"

Signature

forward.export_offer(id: string) → any

Code samples

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

Parameters

NameTypeReq.Description
idstringyesForward contract offer identifier

Result

Type:  any

{ (json object) "offer_id" : "hex", (string) Unique offer identifier "offer" : { (json object) Forward contract offer payload "offer_id" : "hex", (string) Offer ID "terms" : { (json object) Contract terms "long_party" : { (json object) Alice (long) party terms "deliver_leg" : { (json object) Asset this party must deliver "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 }, "margin_leg" : { (json object) Initial margin asset/amount "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 }, "margin_dest" : "str", (string) Bech32m address to receive IM refund "settlement_receive_dest" : "str" (string) Bech32m address to receive counterparty's delivery }, "short_party" : { (json object) Bob (short) party terms "deliver_leg" : { (json object) Asset this party must deliver "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 }, "margin_leg" : { (json object) Initial margin asset/amount "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 }, "margin_dest" : "str", (string) Bech32m address to receive IM refund "settlement_receive_dest" : "str" (string) Bech32m address to receive counterparty's delivery }, "deadline_short" : n, (numeric) Block height Bob must act by (T) "deadline_long" : n, (numeric) Block height Alice must act by (T+K) "premium_upfront" : { (json object, optional) Upfront premium asset/amount (P0, omitted if zero) "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 }, "premium_dest" : "str", (string, optional) Premium sink address if P0 > 0 "premium" : { (json object, optional) Combined premium object (GUI compatibility) "units" : n, (numeric) Premium amount in base units "is_native" : true|false, (boolean) True if premium is in native currency "asset_id" : "hex", (string, optional) Asset identifier if non-native "decimals" : n, (numeric, optional) Decimal places for display "payee_dest" : "str", (string) Address receiving the premium "payer" : "str" (string, optional) Which party pays (long or short) }, "safety_k" : n, (numeric) Safety window before deadlines "reorg_conf" : n (numeric) Confirmations past deadline before timeout }, "commitment_hex" : "hex" (string) Offer commitment } }

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

C++ symbol: forward_export_offer