@vleap/warps-adapter-evm 0.2.0-beta.55 → 0.2.0-beta.57
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 +45 -38
- package/dist/index.d.ts +45 -38
- package/dist/index.js +412 -186
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +347 -124
- 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,26 +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 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
156
|
declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
147
157
|
private readonly config;
|
|
148
158
|
private readonly chain;
|
|
@@ -243,25 +253,22 @@ declare class WarpEvmWallet implements AdapterWarpWallet {
|
|
|
243
253
|
private config;
|
|
244
254
|
private chain;
|
|
245
255
|
private provider;
|
|
256
|
+
private walletProvider;
|
|
257
|
+
private cachedAddress;
|
|
258
|
+
private cachedPublicKey;
|
|
246
259
|
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
260
|
+
private createProvider;
|
|
261
|
+
private initializeCache;
|
|
247
262
|
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
248
263
|
signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
|
|
249
264
|
signMessage(message: string): Promise<string>;
|
|
250
265
|
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
251
266
|
sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
|
|
252
|
-
create(mnemonic: string):
|
|
253
|
-
|
|
254
|
-
privateKey: string;
|
|
255
|
-
mnemonic: string;
|
|
256
|
-
};
|
|
257
|
-
generate(): {
|
|
258
|
-
address: string;
|
|
259
|
-
privateKey: string;
|
|
260
|
-
mnemonic: string;
|
|
261
|
-
};
|
|
267
|
+
create(mnemonic: string): WarpWalletDetails;
|
|
268
|
+
generate(): WarpWalletDetails;
|
|
262
269
|
getAddress(): string | null;
|
|
263
270
|
getPublicKey(): string | null;
|
|
264
|
-
|
|
271
|
+
registerX402Handlers(client: unknown): Promise<Record<string, () => void>>;
|
|
265
272
|
}
|
|
266
273
|
|
|
267
|
-
export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata,
|
|
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,26 +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 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
156
|
declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
147
157
|
private readonly config;
|
|
148
158
|
private readonly chain;
|
|
@@ -243,25 +253,22 @@ declare class WarpEvmWallet implements AdapterWarpWallet {
|
|
|
243
253
|
private config;
|
|
244
254
|
private chain;
|
|
245
255
|
private provider;
|
|
256
|
+
private walletProvider;
|
|
257
|
+
private cachedAddress;
|
|
258
|
+
private cachedPublicKey;
|
|
246
259
|
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
260
|
+
private createProvider;
|
|
261
|
+
private initializeCache;
|
|
247
262
|
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
248
263
|
signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
|
|
249
264
|
signMessage(message: string): Promise<string>;
|
|
250
265
|
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
251
266
|
sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
|
|
252
|
-
create(mnemonic: string):
|
|
253
|
-
|
|
254
|
-
privateKey: string;
|
|
255
|
-
mnemonic: string;
|
|
256
|
-
};
|
|
257
|
-
generate(): {
|
|
258
|
-
address: string;
|
|
259
|
-
privateKey: string;
|
|
260
|
-
mnemonic: string;
|
|
261
|
-
};
|
|
267
|
+
create(mnemonic: string): WarpWalletDetails;
|
|
268
|
+
generate(): WarpWalletDetails;
|
|
262
269
|
getAddress(): string | null;
|
|
263
270
|
getPublicKey(): string | null;
|
|
264
|
-
|
|
271
|
+
registerX402Handlers(client: unknown): Promise<Record<string, () => void>>;
|
|
265
272
|
}
|
|
266
273
|
|
|
267
|
-
export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata,
|
|
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 };
|