@apex_labs/sdk 0.1.1 → 0.1.2
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/README.md +3 -1
- package/dist/index.cjs +7 -2
- package/dist/index.js +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -242,7 +242,9 @@ SmartRouter.exactInputCallParameters(
|
|
|
242
242
|
);
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
-
Use the raw `encode*` helpers only when deliberately assembling a custom multicall. User-facing swaps should use `*CallParameters`, or `SmartRouter.swapCallParameters(rawCalls, options)` for custom batches. These require a deadline or previous blockhash
|
|
245
|
+
Use the raw `encode*` helpers only when deliberately assembling a custom multicall. User-facing swaps should use `*CallParameters`, or `SmartRouter.swapCallParameters(rawCalls, options)` for custom batches. These require a deadline or previous blockhash.
|
|
246
|
+
|
|
247
|
+
When `value` is nonzero, `SmartRouter` call-parameter helpers append `refundETH()` automatically. Token sweeps and WETH unwraps require explicit cleanup entries because the SDK cannot infer the intended token, recipient, or minimum amount for every route.
|
|
246
248
|
|
|
247
249
|
The mixed periphery is exact-input only. Use the CL-only `SwapRouter`/`QuoterV2` for CL exact-output routes.
|
|
248
250
|
|
package/dist/index.cjs
CHANGED
|
@@ -22631,10 +22631,15 @@ var SmartRouter = class _SmartRouter {
|
|
|
22631
22631
|
};
|
|
22632
22632
|
var ApexSmartRouter = SmartRouter;
|
|
22633
22633
|
function callParameters(_calldatas, _options) {
|
|
22634
|
-
|
|
22634
|
+
const value = toBigInt3(_options.value ?? 0n);
|
|
22635
|
+
const payments = [..._options.payments ?? []];
|
|
22636
|
+
if (value > 0n && !payments.some((payment) => payment.kind === "REFUND_ETH")) {
|
|
22637
|
+
payments.push({ kind: "REFUND_ETH" });
|
|
22638
|
+
}
|
|
22639
|
+
for (const payment of payments) _calldatas.push(encodePayment(payment));
|
|
22635
22640
|
return {
|
|
22636
22641
|
calldata: SmartRouter.encodeMulticall(_calldatas, _options.deadlineOrPreviousBlockhash),
|
|
22637
|
-
value: toHexValue2(
|
|
22642
|
+
value: toHexValue2(value)
|
|
22638
22643
|
};
|
|
22639
22644
|
}
|
|
22640
22645
|
function encodePayment(_payment) {
|
package/dist/index.js
CHANGED
|
@@ -22436,10 +22436,15 @@ var SmartRouter = class _SmartRouter {
|
|
|
22436
22436
|
};
|
|
22437
22437
|
var ApexSmartRouter = SmartRouter;
|
|
22438
22438
|
function callParameters(_calldatas, _options) {
|
|
22439
|
-
|
|
22439
|
+
const value = toBigInt3(_options.value ?? 0n);
|
|
22440
|
+
const payments = [..._options.payments ?? []];
|
|
22441
|
+
if (value > 0n && !payments.some((payment) => payment.kind === "REFUND_ETH")) {
|
|
22442
|
+
payments.push({ kind: "REFUND_ETH" });
|
|
22443
|
+
}
|
|
22444
|
+
for (const payment of payments) _calldatas.push(encodePayment(payment));
|
|
22440
22445
|
return {
|
|
22441
22446
|
calldata: SmartRouter.encodeMulticall(_calldatas, _options.deadlineOrPreviousBlockhash),
|
|
22442
|
-
value: toHexValue2(
|
|
22447
|
+
value: toHexValue2(value)
|
|
22443
22448
|
};
|
|
22444
22449
|
}
|
|
22445
22450
|
function encodePayment(_payment) {
|