@aptos-labs/wallet-adapter-core 8.2.0-alpha.4 → 8.3.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.
Files changed (56) hide show
  1. package/README.md +181 -5
  2. package/dist/index.js +18 -9
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +18 -9
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/registry.d.ts.map +1 -1
  7. package/dist/utils/types.d.ts +1 -1
  8. package/dist/utils/types.d.ts.map +1 -1
  9. package/dist/version.d.ts +1 -1
  10. package/dist/version.d.ts.map +1 -1
  11. package/package.json +4 -5
  12. package/src/registry.ts +16 -7
  13. package/src/utils/helpers.ts +1 -1
  14. package/src/utils/types.ts +0 -1
  15. package/src/version.ts +1 -1
  16. package/dist/AIP62StandardWallets/WalletStandard.d.ts +0 -44
  17. package/dist/AIP62StandardWallets/WalletStandard.d.ts.map +0 -1
  18. package/dist/AIP62StandardWallets/index.d.ts +0 -3
  19. package/dist/AIP62StandardWallets/index.d.ts.map +0 -1
  20. package/dist/AIP62StandardWallets/registry.d.ts +0 -17
  21. package/dist/AIP62StandardWallets/registry.d.ts.map +0 -1
  22. package/dist/AIP62StandardWallets/sdkWallets.d.ts +0 -4
  23. package/dist/AIP62StandardWallets/sdkWallets.d.ts.map +0 -1
  24. package/dist/AIP62StandardWallets/types.d.ts +0 -12
  25. package/dist/AIP62StandardWallets/types.d.ts.map +0 -1
  26. package/dist/CrossChainCore.d.ts +0 -28
  27. package/dist/CrossChainCore.d.ts.map +0 -1
  28. package/dist/LegacyWalletPlugins/WalletCoreV1.d.ts +0 -50
  29. package/dist/LegacyWalletPlugins/WalletCoreV1.d.ts.map +0 -1
  30. package/dist/LegacyWalletPlugins/conversion.d.ts +0 -21
  31. package/dist/LegacyWalletPlugins/conversion.d.ts.map +0 -1
  32. package/dist/LegacyWalletPlugins/index.d.ts +0 -4
  33. package/dist/LegacyWalletPlugins/index.d.ts.map +0 -1
  34. package/dist/LegacyWalletPlugins/types.d.ts +0 -116
  35. package/dist/LegacyWalletPlugins/types.d.ts.map +0 -1
  36. package/dist/WalletCoreNew.d.ts +0 -194
  37. package/dist/WalletCoreNew.d.ts.map +0 -1
  38. package/dist/__tests__/WalletCore.test.d.ts +0 -2
  39. package/dist/__tests__/WalletCore.test.d.ts.map +0 -1
  40. package/dist/index.cjs +0 -2376
  41. package/dist/index.cjs.map +0 -1
  42. package/dist/index.d.mts +0 -534
  43. package/dist/utils/aptosConnect.d.ts +0 -18
  44. package/dist/utils/aptosConnect.d.ts.map +0 -1
  45. package/dist/utils/crossChain/chains/mainnet/index.d.ts +0 -45
  46. package/dist/utils/crossChain/chains/mainnet/index.d.ts.map +0 -1
  47. package/dist/utils/crossChain/chains/testnet/index.d.ts +0 -50
  48. package/dist/utils/crossChain/chains/testnet/index.d.ts.map +0 -1
  49. package/dist/utils/crossChain/tokens/mainnet.d.ts +0 -15
  50. package/dist/utils/crossChain/tokens/mainnet.d.ts.map +0 -1
  51. package/dist/utils/crossChain/tokens/testnet.d.ts +0 -11
  52. package/dist/utils/crossChain/tokens/testnet.d.ts.map +0 -1
  53. package/dist/utils/logger.d.ts +0 -6
  54. package/dist/utils/logger.d.ts.map +0 -1
  55. package/dist/utils/scopePollingDetectionStrategy.d.ts +0 -2
  56. package/dist/utils/scopePollingDetectionStrategy.d.ts.map +0 -1
