@aptos-labs/wallet-adapter-react 7.2.7 → 8.0.0-xchaininit.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/dist/WalletProvider.d.ts.map +1 -1
- package/dist/chunk-3I6M53FQ.mjs +1111 -0
- package/dist/chunk-YWCJOTGX.mjs +58 -0
- package/dist/dist-DBDEL5XP.mjs +36251 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -0
- package/dist/index.mjs.map +1 -1
- package/dist/main-MZZKSUYR.mjs +35 -0
- package/package.json +16 -4
- package/src/WalletProvider.tsx +42 -11
- package/src/index.tsx +2 -0
package/README.md
CHANGED
|
@@ -105,6 +105,53 @@ import { Network } from "@aptos-labs/ts-sdk";
|
|
|
105
105
|
</AptosWalletAdapterProvider>
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
+
### Cross-Chain Wallet Support
|
|
109
|
+
|
|
110
|
+
The adapter supports cross-chain wallets, allowing users to connect with Solana or EVM wallets and derive an Aptos account from them. This enables users to interact with your Aptos dapp using wallets they already have.
|
|
111
|
+
|
|
112
|
+
#### Install Cross-Chain Dependencies
|
|
113
|
+
|
|
114
|
+
Cross-chain support requires additional packages. Install only the ones you need:
|
|
115
|
+
|
|
116
|
+
**For Solana wallet support:**
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pnpm add @aptos-labs/derived-wallet-solana
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**For EVM wallet support (Ethereum, Polygon, etc.):**
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pnpm add @aptos-labs/derived-wallet-ethereum
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### Enable Cross-Chain Wallets
|
|
129
|
+
|
|
130
|
+
Enable cross-chain support by adding the `crossChainWallets` config:
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import { Network } from "@aptos-labs/ts-sdk";
|
|
134
|
+
|
|
135
|
+
<AptosWalletAdapterProvider
|
|
136
|
+
autoConnect={true}
|
|
137
|
+
dappConfig={{
|
|
138
|
+
network: Network.MAINNET,
|
|
139
|
+
aptosApiKey: "my-generated-api-key",
|
|
140
|
+
crossChainWallets: {
|
|
141
|
+
solana: true, // Enable Solana wallet support
|
|
142
|
+
evm: true, // Enable EVM wallet support
|
|
143
|
+
},
|
|
144
|
+
}}
|
|
145
|
+
onError={(error) => {
|
|
146
|
+
console.log("error", error);
|
|
147
|
+
}}
|
|
148
|
+
>
|
|
149
|
+
<App />
|
|
150
|
+
</AptosWalletAdapterProvider>;
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
When enabled, compatible wallets like Phantom (Solana), MetaMask (Ethereum), and others will appear in the wallet list. Users can connect with these wallets, and the adapter will derive an Aptos account for them.
|
|
154
|
+
|
|
108
155
|
#### Use Wallet
|
|
109
156
|
|
|
110
157
|
On any page you want to use the wallet props, import `useWallet` from `@aptos-labs/wallet-adapter-react`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletProvider.d.ts","sourceRoot":"","sources":["../src/WalletProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,UAAU,EAEV,aAAa,EAUb,UAAU,EAOX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,EAAE,EAA4C,MAAM,OAAO,CAAC;AAGhF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC/C,WAAW,CAAC,EACR,OAAO,GACP,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACrE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,gBA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