@aptos-labs/wallet-adapter-react 3.8.0 → 4.0.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/dist/index.mjs CHANGED
@@ -2,10 +2,13 @@
2
2
  export * from "@aptos-labs/wallet-adapter-core";
3
3
 
4
4
  // src/WalletProvider.tsx
5
- import { useCallback, useEffect, useState } from "react";
5
+ import {
6
+ WalletCore
7
+ } from "@aptos-labs/wallet-adapter-core";
8
+ import { useState, useEffect, useCallback } from "react";
6
9
 
7
10
  // src/useWallet.tsx
8
- import { createContext, useContext } from "react";
11
+ import { useContext, createContext } from "react";
9
12
  var DEFAULT_CONTEXT = {
10
13
  connected: false
11
14
  };
@@ -21,7 +24,6 @@ function useWallet() {
21
24
  }
22
25
 
23
26
  // src/WalletProvider.tsx
24
- import { WalletCore } from "@aptos-labs/wallet-adapter-core";
25
27
  import { jsx } from "react/jsx-runtime";
26
28
  var initialState = {
27
29
  connected: false,
@@ -31,30 +33,39 @@ var initialState = {
31
33
  };
32
34
  var AptosWalletAdapterProvider = ({
33
35
  children,
34
- plugins,
35
36
  optInWallets,
36
37
  autoConnect = false,
37
38
  dappConfig,
38
39
  disableTelemetry = false,
39
40
  onError
40
41
  }) => {
41
- const [{ connected, account, network, wallet }, setState] = useState(initialState);
42
+ const [{ account, network, connected, wallet }, setState] = useState(initialState);
42
43
  const [isLoading, setIsLoading] = useState(true);
43
44
  const [walletCore, setWalletCore] = useState();
44
- const [wallets, setWallets] = useState(plugins != null ? plugins : []);
45
+ const [wallets, setWallets] = useState([]);
46
+ const [notDetectedWallets, setNotDetectedWallets] = useState([]);
45
47
  useEffect(() => {
46
48
  const walletCore2 = new WalletCore(
47
- plugins != null ? plugins : [],
48
- optInWallets != null ? optInWallets : [],
49
+ optInWallets,
49
50
  dappConfig,
50
51
  disableTelemetry
51
52
  );
52
53
  setWalletCore(walletCore2);
53
54
  }, []);
54
55
  useEffect(() => {
55
- var _a;
56
+ var _a, _b;
56
57
  setWallets((_a = walletCore == null ? void 0 : walletCore.wallets) != null ? _a : []);
58
+ setNotDetectedWallets((_b = walletCore == null ? void 0 : walletCore.notDetectedWallets) != null ? _b : []);
57
59
  }, [walletCore]);
60
+ useEffect(() => {
61
+ if (autoConnect) {
62
+ if (localStorage.getItem("AptosWalletName") && !connected) {
63
+ connect(localStorage.getItem("AptosWalletName"));
64
+ } else {
65
+ setIsLoading(false);
66
+ }
67
+ }
68
+ }, [autoConnect, wallets]);
58
69
  const connect = async (walletName) => {
59
70
  try {
60
71
  setIsLoading(true);
@@ -76,61 +87,64 @@ var AptosWalletAdapterProvider = ({
76
87
  return Promise.reject(error);
77
88
  }
78
89
  };
79
- const signTransaction = async (transaction, asFeePayer, options) => {
80
- if (!walletCore) {
81
- throw new Error("WalletCore is not initialized");
82
- }
90
+ const signAndSubmitTransaction = async (transaction) => {
83
91
  try {
84
- return await (walletCore == null ? void 0 : walletCore.signTransaction(
85
- transaction,
86
- asFeePayer,
87
- options
88
- ));
92
+ if (!walletCore) {
93
+ throw new Error("WalletCore is not initialized");
94
+ }
95
+ return await walletCore.signAndSubmitTransaction(transaction);
89
96
  } catch (error) {
90
97
  if (onError)
91
98
  onError(error);
92
99
  return Promise.reject(error);
93
100
  }
94
101
  };
95
- const signMessage = async (message) => {
102
+ const signTransaction = async (args) => {
103
+ const { transactionOrPayload, asFeePayer, options } = args;
96
104
  if (!walletCore) {
97
105
  throw new Error("WalletCore is not initialized");
98
106
  }
99
107
  try {
100
- return await (walletCore == null ? void 0 : walletCore.signMessage(message));
108
+ return await walletCore.signTransaction({
109
+ transactionOrPayload,
110
+ asFeePayer
111
+ });
101
112
  } catch (error) {
102
113
  if (onError)
103
114
  onError(error);
104
115
  return Promise.reject(error);
105
116
  }
106
117
  };
107
- const signMessageAndVerify = async (message) => {
118
+ const submitTransaction = async (transaction) => {
108
119
  if (!walletCore) {
109
120
  throw new Error("WalletCore is not initialized");
110
121
  }
111
122
  try {
112
- return await (walletCore == null ? void 0 : walletCore.signMessageAndVerify(message));
123
+ return await (walletCore == null ? void 0 : walletCore.submitTransaction(transaction));
113
124
  } catch (error) {
114
125
  if (onError)
115
126
  onError(error);
116
127
  return Promise.reject(error);
117
128
  }
118
129
  };
119
- const submitTransaction = async (transaction) => {
130
+ const signMessage = async (message) => {
120
131
  if (!walletCore) {
121
132
  throw new Error("WalletCore is not initialized");
122
133
  }
123
134
  try {
124
- return await (walletCore == null ? void 0 : walletCore.submitTransaction(transaction));
135
+ return await (walletCore == null ? void 0 : walletCore.signMessage(message));
125
136
  } catch (error) {
126
137
  if (onError)
127
138
  onError(error);
128
139
  return Promise.reject(error);
129
140
  }
130
141
  };
131
- const signAndSubmitTransaction = async (transaction) => {
142
+ const signMessageAndVerify = async (message) => {
143
+ if (!walletCore) {
144
+ throw new Error("WalletCore is not initialized");
145
+ }
132
146
  try {
133
- return await (walletCore == null ? void 0 : walletCore.signAndSubmitTransaction(transaction));
147
+ return await (walletCore == null ? void 0 : walletCore.signMessageAndVerify(message));
134
148
  } catch (error) {
135
149
  if (onError)
136
150
  onError(error);
@@ -149,21 +163,6 @@ var AptosWalletAdapterProvider = ({
149
163
  return Promise.reject(error);
150
164
  }
151
165
  };
152
- useEffect(() => {
153
- if (autoConnect) {
154
- if (localStorage.getItem("AptosWalletName") && !connected) {
155
- connect(localStorage.getItem("AptosWalletName"));
156
- } else {
157
- setIsLoading(false);
158
- }
159
- }
160
- }, [autoConnect, wallets]);
161
- useEffect(() => {
162
- if (connected) {
163
- walletCore == null ? void 0 : walletCore.onAccountChange();
164
- walletCore == null ? void 0 : walletCore.onNetworkChange();
165
- }
166
- }, [connected]);
167
166
  const handleConnect = () => {
168
167
  setState((state) => {
169
168
  return {
@@ -175,19 +174,6 @@ var AptosWalletAdapterProvider = ({
175
174
  };
176
175
  });
177
176
  };
178
- const handleDisconnect = () => {
179
- if (!connected)
180
- return;
181
- setState((state) => {
182
- return {
183
- ...state,
184
- connected: false,
185
- account: (walletCore == null ? void 0 : walletCore.account) || null,
186
- network: (walletCore == null ? void 0 : walletCore.network) || null,
187
- wallet: null
188
- };
189
- });
190
- };
191
177
  const handleAccountChange = useCallback(() => {
192
178
  if (!connected)
193
179
  return;
@@ -212,14 +198,24 @@ var AptosWalletAdapterProvider = ({
212
198
  };
213
199
  });
214
200
  }, [connected]);
215
- const handleReadyStateChange = (updatedWallet) => {
216
- const updatedWallets = wallets == null ? void 0 : wallets.map((wallet2) => {
217
- if (wallet2.name === updatedWallet.name) {
218
- return { ...wallet2, readyState: updatedWallet.readyState };
219
- }
220
- return wallet2;
201
+ useEffect(() => {
202
+ if (connected) {
203
+ walletCore == null ? void 0 : walletCore.onAccountChange();
204
+ walletCore == null ? void 0 : walletCore.onNetworkChange();
205
+ }
206
+ }, [connected]);
207
+ const handleDisconnect = () => {
208
+ if (!connected)
209
+ return;
210
+ setState((state) => {
211
+ return {
212
+ ...state,
213
+ connected: false,
214
+ account: (walletCore == null ? void 0 : walletCore.account) || null,
215
+ network: (walletCore == null ? void 0 : walletCore.network) || null,
216
+ wallet: null
217
+ };
221
218
  });
222
- setWallets(updatedWallets);
223
219
  };
224
220
  const handleStandardWalletsAdded = (standardWallet) => {
225
221
  const existingWalletIndex = wallets.findIndex(
@@ -235,38 +231,59 @@ var AptosWalletAdapterProvider = ({
235
231
  setWallets((wallets2) => [...wallets2, standardWallet]);
236
232
  }
237
233
  };
234
+ const handleStandardNotDetectedWalletsAdded = (notDetectedWallet) => {
235
+ const existingWalletIndex = wallets.findIndex(
236
+ (wallet2) => wallet2.name == notDetectedWallet.name
237
+ );
238
+ if (existingWalletIndex !== -1) {
239
+ setNotDetectedWallets((wallets2) => [
240
+ ...wallets2.slice(0, existingWalletIndex),
241
+ notDetectedWallet,
242
+ ...wallets2.slice(existingWalletIndex + 1)
243
+ ]);
244
+ } else {
245
+ setNotDetectedWallets((wallets2) => [...wallets2, notDetectedWallet]);
246
+ }
247
+ };
238
248
  useEffect(() => {
239
249
  walletCore == null ? void 0 : walletCore.on("connect", handleConnect);
240
- walletCore == null ? void 0 : walletCore.on("disconnect", handleDisconnect);
241
250
  walletCore == null ? void 0 : walletCore.on("accountChange", handleAccountChange);
242
251
  walletCore == null ? void 0 : walletCore.on("networkChange", handleNetworkChange);
243
- walletCore == null ? void 0 : walletCore.on("readyStateChange", handleReadyStateChange);
252
+ walletCore == null ? void 0 : walletCore.on("disconnect", handleDisconnect);
244
253
  walletCore == null ? void 0 : walletCore.on("standardWalletsAdded", handleStandardWalletsAdded);
254
+ walletCore == null ? void 0 : walletCore.on(
255
+ "standardNotDetectedWalletAdded",
256
+ handleStandardNotDetectedWalletsAdded
257
+ );
245
258
  return () => {
246
259
  walletCore == null ? void 0 : walletCore.off("connect", handleConnect);
247
- walletCore == null ? void 0 : walletCore.off("disconnect", handleDisconnect);
248
260
  walletCore == null ? void 0 : walletCore.off("accountChange", handleAccountChange);
249
261
  walletCore == null ? void 0 : walletCore.off("networkChange", handleNetworkChange);
250
- walletCore == null ? void 0 : walletCore.off("readyStateChange", handleReadyStateChange);
262
+ walletCore == null ? void 0 : walletCore.off("disconnect", handleDisconnect);
251
263
  walletCore == null ? void 0 : walletCore.off("standardWalletsAdded", handleStandardWalletsAdded);
264
+ walletCore == null ? void 0 : walletCore.off(
265
+ "standardNotDetectedWalletAdded",
266
+ handleStandardNotDetectedWalletsAdded
267
+ );
252
268
  };
253
269
  }, [wallets, account]);
254
270
  return /* @__PURE__ */ jsx(WalletContext.Provider, {
255
271
  value: {
256
272
  connect,
257
- account,
258
- network,
259
- connected,
260
273
  disconnect,
261
- wallet,
262
- wallets,
263
274
  signAndSubmitTransaction,
264
275
  signTransaction,
265
276
  signMessage,
266
277
  signMessageAndVerify,
267
- isLoading,
278
+ changeNetwork,
268
279
  submitTransaction,
269
- changeNetwork
280
+ account,
281
+ network,
282
+ connected,
283
+ wallet,
284
+ wallets,
285
+ notDetectedWallets,
286
+ isLoading
270
287
  },
271
288
  children
272
289
  });
@@ -640,7 +657,7 @@ var Root3 = forwardRef7(
640
657
  connect(wallet.name);
641
658
  onConnect == null ? void 0 : onConnect();
642
659
  }, [connect, wallet.name, onConnect]);
643
- const isWalletReady = wallet.readyState === WalletReadyState.Installed || wallet.readyState === WalletReadyState.Loadable;
660
+ const isWalletReady = wallet.readyState === WalletReadyState.Installed;
644
661
  const mobileSupport = "deeplinkProvider" in wallet && wallet.deeplinkProvider;
645
662
  if (!isWalletReady && isRedirectable() && !mobileSupport)
646
663
  return null;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.tsx","../src/WalletProvider.tsx","../src/useWallet.tsx","../src/components/AboutAptosConnect.tsx","../src/graphics/LinkGraphic.tsx","../src/graphics/WalletGraphic.tsx","../src/graphics/Web3Graphic.tsx","../src/components/utils.tsx","../src/components/AptosPrivacyPolicy.tsx","../src/graphics/SmallAptosLogo.tsx","../src/components/WalletItem.tsx"],"sourcesContent":["export * from \"@aptos-labs/wallet-adapter-core\";\nexport * from \"./WalletProvider\";\nexport * from \"./components/AboutAptosConnect\";\nexport * from \"./components/AptosPrivacyPolicy\";\nexport * from \"./components/WalletItem\";\nexport * from \"./useWallet\";\n","import { FC, ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { WalletContext } from \"./useWallet\";\nimport type {\n AccountInfo,\n NetworkInfo,\n SignMessagePayload,\n Wallet,\n WalletInfo,\n InputGenerateTransactionOptions,\n AnyRawTransaction,\n InputSubmitTransactionData,\n AccountAuthenticator,\n PendingTransactionResponse,\n SignMessageResponse,\n WalletName,\n Types,\n InputTransactionData,\n Network,\n AptosStandardSupportedWallet,\n AvailableWallets,\n} from \"@aptos-labs/wallet-adapter-core\";\nimport { DappConfig, WalletCore } from \"@aptos-labs/wallet-adapter-core\";\n\nexport interface AptosWalletProviderProps {\n children: ReactNode;\n plugins?: ReadonlyArray<Wallet>;\n optInWallets?: ReadonlyArray<AvailableWallets>;\n autoConnect?: boolean;\n dappConfig?: DappConfig;\n disableTelemetry?: boolean;\n onError?: (error: any) => void;\n}\n\nconst initialState: {\n account: AccountInfo | null;\n network: NetworkInfo | null;\n connected: boolean;\n wallet: WalletInfo | null;\n} = {\n connected: false,\n account: null,\n network: null,\n wallet: null,\n};\n\n/**\n * Supported props to pass into the provider\n *\n * @param plugins Non AIP-62 supported wallet plugins array\n * @param optInWallets AIP-62 supported wallet names array to only include in the adapter wallets\n * @param autoConnect A boolean flag to indicate if the adapter should auto connect to a wallet\n * @param dappConfig The dapp configurations to be used by SDK wallets to set their configurations\n * @param disableTelemetry A boolean flag to disable the adapter telemetry tool\n * @param onError A callback function to execute when there is an error in the adapter\n *\n */\nexport const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({\n children,\n plugins,\n optInWallets,\n autoConnect = false,\n dappConfig,\n disableTelemetry = false,\n onError,\n}: AptosWalletProviderProps) => {\n const [{ connected, account, network, wallet }, setState] =\n useState(initialState);\n\n // a local state to track whether wallet connect request is loading\n // https://github.com/aptos-labs/aptos-wallet-adapter/issues/94\n const [isLoading, setIsLoading] = useState<boolean>(true);\n\n const [walletCore, setWalletCore] = useState<WalletCore>();\n\n const [wallets, setWallets] = useState<\n ReadonlyArray<Wallet | AptosStandardSupportedWallet>\n >(plugins ?? []);\n\n // Initialize WalletCore on first load\n useEffect(() => {\n const walletCore = new WalletCore(\n plugins ?? [],\n optInWallets ?? [],\n dappConfig,\n disableTelemetry,\n );\n setWalletCore(walletCore);\n }, []);\n\n // Update initial Wallets state once WalletCore has been initialized\n useEffect(() => {\n setWallets(walletCore?.wallets ?? []);\n }, [walletCore]);\n\n const connect = async (walletName: WalletName) => {\n try {\n setIsLoading(true);\n await walletCore?.connect(walletName);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n } finally {\n setIsLoading(false);\n }\n };\n\n const disconnect = async () => {\n try {\n await walletCore?.disconnect();\n } catch (error) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signTransaction = async (\n transaction: AnyRawTransaction | Types.TransactionPayload,\n asFeePayer?: boolean,\n options?: InputGenerateTransactionOptions,\n ): Promise<AccountAuthenticator> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.signTransaction(\n transaction,\n asFeePayer,\n options,\n );\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signMessage = async (\n message: SignMessagePayload,\n ): Promise<SignMessageResponse> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.signMessage(message);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signMessageAndVerify = async (\n message: SignMessagePayload,\n ): Promise<boolean> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.signMessageAndVerify(message);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const submitTransaction = async (\n transaction: InputSubmitTransactionData,\n ): Promise<PendingTransactionResponse> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.submitTransaction(transaction);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signAndSubmitTransaction = async (\n transaction: InputTransactionData,\n ) => {\n try {\n return await walletCore?.signAndSubmitTransaction(transaction);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const changeNetwork = async (network: Network) => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.changeNetwork(network);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n useEffect(() => {\n if (autoConnect) {\n if (localStorage.getItem(\"AptosWalletName\") && !connected) {\n connect(localStorage.getItem(\"AptosWalletName\") as WalletName);\n } else {\n // if we dont use autoconnect set the connect is loading to false\n setIsLoading(false);\n }\n }\n }, [autoConnect, wallets]);\n\n useEffect(() => {\n if (connected) {\n walletCore?.onAccountChange();\n walletCore?.onNetworkChange();\n }\n }, [connected]);\n\n // Handle the adapter's connect event\n const handleConnect = () => {\n setState((state) => {\n return {\n ...state,\n connected: true,\n account: walletCore?.account || null,\n network: walletCore?.network || null,\n wallet: walletCore?.wallet || null,\n };\n });\n };\n\n // Handle the adapter's disconnect event\n const handleDisconnect = () => {\n if (!connected) return;\n setState((state) => {\n return {\n ...state,\n connected: false,\n account: walletCore?.account || null,\n network: walletCore?.network || null,\n wallet: null,\n };\n });\n };\n\n // Handle the adapter's account change event\n const handleAccountChange = useCallback(() => {\n if (!connected) return;\n if (!walletCore?.wallet) return;\n setState((state) => {\n return {\n ...state,\n account: walletCore?.account || null,\n };\n });\n }, [connected]);\n\n // Handle the adapter's network event\n const handleNetworkChange = useCallback(() => {\n if (!connected) return;\n if (!walletCore?.wallet) return;\n setState((state) => {\n return {\n ...state,\n network: walletCore?.network || null,\n };\n });\n }, [connected]);\n\n const handleReadyStateChange = (updatedWallet: Wallet) => {\n // Create a new array with updated values\n const updatedWallets = (wallets as Wallet[])?.map((wallet) => {\n if (wallet.name === updatedWallet.name) {\n // Return a new object with updated value\n return { ...wallet, readyState: updatedWallet.readyState };\n }\n return wallet;\n });\n setWallets(updatedWallets);\n };\n\n const handleStandardWalletsAdded = (\n standardWallet: Wallet | AptosStandardSupportedWallet,\n ) => {\n // Manage current wallet state by removing optional duplications\n // as new wallets are coming\n const existingWalletIndex = wallets.findIndex(\n (wallet) => wallet.name == standardWallet.name,\n );\n if (existingWalletIndex !== -1) {\n // If wallet exists, replace it with the new wallet\n setWallets((wallets) => [\n ...wallets.slice(0, existingWalletIndex),\n standardWallet,\n ...wallets.slice(existingWalletIndex + 1),\n ]);\n } else {\n // If wallet doesn't exist, add it to the array\n setWallets((wallets) => [...wallets, standardWallet]);\n }\n };\n\n useEffect(() => {\n walletCore?.on(\"connect\", handleConnect);\n walletCore?.on(\"disconnect\", handleDisconnect);\n walletCore?.on(\"accountChange\", handleAccountChange);\n walletCore?.on(\"networkChange\", handleNetworkChange);\n walletCore?.on(\"readyStateChange\", handleReadyStateChange);\n walletCore?.on(\"standardWalletsAdded\", handleStandardWalletsAdded);\n return () => {\n walletCore?.off(\"connect\", handleConnect);\n walletCore?.off(\"disconnect\", handleDisconnect);\n walletCore?.off(\"accountChange\", handleAccountChange);\n walletCore?.off(\"networkChange\", handleNetworkChange);\n walletCore?.off(\"readyStateChange\", handleReadyStateChange);\n walletCore?.off(\"standardWalletsAdded\", handleStandardWalletsAdded);\n };\n }, [wallets, account]);\n\n return (\n <WalletContext.Provider\n value={{\n connect,\n account,\n network,\n connected,\n disconnect,\n wallet,\n wallets,\n signAndSubmitTransaction,\n signTransaction,\n signMessage,\n signMessageAndVerify,\n isLoading,\n submitTransaction,\n changeNetwork,\n }}\n >\n {children}\n </WalletContext.Provider>\n );\n};\n","import {\n AccountInfo,\n NetworkInfo,\n WalletInfo,\n SignMessagePayload,\n SignMessageResponse,\n Wallet,\n InputGenerateTransactionOptions,\n AnyRawTransaction,\n InputTransactionData,\n InputSubmitTransactionData,\n PendingTransactionResponse,\n AccountAuthenticator,\n Types,\n WalletName,\n AptosChangeNetworkOutput,\n Network,\n AptosStandardSupportedWallet,\n} from \"@aptos-labs/wallet-adapter-core\";\nimport { createContext, useContext } from \"react\";\n\nexport interface WalletContextState {\n connected: boolean;\n isLoading: boolean;\n account: AccountInfo | null;\n network: NetworkInfo | null;\n connect(walletName: WalletName): void;\n disconnect(): void;\n wallet: WalletInfo | null;\n wallets?: ReadonlyArray<Wallet | AptosStandardSupportedWallet>;\n signAndSubmitTransaction(transaction: InputTransactionData): Promise<any>;\n signTransaction(\n transactionOrPayload: AnyRawTransaction | Types.TransactionPayload,\n asFeePayer?: boolean,\n options?: InputGenerateTransactionOptions,\n ): Promise<AccountAuthenticator>;\n submitTransaction(\n transaction: InputSubmitTransactionData,\n ): Promise<PendingTransactionResponse>;\n signMessage(message: SignMessagePayload): Promise<SignMessageResponse>;\n signMessageAndVerify(message: SignMessagePayload): Promise<boolean>;\n changeNetwork(network: Network): Promise<AptosChangeNetworkOutput>;\n}\n\nconst DEFAULT_CONTEXT = {\n connected: false,\n};\n\nexport const WalletContext = createContext<WalletContextState>(\n DEFAULT_CONTEXT as WalletContextState,\n);\n\nexport function useWallet(): WalletContextState {\n const context = useContext(WalletContext);\n if (!context) {\n throw new Error(\"useWallet must be used within a WalletContextState\");\n }\n return context;\n}\n","import {\n Dispatch,\n ForwardRefExoticComponent,\n ReactNode,\n RefAttributes,\n SVGProps,\n SetStateAction,\n createContext,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport { LinkGraphic } from \"../graphics/LinkGraphic\";\nimport { WalletGraphic } from \"../graphics/WalletGraphic\";\nimport { Web3Graphic } from \"../graphics/Web3Graphic\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport const EXPLORE_ECOSYSTEM_URL =\n \"https://aptosfoundation.org/ecosystem/projects/all\";\n\nconst AboutAptosConnectContext = createContext<{\n screenIndex: number;\n setScreenIndex: Dispatch<SetStateAction<number>>;\n} | null>(null);\n\nfunction useAboutAptosConnectContext(displayName: string) {\n const context = useContext(AboutAptosConnectContext);\n\n if (!context) {\n throw new Error(\n `\\`${displayName}\\` must be used within \\`AboutAptosConnect\\``,\n );\n }\n\n return context;\n}\n\nconst educationScreens = [\n {\n Graphic: LinkGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h3\", {\n children: \"A better way to login.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Aptos Connect is a web3 wallet that uses a Social Login to create accounts on the Aptos blockchain.\",\n }),\n },\n {\n Graphic: WalletGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"What is a wallet?\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Wallets are a secure way to send, receive, and interact with digital assets like cryptocurrencies & NFTs.\",\n }),\n },\n {\n Graphic: Web3Graphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"Explore more of web3.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children: (\n <>\n Aptos Connect lets you take one account across any application built\n on Aptos.{\" \"}\n <a\n href={EXPLORE_ECOSYSTEM_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Explore the ecosystem\n </a>\n .\n </>\n ),\n }),\n },\n];\n\nconst educationScreenIndicators = Array(educationScreens.length)\n .fill(null)\n .map((_, index) =>\n createHeadlessComponent(\n \"AboutAptosConnect.ScreenIndicator\",\n \"button\",\n (displayName) => {\n const context = useAboutAptosConnectContext(displayName);\n const isActive = context.screenIndex - 1 === index;\n\n return {\n \"aria-label\": `Go to screen ${index + 1}`,\n \"aria-current\": isActive ? \"step\" : undefined,\n \"data-active\": isActive || undefined,\n onClick: () => {\n context.setScreenIndex(index + 1);\n },\n };\n },\n ),\n );\n\nexport interface AboutAptosConnectEducationScreen {\n /** A component that renders an SVG to illustrate the idea of the current screen. */\n Graphic: ForwardRefExoticComponent<\n Omit<SVGProps<SVGSVGElement>, \"ref\"> & RefAttributes<SVGSVGElement>\n >;\n /** A headless component that renders the title of the current screen. */\n Title: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLHeadingElement>\n >;\n /** A headless component that renders the description text of the current screen. */\n Description: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLParagraphElement>\n >;\n /** The index of the current education screen. */\n screenIndex: number;\n /** The total number of education screens. */\n totalScreens: number;\n /**\n * An array of headless components for indicating the current screen of the set.\n * Each indicator will navigate the user to the screen it represents when clicked.\n */\n screenIndicators: typeof educationScreenIndicators;\n /**\n * A function that navigates the user to the previous education screen.\n * If the user is on the first education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n back: () => void;\n /**\n * A function that navigates the user to the next education screen.\n * If the user is on the last education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n next: () => void;\n /** A function that navigates the user to the initial wallet selection screen. */\n cancel: () => void;\n}\n\nexport interface AboutAptosConnectProps {\n /**\n * A function for defining how each education screen should be rendered.\n * Each screen is modeled as a uniform set of headless components and utilities\n * that allow you to construct your UI and apply your own styles.\n */\n renderEducationScreen: (\n screen: AboutAptosConnectEducationScreen,\n ) => ReactNode;\n /**\n * The initial wallet selection UI that will be replaced by the education\n * screens when `AboutAptosConnect.Trigger` is clicked.\n */\n children?: ReactNode;\n}\n\nconst Root = ({ renderEducationScreen, children }: AboutAptosConnectProps) => {\n const [screenIndex, setScreenIndex] = useState(0);\n\n const currentEducationScreen: AboutAptosConnectEducationScreen = useMemo(\n () =>\n educationScreens.map((screen, i) => ({\n ...screen,\n screenIndex: i,\n totalScreens: educationScreens.length,\n screenIndicators: educationScreenIndicators,\n back: () => {\n setScreenIndex(screenIndex - 1);\n },\n next: () => {\n setScreenIndex(\n screenIndex === educationScreens.length ? 0 : screenIndex + 1,\n );\n },\n cancel: () => {\n setScreenIndex(0);\n },\n }))[screenIndex - 1],\n [screenIndex],\n );\n\n return (\n <AboutAptosConnectContext.Provider value={{ screenIndex, setScreenIndex }}>\n {screenIndex === 0\n ? children\n : renderEducationScreen(currentEducationScreen)}\n </AboutAptosConnectContext.Provider>\n );\n};\nRoot.displayName = \"AboutAptosConnect\";\n\nconst Trigger = createHeadlessComponent(\n \"AboutAptosConnect.Trigger\",\n \"button\",\n (displayName) => {\n const context = useAboutAptosConnectContext(displayName);\n\n return {\n onClick: () => {\n context.setScreenIndex(1);\n },\n };\n },\n);\n\n/**\n * A headless component for rendering education screens that explain the basics\n * of Aptos Connect and web3 wallets.\n */\nexport const AboutAptosConnect = Object.assign(Root, {\n Trigger,\n});\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const LinkGraphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"102\"\n height=\"132\"\n viewBox=\"0 0 102 132\"\n fill=\"none\"\n {...props}\n >\n <g stroke=\"currentColor\" strokeMiterlimit=\"10\">\n <path d=\"M59.633 80.66c11.742-2.814 17.48-7.018 20.925-13.254l17.518-31.69c6.257-11.317 2.142-25.55-9.189-31.798C82.737.53 75.723.188 69.593 2.398M60.7 69.565a14.09 14.09 0 0 1-6.907-1.767l-.228-.108\" />\n <path d=\"m52.365 41.075 12.507-22.627a14.146 14.146 0 0 1 4.727-5.062M32.407 118.619a14.139 14.139 0 0 1-7.034-1.768c-6.857-3.78-9.353-12.402-5.561-19.25l16.634-30.1a14.097 14.097 0 0 1 4.518-4.923\" />\n <path d=\"M41.211 78.85c11.332 6.248 25.583 2.14 31.84-9.177l17.518-31.691c6.256-11.317 2.142-25.55-9.19-31.798-6.085-3.357-13.018-3.724-19.104-1.59A23.31 23.31 0 0 0 49.541 15.36L36.863 38.298l7.989 5.036 12.506-22.627c3.786-6.848 12.419-9.34 19.276-5.554 6.856 3.78 9.353 12.402 5.561 19.25l-16.634 30.1c-3.785 6.848-12.418 9.341-19.275 5.555l-5.075 8.791ZM29.5 130.447c12.361-1.37 19.2-6.994 22.966-13.804l12.678-22.936-8.305-5.239\" />\n <path d=\"m55.72 61.947-.442.764 5.511-9.55c-6.901-3.806-18.65-3.124-27.105.814M44.85 43.523l7.635-2.486m-4.221 23.264 7.217-1.723m-9.316 7.517 7.59-2.405m-.562-12.156 7.508-2.221m10.136-51.32L62.761 4.43M49.642 90.778l7.514-2.26m.474 7.448 7.514-2.26m-50.306-60.13c7.135 0 12.918-5.776 12.918-12.9 0-7.126-5.783-12.902-12.918-12.902-7.134 0-12.917 5.776-12.917 12.901s5.783 12.901 12.918 12.901Z\" />\n <path d=\"M15.724 7.774h3.197c7.135 0 12.918 5.776 12.918 12.901 0 7.126-5.783 12.901-12.918 12.901h-3.425m65.112 66.935h3.198c7.135 0 12.918 5.775 12.918 12.901 0 7.125-5.783 12.9-12.918 12.9h-3.425\" />\n <path d=\"M79.717 126.312c7.135 0 12.918-5.775 12.918-12.9s-5.783-12.901-12.918-12.901c-7.134 0-12.917 5.776-12.917 12.901s5.783 12.9 12.917 12.9ZM53.281 55.414c-11.33-6.248-25.582-2.14-31.839 9.177L3.924 96.281c-6.257 11.318-2.142 25.55 9.189 31.799 11.331 6.248 25.582 2.139 31.839-9.177l12.677-22.937-7.988-5.036-12.507 22.627c-3.785 6.848-12.418 9.341-19.275 5.554-6.857-3.781-9.353-12.402-5.561-19.25l16.633-30.1c3.786-6.848 12.419-9.341 19.276-5.555l5.074-8.792Z\" />\n </g>\n </svg>\n );\n },\n);\nLinkGraphic.displayName = \"LinkGraphic\";\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const WalletGraphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"128\"\n height=\"102\"\n viewBox=\"0 0 128 102\"\n fill=\"none\"\n {...props}\n >\n <path\n fill=\"currentColor\"\n d=\"m.96 25.93-.36-.35.36.85v-.5Zm7.79-7.81v-.5h-.21l-.15.15.36.35ZM1.3 26.28l7.79-7.8-.7-.71-7.8 7.8.7.71Zm7.44-7.66H10v-1H8.75v1Zm29.22 6.8h-37v1h37.01v-1Z\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M82.25 26.08c0 12.25-9.92 22.2-22.14 22.2a22.17 22.17 0 0 1-22.14-22.2H1.1v74.82h118.02V26.08H82.25Zm44.33 67.02h.33V18.27h-5.7\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M74.52 42.92a22.4 22.4 0 0 1-11.43 3.3 22.5 22.5 0 0 1-22.46-22.53H9.52M119.22 101l7.78-7.82m-7.88-67.1 7.79-7.81m-44.78 7.72 2.73-2.3m-46.89 2.39 2.39-2.4\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M9.86 23.69V5.72h107.97v18.04H84.65\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M117.83 20.46h3.39V1H13.25v4.72M9.36 23.69h31.78\"\n />\n </svg>\n );\n },\n);\nWalletGraphic.displayName = \"WalletGraphic\";\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const Web3Graphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"142\"\n height=\"108\"\n viewBox=\"0 0 142 108\"\n fill=\"none\"\n {...props}\n >\n <g stroke=\"currentColor\" strokeLinejoin=\"round\">\n <path d=\"m91.26 35.8.06-10.46L71.3 1v10.53L87 30.5m-36.11 5.24-.06-10.45L71.3 1v10.53L55 30.5\" />\n <path d=\"M71 59.55V49.17L50.83 25.3l.06 10.45L57 42.5m14 17.05V49.18l20.33-23.84-.07 10.45L86 42M1 59.68l.22-9.07 35.33-19.8-.1 9L9 55\" />\n <path d=\"M36.55 30.8s-.08 5.92-.1 9l.1-9ZM71 59.51v-9.07L36.55 30.8l-.1 9L63.5 55\" />\n <path d=\"M71 59.51v-9.07L36.44 70.78l-.1 9.14L55.5 68.5\" />\n <path d=\"M1.22 50.6a77387.2 77387.2 0 0 0 35.22 20.18l-.1 9.14L1 59.68l.23-9.07h-.01ZM141 59.68l-.23-9.07-35.33-19.8.11 9L133 55\" />\n <path d=\"m105.44 30.8.11 9-.1-9Z\" />\n <path d=\"M71 59.51v-9.07l34.44-19.64.11 9L78.5 55\" />\n <path d=\"M71 59.51v-9.07l34.56 20.34.1 9.14L87 69\" />\n <path d=\"M140.78 50.6a78487.3 78487.3 0 0 1-35.23 20.18l.11 9.14L141 59.68l-.23-9.07ZM50.83 80.15l.06-6.33 20.1-23.38H71v9.26L55 79\" />\n <path d=\"M71.3 97.6 50.89 73.81l-.06 9.33L71.3 107v-9.4Zm20.03-14.5-.07-9.33L71 50.44v9.26l16 18.8\" />\n <path d=\"m71.3 97.6 19.96-23.83.06 9.33L71.3 107v-9.4Z\" />\n </g>\n </svg>\n );\n },\n);\nWeb3Graphic.displayName = \"Web3Graphic\";\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { ReactNode, cloneElement, forwardRef, isValidElement } from \"react\";\n\nexport interface HeadlessComponentProps {\n /** A class name for styling the element. */\n className?: string;\n /**\n * Whether to render as the child element instead of the default element provided.\n * All props will be merged into the child element.\n */\n asChild?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Gets an HTML element type from its tag name\n * @example\n * HTMLElementFromTag<\"img\"> // resolved type: HTMLImageElement\n */\ntype HTMLElementFromTag<T extends keyof JSX.IntrinsicElements> =\n JSX.IntrinsicElements[T] extends React.ClassAttributes<infer Element>\n ? Element\n : HTMLElement;\n\nexport function createHeadlessComponent<\n TElement extends keyof JSX.IntrinsicElements,\n>(\n displayName: string,\n elementType: TElement,\n props?:\n | JSX.IntrinsicElements[TElement]\n | ((displayName: string) => JSX.IntrinsicElements[TElement]),\n) {\n const component = forwardRef<\n HTMLElementFromTag<TElement>,\n HeadlessComponentProps\n >(({ className, asChild, children }, ref) => {\n const Component = asChild ? Slot : elementType;\n\n const { children: defaultChildren, ...resolvedProps } =\n typeof props === \"function\" ? props(displayName) : (props ?? {});\n const resolvedChildren =\n /**\n * Use props' default children if no children are set in the component element's children and when asChild is true.\n */\n asChild && isValidElement(children) && !children.props.children\n ? cloneElement(children, {}, defaultChildren)\n : (children ?? defaultChildren);\n\n return (\n /**\n * Due to the complexity of the types at play, TypeScript reports the\n * following error for our JSX below:\n *\n * `Expression produces a union type that is too complex to represent.`\n *\n * We can safely ignore this error and retain accurate return types for\n * consumers of this function. The only drawback is that type-checking is\n * ignored for the JSX block below.\n */\n // @ts-expect-error\n <Component ref={ref} className={className} {...resolvedProps}>\n {resolvedChildren}\n </Component>\n );\n });\n component.displayName = displayName;\n\n return component;\n}\n","import { forwardRef } from \"react\";\nimport { SmallAptosLogo } from \"../graphics/SmallAptosLogo\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport const APTOS_PRIVACY_POLICY_URL = \"https://aptoslabs.com/privacy\";\n\nconst Root = createHeadlessComponent(\"AptosPrivacyPolicy.Root\", \"div\");\n\nconst Disclaimer = createHeadlessComponent(\n \"AptosPrivacyPolicy.Disclaimer\",\n \"span\",\n { children: \"By continuing, you agree to Aptos Labs'\" },\n);\n\nconst Link = createHeadlessComponent(\"AptosPrivacyPolicy.Disclaimer\", \"a\", {\n href: APTOS_PRIVACY_POLICY_URL,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: \"Privacy Policy\",\n});\n\nconst PoweredBy = forwardRef<\n HTMLDivElement,\n Pick<HeadlessComponentProps, \"className\">\n>(({ className }, ref) => {\n return (\n <div ref={ref} className={className}>\n <span>Powered by</span>\n <SmallAptosLogo />\n <span>Aptos Labs</span>\n </div>\n );\n});\nPoweredBy.displayName = \"AptosPrivacyPolicy.PoweredBy\";\n\n/**\n * A headless component for rendering the Aptos Labs privacy policy disclaimer\n * that should be placed under the Aptos Connect login options.\n */\nexport const AptosPrivacyPolicy = Object.assign(Root, {\n Disclaimer,\n Link,\n PoweredBy,\n});\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const SmallAptosLogo = forwardRef<\n SVGSVGElement,\n SVGProps<SVGSVGElement>\n>((props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM7.17547 3.67976C7.13401 3.72309 7.07649 3.74757 7.01648 3.74757H3.00775C3.69185 2.83824 4.77995 2.25 6.00569 2.25C7.23142 2.25 8.31953 2.83824 9.00362 3.74757H8.28524C8.20824 3.74757 8.13498 3.71468 8.08401 3.65701L7.81608 3.35416C7.77618 3.30896 7.71882 3.28308 7.6585 3.28308H7.6454C7.58805 3.28308 7.53318 3.30646 7.49343 3.34792L7.17547 3.67976ZM8.05656 4.75897H7.39569C7.31869 4.75897 7.24543 4.72593 7.19447 4.66842L6.92638 4.36557C6.88647 4.32036 6.82896 4.29465 6.7688 4.29465C6.70863 4.29465 6.65112 4.32052 6.61121 4.36557L6.38131 4.6254C6.30603 4.71034 6.19801 4.75913 6.08454 4.75913H2.46703C2.36401 5.05278 2.29683 5.36296 2.27002 5.68467H5.68505C5.74506 5.68467 5.80258 5.66019 5.84404 5.61686L6.16201 5.28502C6.20175 5.24356 6.25662 5.22018 6.31398 5.22018H6.32707C6.38739 5.22018 6.44475 5.24606 6.48465 5.29126L6.75258 5.59411C6.80355 5.65178 6.87681 5.68467 6.95381 5.68467H9.74133C9.71452 5.3628 9.64734 5.05263 9.54431 4.75913H8.05641L8.05656 4.75897ZM4.33651 7.63095C4.39652 7.63095 4.45404 7.60648 4.4955 7.56315L4.81347 7.23131C4.85321 7.18985 4.90808 7.16647 4.96544 7.16647H4.97853C5.03885 7.16647 5.09621 7.19234 5.13611 7.23739L5.40404 7.54024C5.45501 7.59791 5.52827 7.6308 5.60527 7.6308H9.38285C9.52438 7.33839 9.62803 7.02463 9.68975 6.69591H6.06383C5.98683 6.69591 5.91357 6.66287 5.8626 6.60535L5.59467 6.3025C5.55477 6.2573 5.49725 6.23158 5.43709 6.23158C5.37692 6.23158 5.31941 6.25746 5.27951 6.3025L5.0496 6.56233C4.97432 6.64728 4.86631 6.69606 4.75268 6.69606H2.32147C2.3832 7.02479 2.487 7.33855 2.62837 7.63095H4.33651ZM5.57359 8.55745H4.59116C4.51417 8.55745 4.44091 8.52441 4.38994 8.46689L4.12201 8.16404C4.0821 8.11884 4.02459 8.09312 3.96442 8.09312C3.90426 8.09312 3.84675 8.119 3.80684 8.16404L3.57694 8.42387C3.50166 8.50882 3.39364 8.55761 3.28001 8.55761H3.26474C3.94915 9.29096 4.92378 9.74998 6.00596 9.74998C7.08815 9.74998 8.06262 9.29096 8.74719 8.55761H5.57359V8.55745Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n});\nSmallAptosLogo.displayName = \"SmallAptosLogo\";\n","import {\n AnyAptosWallet,\n WalletReadyState,\n isRedirectable,\n} from \"@aptos-labs/wallet-adapter-core\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { createContext, forwardRef, useCallback, useContext } from \"react\";\nimport { useWallet } from \"../useWallet\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport interface WalletItemProps extends HeadlessComponentProps {\n /** The wallet option to be displayed. */\n wallet: AnyAptosWallet;\n /** A callback to be invoked when the wallet is connected. */\n onConnect?: () => void;\n}\n\nfunction useWalletItemContext(displayName: string) {\n const context = useContext(WalletItemContext);\n\n if (!context) {\n throw new Error(`\\`${displayName}\\` must be used within \\`WalletItem\\``);\n }\n\n return context;\n}\n\nconst WalletItemContext = createContext<{\n wallet: AnyAptosWallet;\n connectWallet: () => void;\n} | null>(null);\n\nconst Root = forwardRef<HTMLDivElement, WalletItemProps>(\n ({ wallet, onConnect, className, asChild, children }, ref) => {\n const { connect } = useWallet();\n\n const connectWallet = useCallback(() => {\n connect(wallet.name);\n onConnect?.();\n }, [connect, wallet.name, onConnect]);\n\n const isWalletReady =\n wallet.readyState === WalletReadyState.Installed ||\n wallet.readyState === WalletReadyState.Loadable;\n\n const mobileSupport =\n \"deeplinkProvider\" in wallet && wallet.deeplinkProvider;\n\n if (!isWalletReady && isRedirectable() && !mobileSupport) return null;\n\n const Component = asChild ? Slot : \"div\";\n\n return (\n <WalletItemContext.Provider value={{ wallet, connectWallet }}>\n <Component ref={ref} className={className}>\n {children}\n </Component>\n </WalletItemContext.Provider>\n );\n },\n);\nRoot.displayName = \"WalletItem\";\n\nconst Icon = createHeadlessComponent(\n \"WalletItem.Icon\",\n \"img\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n src: context.wallet.icon,\n alt: `${context.wallet.name} icon`,\n };\n },\n);\n\nconst Name = createHeadlessComponent(\n \"WalletItem.Name\",\n \"div\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n children: context.wallet.name,\n };\n },\n);\n\nconst ConnectButton = createHeadlessComponent(\n \"WalletItem.ConnectButton\",\n \"button\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n onClick: context.connectWallet,\n children: \"Connect\",\n };\n },\n);\n\nconst InstallLink = createHeadlessComponent(\n \"WalletItem.InstallLink\",\n \"a\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n href: context.wallet.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: \"Install\",\n };\n },\n);\n\n/** A headless component for rendering a wallet option's name, icon, and either connect button or install link. */\nexport const WalletItem = Object.assign(Root, {\n Icon,\n Name,\n ConnectButton,\n InstallLink,\n});\n"],"mappings":";AAAA,cAAc;;;ACAd,SAAwB,aAAa,WAAmB,gBAAgB;;;ACmBxE,SAAS,eAAe,kBAAkB;AAyB1C,IAAM,kBAAkB;AAAA,EACtB,WAAW;AACb;AAEO,IAAM,gBAAgB;AAAA,EAC3B;AACF;AAEO,SAAS,YAAgC;AAC9C,QAAM,UAAU,WAAW,aAAa;AACxC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AACA,SAAO;AACT;;;ADrCA,SAAqB,kBAAkB;AArBvC;AAiCA,IAAM,eAKF;AAAA,EACF,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;AAaO,IAAM,6BAA2D,CAAC;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,mBAAmB;AAAA,EACnB;AACF,MAAgC;AAC9B,QAAM,CAAC,EAAE,WAAW,SAAS,SAAS,OAAO,GAAG,QAAQ,IACtD,SAAS,YAAY;AAIvB,QAAM,CAAC,WAAW,YAAY,IAAI,SAAkB,IAAI;AAExD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAqB;AAEzD,QAAM,CAAC,SAAS,UAAU,IAAI,SAE5B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A,KACF;AAAA,EAEJ;AACF;AACAG,MAAK,cAAc;AAEnB,IAAM,OAAO;AAAA,EACX;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,KAAK,QAAQ,OAAO;AAAA,MACpB,KAAK,GAAG,QAAQ,OAAO;AAAA,IACzB;AAAA,EACF;AACF;AAEA,IAAM,OAAO;AAAA,EACX;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,UAAU,QAAQ,OAAO;AAAA,IAC3B;AAAA,EACF;AACF;AAEA,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,SAAS,QAAQ;AAAA,MACjB,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,MAAM,QAAQ,OAAO;AAAA,MACrB,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAGO,IAAM,aAAa,OAAO,OAAOA,OAAM;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":["walletCore","network","wallet","wallets","createContext","useContext","useState","jsx","forwardRef","jsx","jsxs","forwardRef","jsx","jsxs","forwardRef","jsx","jsx","jsxs","createContext","useContext","useState","forwardRef","forwardRef","jsx","jsx","jsxs","Root","forwardRef","Slot","createContext","forwardRef","useCallback","useContext","jsx","useContext","createContext","Root","forwardRef","useCallback","Slot"]}
1
+ {"version":3,"sources":["../src/index.tsx","../src/WalletProvider.tsx","../src/useWallet.tsx","../src/components/AboutAptosConnect.tsx","../src/graphics/LinkGraphic.tsx","../src/graphics/WalletGraphic.tsx","../src/graphics/Web3Graphic.tsx","../src/components/utils.tsx","../src/components/AptosPrivacyPolicy.tsx","../src/graphics/SmallAptosLogo.tsx","../src/components/WalletItem.tsx"],"sourcesContent":["export * from \"@aptos-labs/wallet-adapter-core\";\nexport * from \"./WalletProvider\";\nexport * from \"./components/AboutAptosConnect\";\nexport * from \"./components/AptosPrivacyPolicy\";\nexport * from \"./components/WalletItem\";\nexport * from \"./useWallet\";\n","import {\n AvailableWallets,\n DappConfig,\n AccountInfo,\n AdapterWallet,\n NetworkInfo,\n InputTransactionData,\n AptosSignAndSubmitTransactionOutput,\n AnyRawTransaction,\n InputGenerateTransactionOptions,\n AccountAuthenticator,\n AptosSignMessageInput,\n AptosSignMessageOutput,\n AdapterNotDetectedWallet,\n WalletCore,\n Network,\n InputSubmitTransactionData,\n PendingTransactionResponse,\n} from \"@aptos-labs/wallet-adapter-core\";\nimport { ReactNode, FC, useState, useEffect, useCallback } from \"react\";\nimport { WalletContext } from \"./useWallet\";\n\nexport interface AptosWalletProviderProps {\n children: ReactNode;\n optInWallets?: ReadonlyArray<AvailableWallets>;\n autoConnect?: boolean;\n dappConfig?: DappConfig;\n disableTelemetry?: boolean;\n onError?: (error: any) => void;\n}\n\nconst initialState: {\n account: AccountInfo | null;\n network: NetworkInfo | null;\n connected: boolean;\n wallet: AdapterWallet | null;\n} = {\n connected: false,\n account: null,\n network: null,\n wallet: null,\n};\n\nexport const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({\n children,\n optInWallets,\n autoConnect = false,\n dappConfig,\n disableTelemetry = false,\n onError,\n}: AptosWalletProviderProps) => {\n const [{ account, network, connected, wallet }, setState] =\n useState(initialState);\n\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [walletCore, setWalletCore] = useState<WalletCore>();\n\n const [wallets, setWallets] = useState<ReadonlyArray<AdapterWallet>>([]);\n const [notDetectedWallets, setNotDetectedWallets] = useState<\n ReadonlyArray<AdapterNotDetectedWallet>\n >([]);\n // Initialize WalletCore on first load\n useEffect(() => {\n const walletCore = new WalletCore(\n optInWallets,\n dappConfig,\n disableTelemetry\n );\n setWalletCore(walletCore);\n }, []);\n\n // Update initial Wallets state once WalletCore has been initialized\n useEffect(() => {\n setWallets(walletCore?.wallets ?? []);\n setNotDetectedWallets(walletCore?.notDetectedWallets ?? []);\n }, [walletCore]);\n\n useEffect(() => {\n if (autoConnect) {\n if (localStorage.getItem(\"AptosWalletName\") && !connected) {\n connect(localStorage.getItem(\"AptosWalletName\") as string);\n } else {\n // if we dont use autoconnect set the connect is loading to false\n setIsLoading(false);\n }\n }\n }, [autoConnect, wallets]);\n\n const connect = async (walletName: string): Promise<void> => {\n try {\n setIsLoading(true);\n await walletCore?.connect(walletName);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n } finally {\n setIsLoading(false);\n }\n };\n\n const disconnect = async (): Promise<void> => {\n try {\n await walletCore?.disconnect();\n } catch (error) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signAndSubmitTransaction = async (\n transaction: InputTransactionData\n ): Promise<AptosSignAndSubmitTransactionOutput> => {\n try {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n return await walletCore.signAndSubmitTransaction(transaction);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signTransaction = async (args: {\n transactionOrPayload: AnyRawTransaction | InputTransactionData;\n asFeePayer?: boolean;\n options?: InputGenerateTransactionOptions & {\n expirationSecondsFromNow?: number;\n expirationTimestamp?: number;\n };\n }): Promise<{\n authenticator: AccountAuthenticator;\n rawTransaction: Uint8Array;\n }> => {\n const { transactionOrPayload, asFeePayer, options } = args;\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore.signTransaction({\n transactionOrPayload,\n asFeePayer,\n });\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const submitTransaction = async (\n transaction: InputSubmitTransactionData\n ): Promise<PendingTransactionResponse> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.submitTransaction(transaction);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signMessage = async (\n message: AptosSignMessageInput\n ): Promise<AptosSignMessageOutput> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.signMessage(message);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signMessageAndVerify = async (\n message: AptosSignMessageInput\n ): Promise<boolean> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.signMessageAndVerify(message);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const changeNetwork = async (network: Network) => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.changeNetwork(network);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n // Handle the adapter's connect event\n const handleConnect = (): void => {\n setState((state) => {\n return {\n ...state,\n connected: true,\n account: walletCore?.account || null,\n network: walletCore?.network || null,\n wallet: walletCore?.wallet || null,\n };\n });\n };\n\n // Handle the adapter's account change event\n const handleAccountChange = useCallback((): void => {\n if (!connected) return;\n if (!walletCore?.wallet) return;\n setState((state) => {\n return {\n ...state,\n account: walletCore?.account || null,\n };\n });\n }, [connected]);\n\n // Handle the adapter's network event\n const handleNetworkChange = useCallback((): void => {\n if (!connected) return;\n if (!walletCore?.wallet) return;\n setState((state) => {\n return {\n ...state,\n network: walletCore?.network || null,\n };\n });\n }, [connected]);\n\n useEffect(() => {\n if (connected) {\n walletCore?.onAccountChange();\n walletCore?.onNetworkChange();\n }\n }, [connected]);\n\n // Handle the adapter's disconnect event\n const handleDisconnect = (): void => {\n if (!connected) return;\n setState((state) => {\n return {\n ...state,\n connected: false,\n account: walletCore?.account || null,\n network: walletCore?.network || null,\n wallet: null,\n };\n });\n };\n\n const handleStandardWalletsAdded = (standardWallet: AdapterWallet): void => {\n // Manage current wallet state by removing optional duplications\n // as new wallets are coming\n const existingWalletIndex = wallets.findIndex(\n (wallet) => wallet.name == standardWallet.name\n );\n if (existingWalletIndex !== -1) {\n // If wallet exists, replace it with the new wallet\n setWallets((wallets) => [\n ...wallets.slice(0, existingWalletIndex),\n standardWallet,\n ...wallets.slice(existingWalletIndex + 1),\n ]);\n } else {\n // If wallet doesn't exist, add it to the array\n setWallets((wallets) => [...wallets, standardWallet]);\n }\n };\n\n const handleStandardNotDetectedWalletsAdded = (\n notDetectedWallet: AdapterNotDetectedWallet\n ): void => {\n // Manage current wallet state by removing optional duplications\n // as new wallets are coming\n const existingWalletIndex = wallets.findIndex(\n (wallet) => wallet.name == notDetectedWallet.name\n );\n if (existingWalletIndex !== -1) {\n // If wallet exists, replace it with the new wallet\n setNotDetectedWallets((wallets) => [\n ...wallets.slice(0, existingWalletIndex),\n notDetectedWallet,\n ...wallets.slice(existingWalletIndex + 1),\n ]);\n } else {\n // If wallet doesn't exist, add it to the array\n setNotDetectedWallets((wallets) => [...wallets, notDetectedWallet]);\n }\n };\n\n useEffect(() => {\n walletCore?.on(\"connect\", handleConnect);\n walletCore?.on(\"accountChange\", handleAccountChange);\n walletCore?.on(\"networkChange\", handleNetworkChange);\n walletCore?.on(\"disconnect\", handleDisconnect);\n walletCore?.on(\"standardWalletsAdded\", handleStandardWalletsAdded);\n walletCore?.on(\n \"standardNotDetectedWalletAdded\",\n handleStandardNotDetectedWalletsAdded\n );\n return () => {\n walletCore?.off(\"connect\", handleConnect);\n walletCore?.off(\"accountChange\", handleAccountChange);\n walletCore?.off(\"networkChange\", handleNetworkChange);\n walletCore?.off(\"disconnect\", handleDisconnect);\n walletCore?.off(\"standardWalletsAdded\", handleStandardWalletsAdded);\n walletCore?.off(\n \"standardNotDetectedWalletAdded\",\n handleStandardNotDetectedWalletsAdded\n );\n };\n }, [wallets, account]);\n return (\n <WalletContext.Provider\n value={{\n connect,\n disconnect,\n signAndSubmitTransaction,\n signTransaction,\n signMessage,\n signMessageAndVerify,\n changeNetwork,\n submitTransaction,\n account,\n network,\n connected,\n wallet,\n wallets,\n notDetectedWallets,\n isLoading,\n }}\n >\n {children}\n </WalletContext.Provider>\n );\n};\n","import { useContext, createContext } from \"react\";\nimport {\n AccountAuthenticator,\n AccountInfo,\n AdapterWallet,\n AnyRawTransaction,\n AptosSignAndSubmitTransactionOutput,\n InputTransactionData,\n NetworkInfo,\n AptosSignMessageInput,\n AptosSignMessageOutput,\n AdapterNotDetectedWallet,\n Network,\n AptosChangeNetworkOutput,\n PendingTransactionResponse,\n InputSubmitTransactionData,\n} from \"@aptos-labs/wallet-adapter-core\";\n\nexport interface WalletContextState {\n connected: boolean;\n isLoading: boolean;\n account: AccountInfo | null;\n network: NetworkInfo | null;\n connect(walletName: string): void;\n signAndSubmitTransaction(\n transaction: InputTransactionData\n ): Promise<AptosSignAndSubmitTransactionOutput>;\n signTransaction(args: {\n transactionOrPayload: AnyRawTransaction | InputTransactionData;\n asFeePayer?: boolean;\n }): Promise<{\n authenticator: AccountAuthenticator;\n rawTransaction: Uint8Array;\n }>;\n signMessage(message: AptosSignMessageInput): Promise<AptosSignMessageOutput>;\n signMessageAndVerify(message: AptosSignMessageInput): Promise<boolean>;\n disconnect(): void;\n changeNetwork(network: Network): Promise<AptosChangeNetworkOutput>;\n submitTransaction(\n transaction: InputSubmitTransactionData\n ): Promise<PendingTransactionResponse>;\n wallet: AdapterWallet | null;\n wallets: ReadonlyArray<AdapterWallet>;\n notDetectedWallets: ReadonlyArray<AdapterNotDetectedWallet>;\n}\n\nconst DEFAULT_CONTEXT = {\n connected: false,\n};\n\nexport const WalletContext = createContext<WalletContextState>(\n DEFAULT_CONTEXT as WalletContextState\n);\n\nexport function useWallet(): WalletContextState {\n const context = useContext(WalletContext);\n if (!context) {\n throw new Error(\"useWallet must be used within a WalletContextState\");\n }\n return context;\n}\n","import {\n Dispatch,\n ForwardRefExoticComponent,\n ReactNode,\n RefAttributes,\n SVGProps,\n SetStateAction,\n createContext,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport { LinkGraphic } from \"../graphics/LinkGraphic\";\nimport { WalletGraphic } from \"../graphics/WalletGraphic\";\nimport { Web3Graphic } from \"../graphics/Web3Graphic\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport const EXPLORE_ECOSYSTEM_URL =\n \"https://aptosfoundation.org/ecosystem/projects/all\";\n\nconst AboutAptosConnectContext = createContext<{\n screenIndex: number;\n setScreenIndex: Dispatch<SetStateAction<number>>;\n} | null>(null);\n\nfunction useAboutAptosConnectContext(displayName: string) {\n const context = useContext(AboutAptosConnectContext);\n\n if (!context) {\n throw new Error(\n `\\`${displayName}\\` must be used within \\`AboutAptosConnect\\``,\n );\n }\n\n return context;\n}\n\nconst educationScreens = [\n {\n Graphic: LinkGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h3\", {\n children: \"A better way to login.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Aptos Connect is a web3 wallet that uses a Social Login to create accounts on the Aptos blockchain.\",\n }),\n },\n {\n Graphic: WalletGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"What is a wallet?\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Wallets are a secure way to send, receive, and interact with digital assets like cryptocurrencies & NFTs.\",\n }),\n },\n {\n Graphic: Web3Graphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"Explore more of web3.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children: (\n <>\n Aptos Connect lets you take one account across any application built\n on Aptos.{\" \"}\n <a\n href={EXPLORE_ECOSYSTEM_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Explore the ecosystem\n </a>\n .\n </>\n ),\n }),\n },\n];\n\nconst educationScreenIndicators = Array(educationScreens.length)\n .fill(null)\n .map((_, index) =>\n createHeadlessComponent(\n \"AboutAptosConnect.ScreenIndicator\",\n \"button\",\n (displayName) => {\n const context = useAboutAptosConnectContext(displayName);\n const isActive = context.screenIndex - 1 === index;\n\n return {\n \"aria-label\": `Go to screen ${index + 1}`,\n \"aria-current\": isActive ? \"step\" : undefined,\n \"data-active\": isActive || undefined,\n onClick: () => {\n context.setScreenIndex(index + 1);\n },\n };\n },\n ),\n );\n\nexport interface AboutAptosConnectEducationScreen {\n /** A component that renders an SVG to illustrate the idea of the current screen. */\n Graphic: ForwardRefExoticComponent<\n Omit<SVGProps<SVGSVGElement>, \"ref\"> & RefAttributes<SVGSVGElement>\n >;\n /** A headless component that renders the title of the current screen. */\n Title: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLHeadingElement>\n >;\n /** A headless component that renders the description text of the current screen. */\n Description: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLParagraphElement>\n >;\n /** The index of the current education screen. */\n screenIndex: number;\n /** The total number of education screens. */\n totalScreens: number;\n /**\n * An array of headless components for indicating the current screen of the set.\n * Each indicator will navigate the user to the screen it represents when clicked.\n */\n screenIndicators: typeof educationScreenIndicators;\n /**\n * A function that navigates the user to the previous education screen.\n * If the user is on the first education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n back: () => void;\n /**\n * A function that navigates the user to the next education screen.\n * If the user is on the last education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n next: () => void;\n /** A function that navigates the user to the initial wallet selection screen. */\n cancel: () => void;\n}\n\nexport interface AboutAptosConnectProps {\n /**\n * A function for defining how each education screen should be rendered.\n * Each screen is modeled as a uniform set of headless components and utilities\n * that allow you to construct your UI and apply your own styles.\n */\n renderEducationScreen: (\n screen: AboutAptosConnectEducationScreen,\n ) => ReactNode;\n /**\n * The initial wallet selection UI that will be replaced by the education\n * screens when `AboutAptosConnect.Trigger` is clicked.\n */\n children?: ReactNode;\n}\n\nconst Root = ({ renderEducationScreen, children }: AboutAptosConnectProps) => {\n const [screenIndex, setScreenIndex] = useState(0);\n\n const currentEducationScreen: AboutAptosConnectEducationScreen = useMemo(\n () =>\n educationScreens.map((screen, i) => ({\n ...screen,\n screenIndex: i,\n totalScreens: educationScreens.length,\n screenIndicators: educationScreenIndicators,\n back: () => {\n setScreenIndex(screenIndex - 1);\n },\n next: () => {\n setScreenIndex(\n screenIndex === educationScreens.length ? 0 : screenIndex + 1,\n );\n },\n cancel: () => {\n setScreenIndex(0);\n },\n }))[screenIndex - 1],\n [screenIndex],\n );\n\n return (\n <AboutAptosConnectContext.Provider value={{ screenIndex, setScreenIndex }}>\n {screenIndex === 0\n ? children\n : renderEducationScreen(currentEducationScreen)}\n </AboutAptosConnectContext.Provider>\n );\n};\nRoot.displayName = \"AboutAptosConnect\";\n\nconst Trigger = createHeadlessComponent(\n \"AboutAptosConnect.Trigger\",\n \"button\",\n (displayName) => {\n const context = useAboutAptosConnectContext(displayName);\n\n return {\n onClick: () => {\n context.setScreenIndex(1);\n },\n };\n },\n);\n\n/**\n * A headless component for rendering education screens that explain the basics\n * of Aptos Connect and web3 wallets.\n */\nexport const AboutAptosConnect = Object.assign(Root, {\n Trigger,\n});\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const LinkGraphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"102\"\n height=\"132\"\n viewBox=\"0 0 102 132\"\n fill=\"none\"\n {...props}\n >\n <g stroke=\"currentColor\" strokeMiterlimit=\"10\">\n <path d=\"M59.633 80.66c11.742-2.814 17.48-7.018 20.925-13.254l17.518-31.69c6.257-11.317 2.142-25.55-9.189-31.798C82.737.53 75.723.188 69.593 2.398M60.7 69.565a14.09 14.09 0 0 1-6.907-1.767l-.228-.108\" />\n <path d=\"m52.365 41.075 12.507-22.627a14.146 14.146 0 0 1 4.727-5.062M32.407 118.619a14.139 14.139 0 0 1-7.034-1.768c-6.857-3.78-9.353-12.402-5.561-19.25l16.634-30.1a14.097 14.097 0 0 1 4.518-4.923\" />\n <path d=\"M41.211 78.85c11.332 6.248 25.583 2.14 31.84-9.177l17.518-31.691c6.256-11.317 2.142-25.55-9.19-31.798-6.085-3.357-13.018-3.724-19.104-1.59A23.31 23.31 0 0 0 49.541 15.36L36.863 38.298l7.989 5.036 12.506-22.627c3.786-6.848 12.419-9.34 19.276-5.554 6.856 3.78 9.353 12.402 5.561 19.25l-16.634 30.1c-3.785 6.848-12.418 9.341-19.275 5.555l-5.075 8.791ZM29.5 130.447c12.361-1.37 19.2-6.994 22.966-13.804l12.678-22.936-8.305-5.239\" />\n <path d=\"m55.72 61.947-.442.764 5.511-9.55c-6.901-3.806-18.65-3.124-27.105.814M44.85 43.523l7.635-2.486m-4.221 23.264 7.217-1.723m-9.316 7.517 7.59-2.405m-.562-12.156 7.508-2.221m10.136-51.32L62.761 4.43M49.642 90.778l7.514-2.26m.474 7.448 7.514-2.26m-50.306-60.13c7.135 0 12.918-5.776 12.918-12.9 0-7.126-5.783-12.902-12.918-12.902-7.134 0-12.917 5.776-12.917 12.901s5.783 12.901 12.918 12.901Z\" />\n <path d=\"M15.724 7.774h3.197c7.135 0 12.918 5.776 12.918 12.901 0 7.126-5.783 12.901-12.918 12.901h-3.425m65.112 66.935h3.198c7.135 0 12.918 5.775 12.918 12.901 0 7.125-5.783 12.9-12.918 12.9h-3.425\" />\n <path d=\"M79.717 126.312c7.135 0 12.918-5.775 12.918-12.9s-5.783-12.901-12.918-12.901c-7.134 0-12.917 5.776-12.917 12.901s5.783 12.9 12.917 12.9ZM53.281 55.414c-11.33-6.248-25.582-2.14-31.839 9.177L3.924 96.281c-6.257 11.318-2.142 25.55 9.189 31.799 11.331 6.248 25.582 2.139 31.839-9.177l12.677-22.937-7.988-5.036-12.507 22.627c-3.785 6.848-12.418 9.341-19.275 5.554-6.857-3.781-9.353-12.402-5.561-19.25l16.633-30.1c3.786-6.848 12.419-9.341 19.276-5.555l5.074-8.792Z\" />\n </g>\n </svg>\n );\n },\n);\nLinkGraphic.displayName = \"LinkGraphic\";\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const WalletGraphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"128\"\n height=\"102\"\n viewBox=\"0 0 128 102\"\n fill=\"none\"\n {...props}\n >\n <path\n fill=\"currentColor\"\n d=\"m.96 25.93-.36-.35.36.85v-.5Zm7.79-7.81v-.5h-.21l-.15.15.36.35ZM1.3 26.28l7.79-7.8-.7-.71-7.8 7.8.7.71Zm7.44-7.66H10v-1H8.75v1Zm29.22 6.8h-37v1h37.01v-1Z\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M82.25 26.08c0 12.25-9.92 22.2-22.14 22.2a22.17 22.17 0 0 1-22.14-22.2H1.1v74.82h118.02V26.08H82.25Zm44.33 67.02h.33V18.27h-5.7\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M74.52 42.92a22.4 22.4 0 0 1-11.43 3.3 22.5 22.5 0 0 1-22.46-22.53H9.52M119.22 101l7.78-7.82m-7.88-67.1 7.79-7.81m-44.78 7.72 2.73-2.3m-46.89 2.39 2.39-2.4\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M9.86 23.69V5.72h107.97v18.04H84.65\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M117.83 20.46h3.39V1H13.25v4.72M9.36 23.69h31.78\"\n />\n </svg>\n );\n },\n);\nWalletGraphic.displayName = \"WalletGraphic\";\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const Web3Graphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"142\"\n height=\"108\"\n viewBox=\"0 0 142 108\"\n fill=\"none\"\n {...props}\n >\n <g stroke=\"currentColor\" strokeLinejoin=\"round\">\n <path d=\"m91.26 35.8.06-10.46L71.3 1v10.53L87 30.5m-36.11 5.24-.06-10.45L71.3 1v10.53L55 30.5\" />\n <path d=\"M71 59.55V49.17L50.83 25.3l.06 10.45L57 42.5m14 17.05V49.18l20.33-23.84-.07 10.45L86 42M1 59.68l.22-9.07 35.33-19.8-.1 9L9 55\" />\n <path d=\"M36.55 30.8s-.08 5.92-.1 9l.1-9ZM71 59.51v-9.07L36.55 30.8l-.1 9L63.5 55\" />\n <path d=\"M71 59.51v-9.07L36.44 70.78l-.1 9.14L55.5 68.5\" />\n <path d=\"M1.22 50.6a77387.2 77387.2 0 0 0 35.22 20.18l-.1 9.14L1 59.68l.23-9.07h-.01ZM141 59.68l-.23-9.07-35.33-19.8.11 9L133 55\" />\n <path d=\"m105.44 30.8.11 9-.1-9Z\" />\n <path d=\"M71 59.51v-9.07l34.44-19.64.11 9L78.5 55\" />\n <path d=\"M71 59.51v-9.07l34.56 20.34.1 9.14L87 69\" />\n <path d=\"M140.78 50.6a78487.3 78487.3 0 0 1-35.23 20.18l.11 9.14L141 59.68l-.23-9.07ZM50.83 80.15l.06-6.33 20.1-23.38H71v9.26L55 79\" />\n <path d=\"M71.3 97.6 50.89 73.81l-.06 9.33L71.3 107v-9.4Zm20.03-14.5-.07-9.33L71 50.44v9.26l16 18.8\" />\n <path d=\"m71.3 97.6 19.96-23.83.06 9.33L71.3 107v-9.4Z\" />\n </g>\n </svg>\n );\n },\n);\nWeb3Graphic.displayName = \"Web3Graphic\";\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { ReactNode, cloneElement, forwardRef, isValidElement } from \"react\";\n\nexport interface HeadlessComponentProps {\n /** A class name for styling the element. */\n className?: string;\n /**\n * Whether to render as the child element instead of the default element provided.\n * All props will be merged into the child element.\n */\n asChild?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Gets an HTML element type from its tag name\n * @example\n * HTMLElementFromTag<\"img\"> // resolved type: HTMLImageElement\n */\ntype HTMLElementFromTag<T extends keyof JSX.IntrinsicElements> =\n JSX.IntrinsicElements[T] extends React.ClassAttributes<infer Element>\n ? Element\n : HTMLElement;\n\nexport function createHeadlessComponent<\n TElement extends keyof JSX.IntrinsicElements,\n>(\n displayName: string,\n elementType: TElement,\n props?:\n | JSX.IntrinsicElements[TElement]\n | ((displayName: string) => JSX.IntrinsicElements[TElement]),\n) {\n const component = forwardRef<\n HTMLElementFromTag<TElement>,\n HeadlessComponentProps\n >(({ className, asChild, children }, ref) => {\n const Component = asChild ? Slot : elementType;\n\n const { children: defaultChildren, ...resolvedProps } =\n typeof props === \"function\" ? props(displayName) : (props ?? {});\n const resolvedChildren =\n /**\n * Use props' default children if no children are set in the component element's children and when asChild is true.\n */\n asChild && isValidElement(children) && !children.props.children\n ? cloneElement(children, {}, defaultChildren)\n : (children ?? defaultChildren);\n\n return (\n /**\n * Due to the complexity of the types at play, TypeScript reports the\n * following error for our JSX below:\n *\n * `Expression produces a union type that is too complex to represent.`\n *\n * We can safely ignore this error and retain accurate return types for\n * consumers of this function. The only drawback is that type-checking is\n * ignored for the JSX block below.\n */\n // @ts-expect-error\n <Component ref={ref} className={className} {...resolvedProps}>\n {resolvedChildren}\n </Component>\n );\n });\n component.displayName = displayName;\n\n return component;\n}\n","import { forwardRef } from \"react\";\nimport { SmallAptosLogo } from \"../graphics/SmallAptosLogo\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport const APTOS_PRIVACY_POLICY_URL = \"https://aptoslabs.com/privacy\";\n\nconst Root = createHeadlessComponent(\"AptosPrivacyPolicy.Root\", \"div\");\n\nconst Disclaimer = createHeadlessComponent(\n \"AptosPrivacyPolicy.Disclaimer\",\n \"span\",\n { children: \"By continuing, you agree to Aptos Labs'\" },\n);\n\nconst Link = createHeadlessComponent(\"AptosPrivacyPolicy.Disclaimer\", \"a\", {\n href: APTOS_PRIVACY_POLICY_URL,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: \"Privacy Policy\",\n});\n\nconst PoweredBy = forwardRef<\n HTMLDivElement,\n Pick<HeadlessComponentProps, \"className\">\n>(({ className }, ref) => {\n return (\n <div ref={ref} className={className}>\n <span>Powered by</span>\n <SmallAptosLogo />\n <span>Aptos Labs</span>\n </div>\n );\n});\nPoweredBy.displayName = \"AptosPrivacyPolicy.PoweredBy\";\n\n/**\n * A headless component for rendering the Aptos Labs privacy policy disclaimer\n * that should be placed under the Aptos Connect login options.\n */\nexport const AptosPrivacyPolicy = Object.assign(Root, {\n Disclaimer,\n Link,\n PoweredBy,\n});\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const SmallAptosLogo = forwardRef<\n SVGSVGElement,\n SVGProps<SVGSVGElement>\n>((props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM7.17547 3.67976C7.13401 3.72309 7.07649 3.74757 7.01648 3.74757H3.00775C3.69185 2.83824 4.77995 2.25 6.00569 2.25C7.23142 2.25 8.31953 2.83824 9.00362 3.74757H8.28524C8.20824 3.74757 8.13498 3.71468 8.08401 3.65701L7.81608 3.35416C7.77618 3.30896 7.71882 3.28308 7.6585 3.28308H7.6454C7.58805 3.28308 7.53318 3.30646 7.49343 3.34792L7.17547 3.67976ZM8.05656 4.75897H7.39569C7.31869 4.75897 7.24543 4.72593 7.19447 4.66842L6.92638 4.36557C6.88647 4.32036 6.82896 4.29465 6.7688 4.29465C6.70863 4.29465 6.65112 4.32052 6.61121 4.36557L6.38131 4.6254C6.30603 4.71034 6.19801 4.75913 6.08454 4.75913H2.46703C2.36401 5.05278 2.29683 5.36296 2.27002 5.68467H5.68505C5.74506 5.68467 5.80258 5.66019 5.84404 5.61686L6.16201 5.28502C6.20175 5.24356 6.25662 5.22018 6.31398 5.22018H6.32707C6.38739 5.22018 6.44475 5.24606 6.48465 5.29126L6.75258 5.59411C6.80355 5.65178 6.87681 5.68467 6.95381 5.68467H9.74133C9.71452 5.3628 9.64734 5.05263 9.54431 4.75913H8.05641L8.05656 4.75897ZM4.33651 7.63095C4.39652 7.63095 4.45404 7.60648 4.4955 7.56315L4.81347 7.23131C4.85321 7.18985 4.90808 7.16647 4.96544 7.16647H4.97853C5.03885 7.16647 5.09621 7.19234 5.13611 7.23739L5.40404 7.54024C5.45501 7.59791 5.52827 7.6308 5.60527 7.6308H9.38285C9.52438 7.33839 9.62803 7.02463 9.68975 6.69591H6.06383C5.98683 6.69591 5.91357 6.66287 5.8626 6.60535L5.59467 6.3025C5.55477 6.2573 5.49725 6.23158 5.43709 6.23158C5.37692 6.23158 5.31941 6.25746 5.27951 6.3025L5.0496 6.56233C4.97432 6.64728 4.86631 6.69606 4.75268 6.69606H2.32147C2.3832 7.02479 2.487 7.33855 2.62837 7.63095H4.33651ZM5.57359 8.55745H4.59116C4.51417 8.55745 4.44091 8.52441 4.38994 8.46689L4.12201 8.16404C4.0821 8.11884 4.02459 8.09312 3.96442 8.09312C3.90426 8.09312 3.84675 8.119 3.80684 8.16404L3.57694 8.42387C3.50166 8.50882 3.39364 8.55761 3.28001 8.55761H3.26474C3.94915 9.29096 4.92378 9.74998 6.00596 9.74998C7.08815 9.74998 8.06262 9.29096 8.74719 8.55761H5.57359V8.55745Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n});\nSmallAptosLogo.displayName = \"SmallAptosLogo\";\n","import {\n AdapterNotDetectedWallet,\n AdapterWallet,\n WalletReadyState,\n isRedirectable,\n} from \"@aptos-labs/wallet-adapter-core\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { createContext, forwardRef, useCallback, useContext } from \"react\";\nimport { useWallet } from \"../useWallet\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport interface WalletItemProps extends HeadlessComponentProps {\n /** The wallet option to be displayed. */\n wallet: AdapterWallet | AdapterNotDetectedWallet;\n /** A callback to be invoked when the wallet is connected. */\n onConnect?: () => void;\n}\n\nfunction useWalletItemContext(displayName: string) {\n const context = useContext(WalletItemContext);\n\n if (!context) {\n throw new Error(`\\`${displayName}\\` must be used within \\`WalletItem\\``);\n }\n\n return context;\n}\n\nconst WalletItemContext = createContext<{\n wallet: AdapterWallet | AdapterNotDetectedWallet;\n connectWallet: () => void;\n} | null>(null);\n\nconst Root = forwardRef<HTMLDivElement, WalletItemProps>(\n ({ wallet, onConnect, className, asChild, children }, ref) => {\n const { connect } = useWallet();\n\n const connectWallet = useCallback(() => {\n connect(wallet.name);\n onConnect?.();\n }, [connect, wallet.name, onConnect]);\n\n const isWalletReady = wallet.readyState === WalletReadyState.Installed;\n\n const mobileSupport =\n \"deeplinkProvider\" in wallet && wallet.deeplinkProvider;\n\n if (!isWalletReady && isRedirectable() && !mobileSupport) return null;\n\n const Component = asChild ? Slot : \"div\";\n\n return (\n <WalletItemContext.Provider value={{ wallet, connectWallet }}>\n <Component ref={ref} className={className}>\n {children}\n </Component>\n </WalletItemContext.Provider>\n );\n }\n);\nRoot.displayName = \"WalletItem\";\n\nconst Icon = createHeadlessComponent(\n \"WalletItem.Icon\",\n \"img\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n src: context.wallet.icon,\n alt: `${context.wallet.name} icon`,\n };\n }\n);\n\nconst Name = createHeadlessComponent(\n \"WalletItem.Name\",\n \"div\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n children: context.wallet.name,\n };\n }\n);\n\nconst ConnectButton = createHeadlessComponent(\n \"WalletItem.ConnectButton\",\n \"button\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n onClick: context.connectWallet,\n children: \"Connect\",\n };\n }\n);\n\nconst InstallLink = createHeadlessComponent(\n \"WalletItem.InstallLink\",\n \"a\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n href: context.wallet.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: \"Install\",\n };\n }\n);\n\n/** A headless component for rendering a wallet option's name, icon, and either connect button or install link. */\nexport const WalletItem = Object.assign(Root, {\n Icon,\n Name,\n ConnectButton,\n InstallLink,\n});\n"],"mappings":";AAAA,cAAc;;;ACAd;AAAA,EAcE;AAAA,OAIK;AACP,SAAwB,UAAU,WAAW,mBAAmB;;;ACnBhE,SAAS,YAAY,qBAAqB;AA8C1C,IAAM,kBAAkB;AAAA,EACtB,WAAW;AACb;AAEO,IAAM,gBAAgB;AAAA,EAC3B;AACF;AAEO,SAAS,YAAgC;AAC9C,QAAM,UAAU,WAAW,aAAa;AACxC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AACA,SAAO;AACT;;;AD5DA;AA+BA,IAAM,eAKF;AAAA,EACF,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;AAEO,IAAM,6BAA2D,CAAC;AAAA,EACvE;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,mBAAmB;AAAA,EACnB;AACF,MAAgC;AAC9B,QAAM,CAAC,EAAE,SAAS,SAAS,WAAW,OAAO,GAAG,QAAQ,IACtD,SAAS,YAAY;AAEvB,QAAM,CAAC,WAAW,YAAY,IAAI,SAAkB,IAAI;AACxD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAqB;AAEzD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAuC,CAAC,CAAC;AACvE,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAElD,CAAC,CAAC;AAEJ,YAAU,MAAM;AACd,UAAMA,cAAa,IAAI;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,IACF;AACA,kBAAcA,WAAU;AAAA,EAC1B,GAAG,CAAC,CAAC;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AAAN,KAAC,kBAAkB,UAAlB;AAAA,MAA2B,OAAO,EAAE,QAAQ,cAAc;AAAA,MACzD,0BAAAA,KAAC;AAAA,QAAU;AAAA,QAAU;AAAA,QAClB;AAAA,OACH;AAAA,KACF;AAAA,EAEJ;AACF;AACAG,MAAK,cAAc;AAEnB,IAAM,OAAO;AAAA,EACX;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,KAAK,QAAQ,OAAO;AAAA,MACpB,KAAK,GAAG,QAAQ,OAAO;AAAA,IACzB;AAAA,EACF;AACF;AAEA,IAAM,OAAO;AAAA,EACX;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,UAAU,QAAQ,OAAO;AAAA,IAC3B;AAAA,EACF;AACF;AAEA,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,SAAS,QAAQ;AAAA,MACjB,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,MAAM,QAAQ,OAAO;AAAA,MACrB,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAGO,IAAM,aAAa,OAAO,OAAOA,OAAM;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":["walletCore","network","wallet","wallets","createContext","useContext","useState","jsx","forwardRef","jsx","jsxs","forwardRef","jsx","jsxs","forwardRef","jsx","jsx","jsxs","createContext","useContext","useState","forwardRef","forwardRef","jsx","jsx","jsxs","Root","forwardRef","Slot","createContext","forwardRef","useCallback","useContext","jsx","useContext","createContext","Root","forwardRef","useCallback","Slot"]}
@@ -1,20 +1,27 @@
1
1
  /// <reference types="react" />
2
- import { AccountInfo, NetworkInfo, WalletInfo, SignMessagePayload, SignMessageResponse, Wallet, InputGenerateTransactionOptions, AnyRawTransaction, InputTransactionData, InputSubmitTransactionData, PendingTransactionResponse, AccountAuthenticator, Types, WalletName, AptosChangeNetworkOutput, Network, AptosStandardSupportedWallet } from "@aptos-labs/wallet-adapter-core";
2
+ import { AccountAuthenticator, AccountInfo, AdapterWallet, AnyRawTransaction, AptosSignAndSubmitTransactionOutput, InputTransactionData, NetworkInfo, AptosSignMessageInput, AptosSignMessageOutput, AdapterNotDetectedWallet, Network, AptosChangeNetworkOutput, PendingTransactionResponse, InputSubmitTransactionData } from "@aptos-labs/wallet-adapter-core";
3
3
  export interface WalletContextState {
4
4
  connected: boolean;
5
5
  isLoading: boolean;
6
6
  account: AccountInfo | null;
7
7
  network: NetworkInfo | null;
8
- connect(walletName: WalletName): void;
8
+ connect(walletName: string): void;
9
+ signAndSubmitTransaction(transaction: InputTransactionData): Promise<AptosSignAndSubmitTransactionOutput>;
10
+ signTransaction(args: {
11
+ transactionOrPayload: AnyRawTransaction | InputTransactionData;
12
+ asFeePayer?: boolean;
13
+ }): Promise<{
14
+ authenticator: AccountAuthenticator;
15
+ rawTransaction: Uint8Array;
16
+ }>;
17
+ signMessage(message: AptosSignMessageInput): Promise<AptosSignMessageOutput>;
18
+ signMessageAndVerify(message: AptosSignMessageInput): Promise<boolean>;
9
19
  disconnect(): void;
10
- wallet: WalletInfo | null;
11
- wallets?: ReadonlyArray<Wallet | AptosStandardSupportedWallet>;
12
- signAndSubmitTransaction(transaction: InputTransactionData): Promise<any>;
13
- signTransaction(transactionOrPayload: AnyRawTransaction | Types.TransactionPayload, asFeePayer?: boolean, options?: InputGenerateTransactionOptions): Promise<AccountAuthenticator>;
14
- submitTransaction(transaction: InputSubmitTransactionData): Promise<PendingTransactionResponse>;
15
- signMessage(message: SignMessagePayload): Promise<SignMessageResponse>;
16
- signMessageAndVerify(message: SignMessagePayload): Promise<boolean>;
17
20
  changeNetwork(network: Network): Promise<AptosChangeNetworkOutput>;
21
+ submitTransaction(transaction: InputSubmitTransactionData): Promise<PendingTransactionResponse>;
22
+ wallet: AdapterWallet | null;
23
+ wallets: ReadonlyArray<AdapterWallet>;
24
+ notDetectedWallets: ReadonlyArray<AdapterNotDetectedWallet>;
18
25
  }
19
26
  export declare const WalletContext: import("react").Context<WalletContextState>;
20
27
  export declare function useWallet(): WalletContextState;
@@ -1 +1 @@
1
- {"version":3,"file":"useWallet.d.ts","sourceRoot":"","sources":["../src/useWallet.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,EACN,+BAA+B,EAC/B,iBAAiB,EACjB,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,EAC1B,oBAAoB,EACpB,KAAK,EACL,UAAU,EACV,wBAAwB,EACxB,OAAO,EACP,4BAA4B,EAC7B,MAAM,iCAAiC,CAAC;AAGzC,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IACtC,UAAU,IAAI,IAAI,CAAC;IACnB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,4BAA4B,CAAC,CAAC;IAC/D,wBAAwB,CAAC,WAAW,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1E,eAAe,CACb,oBAAoB,EAAE,iBAAiB,GAAG,KAAK,CAAC,kBAAkB,EAClE,UAAU,CAAC,EAA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a,EAAE,oBAAoB,CAAC;QACpC,cAAc,EAAE,UAAU,CAAC;KAC5B,CAAC,CAAC;IACH,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC7E,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvE,UAAU,IAAI,IAAI,CAAC;IACnB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACnE,iBAAiB,CACf,WAAW,EAAE,0BAA0B,GACtC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACvC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACtC,kBAAkB,EAAE,aAAa,CAAC,wBAAwB,CAAC,CAAC;CAC7D;AAMD,eAAO,MAAM,aAAa,6CAEzB,CAAC;AAEF,wBAAgB,SAAS,IAAI,kBAAkB,CAM9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-labs/wallet-adapter-react",
3
- "version": "3.8.0",
3
+ "version": "4.0.0",
4
4
  "description": "Aptos Wallet Adapter React Provider",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@radix-ui/react-slot": "^1.0.2",
41
- "@aptos-labs/wallet-adapter-core": "4.25.0"
41
+ "@aptos-labs/wallet-adapter-core": "5.0.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": "^18"