import {
fetchLimitQuote,
toBaseUnits,
getLimitOrderStatus,
fetchInboundAddress,
buildCancelMemo,
getCancelVaultAddress,
} from "leokit-sdk";
// Quote first (no on-chain action)
const quote = await fetchLimitQuote({
fromAsset: "ETH.ETH",
toAsset: "BTC.BTC",
amount: "1000000000000000000",
targetPrice: "0.05",
protocol: "thorchain",
});
// Inbound vault (where the user must deposit)
const vault = await fetchInboundAddress("thorchain", "ETH");
// After broadcasting, check status
const status = await getLimitOrderStatus(quote.quoteId);
// LimitOrderStatus { state: "open" | "filled" | "cancelled", ... }
// To cancel manually
const memo = buildCancelMemo({ orderId, protocol: "thorchain" });
const cancelVault = getCancelVaultAddress("thorchain"); // chain-specific
// Sign + broadcast a transaction with `memo` to `cancelVault`