API Reference
Methods
swapQuote
Get a quote for swapping tokens with simplified parameters.
async swapQuote(params: SwapV2QuoteParams): Promise<SwapV2QuoteResponse>Parameters:
amount(string): Amount to swap (e.g., "0.00008")fromToken(string): Source token (e.g., "BTC")toToken(string): Destination token (e.g., "GOLD DUST")address(string): User's Bitcoin addressparams(Record<string, object>): Additional parametersprotocol(string): Protocol to use (e.g., "alkanes", "runes")marketplaces(list): Marketplaces to include (e.g. ["MagicEden", "Dotswap])
Example:
const quote = await satsTerminal.swapQuote({
amount: "0.00008",
fromToken: "BTC",
toToken: "GOLD DUST",
address: "bc1p4mffk7l9a040dgqrl8spunwkguxn68ldwx848urafar9sj85nnrq9rcvyj",
params: {},
protocol: "alkanes"
});Example Response:
swapPSBT
Get PSBT (Partially Signed Bitcoin Transaction) for the swap.
Parameters:
marketplace(string): Marketplace to use (e.g., "Unisat", "IdClub")swapId(string): Swap ID from quote responseaddress(string): User's Bitcoin addresspublicKey(string): User's public keypaymentAddress(string): Payment addresspaymentPublicKey(string): Payment public keyfeeRate(number): Fee rate (e.g., 3)slippage(number): Slippage tolerance (e.g., 9)themeID?(string | null): Theme ID (optional)protocol(string): Protocol to use
Example:
Example Response:
swapSubmit
Submit signed PSBT to complete the swap.
Parameters:
marketplace(string): Marketplace to useswapId(string): Swap ID from PSBT responseaddress(string): User's Bitcoin addresspublicKey(string): User's public keypaymentAddress(string): Payment addresspaymentPublicKey(string): Payment public keyprotocol(string): Protocol to usesignedPsbts(string[]): Array of signed PSBT hex strings
Example:
Example Response:
signIn
Register and authenticate a user with their Bitcoin and Ordinals addresses.
Parameters:
ord_address(string): Ordinals addressbtc_address(string): Bitcoin addressord_public_key(string): Ordinals public keybtc_public_key(string): Bitcoin public keyprovider(string): Wallet provider (e.g., 'xverse', 'unisat')
Example:
bind
Bind a user's wallet to Unisat and DotSwap. This is required only once before performing transactions.
Parameters:
btcAddress(string): Bitcoin addressnftAddress(string): Ordinals addresssign(string): User's signature of the bind message
Example:
points
Get the user's accumulated Amber points balance.
Parameters:
ord_address(string): Ordinals address
Example:
search
Search for runes by name.
Parameters:
rune_name(string): The name of the rune to search forsell(boolean, optional): Whether to search for sell orders
Example:
popularCollections
Fetch popular rune collections.
Example:
Last updated