/build/rpc / contracts / crosschain
crosschain.create_record
crosschain.create_record "swap_id" "offer_id" "external_chain" "adapter" "funding_order" "local_role" "payload_json" Create a cross-chain execution record for testnet. In production, records are created by the session layer after offer acceptance. This RPC allows manual record creation for testing the swap manager. Arguments: 1. swap_id (string, required) Unique swap identifier 2. offer_id (string, required) Bulletin board offer ID 3. external_chain (string, required) Chain: btc|ethereum|tron 4. adapter (string, required) Adapter: btc_scriptless_v1|eth_htlc_v1|tron_htlc_v1 5. funding_order (string, required) Funding order: tsc_first|external_first 6. local_role (string, required) Our role: maker|taker 7. payload_json (string, required) Full cross_chain_spot_v1 payload JSON Result: { (json object) "swap_id" : "str", (string) Created swap ID "state" : n (numeric) Initial state (5 = FUNDING_PREPARED) } Examples: > bitcoin-cli crosschain.create_record "swap-1" "offer-1" "ethereum" "eth_htlc_v1" "external_first" "taker" "{...}"
Signature
crosschain.create_record(swap_id: string, offer_id: string, external_chain: string, adapter: string, funding_order: string, local_role: string, payload_json: string) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"crosschain.create_record","params":["\"<swap_id>\"","\"<offer_id>\"","\"<external_chain>\"","\"<adapter>\"","\"<funding_order>\"","\"<local_role>\"","\"<payload_json>\""]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| swap_id | string | yes | Unique swap identifier |
| offer_id | string | yes | Bulletin board offer ID |
| external_chain | string | yes | Chain: btc|ethereum|tron |
| adapter | string | yes | Adapter: btc_scriptless_v1|eth_htlc_v1|tron_htlc_v1 |
| funding_order | string | yes | Funding order: tsc_first|external_first |
| local_role | string | yes | Our role: maker|taker |
| payload_json | string | yes | Full cross_chain_spot_v1 payload JSON |
Result
Type: any
{ (json object) "swap_id" : "str", (string) Created swap ID "state" : n (numeric) Initial state (5 = FUNDING_PREPARED) }
Source: services/core-node/bcore/src/wallet/rpc/contracts.cpp:18751
C++ symbol: crosschain_create_record