Skip to content

Commit 2c6ba4b

Browse files
authored
add Sui support to the cross chain docs (#386)
* add Sui support to the cross chain docs * address comments * correct nano-staged remark command to process only staged files * address comments
1 parent e3a5b8d commit 2c6ba4b

File tree

3 files changed

+72
-14
lines changed

3 files changed

+72
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"prettier --write"
156156
],
157157
"src/content/**/*.mdx": [
158-
"remark \"src/content/**/*.{md,mdx}\" --output"
158+
"remark --output --"
159159
]
160160
}
161161
}

src/content/docs/build/sdks/wallet-adapter/x-chain-accounts.mdx

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ The computation of the DAA address is done using the `authenticationFunction` an
3838

3939
### How to integrate x-chain accounts in my dApp?
4040

41-
Currently, the adapter supports Solana and EVM chains
42-
4341
<Aside type="note">
4442
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](/build/sdks/wallet-adapter/dapp)
4543
</Aside>
@@ -89,10 +87,10 @@ Currently, the adapter supports Solana and EVM chains
8987
}}
9088
>
9189
{children}
92-
<AptosWalletAdapterProvider/>
90+
</AptosWalletAdapterProvider>
9391
```
9492

95-
3. Set crossChainWallets dapp config prop to true fot the AptosWalletAdapterProvider
93+
3. Set crossChainWallets dapp config prop to true for the AptosWalletAdapterProvider
9694

9795
```tsx filename="WalletProvider.tsx"
9896
<AptosWalletAdapterProvider
@@ -102,7 +100,7 @@ Currently, the adapter supports Solana and EVM chains
102100
}}
103101
>
104102
{children}
105-
<AptosWalletAdapterProvider/>
103+
</AptosWalletAdapterProvider>
106104
```
107105
</Steps>
108106
</TabItem>
@@ -149,7 +147,69 @@ Currently, the adapter supports Solana and EVM chains
149147
}}
150148
>
151149
{children}
152-
<AptosWalletAdapterProvider/>
150+
</AptosWalletAdapterProvider>
151+
```
152+
153+
3. Set crossChainWallets dapp config prop to true fot the AptosWalletAdapterProvider
154+
155+
```tsx filename="WalletProvider.tsx"
156+
<AptosWalletAdapterProvider
157+
dappConfig={{
158+
network: Network.TESTNET,
159+
crossChainWallets: true,
160+
}}
161+
>
162+
{children}
163+
</AptosWalletAdapterProvider>
164+
```
165+
</Steps>
166+
</TabItem>
167+
168+
{/* Sui */}
169+
170+
<TabItem label="Sui">
171+
The wallet adapter follows the [Sui Wallet Standard](https://docs.sui.io/standards/wallet-standard) to discover wallets.
172+
Currently, the wallets that have been tested and support cross-chain accounts are:
173+
174+
| | Aptos Devnet | Aptos Testnet | Aptos Mainnet |
175+
| ------------ | ------------ | ------------- | ------------- |
176+
| Backpack ||||
177+
| Bitget ||||
178+
| Ethos ||||
179+
| Nightly ||||
180+
| OKX ||||
181+
| Phantom ||||
182+
| Slush ||||
183+
| Trust Wallet ||||
184+
185+
Supporting x-chain accounts in a dApp requires only a 2-step installation process.
186+
187+
<Steps>
188+
1. Install the @aptos-labs/derived-wallet-sui package
189+
190+
```shellscript
191+
npm install @aptos-labs/derived-wallet-sui
192+
```
193+
194+
2. Import the setupAutomaticSuiWalletDerivation function
195+
196+
Once you have installed the `@aptos-labs/derived-wallet-sui` package, you can import and use it.
197+
In the same file where you import the other wallets, such as `WalletProvider.tsx`, you can add the following:
198+
199+
```tsx filename="WalletProvider.tsx"
200+
import { setupAutomaticSuiWalletDerivation } from "@aptos-labs/derived-wallet-sui";
201+
202+
setupAutomaticSuiWalletDerivation({ defaultNetwork: Network.TESTNET }); // this is the Aptos network your dapp is working with
203+
204+
...
205+
206+
<AptosWalletAdapterProvider
207+
dappConfig={{
208+
network: Network.TESTNET,
209+
}}
210+
>
211+
{children}
212+
</AptosWalletAdapterProvider>
153213
```
154214

155215
3. Set crossChainWallets dapp config prop to true fot the AptosWalletAdapterProvider
@@ -162,7 +222,7 @@ Currently, the adapter supports Solana and EVM chains
162222
}}
163223
>
164224
{children}
165-
<AptosWalletAdapterProvider/>
225+
</AptosWalletAdapterProvider>
166226
```
167227
</Steps>
168228
</TabItem>

src/content/docs/es/build/sdks/wallet-adapter/x-chain-accounts.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ El cálculo de la dirección DAA se hace usando la `authenticationFunction` y la
3939

4040
### ¿Cómo integrar cuentas x-chain en mi dApp?
4141

42-
Actualmente, el adaptador soporta cadenas Solana y EVM
43-
4442
<Aside type="note">
4543
Se recomienda altamente usar el paquete `@aptos-labs/wallet-adapter-react` para la mejor experiencia. Asegúrate de integrar con el Adaptador de Wallet de Aptos siguiendo estos [pasos](/es/build/sdks/wallet-adapter/dapp)
4644
</Aside>
@@ -86,7 +84,7 @@ Actualmente, el adaptador soporta cadenas Solana y EVM
8684
}}
8785
>
8886
{children}
89-
<AptosWalletAdapterProvider/>
87+
</AptosWalletAdapterProvider>
9088
```
9189

9290
3. Establecer la prop crossChainWallets dapp config a true para el AptosWalletAdapterProvider
@@ -99,7 +97,7 @@ Actualmente, el adaptador soporta cadenas Solana y EVM
9997
}}
10098
>
10199
{children}
102-
<AptosWalletAdapterProvider/>
100+
</AptosWalletAdapterProvider>
103101
```
104102
</Steps>
105103
</TabItem>
@@ -146,7 +144,7 @@ Actualmente, el adaptador soporta cadenas Solana y EVM
146144
}}
147145
>
148146
{children}
149-
<AptosWalletAdapterProvider/>
147+
</AptosWalletAdapterProvider>
150148
```
151149

152150
3. Set crossChainWallets dapp config prop to true fot the AptosWalletAdapterProvider
@@ -159,7 +157,7 @@ Actualmente, el adaptador soporta cadenas Solana y EVM
159157
}}
160158
>
161159
{children}
162-
<AptosWalletAdapterProvider/>
160+
</AptosWalletAdapterProvider>
163161
```
164162
</Steps>
165163
</TabItem>

0 commit comments

Comments
 (0)