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

Commit e539b1b

Browse files
committed
update api key docs for the wallet adapter
1 parent a3a7a7f commit e539b1b

File tree

1 file changed

+12
-6
lines changed
  • apps/nextra/pages/en/build/sdks/wallet-adapter

1 file changed

+12
-6
lines changed

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ You can use any of the following optional fields.
5858
It is recommended to:
5959

6060
1. Set `autoConnect` to `true`.
61-
2. Set the `dappConfig` with the `network` property set to the network your dapp works with
61+
2. Set the `dappConfig` with:
62+
- The `network` property set to the network your dapp works with
63+
- The `aptosApiKeys` property set to the generated Api Key for the specified network
6264

6365
| Field | Description | Example |
6466
| --- | --- | --- |
6567
| `autoConnect` | A prop indicates whether the dapp should auto connect with the most recently connected wallet on page reload. | `true` |
66-
| `optInWallets` | Limit the list of supported AIP-62 wallets to just the ones with names in optedInWallets. | `['Petra']` |
67-
| `dappConfig` | Specify an alternate network to work on. This prop only works for wallets which are NOT chrome extensions. If set, this object must include the name of the network the app is connected to. The object may include a aptosConnectDappId. | `{ network: 'mainnet', aptosConnectDappId: undefined }` |
68+
| `dappConfig` | Specify an alternate network to work on. This prop only works for wallets which are NOT chrome extensions. If set, this object must include the name of the network the app is connected to. The object may include a aptosConnectDappId. | `{ network: 'mainnet', aptosApiKeys:{}, aptosConnectDappId: undefined }` |
6869
| `onError` | A callback function to fire when the adapter throws an error. | `(error) => { console.log("error", error); }` |
6970

7071
#### Full Example
@@ -79,10 +80,15 @@ export const WalletProvider = ({ children }: PropsWithChildren) => {
7980
return (
8081
<AptosWalletAdapterProvider
8182
autoConnect={true}
82-
dappConfig={{ network: Network.MAINNET }}
83+
dappConfig={{
84+
network: Network.MAINNET,
85+
aptosApiKeys: {
86+
mainnet: process.env.APTOS_API_KEY_MAINNET,
87+
}
88+
}}
8389
onError={(error) => {
84-
console.log("error", error);
85-
}}
90+
console.log("error", error);
91+
}}
8692
>
8793
{children}
8894
</AptosWalletAdapterProvider>

0 commit comments

Comments
 (0)