@aptos-labs/wallet-adapter-core 7.10.2 → 7.10.3-xchaininit3.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/WalletCore.d.ts +9 -1
- package/dist/WalletCore.d.ts.map +1 -1
- package/dist/index.d.mts +12 -3
- package/dist/index.d.ts +9 -482
- package/dist/index.js +39 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -22
- package/dist/index.mjs.map +1 -1
- package/dist/registry.d.ts +2 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/WalletCore.ts +45 -35
- package/src/registry.ts +24 -18
- package/src/version.ts +1 -1
package/dist/WalletCore.d.ts
CHANGED
|
@@ -37,7 +37,15 @@ export interface DappConfig {
|
|
|
37
37
|
appId?: string;
|
|
38
38
|
appUrl?: string;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* A flag to indicate that the dapp supports cross-chain transactions.
|
|
42
|
+
* If enabled, the adapter will show cross-chain wallets in the wallet selector modal.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
crossChainWallets?: {
|
|
46
|
+
solana?: boolean;
|
|
47
|
+
evm?: boolean;
|
|
48
|
+
};
|
|
41
49
|
}
|
|
42
50
|
export declare interface WalletCoreEvents {
|
|
43
51
|
connect(account: AccountInfo | null): void;
|
package/dist/WalletCore.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletCore.d.ts","sourceRoot":"","sources":["../src/WalletCore.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAEL,oBAAoB,EACpB,iBAAiB,EAEjB,0BAA0B,EAC1B,OAAO,EAEP,0BAA0B,EAC1B,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,W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C,CAAC;IA+G/C;;;;;;;;;;;;OAYG;IACG,eAAe,CAAC,IAAI,EAAE;QAC1B,oBAAoB,EAAE,iBAAiB,GAAG,oBAAoB,CAAC;QAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,GAAG,OAAO,CAAC;QACV,aAAa,EAAE,oBAAoB,CAAC;QACpC,cAAc,EAAE,UAAU,CAAC;KAC5B,CAAC;IAyGF;;;;;;;OAOG;IACG,WAAW,CACf,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAkBlC;;;;;OAKG;IACG,iBAAiB,CACrB,WAAW,EAAE,0BAA0B,GACtC,OAAO,CAAC,0BAA0B,CAAC;IA+BtC;;;;OAIG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBtC;;;;OAIG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBtC;;;;;OAKG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAsCxE;;;;OAIG;IACG,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;CAoC7E"}
|
package/dist/index.d.mts
CHANGED
|
@@ -104,7 +104,15 @@ interface DappConfig {
|
|
|
104
104
|
appId?: string;
|
|
105
105
|
appUrl?: string;
|
|
106
106
|
};
|
|
107
|
-
|
|
107
|
+
/**
|
|
108
|
+
* A flag to indicate that the dapp supports cross-chain transactions.
|
|
109
|
+
* If enabled, the adapter will show cross-chain wallets in the wallet selector modal.
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
crossChainWallets?: {
|
|
113
|
+
solana?: boolean;
|
|
114
|
+
evm?: boolean;
|
|
115
|
+
};
|
|
108
116
|
}
|
|
109
117
|
declare interface WalletCoreEvents {
|
|
110
118
|
connect(account: AccountInfo | null): void;
|
|
@@ -475,11 +483,12 @@ declare function getSDKWallets(dappConfig?: DappConfig): AdapterWallet[];
|
|
|
475
483
|
* @example "https://myWallet.app/explore?link="
|
|
476
484
|
*/
|
|
477
485
|
declare const aptosStandardSupportedWalletList: Array<AptosStandardSupportedWallet>;
|
|
478
|
-
declare const
|
|
486
|
+
declare const solanaStandardSupportedWalletList: Array<AptosStandardSupportedWallet>;
|
|
487
|
+
declare const evmStandardSupportedWalletList: Array<AptosStandardSupportedWallet>;
|
|
479
488
|
|
|
480
489
|
/**
|
|
481
490
|
* @deprecated Use `AptosSignInBoundFields` instead. This will be removed in future versions.
|
|
482
491
|
*/
|
|
483
492
|
type AptosSignInRequiredFields = AptosSignInBoundFields;
|
|
484
493
|
|
|
485
|
-
export { APTOS_CONNECT_ACCOUNT_URL, APTOS_CONNECT_BASE_URL, type AdapterAccountInfo, type AdapterNotDetectedWallet, type AdapterWallet, type AptosSignInRequiredFields, type AptosStandardSupportedWallet, type AvailableWallets, ChainIdToAnsSupportedNetworkMap, type DappConfig, type InputTransactionData, NetworkName, PETRA_WEB_ACCOUNT_URL, PETRA_WEB_BASE_URL, WalletCore, type WalletCoreEvents, type WalletInfo, WalletReadyState, type WalletSortingOptions, aptosStandardSupportedWalletList, convertNetwork,
|
|
494
|
+
export { APTOS_CONNECT_ACCOUNT_URL, APTOS_CONNECT_BASE_URL, type AdapterAccountInfo, type AdapterNotDetectedWallet, type AdapterWallet, type AptosSignInRequiredFields, type AptosStandardSupportedWallet, type AvailableWallets, ChainIdToAnsSupportedNetworkMap, type DappConfig, type InputTransactionData, NetworkName, PETRA_WEB_ACCOUNT_URL, PETRA_WEB_BASE_URL, WalletCore, type WalletCoreEvents, type WalletInfo, WalletReadyState, type WalletSortingOptions, aptosStandardSupportedWalletList, convertNetwork, evmStandardSupportedWalletList, fetchDevnetChainId, generalizedErrorMessage, getAptosConfig, getAptosConnectWallets, getLocalStorage, getPetraWebWallets, getSDKWallets, groupAndSortWallets, handlePublishPackageTransaction, isAptosConnectWallet, isAptosLiveNetwork, isAptosNetwork, isInAppBrowser, isInstallRequired, isInstalledOrLoadable, isMobile, isPetraWebWallet, isRedirectable, partitionWallets, removeLocalStorage, setLocalStorage, solanaStandardSupportedWalletList, truncateAddress };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,485 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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
|
-
/**
|
|
33
|
-
* The URL to the Aptos Connect account page if the user is signed in to Aptos Connect.
|
|
34
|
-
*
|
|
35
|
-
* @deprecated Use {@link PETRA_WEB_ACCOUNT_URL} instead.
|
|
36
|
-
*/
|
|
37
|
-
declare const APTOS_CONNECT_ACCOUNT_URL = "https://aptosconnect.app/dashboard/main-account";
|
|
38
|
-
/** The URL to the Petra Web account page if the user is signed in to Petra Web. */
|
|
39
|
-
declare const PETRA_WEB_ACCOUNT_URL = "https://web.petra.app/dashboard/main-account";
|
|
40
|
-
|
|
41
|
-
interface AptosStandardSupportedWallet {
|
|
42
|
-
name: string;
|
|
43
|
-
url: string;
|
|
44
|
-
icon: `data:image/${"svg+xml" | "webp" | "png" | "gif"};base64,${string}`;
|
|
45
|
-
readyState: WalletReadyState.NotDetected;
|
|
46
|
-
isAIP62Standard: true;
|
|
47
|
-
deeplinkProvider?: string;
|
|
48
|
-
isAptosNativeWallet?: boolean;
|
|
49
|
-
}
|
|
50
|
-
type AvailableWallets = "Continue with Apple" | "Continue with Google" | "OKX Wallet" | "Petra" | "Nightly" | "Pontem Wallet" | "Backpack" | "MSafe" | "Bitget Wallet" | "Gate Wallet" | "Cosmostation Wallet";
|
|
51
|
-
type InputTransactionDataInner = {
|
|
52
|
-
sender?: AccountAddressInput;
|
|
53
|
-
data: InputGenerateTransactionPayloadData;
|
|
54
|
-
options?: InputGenerateTransactionOptions & {
|
|
55
|
-
expirationSecondsFromNow?: number;
|
|
56
|
-
expirationTimestamp?: number;
|
|
57
|
-
};
|
|
58
|
-
/** This will always be set to true if a custom transaction submitter is provided. */
|
|
59
|
-
withFeePayer?: boolean;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* If `transactionSubmitter` is set it will be used, and override any transaction
|
|
63
|
-
* submitter configured in the DappConfig.
|
|
64
|
-
*
|
|
65
|
-
* The `pluginParams` parameter is used to provide additional parameters to a
|
|
66
|
-
* transaction submitter plugin, whether provided here or configured in the
|
|
67
|
-
* DappConfig.
|
|
68
|
-
*/
|
|
69
|
-
type InputTransactionData = InputTransactionDataInner & InputTransactionPluginData;
|
|
70
|
-
type WalletInfo = {
|
|
71
|
-
name: string;
|
|
72
|
-
icon: string;
|
|
73
|
-
url: string;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
type AdapterWallet = AptosWallet & {
|
|
77
|
-
readyState?: WalletReadyState;
|
|
78
|
-
isAptosNativeWallet?: boolean;
|
|
79
|
-
};
|
|
80
|
-
type AdapterNotDetectedWallet = Omit<AdapterWallet, "features" | "version" | "chains" | "accounts"> & {
|
|
81
|
-
readyState: WalletReadyState.NotDetected;
|
|
82
|
-
};
|
|
83
|
-
interface DappConfig {
|
|
84
|
-
network: Network;
|
|
85
|
-
/**
|
|
86
|
-
* If provided, the wallet adapter will submit transactions using the provided
|
|
87
|
-
* transaction submitter rather than via the wallet.
|
|
88
|
-
*/
|
|
89
|
-
transactionSubmitter?: TransactionSubmitter;
|
|
90
|
-
aptosApiKeys?: Partial<Record<Network, string>>;
|
|
91
|
-
aptosConnectDappId?: string;
|
|
92
|
-
aptosConnect?: Omit<AptosConnectWalletConfig, "network">;
|
|
93
|
-
/**
|
|
94
|
-
* @deprecated will be removed in a future version
|
|
95
|
-
*/
|
|
96
|
-
mizuwallet?: {
|
|
97
|
-
manifestURL: string;
|
|
98
|
-
appId?: string;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* @deprecated will be removed in a future version
|
|
102
|
-
*/
|
|
103
|
-
msafeWalletConfig?: {
|
|
104
|
-
appId?: string;
|
|
105
|
-
appUrl?: string;
|
|
106
|
-
};
|
|
107
|
-
crossChainWallets?: boolean;
|
|
108
|
-
}
|
|
109
|
-
declare interface WalletCoreEvents {
|
|
110
|
-
connect(account: AccountInfo | null): void;
|
|
111
|
-
disconnect(): void;
|
|
112
|
-
standardWalletsAdded(wallets: AdapterWallet): void;
|
|
113
|
-
standardNotDetectedWalletAdded(wallets: AdapterNotDetectedWallet): void;
|
|
114
|
-
networkChange(network: NetworkInfo | null): void;
|
|
115
|
-
accountChange(account: AccountInfo | null): void;
|
|
116
|
-
}
|
|
117
|
-
type AdapterAccountInfo = Omit<AccountInfo, "ansName"> & {
|
|
118
|
-
ansName?: string;
|
|
119
|
-
};
|
|
120
|
-
declare class WalletCore extends EventEmitter<WalletCoreEvents> {
|
|
121
|
-
private _wallet;
|
|
122
|
-
private readonly _sdkWallets;
|
|
123
|
-
private _standard_wallets;
|
|
124
|
-
private _standard_not_detected_wallets;
|
|
125
|
-
private _network;
|
|
126
|
-
private _connected;
|
|
127
|
-
private _connecting;
|
|
128
|
-
private _account;
|
|
129
|
-
private _dappConfig;
|
|
130
|
-
private _optInWallets;
|
|
131
|
-
private _disableTelemetry;
|
|
132
|
-
private readonly ga4;
|
|
133
|
-
constructor(optInWallets?: ReadonlyArray<AvailableWallets>, dappConfig?: DappConfig, disableTelemetry?: boolean);
|
|
134
|
-
private fetchExtensionAIP62AptosWallets;
|
|
135
|
-
/**
|
|
136
|
-
* Set AIP-62 extension wallets
|
|
137
|
-
*
|
|
138
|
-
* @param extensionwWallets
|
|
139
|
-
*/
|
|
140
|
-
private setExtensionAIP62Wallets;
|
|
141
|
-
/**
|
|
142
|
-
* Set AIP-62 SDK wallets
|
|
143
|
-
*/
|
|
144
|
-
private fetchSDKAIP62AptosWallets;
|
|
145
|
-
private isAptosNativeWallet;
|
|
146
|
-
private appendNotDetectedStandardSupportedWallets;
|
|
147
|
-
/**
|
|
148
|
-
* A function that excludes an AIP-62 compatible wallet the dapp doesnt want to include
|
|
149
|
-
*
|
|
150
|
-
* @param wallet AdapterWallet | AdapterNotDetectedWallet
|
|
151
|
-
* @returns boolean
|
|
152
|
-
*/
|
|
153
|
-
excludeWallet(wallet: AdapterWallet | AdapterNotDetectedWallet): boolean;
|
|
154
|
-
private recordEvent;
|
|
155
|
-
/**
|
|
156
|
-
* Helper function to ensure wallet exists
|
|
157
|
-
*
|
|
158
|
-
* @param wallet A wallet
|
|
159
|
-
*/
|
|
160
|
-
private ensureWalletExists;
|
|
161
|
-
/**
|
|
162
|
-
* Helper function to ensure account exists
|
|
163
|
-
*
|
|
164
|
-
* @param account An account
|
|
165
|
-
*/
|
|
166
|
-
private ensureAccountExists;
|
|
167
|
-
/**
|
|
168
|
-
* Queries and sets ANS name for the current connected wallet account
|
|
169
|
-
*/
|
|
170
|
-
private setAnsName;
|
|
171
|
-
/**
|
|
172
|
-
* Function to cleat wallet adapter data.
|
|
173
|
-
*
|
|
174
|
-
* - Removes current connected wallet state
|
|
175
|
-
* - Removes current connected account state
|
|
176
|
-
* - Removes current connected network state
|
|
177
|
-
* - Removes autoconnect local storage value
|
|
178
|
-
*/
|
|
179
|
-
private clearData;
|
|
180
|
-
/**
|
|
181
|
-
* Sets the connected wallet
|
|
182
|
-
*
|
|
183
|
-
* @param wallet A wallet
|
|
184
|
-
*/
|
|
185
|
-
setWallet(wallet: AptosWallet | null): void;
|
|
186
|
-
/**
|
|
187
|
-
* Sets the connected account
|
|
188
|
-
*
|
|
189
|
-
* @param account An account
|
|
190
|
-
*/
|
|
191
|
-
setAccount(account: AccountInfo | null): void;
|
|
192
|
-
/**
|
|
193
|
-
* Sets the connected network
|
|
194
|
-
*
|
|
195
|
-
* @param network A network
|
|
196
|
-
*/
|
|
197
|
-
setNetwork(network: NetworkInfo | null): void;
|
|
198
|
-
/**
|
|
199
|
-
* Helper function to detect whether a wallet is connected
|
|
200
|
-
*
|
|
201
|
-
* @returns boolean
|
|
202
|
-
*/
|
|
203
|
-
isConnected(): boolean;
|
|
204
|
-
/**
|
|
205
|
-
* Getter to fetch all detected wallets
|
|
206
|
-
*/
|
|
207
|
-
get wallets(): ReadonlyArray<AptosWallet>;
|
|
208
|
-
get notDetectedWallets(): ReadonlyArray<AdapterNotDetectedWallet>;
|
|
209
|
-
/**
|
|
210
|
-
* Getter for the current connected wallet
|
|
211
|
-
*
|
|
212
|
-
* @return wallet info
|
|
213
|
-
* @throws WalletNotSelectedError
|
|
214
|
-
*/
|
|
215
|
-
get wallet(): AptosWallet | null;
|
|
216
|
-
/**
|
|
217
|
-
* Getter for the current connected account
|
|
218
|
-
*
|
|
219
|
-
* @return account info
|
|
220
|
-
* @throws WalletAccountError
|
|
221
|
-
*/
|
|
222
|
-
get account(): AccountInfo | null;
|
|
223
|
-
/**
|
|
224
|
-
* Getter for the current wallet network
|
|
225
|
-
*
|
|
226
|
-
* @return network info
|
|
227
|
-
* @throws WalletGetNetworkError
|
|
228
|
-
*/
|
|
229
|
-
get network(): NetworkInfo | null;
|
|
230
|
-
/**
|
|
231
|
-
* Helper function to run some checks before we connect with a wallet.
|
|
232
|
-
*
|
|
233
|
-
* @param walletName. The wallet name we want to connect with.
|
|
234
|
-
*/
|
|
235
|
-
connect(walletName: string): Promise<void | string>;
|
|
236
|
-
/**
|
|
237
|
-
* Signs into the wallet by connecting and signing an authentication messages.
|
|
238
|
-
*
|
|
239
|
-
* For more information, visit: https://siwa.aptos.dev
|
|
240
|
-
*
|
|
241
|
-
* @param args
|
|
242
|
-
* @param args.input The AptosSignInInput which defines how the SIWA Message should be constructed
|
|
243
|
-
* @param args.walletName The name of the wallet to sign into
|
|
244
|
-
* @returns The AptosSignInOutput which contains the account and signature information
|
|
245
|
-
*/
|
|
246
|
-
signIn(args: {
|
|
247
|
-
input: AptosSignInInput;
|
|
248
|
-
walletName: string;
|
|
249
|
-
}): Promise<AptosSignInOutput>;
|
|
250
|
-
/**
|
|
251
|
-
* Connects a wallet to the dapp.
|
|
252
|
-
* On connect success, we set the current account and the network, and keeping the selected wallet
|
|
253
|
-
* name in LocalStorage to support autoConnect function.
|
|
254
|
-
*
|
|
255
|
-
* @param selectedWallet. The wallet we want to connect.
|
|
256
|
-
* @emit emits "connect" event
|
|
257
|
-
* @throws WalletConnectionError
|
|
258
|
-
*/
|
|
259
|
-
private connectWallet;
|
|
260
|
-
/**
|
|
261
|
-
* Disconnect the current connected wallet. On success, we clear the
|
|
262
|
-
* current account, current network and LocalStorage data.
|
|
263
|
-
*
|
|
264
|
-
* @emit emits "disconnect" event
|
|
265
|
-
* @throws WalletDisconnectionError
|
|
266
|
-
*/
|
|
267
|
-
disconnect(): Promise<void>;
|
|
268
|
-
/**
|
|
269
|
-
* Signs and submits a transaction to chain
|
|
270
|
-
*
|
|
271
|
-
* @param transactionInput InputTransactionData
|
|
272
|
-
* @returns AptosSignAndSubmitTransactionOutput
|
|
273
|
-
*/
|
|
274
|
-
signAndSubmitTransaction(transactionInput: InputTransactionData): Promise<AptosSignAndSubmitTransactionOutput>;
|
|
275
|
-
/**
|
|
276
|
-
* Signs a transaction
|
|
277
|
-
*
|
|
278
|
-
* This method supports 2 input types -
|
|
279
|
-
* 1. A raw transaction that was already built by the dapp,
|
|
280
|
-
* 2. A transaction data input as JSON. This is for the wallet to be able to simulate before signing
|
|
281
|
-
*
|
|
282
|
-
* @param transactionOrPayload AnyRawTransaction | InputTransactionData
|
|
283
|
-
* @param asFeePayer optional. A flag indicates to sign the transaction as the fee payer
|
|
284
|
-
* @param options optional. Transaction options
|
|
285
|
-
*
|
|
286
|
-
* @returns AccountAuthenticator
|
|
287
|
-
*/
|
|
288
|
-
signTransaction(args: {
|
|
289
|
-
transactionOrPayload: AnyRawTransaction | InputTransactionData;
|
|
290
|
-
asFeePayer?: boolean;
|
|
291
|
-
}): Promise<{
|
|
292
|
-
authenticator: AccountAuthenticator;
|
|
293
|
-
rawTransaction: Uint8Array;
|
|
294
|
-
}>;
|
|
295
|
-
/**
|
|
296
|
-
* Sign a message (doesnt submit to chain).
|
|
297
|
-
*
|
|
298
|
-
* @param message - AptosSignMessageInput
|
|
299
|
-
*
|
|
300
|
-
* @return response from the wallet's signMessage function
|
|
301
|
-
* @throws WalletSignMessageError
|
|
302
|
-
*/
|
|
303
|
-
signMessage(message: AptosSignMessageInput): Promise<AptosSignMessageOutput>;
|
|
304
|
-
/**
|
|
305
|
-
* Submits transaction to chain
|
|
306
|
-
*
|
|
307
|
-
* @param transaction - InputSubmitTransactionData
|
|
308
|
-
* @returns PendingTransactionResponse
|
|
309
|
-
*/
|
|
310
|
-
submitTransaction(transaction: InputSubmitTransactionData): Promise<PendingTransactionResponse>;
|
|
311
|
-
/**
|
|
312
|
-
Event for when account has changed on the wallet
|
|
313
|
-
@return the new account info
|
|
314
|
-
@throws WalletAccountChangeError
|
|
315
|
-
*/
|
|
316
|
-
onAccountChange(): Promise<void>;
|
|
317
|
-
/**
|
|
318
|
-
Event for when network has changed on the wallet
|
|
319
|
-
@return the new network info
|
|
320
|
-
@throws WalletNetworkChangeError
|
|
321
|
-
*/
|
|
322
|
-
onNetworkChange(): Promise<void>;
|
|
323
|
-
/**
|
|
324
|
-
* Sends a change network request to the wallet to change the connected network
|
|
325
|
-
*
|
|
326
|
-
* @param network - Network
|
|
327
|
-
* @returns AptosChangeNetworkOutput
|
|
328
|
-
*/
|
|
329
|
-
changeNetwork(network: Network): Promise<AptosChangeNetworkOutput>;
|
|
330
|
-
/**
|
|
331
|
-
* Signs a message and verifies the signer
|
|
332
|
-
* @param message - AptosSignMessageInput
|
|
333
|
-
* @returns boolean
|
|
334
|
-
*/
|
|
335
|
-
signMessageAndVerify(message: AptosSignMessageInput): Promise<boolean>;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
declare function isMobile(): boolean;
|
|
339
|
-
declare function isInAppBrowser(): boolean;
|
|
340
|
-
declare function isRedirectable(): boolean;
|
|
341
|
-
declare function generalizedErrorMessage(error: any): string;
|
|
342
|
-
/**
|
|
343
|
-
* Helper function to get AptosConfig that supports Aptos and Custom networks
|
|
344
|
-
*
|
|
345
|
-
* @param networkInfo
|
|
346
|
-
* @param dappConfig
|
|
347
|
-
* @returns AptosConfig
|
|
348
|
-
*/
|
|
349
|
-
declare const getAptosConfig: (networkInfo: NetworkInfo | null, dappConfig: DappConfig | undefined) => AptosConfig;
|
|
350
|
-
/**
|
|
351
|
-
* Helper function to resolve if the current connected network is an Aptos network
|
|
352
|
-
*
|
|
353
|
-
* @param networkInfo
|
|
354
|
-
* @returns boolean
|
|
355
|
-
*/
|
|
356
|
-
declare const isAptosNetwork: (networkInfo: NetworkInfo | NetworkInfo | null) => boolean;
|
|
357
|
-
declare const isAptosLiveNetwork: (networkInfo: Network) => boolean;
|
|
358
|
-
/**
|
|
359
|
-
* Helper function to fetch Devnet chain id
|
|
360
|
-
*/
|
|
361
|
-
declare const fetchDevnetChainId: () => Promise<number>;
|
|
362
|
-
/**
|
|
363
|
-
* A helper function to handle the publish package transaction.
|
|
364
|
-
* The Aptos SDK expects the metadataBytes and byteCode to be Uint8Array, but in case the arguments are passed in
|
|
365
|
-
* as a string, this function converts the string to Uint8Array.
|
|
366
|
-
*/
|
|
367
|
-
declare const handlePublishPackageTransaction: (transactionInput: InputTransactionData) => {
|
|
368
|
-
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;
|
|
369
|
-
byteCode: (_aptos_labs_ts_sdk.EntryFunctionArgumentTypes | _aptos_labs_ts_sdk.SimpleEntryFunctionArgumentTypes)[];
|
|
370
|
-
};
|
|
371
|
-
declare function convertNetwork(networkInfo: NetworkInfo | null): Network;
|
|
372
|
-
|
|
373
|
-
declare function setLocalStorage(walletName: string): void;
|
|
374
|
-
declare function removeLocalStorage(): void;
|
|
375
|
-
declare function getLocalStorage(): void;
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* A function that will partition the provided wallets into two list — `defaultWallets` and `moreWallets`.
|
|
379
|
-
* By default, the wallets will be partitioned by whether or not they are installed or loadable.
|
|
380
|
-
* You can pass your own partition function if you wish to customize this behavior.
|
|
381
|
-
*/
|
|
382
|
-
declare function partitionWallets(wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>, partitionFunction?: (wallet: AdapterWallet | AdapterNotDetectedWallet) => boolean): {
|
|
383
|
-
defaultWallets: AdapterWallet[];
|
|
384
|
-
moreWallets: AdapterNotDetectedWallet[];
|
|
385
|
-
};
|
|
386
|
-
/** Returns true if the wallet is installed or loadable. */
|
|
387
|
-
declare function isInstalledOrLoadable(wallet: AdapterWallet | AdapterNotDetectedWallet): boolean;
|
|
388
|
-
/**
|
|
389
|
-
* Returns true if the user is on desktop and the provided wallet requires installation of a browser extension.
|
|
390
|
-
* This can be used to decide whether to show a "Connect" button or "Install" link in the UI.
|
|
391
|
-
*/
|
|
392
|
-
declare function isInstallRequired(wallet: AdapterWallet | AdapterNotDetectedWallet): boolean;
|
|
393
|
-
/** Truncates the provided wallet address at the middle with an ellipsis. */
|
|
394
|
-
declare function truncateAddress(address: string | undefined): string | undefined;
|
|
395
|
-
/**
|
|
396
|
-
* Returns `true` if the provided wallet is an Aptos Connect wallet.
|
|
397
|
-
*
|
|
398
|
-
* @deprecated Use {@link isPetraWebWallet} instead.
|
|
399
|
-
*/
|
|
400
|
-
declare function isAptosConnectWallet(wallet: WalletInfo | AdapterWallet): boolean;
|
|
401
|
-
/** Returns `true` if the provided wallet is a Petra Web wallet. */
|
|
402
|
-
declare function isPetraWebWallet(wallet: WalletInfo | AdapterWallet): boolean;
|
|
403
|
-
/**
|
|
404
|
-
* Partitions the `wallets` array so that Aptos Connect wallets are grouped separately from the rest.
|
|
405
|
-
* Petra Web is a web wallet that uses social login to create accounts on the blockchain.
|
|
406
|
-
*
|
|
407
|
-
* @deprecated Use {@link getPetraWebWallets} instead.
|
|
408
|
-
*/
|
|
409
|
-
declare function getAptosConnectWallets(wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>): {
|
|
410
|
-
aptosConnectWallets: AdapterWallet[];
|
|
411
|
-
otherWallets: AdapterNotDetectedWallet[];
|
|
412
|
-
};
|
|
413
|
-
/**
|
|
414
|
-
* Partitions the `wallets` array so that Petra Web wallets are grouped separately from the rest.
|
|
415
|
-
* Petra Web is a web wallet that uses social login to create accounts on the blockchain.
|
|
416
|
-
*/
|
|
417
|
-
declare function getPetraWebWallets(wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>): {
|
|
418
|
-
petraWebWallets: AdapterWallet[];
|
|
419
|
-
otherWallets: AdapterNotDetectedWallet[];
|
|
420
|
-
};
|
|
421
|
-
interface WalletSortingOptions {
|
|
422
|
-
/**
|
|
423
|
-
* An optional function for sorting Aptos Connect wallets.
|
|
424
|
-
*
|
|
425
|
-
* @deprecated Use {@link sortPetraWebWallets} instead.
|
|
426
|
-
*/
|
|
427
|
-
sortAptosConnectWallets?: (a: AdapterWallet, b: AdapterWallet) => number;
|
|
428
|
-
/** An optional function for sorting Petra Web wallets. */
|
|
429
|
-
sortPetraWebWallets?: (a: AdapterWallet, b: AdapterWallet) => number;
|
|
430
|
-
/** An optional function for sorting wallets that are currently installed or loadable. */
|
|
431
|
-
sortAvailableWallets?: (a: AdapterWallet | AdapterNotDetectedWallet, b: AdapterWallet | AdapterNotDetectedWallet) => number;
|
|
432
|
-
/** An optional function for sorting wallets that are NOT currently installed or loadable. */
|
|
433
|
-
sortInstallableWallets?: (a: AdapterWallet | AdapterNotDetectedWallet, b: AdapterWallet | AdapterNotDetectedWallet) => number;
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Partitions the `wallets` array into three distinct groups:
|
|
437
|
-
*
|
|
438
|
-
* `aptosConnectWallets` - Use {@link petraWebWallets} instead.
|
|
439
|
-
*
|
|
440
|
-
* `petraWebWallets` - Wallets that use social login to create accounts on
|
|
441
|
-
* the blockchain via Petra Web.
|
|
442
|
-
*
|
|
443
|
-
* `availableWallets` - Wallets that are currently installed or loadable by the client.
|
|
444
|
-
*
|
|
445
|
-
* `installableWallets` - Wallets that are NOT current installed or loadable and
|
|
446
|
-
* require the client to install a browser extension first.
|
|
447
|
-
*
|
|
448
|
-
* Additionally, these wallet groups can be sorted by passing sort functions via the `options` argument.
|
|
449
|
-
*/
|
|
450
|
-
declare function groupAndSortWallets(wallets: ReadonlyArray<AdapterWallet | AdapterNotDetectedWallet>, options?: WalletSortingOptions): {
|
|
451
|
-
/** @deprecated Use {@link petraWebWallets} instead. */
|
|
452
|
-
aptosConnectWallets: AdapterWallet[];
|
|
453
|
-
/** Wallets that use social login to create an account on the blockchain */
|
|
454
|
-
petraWebWallets: AdapterWallet[];
|
|
455
|
-
/** Wallets that are currently installed or loadable. */
|
|
456
|
-
availableWallets: AdapterWallet[];
|
|
457
|
-
/** Wallets that are NOT currently installed or loadable. */
|
|
458
|
-
installableWallets: AdapterNotDetectedWallet[];
|
|
459
|
-
};
|
|
460
|
-
|
|
461
|
-
declare function getSDKWallets(dappConfig?: DappConfig): AdapterWallet[];
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* Registry of AIP-62 wallet standard supported wallets.
|
|
465
|
-
* This list is used to show supported wallets even if they are not installed on the user machine.
|
|
466
|
-
*
|
|
467
|
-
* AIP-62 compatible wallets are required to add their wallet info here if they want to be detected by the adapter
|
|
468
|
-
*
|
|
469
|
-
* @param name - The name of your wallet cast to WalletName (Ex. "Petra" as WalletName<"Petra">)
|
|
470
|
-
* @param url - The link to your chrome extension or main website where new users can create an account with your wallet.
|
|
471
|
-
* @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).
|
|
472
|
-
* Format: `data:image/${"svg+xml" | "webp" | "png" | "gif"};base64,${string}`
|
|
473
|
-
* Note: ${...} data in the above format should be replaced. Other characters are literals (ex. ";")
|
|
474
|
-
* @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
|
|
475
|
-
* @example "https://myWallet.app/explore?link="
|
|
476
|
-
*/
|
|
477
|
-
declare const aptosStandardSupportedWalletList: Array<AptosStandardSupportedWallet>;
|
|
478
|
-
declare const crossChainStandardSupportedWalletList: Array<AptosStandardSupportedWallet>;
|
|
479
|
-
|
|
1
|
+
import { AptosSignInBoundFields } from "@aptos-labs/wallet-standard";
|
|
2
|
+
export type { AptosSignInOutput, AptosSignInInput, AptosSignInBoundFields, } from "@aptos-labs/wallet-standard";
|
|
480
3
|
/**
|
|
481
4
|
* @deprecated Use `AptosSignInBoundFields` instead. This will be removed in future versions.
|
|
482
5
|
*/
|
|
483
|
-
type AptosSignInRequiredFields = AptosSignInBoundFields;
|
|
484
|
-
|
|
485
|
-
export
|
|
6
|
+
export type AptosSignInRequiredFields = AptosSignInBoundFields;
|
|
7
|
+
export * from "./WalletCore";
|
|
8
|
+
export * from "./constants";
|
|
9
|
+
export * from "./utils";
|
|
10
|
+
export * from "./sdkWallets";
|
|
11
|
+
export * from "./registry";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|