@vleap/warps-adapter-evm 0.2.0-beta.56 → 0.2.0-beta.58
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 +42 -67
- package/dist/index.d.ts +42 -67
- package/dist/index.js +164 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +158 -58
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { WarpChainAsset,
|
|
1
|
+
import { WarpChainAsset, ChainAdapterFactory, WarpChain, WarpChainEnv, WarpChainInfo, AdapterWarpDataLoader, WarpClientConfig, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpActionExecutionResult, AdapterWarpExplorer, AdapterWarpOutput, Warp, WarpActionIndex, WarpAdapterGenericRemoteTransaction, ResolvedInput, WarpNativeValue, WarpExecutionOutput, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, BaseWarpActionInputType, WarpAdapterGenericType, AdapterWarpWallet, WarpAdapterGenericTransaction, WarpWalletDetails } from '@vleap/warps';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
|
|
4
4
|
declare const NativeTokenArb: WarpChainAsset;
|
|
5
|
-
declare const
|
|
5
|
+
declare const ArbitrumAdapter: ChainAdapterFactory;
|
|
6
6
|
|
|
7
7
|
declare const NativeTokenBase: WarpChainAsset;
|
|
8
|
-
declare const
|
|
8
|
+
declare const BaseAdapter: ChainAdapterFactory;
|
|
9
9
|
|
|
10
|
-
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
11
10
|
declare const getAllEvmChainNames: () => WarpChain[];
|
|
12
11
|
|
|
13
|
-
declare const createEvmAdapter: (chainName: WarpChain, chainInfos: Record<WarpChainEnv, WarpChainInfo>) =>
|
|
12
|
+
declare const createEvmAdapter: (chainName: WarpChain, chainInfos: Record<WarpChainEnv, WarpChainInfo>) => ChainAdapterFactory;
|
|
14
13
|
|
|
15
14
|
declare const NativeTokenEth: WarpChainAsset;
|
|
16
|
-
declare const
|
|
15
|
+
declare const EthereumAdapter: ChainAdapterFactory;
|
|
17
16
|
|
|
18
17
|
declare const WarpEvmConstants: {
|
|
19
18
|
GasLimit: {
|
|
@@ -71,6 +70,37 @@ declare const EvmExplorers: {
|
|
|
71
70
|
};
|
|
72
71
|
};
|
|
73
72
|
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
73
|
+
declare const EvmChainIds: {
|
|
74
|
+
readonly Ethereum: {
|
|
75
|
+
readonly Mainnet: 1;
|
|
76
|
+
readonly Goerli: 5;
|
|
77
|
+
readonly Sepolia: 11155111;
|
|
78
|
+
};
|
|
79
|
+
readonly Polygon: {
|
|
80
|
+
readonly Mainnet: 137;
|
|
81
|
+
readonly Mumbai: 80001;
|
|
82
|
+
};
|
|
83
|
+
readonly Arbitrum: {
|
|
84
|
+
readonly Mainnet: 42161;
|
|
85
|
+
readonly Sepolia: 421614;
|
|
86
|
+
};
|
|
87
|
+
readonly Base: {
|
|
88
|
+
readonly Mainnet: 8453;
|
|
89
|
+
readonly Sepolia: 84532;
|
|
90
|
+
};
|
|
91
|
+
readonly Optimism: {
|
|
92
|
+
readonly Mainnet: 10;
|
|
93
|
+
readonly Sepolia: 11155420;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
declare const EvmChainIdMap: Record<string, number>;
|
|
97
|
+
declare const SupportedEvmChainIds: number[];
|
|
98
|
+
|
|
99
|
+
declare const getAllEvmAdapters: (fallbackFactory: ChainAdapterFactory) => ChainAdapterFactory[];
|
|
100
|
+
|
|
101
|
+
declare const KnownTokens: Record<WarpChain, Record<string, WarpChainAsset[]>>;
|
|
102
|
+
declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
103
|
+
declare const getKnownTokensForChain: (chainName: string, env?: string) => WarpChainAsset[];
|
|
74
104
|
|
|
75
105
|
interface TokenMetadata {
|
|
76
106
|
name: string;
|
|
@@ -123,54 +153,6 @@ interface TokenListResponse {
|
|
|
123
153
|
}>;
|
|
124
154
|
}
|
|
125
155
|
|
|
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 class PrivateKeyWalletProvider implements WalletProvider {
|
|
143
|
-
private config;
|
|
144
|
-
private chain;
|
|
145
|
-
private rpcProvider;
|
|
146
|
-
private wallet;
|
|
147
|
-
constructor(config: WarpClientConfig, chain: WarpChainInfo, rpcProvider: ethers.JsonRpcProvider);
|
|
148
|
-
getAddress(): Promise<string | null>;
|
|
149
|
-
getPublicKey(): Promise<string | null>;
|
|
150
|
-
signTransaction(tx: any): Promise<any>;
|
|
151
|
-
signMessage(message: string): Promise<string>;
|
|
152
|
-
getWalletInstance(): ethers.Wallet;
|
|
153
|
-
private getWallet;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
declare class MnemonicWalletProvider implements WalletProvider {
|
|
157
|
-
private config;
|
|
158
|
-
private chain;
|
|
159
|
-
private rpcProvider;
|
|
160
|
-
private wallet;
|
|
161
|
-
constructor(config: WarpClientConfig, chain: WarpChainInfo, rpcProvider: ethers.JsonRpcProvider);
|
|
162
|
-
getAddress(): Promise<string | null>;
|
|
163
|
-
getPublicKey(): Promise<string | null>;
|
|
164
|
-
signTransaction(tx: any): Promise<any>;
|
|
165
|
-
signMessage(message: string): Promise<string>;
|
|
166
|
-
getWalletInstance(): ethers.Wallet;
|
|
167
|
-
private getWallet;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
declare const KnownTokens: Record<WarpChain, Record<string, WarpChainAsset[]>>;
|
|
171
|
-
declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
172
|
-
declare const getKnownTokensForChain: (chainName: string, env?: string) => WarpChainAsset[];
|
|
173
|
-
|
|
174
156
|
declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
175
157
|
private readonly config;
|
|
176
158
|
private readonly chain;
|
|
@@ -274,26 +256,19 @@ declare class WarpEvmWallet implements AdapterWarpWallet {
|
|
|
274
256
|
private walletProvider;
|
|
275
257
|
private cachedAddress;
|
|
276
258
|
private cachedPublicKey;
|
|
277
|
-
constructor(config: WarpClientConfig, chain: WarpChainInfo
|
|
278
|
-
private
|
|
259
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
260
|
+
private createProvider;
|
|
279
261
|
private initializeCache;
|
|
280
262
|
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
281
263
|
signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
|
|
282
264
|
signMessage(message: string): Promise<string>;
|
|
283
265
|
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
284
266
|
sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
|
|
285
|
-
create(mnemonic: string):
|
|
286
|
-
|
|
287
|
-
privateKey: string;
|
|
288
|
-
mnemonic: string;
|
|
289
|
-
};
|
|
290
|
-
generate(): {
|
|
291
|
-
address: string;
|
|
292
|
-
privateKey: string;
|
|
293
|
-
mnemonic: string;
|
|
294
|
-
};
|
|
267
|
+
create(mnemonic: string): WarpWalletDetails;
|
|
268
|
+
generate(): WarpWalletDetails;
|
|
295
269
|
getAddress(): string | null;
|
|
296
270
|
getPublicKey(): string | null;
|
|
271
|
+
registerX402Handlers(client: unknown): Promise<Record<string, () => void>>;
|
|
297
272
|
}
|
|
298
273
|
|
|
299
|
-
export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens,
|
|
274
|
+
export { ArbitrumAdapter, ArbitrumExplorers, BaseAdapter, BaseExplorers, EthereumAdapter, EthereumExplorers, EvmChainIdMap, EvmChainIds, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, SupportedEvmChainIds, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, type UniswapToken, type UniswapTokenList, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmOutput, WarpEvmSerializer, WarpEvmWallet, createEvmAdapter, findKnownTokenById, getAllEvmAdapters, getAllEvmChainNames, getKnownTokensForChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { WarpChainAsset,
|
|
1
|
+
import { WarpChainAsset, ChainAdapterFactory, WarpChain, WarpChainEnv, WarpChainInfo, AdapterWarpDataLoader, WarpClientConfig, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpActionExecutionResult, AdapterWarpExplorer, AdapterWarpOutput, Warp, WarpActionIndex, WarpAdapterGenericRemoteTransaction, ResolvedInput, WarpNativeValue, WarpExecutionOutput, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, BaseWarpActionInputType, WarpAdapterGenericType, AdapterWarpWallet, WarpAdapterGenericTransaction, WarpWalletDetails } from '@vleap/warps';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
|
|
4
4
|
declare const NativeTokenArb: WarpChainAsset;
|
|
5
|
-
declare const
|
|
5
|
+
declare const ArbitrumAdapter: ChainAdapterFactory;
|
|
6
6
|
|
|
7
7
|
declare const NativeTokenBase: WarpChainAsset;
|
|
8
|
-
declare const
|
|
8
|
+
declare const BaseAdapter: ChainAdapterFactory;
|
|
9
9
|
|
|
10
|
-
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
11
10
|
declare const getAllEvmChainNames: () => WarpChain[];
|
|
12
11
|
|
|
13
|
-
declare const createEvmAdapter: (chainName: WarpChain, chainInfos: Record<WarpChainEnv, WarpChainInfo>) =>
|
|
12
|
+
declare const createEvmAdapter: (chainName: WarpChain, chainInfos: Record<WarpChainEnv, WarpChainInfo>) => ChainAdapterFactory;
|
|
14
13
|
|
|
15
14
|
declare const NativeTokenEth: WarpChainAsset;
|
|
16
|
-
declare const
|
|
15
|
+
declare const EthereumAdapter: ChainAdapterFactory;
|
|
17
16
|
|
|
18
17
|
declare const WarpEvmConstants: {
|
|
19
18
|
GasLimit: {
|
|
@@ -71,6 +70,37 @@ declare const EvmExplorers: {
|
|
|
71
70
|
};
|
|
72
71
|
};
|
|
73
72
|
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
73
|
+
declare const EvmChainIds: {
|
|
74
|
+
readonly Ethereum: {
|
|
75
|
+
readonly Mainnet: 1;
|
|
76
|
+
readonly Goerli: 5;
|
|
77
|
+
readonly Sepolia: 11155111;
|
|
78
|
+
};
|
|
79
|
+
readonly Polygon: {
|
|
80
|
+
readonly Mainnet: 137;
|
|
81
|
+
readonly Mumbai: 80001;
|
|
82
|
+
};
|
|
83
|
+
readonly Arbitrum: {
|
|
84
|
+
readonly Mainnet: 42161;
|
|
85
|
+
readonly Sepolia: 421614;
|
|
86
|
+
};
|
|
87
|
+
readonly Base: {
|
|
88
|
+
readonly Mainnet: 8453;
|
|
89
|
+
readonly Sepolia: 84532;
|
|
90
|
+
};
|
|
91
|
+
readonly Optimism: {
|
|
92
|
+
readonly Mainnet: 10;
|
|
93
|
+
readonly Sepolia: 11155420;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
declare const EvmChainIdMap: Record<string, number>;
|
|
97
|
+
declare const SupportedEvmChainIds: number[];
|
|
98
|
+
|
|
99
|
+
declare const getAllEvmAdapters: (fallbackFactory: ChainAdapterFactory) => ChainAdapterFactory[];
|
|
100
|
+
|
|
101
|
+
declare const KnownTokens: Record<WarpChain, Record<string, WarpChainAsset[]>>;
|
|
102
|
+
declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
103
|
+
declare const getKnownTokensForChain: (chainName: string, env?: string) => WarpChainAsset[];
|
|
74
104
|
|
|
75
105
|
interface TokenMetadata {
|
|
76
106
|
name: string;
|
|
@@ -123,54 +153,6 @@ interface TokenListResponse {
|
|
|
123
153
|
}>;
|
|
124
154
|
}
|
|
125
155
|
|
|
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 class PrivateKeyWalletProvider implements WalletProvider {
|
|
143
|
-
private config;
|
|
144
|
-
private chain;
|
|
145
|
-
private rpcProvider;
|
|
146
|
-
private wallet;
|
|
147
|
-
constructor(config: WarpClientConfig, chain: WarpChainInfo, rpcProvider: ethers.JsonRpcProvider);
|
|
148
|
-
getAddress(): Promise<string | null>;
|
|
149
|
-
getPublicKey(): Promise<string | null>;
|
|
150
|
-
signTransaction(tx: any): Promise<any>;
|
|
151
|
-
signMessage(message: string): Promise<string>;
|
|
152
|
-
getWalletInstance(): ethers.Wallet;
|
|
153
|
-
private getWallet;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
declare class MnemonicWalletProvider implements WalletProvider {
|
|
157
|
-
private config;
|
|
158
|
-
private chain;
|
|
159
|
-
private rpcProvider;
|
|
160
|
-
private wallet;
|
|
161
|
-
constructor(config: WarpClientConfig, chain: WarpChainInfo, rpcProvider: ethers.JsonRpcProvider);
|
|
162
|
-
getAddress(): Promise<string | null>;
|
|
163
|
-
getPublicKey(): Promise<string | null>;
|
|
164
|
-
signTransaction(tx: any): Promise<any>;
|
|
165
|
-
signMessage(message: string): Promise<string>;
|
|
166
|
-
getWalletInstance(): ethers.Wallet;
|
|
167
|
-
private getWallet;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
declare const KnownTokens: Record<WarpChain, Record<string, WarpChainAsset[]>>;
|
|
171
|
-
declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
172
|
-
declare const getKnownTokensForChain: (chainName: string, env?: string) => WarpChainAsset[];
|
|
173
|
-
|
|
174
156
|
declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
175
157
|
private readonly config;
|
|
176
158
|
private readonly chain;
|
|
@@ -274,26 +256,19 @@ declare class WarpEvmWallet implements AdapterWarpWallet {
|
|
|
274
256
|
private walletProvider;
|
|
275
257
|
private cachedAddress;
|
|
276
258
|
private cachedPublicKey;
|
|
277
|
-
constructor(config: WarpClientConfig, chain: WarpChainInfo
|
|
278
|
-
private
|
|
259
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
260
|
+
private createProvider;
|
|
279
261
|
private initializeCache;
|
|
280
262
|
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
281
263
|
signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
|
|
282
264
|
signMessage(message: string): Promise<string>;
|
|
283
265
|
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
284
266
|
sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
|
|
285
|
-
create(mnemonic: string):
|
|
286
|
-
|
|
287
|
-
privateKey: string;
|
|
288
|
-
mnemonic: string;
|
|
289
|
-
};
|
|
290
|
-
generate(): {
|
|
291
|
-
address: string;
|
|
292
|
-
privateKey: string;
|
|
293
|
-
mnemonic: string;
|
|
294
|
-
};
|
|
267
|
+
create(mnemonic: string): WarpWalletDetails;
|
|
268
|
+
generate(): WarpWalletDetails;
|
|
295
269
|
getAddress(): string | null;
|
|
296
270
|
getPublicKey(): string | null;
|
|
271
|
+
registerX402Handlers(client: unknown): Promise<Record<string, () => void>>;
|
|
297
272
|
}
|
|
298
273
|
|
|
299
|
-
export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens,
|
|
274
|
+
export { ArbitrumAdapter, ArbitrumExplorers, BaseAdapter, BaseExplorers, EthereumAdapter, EthereumExplorers, EvmChainIdMap, EvmChainIds, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, SupportedEvmChainIds, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, type UniswapToken, type UniswapTokenList, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmOutput, WarpEvmSerializer, WarpEvmWallet, createEvmAdapter, findKnownTokenById, getAllEvmAdapters, getAllEvmChainNames, getKnownTokensForChain };
|