Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 6af0e80

Browse files
committed
update docs for fetching wallets in the wallet adapter
1 parent 5402d78 commit 6af0e80

File tree

1 file changed

+59
-0
lines changed
  • apps/nextra/pages/en/build/sdks/wallet-adapter

1 file changed

+59
-0
lines changed

apps/nextra/pages/en/build/sdks/wallet-adapter/dapp.mdx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,65 @@ See the next.js example dapp for a demonstration of how these components are use
152152
- [Live site](https://aptos-labs.github.io/aptos-wallet-adapter/)
153153
- [Source code](https://github.com/aptos-labs/aptos-wallet-adapter/tree/main/apps/nextjs-example)
154154

155+
### `wallets`
156+
157+
`wallets` is a list of available wallets, including standard supported ones, each with name, URL, icon, readiness state, and AIP62 standard compliance indication.
158+
159+
```tsx filename="WalletDisplayDemo.tsx"
160+
import { useWallet } from '@aptos-labs/wallet-adapter-react';
161+
162+
const displayInstalledWalletsDemo = () => {
163+
164+
const { wallets } = useWallet();
165+
166+
return (
167+
<div>
168+
{wallets.map(wallet => {
169+
return <p>{wallet.name}</p>
170+
})}
171+
</div>
172+
)
173+
}
174+
```
175+
176+
#### Support for Uninstalled Wallets
177+
178+
Following AIP-62, the adapter uses an event-based communication model between a wallet and a dapp. This means only wallets installed in the user's browser are detected automatically and available for use.
179+
To support the full Aptos wallet ecosystem, the adapter maintains a registry of supported wallets—allowing dapps to also display uninstalled wallets. It also exposes a utility function to easily manage all wallets.
180+
181+
```tsx filename="WalletDisplayDemo.tsx"
182+
import { groupAndSortWallets } from '@aptos-labs/wallet-adapter-react';
183+
import { useWallet } from '@aptos-labs/wallet-adapter-react';
184+
185+
const displayAllWalletsDemo = () => {
186+
187+
const { wallets = [], notDetectedWallets = [] } = useWallet();
188+
189+
const { aptosConnectWallets, availableWallets, installableWallets } =
190+
groupAndSortWallets(
191+
[...wallets, ...notDetectedWallets]
192+
);
193+
194+
return (
195+
<div>
196+
/** Wallets that use social login to create an account on the blockchain */
197+
{aptosConnectWallets.map((aptosConnectwallet) => (
198+
return <p>{aptosConnectwallet.name}</p>
199+
))}
200+
/** Wallets that are currently installed or loadable. */
201+
{availableWallets.map((availableWallet) => (
202+
return <p>{availableWallet.name}</p>
203+
))}
204+
/** Wallets that are NOT currently installed or loadable. */
205+
{installableWallets.map((installableWallet) => (
206+
return <p>{installableWallet.name}</p>
207+
))}
208+
</div>
209+
)
210+
}
211+
```
212+
213+
155214
### `connect()` and `disconnect()`
156215

157216
`connect()` establishes a connection between the dapp and a Wallet. You can then use `disconnect()` to

0 commit comments

Comments
 (0)