Monetize

Swap and Sequence Pay

Seamlessly swap eligible currencies in your wallet to a target currency

Available Platforms

Swap tokens and pay in a single transaction

Sequence's Swap and Pay feature allows users to swap any token they own into the required payment token and complete a purchase in a single transaction, creating a seamless user experience.

Users can pay with whatever tokens they have in their wallet without worrying about token conversions

Not connected

13 lines collapsed
14 const onClick = () => {
15 setPending(true);
16 const chainId = 137;
17 const currencyAddress = "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359";
18 const currencyAmount = "2000";
19 const contractAbiInterface = new ethers.Interface(["function demo()"]);
20 const data = contractAbiInterface.encodeFunctionData(
21 "demo",
22 [],
23 ) as `0x${string}`;
24 const swapModalSettings: SwapModalSettings = {
25 onSuccess: (txHash) => {
26 setPending(false);
27 console.log("swap successful!");
28 setData(txHash as `0x${string}`);
29 props.setData(txHash as `0x${string}`);
30 },
31 chainId,
32 currencyAddress,
33 currencyAmount,
34 postSwapTransactions: [
35 {
36 to: "0x37470dac8a0255141745906c972e414b1409b470",
37 data,
38 },
39 ],
40 title: "Swap and Pay",
41 description: "Select a token in your wallet to swap to 0.2 USDC.",
42 };
43 openSwapModal(swapModalSettings);
44 };
22 lines collapsed