@vleap/warps-adapter-evm 0.2.0-alpha.17 → 0.2.0-alpha.19
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.ts +94 -6
- package/dist/index.mjs +473 -104
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
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
|
-
declare const ChainNameArbitrum: WarpChain;
|
|
5
4
|
declare const NativeTokenArb: WarpChainAsset;
|
|
6
5
|
declare const getArbitrumAdapter: AdapterFactory;
|
|
7
6
|
|
|
8
|
-
declare const ChainNameBase: WarpChain;
|
|
9
7
|
declare const NativeTokenBase: WarpChainAsset;
|
|
10
8
|
declare const getBaseAdapter: AdapterFactory;
|
|
11
9
|
|
|
12
10
|
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
13
11
|
declare const getAllEvmChainNames: () => WarpChain[];
|
|
14
12
|
|
|
15
|
-
declare const
|
|
13
|
+
declare const createEvmAdapter: (chainName: string, chainPrefix: string, chainInfos: Record<WarpChainEnv, WarpChainInfo>) => AdapterFactory;
|
|
14
|
+
|
|
16
15
|
declare const NativeTokenEth: WarpChainAsset;
|
|
17
16
|
declare const getEthereumAdapter: AdapterFactory;
|
|
18
17
|
|
|
@@ -22,6 +21,7 @@ declare const WarpEvmConstants: {
|
|
|
22
21
|
ContractCall: number;
|
|
23
22
|
ContractDeploy: number;
|
|
24
23
|
Transfer: number;
|
|
24
|
+
TokenTransfer: number;
|
|
25
25
|
Approve: number;
|
|
26
26
|
Swap: number;
|
|
27
27
|
};
|
|
@@ -72,6 +72,79 @@ declare const EvmExplorers: {
|
|
|
72
72
|
};
|
|
73
73
|
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
74
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
|
+
|
|
75
148
|
declare class WarpEvmExecutor implements AdapterWarpExecutor {
|
|
76
149
|
private readonly config;
|
|
77
150
|
private readonly chain;
|
|
@@ -82,10 +155,13 @@ declare class WarpEvmExecutor implements AdapterWarpExecutor {
|
|
|
82
155
|
createTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
83
156
|
createTransferTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
84
157
|
createContractCallTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
|
|
158
|
+
private createTokenTransferTransaction;
|
|
159
|
+
private createSingleTokenTransfer;
|
|
85
160
|
executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
|
|
86
161
|
preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
|
|
87
162
|
private estimateGasAndSetDefaults;
|
|
88
163
|
signMessage(message: string, privateKey: string): Promise<string>;
|
|
164
|
+
verifyMessage(message: string, signature: string): Promise<string>;
|
|
89
165
|
}
|
|
90
166
|
|
|
91
167
|
declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
@@ -104,17 +180,29 @@ declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
|
104
180
|
getExplorerByName(name: string): ExplorerName | undefined;
|
|
105
181
|
getAccountUrls(address: string): Record<ExplorerName, string>;
|
|
106
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>;
|
|
107
186
|
}
|
|
108
187
|
|
|
109
188
|
declare class WarpEvmResults implements AdapterWarpResults {
|
|
110
189
|
private readonly config;
|
|
190
|
+
private readonly chain?;
|
|
111
191
|
private readonly serializer;
|
|
112
|
-
|
|
192
|
+
private readonly provider;
|
|
193
|
+
constructor(config: WarpClientConfig, chain?: WarpChainInfo | undefined);
|
|
113
194
|
getTransactionExecutionResults(warp: Warp, tx: ethers.TransactionReceipt): Promise<WarpExecution>;
|
|
114
195
|
extractQueryResults(warp: Warp, typedValues: any[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
115
196
|
values: any[];
|
|
197
|
+
valuesRaw: any[];
|
|
116
198
|
results: WarpExecutionResults;
|
|
117
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>;
|
|
118
206
|
}
|
|
119
207
|
|
|
120
208
|
declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
@@ -128,4 +216,4 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
|
128
216
|
private parseNativeValue;
|
|
129
217
|
}
|
|
130
218
|
|
|
131
|
-
export { ArbitrumExplorers, BaseExplorers,
|
|
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 };
|