package/dist/index.d.mts DELETED
@@ -1,534 +0,0 @@
1
- import { AptosWallet, AccountInfo, NetworkInfo, AptosSignInInput, AptosSignInOutput, AptosSignAndSubmitTransactionOutput, AptosSignMessageInput, AptosSignMessageOutput, AptosChangeNetworkOutput, AptosSignInBoundFields } from '@aptos-labs/wallet-standard';
2
- export { AccountInfo, AptosChangeNetworkOutput, AptosSignAndSubmitTransactionOutput, AptosSignInBoundFields, AptosSignInInput, AptosSignInOutput, AptosSignMessageInput, AptosSignMessageOutput, AptosSignTransactionOutputV1_1, NetworkInfo } from '@aptos-labs/wallet-standard';
3
- import EventEmitter from 'eventemitter3';
4
- import * as _aptos_labs_ts_sdk from '@aptos-labs/ts-sdk';
5
- import { AccountAddressInput, InputGenerateTransactionPayloadData, InputGenerateTransactionOptions, InputTransactionPluginData, Network, TransactionSubmitter, AnyRawTransaction, AccountAuthenticator, InputSubmitTransactionData, PendingTransactionResponse, AptosConfig } from '@aptos-labs/ts-sdk';
6
- export { AccountAddress, AccountAuthenticator, AnyPublicKey, AnyRawTransaction, InputGenerateTransactionOptions, InputSubmitTransactionData, Network, PendingTransactionResponse, TransactionSubmitter } from '@aptos-labs/ts-sdk';
7
- import { AptosConnectWalletConfig } from '@aptos-connect/wallet-adapter-plugin';
8
-
9
- declare enum WalletReadyState {
10
- /**
11
- * Wallet can only be in one of two states - installed or not installed
12
- * Installed: wallets are detected by the browser event listeners and means they are installed on the user's browser.
13
- * NotDetected: wallets are not detected by the browser event listeners and means they are not installed on the user's browser.
14
- */
15
- Installed = "Installed",
16
- NotDetected = "NotDetected"
17
- }
18
- declare enum NetworkName {
19
- Mainnet = "mainnet",
20
- Testnet = "testnet",
21
- Devnet = "devnet"
22
- }
23
- declare const ChainIdToAnsSupportedNetworkMap: Record<string, string>;
24
- /**
25
- * The base URL for all Aptos Connect wallets.
26
- *
27
- * @deprecated Use {@link PETRA_WEB_BASE_URL} instead.
28
- */
29
- declare const APTOS_CONNECT_BASE_URL = "https://aptosconnect.app";
30
- /** The base URL for all Petra Web wallets. */
31
- declare const PETRA_WEB_BASE_URL = "https://web.petra.app";
32
- /** The name of the generic wallet for Petra Web. */
33
- declare const PETRA_WEB_GENERIC_WALLET_NAME = "Petra Web";
34
- /** The name of the Petra wallet. */
35
- declare const PETRA_WALLET_NAME = "Petra";
36
- /** The default connection fallbacks for wallets that are not installed. */
37
- declare const DEFAULT_WALLET_CONNECTION_FALLBACKS: {
38
- Petra: string;
39
- };
40
- /**
41
- * The URL to the Aptos Connect account page if the user is signed in to Aptos Connect.
42
- *
43
- * @deprecated Use {@link PETRA_WEB_ACCOUNT_URL} instead.
44
- */
45
- declare const APTOS_CONNECT_ACCOUNT_URL = "https://aptosconnect.app/dashboard/main-account";
46
- /** The URL to the Petra Web account page if the user is signed in to Petra Web. */
47
- declare const PETRA_WEB_ACCOUNT_URL = "https://web.petra.app/dashboard/main-account";
48
-
49
- interface AptosStandardSupportedWallet {
50
- name: string;
51
- url: string;
52
- icon: `data:image/${"svg+xml" | "webp" | "png" | "gif"};base64,${string}`;
53
- readyState: WalletReadyState.NotDetected;
54
- isAIP62Standard: true;
55
- deeplinkProvider?: string;
56
- isAptosNativeWallet?: boolean;
57
- }
58
- type AvailableWallets = "Continue with Apple" | "Continue with Google" | "Petra Web" | "OKX Wallet" | "Petra" | "Nightly" | "Pontem Wallet" | "Backpack" | "MSafe" | "Bitget Wallet" | "Gate Wallet" | "Cosmostation Wallet";
59
- type InputTransactionDataInner = {
60
- sender?: AccountAddressInput;
61
- data: InputGenerateTransactionPayloadData;
62
- options?: InputGenerateTransactionOptions & {
63
- expirationSecondsFromNow?: number;
64
- expirationTimestamp?: number;
65
- };
66
- /** This will always be set to true if a custom transaction submitter is provided. */
67
- withFeePayer?: boolean;
68
- };
69
- /**
70
- * If `transactionSubmitter` is set it will be used, and override any transaction
71
- * submitter configured in the DappConfig.
72
- *
73
- * The `pluginParams` parameter is used to provide additional parameters to a
74
- * transaction submitter plugin, whether provided here or configured in the
75
- * DappConfig.
76
- */
77
- type InputTransactionData = InputTransactionDataInner & InputTransactionPluginData;
78
- type WalletInfo = {
79
- name: string;
80
- icon: string;
81
- url: string;
82
- };
83
-
84
- type AdapterWallet = AptosWallet & {
85
- readyState?: WalletReadyState;
86
- isAptosNativeWallet?: boolean;
87
- /** A fallback wallet to use when this wallet is not installed */
88
- fallbackWallet?: AdapterWallet;
89
- };
90
- type AdapterNotDetectedWallet = Omit<AdapterWallet, "features" | "version" | "chains" | "accounts"> & {
91
- readyState: WalletReadyState.NotDetected;
92
- };
93
- interface DappConfig {
94
- network: Network;
95
- /**
96
- * If provided, the wallet adapter will submit transactions using the provided
97
- * transaction submitter rather than via the wallet.
98
- */
99
- transactionSubmitter?: TransactionSubmitter;
100
- aptosApiKeys?: Partial<Record<Network, string>>;
101
- aptosConnectDappId?: string;
102
- aptosConnect?: Omit<AptosConnectWalletConfig, "network">;
103
- /**
104
- * @deprecated will be removed in a future version
105
- */
106
- mizuwallet?: {
107
- manifestURL: string;
108
- appId?: string;
109
- };
110
- /**
111
- * @deprecated will be removed in a future version
112
- */
113
- msafeWalletConfig?: {
114
- appId?: string;
115
- appUrl?: string;
116
- };
117
- crossChainWallets?: boolean;
118
- }
119
- declare interface WalletCoreEvents {
120
- connect(account: AccountInfo | null): void;
121
- disconnect(): void;
122
- standardWalletsAdded(wallets: AdapterWallet): void;
123
- standardWalletsHiddenAdded(wallets: AdapterWallet): void;
124
- standardNotDetectedWalletAdded(wallets: AdapterNotDetectedWallet): void;
125
- networkChange(network: NetworkInfo | null): void;
126
- accountChange(account: AccountInfo | null): void;
127
- }
128
- type AdapterAccountInfo = Omit<AccountInfo, "ansName"> & {
129
- ansName?: string;
130
- };
131
- declare class WalletCore extends EventEmitter<WalletCoreEvents> {
132
- private _wallet;
133
- private readonly _sdkWallets;
134
- private _standard_wallets;
135
- private _standard_not_detected_wallets;
136
- private _standard_wallets_hidden;
137
- private _network;
138
- private _connected;
139
- private _connecting;
140
- private _account;
141
- private _dappConfig;
142
- private _optInWallets;
143
- private _hideWallets;
144
- private _disableTelemetry;
145
- private readonly ga4;
146
- constructor(optInWallets?: ReadonlyArray<AvailableWallets>, dappConfig?: DappConfig, disableTelemetry?: boolean, hideWallets?: ReadonlyArray<AvailableWallets>);
147
- private fetchExtensionAIP62AptosWallets;
148
- /**
149
- * Set AIP-62 extension wallets
150
- *
151
- * @param extensionwWallets
152
- */
153
- private setExtensionAIP62Wallets;
154
- /**
155
- * Set AIP-62 SDK wallets
156
- */
157
- private fetchSDKAIP62AptosWallets;
158
- private isAptosNativeWallet;
159
- private appendNotDetectedStandardSupportedWallets;
160
- /**
161
- * A function that excludes an AIP-62 compatible wallet the dapp doesnt want to include
162
- *
163
- * @param wallet AdapterWallet | AdapterNotDetectedWallet
164
- * @returns boolean
165
- */
166
- excludeWallet(wallet: AdapterWallet | AdapterNotDetectedWallet): boolean;
167
- /**
168
- * A function that hides an AIP-62 compatible wallet from normal display.
169
- *
170
- * @param wallet AdapterWallet | AdapterNotDetectedWallet
171
- * @returns boolean
172
- */
173
- hideWallet(wallet: AdapterWallet | AdapterNotDetectedWallet): boolean;
174
- private recordEvent;
175
- /**
176
- * Helper function to ensure wallet exists
177
- *
178
- * @param wallet A wallet
179
- */
180
- private ensureWalletExists;
181
- /**
182
- * Helper function to ensure account exists
183
- *
184
- * @param account An account
185
- */
186
- private ensureAccountExists;
187
- /**
188
- * Queries and sets ANS name for the current connected wallet account
189
- */
190
- private setAnsName;
191
- /**
192
- * Function to cleat wallet adapter data.
193
- *
194
- * - Removes current connected wallet state
195
- * - Removes current connected account state
196
- * - Removes current connected network state
197
- * - Removes autoconnect local storage value
198
- */
199
- private clearData;
200
- /**
201
- * Sets the connected wallet
202
- *
203
- * @param wallet A wallet
204
- */
205
- setWallet(wallet: AptosWallet | null): void;
206
- /**
207
- * Sets the connected account
208
- *
209
- * @param account An account
210
- */
211
- setAccount(account: AccountInfo | null): void;
212
- /**
213
- * Sets the connected network
214
- *
215
- * @param network A network
216
- */
217
- setNetwork(network: NetworkInfo | null): void;
218
- /**
219
- * Helper function to detect whether a wallet is connected
220
- *
221
- * @returns boolean
222
- */
223
- isConnected(): boolean;
224
- /**
225
- * Getter to fetch all detected wallets
226
- */
227
- get wallets(): ReadonlyArray<AptosWallet>;
228
- /**
229
- * Getter to fetch all hidden wallets
230
- */
231
- get hiddenWallets(): ReadonlyArray<AdapterWallet>;
232
- get notDetectedWallets(): ReadonlyArray<AdapterNotDetectedWallet>;
233
- /**
234
- * Getter for the current connected wallet
235
- *
236
- * @return wallet info
237
- * @throws WalletNotSelectedError
238
- */
239
- get wallet(): AptosWallet | null;
240
- /**
241
- * Getter for the current connected account
242
- *
243
- * @return account info
244
- * @throws WalletAccountError
245
- */
246
- get account(): AccountInfo | null;
247
- /**
248
- * Getter for the current wallet network
249
- *
250
- * @return network info
251
- * @throws WalletGetNetworkError
252
- */
253
- get network(): NetworkInfo | null;
254
- /**
255
- * Helper function to run some checks before we connect with a wallet.
256
- *
257
- * @param walletName. The wallet name we want to connect with.
258
- */
259
- connect(walletName: string): Promise<void | string>;
260
- /**
261
- * Signs into the wallet by connecting and signing an authentication messages.
262
- *
263
- * For more information, visit: https://siwa.aptos.dev
264
- *
265
- * @param args
266
- * @param args.input The AptosSignInInput which defines how the SIWA Message should be constructed
267
- * @param args.walletName The name of the wallet to sign into
268
- * @returns The AptosSignInOutput which contains the account and signature information
269
- */
270
- signIn(args: {
271
- input: AptosSignInInput;
272
- walletName: string;
273
- }): Promise<AptosSignInOutput>;
274
- /**
275
- * Connects a wallet to the dapp.
276
- * On connect success, we set the current account and the network, and keeping the selected wallet
277
- * name in LocalStorage to support autoConnect function.
278
- *
279
- * @param selectedWallet. The wallet we want to connect.
280
- * @emit emits "connect" event
281
- * @throws WalletConnectionError
282
- */
283
- private connectWallet;
284
- /**
285
- * Disconnect the current connected wallet. On success, we clear the
286
- * current account, current network and LocalStorage data.
287
- *
288
- * @emit emits "disconnect" event
289
- * @throws WalletDisconnectionError
290
- */
291
- disconnect(): Promise<void>;
292
- /**
293
- * Signs and submits a transaction to chain
294
- *
295
- * @param transactionInput InputTransactionData
296
- * @returns AptosSignAndSubmitTransactionOutput
297
- */
298
- signAndSubmitTransaction(transactionInput: InputTransactionData): Promise<AptosSignAndSubmitTransactionOutput>;
299
- /**
300
- * Signs a transaction
301
- *
302
- * This method supports 2 input types -
303
- * 1. A raw transaction that was already built by the dapp,
304
- * 2. A transaction data input as JSON. This is for the wallet to be able to simulate before signing
305
- *
306
- * @param transactionOrPayload AnyRawTransaction | InputTransactionData
307
- * @param asFeePayer optional. A flag indicates to sign the transaction as the fee payer
308
- * @param options optional. Transaction options
309
- *
310
- * @returns AccountAuthenticator
311
- */
312
- signTransaction(args: {
313
- transactionOrPayload: AnyRawTransaction | InputTransactionData;
314
- asFeePayer?: boolean;
315
- }): Promise<{
316
- authenticator: AccountAuthenticator;
317
- rawTransaction: Uint8Array;
318
- }>;
319
- /**
320
- * Sign a message (doesnt submit to chain).
321
- *
322
- * @param message - AptosSignMessageInput
323
- *
324
- * @return response from the wallet's signMessage function
325
- * @throws WalletSignMessageError
326
- */
327
- signMessage(message: AptosSignMessageInput): Promise<AptosSignMessageOutput>;
328
- /**
329
- * Submits transaction to chain
330
- *
331
- * @param transaction - InputSubmitTransactionData
332
- * @returns PendingTransactionResponse
333
- */
334
- submitTransaction(transaction: InputSubmitTransactionData): Promise<PendingTransactionResponse>;
335
- /**
336
- Event for when account has changed on the wallet
337
- @return the new account info
338
- @throws WalletAccountChangeError
339
- */
340
- onAccountChange(): Promise<void>;
341
- /**
342
- Event for when network has changed on the wallet
343
- @return the new network info
344
- @throws WalletNetworkChangeError
345
- */
346
- onNetworkChange(): Promise<void>;
347
- /**
348
- * Sends a change network request to the wallet to change the connected network
349
- *
350
- * @param network - Network
351
- * @returns AptosChangeNetworkOutput
352
- */
353
- changeNetwork(network: Network): Promise<AptosChangeNetworkOutput>;
354
- /**
355
- * Signs a message and verifies the signer
356
- * @param message - AptosSignMessageInput
357
- * @returns boolean
358
- */
359
- signMessageAndVerify(message: AptosSignMessageInput): Promise<boolean>;
360
- }
361
-
362
- declare function isMobile(): boolean;
363
- declare function isInAppBrowser(): boolean;
364
- declare function isRedirectable(): boolean;
365
- declare function generalizedErrorMessage(error: any): string;
366
- /**
367
- * Helper function to get AptosConfig that supports Aptos and Custom networks
368
- *
369
- * @param networkInfo
370
- * @param dappConfig
371
- * @returns AptosConfig
372
- */
373
- declare const getAptosConfig: (networkInfo: NetworkInfo | null, dappConfig: DappConfig | undefined) => AptosConfig;
374
- /**
375
- * Helper function to resolve if the current connected network is an Aptos network
376
- *
377
- * @param networkInfo
378
- * @returns boolean
379
- */
380
- declare const isAptosNetwork: (networkInfo: NetworkInfo | NetworkInfo | null) => boolean;
381
- declare const isAptosLiveNetwork: (networkInfo: Network) => boolean;
382
- /**
383
- * Helper function to fetch Devnet chain id
384
- */
385
- declare const fetchDevnetChainId: () => Promise<number>;
386
- /**
387
- * A helper function to handle the publish package transaction.
388
- * The Aptos SDK expects the metadataBytes and byteCode to be Uint8Array, but in case the arguments are passed in
389
- * as a string, this function converts the string to Uint8Array.
390
- */
391
- declare const handlePublishPackageTransaction: (transactionInput: InputTransactionData) => {
392
- metadataBytes: number | bigint | boolean | _aptos_labs_ts_sdk.AccountAddress | _aptos_labs_ts_sdk.Bool | _aptos_labs_ts_sdk.U8 | _aptos_labs_ts_sdk.U16 | _aptos_labs_ts_sdk.U32 | _aptos_labs_ts_sdk.U64 | _aptos_labs_ts_sdk.U128 | _aptos_labs_ts_sdk.U256 | _aptos_labs_ts_sdk.MoveVector<_aptos_labs_ts_sdk.EntryFunctionArgumentTypes> | _aptos_labs_ts_sdk.MoveOption<_aptos_labs_ts_sdk.EntryFunctionArgumentTypes> | _aptos_labs_ts_sdk.MoveString | _aptos_labs_ts_sdk.FixedBytes | Uint8Array<ArrayBufferLike> | ArrayBuffer | (_aptos_labs_ts_sdk.EntryFunctionArgumentTypes | _aptos_labs_ts_sdk.SimpleEntryFunctionArgumentTypes)[] | _aptos_labs_ts_sdk.MoveVector<_aptos_labs_ts_sdk.ScriptFunctionArgumentTypes> | _aptos_labs_ts_sdk.Serialized | null | undefined;
393
- byteCode: (_aptos_labs_ts_sdk.EntryFunctionArgumentTypes | _aptos_labs_ts_sdk.SimpleEntryFunctionArgumentTypes)[];
394
- };
395
- declare function convertNetwork(networkInfo: NetworkInfo | null): Network;
396
-
397
- declare function setLocalStorage(walletName: string): void;
398
- declare function removeLocalStorage(): void;
399
- declare function getLocalStorage(): void;
400
-
401
- /**
402
- * A function that will partition the provided wallets into two list — `defaultWallets` and `moreWallets`.
403
- * By default, the wallets will be partitioned by whether or not they are installed or loadable.
404
- * You can pass your own partition function if you wish to customize this behavior.
405
- */
406
- declare function partitionWallets(wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>, partitionFunction?: (wallet: AdapterWallet | AdapterNotDetectedWallet) => boolean): {
407
- defaultWallets: AdapterWallet[];
408
- moreWallets: AdapterNotDetectedWallet[];
409
- };
410
- /** Returns true if the wallet is installed or loadable. */
411
- declare function isInstalledOrLoadable(wallet: AdapterWallet | AdapterNotDetectedWallet): wallet is AdapterWallet;
412
- /**
413
- * Returns true if the user is on desktop and the provided wallet requires installation of a browser extension.
414
- * This can be used to decide whether to show a "Connect" button or "Install" link in the UI.
415
- */
416
- declare function isInstallRequired(wallet: AdapterWallet | AdapterNotDetectedWallet): boolean;
417
- declare function shouldUseFallbackWallet(wallet: AdapterWallet | AdapterNotDetectedWallet): boolean;
418
- /** Truncates the provided wallet address at the middle with an ellipsis. */
419
- declare function truncateAddress(address: string | undefined): string | undefined;
420
- /**
421
- * Returns `true` if the provided wallet is an Aptos Connect wallet.
422
- *
423
- * @deprecated Use {@link isPetraWebWallet} instead.
424
- */
425
- declare function isAptosConnectWallet(wallet: WalletInfo | AdapterWallet): boolean;
426
- /** Returns `true` if the provided wallet is a Petra Web wallet. This will automatically exclude the generic wallet. */
427
- declare function isPetraWebWallet(wallet: WalletInfo | AdapterWallet, ignoreGenericWallet?: boolean): boolean;
428
- /** Returns true if the wallet is a generic wallet. */
429
- declare function isPetraWebGenericWallet(wallet: AdapterWallet | AdapterNotDetectedWallet | WalletInfo): boolean;
430
- /**
431
- * Partitions the `wallets` array so that Aptos Connect wallets are grouped separately from the rest.
432
- * Petra Web is a web wallet that uses social login to create accounts on the blockchain.
433
- *
434
- * @deprecated Use {@link getPetraWebWallets} instead.
435
- */
436
- declare function getAptosConnectWallets(wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>): {
437
- aptosConnectWallets: AdapterWallet[];
438
- otherWallets: AdapterNotDetectedWallet[];
439
- };
440
- /**
441
- * Partitions the `wallets` array so that Petra Web wallets are grouped separately from the rest.
442
- * Petra Web is a web wallet that uses social login to create accounts on the blockchain.
443
- */
444
- declare function getPetraWebWallets(wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>): {
445
- petraWebWallets: AdapterWallet[];
446
- otherWallets: AdapterNotDetectedWallet[];
447
- };
448
- interface WalletSortingOptions {
449
- /**
450
- * An optional function for sorting Aptos Connect wallets.
451
- *
452
- * @deprecated Use {@link sortPetraWebWallets} instead.
453
- */
454
- sortAptosConnectWallets?: (a: AdapterWallet, b: AdapterWallet) => number;
455
- /** An optional function for sorting Petra Web wallets. */
456
- sortPetraWebWallets?: (a: AdapterWallet, b: AdapterWallet) => number;
457
- /** An optional function for sorting wallets that are currently installed or loadable. */
458
- sortAvailableWallets?: (a: AdapterWallet | AdapterNotDetectedWallet, b: AdapterWallet | AdapterNotDetectedWallet) => number;
459
- /** An optional function for sorting wallets that are NOT currently installed or loadable. */
460
- sortInstallableWallets?: (a: AdapterWallet | AdapterNotDetectedWallet, b: AdapterWallet | AdapterNotDetectedWallet) => number;
461
- /**
462
- * A map of wallet names to fallback wallet names.
463
- * If a wallet is not installed and has a fallback wallet that IS installed,
464
- * the fallback wallet will be attached to the not-installed wallet and it will
465
- * be moved to the available wallets list.
466
- *
467
- * @example
468
- * ```ts
469
- * // Override the default fallbacks
470
- * fallbacks: { connections: { "Petra": "Petra Web", "OtherWallet": "OtherFallback" } }
471
- * ```
472
- */
473
- fallbacks?: {
474
- /** A map of wallet names to fallback wallet names. */
475
- connections: Record<string | AvailableWallets, string | AvailableWallets>;
476
- /** An optional array of wallets that are available but not intended for display. These wallets will only be shown if there is logic to explicitly show them (e.g. `fallbacks`) */
477
- additionalFallbackWallets?: ReadonlyArray<AdapterWallet>;
478
- };
479
- }
480
- /**
481
- * Partitions the `wallets` array into three distinct groups:
482
- *
483
- * `aptosConnectWallets` - Use {@link petraWebWallets} instead.
484
- *
485
- * `petraWebWallets` - Wallets that use social login to create accounts on
486
- * the blockchain via Petra Web.
487
- *
488
- * `availableWallets` - Wallets that are currently installed or loadable by the client.
489
- *
490
- * `availableWalletsWithFallbacks` - Wallets that are currently uninstalled that have a fallback wallet.
491
- *
492
- * `installableWallets` - Wallets that are NOT current installed or loadable and
493
- * require the client to install a browser extension first.
494
- *
495
- * Additionally, these wallet groups can be sorted by passing sort functions via the `options` argument.
496
- */
497
- declare function groupAndSortWallets(wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>, options?: WalletSortingOptions): {
498
- /** @deprecated Use {@link petraWebWallets} instead. */
499
- aptosConnectWallets: AdapterWallet[];
500
- /** Wallets that use social login to create an account on the blockchain */
501
- petraWebWallets: AdapterWallet[];
502
- /** Wallets that are currently installed or loadable. */
503
- availableWallets: AdapterWallet[];
504
- /** Wallets that are currently uninstalled that have a fallback wallet. */
505
- availableWalletsWithFallbacks: (AdapterWallet | AdapterNotDetectedWallet)[];
506
- /** Wallets that are NOT currently installed or loadable. */
507
- installableWallets: AdapterNotDetectedWallet[];
508
- };
509
-
510
- declare function getSDKWallets(dappConfig?: DappConfig): AdapterWallet[];
511
-
512
- /**
513
- * Registry of AIP-62 wallet standard supported wallets.
514
- * This list is used to show supported wallets even if they are not installed on the user machine.
515
- *
516
- * AIP-62 compatible wallets are required to add their wallet info here if they want to be detected by the adapter
517
- *
518
- * @param name - The name of your wallet cast to WalletName (Ex. "Petra" as WalletName<"Petra">)
519
- * @param url - The link to your chrome extension or main website where new users can create an account with your wallet.
520
- * @param icon - An icon for your wallet. Can be one of 4 data types. Be sure to follow the below format exactly (including the literal "," after base64).
521
- * Format: `data:image/${"svg+xml" | "webp" | "png" | "gif"};base64,${string}`
522
- * Note: ${...} data in the above format should be replaced. Other characters are literals (ex. ";")
523
- * @param deeplinkProvider optional - An optional deeplink provider for the wallet. If the wallet is not installed, we can redirect the user to the wallet's deeplink provider
524
- * @example "https://myWallet.app/explore?link="
525
- */
526
- declare const aptosStandardSupportedWalletList: Array<AptosStandardSupportedWallet>;
527
- declare const crossChainStandardSupportedWalletList: Array<AptosStandardSupportedWallet>;
528
-
529
- /**
530
- * @deprecated Use `AptosSignInBoundFields` instead. This will be removed in future versions.
531
- */
532
- type AptosSignInRequiredFields = AptosSignInBoundFields;
533
-
534
- export { APTOS_CONNECT_ACCOUNT_URL, APTOS_CONNECT_BASE_URL, type AdapterAccountInfo, type AdapterNotDetectedWallet, type AdapterWallet, type AptosSignInRequiredFields, type AptosStandardSupportedWallet, type AvailableWallets, ChainIdToAnsSupportedNetworkMap, DEFAULT_WALLET_CONNECTION_FALLBACKS, type DappConfig, type InputTransactionData, NetworkName, PETRA_WALLET_NAME, PETRA_WEB_ACCOUNT_URL, PETRA_WEB_BASE_URL, PETRA_WEB_GENERIC_WALLET_NAME, WalletCore, type WalletCoreEvents, type WalletInfo, WalletReadyState, type WalletSortingOptions, aptosStandardSupportedWalletList, convertNetwork, crossChainStandardSupportedWalletList, fetchDevnetChainId, generalizedErrorMessage, getAptosConfig, getAptosConnectWallets, getLocalStorage, getPetraWebWallets, getSDKWallets, groupAndSortWallets, handlePublishPackageTransaction, isAptosConnectWallet, isAptosLiveNetwork, isAptosNetwork, isInAppBrowser, isInstallRequired, isInstalledOrLoadable, isMobile, isPetraWebGenericWallet, isPetraWebWallet, isRedirectable, partitionWallets, removeLocalStorage, setLocalStorage, shouldUseFallbackWallet, truncateAddress };
@@ -1,18 +0,0 @@
1
- import { AptosStandardWallet } from "../AIP62StandardWallets";
2
- import { WalletInfo } from "../LegacyWalletPlugins";
3
- import { AnyAptosWallet } from "../WalletCore";
4
- /** The base URL for all Aptos Connect wallets. */
5
- export declare const APTOS_CONNECT_BASE_URL = "https://aptosconnect.app";
6
- /** The URL to the Aptos Connect account page if the user is signed in to Aptos Connect. */
7
- export declare const APTOS_CONNECT_ACCOUNT_URL = "https://aptosconnect.app/dashboard/main-account";
8
- /** Returns `true` if the provided wallet is an Aptos Connect wallet. */
9
- export declare function isAptosConnectWallet(wallet: WalletInfo | AnyAptosWallet | AptosStandardWallet): boolean;
10
- /**
11
- * Partitions the `wallets` array so that Aptos Connect wallets are grouped separately from the rest.
12
- * Aptos Connect is a web wallet that uses social login to create accounts on the blockchain.
13
- */
14
- export declare function getAptosConnectWallets(wallets: ReadonlyArray<AnyAptosWallet>): {
15
- aptosConnectWallets: AnyAptosWallet[];
16
- otherWallets: AnyAptosWallet[];
17
- };
18
- //# sourceMappingURL=aptosConnect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aptosConnect.d.ts","sourceRoot":"","sources":["../../src/utils/aptosConnect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,kDAAkD;AAClD,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;AAEjE,2FAA2F;AAC3F,eAAO,MAAM,yBAAyB,oDACa,CAAC;AAEpD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,mBAAmB,WAG1D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC;;;EAM5E"}
@@ -1,45 +0,0 @@
1
- export declare const mainnetChains: {
2
- Ethereum: {
3
- key: string;
4
- id: number;
5
- context: string;
6
- finalityThreshold: number;
7
- displayName: string;
8
- explorerUrl: string;
9
- explorerName: string;
10
- gasToken: string;
11
- chainId: number;
12
- icon: string;
13
- maxBlockSearch: number;
14
- symbol: string;
15
- };
16
- Solana: {
17
- key: string;
18
- id: number;
19
- context: string;
20
- finalityThreshold: number;
21
- displayName: string;
22
- explorerUrl: string;
23
- explorerName: string;
24
- gasToken: string;
25
- chainId: number;
26
- icon: string;
27
- maxBlockSearch: number;
28
- symbol: string;
29
- };
30
- };
31
- export declare const AptosMainnetChain: {
32
- key: string;
33
- id: number;
34
- context: string;
35
- finalityThreshold: number;
36
- displayName: string;
37
- explorerUrl: string;
38
- explorerName: string;
39
- gasToken: string;
40
- chainId: number;
41
- icon: string;
42
- maxBlockSearch: number;
43
- symbol: string;
44
- };
45
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/crossChain/chains/mainnet/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BzB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;CAa7B,CAAC"}
@@ -1,50 +0,0 @@
1
- export declare const testnetChains: {
2
- Sepolia: {
3
- key: string;
4
- id: number;
5
- context: string;
6
- finalityThreshold: number;
7
- displayName: string;
8
- explorerUrl: string;
9
- explorerName: string;
10
- gasToken: string;
11
- chainId: number;
12
- icon: string;
13
- maxBlockSearch: number;
14
- symbol: string;
15
- sdkName: string;
16
- wrappedGasToken: string;
17
- };
18
- Solana: {
19
- key: string;
20
- id: number;
21
- context: string;
22
- finalityThreshold: number;
23
- displayName: string;
24
- explorerUrl: string;
25
- explorerName: string;
26
- gasToken: string;
27
- chainId: number;
28
- icon: string;
29
- maxBlockSearch: number;
30
- symbol: string;
31
- sdkName: string;
32
- wrappedGasToken: string;
33
- };
34
- };
35
- export declare const AptosTestnetChain: {
36
- key: string;
37
- id: number;
38
- context: string;
39
- finalityThreshold: number;
40
- displayName: string;
41
- explorerUrl: string;
42
- explorerName: string;
43
- gasToken: string;
44
- chainId: number;
45
- icon: string;
46
- maxBlockSearch: number;
47
- symbol: string;
48
- sdkName: string;
49
- };
50
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/crossChain/chains/testnet/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDzB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;CAc7B,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const mainnetChainTokens: Record<string, any>;
2
- export declare const AptosMainnetUSDCToken: {
3
- key: string;
4
- symbol: string;
5
- nativeChain: string;
6
- tokenId: {
7
- chain: string;
8
- address: string;
9
- };
10
- icon: string;
11
- coinGeckoId: string;
12
- color: string;
13
- decimals: number;
14
- };
15
- //# sourceMappingURL=mainnet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mainnet.d.ts","sourceRoot":"","sources":["../../../../src/utils/crossChain/tokens/mainnet.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CA2BlD,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;CAajC,CAAC"}