@velora-dex/sdk 9.3.0-dev.2 → 9.3.0
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.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/methods/delta/buildDeltaOrder.d.ts +2 -0
- package/dist/methods/delta/buildDeltaOrder.d.ts.map +1 -1
- package/dist/methods/delta/getBridgeInfo.d.ts +0 -1
- package/dist/methods/delta/getBridgeInfo.d.ts.map +1 -1
- package/dist/methods/delta/getDeltaPrice.d.ts +7 -3
- package/dist/methods/delta/getDeltaPrice.d.ts.map +1 -1
- package/dist/methods/delta/helpers/buildDeltaOrderData.d.ts +2 -1
- package/dist/methods/delta/helpers/buildDeltaOrderData.d.ts.map +1 -1
- package/dist/methods/delta/helpers/types.d.ts +0 -3
- package/dist/methods/delta/helpers/types.d.ts.map +1 -1
- package/dist/sdk.cjs.development.js +15 -6
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +15 -6
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +0 -2
- package/src/methods/delta/buildDeltaOrder.ts +5 -0
- package/src/methods/delta/getBridgeInfo.ts +1 -2
- package/src/methods/delta/getDeltaPrice.ts +6 -8
- package/src/methods/delta/helpers/buildDeltaOrderData.ts +17 -8
- package/src/methods/delta/helpers/types.ts +0 -3
package/dist/sdk.esm.js
CHANGED
|
@@ -3672,6 +3672,8 @@ function buildDeltaSignableOrderData(_ref2) {
|
|
|
3672
3672
|
partnerFeeBps = _ref2.partnerFeeBps,
|
|
3673
3673
|
_ref2$partnerTakesSur = _ref2.partnerTakesSurplus,
|
|
3674
3674
|
partnerTakesSurplus = _ref2$partnerTakesSur === void 0 ? false : _ref2$partnerTakesSur,
|
|
3675
|
+
_ref2$capSurplus = _ref2.capSurplus,
|
|
3676
|
+
capSurplus = _ref2$capSurplus === void 0 ? true : _ref2$capSurplus,
|
|
3675
3677
|
chainId = _ref2.chainId,
|
|
3676
3678
|
paraswapDeltaAddress = _ref2.paraswapDeltaAddress,
|
|
3677
3679
|
bridge = _ref2.bridge;
|
|
@@ -3689,7 +3691,8 @@ function buildDeltaSignableOrderData(_ref2) {
|
|
|
3689
3691
|
partnerAndFee: producePartnerAndFee({
|
|
3690
3692
|
partnerFeeBps: partnerFeeBps,
|
|
3691
3693
|
partnerAddress: partnerAddress,
|
|
3692
|
-
partnerTakesSurplus: partnerTakesSurplus
|
|
3694
|
+
partnerTakesSurplus: partnerTakesSurplus,
|
|
3695
|
+
capSurplus: capSurplus
|
|
3693
3696
|
}),
|
|
3694
3697
|
bridge: bridge,
|
|
3695
3698
|
kind: kind,
|
|
@@ -3705,10 +3708,15 @@ function buildDeltaSignableOrderData(_ref2) {
|
|
|
3705
3708
|
function producePartnerAndFee(_ref3) {
|
|
3706
3709
|
var partnerFeeBps = _ref3.partnerFeeBps,
|
|
3707
3710
|
partnerAddress = _ref3.partnerAddress,
|
|
3708
|
-
partnerTakesSurplus = _ref3.partnerTakesSurplus
|
|
3709
|
-
|
|
3710
|
-
var
|
|
3711
|
-
|
|
3711
|
+
partnerTakesSurplus = _ref3.partnerTakesSurplus,
|
|
3712
|
+
capSurplus = _ref3.capSurplus;
|
|
3713
|
+
var capSurplusShifted = BigInt(capSurplus) << BigInt(9);
|
|
3714
|
+
if (partnerAddress === ZERO_ADDRESS) {
|
|
3715
|
+
return capSurplusShifted.toString(10);
|
|
3716
|
+
} else {
|
|
3717
|
+
var partnerAndFee = BigInt(partnerAddress) << BigInt(96) | BigInt(partnerFeeBps.toFixed(0)) | BigInt(partnerTakesSurplus) << BigInt(8) | capSurplusShifted;
|
|
3718
|
+
return partnerAndFee.toString(10);
|
|
3719
|
+
}
|
|
3712
3720
|
}
|
|
3713
3721
|
|
|
3714
3722
|
var _SwapSideToOrderKind;
|
|
@@ -3800,6 +3808,7 @@ var constructBuildDeltaOrder = function constructBuildDeltaOrder(options) {
|
|
|
3800
3808
|
partnerAddress: partnerAddress,
|
|
3801
3809
|
partnerTakesSurplus: partnerTakesSurplus,
|
|
3802
3810
|
partnerFeeBps: partnerFeeBps,
|
|
3811
|
+
capSurplus: options.capSurplus,
|
|
3803
3812
|
bridge: options.deltaPrice.bridge // ZERO_BRIDGE for same-chain Orders
|
|
3804
3813
|
};
|
|
3805
3814
|
return _context.abrupt("return", buildDeltaSignableOrderData(input));
|
|
@@ -4293,7 +4302,7 @@ var constructGetBridgeInfo = function constructGetBridgeInfo(_ref) {
|
|
|
4293
4302
|
_params = params, allowBridgeAndSwap = _params.allowBridgeAndSwap, bridges = _params.bridges;
|
|
4294
4303
|
bridgesString = bridges ? bridges.join(',') : undefined;
|
|
4295
4304
|
search = constructSearchString({
|
|
4296
|
-
allowBridgeAndSwap:
|
|
4305
|
+
allowBridgeAndSwap: allowBridgeAndSwap,
|
|
4297
4306
|
bridges: bridgesString
|
|
4298
4307
|
});
|
|
4299
4308
|
fetchURL = deltaBridgeUrl + "/bridge-info" + search;
|