@ref-finance/ref-sdk 1.4.9 → 1.5.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.
@@ -7819,12 +7819,12 @@ function getDefaultTokenList() {
7819
7819
  var DCL_POOL_SPLITER = '|';
7820
7820
  var DCLSwap = /*#__PURE__*/function () {
7821
7821
  var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
7822
- var Swap, SwapByOutput, LimitOrderWithSwap, SwapByStopPoint, AccountId, swapInfo, transactions, tokenA, tokenB, amountA, pool_ids, tokenRegistered, output_token, min_output_amount, msg, _pool_ids, _output_token, output_amount, _msg, _tokenRegistered, pool_id, fee, buy_token, point, _tokenRegistered2, DCLRegistered, new_point, _msg2, _tokenRegistered3, _msg3, registered;
7822
+ var Swap, SwapByOutput, LimitOrderWithSwap, SwapByStopPoint, AccountId, swapInfo, referralId, transactions, tokenA, tokenB, amountA, pool_ids, tokenRegistered, output_token, min_output_amount, msg, _pool_ids, _output_token, output_amount, _msg, _tokenRegistered, pool_id, fee, buy_token, point, _tokenRegistered2, DCLRegistered, new_point, _msg2, _tokenRegistered3, _msg3, registered;
7823
7823
  return _regeneratorRuntime().wrap(function _callee$(_context) {
7824
7824
  while (1) {
7825
7825
  switch (_context.prev = _context.next) {
7826
7826
  case 0:
7827
- Swap = _ref.Swap, SwapByOutput = _ref.SwapByOutput, LimitOrderWithSwap = _ref.LimitOrderWithSwap, SwapByStopPoint = _ref.SwapByStopPoint, AccountId = _ref.AccountId, swapInfo = _ref.swapInfo;
7827
+ Swap = _ref.Swap, SwapByOutput = _ref.SwapByOutput, LimitOrderWithSwap = _ref.LimitOrderWithSwap, SwapByStopPoint = _ref.SwapByStopPoint, AccountId = _ref.AccountId, swapInfo = _ref.swapInfo, referralId = _ref.referralId;
7828
7828
  transactions = [];
7829
7829
  tokenA = swapInfo.tokenA, tokenB = swapInfo.tokenB, amountA = swapInfo.amountA;
7830
7830
  if (!Swap) {
@@ -7851,6 +7851,7 @@ var DCLSwap = /*#__PURE__*/function () {
7851
7851
  pool_ids: pool_ids,
7852
7852
  output_token: output_token,
7853
7853
  min_output_amount: min_output_amount,
7854
+ referral_id: referralId || '',
7854
7855
  client_id: ''
7855
7856
  }
7856
7857
  });
@@ -7882,6 +7883,7 @@ var DCLSwap = /*#__PURE__*/function () {
7882
7883
  pool_ids: _pool_ids,
7883
7884
  output_token: _output_token,
7884
7885
  output_amount: output_amount,
7886
+ referral_id: referralId || '',
7885
7887
  client_id: ''
7886
7888
  }
7887
7889
  });
@@ -7965,7 +7967,8 @@ var DCLSwap = /*#__PURE__*/function () {
7965
7967
  pool_id: pool_id,
7966
7968
  buy_token: buy_token,
7967
7969
  point: new_point,
7968
- client_id: ''
7970
+ client_id: '',
7971
+ referral_id: referralId || ''
7969
7972
  }
7970
7973
  });
7971
7974
  transactions.push({
@@ -8001,7 +8004,9 @@ var DCLSwap = /*#__PURE__*/function () {
8001
8004
  });
8002
8005
  }
8003
8006
  _msg3 = JSON.stringify({
8004
- SwapByStopPoint: SwapByStopPoint
8007
+ SwapByStopPoint: _extends({}, SwapByStopPoint, {
8008
+ referral_id: referralId || ''
8009
+ })
8005
8010
  });
8006
8011
  transactions.push({
8007
8012
  receiverId: tokenA.id,
@@ -8105,12 +8110,12 @@ var list_user_assets = /*#__PURE__*/function () {
8105
8110
  var DCLSwapByInputOnBestPool = /*#__PURE__*/function () {
8106
8111
  var _ref7 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref6) {
8107
8112
  var _bestEstimate$tag, _bestEstimate$tag$spl, _bestEstimate$tag2, _bestEstimate$tag2$sp;
8108
- var tokenA, tokenB, amountA, slippageTolerance, AccountId, estimates, bestEstimate, bestFee;
8113
+ var tokenA, tokenB, amountA, slippageTolerance, AccountId, referralId, estimates, bestEstimate, bestFee;
8109
8114
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
8110
8115
  while (1) {
8111
8116
  switch (_context5.prev = _context5.next) {
8112
8117
  case 0:
8113
- tokenA = _ref6.tokenA, tokenB = _ref6.tokenB, amountA = _ref6.amountA, slippageTolerance = _ref6.slippageTolerance, AccountId = _ref6.AccountId;
8118
+ tokenA = _ref6.tokenA, tokenB = _ref6.tokenB, amountA = _ref6.amountA, slippageTolerance = _ref6.slippageTolerance, AccountId = _ref6.AccountId, referralId = _ref6.referralId;
8114
8119
  if (!(slippageTolerance <= 0 || slippageTolerance >= 100)) {
8115
8120
  _context5.next = 3;
8116
8121
  break;
@@ -8172,7 +8177,8 @@ var DCLSwapByInputOnBestPool = /*#__PURE__*/function () {
8172
8177
  pool_ids: [getDCLPoolId(tokenA.id, tokenB.id, bestFee)],
8173
8178
  min_output_amount: percentLess(slippageTolerance, bestEstimate.amount)
8174
8179
  },
8175
- AccountId: AccountId
8180
+ AccountId: AccountId,
8181
+ referralId: referralId
8176
8182
  }));
8177
8183
  case 11:
8178
8184
  case "end":