@velora-dex/sdk 9.3.0-dev.2 → 9.3.1

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/sdk.esm.js CHANGED
@@ -506,7 +506,7 @@ var constructGetSpender = function constructGetSpender(_ref) {
506
506
  chainId = _ref.chainId,
507
507
  fetcher = _ref.fetcher;
508
508
  var search = constructSearchString({
509
- network: chainId,
509
+ chainId: chainId,
510
510
  version: version
511
511
  });
512
512
  var fetchURL = apiURL + "/adapters/contracts" + search;
@@ -880,7 +880,7 @@ var constructGetAdapters = function constructGetAdapters(_ref) {
880
880
  case 0:
881
881
  // always pass explicit type to make sure UrlSearchParams are correct
882
882
  query = constructSearchString({
883
- network: chainId,
883
+ chainId: chainId,
884
884
  version: version
885
885
  });
886
886
  fetchURL = apiURL + "/adapters/list" + query;
@@ -964,7 +964,7 @@ var constructGetRate = function constructGetRate(_ref) {
964
964
  search = constructSearchString(_extends({
965
965
  srcToken: srcToken,
966
966
  destToken: destToken,
967
- network: chainId,
967
+ chainId: chainId,
968
968
  version: version
969
969
  }, parsedOptions));
970
970
  fetchURL = pricesUrl + "/" + search;
@@ -1005,7 +1005,7 @@ var constructGetRate = function constructGetRate(_ref) {
1005
1005
  search = constructSearchString(_extends({
1006
1006
  route: _route,
1007
1007
  // route can be used in place of srcToken+destToken
1008
- network: chainId,
1008
+ chainId: chainId,
1009
1009
  version: version
1010
1010
  }, parsedOptions));
1011
1011
  fetchURL = pricesUrl + "/" + search;
@@ -1057,7 +1057,7 @@ var constructSwapTx = function constructSwapTx(_ref) {
1057
1057
  srcToken: srcToken,
1058
1058
  destToken: destToken,
1059
1059
  route: _route,
1060
- network: chainId,
1060
+ chainId: chainId,
1061
1061
  version: version
1062
1062
  }, parsedOptions));
1063
1063
  fetchURL = pricesUrl + "/" + search;
@@ -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
- if (partnerAddress === ZERO_ADDRESS) return '0';
3710
- var partnerAndFee = BigInt(partnerAddress) << BigInt(96) | BigInt(partnerFeeBps.toFixed(0)) | BigInt(partnerTakesSurplus) << BigInt(8);
3711
- return partnerAndFee.toString(10);
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: !!allowBridgeAndSwap,
4305
+ allowBridgeAndSwap: allowBridgeAndSwap,
4297
4306
  bridges: bridgesString
4298
4307
  });
4299
4308
  fetchURL = deltaBridgeUrl + "/bridge-info" + search;