hermes-swap 0.0.25 → 0.0.27
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/cjs/index.js +4 -2
- package/dist/cjs/types.d.ts +5 -0
- package/dist/esm/index.js +4 -2
- package/dist/esm/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -169,8 +169,9 @@ var Hermes = class {
|
|
|
169
169
|
toCoin: pathItem.toCoinAddress,
|
|
170
170
|
extra: pathItem.extra ?? "0x"
|
|
171
171
|
}));
|
|
172
|
+
const amountIn = params.amountInWei;
|
|
172
173
|
const iface = new import_ethers.ethers.Interface(import_aggregator.default);
|
|
173
|
-
const calldata = iface.encodeFunctionData("swap", [params.user,
|
|
174
|
+
const calldata = iface.encodeFunctionData("swap", [params.user, amountIn, swapParams, params.minAmountOutList]);
|
|
174
175
|
return {
|
|
175
176
|
to: aggregatorAddress,
|
|
176
177
|
data: calldata
|
|
@@ -338,8 +339,9 @@ var Hermes = class {
|
|
|
338
339
|
destUser: params.destUser,
|
|
339
340
|
extra: params.extra ?? "0x"
|
|
340
341
|
};
|
|
342
|
+
const amountIn = params.amountInWei;
|
|
341
343
|
const iface = new import_ethers.ethers.Interface(import_aggregator.default);
|
|
342
|
-
const calldata = iface.encodeFunctionData("swapAndBridge", [params.user,
|
|
344
|
+
const calldata = iface.encodeFunctionData("swapAndBridge", [params.user, amountIn, swapParams, params.minAmountOutList, bridgeParam]);
|
|
343
345
|
return {
|
|
344
346
|
to: aggregatorAddress,
|
|
345
347
|
data: calldata,
|
package/dist/cjs/types.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -291,11 +291,12 @@ var Hermes = /*#__PURE__*/function () {
|
|
|
291
291
|
extra: (_pathItem$extra2 = pathItem.extra) !== null && _pathItem$extra2 !== void 0 ? _pathItem$extra2 : '0x'
|
|
292
292
|
};
|
|
293
293
|
});
|
|
294
|
+
var amountIn = params.amountInWei;
|
|
294
295
|
|
|
295
296
|
// 使用 ethers Interface 编码 calldata
|
|
296
297
|
// 参数顺序: user, amountIn, swapParams, minAmountOutList
|
|
297
298
|
var iface = new ethers.Interface(AggregatorAbi);
|
|
298
|
-
var calldata = iface.encodeFunctionData('swap', [params.user,
|
|
299
|
+
var calldata = iface.encodeFunctionData('swap', [params.user, amountIn, swapParams, params.minAmountOutList]);
|
|
299
300
|
return {
|
|
300
301
|
to: aggregatorAddress,
|
|
301
302
|
data: calldata
|
|
@@ -595,11 +596,12 @@ var Hermes = /*#__PURE__*/function () {
|
|
|
595
596
|
destUser: params.destUser,
|
|
596
597
|
extra: (_params$extra4 = params.extra) !== null && _params$extra4 !== void 0 ? _params$extra4 : '0x'
|
|
597
598
|
};
|
|
599
|
+
var amountIn = params.amountInWei;
|
|
598
600
|
|
|
599
601
|
// 使用 ethers Interface 编码 calldata
|
|
600
602
|
// 参数顺序: user, amountIn, swapParams, minAmountOutList, bridgeParam
|
|
601
603
|
var iface = new ethers.Interface(AggregatorAbi);
|
|
602
|
-
var calldata = iface.encodeFunctionData('swapAndBridge', [params.user,
|
|
604
|
+
var calldata = iface.encodeFunctionData('swapAndBridge', [params.user, amountIn, swapParams, params.minAmountOutList, bridgeParam]);
|
|
603
605
|
return {
|
|
604
606
|
to: aggregatorAddress,
|
|
605
607
|
data: calldata,
|
package/dist/esm/types.d.ts
CHANGED