@vleap/warps-adapter-evm 0.2.0-alpha.10 → 0.2.0-alpha.12

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/package.json CHANGED
@@ -1,13 +1,19 @@
1
1
  {
2
2
  "name": "@vleap/warps-adapter-evm",
3
- "version": "0.2.0-alpha.10",
3
+ "version": "0.2.0-alpha.12",
4
4
  "description": "EVM adapter for Warps SDK",
5
- "main": "./dist/index.js",
5
+ "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
- "module": "./dist/index.js",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.mjs",
11
+ "default": "./dist/index.mjs"
12
+ }
13
+ },
8
14
  "scripts": {
9
15
  "build": "tsup",
10
- "test": "jest --config jest.config.js",
16
+ "test": "jest --config jest.config.mjs",
11
17
  "lint": "tsc --noEmit",
12
18
  "prepare": "npm run build",
13
19
  "preversion": "npm run lint && npm run build"
@@ -31,6 +37,6 @@
31
37
  },
32
38
  "dependencies": {
33
39
  "ethers": "^6.15.0",
34
- "@vleap/warps": "^3.0.0-alpha.72"
40
+ "@vleap/warps": "^3.0.0-alpha.74"
35
41
  }
36
42
  }
package/dist/index.d.mts DELETED
@@ -1,140 +0,0 @@
1
- import { WarpChain, AdapterFactory, WarpClientConfig, Adapter, WarpChainEnv, AdapterWarpExecutor, WarpExecutable, WarpExecution, WarpChainInfo, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, Warp, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
2
- import { ethers } from 'ethers';
3
-
4
- declare const ChainNameArbitrum: WarpChain;
5
- declare const getArbitrumAdapter: AdapterFactory;
6
-
7
- declare const ChainNameBase: WarpChain;
8
- declare const getBaseAdapter: AdapterFactory;
9
-
10
- declare const getAllEvmAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
11
- declare const getAllEvmChainNames: () => WarpChain[];
12
-
13
- declare const ChainNameEthereum: WarpChain;
14
- declare const getEthereumAdapter: AdapterFactory;
15
-
16
- interface EvmChainConfig {
17
- apiUrl: string;
18
- explorerUrl: string;
19
- chainId: string;
20
- registryAddress: string;
21
- nativeToken: string;
22
- blockTime?: number;
23
- }
24
- declare const EVM_CHAIN_CONFIGS: Record<string, Record<WarpChainEnv, EvmChainConfig>>;
25
- declare const getEvmChainConfig: (chain: string | undefined, env: WarpChainEnv) => EvmChainConfig;
26
- declare const getEvmApiUrl: (env: WarpChainEnv, chain?: string) => string;
27
- declare const getEvmExplorerUrl: (env: WarpChainEnv, chain?: string) => string;
28
-
29
- declare const WarpEvmConstants: {
30
- GasLimit: {
31
- Default: number;
32
- ContractCall: number;
33
- ContractDeploy: number;
34
- Transfer: number;
35
- Approve: number;
36
- Swap: number;
37
- };
38
- GasPrice: {
39
- Default: string;
40
- };
41
- Validation: {
42
- MinGasLimit: number;
43
- MaxGasLimit: number;
44
- };
45
- };
46
- declare enum EthereumExplorers {
47
- Etherscan = "etherscan",
48
- EtherscanSepolia = "etherscan_sepolia",
49
- Ethplorer = "ethplorer",
50
- Blockscout = "blockscout",
51
- BlockscoutSepolia = "blockscout_sepolia"
52
- }
53
- declare enum ArbitrumExplorers {
54
- Arbiscan = "arbiscan",
55
- ArbiscanSepolia = "arbiscan_sepolia",
56
- BlockscoutArbitrum = "blockscout_arbitrum",
57
- BlockscoutArbitrumSepolia = "blockscout_arbitrum_sepolia"
58
- }
59
- declare enum BaseExplorers {
60
- Basescan = "basescan",
61
- BasescanSepolia = "basescan_sepolia",
62
- BlockscoutBase = "blockscout_base",
63
- BlockscoutBaseSepolia = "blockscout_base_sepolia"
64
- }
65
- type ExplorerName = EthereumExplorers | ArbitrumExplorers | BaseExplorers;
66
- declare const EvmExplorers: {
67
- readonly ethereum: {
68
- readonly mainnet: readonly [EthereumExplorers.Etherscan, EthereumExplorers.Ethplorer, EthereumExplorers.Blockscout];
69
- readonly testnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
70
- readonly devnet: readonly [EthereumExplorers.EtherscanSepolia, EthereumExplorers.BlockscoutSepolia];
71
- };
72
- readonly arbitrum: {
73
- readonly mainnet: readonly [ArbitrumExplorers.Arbiscan, ArbitrumExplorers.BlockscoutArbitrum];
74
- readonly testnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
75
- readonly devnet: readonly [ArbitrumExplorers.ArbiscanSepolia, ArbitrumExplorers.BlockscoutArbitrumSepolia];
76
- };
77
- readonly base: {
78
- readonly mainnet: readonly [BaseExplorers.Basescan, BaseExplorers.BlockscoutBase];
79
- readonly testnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
80
- readonly devnet: readonly [BaseExplorers.BasescanSepolia, BaseExplorers.BlockscoutBaseSepolia];
81
- };
82
- };
83
- declare const ExplorerUrls: Record<ExplorerName, string>;
84
-
85
- declare class WarpEvmExecutor implements AdapterWarpExecutor {
86
- private readonly config;
87
- private readonly serializer;
88
- private readonly provider;
89
- private readonly results;
90
- constructor(config: WarpClientConfig);
91
- createTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
92
- createTransferTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
93
- createContractCallTransaction(executable: WarpExecutable): Promise<ethers.TransactionRequest>;
94
- executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
95
- preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
96
- private estimateGasAndSetDefaults;
97
- signMessage(message: string, privateKey: string): Promise<string>;
98
- }
99
-
100
- declare class WarpEvmExplorer implements AdapterWarpExplorer {
101
- private readonly chain;
102
- private readonly config;
103
- constructor(chain: WarpChainInfo, config: WarpClientConfig);
104
- private getExplorers;
105
- private getPrimaryExplorer;
106
- private getExplorerUrlByName;
107
- getAccountUrl(address: string, explorer?: ExplorerName): string;
108
- getTransactionUrl(hash: string, explorer?: ExplorerName): string;
109
- getBlockUrl(blockNumber: string | number, explorer?: ExplorerName): string;
110
- getAssetUrl(identifier: string, explorer?: ExplorerName): string;
111
- getContractUrl(address: string, explorer?: ExplorerName): string;
112
- getAllExplorers(): readonly ExplorerName[];
113
- getExplorerByName(name: string): ExplorerName | undefined;
114
- getAccountUrls(address: string): Record<ExplorerName, string>;
115
- getTransactionUrls(hash: string): Record<ExplorerName, string>;
116
- }
117
-
118
- declare class WarpEvmResults implements AdapterWarpResults {
119
- private readonly config;
120
- private readonly serializer;
121
- constructor(config: WarpClientConfig);
122
- getTransactionExecutionResults(warp: Warp, tx: ethers.TransactionReceipt): Promise<WarpExecution>;
123
- extractQueryResults(warp: Warp, typedValues: any[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
124
- values: any[];
125
- results: WarpExecutionResults;
126
- }>;
127
- }
128
-
129
- declare class WarpEvmSerializer implements AdapterWarpSerializer {
130
- readonly coreSerializer: WarpSerializer;
131
- constructor();
132
- typedToString(value: any): string;
133
- typedToNative(value: any): [WarpActionInputType, WarpNativeValue];
134
- nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): any;
135
- nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
136
- stringToTyped(value: string): any;
137
- private parseNativeValue;
138
- }
139
-
140
- export { ArbitrumExplorers, BaseExplorers, ChainNameArbitrum, ChainNameBase, ChainNameEthereum, EVM_CHAIN_CONFIGS, EthereumExplorers, type EvmChainConfig, EvmExplorers, type ExplorerName, ExplorerUrls, WarpEvmConstants, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter, getEvmApiUrl, getEvmChainConfig, getEvmExplorerUrl };