@vleap/warps-adapter-evm 0.2.0-alpha.3 → 0.2.0-alpha.30
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 +255 -0
- package/dist/index.d.ts +192 -77
- package/dist/index.js +1051 -373
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1029 -347
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -8
- package/README.md +0 -400
- package/dist/index.d.mts +0 -140
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, WarpCache, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpExecution, AdapterWarpExplorer, AdapterWarpResults, Warp, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, WarpNativeValue, 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: string, chainPrefix: string, 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<WarpExecution>;
|
|
176
|
+
private estimateGasAndSetDefaults;
|
|
177
|
+
signMessage(message: string, privateKey: string): Promise<string>;
|
|
178
|
+
verifyMessage(message: string, signature: string): Promise<string>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
182
|
+
private readonly chain;
|
|
183
|
+
private readonly config;
|
|
184
|
+
constructor(chain: WarpChainInfo, config: WarpClientConfig);
|
|
185
|
+
private getExplorers;
|
|
186
|
+
private getPrimaryExplorer;
|
|
187
|
+
private getExplorerUrlByName;
|
|
188
|
+
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
189
|
+
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
190
|
+
getBlockUrl(blockNumber: string | number, explorer?: ExplorerName): string;
|
|
191
|
+
getAssetUrl(identifier: string, explorer?: ExplorerName): string;
|
|
192
|
+
getContractUrl(address: string, explorer?: ExplorerName): string;
|
|
193
|
+
getAllExplorers(): readonly ExplorerName[];
|
|
194
|
+
getExplorerByName(name: string): ExplorerName | undefined;
|
|
195
|
+
getAccountUrls(address: string): Record<ExplorerName, string>;
|
|
196
|
+
getTransactionUrls(hash: string): Record<ExplorerName, string>;
|
|
197
|
+
getAssetUrls(identifier: string): Record<ExplorerName, string>;
|
|
198
|
+
getContractUrls(address: string): Record<ExplorerName, string>;
|
|
199
|
+
getBlockUrls(blockNumber: string | number): Record<ExplorerName, string>;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
declare class WarpEvmResults implements AdapterWarpResults {
|
|
203
|
+
private readonly config;
|
|
204
|
+
private readonly chain?;
|
|
205
|
+
private readonly serializer;
|
|
206
|
+
private readonly provider;
|
|
207
|
+
constructor(config: WarpClientConfig, chain?: WarpChainInfo | undefined);
|
|
208
|
+
getTransactionExecutionResults(warp: Warp, tx: ethers.TransactionReceipt): Promise<WarpExecution>;
|
|
209
|
+
extractQueryResults(warp: Warp, typedValues: any[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
210
|
+
values: any[];
|
|
211
|
+
valuesRaw: any[];
|
|
212
|
+
results: WarpExecutionResults;
|
|
213
|
+
}>;
|
|
214
|
+
getTransactionStatus(txHash: string): Promise<{
|
|
215
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
216
|
+
blockNumber?: number;
|
|
217
|
+
gasUsed?: bigint;
|
|
218
|
+
}>;
|
|
219
|
+
getTransactionReceipt(txHash: string): Promise<ethers.TransactionReceipt | null>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
223
|
+
readonly coreSerializer: WarpSerializer;
|
|
224
|
+
constructor();
|
|
225
|
+
typedToString(value: any): string;
|
|
226
|
+
typedToNative(value: any): [WarpActionInputType, WarpNativeValue];
|
|
227
|
+
nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): any;
|
|
228
|
+
nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
|
|
229
|
+
stringToTyped(value: string): any;
|
|
230
|
+
private parseNativeValue;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
declare class WarpEvmWallet implements AdapterWarpWallet {
|
|
234
|
+
private config;
|
|
235
|
+
private chain;
|
|
236
|
+
private wallet;
|
|
237
|
+
private provider;
|
|
238
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
239
|
+
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
240
|
+
signMessage(message: string): Promise<string>;
|
|
241
|
+
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
242
|
+
create(mnemonic: string): {
|
|
243
|
+
address: string;
|
|
244
|
+
privateKey: string;
|
|
245
|
+
mnemonic: string;
|
|
246
|
+
};
|
|
247
|
+
generate(): {
|
|
248
|
+
address: string;
|
|
249
|
+
privateKey: string;
|
|
250
|
+
mnemonic: string;
|
|
251
|
+
};
|
|
252
|
+
getAddress(): string | null;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
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,129 +1,222 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, WarpCache, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpExecution, AdapterWarpExplorer, AdapterWarpResults, Warp, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType, AdapterWarpWallet, WarpAdapterGenericTransaction } from '@vleap/warps';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
declare const
|
|
14
|
-
|
|
15
|
-
declare const
|
|
16
|
-
declare const
|
|
17
|
-
declare const getEvmRegistryAddress: (env: WarpChainEnv, chain?: string) => string;
|
|
18
|
-
declare const getEvmNativeToken: (env: WarpChainEnv, chain?: string) => string;
|
|
19
|
-
declare const getEvmBlockTime: (env: WarpChainEnv, chain?: string) => number;
|
|
20
|
-
declare const getSupportedEvmChains: () => string[];
|
|
21
|
-
declare const getSupportedEnvironments: (chain: string) => WarpChainEnv[];
|
|
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: string, chainPrefix: string, chainInfos: Record<WarpChainEnv, WarpChainInfo>) => AdapterFactory;
|
|
14
|
+
|
|
15
|
+
declare const NativeTokenEth: WarpChainAsset;
|
|
16
|
+
declare const getEthereumAdapter: AdapterFactory;
|
|
22
17
|
|
|
23
18
|
declare const WarpEvmConstants: {
|
|
24
|
-
Ether: {
|
|
25
|
-
Identifier: string;
|
|
26
|
-
DisplayName: string;
|
|
27
|
-
Decimals: number;
|
|
28
|
-
};
|
|
29
19
|
GasLimit: {
|
|
30
20
|
Default: number;
|
|
31
21
|
ContractCall: number;
|
|
32
22
|
ContractDeploy: number;
|
|
33
23
|
Transfer: number;
|
|
24
|
+
TokenTransfer: number;
|
|
34
25
|
Approve: number;
|
|
35
26
|
Swap: number;
|
|
36
27
|
};
|
|
37
28
|
GasPrice: {
|
|
38
29
|
Default: string;
|
|
39
|
-
Low: string;
|
|
40
|
-
Medium: string;
|
|
41
|
-
High: string;
|
|
42
|
-
};
|
|
43
|
-
Networks: {
|
|
44
|
-
Ethereum: {
|
|
45
|
-
ChainId: string;
|
|
46
|
-
Name: string;
|
|
47
|
-
BlockTime: number;
|
|
48
|
-
};
|
|
49
|
-
Arbitrum: {
|
|
50
|
-
ChainId: string;
|
|
51
|
-
Name: string;
|
|
52
|
-
BlockTime: number;
|
|
53
|
-
};
|
|
54
|
-
Base: {
|
|
55
|
-
ChainId: string;
|
|
56
|
-
Name: string;
|
|
57
|
-
BlockTime: number;
|
|
58
|
-
};
|
|
59
30
|
};
|
|
60
31
|
Validation: {
|
|
61
|
-
AddressLength: number;
|
|
62
|
-
HexPrefix: string;
|
|
63
32
|
MinGasLimit: number;
|
|
64
33
|
MaxGasLimit: number;
|
|
65
34
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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];
|
|
70
71
|
};
|
|
71
72
|
};
|
|
73
|
+
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
+
}
|
|
77
125
|
|
|
78
|
-
declare class
|
|
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 {
|
|
79
147
|
private readonly config;
|
|
80
|
-
private
|
|
81
|
-
private
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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;
|
|
93
161
|
}
|
|
94
162
|
|
|
95
163
|
declare class WarpEvmExecutor implements AdapterWarpExecutor {
|
|
96
164
|
private readonly config;
|
|
165
|
+
private readonly chain;
|
|
97
166
|
private readonly serializer;
|
|
98
167
|
private readonly provider;
|
|
99
168
|
private readonly results;
|
|
100
|
-
constructor(config: WarpClientConfig);
|
|
169
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
101
170
|
createTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
102
171
|
createTransferTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
103
172
|
createContractCallTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
173
|
+
private createTokenTransferTransaction;
|
|
174
|
+
private createSingleTokenTransfer;
|
|
104
175
|
executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
|
|
105
|
-
preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
|
|
106
176
|
private estimateGasAndSetDefaults;
|
|
107
177
|
signMessage(message: string, privateKey: string): Promise<string>;
|
|
178
|
+
verifyMessage(message: string, signature: string): Promise<string>;
|
|
108
179
|
}
|
|
109
180
|
|
|
110
181
|
declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
111
|
-
private readonly
|
|
112
|
-
private readonly
|
|
113
|
-
constructor(
|
|
114
|
-
|
|
115
|
-
|
|
182
|
+
private readonly chain;
|
|
183
|
+
private readonly config;
|
|
184
|
+
constructor(chain: WarpChainInfo, config: WarpClientConfig);
|
|
185
|
+
private getExplorers;
|
|
186
|
+
private getPrimaryExplorer;
|
|
187
|
+
private getExplorerUrlByName;
|
|
188
|
+
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
189
|
+
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
190
|
+
getBlockUrl(blockNumber: string | number, explorer?: ExplorerName): string;
|
|
191
|
+
getAssetUrl(identifier: string, explorer?: ExplorerName): string;
|
|
192
|
+
getContractUrl(address: string, explorer?: ExplorerName): string;
|
|
193
|
+
getAllExplorers(): readonly ExplorerName[];
|
|
194
|
+
getExplorerByName(name: string): ExplorerName | undefined;
|
|
195
|
+
getAccountUrls(address: string): Record<ExplorerName, string>;
|
|
196
|
+
getTransactionUrls(hash: string): Record<ExplorerName, string>;
|
|
197
|
+
getAssetUrls(identifier: string): Record<ExplorerName, string>;
|
|
198
|
+
getContractUrls(address: string): Record<ExplorerName, string>;
|
|
199
|
+
getBlockUrls(blockNumber: string | number): Record<ExplorerName, string>;
|
|
116
200
|
}
|
|
117
201
|
|
|
118
202
|
declare class WarpEvmResults implements AdapterWarpResults {
|
|
119
203
|
private readonly config;
|
|
204
|
+
private readonly chain?;
|
|
120
205
|
private readonly serializer;
|
|
121
|
-
|
|
206
|
+
private readonly provider;
|
|
207
|
+
constructor(config: WarpClientConfig, chain?: WarpChainInfo | undefined);
|
|
122
208
|
getTransactionExecutionResults(warp: Warp, tx: ethers.TransactionReceipt): Promise<WarpExecution>;
|
|
123
209
|
extractQueryResults(warp: Warp, typedValues: any[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
124
210
|
values: any[];
|
|
211
|
+
valuesRaw: any[];
|
|
125
212
|
results: WarpExecutionResults;
|
|
126
213
|
}>;
|
|
214
|
+
getTransactionStatus(txHash: string): Promise<{
|
|
215
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
216
|
+
blockNumber?: number;
|
|
217
|
+
gasUsed?: bigint;
|
|
218
|
+
}>;
|
|
219
|
+
getTransactionReceipt(txHash: string): Promise<ethers.TransactionReceipt | null>;
|
|
127
220
|
}
|
|
128
221
|
|
|
129
222
|
declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
@@ -137,4 +230,26 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
|
137
230
|
private parseNativeValue;
|
|
138
231
|
}
|
|
139
232
|
|
|
140
|
-
|
|
233
|
+
declare class WarpEvmWallet implements AdapterWarpWallet {
|
|
234
|
+
private config;
|
|
235
|
+
private chain;
|
|
236
|
+
private wallet;
|
|
237
|
+
private provider;
|
|
238
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
239
|
+
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
240
|
+
signMessage(message: string): Promise<string>;
|
|
241
|
+
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
242
|
+
create(mnemonic: string): {
|
|
243
|
+
address: string;
|
|
244
|
+
privateKey: string;
|
|
245
|
+
mnemonic: string;
|
|
246
|
+
};
|
|
247
|
+
generate(): {
|
|
248
|
+
address: string;
|
|
249
|
+
privateKey: string;
|
|
250
|
+
mnemonic: string;
|
|
251
|
+
};
|
|
252
|
+
getAddress(): string | null;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
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 };
|