@vleap/warps-adapter-evm 0.2.0-beta.48 → 0.2.0-beta.50

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.mjs CHANGED
@@ -100,6 +100,14 @@ var UniswapService = _UniswapService;
100
100
  import { WarpChainName } from "@vleap/warps";
101
101
  var ArbitrumChain = WarpChainName.Arbitrum;
102
102
  var ArbitrumTokens = [
103
+ {
104
+ chain: ArbitrumChain,
105
+ identifier: "0x0000000000000000000000000000000000000000",
106
+ name: "Ether",
107
+ symbol: "ETH",
108
+ decimals: 18,
109
+ logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
110
+ },
103
111
  {
104
112
  chain: ArbitrumChain,
105
113
  identifier: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
@@ -130,6 +138,14 @@ var ArbitrumTokens = [
130
138
  import { WarpChainName as WarpChainName2 } from "@vleap/warps";
131
139
  var ArbitrumChain2 = WarpChainName2.Arbitrum;
132
140
  var ArbitrumSepoliaTokens = [
141
+ {
142
+ chain: ArbitrumChain2,
143
+ identifier: "0x0000000000000000000000000000000000000000",
144
+ name: "Ether",
145
+ symbol: "ETH",
146
+ decimals: 18,
147
+ logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
148
+ },
133
149
  {
134
150
  chain: ArbitrumChain2,
135
151
  identifier: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
@@ -152,6 +168,14 @@ var ArbitrumSepoliaTokens = [
152
168
  import { WarpChainName as WarpChainName3 } from "@vleap/warps";
153
169
  var BaseChain = WarpChainName3.Base;
154
170
  var BaseTokens = [
171
+ {
172
+ chain: BaseChain,
173
+ identifier: "0x0000000000000000000000000000000000000000",
174
+ name: "Ether",
175
+ symbol: "ETH",
176
+ decimals: 18,
177
+ logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
178
+ },
155
179
  {
156
180
  chain: BaseChain,
157
181
  identifier: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
@@ -190,6 +214,14 @@ var BaseTokens = [
190
214
  import { WarpChainName as WarpChainName4 } from "@vleap/warps";
191
215
  var BaseChain2 = WarpChainName4.Base;
192
216
  var BaseSepoliaTokens = [
217
+ {
218
+ chain: BaseChain2,
219
+ identifier: "0x0000000000000000000000000000000000000000",
220
+ name: "Ether",
221
+ symbol: "ETH",
222
+ decimals: 18,
223
+ logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
224
+ },
193
225
  {
194
226
  chain: BaseChain2,
195
227
  identifier: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
@@ -220,6 +252,14 @@ var BaseSepoliaTokens = [
220
252
  import { WarpChainName as WarpChainName5 } from "@vleap/warps";
221
253
  var EthereumChain = WarpChainName5.Ethereum;
222
254
  var EthereumTokens = [
255
+ {
256
+ chain: EthereumChain,
257
+ identifier: "0x0000000000000000000000000000000000000000",
258
+ name: "Ether",
259
+ symbol: "ETH",
260
+ decimals: 18,
261
+ logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
262
+ },
223
263
  {
224
264
  chain: EthereumChain,
225
265
  identifier: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
@@ -266,6 +306,14 @@ var EthereumTokens = [
266
306
  import { WarpChainName as WarpChainName6 } from "@vleap/warps";
267
307
  var EthereumChain2 = WarpChainName6.Ethereum;
268
308
  var EthereumSepoliaTokens = [
309
+ {
310
+ chain: EthereumChain2,
311
+ identifier: "0x0000000000000000000000000000000000000000",
312
+ name: "Ether",
313
+ symbol: "ETH",
314
+ decimals: 18,
315
+ logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
316
+ },
269
317
  {
270
318
  chain: EthereumChain2,
271
319
  identifier: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
@@ -490,6 +538,7 @@ var WarpEvmDataLoader = class {
490
538
  // src/WarpEvmExecutor.ts
491
539
  import {
492
540
  applyOutputToMessages,
541
+ extractResolvedInputValues as extractResolvedInputValues2,
493
542
  getNextInfo,
494
543
  getProviderConfig as getProviderConfig3,
495
544
  getWarpActionByIndex,
@@ -575,10 +624,13 @@ var ExplorerUrls = {
575
624
  // src/WarpEvmOutput.ts
576
625
  import {
577
626
  evaluateOutputCommon,
627
+ extractResolvedInputValues,
578
628
  getProviderConfig as getProviderConfig2,
579
629
  getWarpWalletAddressFromConfig,
580
630
  parseOutputOutIndex,
581
- WarpConstants as WarpConstants2
631
+ WarpConstants as WarpConstants2,
632
+ WarpCache as WarpCache3,
633
+ WarpCacheKey as WarpCacheKey2
582
634
  } from "@vleap/warps";
583
635
  import { ethers as ethers3 } from "ethers";
584
636
 
@@ -746,17 +798,20 @@ var WarpEvmOutput = class {
746
798
  const providerConfig = getProviderConfig2(this.config, this.chain.name, this.config.env, this.chain.defaultApiUrl);
747
799
  const network = new ethers3.Network(this.chain.name, parseInt(this.chain.chainId));
748
800
  this.provider = new ethers3.JsonRpcProvider(providerConfig.url, network);
801
+ this.cache = new WarpCache3(config.cache?.type);
749
802
  }
750
803
  async getActionExecution(warp, actionIndex, tx) {
804
+ const inputs = this.cache.get(WarpCacheKey2.WarpExecutable(this.config.env, warp.meta?.hash || "", actionIndex)) ?? [];
805
+ const resolvedInputs = extractResolvedInputValues(inputs);
751
806
  if (!tx) {
752
- return this.createFailedExecution(warp, actionIndex);
807
+ return this.createFailedExecution(warp, actionIndex, resolvedInputs);
753
808
  }
754
809
  if ("status" in tx && typeof tx.status === "string") {
755
- return this.handleWarpChainAction(warp, actionIndex, tx);
810
+ return this.handleWarpChainAction(warp, actionIndex, tx, resolvedInputs);
756
811
  }
757
- return this.handleTransactionReceipt(warp, actionIndex, tx);
812
+ return this.handleTransactionReceipt(warp, actionIndex, tx, resolvedInputs);
758
813
  }
759
- createFailedExecution(warp, actionIndex) {
814
+ createFailedExecution(warp, actionIndex, resolvedInputs = []) {
760
815
  return {
761
816
  status: "error",
762
817
  warp,
@@ -768,10 +823,11 @@ var WarpEvmOutput = class {
768
823
  values: { string: [], native: [], mapped: {} },
769
824
  output: {},
770
825
  messages: {},
771
- destination: null
826
+ destination: null,
827
+ resolvedInputs
772
828
  };
773
829
  }
774
- handleWarpChainAction(warp, actionIndex, tx) {
830
+ handleWarpChainAction(warp, actionIndex, tx, resolvedInputs = []) {
775
831
  const success = tx.status === "success";
776
832
  const transactionHash = tx.id || tx.tx?.hash || "";
777
833
  const gasUsed = tx.tx?.gasLimit || "0";
@@ -790,10 +846,11 @@ var WarpEvmOutput = class {
790
846
  values: { string: stringValues, native: rawValues, mapped: {} },
791
847
  output: {},
792
848
  messages: {},
793
- destination: null
849
+ destination: null,
850
+ resolvedInputs
794
851
  };
795
852
  }
796
- handleTransactionReceipt(warp, actionIndex, tx) {
853
+ handleTransactionReceipt(warp, actionIndex, tx, resolvedInputs = []) {
797
854
  const success = tx.status === 1;
798
855
  const gasUsed = tx.gasUsed?.toString() || "0";
799
856
  const gasPrice = tx.gasPrice?.toString() || "0";
@@ -820,7 +877,8 @@ var WarpEvmOutput = class {
820
877
  values: { string: stringValues, native: rawValues, mapped: {} },
821
878
  output: {},
822
879
  messages: {},
823
- destination: null
880
+ destination: null,
881
+ resolvedInputs
824
882
  };
825
883
  }
826
884
  async extractQueryOutput(warp, typedValues, actionIndex, inputs) {
@@ -1010,6 +1068,7 @@ var WarpEvmExecutor = class {
1010
1068
  (i) => i.input.position === "receiver" || i.input.position === "destination"
1011
1069
  );
1012
1070
  const destination = destinationInput?.value || executable.destination;
1071
+ const resolvedInputs = extractResolvedInputValues2(executable.resolvedInputs);
1013
1072
  return {
1014
1073
  status: isSuccess ? "success" : "error",
1015
1074
  warp: executable.warp,
@@ -1021,13 +1080,15 @@ var WarpEvmExecutor = class {
1021
1080
  values,
1022
1081
  output: { ...output, _DATA: decodedResult },
1023
1082
  messages: applyOutputToMessages(executable.warp, output, this.config),
1024
- destination
1083
+ destination,
1084
+ resolvedInputs
1025
1085
  };
1026
1086
  } catch (error) {
1027
1087
  const destinationInput = executable.resolvedInputs.find(
1028
1088
  (i) => i.input.position === "receiver" || i.input.position === "destination"
1029
1089
  );
1030
1090
  const destination = destinationInput?.value || executable.destination;
1091
+ const resolvedInputs = extractResolvedInputValues2(executable.resolvedInputs);
1031
1092
  return {
1032
1093
  status: "error",
1033
1094
  warp: executable.warp,
@@ -1039,7 +1100,8 @@ var WarpEvmExecutor = class {
1039
1100
  values: { string: [], native: [], mapped: {} },
1040
1101
  output: { _DATA: error },
1041
1102
  messages: {},
1042
- destination
1103
+ destination,
1104
+ resolvedInputs
1043
1105
  };
1044
1106
  }
1045
1107
  }