@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.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +69 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -203,6 +203,7 @@ declare class WarpEvmOutput implements AdapterWarpOutput {
|
|
|
203
203
|
private readonly chain;
|
|
204
204
|
private readonly serializer;
|
|
205
205
|
private readonly provider;
|
|
206
|
+
private readonly cache;
|
|
206
207
|
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
207
208
|
getActionExecution(warp: Warp, actionIndex: WarpActionIndex, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpActionExecutionResult>;
|
|
208
209
|
private createFailedExecution;
|
package/dist/index.d.ts
CHANGED
|
@@ -203,6 +203,7 @@ declare class WarpEvmOutput implements AdapterWarpOutput {
|
|
|
203
203
|
private readonly chain;
|
|
204
204
|
private readonly serializer;
|
|
205
205
|
private readonly provider;
|
|
206
|
+
private readonly cache;
|
|
206
207
|
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
207
208
|
getActionExecution(warp: Warp, actionIndex: WarpActionIndex, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpActionExecutionResult>;
|
|
208
209
|
private createFailedExecution;
|
package/dist/index.js
CHANGED
|
@@ -145,6 +145,14 @@ var UniswapService = _UniswapService;
|
|
|
145
145
|
var import_warps2 = require("@vleap/warps");
|
|
146
146
|
var ArbitrumChain = import_warps2.WarpChainName.Arbitrum;
|
|
147
147
|
var ArbitrumTokens = [
|
|
148
|
+
{
|
|
149
|
+
chain: ArbitrumChain,
|
|
150
|
+
identifier: "0x0000000000000000000000000000000000000000",
|
|
151
|
+
name: "Ether",
|
|
152
|
+
symbol: "ETH",
|
|
153
|
+
decimals: 18,
|
|
154
|
+
logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
|
|
155
|
+
},
|
|
148
156
|
{
|
|
149
157
|
chain: ArbitrumChain,
|
|
150
158
|
identifier: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
|
|
@@ -175,6 +183,14 @@ var ArbitrumTokens = [
|
|
|
175
183
|
var import_warps3 = require("@vleap/warps");
|
|
176
184
|
var ArbitrumChain2 = import_warps3.WarpChainName.Arbitrum;
|
|
177
185
|
var ArbitrumSepoliaTokens = [
|
|
186
|
+
{
|
|
187
|
+
chain: ArbitrumChain2,
|
|
188
|
+
identifier: "0x0000000000000000000000000000000000000000",
|
|
189
|
+
name: "Ether",
|
|
190
|
+
symbol: "ETH",
|
|
191
|
+
decimals: 18,
|
|
192
|
+
logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
|
|
193
|
+
},
|
|
178
194
|
{
|
|
179
195
|
chain: ArbitrumChain2,
|
|
180
196
|
identifier: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
|
|
@@ -197,6 +213,14 @@ var ArbitrumSepoliaTokens = [
|
|
|
197
213
|
var import_warps4 = require("@vleap/warps");
|
|
198
214
|
var BaseChain = import_warps4.WarpChainName.Base;
|
|
199
215
|
var BaseTokens = [
|
|
216
|
+
{
|
|
217
|
+
chain: BaseChain,
|
|
218
|
+
identifier: "0x0000000000000000000000000000000000000000",
|
|
219
|
+
name: "Ether",
|
|
220
|
+
symbol: "ETH",
|
|
221
|
+
decimals: 18,
|
|
222
|
+
logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
|
|
223
|
+
},
|
|
200
224
|
{
|
|
201
225
|
chain: BaseChain,
|
|
202
226
|
identifier: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
@@ -235,6 +259,14 @@ var BaseTokens = [
|
|
|
235
259
|
var import_warps5 = require("@vleap/warps");
|
|
236
260
|
var BaseChain2 = import_warps5.WarpChainName.Base;
|
|
237
261
|
var BaseSepoliaTokens = [
|
|
262
|
+
{
|
|
263
|
+
chain: BaseChain2,
|
|
264
|
+
identifier: "0x0000000000000000000000000000000000000000",
|
|
265
|
+
name: "Ether",
|
|
266
|
+
symbol: "ETH",
|
|
267
|
+
decimals: 18,
|
|
268
|
+
logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
|
|
269
|
+
},
|
|
238
270
|
{
|
|
239
271
|
chain: BaseChain2,
|
|
240
272
|
identifier: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
|
|
@@ -265,6 +297,14 @@ var BaseSepoliaTokens = [
|
|
|
265
297
|
var import_warps6 = require("@vleap/warps");
|
|
266
298
|
var EthereumChain = import_warps6.WarpChainName.Ethereum;
|
|
267
299
|
var EthereumTokens = [
|
|
300
|
+
{
|
|
301
|
+
chain: EthereumChain,
|
|
302
|
+
identifier: "0x0000000000000000000000000000000000000000",
|
|
303
|
+
name: "Ether",
|
|
304
|
+
symbol: "ETH",
|
|
305
|
+
decimals: 18,
|
|
306
|
+
logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
|
|
307
|
+
},
|
|
268
308
|
{
|
|
269
309
|
chain: EthereumChain,
|
|
270
310
|
identifier: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
@@ -311,6 +351,14 @@ var EthereumTokens = [
|
|
|
311
351
|
var import_warps7 = require("@vleap/warps");
|
|
312
352
|
var EthereumChain2 = import_warps7.WarpChainName.Ethereum;
|
|
313
353
|
var EthereumSepoliaTokens = [
|
|
354
|
+
{
|
|
355
|
+
chain: EthereumChain2,
|
|
356
|
+
identifier: "0x0000000000000000000000000000000000000000",
|
|
357
|
+
name: "Ether",
|
|
358
|
+
symbol: "ETH",
|
|
359
|
+
decimals: 18,
|
|
360
|
+
logoUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png"
|
|
361
|
+
},
|
|
314
362
|
{
|
|
315
363
|
chain: EthereumChain2,
|
|
316
364
|
identifier: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
@@ -776,17 +824,20 @@ var WarpEvmOutput = class {
|
|
|
776
824
|
const providerConfig = (0, import_warps10.getProviderConfig)(this.config, this.chain.name, this.config.env, this.chain.defaultApiUrl);
|
|
777
825
|
const network = new import_ethers3.ethers.Network(this.chain.name, parseInt(this.chain.chainId));
|
|
778
826
|
this.provider = new import_ethers3.ethers.JsonRpcProvider(providerConfig.url, network);
|
|
827
|
+
this.cache = new import_warps10.WarpCache(config.cache?.type);
|
|
779
828
|
}
|
|
780
829
|
async getActionExecution(warp, actionIndex, tx) {
|
|
830
|
+
const inputs = this.cache.get(import_warps10.WarpCacheKey.WarpExecutable(this.config.env, warp.meta?.hash || "", actionIndex)) ?? [];
|
|
831
|
+
const resolvedInputs = (0, import_warps10.extractResolvedInputValues)(inputs);
|
|
781
832
|
if (!tx) {
|
|
782
|
-
return this.createFailedExecution(warp, actionIndex);
|
|
833
|
+
return this.createFailedExecution(warp, actionIndex, resolvedInputs);
|
|
783
834
|
}
|
|
784
835
|
if ("status" in tx && typeof tx.status === "string") {
|
|
785
|
-
return this.handleWarpChainAction(warp, actionIndex, tx);
|
|
836
|
+
return this.handleWarpChainAction(warp, actionIndex, tx, resolvedInputs);
|
|
786
837
|
}
|
|
787
|
-
return this.handleTransactionReceipt(warp, actionIndex, tx);
|
|
838
|
+
return this.handleTransactionReceipt(warp, actionIndex, tx, resolvedInputs);
|
|
788
839
|
}
|
|
789
|
-
createFailedExecution(warp, actionIndex) {
|
|
840
|
+
createFailedExecution(warp, actionIndex, resolvedInputs = []) {
|
|
790
841
|
return {
|
|
791
842
|
status: "error",
|
|
792
843
|
warp,
|
|
@@ -798,10 +849,11 @@ var WarpEvmOutput = class {
|
|
|
798
849
|
values: { string: [], native: [], mapped: {} },
|
|
799
850
|
output: {},
|
|
800
851
|
messages: {},
|
|
801
|
-
destination: null
|
|
852
|
+
destination: null,
|
|
853
|
+
resolvedInputs
|
|
802
854
|
};
|
|
803
855
|
}
|
|
804
|
-
handleWarpChainAction(warp, actionIndex, tx) {
|
|
856
|
+
handleWarpChainAction(warp, actionIndex, tx, resolvedInputs = []) {
|
|
805
857
|
const success = tx.status === "success";
|
|
806
858
|
const transactionHash = tx.id || tx.tx?.hash || "";
|
|
807
859
|
const gasUsed = tx.tx?.gasLimit || "0";
|
|
@@ -820,10 +872,11 @@ var WarpEvmOutput = class {
|
|
|
820
872
|
values: { string: stringValues, native: rawValues, mapped: {} },
|
|
821
873
|
output: {},
|
|
822
874
|
messages: {},
|
|
823
|
-
destination: null
|
|
875
|
+
destination: null,
|
|
876
|
+
resolvedInputs
|
|
824
877
|
};
|
|
825
878
|
}
|
|
826
|
-
handleTransactionReceipt(warp, actionIndex, tx) {
|
|
879
|
+
handleTransactionReceipt(warp, actionIndex, tx, resolvedInputs = []) {
|
|
827
880
|
const success = tx.status === 1;
|
|
828
881
|
const gasUsed = tx.gasUsed?.toString() || "0";
|
|
829
882
|
const gasPrice = tx.gasPrice?.toString() || "0";
|
|
@@ -850,7 +903,8 @@ var WarpEvmOutput = class {
|
|
|
850
903
|
values: { string: stringValues, native: rawValues, mapped: {} },
|
|
851
904
|
output: {},
|
|
852
905
|
messages: {},
|
|
853
|
-
destination: null
|
|
906
|
+
destination: null,
|
|
907
|
+
resolvedInputs
|
|
854
908
|
};
|
|
855
909
|
}
|
|
856
910
|
async extractQueryOutput(warp, typedValues, actionIndex, inputs) {
|
|
@@ -1040,6 +1094,7 @@ var WarpEvmExecutor = class {
|
|
|
1040
1094
|
(i) => i.input.position === "receiver" || i.input.position === "destination"
|
|
1041
1095
|
);
|
|
1042
1096
|
const destination = destinationInput?.value || executable.destination;
|
|
1097
|
+
const resolvedInputs = (0, import_warps11.extractResolvedInputValues)(executable.resolvedInputs);
|
|
1043
1098
|
return {
|
|
1044
1099
|
status: isSuccess ? "success" : "error",
|
|
1045
1100
|
warp: executable.warp,
|
|
@@ -1051,13 +1106,15 @@ var WarpEvmExecutor = class {
|
|
|
1051
1106
|
values,
|
|
1052
1107
|
output: { ...output, _DATA: decodedResult },
|
|
1053
1108
|
messages: (0, import_warps11.applyOutputToMessages)(executable.warp, output, this.config),
|
|
1054
|
-
destination
|
|
1109
|
+
destination,
|
|
1110
|
+
resolvedInputs
|
|
1055
1111
|
};
|
|
1056
1112
|
} catch (error) {
|
|
1057
1113
|
const destinationInput = executable.resolvedInputs.find(
|
|
1058
1114
|
(i) => i.input.position === "receiver" || i.input.position === "destination"
|
|
1059
1115
|
);
|
|
1060
1116
|
const destination = destinationInput?.value || executable.destination;
|
|
1117
|
+
const resolvedInputs = (0, import_warps11.extractResolvedInputValues)(executable.resolvedInputs);
|
|
1061
1118
|
return {
|
|
1062
1119
|
status: "error",
|
|
1063
1120
|
warp: executable.warp,
|
|
@@ -1069,7 +1126,8 @@ var WarpEvmExecutor = class {
|
|
|
1069
1126
|
values: { string: [], native: [], mapped: {} },
|
|
1070
1127
|
output: { _DATA: error },
|
|
1071
1128
|
messages: {},
|
|
1072
|
-
destination
|
|
1129
|
+
destination,
|
|
1130
|
+
resolvedInputs
|
|
1073
1131
|
};
|
|
1074
1132
|
}
|
|
1075
1133
|
}
|