- )
-}
-
-export default SwapList
-```
-
-## Return Type: `UseQueryResult`
-
-The hook returns all properties from React Query's `UseQueryResult` with swap routes data. Here's the detailed structure of the `LifiSwapRoute` object:
-
-```tsx
-interface LifiToken {
- chainId: number;
- address: string;
- symbol: string;
- name: string;
- decimals: number;
- priceUsd: number;
- price?: string;
- coinKey: string;
- logoUri: string;
-}
-
-interface LifiSwapRoute {
- fromChainId: number;
- toChainId: number;
- fromTokens: Array;
- toTokens: Array;
-}
-```
-
-### Properties
-
-#### data
-
-`LifiSwapRoute[] | undefined`
-
-Array of swap route objects containing:
-
-##### route
-- `fromChainId`: The chain ID of the token to sell
-- `toChainId`: The chain ID of the token to buy
-- `fromTokens`: Array of tokens that can be used to pay for the swap
-- `toTokens`: Array of tokens that can be received from the swap
-
-#### isLoading
-
-`boolean`
-
-Loading state for the data fetch.
-
-#### isError
-
-`boolean`
-
-Error state indicating if the query failed.
-
-#### error
-
-`Error | null`
-
-Any error that occurred during data fetching.
-
-## Parameters
-
-The hook accepts two parameters:
-
-### args: `UseGetSwapRoutesArgs`
-
-```tsx
-interface UseGetSwapRoutesArgs {
- walletAddress: string
- toTokenAddress: string
- chainId: number
- toTokenAmount: string
-}
-```
-
-| Parameter | Type | Description |
-| --------- | ---- | ----------- |
-| `walletAddress` | `string` | The address of the user's wallet |
-| `toTokenAddress` | `string` | The address of the token to buy |
-| `chainId` | `number` | The chain ID where the swap will occur |
-| `toTokenAmount` | `string` | The amount of token to buy (in wei) |
-
-### options: `HooksOptions`
-
-```tsx
-interface HooksOptions {
- disabled?: boolean
- retry?: boolean
-}
-```
-
-| Parameter | Type | Description |
-| --------- | ---- | ----------- |
-| `disabled` | `boolean` | (Optional) Disable the query from automatically running |
-| `retry` | `boolean` | (Optional) Whether to retry failed queries (defaults to true) |
-
-## Additional Notes
-
-- This hook uses React Query to fetch and cache swap routes from the Sequence API.
-- Stale time is set to one hour by default to avoid refreshing quotes while the user is completing transactions.
-- This hook will not return "fromTokens" that the user does not have in their wallet.
diff --git a/sdk/web/wallet-sdk/embedded/guides/checkout.mdx b/sdk/web/wallet-sdk/embedded/guides/checkout.mdx
deleted file mode 100644
index 199956f2..00000000
--- a/sdk/web/wallet-sdk/embedded/guides/checkout.mdx
+++ /dev/null
@@ -1,156 +0,0 @@
----
-
-title: "Checkout Modal"
-description: The Checkout Modal provides developers with an easy way to implement cryptocurrency payments.
-sidebarTitle: Checkout Modal
----
-
-Sequence Checkout allows users to easily purchase an ERC721 or ERC1155 token with a primary or secondary sales contract such as a marketplace, with the following payment options:
- - Purchase with any cryptocurrency in the wallet.
- - Receive funds from another wallet to a Sequence wallet and purchase.
- - Pay using a credit or debit card which will intelligently detect the correct provider for each region, chain and currency.
- - Pay with another cryptocurrency in a wallet by doing an automated swap and purchase.
-
-We have an integrated checkout flow that you can leverage by installing the dedicated library `@0xsequence/checkout` and using it in conjunction with `@0xsequence/connect`.
-
-
-
-
-
-In order to enable credit card payments for checkout, please get in touch with the Sequence team as your contract address will need to be allowlisted and go through a KYB process for your organization. Credit card payments only work on various networks mainnets
-
-
-# Installation and Setup
-To integrate the checkout feature, follow these steps:
-
-
-
-
-```bash
-npm install @0xsequence/checkout
-# or
-pnpm install @0xsequence/checkout
-# or
-yarn add @0xsequence/checkout
-```
-
-
-
-
-```jsx
-import { SequenceCheckoutProvider } from '@0xsequence/checkout'
-import { SequenceConnect } from '@0xsequence/connect'
-import { config } from './config'
-
-const App = () => {
- return (
-
-
-
-
-
- )
-}
-```
-
-
-
-Now we have the setup done, let's see how to use the checkout modal for different use cases.
-
- ## Custom Contract
- We instantiate the `useSelectPaymentModal` hook to open the checkout modal and pass a settings object. In addition, for custom contracts, you can specify a contract ABI along with encoding the call data, in this case we are using `ethers` and `viem`'s `encodeFunctionData` utility.
-
- ```tsx
- import { useAccount } from 'wagmi'
- import { useSelectPaymentModal, type SelectPaymentSettings } from '@0xsequence/checkout'
- import { toHex } from 'viem'
- import { encodeFunctionData } from 'viem'
-
- const MyComponent = () => {
- const { address } = useAccount()
- const { openSelectPaymentModal } = useSelectPaymentModal()
-
- const onClick = () => {
- if (!address) {
- return
- }
-
- const currencyAddress = '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359'
- const salesContractAddress = '0xe65b75eb7c58ffc0bf0e671d64d0e1c6cd0d3e5b'
- const collectionAddress = '0xdeb398f41ccd290ee5114df7e498cf04fac916cb'
- const price = '20000'
-
- const chainId = 137
-
- const erc1155SalesContractAbi = [
- {
- type: 'function',
- name: 'mint',
- inputs: [
- { name: 'to', type: 'address', internalType: 'address' },
- { name: 'tokenIds', type: 'uint256[]', internalType: 'uint256[]' },
- { name: 'amounts', type: 'uint256[]', internalType: 'uint256[]' },
- { name: 'data', type: 'bytes', internalType: 'bytes' },
- { name: 'expectedPaymentToken', type: 'address', internalType: 'address' },
- { name: 'maxTotal', type: 'uint256', internalType: 'uint256' },
- { name: 'proof', type: 'bytes32[]', internalType: 'bytes32[]' }
- ],
- outputs: [],
- stateMutability: 'payable'
- }
- ]
-
- const collectibles = [
- {
- tokenId: '1',
- quantity: '1'
- }
- ]
-
- const purchaseTransactionData = encodeFunctionData({
- abi: erc1155SalesContractAbi,
- functionName: 'mint',
- args: [
- address,
- collectibles.map(c => BigInt(c.tokenId)),
- collectibles.map(c => BigInt(c.quantity)),
- toHex(0),
- currencyAddress,
- price,
- [toHex(0, { size: 32 })]
- ]
- })
-
- const selectPaymentModalSettings: SelectPaymentSettings = {
- collectibles: [
- {
- tokenId: '1',
- quantity: '1'
- }
- ],
- chain: chainId,
- price,
- targetContractAddress: salesContractAddress,
- recipientAddress: address,
- currencyAddress,
- collectionAddress,
- creditCardProviders: ['transak'],
- copyrightText: 'ⓒ2024 Sequence',
- onSuccess: (txnHash: string) => {
- console.log('success!', txnHash)
- },
- onError: (error: Error) => {
- console.error(error)
- },
- txData: purchaseTransactionData,
- }
-
- openSelectPaymentModal(selectPaymentModalSettings)
- }
-
- return
- }
-```
-
-Congratulations! You’ve just learned how to use the Checkout Modal with Web SDK.
-
diff --git a/sdk/web/wallet-sdk/embedded/guides/on-ramp-and-swap.mdx b/sdk/web/wallet-sdk/embedded/guides/on-ramp-and-swap.mdx
deleted file mode 100644
index eb387bb2..00000000
--- a/sdk/web/wallet-sdk/embedded/guides/on-ramp-and-swap.mdx
+++ /dev/null
@@ -1,120 +0,0 @@
----
-
-title: "On-ramp and Swap to a custom token"
-description: On-ramp to a supported token and swap to your own custom token.
-sidebarTitle: On-ramp and Swap to a custom token
----
-
-Most of the well known tokens are already supported but for some cases you might want your users to be able to swap to a custom token.
-This example will show you how to do that in two steps using our web SDK.
-
-## Integration
-To integrate the on-ramp and swap to a custom token, follow these steps:
-
-
-
-
- Make sure you completed the [Getting Started](/sdk/web/wallet-sdk/embedded/getting-started) guide.
-
-
-
- Complete the [On-ramp](/sdk/web/wallet-sdk/embedded/guides/on-ramp) guide
-
-
-
-After the on-ramp is successful, we can use the `onOrderSuccessful` callback to update the state of the app.
-
-```tsx
- import { useState } from 'react'
- import { useAddFundsModal } from '@0xsequence/checkout'
- import { useAccount } from 'wagmi'
-
- export const OnRampAndSwap = () => {
- const { triggerAddFunds: toggleAddFunds } = useAddFundsModal()
- const { address: smartWalletAddress } = useAccount()
- const [canSwap, setCanSwap] = useState(true)
-
- const onTriggerAddFunds = () => {
- if (smartWalletAddress) {
- toggleAddFunds({
- walletAddress: smartWalletAddress,
- onOrderSuccessful(data) {
- console.log('Order successful', data)
- setCanSwap(true)
- },
- })
- }
- }
-
- return (
- <>
-
- >
- )
- }
-```
-
-
-
-Once the on-ramp is successful, we can use the `useSwapModal` hook to swap the purchased token to your own custom token.
-
-It will take a few minutes (1-3 minutes) for the on-ramped token to be available in the smart wallet so make sure to check the balance before opening the swap modal.
-If you have enough balance of a supported payment token, the modal will display it as a payment option, you don't need to specify a payment token.
-
-
- Make sure your custom token has enough liquidity on the chain you are executing the swap on.
-
-
-```tsx
- import { useState } from 'react'
- import { SwapModalSettings, useAddFundsModal, useSwapModal } from '@0xsequence/checkout'
- import { useAccount } from 'wagmi'
-
- export const OnRampAndSwap = () => {
- const { triggerAddFunds: toggleAddFunds } = useAddFundsModal()
- const { openSwapModal } = useSwapModal()
- const { address: smartWalletAddress, chainId } = useAccount()
- const [canSwap, setCanSwap] = useState(true)
-
- const toTokenAmount = '10000000000' // amount in wei
- const toTokenAddress = '0x...' // custom token address
-
- const onTriggerAddFunds = () => {
- if (smartWalletAddress) {
- toggleAddFunds({
- walletAddress: smartWalletAddress,
- onOrderSuccessful(data) {
- console.log('Order successful', data)
- setCanSwap(true)
- },
- })
- }
- }
-
- const onSwap = () => {
- const swapModalSettings: SwapModalSettings = {
- onSuccess: () => {
- console.log('Swap successful')
- },
- chainId,
- toTokenAddress,
- toTokenAmount,
- title: `Buy our custom token`,
- description: 'Choose your payment method'
- }
-
- openSwapModal(swapModalSettings)
- }
-
- return (
- <>
- {canSwap ? : }
- >
- )
- }
-```
-
-
-
-Congratulations! You’ve just learned how to on-ramp and swap to a custom token using Web SDK.
-
diff --git a/sdk/web/wallet-sdk/embedded/guides/on-ramp.mdx b/sdk/web/wallet-sdk/embedded/guides/on-ramp.mdx
deleted file mode 100644
index fd024731..00000000
--- a/sdk/web/wallet-sdk/embedded/guides/on-ramp.mdx
+++ /dev/null
@@ -1,95 +0,0 @@
----
-
-title: "On-ramp Overview"
-description: The checkout on-ramp modal in Web SDK allows developers to easily onboard users with fiat currency into cryptocurrency using a credit card.
-sidebarTitle: On-ramp
----
-
-With this integration, one can use a credit card to purchase tokens across many different networks.
-
-
-
-
-
-## Integration
-To integrate the on-ramp feature, follow these steps:
-
-
-
-
- Make sure you completed the [Getting Started](/sdk/web/wallet-sdk/embedded/getting-started) guide.
-
-
-
-
-```bash
-npm install @0xsequence/checkout
-# or
-pnpm install @0xsequence/checkout
-# or
-yarn add @0xsequence/checkout
-```
-
-
-
-
-```jsx
-import { SequenceCheckoutProvider } from '@0xsequence/checkout'
-import { SequenceConnect } from '@0xsequence/connect'
-import { config } from './config'
-
-const App = () => {
- return (
-
-
-
-
-
- )
-}
-```
-
-
-
-Call the `triggerAddFunds` function to cause a modal to appear
-
-```js
- import { useAddFundsModal } from '@0xsequence/checkout'
- import { useAccount } from 'wagmi'
-
- const MyComponent = () => {
- const { address: recipientAddress } = useAccount()
- const { triggerAddFunds: toggleAddFunds } = useAddFundsModal()
-
- const onClick = () => {
- toggleAddFunds({
- walletAddress: recipientAddress,
- })
- }
-
- return (
-
- )
- }
-```
-
-
-
-Congratulations! You’ve just learned how to add funds to your wallet using Web SDK.
-
-# Configuration Overview
-
-The following is the available configuration customization options for toggleAddFunds params
-
-```ts
-interface AddFundsSettings {
- walletAddress: string | Hex // Address of the wallet where funds will be added
- fiatAmount?: string // Specify the amount in fiat to add
- fiatCurrency?: string // Specify the fiat currency (e.g., USD, EUR)
- defaultFiatAmount?: string // Default amount in fiat to add
- defaultCryptoCurrency?: string // Default cryptocurrency to use (e.g., ETH, BTC)
- cryptoCurrencyList?: string // List of cryptocurrencies available for selection. Example: "USDT,BTC,USDC"
- networks?: string // Specify network(s) to use for the transaction. Example: "mainnet,ethereum"
- onClose?: () => void // Callback function to execute when the modal is closed
-}
-```
\ No newline at end of file
diff --git a/sdk/web/wallet-sdk/embedded/guides/smart-swaps.mdx b/sdk/web/wallet-sdk/embedded/guides/smart-swaps.mdx
deleted file mode 100644
index 8ee01fa2..00000000
--- a/sdk/web/wallet-sdk/embedded/guides/smart-swaps.mdx
+++ /dev/null
@@ -1,119 +0,0 @@
----
-
-title: "Smart Swaps"
-description: Sequence Smart Swaps auto detects eligible currencies in the user's wallet and swaps them to the target currency. Developers can define the target currency and Sequence will handle everything, including the UI and flow through Web SDK.
-sidebarTitle: Smart Swaps
----
-
-The power of smart swaps is intelligently detecting the currencies available to the user as well as batching multiple transactions together to if the user is utilizing a Sequence wallet to simplify the UX. You can say goodbye to separate `approve` and `transfer` transactions!
-
-
-
-
-
-If you intend to use smart swaps with your custom token, please ensure you provide sufficient liquidity for your token (preferably USDC, USDT, or ETH) on a supported DEX such as Uniswap.
-
-
-Smart Swaps are only supported on mainnets, such as:
-
-- Ethereum
-- Arbitrum
-- Avalanche
-- Base
-- Blast
-- BSC
-- Optimism
-- Polygon
-- ...
-
-Here are some of our supported liquidity pool providers:
-
-`UniSwap` `SushiSwap` `Pancake Swap` `Curve` `Balancer` `Bancor` `Synapse` `Solidly`
-
-# Installation and Setup
-To integrate the Swap feature with Web SDK, follow these steps:
-
-
-
-
-```bash
-npm install @0xsequence/checkout
-# or
-pnpm install @0xsequence/checkout
-# or
-yarn add @0xsequence/checkout
-```
-
-
-
-
-```jsx
-import { SequenceCheckoutProvider } from '@0xsequence/checkout'
-import { SequenceConnect } from '@0xsequence/connect'
-import { config } from './config'
-
-const App = () => {
- return (
-
-
-
-
-
- )
-}
-```
-
-
-
-
-- `toTokenAddress`: The target currency address, this is the token the user will receive after the swap.
-- `toTokenAmount`: The target currency amount, this is the amount the user will receive after the swap.
-- `postSwapTransactions`: An optional array of transactions to be executed after the swap, using the swapped tokens.
-- `title`: The modal's title.
-- `description`: A description of the swap and payment process.
-- `chainId`: The chain id of the target currency.
-- `onSuccess`: A callback function that is called when the swap is successful.
-
-```jsx
-import { useSwapModal, type SwapModalSettings } from '@0xsequence/checkout'
-
-const MyComponent = () => {
- const { openSwapModal } = useSwapModal()
-
- const onClick = () => {
- const chainId = 137
- const toTokenAddress = '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359'
- const toTokenAmount = '20000'
-
- const contractAbiInterface = new ethers.Interface(['function demo()']) // Optionally, replace with your contract's abi interface
-
- const data = contractAbiInterface.encodeFunctionData('demo', []) as `0x${string}` // Optionally, replace 'demo' with the function you want to call,
-
- const swapModalSettings: SwapModalSettings = {
- onSuccess: () => {
- console.log('swap successful!')
- },
- chainId,
- toTokenAddress,
- toTokenAmount,
- postSwapTransactions: [ // Optionally, replace with the transaction you would like to execute after the swap has taken place.
- {
- to: '0x37470dac8a0255141745906c972e414b1409b470',
- data
- }
- ],
- title: 'Swap and Pay',
- description: 'Select a token in your wallet to swap to 0.2 USDC.'
- }
-
- openSwapModal(swapModalSettings)
- }
-
- return
-}
-```
-
-
-
-Congratulations! You’ve just learned how to use smart swaps with Web SDK.
-