Skip to main content

CreateSwapInput

Input for creating a new swap. Fields typed as bigint in TypeScript are encoded in JSON/OpenAPI as decimal strings.

srcTokenstringrequired

Input source token identifier, always in the format of <network>-<ticker>, e.g. BITCOIN-BTC, LIGHTNING-BTC, or STARKNET-STRK.

dstTokenstringrequired

Output destination token identifier, always in the format of <network>-<ticker>, e.g. BITCOIN-BTC, LIGHTNING-BTC, or STARKNET-STRK.

amountbigintrequired

Swap amount in base units.

Possible values: Value must match regular expression ^[+-]?\d+$

Example: 1500000000000000000
amountTypeExactAmountTyperequired

Whether the provided amount targets the exact input side or exact output side of the swap.

Possible values: [EXACT_IN, EXACT_OUT]

srcAddressstring

Source address for flows that require it, mainly smart-chain-to-Bitcoin or smart-chain-to-Lightning swaps.

dstAddressstringrequired

Destination address, invoice, or recipient identifier for the swap output.

gasAmountbigint

Only for Lightning/Bitcoin to smart-chain swaps. Optional gas-drop amount, meaning additional native destination-chain token to receive on the destination smart chain, encoded in base units.

Possible values: Value must match regular expression ^[+-]?\d+$

Example: 1500000000000000000
paymentHashstring

Only for Lightning-to-smart-chain swaps. Optional custom swap payment hash encoded as a hexadecimal string for cases where the preimage and payment-hash pair are generated outside the API. When this field is used, the client must later provide the secret argument to getSwapStatus once the swap HTLC is ready to be claimed, which is indicated by requiresSecretReveal in the status response.

lightningInvoiceDescriptionstring

Only for Lightning-to-smart-chain swaps. Optional description to add to the generated Lightning BOLT11 invoice.

lightningInvoiceDescriptionHashstring

Only for Lightning-to-smart-chain swaps. Optional description hash to add to the generated Lightning BOLT11 invoice, encoded as a hexadecimal string.

lightningPaymentHTLCTimeoutnumber

Only for smart-chain-to-Lightning swaps. Optional override for the HTLC timeout in seconds. Longer timeouts allow more Lightning routing hops to be considered, but may lead to longer funds lockup if the LP is non-cooperative.

CreateSwapInput
{
"srcToken": "BTC",
"dstToken": "STARKNET-STRK",
"amount": "150000",
"amountType": "EXACT_IN",
"dstAddress": "0x0123456789abcdef"
}