@vleap/warps-adapter-evm 0.2.0-alpha.4 → 0.2.0-alpha.41
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.cts +261 -0
- package/dist/index.d.ts +159 -53
- package/dist/index.js +1035 -399
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1027 -379
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -10
- package/README.md +0 -400
- package/dist/index.d.mts +0 -155
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, WarpCache, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpActionExecution, AdapterWarpExplorer, AdapterWarpResults, Warp, WarpActionIndex, WarpAdapterGenericRemoteTransaction, ResolvedInput, WarpNativeValue, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, BaseWarpActionInputType, WarpAdapterGenericType, AdapterWarpWallet, WarpAdapterGenericTransaction } from '@vleap/warps';
|
|
2
|
+
import { ethers } from 'ethers';
|
|
3
|
+
|
|
4
|
+
declare const NativeTokenArb: WarpChainAsset;
|
|
5
|
+
declare const getArbitrumAdapter: AdapterFactory;
|
|
6
|
+
|
|
7
|
+
declare const NativeTokenBase: WarpChainAsset;
|
|
8
|
+
declare const getBaseAdapter: AdapterFactory;
|
|
9
|
+
|
|
10
|
+
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
11
|
+
declare const getAllEvmChainNames: () => WarpChain[];
|
|
12
|
+
|
|
13
|
+
declare const createEvmAdapter: (chainName: WarpChain, chainInfos: Record<WarpChainEnv, WarpChainInfo>) => AdapterFactory;
|
|
14
|
+
|
|
15
|
+
declare const NativeTokenEth: WarpChainAsset;
|
|
16
|
+
declare const getEthereumAdapter: AdapterFactory;
|
|
17
|
+
|
|
18
|
+
declare const WarpEvmConstants: {
|
|
19
|
+
GasLimit: {
|
|
20
|
+
Default: number;
|
|
21
|
+
ContractCall: number;
|
|
22
|
+
ContractDeploy: number;
|
|
23
|
+
Transfer: number;
|
|
24
|
+
TokenTransfer: number;
|
|
25
|
+
Approve: number;
|
|
26
|
+
Swap: number;
|
|
27
|
+
};
|
|
28
|
+
GasPrice: {
|
|
29
|
+
Default: string;
|
|
30
|
+
};
|
|
31
|
+
Validation: {
|
|
32
|
+
MinGasLimit: number;
|
|
33
|
+
MaxGasLimit: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
declare enum EthereumExplorers {
|
|
37
|
+
Etherscan = "etherscan",
|
|
38
|
+
EtherscanSepolia = "etherscan_sepolia",
|
|
39
|
+
Ethplorer = "ethplorer",
|
|
40
|
+
Blockscout = "blockscout",
|
|
41
|
+
BlockscoutSepolia = "blockscout_sepolia"
|
|
42
|
+
}
|
|
43
|
+
declare enum ArbitrumExplorers {
|
|
44
|
+
Arbiscan = "arbiscan",
|
|
45
|
+
ArbiscanSepolia = "arbiscan_sepolia",
|
|
46
|
+
BlockscoutArbitrum = "blockscout_arbitrum",
|
|
47
|
+
BlockscoutArbitrumSepolia = "blockscout_arbitrum_sepolia"
|
|
48
|
+
}
|
|
49
|
+
declare enum BaseExplorers {
|
|
50
|
+
Basescan = "basescan",
|
|
51
|
+
BasescanSepolia = "basescan_sepolia",
|
|
52
|
+
BlockscoutBase = "blockscout_base",
|
|
53
|
+
BlockscoutBaseSepolia = "blockscout_base_sepolia"
|
|
54
|
+
}
|
|
55
|
+
type ExplorerName = EthereumExplorers | ArbitrumExplorers | BaseExplorers;
|
|
56
|
+
declare const EvmExplorers: {
|
|
57
|
+
readonly ethereum: {
|
|
58
|
+
readonly mainnet: readonly [EthereumExplorers.Etherscan, EthereumExplorers.Ethplorer, EthereumExplorers.Blockscout];
|
|
59
|
+
readonly testnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
|
|
60
|
+
readonly devnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
|
|
61
|
+
};
|
|
62
|
+
readonly arbitrum: {
|
|
63
|
+
readonly mainnet: readonly [ArbitrumExplorers.Arbiscan, ArbitrumExplorers.BlockscoutArbitrum];
|
|
64
|
+
readonly testnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
|
|
65
|
+
readonly devnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
|
|
66
|
+
};
|
|
67
|
+
readonly base: {
|
|
68
|
+
readonly mainnet: readonly [BaseExplorers.Basescan, BaseExplorers.BlockscoutBase];
|
|
69
|
+
readonly testnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
|
|
70
|
+
readonly devnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
74
|
+
|
|
75
|
+
interface TokenMetadata {
|
|
76
|
+
name: string;
|
|
77
|
+
symbol: string;
|
|
78
|
+
decimals: number;
|
|
79
|
+
logoUrl?: string;
|
|
80
|
+
}
|
|
81
|
+
interface TokenBalance {
|
|
82
|
+
tokenAddress: string;
|
|
83
|
+
balance: bigint;
|
|
84
|
+
metadata: TokenMetadata;
|
|
85
|
+
}
|
|
86
|
+
interface TokenInfo {
|
|
87
|
+
name?: string;
|
|
88
|
+
symbol?: string;
|
|
89
|
+
logoURI?: string;
|
|
90
|
+
decimals?: number;
|
|
91
|
+
}
|
|
92
|
+
interface UniswapToken {
|
|
93
|
+
chainId: number;
|
|
94
|
+
address: string;
|
|
95
|
+
name: string;
|
|
96
|
+
symbol: string;
|
|
97
|
+
decimals: number;
|
|
98
|
+
logoURI: string;
|
|
99
|
+
extensions?: {
|
|
100
|
+
bridgeInfo?: Record<string, {
|
|
101
|
+
tokenAddress: string;
|
|
102
|
+
}>;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
interface UniswapTokenList {
|
|
106
|
+
name: string;
|
|
107
|
+
timestamp: string;
|
|
108
|
+
version: {
|
|
109
|
+
major: number;
|
|
110
|
+
minor: number;
|
|
111
|
+
patch: number;
|
|
112
|
+
};
|
|
113
|
+
tokens: UniswapToken[];
|
|
114
|
+
}
|
|
115
|
+
interface TokenListResponse {
|
|
116
|
+
tokens: Array<{
|
|
117
|
+
chainId: number;
|
|
118
|
+
address: string;
|
|
119
|
+
name: string;
|
|
120
|
+
symbol: string;
|
|
121
|
+
decimals: number;
|
|
122
|
+
logoURI?: string;
|
|
123
|
+
}>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare class UniswapService {
|
|
127
|
+
private static readonly UNISWAP_TOKEN_LIST_URL;
|
|
128
|
+
private cache;
|
|
129
|
+
private chainId;
|
|
130
|
+
constructor(cache: WarpCache, chainId: number);
|
|
131
|
+
getTokenList(): Promise<UniswapTokenList>;
|
|
132
|
+
findToken(address: string): Promise<UniswapToken | null>;
|
|
133
|
+
getTokenMetadata(address: string): Promise<{
|
|
134
|
+
name: string;
|
|
135
|
+
symbol: string;
|
|
136
|
+
decimals: number;
|
|
137
|
+
logoUrl: string;
|
|
138
|
+
} | null>;
|
|
139
|
+
getBridgeInfo(address: string): Promise<Record<string, string> | null>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
declare const KnownTokens: Record<WarpChain, Record<string, WarpChainAsset[]>>;
|
|
143
|
+
declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
144
|
+
declare const getKnownTokensForChain: (chainName: string, env?: string) => WarpChainAsset[];
|
|
145
|
+
|
|
146
|
+
declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
147
|
+
private readonly config;
|
|
148
|
+
private readonly chain;
|
|
149
|
+
private provider;
|
|
150
|
+
private cache;
|
|
151
|
+
private uniswapService;
|
|
152
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
153
|
+
getAccount(address: string): Promise<WarpChainAccount>;
|
|
154
|
+
getAccountAssets(address: string): Promise<WarpChainAsset[]>;
|
|
155
|
+
getAsset(identifier: string): Promise<WarpChainAsset | null>;
|
|
156
|
+
getAction(identifier: string, awaitCompleted?: boolean): Promise<WarpChainAction | null>;
|
|
157
|
+
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
158
|
+
private getERC20TokenBalances;
|
|
159
|
+
private getTokenBalance;
|
|
160
|
+
private getTokenMetadata;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
declare class WarpEvmExecutor implements AdapterWarpExecutor {
|
|
164
|
+
private readonly config;
|
|
165
|
+
private readonly chain;
|
|
166
|
+
private readonly serializer;
|
|
167
|
+
private readonly provider;
|
|
168
|
+
private readonly results;
|
|
169
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
170
|
+
createTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
171
|
+
createTransferTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
172
|
+
createContractCallTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
173
|
+
private createTokenTransferTransaction;
|
|
174
|
+
private createSingleTokenTransfer;
|
|
175
|
+
executeQuery(executable: WarpExecutable): Promise<WarpActionExecution>;
|
|
176
|
+
private estimateGasAndSetDefaults;
|
|
177
|
+
verifyMessage(message: string, signature: string): Promise<string>;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
181
|
+
private readonly chain;
|
|
182
|
+
private readonly config;
|
|
183
|
+
constructor(chain: WarpChainInfo, config: WarpClientConfig);
|
|
184
|
+
private getExplorers;
|
|
185
|
+
private getPrimaryExplorer;
|
|
186
|
+
private getExplorerUrlByName;
|
|
187
|
+
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
188
|
+
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
189
|
+
getBlockUrl(blockNumber: string | number, explorer?: ExplorerName): string;
|
|
190
|
+
getAssetUrl(identifier: string, explorer?: ExplorerName): string;
|
|
191
|
+
getContractUrl(address: string, explorer?: ExplorerName): string;
|
|
192
|
+
getAllExplorers(): readonly ExplorerName[];
|
|
193
|
+
getExplorerByName(name: string): ExplorerName | undefined;
|
|
194
|
+
getAccountUrls(address: string): Record<ExplorerName, string>;
|
|
195
|
+
getTransactionUrls(hash: string): Record<ExplorerName, string>;
|
|
196
|
+
getAssetUrls(identifier: string): Record<ExplorerName, string>;
|
|
197
|
+
getContractUrls(address: string): Record<ExplorerName, string>;
|
|
198
|
+
getBlockUrls(blockNumber: string | number): Record<ExplorerName, string>;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
declare class WarpEvmResults implements AdapterWarpResults {
|
|
202
|
+
private readonly config;
|
|
203
|
+
private readonly chain;
|
|
204
|
+
private readonly serializer;
|
|
205
|
+
private readonly provider;
|
|
206
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
207
|
+
getActionExecution(warp: Warp, actionIndex: WarpActionIndex, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpActionExecution>;
|
|
208
|
+
private createFailedExecution;
|
|
209
|
+
private handleWarpChainAction;
|
|
210
|
+
private handleTransactionReceipt;
|
|
211
|
+
extractQueryResults(warp: Warp, typedValues: unknown[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
212
|
+
values: {
|
|
213
|
+
string: string[];
|
|
214
|
+
native: WarpNativeValue[];
|
|
215
|
+
};
|
|
216
|
+
results: WarpExecutionResults;
|
|
217
|
+
}>;
|
|
218
|
+
getTransactionStatus(txHash: string): Promise<{
|
|
219
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
220
|
+
blockNumber?: number;
|
|
221
|
+
gasUsed?: bigint;
|
|
222
|
+
}>;
|
|
223
|
+
getTransactionReceipt(txHash: string): Promise<ethers.TransactionReceipt | null>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
227
|
+
readonly coreSerializer: WarpSerializer;
|
|
228
|
+
constructor();
|
|
229
|
+
typedToString(value: any): string;
|
|
230
|
+
typedToNative(value: any): [WarpActionInputType, WarpNativeValue];
|
|
231
|
+
nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): any;
|
|
232
|
+
nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
|
|
233
|
+
stringToTyped(value: string): any;
|
|
234
|
+
private parseNativeValue;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
declare class WarpEvmWallet implements AdapterWarpWallet {
|
|
238
|
+
private config;
|
|
239
|
+
private chain;
|
|
240
|
+
private provider;
|
|
241
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
242
|
+
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
243
|
+
signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
|
|
244
|
+
signMessage(message: string): Promise<string>;
|
|
245
|
+
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
246
|
+
sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
|
|
247
|
+
create(mnemonic: string): {
|
|
248
|
+
address: string;
|
|
249
|
+
privateKey: string;
|
|
250
|
+
mnemonic: string;
|
|
251
|
+
};
|
|
252
|
+
generate(): {
|
|
253
|
+
address: string;
|
|
254
|
+
privateKey: string;
|
|
255
|
+
mnemonic: string;
|
|
256
|
+
};
|
|
257
|
+
getAddress(): string | null;
|
|
258
|
+
private getWallet;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, UniswapService, type UniswapToken, type UniswapTokenList, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, WarpEvmWallet, createEvmAdapter, findKnownTokenById, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter, getKnownTokensForChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, WarpCache, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpActionExecution, AdapterWarpExplorer, AdapterWarpResults, Warp, WarpActionIndex, WarpAdapterGenericRemoteTransaction, ResolvedInput, WarpNativeValue, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, BaseWarpActionInputType, WarpAdapterGenericType, AdapterWarpWallet, WarpAdapterGenericTransaction } from '@vleap/warps';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
|
|
4
|
+
declare const NativeTokenArb: WarpChainAsset;
|
|
5
|
+
declare const getArbitrumAdapter: AdapterFactory;
|
|
6
|
+
|
|
7
|
+
declare const NativeTokenBase: WarpChainAsset;
|
|
8
|
+
declare const getBaseAdapter: AdapterFactory;
|
|
9
|
+
|
|
10
|
+
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
11
|
+
declare const getAllEvmChainNames: () => WarpChain[];
|
|
12
|
+
|
|
13
|
+
declare const createEvmAdapter: (chainName: WarpChain, chainInfos: Record<WarpChainEnv, WarpChainInfo>) => AdapterFactory;
|
|
14
|
+
|
|
15
|
+
declare const NativeTokenEth: WarpChainAsset;
|
|
16
|
+
declare const getEthereumAdapter: AdapterFactory;
|
|
17
|
+
|
|
4
18
|
declare const WarpEvmConstants: {
|
|
5
19
|
GasLimit: {
|
|
6
20
|
Default: number;
|
|
7
21
|
ContractCall: number;
|
|
8
22
|
ContractDeploy: number;
|
|
9
23
|
Transfer: number;
|
|
24
|
+
TokenTransfer: number;
|
|
10
25
|
Approve: number;
|
|
11
26
|
Swap: number;
|
|
12
27
|
};
|
|
@@ -37,108 +52,175 @@ declare enum BaseExplorers {
|
|
|
37
52
|
BlockscoutBase = "blockscout_base",
|
|
38
53
|
BlockscoutBaseSepolia = "blockscout_base_sepolia"
|
|
39
54
|
}
|
|
40
|
-
|
|
41
|
-
LocalBlockscout = "local_blockscout"
|
|
42
|
-
}
|
|
43
|
-
type ExplorerName = EthereumExplorers | ArbitrumExplorers | BaseExplorers | (LocalExplorers & WarpExplorerName);
|
|
55
|
+
type ExplorerName = EthereumExplorers | ArbitrumExplorers | BaseExplorers;
|
|
44
56
|
declare const EvmExplorers: {
|
|
45
57
|
readonly ethereum: {
|
|
46
58
|
readonly mainnet: readonly [EthereumExplorers.Etherscan, EthereumExplorers.Ethplorer, EthereumExplorers.Blockscout];
|
|
47
59
|
readonly testnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
|
|
48
|
-
readonly devnet: readonly [
|
|
60
|
+
readonly devnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
|
|
49
61
|
};
|
|
50
62
|
readonly arbitrum: {
|
|
51
63
|
readonly mainnet: readonly [ArbitrumExplorers.Arbiscan, ArbitrumExplorers.BlockscoutArbitrum];
|
|
52
64
|
readonly testnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
|
|
53
|
-
readonly devnet: readonly [
|
|
65
|
+
readonly devnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
|
|
54
66
|
};
|
|
55
67
|
readonly base: {
|
|
56
68
|
readonly mainnet: readonly [BaseExplorers.Basescan, BaseExplorers.BlockscoutBase];
|
|
57
69
|
readonly testnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
|
|
58
|
-
readonly devnet: readonly [
|
|
70
|
+
readonly devnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
|
|
59
71
|
};
|
|
60
72
|
};
|
|
61
73
|
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
62
74
|
|
|
63
|
-
interface
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
interface TokenMetadata {
|
|
76
|
+
name: string;
|
|
77
|
+
symbol: string;
|
|
78
|
+
decimals: number;
|
|
79
|
+
logoUrl?: string;
|
|
80
|
+
}
|
|
81
|
+
interface TokenBalance {
|
|
82
|
+
tokenAddress: string;
|
|
83
|
+
balance: bigint;
|
|
84
|
+
metadata: TokenMetadata;
|
|
85
|
+
}
|
|
86
|
+
interface TokenInfo {
|
|
87
|
+
name?: string;
|
|
88
|
+
symbol?: string;
|
|
89
|
+
logoURI?: string;
|
|
90
|
+
decimals?: number;
|
|
91
|
+
}
|
|
92
|
+
interface UniswapToken {
|
|
93
|
+
chainId: number;
|
|
94
|
+
address: string;
|
|
95
|
+
name: string;
|
|
96
|
+
symbol: string;
|
|
97
|
+
decimals: number;
|
|
98
|
+
logoURI: string;
|
|
99
|
+
extensions?: {
|
|
100
|
+
bridgeInfo?: Record<string, {
|
|
101
|
+
tokenAddress: string;
|
|
102
|
+
}>;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
interface UniswapTokenList {
|
|
106
|
+
name: string;
|
|
107
|
+
timestamp: string;
|
|
108
|
+
version: {
|
|
109
|
+
major: number;
|
|
110
|
+
minor: number;
|
|
111
|
+
patch: number;
|
|
112
|
+
};
|
|
113
|
+
tokens: UniswapToken[];
|
|
114
|
+
}
|
|
115
|
+
interface TokenListResponse {
|
|
116
|
+
tokens: Array<{
|
|
117
|
+
chainId: number;
|
|
118
|
+
address: string;
|
|
119
|
+
name: string;
|
|
120
|
+
symbol: string;
|
|
121
|
+
decimals: number;
|
|
122
|
+
logoURI?: string;
|
|
123
|
+
}>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare class UniswapService {
|
|
127
|
+
private static readonly UNISWAP_TOKEN_LIST_URL;
|
|
128
|
+
private cache;
|
|
129
|
+
private chainId;
|
|
130
|
+
constructor(cache: WarpCache, chainId: number);
|
|
131
|
+
getTokenList(): Promise<UniswapTokenList>;
|
|
132
|
+
findToken(address: string): Promise<UniswapToken | null>;
|
|
133
|
+
getTokenMetadata(address: string): Promise<{
|
|
134
|
+
name: string;
|
|
135
|
+
symbol: string;
|
|
136
|
+
decimals: number;
|
|
137
|
+
logoUrl: string;
|
|
138
|
+
} | null>;
|
|
139
|
+
getBridgeInfo(address: string): Promise<Record<string, string> | null>;
|
|
140
|
+
}
|
|
79
141
|
|
|
80
|
-
declare const
|
|
81
|
-
declare const
|
|
82
|
-
declare const
|
|
83
|
-
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
142
|
+
declare const KnownTokens: Record<WarpChain, Record<string, WarpChainAsset[]>>;
|
|
143
|
+
declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
144
|
+
declare const getKnownTokensForChain: (chainName: string, env?: string) => WarpChainAsset[];
|
|
84
145
|
|
|
85
|
-
declare class
|
|
146
|
+
declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
86
147
|
private readonly config;
|
|
87
|
-
private
|
|
88
|
-
private
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
148
|
+
private readonly chain;
|
|
149
|
+
private provider;
|
|
150
|
+
private cache;
|
|
151
|
+
private uniswapService;
|
|
152
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
153
|
+
getAccount(address: string): Promise<WarpChainAccount>;
|
|
154
|
+
getAccountAssets(address: string): Promise<WarpChainAsset[]>;
|
|
155
|
+
getAsset(identifier: string): Promise<WarpChainAsset | null>;
|
|
156
|
+
getAction(identifier: string, awaitCompleted?: boolean): Promise<WarpChainAction | null>;
|
|
157
|
+
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
158
|
+
private getERC20TokenBalances;
|
|
159
|
+
private getTokenBalance;
|
|
160
|
+
private getTokenMetadata;
|
|
100
161
|
}
|
|
101
162
|
|
|
102
163
|
declare class WarpEvmExecutor implements AdapterWarpExecutor {
|
|
103
164
|
private readonly config;
|
|
165
|
+
private readonly chain;
|
|
104
166
|
private readonly serializer;
|
|
105
167
|
private readonly provider;
|
|
106
168
|
private readonly results;
|
|
107
|
-
constructor(config: WarpClientConfig);
|
|
169
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
108
170
|
createTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
109
171
|
createTransferTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
110
172
|
createContractCallTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
111
|
-
|
|
112
|
-
|
|
173
|
+
private createTokenTransferTransaction;
|
|
174
|
+
private createSingleTokenTransfer;
|
|
175
|
+
executeQuery(executable: WarpExecutable): Promise<WarpActionExecution>;
|
|
113
176
|
private estimateGasAndSetDefaults;
|
|
114
|
-
|
|
177
|
+
verifyMessage(message: string, signature: string): Promise<string>;
|
|
115
178
|
}
|
|
116
179
|
|
|
117
180
|
declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
118
181
|
private readonly chain;
|
|
119
182
|
private readonly config;
|
|
120
183
|
constructor(chain: WarpChainInfo, config: WarpClientConfig);
|
|
184
|
+
private getExplorers;
|
|
185
|
+
private getPrimaryExplorer;
|
|
121
186
|
private getExplorerUrlByName;
|
|
122
187
|
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
123
188
|
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
124
189
|
getBlockUrl(blockNumber: string | number, explorer?: ExplorerName): string;
|
|
125
|
-
|
|
126
|
-
getContractUrl(
|
|
190
|
+
getAssetUrl(identifier: string, explorer?: ExplorerName): string;
|
|
191
|
+
getContractUrl(address: string, explorer?: ExplorerName): string;
|
|
127
192
|
getAllExplorers(): readonly ExplorerName[];
|
|
128
193
|
getExplorerByName(name: string): ExplorerName | undefined;
|
|
129
194
|
getAccountUrls(address: string): Record<ExplorerName, string>;
|
|
130
195
|
getTransactionUrls(hash: string): Record<ExplorerName, string>;
|
|
196
|
+
getAssetUrls(identifier: string): Record<ExplorerName, string>;
|
|
197
|
+
getContractUrls(address: string): Record<ExplorerName, string>;
|
|
198
|
+
getBlockUrls(blockNumber: string | number): Record<ExplorerName, string>;
|
|
131
199
|
}
|
|
132
200
|
|
|
133
201
|
declare class WarpEvmResults implements AdapterWarpResults {
|
|
134
202
|
private readonly config;
|
|
203
|
+
private readonly chain;
|
|
135
204
|
private readonly serializer;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
205
|
+
private readonly provider;
|
|
206
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
207
|
+
getActionExecution(warp: Warp, actionIndex: WarpActionIndex, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpActionExecution>;
|
|
208
|
+
private createFailedExecution;
|
|
209
|
+
private handleWarpChainAction;
|
|
210
|
+
private handleTransactionReceipt;
|
|
211
|
+
extractQueryResults(warp: Warp, typedValues: unknown[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
212
|
+
values: {
|
|
213
|
+
string: string[];
|
|
214
|
+
native: WarpNativeValue[];
|
|
215
|
+
};
|
|
140
216
|
results: WarpExecutionResults;
|
|
141
217
|
}>;
|
|
218
|
+
getTransactionStatus(txHash: string): Promise<{
|
|
219
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
220
|
+
blockNumber?: number;
|
|
221
|
+
gasUsed?: bigint;
|
|
222
|
+
}>;
|
|
223
|
+
getTransactionReceipt(txHash: string): Promise<ethers.TransactionReceipt | null>;
|
|
142
224
|
}
|
|
143
225
|
|
|
144
226
|
declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
@@ -152,4 +234,28 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
|
152
234
|
private parseNativeValue;
|
|
153
235
|
}
|
|
154
236
|
|
|
155
|
-
|
|
237
|
+
declare class WarpEvmWallet implements AdapterWarpWallet {
|
|
238
|
+
private config;
|
|
239
|
+
private chain;
|
|
240
|
+
private provider;
|
|
241
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
242
|
+
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
243
|
+
signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
|
|
244
|
+
signMessage(message: string): Promise<string>;
|
|
245
|
+
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
246
|
+
sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
|
|
247
|
+
create(mnemonic: string): {
|
|
248
|
+
address: string;
|
|
249
|
+
privateKey: string;
|
|
250
|
+
mnemonic: string;
|
|
251
|
+
};
|
|
252
|
+
generate(): {
|
|
253
|
+
address: string;
|
|
254
|
+
privateKey: string;
|
|
255
|
+
mnemonic: string;
|
|
256
|
+
};
|
|
257
|
+
getAddress(): string | null;
|
|
258
|
+
private getWallet;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, UniswapService, type UniswapToken, type UniswapTokenList, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, WarpEvmWallet, createEvmAdapter, findKnownTokenById, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter, getKnownTokensForChain };
|