@vleap/warps-adapter-evm 0.2.0-alpha.2 → 0.2.0-alpha.21
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 +219 -0
- package/dist/index.d.ts +155 -75
- package/dist/index.js +952 -344
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +924 -316
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -6
- package/README.md +0 -400
- package/dist/index.d.mts +0 -139
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, AdapterWarpDataLoader, WarpChainAccount, WarpDataLoaderOptions, WarpChainAction, AdapterWarpExecutor, WarpExecutable, WarpExecution, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, Warp, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } 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 TokenInfo$1 {
|
|
76
|
+
name?: string;
|
|
77
|
+
symbol?: string;
|
|
78
|
+
logoURI?: string;
|
|
79
|
+
decimals?: number;
|
|
80
|
+
}
|
|
81
|
+
declare class EvmLogoService {
|
|
82
|
+
static getTokenInfo(chainName: string, tokenAddress: string): Promise<TokenInfo$1>;
|
|
83
|
+
static getLogoUrl(chainName: string, tokenAddress: string, tokenName?: string, tokenSymbol?: string): Promise<string>;
|
|
84
|
+
private static fetchFromTokenLists;
|
|
85
|
+
private static fetchFromDefiLlama;
|
|
86
|
+
private static fetchFromTrustWallet;
|
|
87
|
+
static clearCache(): void;
|
|
88
|
+
static getCacheSize(): number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
interface TokenMetadata$1 {
|
|
92
|
+
name: string;
|
|
93
|
+
symbol: string;
|
|
94
|
+
decimals: number;
|
|
95
|
+
logoUrl?: string;
|
|
96
|
+
}
|
|
97
|
+
interface TokenBalance {
|
|
98
|
+
tokenAddress: string;
|
|
99
|
+
balance: bigint;
|
|
100
|
+
metadata: TokenMetadata$1;
|
|
101
|
+
}
|
|
102
|
+
interface TokenInfo {
|
|
103
|
+
name?: string;
|
|
104
|
+
symbol?: string;
|
|
105
|
+
logoURI?: string;
|
|
106
|
+
decimals?: number;
|
|
107
|
+
}
|
|
108
|
+
interface TokenListResponse {
|
|
109
|
+
tokens: Array<{
|
|
110
|
+
chainId: number;
|
|
111
|
+
address: string;
|
|
112
|
+
name: string;
|
|
113
|
+
symbol: string;
|
|
114
|
+
decimals: number;
|
|
115
|
+
logoURI?: string;
|
|
116
|
+
}>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface TokenMetadata {
|
|
120
|
+
name: string;
|
|
121
|
+
symbol: string;
|
|
122
|
+
decimals: number;
|
|
123
|
+
logoUrl?: string;
|
|
124
|
+
}
|
|
125
|
+
declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
126
|
+
private readonly config;
|
|
127
|
+
private readonly chain;
|
|
128
|
+
private provider;
|
|
129
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
130
|
+
getAccount(address: string): Promise<WarpChainAccount>;
|
|
131
|
+
getAccountAssets(address: string): Promise<WarpChainAsset[]>;
|
|
132
|
+
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
133
|
+
private getERC20TokenBalances;
|
|
134
|
+
private getTokenBalance;
|
|
135
|
+
private getTokenMetadata;
|
|
136
|
+
private detectTokensFromEvents;
|
|
137
|
+
getTokenInfo(tokenAddress: string): Promise<TokenMetadata | null>;
|
|
138
|
+
getTokenBalanceForAddress(address: string, tokenAddress: string): Promise<bigint>;
|
|
139
|
+
getMultipleTokenBalances(address: string, tokenAddresses: string[]): Promise<Map<string, bigint>>;
|
|
140
|
+
getAccountTokens(address: string): Promise<WarpChainAsset[]>;
|
|
141
|
+
getTokenMetadataPublic(tokenAddress: string): Promise<TokenMetadata | null>;
|
|
142
|
+
getChainInfo(): Promise<{
|
|
143
|
+
chainId: string;
|
|
144
|
+
blockTime: number;
|
|
145
|
+
}>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
declare class WarpEvmExecutor implements AdapterWarpExecutor {
|
|
149
|
+
private readonly config;
|
|
150
|
+
private readonly chain;
|
|
151
|
+
private readonly serializer;
|
|
152
|
+
private readonly provider;
|
|
153
|
+
private readonly results;
|
|
154
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
155
|
+
createTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
156
|
+
createTransferTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
157
|
+
createContractCallTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
158
|
+
private createTokenTransferTransaction;
|
|
159
|
+
private createSingleTokenTransfer;
|
|
160
|
+
executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
|
|
161
|
+
preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
|
|
162
|
+
private estimateGasAndSetDefaults;
|
|
163
|
+
signMessage(message: string, privateKey: string): Promise<string>;
|
|
164
|
+
verifyMessage(message: string, signature: string): Promise<string>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
168
|
+
private readonly chain;
|
|
169
|
+
private readonly config;
|
|
170
|
+
constructor(chain: WarpChainInfo, config: WarpClientConfig);
|
|
171
|
+
private getExplorers;
|
|
172
|
+
private getPrimaryExplorer;
|
|
173
|
+
private getExplorerUrlByName;
|
|
174
|
+
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
175
|
+
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
176
|
+
getBlockUrl(blockNumber: string | number, explorer?: ExplorerName): string;
|
|
177
|
+
getAssetUrl(identifier: string, explorer?: ExplorerName): string;
|
|
178
|
+
getContractUrl(address: string, explorer?: ExplorerName): string;
|
|
179
|
+
getAllExplorers(): readonly ExplorerName[];
|
|
180
|
+
getExplorerByName(name: string): ExplorerName | undefined;
|
|
181
|
+
getAccountUrls(address: string): Record<ExplorerName, string>;
|
|
182
|
+
getTransactionUrls(hash: string): Record<ExplorerName, string>;
|
|
183
|
+
getAssetUrls(identifier: string): Record<ExplorerName, string>;
|
|
184
|
+
getContractUrls(address: string): Record<ExplorerName, string>;
|
|
185
|
+
getBlockUrls(blockNumber: string | number): Record<ExplorerName, string>;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
declare class WarpEvmResults implements AdapterWarpResults {
|
|
189
|
+
private readonly config;
|
|
190
|
+
private readonly chain?;
|
|
191
|
+
private readonly serializer;
|
|
192
|
+
private readonly provider;
|
|
193
|
+
constructor(config: WarpClientConfig, chain?: WarpChainInfo | undefined);
|
|
194
|
+
getTransactionExecutionResults(warp: Warp, tx: ethers.TransactionReceipt): Promise<WarpExecution>;
|
|
195
|
+
extractQueryResults(warp: Warp, typedValues: any[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
196
|
+
values: any[];
|
|
197
|
+
valuesRaw: any[];
|
|
198
|
+
results: WarpExecutionResults;
|
|
199
|
+
}>;
|
|
200
|
+
getTransactionStatus(txHash: string): Promise<{
|
|
201
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
202
|
+
blockNumber?: number;
|
|
203
|
+
gasUsed?: bigint;
|
|
204
|
+
}>;
|
|
205
|
+
getTransactionReceipt(txHash: string): Promise<ethers.TransactionReceipt | null>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
209
|
+
readonly coreSerializer: WarpSerializer;
|
|
210
|
+
constructor();
|
|
211
|
+
typedToString(value: any): string;
|
|
212
|
+
typedToNative(value: any): [WarpActionInputType, WarpNativeValue];
|
|
213
|
+
nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): any;
|
|
214
|
+
nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
|
|
215
|
+
stringToTyped(value: string): any;
|
|
216
|
+
private parseNativeValue;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, EvmLogoService, type ExplorerName, ExplorerUrls, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata$1 as TokenMetadata, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, createEvmAdapter, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,128 +1,208 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, AdapterWarpDataLoader, WarpChainAccount, WarpDataLoaderOptions, WarpChainAction, AdapterWarpExecutor, WarpExecutable, WarpExecution, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, Warp, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } 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
|
-
ChainName: string;
|
|
25
|
-
ChainPrefix: string;
|
|
26
|
-
Ether: {
|
|
27
|
-
Identifier: string;
|
|
28
|
-
DisplayName: string;
|
|
29
|
-
Decimals: number;
|
|
30
|
-
};
|
|
31
19
|
GasLimit: {
|
|
32
20
|
Default: number;
|
|
33
21
|
ContractCall: number;
|
|
34
22
|
ContractDeploy: number;
|
|
35
23
|
Transfer: number;
|
|
24
|
+
TokenTransfer: number;
|
|
36
25
|
Approve: number;
|
|
37
26
|
Swap: number;
|
|
38
27
|
};
|
|
39
28
|
GasPrice: {
|
|
40
29
|
Default: string;
|
|
41
|
-
Low: string;
|
|
42
|
-
Medium: string;
|
|
43
|
-
High: string;
|
|
44
|
-
};
|
|
45
|
-
Network: {
|
|
46
|
-
Ethereum: {
|
|
47
|
-
ChainId: string;
|
|
48
|
-
Name: string;
|
|
49
|
-
BlockTime: number;
|
|
50
|
-
};
|
|
51
|
-
Arbitrum: {
|
|
52
|
-
ChainId: string;
|
|
53
|
-
Name: string;
|
|
54
|
-
BlockTime: number;
|
|
55
|
-
};
|
|
56
|
-
Base: {
|
|
57
|
-
ChainId: string;
|
|
58
|
-
Name: string;
|
|
59
|
-
BlockTime: number;
|
|
60
|
-
};
|
|
61
30
|
};
|
|
62
31
|
Validation: {
|
|
63
|
-
AddressLength: number;
|
|
64
|
-
HexPrefix: string;
|
|
65
32
|
MinGasLimit: number;
|
|
66
33
|
MaxGasLimit: number;
|
|
67
34
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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];
|
|
72
71
|
};
|
|
73
72
|
};
|
|
73
|
+
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
interface TokenInfo$1 {
|
|
76
|
+
name?: string;
|
|
77
|
+
symbol?: string;
|
|
78
|
+
logoURI?: string;
|
|
79
|
+
decimals?: number;
|
|
80
|
+
}
|
|
81
|
+
declare class EvmLogoService {
|
|
82
|
+
static getTokenInfo(chainName: string, tokenAddress: string): Promise<TokenInfo$1>;
|
|
83
|
+
static getLogoUrl(chainName: string, tokenAddress: string, tokenName?: string, tokenSymbol?: string): Promise<string>;
|
|
84
|
+
private static fetchFromTokenLists;
|
|
85
|
+
private static fetchFromDefiLlama;
|
|
86
|
+
private static fetchFromTrustWallet;
|
|
87
|
+
static clearCache(): void;
|
|
88
|
+
static getCacheSize(): number;
|
|
89
|
+
}
|
|
76
90
|
|
|
77
|
-
|
|
91
|
+
interface TokenMetadata$1 {
|
|
92
|
+
name: string;
|
|
93
|
+
symbol: string;
|
|
94
|
+
decimals: number;
|
|
95
|
+
logoUrl?: string;
|
|
96
|
+
}
|
|
97
|
+
interface TokenBalance {
|
|
98
|
+
tokenAddress: string;
|
|
99
|
+
balance: bigint;
|
|
100
|
+
metadata: TokenMetadata$1;
|
|
101
|
+
}
|
|
102
|
+
interface TokenInfo {
|
|
103
|
+
name?: string;
|
|
104
|
+
symbol?: string;
|
|
105
|
+
logoURI?: string;
|
|
106
|
+
decimals?: number;
|
|
107
|
+
}
|
|
108
|
+
interface TokenListResponse {
|
|
109
|
+
tokens: Array<{
|
|
110
|
+
chainId: number;
|
|
111
|
+
address: string;
|
|
112
|
+
name: string;
|
|
113
|
+
symbol: string;
|
|
114
|
+
decimals: number;
|
|
115
|
+
logoURI?: string;
|
|
116
|
+
}>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface TokenMetadata {
|
|
120
|
+
name: string;
|
|
121
|
+
symbol: string;
|
|
122
|
+
decimals: number;
|
|
123
|
+
logoUrl?: string;
|
|
124
|
+
}
|
|
125
|
+
declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
78
126
|
private readonly config;
|
|
79
|
-
private
|
|
80
|
-
private
|
|
81
|
-
constructor(config: WarpClientConfig);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
127
|
+
private readonly chain;
|
|
128
|
+
private provider;
|
|
129
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
130
|
+
getAccount(address: string): Promise<WarpChainAccount>;
|
|
131
|
+
getAccountAssets(address: string): Promise<WarpChainAsset[]>;
|
|
132
|
+
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
133
|
+
private getERC20TokenBalances;
|
|
134
|
+
private getTokenBalance;
|
|
135
|
+
private getTokenMetadata;
|
|
136
|
+
private detectTokensFromEvents;
|
|
137
|
+
getTokenInfo(tokenAddress: string): Promise<TokenMetadata | null>;
|
|
138
|
+
getTokenBalanceForAddress(address: string, tokenAddress: string): Promise<bigint>;
|
|
139
|
+
getMultipleTokenBalances(address: string, tokenAddresses: string[]): Promise<Map<string, bigint>>;
|
|
140
|
+
getAccountTokens(address: string): Promise<WarpChainAsset[]>;
|
|
141
|
+
getTokenMetadataPublic(tokenAddress: string): Promise<TokenMetadata | null>;
|
|
142
|
+
getChainInfo(): Promise<{
|
|
143
|
+
chainId: string;
|
|
144
|
+
blockTime: number;
|
|
145
|
+
}>;
|
|
92
146
|
}
|
|
93
147
|
|
|
94
148
|
declare class WarpEvmExecutor implements AdapterWarpExecutor {
|
|
95
149
|
private readonly config;
|
|
150
|
+
private readonly chain;
|
|
96
151
|
private readonly serializer;
|
|
97
152
|
private readonly provider;
|
|
98
153
|
private readonly results;
|
|
99
|
-
constructor(config: WarpClientConfig);
|
|
154
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
100
155
|
createTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
101
156
|
createTransferTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
102
157
|
createContractCallTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
158
|
+
private createTokenTransferTransaction;
|
|
159
|
+
private createSingleTokenTransfer;
|
|
103
160
|
executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
|
|
104
161
|
preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
|
|
105
162
|
private estimateGasAndSetDefaults;
|
|
106
163
|
signMessage(message: string, privateKey: string): Promise<string>;
|
|
164
|
+
verifyMessage(message: string, signature: string): Promise<string>;
|
|
107
165
|
}
|
|
108
166
|
|
|
109
167
|
declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
110
|
-
private readonly
|
|
111
|
-
private readonly
|
|
112
|
-
constructor(
|
|
113
|
-
|
|
114
|
-
|
|
168
|
+
private readonly chain;
|
|
169
|
+
private readonly config;
|
|
170
|
+
constructor(chain: WarpChainInfo, config: WarpClientConfig);
|
|
171
|
+
private getExplorers;
|
|
172
|
+
private getPrimaryExplorer;
|
|
173
|
+
private getExplorerUrlByName;
|
|
174
|
+
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
175
|
+
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
176
|
+
getBlockUrl(blockNumber: string | number, explorer?: ExplorerName): string;
|
|
177
|
+
getAssetUrl(identifier: string, explorer?: ExplorerName): string;
|
|
178
|
+
getContractUrl(address: string, explorer?: ExplorerName): string;
|
|
179
|
+
getAllExplorers(): readonly ExplorerName[];
|
|
180
|
+
getExplorerByName(name: string): ExplorerName | undefined;
|
|
181
|
+
getAccountUrls(address: string): Record<ExplorerName, string>;
|
|
182
|
+
getTransactionUrls(hash: string): Record<ExplorerName, string>;
|
|
183
|
+
getAssetUrls(identifier: string): Record<ExplorerName, string>;
|
|
184
|
+
getContractUrls(address: string): Record<ExplorerName, string>;
|
|
185
|
+
getBlockUrls(blockNumber: string | number): Record<ExplorerName, string>;
|
|
115
186
|
}
|
|
116
187
|
|
|
117
188
|
declare class WarpEvmResults implements AdapterWarpResults {
|
|
118
189
|
private readonly config;
|
|
190
|
+
private readonly chain?;
|
|
119
191
|
private readonly serializer;
|
|
120
|
-
|
|
192
|
+
private readonly provider;
|
|
193
|
+
constructor(config: WarpClientConfig, chain?: WarpChainInfo | undefined);
|
|
121
194
|
getTransactionExecutionResults(warp: Warp, tx: ethers.TransactionReceipt): Promise<WarpExecution>;
|
|
122
195
|
extractQueryResults(warp: Warp, typedValues: any[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
123
196
|
values: any[];
|
|
197
|
+
valuesRaw: any[];
|
|
124
198
|
results: WarpExecutionResults;
|
|
125
199
|
}>;
|
|
200
|
+
getTransactionStatus(txHash: string): Promise<{
|
|
201
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
202
|
+
blockNumber?: number;
|
|
203
|
+
gasUsed?: bigint;
|
|
204
|
+
}>;
|
|
205
|
+
getTransactionReceipt(txHash: string): Promise<ethers.TransactionReceipt | null>;
|
|
126
206
|
}
|
|
127
207
|
|
|
128
208
|
declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
@@ -136,4 +216,4 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
|
136
216
|
private parseNativeValue;
|
|
137
217
|
}
|
|
138
218
|
|
|
139
|
-
export {
|
|
219
|
+
export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, EvmLogoService, type ExplorerName, ExplorerUrls, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata$1 as TokenMetadata, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, createEvmAdapter, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter };
|