|
2 | 2 | title: "X-Chain Accounts" |
3 | 3 | --- |
4 | 4 |
|
5 | | -import { Callout } from "nextra/components"; |
| 5 | +import { Callout, Steps } from "nextra/components"; |
6 | 6 |
|
7 | 7 | # X-Chain Accounts |
8 | 8 |
|
@@ -43,40 +43,55 @@ In the Wallet Adapter, the `accountIdentity` is based on the original x-chain ac |
43 | 43 |
|
44 | 44 | ### How to integrate x-chain accounts in my dApp? |
45 | 45 |
|
46 | | -Make sure you integrate with the Aptos Wallet Adapter by following these [steps](./dapp.mdx) |
| 46 | +The wallet adapter follows the [Solana Wallet Standard](https://github.com/wallet-standard/wallet-standard/blob/master/DESIGN.md) to discover wallets. |
| 47 | +Currently, the wallets that have been tested and support cross-chain accounts are: |
| 48 | + |
| 49 | +| | Aptos Devnet | Aptos Testnet | Aptos Mainnet | |
| 50 | +|----------|--------------|---------------|---------------| |
| 51 | +| Phantom | ✅ | | |
| 52 | +| Solflare | ✅ | | |
| 53 | +| Backpack | ✅ | | |
| 54 | +| OKX | ✅ | | |
| 55 | + |
| 56 | + |
| 57 | +<Callout> |
| 58 | + 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) |
| 59 | +</Callout> |
47 | 60 |
|
48 | 61 | Supporting x-chain accounts in a dApp requires only a 2-step installation process. |
49 | 62 |
|
| 63 | +<Steps> |
| 64 | + |
| 65 | +### Install the `@aptos-labs/derived-wallet-solana` package |
| 66 | + |
50 | 67 | ```bash |
51 | 68 | npm install @aptos-labs/derived-wallet-solana |
52 | 69 | ``` |
53 | 70 |
|
| 71 | +### Import the `setupAutomaticSolanaWalletDerivation` function |
| 72 | + |
54 | 73 | Once you have installed the `@aptos-labs/derived-wallet-solana` package, you can import and use it. |
55 | 74 | In the same file where you import the other wallets, such as `WalletProvider.tsx`, you can add the following: |
56 | 75 |
|
57 | | -```ts |
| 76 | +```tsx filename="WalletProvider.tsx" |
58 | 77 | import { setupAutomaticSolanaWalletDerivation } from "@aptos-labs/derived-wallet-solana"; |
59 | 78 |
|
60 | | -setupAutomaticSolanaWalletDerivation({ defaultNetwork: Network.TESTNET }); // this is the Aptos network your dapp is working with |
| 79 | +setupAutomaticSolanaWalletDerivation({ defaultNetwork: Network.DEVNET }); // this is the Aptos network your dapp is working with |
61 | 80 |
|
62 | 81 | ..... |
63 | 82 |
|
64 | 83 | <AptosWalletAdapterProvider |
65 | 84 | dappConfig={{ |
66 | | - network: Network.TESTNET, |
| 85 | + network: Network.DEVNET, |
67 | 86 | }} |
68 | 87 | > |
69 | 88 | {children} |
70 | 89 | <AptosWalletAdapterProvider/> |
71 | 90 | ``` |
| 91 | +</Steps> |
72 | 92 |
|
73 | 93 | That will handle the logic and implementation to include the x-chain accounts as if they were Aptos wallets. |
74 | 94 |
|
75 | | -<Callout> |
76 | | - It is highly recommended to use the `@aptos-labs/wallet-adapter-react` package for the best experience. |
77 | | -</Callout> |
78 | | - |
79 | | - |
80 | 95 | #### Submitting a transaction |
81 | 96 |
|
82 | 97 | 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. |
|
0 commit comments