@vleap/warps-adapter-evm 0.2.0-alpha.4 → 0.2.0-alpha.6
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.mts +30 -32
- package/dist/index.d.ts +30 -32
- package/dist/index.js +220 -167
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +219 -161
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdapterFactory, WarpClientConfig, Adapter, WarpChainEnv, CombinedWarpBuilder, Warp, BaseWarpBuilder, WarpCacheConfig, AdapterWarpExecutor, WarpExecutable, WarpExecution, WarpChainInfo, WarpActionInputType, AdapterWarpExplorer, WarpChain, AdapterWarpResults, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
|
|
4
|
+
declare const getArbitrumAdapter: AdapterFactory;
|
|
5
|
+
|
|
6
|
+
declare const getBaseAdapter: AdapterFactory;
|
|
7
|
+
|
|
8
|
+
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
9
|
+
|
|
10
|
+
declare const getEthereumAdapter: AdapterFactory;
|
|
11
|
+
|
|
12
|
+
interface EvmChainConfig {
|
|
13
|
+
apiUrl: string;
|
|
14
|
+
explorerUrl: string;
|
|
15
|
+
chainId: string;
|
|
16
|
+
registryAddress: string;
|
|
17
|
+
nativeToken: string;
|
|
18
|
+
blockTime?: number;
|
|
19
|
+
}
|
|
20
|
+
declare const EVM_CHAIN_CONFIGS: Record<string, Record<WarpChainEnv, EvmChainConfig>>;
|
|
21
|
+
declare const getEvmChainConfig: (chain: string | undefined, env: WarpChainEnv) => EvmChainConfig;
|
|
22
|
+
declare const getEvmApiUrl: (env: WarpChainEnv, chain?: string) => string;
|
|
23
|
+
declare const getEvmExplorerUrl: (env: WarpChainEnv, chain?: string) => string;
|
|
24
|
+
|
|
4
25
|
declare const WarpEvmConstants: {
|
|
5
26
|
GasLimit: {
|
|
6
27
|
Default: number;
|
|
@@ -37,51 +58,26 @@ declare enum BaseExplorers {
|
|
|
37
58
|
BlockscoutBase = "blockscout_base",
|
|
38
59
|
BlockscoutBaseSepolia = "blockscout_base_sepolia"
|
|
39
60
|
}
|
|
40
|
-
|
|
41
|
-
LocalBlockscout = "local_blockscout"
|
|
42
|
-
}
|
|
43
|
-
type ExplorerName = EthereumExplorers | ArbitrumExplorers | BaseExplorers | (LocalExplorers & WarpExplorerName);
|
|
61
|
+
type ExplorerName = EthereumExplorers | ArbitrumExplorers | BaseExplorers;
|
|
44
62
|
declare const EvmExplorers: {
|
|
45
63
|
readonly ethereum: {
|
|
46
64
|
readonly mainnet: readonly [EthereumExplorers.Etherscan, EthereumExplorers.Ethplorer, EthereumExplorers.Blockscout];
|
|
47
65
|
readonly testnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
|
|
48
|
-
readonly devnet: readonly [
|
|
66
|
+
readonly devnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
|
|
49
67
|
};
|
|
50
68
|
readonly arbitrum: {
|
|
51
69
|
readonly mainnet: readonly [ArbitrumExplorers.Arbiscan, ArbitrumExplorers.BlockscoutArbitrum];
|
|
52
70
|
readonly testnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
|
|
53
|
-
readonly devnet: readonly [
|
|
71
|
+
readonly devnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
|
|
54
72
|
};
|
|
55
73
|
readonly base: {
|
|
56
74
|
readonly mainnet: readonly [BaseExplorers.Basescan, BaseExplorers.BlockscoutBase];
|
|
57
75
|
readonly testnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
|
|
58
|
-
readonly devnet: readonly [
|
|
76
|
+
readonly devnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
|
|
59
77
|
};
|
|
60
78
|
};
|
|
61
79
|
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
62
80
|
|
|
63
|
-
interface EvmChainConfig {
|
|
64
|
-
apiUrl: string;
|
|
65
|
-
explorerUrl: string;
|
|
66
|
-
chainId: string;
|
|
67
|
-
registryAddress: string;
|
|
68
|
-
nativeToken: string;
|
|
69
|
-
blockTime?: number;
|
|
70
|
-
}
|
|
71
|
-
declare const EVM_CHAIN_CONFIGS: Record<string, Record<WarpChainEnv, EvmChainConfig>>;
|
|
72
|
-
declare const getEvmChainConfig: (chain: string | undefined, env: WarpChainEnv) => EvmChainConfig;
|
|
73
|
-
declare const getEvmApiUrl: (env: WarpChainEnv, chain?: string) => string;
|
|
74
|
-
declare const getEvmExplorerUrl: (env: WarpChainEnv, chain?: string) => string;
|
|
75
|
-
declare const getEvmExplorers: (chain: string | undefined, env: WarpChainEnv) => readonly ExplorerName[];
|
|
76
|
-
declare const getPrimaryEvmExplorer: (chain: string | undefined, env: WarpChainEnv) => ExplorerName;
|
|
77
|
-
declare const getEvmExplorerUrlByName: (explorerName: ExplorerName) => string;
|
|
78
|
-
declare const getEvmExplorerByName: (chain: string | undefined, env: WarpChainEnv, name: string) => ExplorerName | undefined;
|
|
79
|
-
|
|
80
|
-
declare const getEthereumAdapter: AdapterFactory;
|
|
81
|
-
declare const getArbitrumAdapter: AdapterFactory;
|
|
82
|
-
declare const getBaseAdapter: AdapterFactory;
|
|
83
|
-
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
84
|
-
|
|
85
81
|
declare class WarpEvmBuilder implements CombinedWarpBuilder {
|
|
86
82
|
private readonly config;
|
|
87
83
|
private warp;
|
|
@@ -117,7 +113,9 @@ declare class WarpEvmExecutor implements AdapterWarpExecutor {
|
|
|
117
113
|
declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
118
114
|
private readonly chain;
|
|
119
115
|
private readonly config;
|
|
120
|
-
constructor(chain:
|
|
116
|
+
constructor(chain: WarpChain, config: WarpClientConfig);
|
|
117
|
+
private getExplorers;
|
|
118
|
+
private getPrimaryExplorer;
|
|
121
119
|
private getExplorerUrlByName;
|
|
122
120
|
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
123
121
|
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
@@ -152,4 +150,4 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
|
152
150
|
private parseNativeValue;
|
|
153
151
|
}
|
|
154
152
|
|
|
155
|
-
export { ArbitrumExplorers, BaseExplorers, EVM_CHAIN_CONFIGS, EthereumExplorers, type EvmChainConfig, EvmExplorers, type ExplorerName, ExplorerUrls,
|
|
153
|
+
export { ArbitrumExplorers, BaseExplorers, EVM_CHAIN_CONFIGS, EthereumExplorers, type EvmChainConfig, EvmExplorers, type ExplorerName, ExplorerUrls, WarpEvmBuilder, WarpEvmConstants, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, getAllEvmAdapters, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter, getEvmApiUrl, getEvmChainConfig, getEvmExplorerUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdapterFactory, WarpClientConfig, Adapter, WarpChainEnv, CombinedWarpBuilder, Warp, BaseWarpBuilder, WarpCacheConfig, AdapterWarpExecutor, WarpExecutable, WarpExecution, WarpChainInfo, WarpActionInputType, AdapterWarpExplorer, WarpChain, AdapterWarpResults, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
|
|
4
|
+
declare const getArbitrumAdapter: AdapterFactory;
|
|
5
|
+
|
|
6
|
+
declare const getBaseAdapter: AdapterFactory;
|
|
7
|
+
|
|
8
|
+
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
9
|
+
|
|
10
|
+
declare const getEthereumAdapter: AdapterFactory;
|
|
11
|
+
|
|
12
|
+
interface EvmChainConfig {
|
|
13
|
+
apiUrl: string;
|
|
14
|
+
explorerUrl: string;
|
|
15
|
+
chainId: string;
|
|
16
|
+
registryAddress: string;
|
|
17
|
+
nativeToken: string;
|
|
18
|
+
blockTime?: number;
|
|
19
|
+
}
|
|
20
|
+
declare const EVM_CHAIN_CONFIGS: Record<string, Record<WarpChainEnv, EvmChainConfig>>;
|
|
21
|
+
declare const getEvmChainConfig: (chain: string | undefined, env: WarpChainEnv) => EvmChainConfig;
|
|
22
|
+
declare const getEvmApiUrl: (env: WarpChainEnv, chain?: string) => string;
|
|
23
|
+
declare const getEvmExplorerUrl: (env: WarpChainEnv, chain?: string) => string;
|
|
24
|
+
|
|
4
25
|
declare const WarpEvmConstants: {
|
|
5
26
|
GasLimit: {
|
|
6
27
|
Default: number;
|
|
@@ -37,51 +58,26 @@ declare enum BaseExplorers {
|
|
|
37
58
|
BlockscoutBase = "blockscout_base",
|
|
38
59
|
BlockscoutBaseSepolia = "blockscout_base_sepolia"
|
|
39
60
|
}
|
|
40
|
-
|
|
41
|
-
LocalBlockscout = "local_blockscout"
|
|
42
|
-
}
|
|
43
|
-
type ExplorerName = EthereumExplorers | ArbitrumExplorers | BaseExplorers | (LocalExplorers & WarpExplorerName);
|
|
61
|
+
type ExplorerName = EthereumExplorers | ArbitrumExplorers | BaseExplorers;
|
|
44
62
|
declare const EvmExplorers: {
|
|
45
63
|
readonly ethereum: {
|
|
46
64
|
readonly mainnet: readonly [EthereumExplorers.Etherscan, EthereumExplorers.Ethplorer, EthereumExplorers.Blockscout];
|
|
47
65
|
readonly testnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
|
|
48
|
-
readonly devnet: readonly [
|
|
66
|
+
readonly devnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
|
|
49
67
|
};
|
|
50
68
|
readonly arbitrum: {
|
|
51
69
|
readonly mainnet: readonly [ArbitrumExplorers.Arbiscan, ArbitrumExplorers.BlockscoutArbitrum];
|
|
52
70
|
readonly testnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
|
|
53
|
-
readonly devnet: readonly [
|
|
71
|
+
readonly devnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
|
|
54
72
|
};
|
|
55
73
|
readonly base: {
|
|
56
74
|
readonly mainnet: readonly [BaseExplorers.Basescan, BaseExplorers.BlockscoutBase];
|
|
57
75
|
readonly testnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
|
|
58
|
-
readonly devnet: readonly [
|
|
76
|
+
readonly devnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
|
|
59
77
|
};
|
|
60
78
|
};
|
|
61
79
|
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
62
80
|
|
|
63
|
-
interface EvmChainConfig {
|
|
64
|
-
apiUrl: string;
|
|
65
|
-
explorerUrl: string;
|
|
66
|
-
chainId: string;
|
|
67
|
-
registryAddress: string;
|
|
68
|
-
nativeToken: string;
|
|
69
|
-
blockTime?: number;
|
|
70
|
-
}
|
|
71
|
-
declare const EVM_CHAIN_CONFIGS: Record<string, Record<WarpChainEnv, EvmChainConfig>>;
|
|
72
|
-
declare const getEvmChainConfig: (chain: string | undefined, env: WarpChainEnv) => EvmChainConfig;
|
|
73
|
-
declare const getEvmApiUrl: (env: WarpChainEnv, chain?: string) => string;
|
|
74
|
-
declare const getEvmExplorerUrl: (env: WarpChainEnv, chain?: string) => string;
|
|
75
|
-
declare const getEvmExplorers: (chain: string | undefined, env: WarpChainEnv) => readonly ExplorerName[];
|
|
76
|
-
declare const getPrimaryEvmExplorer: (chain: string | undefined, env: WarpChainEnv) => ExplorerName;
|
|
77
|
-
declare const getEvmExplorerUrlByName: (explorerName: ExplorerName) => string;
|
|
78
|
-
declare const getEvmExplorerByName: (chain: string | undefined, env: WarpChainEnv, name: string) => ExplorerName | undefined;
|
|
79
|
-
|
|
80
|
-
declare const getEthereumAdapter: AdapterFactory;
|
|
81
|
-
declare const getArbitrumAdapter: AdapterFactory;
|
|
82
|
-
declare const getBaseAdapter: AdapterFactory;
|
|
83
|
-
declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
84
|
-
|
|
85
81
|
declare class WarpEvmBuilder implements CombinedWarpBuilder {
|
|
86
82
|
private readonly config;
|
|
87
83
|
private warp;
|
|
@@ -117,7 +113,9 @@ declare class WarpEvmExecutor implements AdapterWarpExecutor {
|
|
|
117
113
|
declare class WarpEvmExplorer implements AdapterWarpExplorer {
|
|
118
114
|
private readonly chain;
|
|
119
115
|
private readonly config;
|
|
120
|
-
constructor(chain:
|
|
116
|
+
constructor(chain: WarpChain, config: WarpClientConfig);
|
|
117
|
+
private getExplorers;
|
|
118
|
+
private getPrimaryExplorer;
|
|
121
119
|
private getExplorerUrlByName;
|
|
122
120
|
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
123
121
|
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
@@ -152,4 +150,4 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
|
|
|
152
150
|
private parseNativeValue;
|
|
153
151
|
}
|
|
154
152
|
|
|
155
|
-
export { ArbitrumExplorers, BaseExplorers, EVM_CHAIN_CONFIGS, EthereumExplorers, type EvmChainConfig, EvmExplorers, type ExplorerName, ExplorerUrls,
|
|
153
|
+
export { ArbitrumExplorers, BaseExplorers, EVM_CHAIN_CONFIGS, EthereumExplorers, type EvmChainConfig, EvmExplorers, type ExplorerName, ExplorerUrls, WarpEvmBuilder, WarpEvmConstants, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, getAllEvmAdapters, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter, getEvmApiUrl, getEvmChainConfig, getEvmExplorerUrl };
|