@enclave-hq/wallet-sdk 1.2.4 → 1.2.5
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.d.mts +9 -227
- package/dist/index.js +320 -729
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +323 -38
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +3 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +321 -36
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +322 -37
- package/dist/react/index.mjs.map +1 -1
- package/dist/tron.d.mts +36 -0
- package/dist/tron.js +852 -0
- package/dist/tron.js.map +1 -0
- package/dist/tron.mjs +846 -0
- package/dist/tron.mjs.map +1 -0
- package/dist/wallet-adapter-DRd0xm3N.d.mts +197 -0
- package/package.json +8 -3
- package/dist/index.d.ts +0 -880
package/dist/index.d.ts
DELETED
|
@@ -1,880 +0,0 @@
|
|
|
1
|
-
import * as _enclave_hq_chain_utils from '@enclave-hq/chain-utils';
|
|
2
|
-
import { ChainType as ChainType$2, ChainInfo as ChainInfo$1 } from '@enclave-hq/chain-utils';
|
|
3
|
-
import EventEmitter from 'eventemitter3';
|
|
4
|
-
import { WalletClient } from 'viem';
|
|
5
|
-
import { WalletConnectWallet } from '@tronweb3/walletconnect-tron';
|
|
6
|
-
|
|
7
|
-
declare class TypedEventEmitter<TEvents extends Record<string, (...args: any[]) => void>> {
|
|
8
|
-
private emitter;
|
|
9
|
-
on<K extends keyof TEvents>(event: K, handler: TEvents[K]): this;
|
|
10
|
-
once<K extends keyof TEvents>(event: K, handler: TEvents[K]): this;
|
|
11
|
-
off<K extends keyof TEvents>(event: K, handler: TEvents[K]): this;
|
|
12
|
-
emit<K extends keyof TEvents>(event: K, ...args: Parameters<TEvents[K]>): boolean;
|
|
13
|
-
removeAllListeners<K extends keyof TEvents>(event?: K): this;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare const ChainType$1: typeof ChainType$2;
|
|
17
|
-
type ChainType$1 = ChainType$2;
|
|
18
|
-
declare enum WalletType {
|
|
19
|
-
METAMASK = "metamask",
|
|
20
|
-
WALLETCONNECT = "walletconnect",
|
|
21
|
-
COINBASE_WALLET = "coinbase-wallet",
|
|
22
|
-
TRONLINK = "tronlink",
|
|
23
|
-
WALLETCONNECT_TRON = "walletconnect-tron",
|
|
24
|
-
PRIVATE_KEY = "private-key",
|
|
25
|
-
DEEP_LINK_EVM = "deep-link-evm",
|
|
26
|
-
DEEP_LINK_TRON = "deep-link-tron"
|
|
27
|
-
}
|
|
28
|
-
declare enum WalletState {
|
|
29
|
-
DISCONNECTED = "disconnected",
|
|
30
|
-
CONNECTING = "connecting",
|
|
31
|
-
CONNECTED = "connected",
|
|
32
|
-
ERROR = "error"
|
|
33
|
-
}
|
|
34
|
-
type UniversalAddress = string;
|
|
35
|
-
interface Account {
|
|
36
|
-
universalAddress: UniversalAddress;
|
|
37
|
-
nativeAddress: string;
|
|
38
|
-
chainId: number;
|
|
39
|
-
chainType: ChainType$1;
|
|
40
|
-
isActive: boolean;
|
|
41
|
-
balance?: string;
|
|
42
|
-
name?: string;
|
|
43
|
-
}
|
|
44
|
-
interface ISigner {
|
|
45
|
-
signMessage(message: string): Promise<string>;
|
|
46
|
-
getAddress(): Promise<string>;
|
|
47
|
-
}
|
|
48
|
-
interface IWalletAdapter extends ISigner {
|
|
49
|
-
readonly type: WalletType;
|
|
50
|
-
readonly chainType: ChainType$1;
|
|
51
|
-
readonly name: string;
|
|
52
|
-
readonly icon?: string;
|
|
53
|
-
state: WalletState;
|
|
54
|
-
currentAccount: Account | null;
|
|
55
|
-
connect(chainId?: number | number[]): Promise<Account>;
|
|
56
|
-
disconnect(): Promise<void>;
|
|
57
|
-
isAvailable(): Promise<boolean>;
|
|
58
|
-
isConnected(): boolean;
|
|
59
|
-
signMessage(message: string): Promise<string>;
|
|
60
|
-
signTransaction?(transaction: Transaction): Promise<string>;
|
|
61
|
-
signTypedData?(typedData: any): Promise<string>;
|
|
62
|
-
switchChain?(chainId: number): Promise<void>;
|
|
63
|
-
addChain?(chainConfig: AddChainParams): Promise<void>;
|
|
64
|
-
readContract?<T = any>(params: ContractReadParams): Promise<T>;
|
|
65
|
-
writeContract?(params: ContractWriteParams): Promise<string>;
|
|
66
|
-
estimateGas?(params: ContractWriteParams): Promise<bigint>;
|
|
67
|
-
waitForTransaction?(txHash: string, confirmations?: number): Promise<TransactionReceipt>;
|
|
68
|
-
getProvider(): any;
|
|
69
|
-
getSigner?(): any;
|
|
70
|
-
on(event: string, handler: (...args: any[]) => void): void;
|
|
71
|
-
off(event: string, handler: (...args: any[]) => void): void;
|
|
72
|
-
removeAllListeners(event?: string): void;
|
|
73
|
-
}
|
|
74
|
-
interface ContractReadParams {
|
|
75
|
-
address: string;
|
|
76
|
-
abi: any[];
|
|
77
|
-
functionName: string;
|
|
78
|
-
args?: any[];
|
|
79
|
-
}
|
|
80
|
-
interface ContractWriteParams extends ContractReadParams {
|
|
81
|
-
value?: string;
|
|
82
|
-
gas?: number;
|
|
83
|
-
gasPrice?: string;
|
|
84
|
-
maxFeePerGas?: string;
|
|
85
|
-
maxPriorityFeePerGas?: string;
|
|
86
|
-
}
|
|
87
|
-
interface EVMTransaction {
|
|
88
|
-
to: string;
|
|
89
|
-
value?: string | bigint;
|
|
90
|
-
data?: string;
|
|
91
|
-
gas?: string | bigint;
|
|
92
|
-
gasPrice?: string | bigint;
|
|
93
|
-
maxFeePerGas?: string | bigint;
|
|
94
|
-
maxPriorityFeePerGas?: string | bigint;
|
|
95
|
-
nonce?: number;
|
|
96
|
-
chainId?: number;
|
|
97
|
-
}
|
|
98
|
-
interface TronTransaction {
|
|
99
|
-
txID?: string;
|
|
100
|
-
raw_data?: any;
|
|
101
|
-
raw_data_hex?: string;
|
|
102
|
-
visible?: boolean;
|
|
103
|
-
}
|
|
104
|
-
type Transaction = EVMTransaction | TronTransaction;
|
|
105
|
-
interface TransactionReceipt {
|
|
106
|
-
transactionHash: string;
|
|
107
|
-
blockNumber: number;
|
|
108
|
-
blockHash: string;
|
|
109
|
-
from: string;
|
|
110
|
-
to?: string;
|
|
111
|
-
status: 'success' | 'failed';
|
|
112
|
-
gasUsed: string;
|
|
113
|
-
effectiveGasPrice?: string;
|
|
114
|
-
logs?: any[];
|
|
115
|
-
}
|
|
116
|
-
interface AddChainParams {
|
|
117
|
-
chainId: number;
|
|
118
|
-
chainName: string;
|
|
119
|
-
nativeCurrency: {
|
|
120
|
-
name: string;
|
|
121
|
-
symbol: string;
|
|
122
|
-
decimals: number;
|
|
123
|
-
};
|
|
124
|
-
rpcUrls: string[];
|
|
125
|
-
blockExplorerUrls?: string[];
|
|
126
|
-
iconUrls?: string[];
|
|
127
|
-
}
|
|
128
|
-
interface WalletManagerConfig {
|
|
129
|
-
enableStorage?: boolean;
|
|
130
|
-
storagePrefix?: string;
|
|
131
|
-
defaultChainId?: number;
|
|
132
|
-
defaultTronChainId?: number;
|
|
133
|
-
walletConnectProjectId?: string;
|
|
134
|
-
}
|
|
135
|
-
interface ConnectedWallet {
|
|
136
|
-
account: Account;
|
|
137
|
-
walletType: WalletType;
|
|
138
|
-
chainType: ChainType$1;
|
|
139
|
-
isPrimary: boolean;
|
|
140
|
-
canSwitchChain: boolean;
|
|
141
|
-
adapter: IWalletAdapter;
|
|
142
|
-
}
|
|
143
|
-
interface WalletManagerEvents extends Record<string, (...args: any[]) => void> {
|
|
144
|
-
accountChanged: (account: Account | null) => void;
|
|
145
|
-
chainChanged: (chainId: number, account: Account) => void;
|
|
146
|
-
disconnected: () => void;
|
|
147
|
-
walletAccountChanged: (chainType: ChainType$1, account: Account | null, isPrimary: boolean) => void;
|
|
148
|
-
walletChainChanged: (chainType: ChainType$1, chainId: number, account: Account, isPrimary: boolean) => void;
|
|
149
|
-
walletDisconnected: (chainType: ChainType$1, isPrimary: boolean) => void;
|
|
150
|
-
primaryWalletSwitched: (newPrimary: Account, oldPrimary: Account | null, chainType: ChainType$1) => void;
|
|
151
|
-
error: (error: Error) => void;
|
|
152
|
-
}
|
|
153
|
-
interface WalletHistoryRecord {
|
|
154
|
-
universalAddress: UniversalAddress;
|
|
155
|
-
nativeAddress: string;
|
|
156
|
-
chainId: number;
|
|
157
|
-
chainType: ChainType$1;
|
|
158
|
-
walletType: WalletType;
|
|
159
|
-
lastConnected: number;
|
|
160
|
-
name?: string;
|
|
161
|
-
}
|
|
162
|
-
interface StorageData {
|
|
163
|
-
current: UniversalAddress | null;
|
|
164
|
-
primaryWalletType?: WalletType;
|
|
165
|
-
primaryChainId?: number;
|
|
166
|
-
history: WalletHistoryRecord[];
|
|
167
|
-
}
|
|
168
|
-
interface WalletAvailability {
|
|
169
|
-
walletType: WalletType;
|
|
170
|
-
chainType: ChainType$1;
|
|
171
|
-
isAvailable: boolean;
|
|
172
|
-
downloadUrl?: string;
|
|
173
|
-
detected: boolean;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
interface QRCodeSignerConfig {
|
|
177
|
-
requestId: string;
|
|
178
|
-
requestUrl: string;
|
|
179
|
-
pollUrl?: string;
|
|
180
|
-
pollInterval?: number;
|
|
181
|
-
timeout?: number;
|
|
182
|
-
pollFn?: (requestId: string) => Promise<QRCodeSignResult | null>;
|
|
183
|
-
}
|
|
184
|
-
interface QRCodeSignResult {
|
|
185
|
-
completed: boolean;
|
|
186
|
-
signature?: string;
|
|
187
|
-
error?: string;
|
|
188
|
-
signer?: string;
|
|
189
|
-
}
|
|
190
|
-
declare enum QRCodeSignStatus {
|
|
191
|
-
WAITING = "waiting",
|
|
192
|
-
PENDING = "pending",
|
|
193
|
-
SUCCESS = "success",
|
|
194
|
-
FAILED = "failed",
|
|
195
|
-
TIMEOUT = "timeout",
|
|
196
|
-
CANCELLED = "cancelled"
|
|
197
|
-
}
|
|
198
|
-
declare class QRCodeSigner {
|
|
199
|
-
private config;
|
|
200
|
-
private pollTimer;
|
|
201
|
-
private timeoutTimer;
|
|
202
|
-
private status;
|
|
203
|
-
private qrCodeDataUrl;
|
|
204
|
-
private result;
|
|
205
|
-
constructor(config: QRCodeSignerConfig);
|
|
206
|
-
generateQRCode(options?: {
|
|
207
|
-
width?: number;
|
|
208
|
-
margin?: number;
|
|
209
|
-
color?: {
|
|
210
|
-
dark?: string;
|
|
211
|
-
light?: string;
|
|
212
|
-
};
|
|
213
|
-
}): Promise<string>;
|
|
214
|
-
startPolling(onStatusChange?: (status: QRCodeSignStatus) => void, onResult?: (result: QRCodeSignResult) => void): Promise<string>;
|
|
215
|
-
private defaultPoll;
|
|
216
|
-
stopPolling(): void;
|
|
217
|
-
cancel(): void;
|
|
218
|
-
getStatus(): QRCodeSignStatus;
|
|
219
|
-
getQRCodeUrl(): string;
|
|
220
|
-
getResult(): QRCodeSignResult | null;
|
|
221
|
-
cleanup(): void;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
declare class WalletManager extends TypedEventEmitter<WalletManagerEvents> {
|
|
225
|
-
private config;
|
|
226
|
-
private registry;
|
|
227
|
-
private primaryWallet;
|
|
228
|
-
private connectedWallets;
|
|
229
|
-
constructor(config?: WalletManagerConfig);
|
|
230
|
-
hasAdapter(type: WalletType): boolean;
|
|
231
|
-
connect(type: WalletType, chainId?: number | number[]): Promise<Account>;
|
|
232
|
-
connectAdditional(type: WalletType, chainId?: number | number[]): Promise<Account>;
|
|
233
|
-
connectWithPrivateKey(privateKey: string, chainId?: number): Promise<Account>;
|
|
234
|
-
disconnect(): Promise<void>;
|
|
235
|
-
disconnectAll(): Promise<void>;
|
|
236
|
-
switchPrimaryWallet(chainType: ChainType$1): Promise<Account>;
|
|
237
|
-
getPrimaryAccount(): Account | null;
|
|
238
|
-
getConnectedWallets(): ConnectedWallet[];
|
|
239
|
-
getWalletByChainType(chainType: ChainType$1): IWalletAdapter | null;
|
|
240
|
-
signMessage(message: string): Promise<string>;
|
|
241
|
-
signMessageWithChainType(message: string, chainType?: ChainType$1): Promise<string>;
|
|
242
|
-
createQRCodeSigner(message: string, config: Omit<QRCodeSignerConfig, 'requestId' | 'requestUrl'> & {
|
|
243
|
-
requestId: string;
|
|
244
|
-
requestUrl: string;
|
|
245
|
-
}): QRCodeSigner;
|
|
246
|
-
signTypedData(typedData: any, chainType?: ChainType$1): Promise<string>;
|
|
247
|
-
signTransaction(transaction: any): Promise<string>;
|
|
248
|
-
signTransactionWithChainType(transaction: any, chainType?: ChainType$1): Promise<string>;
|
|
249
|
-
requestSwitchChain(chainId: number, options?: {
|
|
250
|
-
addChainIfNotExists?: boolean;
|
|
251
|
-
chainConfig?: AddChainParams;
|
|
252
|
-
}): Promise<Account>;
|
|
253
|
-
readContract<T = any>(address: string, abi: any[], functionName: string, args?: any[], chainType?: ChainType$1): Promise<T>;
|
|
254
|
-
writeContract(address: string, abi: any[], functionName: string, args?: any[], options?: {
|
|
255
|
-
value?: string;
|
|
256
|
-
gas?: number;
|
|
257
|
-
gasPrice?: string;
|
|
258
|
-
maxFeePerGas?: string;
|
|
259
|
-
maxPriorityFeePerGas?: string;
|
|
260
|
-
}, chainType?: ChainType$1): Promise<string>;
|
|
261
|
-
estimateGas(address: string, abi: any[], functionName: string, args?: any[], chainType?: ChainType$1): Promise<bigint>;
|
|
262
|
-
waitForTransaction(txHash: string, confirmations?: number, chainType?: ChainType$1): Promise<TransactionReceipt>;
|
|
263
|
-
getProvider(): any;
|
|
264
|
-
getProviderByChainType(chainType: ChainType$1): any;
|
|
265
|
-
private setPrimaryWallet;
|
|
266
|
-
private canSwitchChain;
|
|
267
|
-
private setupAdapterListeners;
|
|
268
|
-
private removeAdapterListeners;
|
|
269
|
-
private saveToStorage;
|
|
270
|
-
restoreFromStorage(): Promise<Account | null>;
|
|
271
|
-
private clearStorage;
|
|
272
|
-
private getHistoryRecords;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
declare class AdapterRegistry {
|
|
276
|
-
private adapters;
|
|
277
|
-
private config;
|
|
278
|
-
constructor(config?: WalletManagerConfig);
|
|
279
|
-
private registerDefaultAdapters;
|
|
280
|
-
register(type: WalletType, factory: () => IWalletAdapter): void;
|
|
281
|
-
getAdapter(type: WalletType): IWalletAdapter | null;
|
|
282
|
-
has(type: WalletType): boolean;
|
|
283
|
-
getRegisteredTypes(): WalletType[];
|
|
284
|
-
getAdapterTypesByChainType(chainType: ChainType$1): WalletType[];
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
declare class WalletSDKError extends Error {
|
|
288
|
-
readonly code: string;
|
|
289
|
-
readonly details?: any | undefined;
|
|
290
|
-
constructor(message: string, code: string, details?: any | undefined);
|
|
291
|
-
}
|
|
292
|
-
declare class WalletNotConnectedError extends WalletSDKError {
|
|
293
|
-
constructor(walletType?: string);
|
|
294
|
-
}
|
|
295
|
-
declare class WalletNotAvailableError extends WalletSDKError {
|
|
296
|
-
constructor(walletType: string, downloadUrl?: string);
|
|
297
|
-
}
|
|
298
|
-
declare class ConnectionRejectedError extends WalletSDKError {
|
|
299
|
-
constructor(walletType: string);
|
|
300
|
-
}
|
|
301
|
-
declare class ChainNotSupportedError extends WalletSDKError {
|
|
302
|
-
constructor(chainId: number, walletType: string);
|
|
303
|
-
}
|
|
304
|
-
declare class SignatureRejectedError extends WalletSDKError {
|
|
305
|
-
constructor(message?: string);
|
|
306
|
-
}
|
|
307
|
-
declare class TransactionFailedError extends WalletSDKError {
|
|
308
|
-
constructor(txHash: string, reason?: string);
|
|
309
|
-
}
|
|
310
|
-
declare class MethodNotSupportedError extends WalletSDKError {
|
|
311
|
-
constructor(method: string, walletType: string);
|
|
312
|
-
}
|
|
313
|
-
declare class ConfigurationError extends WalletSDKError {
|
|
314
|
-
constructor(message: string, details?: any);
|
|
315
|
-
}
|
|
316
|
-
declare class NetworkError extends WalletSDKError {
|
|
317
|
-
constructor(message: string, details?: any);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
declare abstract class WalletAdapter extends EventEmitter implements IWalletAdapter {
|
|
321
|
-
abstract readonly type: WalletType;
|
|
322
|
-
abstract readonly chainType: ChainType$1;
|
|
323
|
-
abstract readonly name: string;
|
|
324
|
-
readonly icon?: string;
|
|
325
|
-
state: WalletState;
|
|
326
|
-
currentAccount: Account | null;
|
|
327
|
-
abstract connect(chainId?: number | number[]): Promise<Account>;
|
|
328
|
-
abstract disconnect(): Promise<void>;
|
|
329
|
-
abstract isAvailable(): Promise<boolean>;
|
|
330
|
-
isConnected(): boolean;
|
|
331
|
-
abstract signMessage(message: string): Promise<string>;
|
|
332
|
-
getAddress(): Promise<string>;
|
|
333
|
-
signTransaction?(_transaction: any): Promise<string>;
|
|
334
|
-
signTypedData?(_typedData: any): Promise<string>;
|
|
335
|
-
switchChain?(_chainId: number): Promise<void>;
|
|
336
|
-
addChain?(_chainConfig: any): Promise<void>;
|
|
337
|
-
readContract<T = any>(_params: ContractReadParams): Promise<T>;
|
|
338
|
-
writeContract(_params: ContractWriteParams): Promise<string>;
|
|
339
|
-
estimateGas(_params: ContractWriteParams): Promise<bigint>;
|
|
340
|
-
waitForTransaction(_txHash: string, _confirmations?: number): Promise<TransactionReceipt>;
|
|
341
|
-
abstract getProvider(): any;
|
|
342
|
-
getSigner?(): any;
|
|
343
|
-
protected ensureConnected(): void;
|
|
344
|
-
protected setState(state: WalletState): void;
|
|
345
|
-
protected setAccount(account: Account | null): void;
|
|
346
|
-
protected emitAccountChanged(account: Account | null): void;
|
|
347
|
-
protected emitChainChanged(chainId: number): void;
|
|
348
|
-
protected emitDisconnected(): void;
|
|
349
|
-
protected emitError(error: Error): void;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
declare abstract class BrowserWalletAdapter extends WalletAdapter {
|
|
353
|
-
protected abstract getBrowserProvider(): any | undefined;
|
|
354
|
-
isAvailable(): Promise<boolean>;
|
|
355
|
-
protected ensureAvailable(): Promise<void>;
|
|
356
|
-
protected abstract getDownloadUrl(): string;
|
|
357
|
-
protected abstract setupEventListeners(): void;
|
|
358
|
-
protected abstract removeEventListeners(): void;
|
|
359
|
-
disconnect(): Promise<void>;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
declare class MetaMaskAdapter extends BrowserWalletAdapter {
|
|
363
|
-
readonly type = WalletType.METAMASK;
|
|
364
|
-
readonly chainType = ChainType.EVM;
|
|
365
|
-
readonly name = "MetaMask";
|
|
366
|
-
readonly icon = "https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg";
|
|
367
|
-
private walletClient;
|
|
368
|
-
private publicClient;
|
|
369
|
-
connect(chainId?: number | number[]): Promise<Account>;
|
|
370
|
-
signMessage(message: string): Promise<string>;
|
|
371
|
-
signTypedData(typedData: any): Promise<string>;
|
|
372
|
-
signTransaction(transaction: any): Promise<string>;
|
|
373
|
-
switchChain(chainId: number): Promise<void>;
|
|
374
|
-
addChain(chainConfig: AddChainParams): Promise<void>;
|
|
375
|
-
readContract<T = any>(params: ContractReadParams): Promise<T>;
|
|
376
|
-
writeContract(params: ContractWriteParams): Promise<string>;
|
|
377
|
-
estimateGas(params: ContractWriteParams): Promise<bigint>;
|
|
378
|
-
waitForTransaction(txHash: string, confirmations?: number): Promise<TransactionReceipt>;
|
|
379
|
-
getProvider(): any;
|
|
380
|
-
getSigner(): WalletClient | null;
|
|
381
|
-
protected getBrowserProvider(): any | undefined;
|
|
382
|
-
protected getDownloadUrl(): string;
|
|
383
|
-
protected setupEventListeners(): void;
|
|
384
|
-
protected removeEventListeners(): void;
|
|
385
|
-
private handleAccountsChanged;
|
|
386
|
-
private handleChainChanged;
|
|
387
|
-
private handleDisconnect;
|
|
388
|
-
private getViemChain;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
declare class WalletConnectAdapter extends WalletAdapter {
|
|
392
|
-
readonly type = WalletType.WALLETCONNECT;
|
|
393
|
-
readonly chainType = ChainType.EVM;
|
|
394
|
-
readonly name = "WalletConnect";
|
|
395
|
-
readonly icon = "https://avatars.githubusercontent.com/u/37784886";
|
|
396
|
-
private provider;
|
|
397
|
-
private walletClient;
|
|
398
|
-
private publicClient;
|
|
399
|
-
private projectId;
|
|
400
|
-
private supportedChains;
|
|
401
|
-
private static providerInstance;
|
|
402
|
-
private static providerProjectId;
|
|
403
|
-
private static providerChains;
|
|
404
|
-
private static isInitializing;
|
|
405
|
-
private static initPromise;
|
|
406
|
-
constructor(projectId: string);
|
|
407
|
-
isAvailable(): Promise<boolean>;
|
|
408
|
-
private isTelegramMiniApp;
|
|
409
|
-
private getTelegramWebApp;
|
|
410
|
-
private closeTelegramDeepLinkPopup;
|
|
411
|
-
connect(chainId?: number | number[]): Promise<Account>;
|
|
412
|
-
disconnect(): Promise<void>;
|
|
413
|
-
signMessage(message: string): Promise<string>;
|
|
414
|
-
signTypedData(typedData: any): Promise<string>;
|
|
415
|
-
signTransaction(transaction: any): Promise<string>;
|
|
416
|
-
getSupportedChains(): number[];
|
|
417
|
-
switchChain(chainId: number): Promise<void>;
|
|
418
|
-
addChain(chainConfig: AddChainParams): Promise<void>;
|
|
419
|
-
readContract<T = any>(params: ContractReadParams): Promise<T>;
|
|
420
|
-
writeContract(params: ContractWriteParams): Promise<string>;
|
|
421
|
-
estimateGas(params: ContractWriteParams): Promise<bigint>;
|
|
422
|
-
waitForTransaction(txHash: string, confirmations?: number): Promise<TransactionReceipt>;
|
|
423
|
-
getProvider(): any;
|
|
424
|
-
getSigner(): WalletClient | null;
|
|
425
|
-
protected setupEventListeners(): void;
|
|
426
|
-
protected removeEventListeners(): void;
|
|
427
|
-
private handleAccountsChanged;
|
|
428
|
-
private handleChainChanged;
|
|
429
|
-
private handleDisconnect;
|
|
430
|
-
private getViemChain;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
declare class TronLinkAdapter extends BrowserWalletAdapter {
|
|
434
|
-
readonly type = WalletType.TRONLINK;
|
|
435
|
-
readonly chainType = ChainType.TRON;
|
|
436
|
-
readonly name = "TronWeb";
|
|
437
|
-
readonly icon = "https://www.tronlink.org/static/logoIcon.svg";
|
|
438
|
-
private static readonly TRON_MAINNET_CHAIN_ID;
|
|
439
|
-
connect(chainId?: number | number[]): Promise<Account>;
|
|
440
|
-
signMessage(message: string): Promise<string>;
|
|
441
|
-
signTransaction(transaction: any): Promise<string>;
|
|
442
|
-
readContract<T = any>(params: ContractReadParams): Promise<T>;
|
|
443
|
-
writeContract(params: ContractWriteParams): Promise<string>;
|
|
444
|
-
waitForTransaction(txHash: string, _confirmations?: number): Promise<TransactionReceipt>;
|
|
445
|
-
getProvider(): any;
|
|
446
|
-
protected getBrowserProvider(): any | undefined;
|
|
447
|
-
private getTronWeb;
|
|
448
|
-
protected getDownloadUrl(): string;
|
|
449
|
-
protected setupEventListeners(): void;
|
|
450
|
-
protected removeEventListeners(): void;
|
|
451
|
-
private pollingInterval;
|
|
452
|
-
private lastKnownAddress;
|
|
453
|
-
private startPolling;
|
|
454
|
-
private stopPolling;
|
|
455
|
-
private handleAccountsChanged;
|
|
456
|
-
private handleDisconnect;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
declare class WalletConnectTronAdapter extends WalletAdapter {
|
|
460
|
-
readonly type = WalletType.WALLETCONNECT_TRON;
|
|
461
|
-
readonly chainType = ChainType.TRON;
|
|
462
|
-
readonly name = "WalletConnect (Tron)";
|
|
463
|
-
readonly icon = "https://avatars.githubusercontent.com/u/37784886";
|
|
464
|
-
private wallet;
|
|
465
|
-
private projectId;
|
|
466
|
-
private currentAddress;
|
|
467
|
-
private static readonly TRON_MAINNET_CHAIN_ID;
|
|
468
|
-
private static walletInstance;
|
|
469
|
-
private static walletProjectId;
|
|
470
|
-
constructor(projectId: string);
|
|
471
|
-
isAvailable(): Promise<boolean>;
|
|
472
|
-
private isTelegramMiniApp;
|
|
473
|
-
restoreSession(chainId?: number | number[]): Promise<Account | null>;
|
|
474
|
-
private initializeWallet;
|
|
475
|
-
connect(chainId?: number | number[]): Promise<Account>;
|
|
476
|
-
disconnect(): Promise<void>;
|
|
477
|
-
signMessage(message: string): Promise<string>;
|
|
478
|
-
signTransaction(transaction: any): Promise<string>;
|
|
479
|
-
readContract<T = any>(_params: ContractReadParams): Promise<T>;
|
|
480
|
-
writeContract(_params: ContractWriteParams): Promise<string>;
|
|
481
|
-
estimateGas(_params: ContractWriteParams): Promise<bigint>;
|
|
482
|
-
waitForTransaction(_txHash: string, _confirmations?: number): Promise<TransactionReceipt>;
|
|
483
|
-
private setupEventListeners;
|
|
484
|
-
private removeEventListeners;
|
|
485
|
-
getProvider(): WalletConnectWallet | null;
|
|
486
|
-
static clearWalletInstance(): void;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
declare class EVMPrivateKeyAdapter extends WalletAdapter {
|
|
490
|
-
readonly type = WalletType.PRIVATE_KEY;
|
|
491
|
-
readonly chainType = ChainType.EVM;
|
|
492
|
-
readonly name = "Private Key (EVM)";
|
|
493
|
-
private privateKey;
|
|
494
|
-
private walletClient;
|
|
495
|
-
private publicClient;
|
|
496
|
-
connect(chainId?: number | number[]): Promise<Account>;
|
|
497
|
-
disconnect(): Promise<void>;
|
|
498
|
-
isAvailable(): Promise<boolean>;
|
|
499
|
-
setPrivateKey(privateKey: string): void;
|
|
500
|
-
signMessage(message: string): Promise<string>;
|
|
501
|
-
signTypedData(typedData: any): Promise<string>;
|
|
502
|
-
switchChain(chainId: number): Promise<void>;
|
|
503
|
-
readContract<T = any>(params: ContractReadParams): Promise<T>;
|
|
504
|
-
writeContract(params: ContractWriteParams): Promise<string>;
|
|
505
|
-
estimateGas(params: ContractWriteParams): Promise<bigint>;
|
|
506
|
-
waitForTransaction(txHash: string, confirmations?: number): Promise<TransactionReceipt>;
|
|
507
|
-
getProvider(): any;
|
|
508
|
-
getSigner(): WalletClient | null;
|
|
509
|
-
private getViemChain;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
declare enum DeepLinkProviderType {
|
|
513
|
-
TOKENPOCKET = "tokenpocket",
|
|
514
|
-
TRONLINK = "tronlink",
|
|
515
|
-
IMTOKEN = "imtoken",
|
|
516
|
-
METAMASK = "metamask",
|
|
517
|
-
OKX = "okx"
|
|
518
|
-
}
|
|
519
|
-
interface DeepLinkAdapterConfig {
|
|
520
|
-
providerType: DeepLinkProviderType;
|
|
521
|
-
callbackUrl?: string;
|
|
522
|
-
callbackSchema?: string;
|
|
523
|
-
}
|
|
524
|
-
declare class DeepLinkAdapter extends WalletAdapter {
|
|
525
|
-
readonly type: WalletType;
|
|
526
|
-
readonly chainType: ChainType$1;
|
|
527
|
-
readonly name: string;
|
|
528
|
-
readonly icon: string;
|
|
529
|
-
private provider;
|
|
530
|
-
private currentChainId;
|
|
531
|
-
private currentChainType;
|
|
532
|
-
private static pendingActions;
|
|
533
|
-
constructor(config: DeepLinkAdapterConfig);
|
|
534
|
-
private createProvider;
|
|
535
|
-
private setupCallbackHandler;
|
|
536
|
-
isAvailable(): Promise<boolean>;
|
|
537
|
-
connect(chainId?: number | number[]): Promise<Account>;
|
|
538
|
-
disconnect(): Promise<void>;
|
|
539
|
-
signMessage(message: string): Promise<string>;
|
|
540
|
-
signTransaction(transaction: any): Promise<string>;
|
|
541
|
-
getProvider(): any;
|
|
542
|
-
static handleCallback(): void;
|
|
543
|
-
protected setAccount(account: Account | null): void;
|
|
544
|
-
protected emitDisconnected(): void;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
interface DeepLinkSignMessageParams {
|
|
548
|
-
message: string;
|
|
549
|
-
chainId: number;
|
|
550
|
-
chainType: ChainType$1;
|
|
551
|
-
}
|
|
552
|
-
interface DeepLinkSignTransactionParams {
|
|
553
|
-
transaction: any;
|
|
554
|
-
chainId: number;
|
|
555
|
-
chainType: ChainType$1;
|
|
556
|
-
}
|
|
557
|
-
interface DeepLinkConnectParams {
|
|
558
|
-
chainId: number;
|
|
559
|
-
chainType: ChainType$1;
|
|
560
|
-
}
|
|
561
|
-
interface IDeepLinkProvider {
|
|
562
|
-
readonly name: string;
|
|
563
|
-
readonly icon: string;
|
|
564
|
-
readonly supportedChainTypes: ChainType$1[];
|
|
565
|
-
isAvailable(): Promise<boolean>;
|
|
566
|
-
buildSignMessageLink(params: DeepLinkSignMessageParams): {
|
|
567
|
-
url: string;
|
|
568
|
-
actionId: string;
|
|
569
|
-
callbackSchema?: string;
|
|
570
|
-
callbackUrl?: string;
|
|
571
|
-
};
|
|
572
|
-
buildSignTransactionLink(params: DeepLinkSignTransactionParams): {
|
|
573
|
-
url: string;
|
|
574
|
-
actionId: string;
|
|
575
|
-
callbackSchema?: string;
|
|
576
|
-
callbackUrl?: string;
|
|
577
|
-
};
|
|
578
|
-
buildConnectLink?(params: DeepLinkConnectParams): {
|
|
579
|
-
url: string;
|
|
580
|
-
actionId?: string;
|
|
581
|
-
};
|
|
582
|
-
parseCallbackResult(urlParams: URLSearchParams): {
|
|
583
|
-
actionId: string | null;
|
|
584
|
-
result: any | null;
|
|
585
|
-
error: string | null;
|
|
586
|
-
};
|
|
587
|
-
getDefaultCallbackSchema?(): string;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
declare class TokenPocketDeepLinkProvider implements IDeepLinkProvider {
|
|
591
|
-
readonly name = "TokenPocket";
|
|
592
|
-
readonly icon = "https://tokenpocket.pro/icon.png";
|
|
593
|
-
readonly supportedChainTypes: _enclave_hq_chain_utils.ChainType[];
|
|
594
|
-
private callbackUrl?;
|
|
595
|
-
private callbackSchema?;
|
|
596
|
-
constructor(options?: {
|
|
597
|
-
callbackUrl?: string;
|
|
598
|
-
callbackSchema?: string;
|
|
599
|
-
});
|
|
600
|
-
isAvailable(): Promise<boolean>;
|
|
601
|
-
private generateActionId;
|
|
602
|
-
private getCallbackConfig;
|
|
603
|
-
private getBlockchainConfig;
|
|
604
|
-
buildSignMessageLink(params: DeepLinkSignMessageParams): {
|
|
605
|
-
url: string;
|
|
606
|
-
actionId: string;
|
|
607
|
-
callbackSchema?: string;
|
|
608
|
-
callbackUrl?: string;
|
|
609
|
-
};
|
|
610
|
-
buildSignTransactionLink(params: DeepLinkSignTransactionParams): {
|
|
611
|
-
url: string;
|
|
612
|
-
actionId: string;
|
|
613
|
-
callbackSchema?: string;
|
|
614
|
-
callbackUrl?: string;
|
|
615
|
-
};
|
|
616
|
-
buildConnectLink(params: DeepLinkConnectParams): {
|
|
617
|
-
url: string;
|
|
618
|
-
actionId?: string;
|
|
619
|
-
};
|
|
620
|
-
parseCallbackResult(urlParams: URLSearchParams): {
|
|
621
|
-
actionId: string | null;
|
|
622
|
-
result: any | null;
|
|
623
|
-
error: string | null;
|
|
624
|
-
};
|
|
625
|
-
getDefaultCallbackSchema(): string;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
declare class TronLinkDeepLinkProvider implements IDeepLinkProvider {
|
|
629
|
-
readonly name = "TronLink";
|
|
630
|
-
readonly icon = "https://www.tronlink.org/static/logoIcon.svg";
|
|
631
|
-
readonly supportedChainTypes: _enclave_hq_chain_utils.ChainType[];
|
|
632
|
-
isAvailable(): Promise<boolean>;
|
|
633
|
-
buildSignMessageLink(params: DeepLinkSignMessageParams): {
|
|
634
|
-
url: string;
|
|
635
|
-
actionId: string;
|
|
636
|
-
callbackSchema?: string;
|
|
637
|
-
callbackUrl?: string;
|
|
638
|
-
};
|
|
639
|
-
buildSignTransactionLink(params: DeepLinkSignTransactionParams): {
|
|
640
|
-
url: string;
|
|
641
|
-
actionId: string;
|
|
642
|
-
callbackSchema?: string;
|
|
643
|
-
callbackUrl?: string;
|
|
644
|
-
};
|
|
645
|
-
buildConnectLink(params: DeepLinkConnectParams): {
|
|
646
|
-
url: string;
|
|
647
|
-
actionId?: string;
|
|
648
|
-
};
|
|
649
|
-
parseCallbackResult(_urlParams: URLSearchParams): {
|
|
650
|
-
actionId: string | null;
|
|
651
|
-
result: any | null;
|
|
652
|
-
error: string | null;
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
declare class ImTokenDeepLinkProvider implements IDeepLinkProvider {
|
|
657
|
-
readonly name = "ImToken";
|
|
658
|
-
readonly icon = "https://token.im/static/img/logo.png";
|
|
659
|
-
readonly supportedChainTypes: _enclave_hq_chain_utils.ChainType[];
|
|
660
|
-
private callbackUrl?;
|
|
661
|
-
private callbackSchema?;
|
|
662
|
-
constructor(options?: {
|
|
663
|
-
callbackUrl?: string;
|
|
664
|
-
callbackSchema?: string;
|
|
665
|
-
});
|
|
666
|
-
isAvailable(): Promise<boolean>;
|
|
667
|
-
private generateActionId;
|
|
668
|
-
private getCallbackConfig;
|
|
669
|
-
buildSignMessageLink(params: DeepLinkSignMessageParams): {
|
|
670
|
-
url: string;
|
|
671
|
-
actionId: string;
|
|
672
|
-
callbackSchema?: string;
|
|
673
|
-
callbackUrl?: string;
|
|
674
|
-
};
|
|
675
|
-
buildSignTransactionLink(params: DeepLinkSignTransactionParams): {
|
|
676
|
-
url: string;
|
|
677
|
-
actionId: string;
|
|
678
|
-
callbackSchema?: string;
|
|
679
|
-
callbackUrl?: string;
|
|
680
|
-
};
|
|
681
|
-
buildConnectLink(params: DeepLinkConnectParams): {
|
|
682
|
-
url: string;
|
|
683
|
-
actionId?: string;
|
|
684
|
-
};
|
|
685
|
-
parseCallbackResult(urlParams: URLSearchParams): {
|
|
686
|
-
actionId: string | null;
|
|
687
|
-
result: any | null;
|
|
688
|
-
error: string | null;
|
|
689
|
-
};
|
|
690
|
-
getDefaultCallbackSchema(): string;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
declare class MetaMaskDeepLinkProvider implements IDeepLinkProvider {
|
|
694
|
-
readonly name = "MetaMask";
|
|
695
|
-
readonly icon = "https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg";
|
|
696
|
-
readonly supportedChainTypes: _enclave_hq_chain_utils.ChainType[];
|
|
697
|
-
isAvailable(): Promise<boolean>;
|
|
698
|
-
buildSignMessageLink(params: DeepLinkSignMessageParams): {
|
|
699
|
-
url: string;
|
|
700
|
-
actionId: string;
|
|
701
|
-
callbackSchema?: string;
|
|
702
|
-
callbackUrl?: string;
|
|
703
|
-
};
|
|
704
|
-
buildSignTransactionLink(params: DeepLinkSignTransactionParams): {
|
|
705
|
-
url: string;
|
|
706
|
-
actionId: string;
|
|
707
|
-
callbackSchema?: string;
|
|
708
|
-
callbackUrl?: string;
|
|
709
|
-
};
|
|
710
|
-
buildConnectLink(params: DeepLinkConnectParams): {
|
|
711
|
-
url: string;
|
|
712
|
-
actionId?: string;
|
|
713
|
-
};
|
|
714
|
-
parseCallbackResult(urlParams: URLSearchParams): {
|
|
715
|
-
actionId: string | null;
|
|
716
|
-
result: any | null;
|
|
717
|
-
error: string | null;
|
|
718
|
-
};
|
|
719
|
-
getDefaultCallbackSchema(): string;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
declare class OKXDeepLinkProvider implements IDeepLinkProvider {
|
|
723
|
-
readonly name = "OKX";
|
|
724
|
-
readonly icon = "https://www.okx.com/favicon.ico";
|
|
725
|
-
readonly supportedChainTypes: _enclave_hq_chain_utils.ChainType[];
|
|
726
|
-
isAvailable(): Promise<boolean>;
|
|
727
|
-
buildSignMessageLink(params: DeepLinkSignMessageParams): {
|
|
728
|
-
url: string;
|
|
729
|
-
actionId: string;
|
|
730
|
-
callbackSchema?: string;
|
|
731
|
-
callbackUrl?: string;
|
|
732
|
-
};
|
|
733
|
-
buildSignTransactionLink(params: DeepLinkSignTransactionParams): {
|
|
734
|
-
url: string;
|
|
735
|
-
actionId: string;
|
|
736
|
-
callbackSchema?: string;
|
|
737
|
-
callbackUrl?: string;
|
|
738
|
-
};
|
|
739
|
-
buildConnectLink(params: DeepLinkConnectParams): {
|
|
740
|
-
url: string;
|
|
741
|
-
actionId?: string;
|
|
742
|
-
};
|
|
743
|
-
parseCallbackResult(urlParams: URLSearchParams): {
|
|
744
|
-
actionId: string | null;
|
|
745
|
-
result: any | null;
|
|
746
|
-
error: string | null;
|
|
747
|
-
};
|
|
748
|
-
getDefaultCallbackSchema(): string;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
declare enum DeepLinkWalletType {
|
|
752
|
-
TOKENPOCKET = "tokenpocket",
|
|
753
|
-
TRONLINK = "tronlink"
|
|
754
|
-
}
|
|
755
|
-
declare class TronDeepLinkAdapter extends WalletAdapter {
|
|
756
|
-
readonly type = WalletType.TRONLINK;
|
|
757
|
-
readonly chainType = ChainType.TRON;
|
|
758
|
-
readonly name: string;
|
|
759
|
-
readonly icon: string;
|
|
760
|
-
private walletType;
|
|
761
|
-
private callbackUrl?;
|
|
762
|
-
private callbackSchema?;
|
|
763
|
-
private pendingActions;
|
|
764
|
-
private static readonly TRON_MAINNET_CHAIN_ID;
|
|
765
|
-
constructor(walletType?: DeepLinkWalletType, options?: {
|
|
766
|
-
callbackUrl?: string;
|
|
767
|
-
callbackSchema?: string;
|
|
768
|
-
});
|
|
769
|
-
private setupCallbackHandler;
|
|
770
|
-
private checkCallbackFromUrl;
|
|
771
|
-
isAvailable(): Promise<boolean>;
|
|
772
|
-
connect(chainId?: number | number[]): Promise<Account>;
|
|
773
|
-
disconnect(): Promise<void>;
|
|
774
|
-
signMessage(message: string): Promise<string>;
|
|
775
|
-
signTransaction(transaction: any): Promise<string>;
|
|
776
|
-
readContract<T = any>(_params: ContractReadParams): Promise<T>;
|
|
777
|
-
writeContract(_params: ContractWriteParams): Promise<string>;
|
|
778
|
-
estimateGas(_params: ContractWriteParams): Promise<bigint>;
|
|
779
|
-
waitForTransaction(_txHash: string, _confirmations?: number): Promise<TransactionReceipt>;
|
|
780
|
-
getProvider(): any;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
interface AuthMessageParams {
|
|
784
|
-
domain: string;
|
|
785
|
-
nonce: string;
|
|
786
|
-
chainId: number;
|
|
787
|
-
timestamp: number;
|
|
788
|
-
statement?: string;
|
|
789
|
-
}
|
|
790
|
-
declare class AuthMessageGenerator {
|
|
791
|
-
private readonly domain;
|
|
792
|
-
constructor(domain: string);
|
|
793
|
-
generateAuthMessage(chainType: ChainType$1, nonce: string, chainId: number, timestamp?: number, statement?: string): string;
|
|
794
|
-
private generateEIP191Message;
|
|
795
|
-
private generateTIP191Message;
|
|
796
|
-
static generateNonce(): string;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
declare class SignatureVerifier {
|
|
800
|
-
verifySignature(message: string, signature: string, expectedAddress: string, chainType: ChainType$1): Promise<boolean>;
|
|
801
|
-
private verifyEIP191Signature;
|
|
802
|
-
private verifyTIP191Signature;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
declare class WalletDetector {
|
|
806
|
-
detectAllWallets(): Promise<WalletAvailability[]>;
|
|
807
|
-
detectWallet(walletType: WalletType): Promise<WalletAvailability>;
|
|
808
|
-
private isWalletAvailable;
|
|
809
|
-
private isMetaMaskAvailable;
|
|
810
|
-
private isTronLinkAvailable;
|
|
811
|
-
private isCoinbaseWalletAvailable;
|
|
812
|
-
waitForWallet(walletType: WalletType, timeout?: number): Promise<boolean>;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
interface WalletMetadata {
|
|
816
|
-
type: WalletType;
|
|
817
|
-
name: string;
|
|
818
|
-
chainType: ChainType$1;
|
|
819
|
-
icon?: string;
|
|
820
|
-
downloadUrl?: string;
|
|
821
|
-
description?: string;
|
|
822
|
-
}
|
|
823
|
-
declare const SUPPORTED_WALLETS: Record<WalletType, WalletMetadata>;
|
|
824
|
-
declare function getWalletMetadata(type: WalletType): WalletMetadata | undefined;
|
|
825
|
-
declare function getEVMWallets(): WalletMetadata[];
|
|
826
|
-
declare function getTronWallets(): WalletMetadata[];
|
|
827
|
-
|
|
828
|
-
declare function createUniversalAddress(chainId: number, address: string): UniversalAddress;
|
|
829
|
-
declare function parseUniversalAddress(universalAddress: UniversalAddress): {
|
|
830
|
-
chainId: number;
|
|
831
|
-
address: string;
|
|
832
|
-
} | null;
|
|
833
|
-
declare function isValidUniversalAddress(universalAddress: string): boolean;
|
|
834
|
-
declare function getChainIdFromUniversalAddress(universalAddress: UniversalAddress): number | null;
|
|
835
|
-
declare function getAddressFromUniversalAddress(universalAddress: UniversalAddress): string | null;
|
|
836
|
-
declare function compareUniversalAddresses(a: UniversalAddress, b: UniversalAddress): boolean;
|
|
837
|
-
|
|
838
|
-
declare function isValidEVMAddress(address: string): boolean;
|
|
839
|
-
declare function formatEVMAddress(address: string): string;
|
|
840
|
-
declare function compareEVMAddresses(a: string, b: string): boolean;
|
|
841
|
-
declare function shortenAddress(address: string, chars?: number): string;
|
|
842
|
-
|
|
843
|
-
declare function isValidTronAddress(address: string): boolean;
|
|
844
|
-
declare function isValidTronHexAddress(address: string): boolean;
|
|
845
|
-
declare function compareTronAddresses(a: string, b: string): boolean;
|
|
846
|
-
declare function shortenTronAddress(address: string, chars?: number): string;
|
|
847
|
-
|
|
848
|
-
interface ChainInfo extends Omit<ChainInfo$1, 'nativeChainId' | 'slip44'> {
|
|
849
|
-
id: number;
|
|
850
|
-
slip44?: number;
|
|
851
|
-
nativeCurrency: {
|
|
852
|
-
name: string;
|
|
853
|
-
symbol: string;
|
|
854
|
-
decimals: number;
|
|
855
|
-
};
|
|
856
|
-
rpcUrls: string[];
|
|
857
|
-
blockExplorerUrls?: string[];
|
|
858
|
-
iconUrls?: string[];
|
|
859
|
-
}
|
|
860
|
-
declare const CHAIN_INFO: Record<number, ChainInfo>;
|
|
861
|
-
declare function getChainInfo(chainId: number): ChainInfo | undefined;
|
|
862
|
-
declare function getChainType(chainId: number): ChainType$2 | undefined;
|
|
863
|
-
declare function isEVMChain(chainId: number): boolean;
|
|
864
|
-
declare function isTronChain(chainId: number): boolean;
|
|
865
|
-
|
|
866
|
-
declare function validateAddress(address: string, chainType: ChainType$1): boolean;
|
|
867
|
-
declare function validateAddressForChain(address: string, chainId: number): boolean;
|
|
868
|
-
declare function isValidChainId(chainId: number): boolean;
|
|
869
|
-
declare function isValidSignature(signature: string): boolean;
|
|
870
|
-
declare function isValidTransactionHash(txHash: string, chainType: ChainType$1): boolean;
|
|
871
|
-
|
|
872
|
-
declare function isHex(value: string): boolean;
|
|
873
|
-
declare function toHex(value: string): string;
|
|
874
|
-
declare function fromHex(hex: string): string;
|
|
875
|
-
declare function numberToHex(value: number | bigint): string;
|
|
876
|
-
declare function hexToNumber(hex: string): number;
|
|
877
|
-
declare function ensureHexPrefix(value: string): string;
|
|
878
|
-
declare function removeHexPrefix(value: string): string;
|
|
879
|
-
|
|
880
|
-
export { type Account, AdapterRegistry, type AddChainParams, AuthMessageGenerator, type AuthMessageParams, BrowserWalletAdapter, CHAIN_INFO, type ChainInfo, ChainNotSupportedError, ChainType$1 as ChainType, ConfigurationError, type ConnectedWallet, ConnectionRejectedError, type ContractReadParams, type ContractWriteParams, DeepLinkAdapter, DeepLinkProviderType, DeepLinkWalletType, EVMPrivateKeyAdapter, type EVMTransaction, type IDeepLinkProvider, type ISigner, type IWalletAdapter, ImTokenDeepLinkProvider, MetaMaskAdapter, MetaMaskDeepLinkProvider, MethodNotSupportedError, NetworkError, OKXDeepLinkProvider, type QRCodeSignResult, QRCodeSignStatus, QRCodeSigner, type QRCodeSignerConfig, SUPPORTED_WALLETS, SignatureRejectedError, SignatureVerifier, type StorageData, TokenPocketDeepLinkProvider, type Transaction, TransactionFailedError, type TransactionReceipt, TronDeepLinkAdapter, TronLinkAdapter, TronLinkDeepLinkProvider, type TronTransaction, type UniversalAddress, WalletAdapter, type WalletAvailability, WalletConnectAdapter, WalletConnectTronAdapter, WalletDetector, type WalletHistoryRecord, WalletManager, type WalletManagerConfig, type WalletManagerEvents, type WalletMetadata, WalletNotAvailableError, WalletNotConnectedError, WalletSDKError, WalletState, WalletType, compareEVMAddresses, compareTronAddresses, compareUniversalAddresses, createUniversalAddress, WalletManager as default, ensureHexPrefix, formatEVMAddress, fromHex, getAddressFromUniversalAddress, getChainIdFromUniversalAddress, getChainInfo, getChainType, getEVMWallets, getTronWallets, getWalletMetadata, hexToNumber, isEVMChain, isHex, isTronChain, isValidChainId, isValidEVMAddress, isValidSignature, isValidTransactionHash, isValidTronAddress, isValidTronHexAddress, isValidUniversalAddress, numberToHex, parseUniversalAddress, removeHexPrefix, shortenAddress, shortenTronAddress, toHex, validateAddress, validateAddressForChain };
|