diff --git a/apps/nextra/pages/en/build/sdks/wallet-adapter/x-chain-accounts.mdx b/apps/nextra/pages/en/build/sdks/wallet-adapter/x-chain-accounts.mdx index 5bbd4647a..d9fe5b51e 100644 --- a/apps/nextra/pages/en/build/sdks/wallet-adapter/x-chain-accounts.mdx +++ b/apps/nextra/pages/en/build/sdks/wallet-adapter/x-chain-accounts.mdx @@ -2,7 +2,7 @@ title: "X-Chain Accounts" --- -import { Callout } from "nextra/components"; +import { Callout, Steps } from "nextra/components"; # X-Chain Accounts @@ -43,40 +43,55 @@ In the Wallet Adapter, the `accountIdentity` is based on the original x-chain ac ### How to integrate x-chain accounts in my dApp? -Make sure you integrate with the Aptos Wallet Adapter by following these [steps](./dapp.mdx) +The wallet adapter follows the [Solana Wallet Standard](https://github.com/wallet-standard/wallet-standard/blob/master/DESIGN.md) to discover wallets. +Currently, the wallets that have been tested and support cross-chain accounts are: + +| | Aptos Devnet | Aptos Testnet | Aptos Mainnet | +|----------|--------------|---------------|---------------| +| Phantom | ✅ | | +| Solflare | ✅ | | +| Backpack | ✅ | | +| OKX | ✅ | | + + + + It is highly recommended to use the `@aptos-labs/wallet-adapter-react` package for the best experience. Make sure you integrate with the Aptos Wallet Adapter by following these [steps](./dapp.mdx) + Supporting x-chain accounts in a dApp requires only a 2-step installation process. + + +### Install the `@aptos-labs/derived-wallet-solana` package + ```bash npm install @aptos-labs/derived-wallet-solana ``` +### Import the `setupAutomaticSolanaWalletDerivation` function + Once you have installed the `@aptos-labs/derived-wallet-solana` package, you can import and use it. In the same file where you import the other wallets, such as `WalletProvider.tsx`, you can add the following: -```ts +```tsx filename="WalletProvider.tsx" import { setupAutomaticSolanaWalletDerivation } from "@aptos-labs/derived-wallet-solana"; -setupAutomaticSolanaWalletDerivation({ defaultNetwork: Network.TESTNET }); // this is the Aptos network your dapp is working with +setupAutomaticSolanaWalletDerivation({ defaultNetwork: Network.DEVNET }); // this is the Aptos network your dapp is working with ..... {children} ``` + That will handle the logic and implementation to include the x-chain accounts as if they were Aptos wallets. - - It is highly recommended to use the `@aptos-labs/wallet-adapter-react` package for the best experience. - - - #### Submitting a transaction In most cases, allowing users to submit a transaction with a x-chain account to the Aptos chain requires using a sponsor transaction. This is because the x-chain account might not have APT to pay for gas.