@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.
- package/README.md +21 -19
- package/dist/dcl-swap/swap.d.ts +4 -2
- package/dist/ref-sdk.cjs.development.js +13 -7
- package/dist/ref-sdk.cjs.development.js.map +1 -1
- package/dist/ref-sdk.cjs.production.min.js +1 -1
- package/dist/ref-sdk.cjs.production.min.js.map +1 -1
- package/dist/ref-sdk.esm.js +13 -7
- package/dist/ref-sdk.esm.js.map +1 -1
- package/dist/ref-sdk.umd.development.js +13 -7
- package/dist/ref-sdk.umd.development.js.map +1 -1
- package/dist/ref-sdk.umd.production.min.js +1 -1
- package/dist/ref-sdk.umd.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -7805,12 +7805,12 @@
|
|
|
7805
7805
|
var DCL_POOL_SPLITER = '|';
|
|
7806
7806
|
var DCLSwap = /*#__PURE__*/function () {
|
|
7807
7807
|
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
7808
|
-
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;
|
|
7808
|
+
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;
|
|
7809
7809
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7810
7810
|
while (1) {
|
|
7811
7811
|
switch (_context.prev = _context.next) {
|
|
7812
7812
|
case 0:
|
|
7813
|
-
Swap = _ref.Swap, SwapByOutput = _ref.SwapByOutput, LimitOrderWithSwap = _ref.LimitOrderWithSwap, SwapByStopPoint = _ref.SwapByStopPoint, AccountId = _ref.AccountId, swapInfo = _ref.swapInfo;
|
|
7813
|
+
Swap = _ref.Swap, SwapByOutput = _ref.SwapByOutput, LimitOrderWithSwap = _ref.LimitOrderWithSwap, SwapByStopPoint = _ref.SwapByStopPoint, AccountId = _ref.AccountId, swapInfo = _ref.swapInfo, referralId = _ref.referralId;
|
|
7814
7814
|
transactions = [];
|
|
7815
7815
|
tokenA = swapInfo.tokenA, tokenB = swapInfo.tokenB, amountA = swapInfo.amountA;
|
|
7816
7816
|
if (!Swap) {
|
|
@@ -7837,6 +7837,7 @@
|
|
|
7837
7837
|
pool_ids: pool_ids,
|
|
7838
7838
|
output_token: output_token,
|
|
7839
7839
|
min_output_amount: min_output_amount,
|
|
7840
|
+
referral_id: referralId || '',
|
|
7840
7841
|
client_id: ''
|
|
7841
7842
|
}
|
|
7842
7843
|
});
|
|
@@ -7868,6 +7869,7 @@
|
|
|
7868
7869
|
pool_ids: _pool_ids,
|
|
7869
7870
|
output_token: _output_token,
|
|
7870
7871
|
output_amount: output_amount,
|
|
7872
|
+
referral_id: referralId || '',
|
|
7871
7873
|
client_id: ''
|
|
7872
7874
|
}
|
|
7873
7875
|
});
|
|
@@ -7951,7 +7953,8 @@
|
|
|
7951
7953
|
pool_id: pool_id,
|
|
7952
7954
|
buy_token: buy_token,
|
|
7953
7955
|
point: new_point,
|
|
7954
|
-
client_id: ''
|
|
7956
|
+
client_id: '',
|
|
7957
|
+
referral_id: referralId || ''
|
|
7955
7958
|
}
|
|
7956
7959
|
});
|
|
7957
7960
|
transactions.push({
|
|
@@ -7987,7 +7990,9 @@
|
|
|
7987
7990
|
});
|
|
7988
7991
|
}
|
|
7989
7992
|
_msg3 = JSON.stringify({
|
|
7990
|
-
SwapByStopPoint: SwapByStopPoint
|
|
7993
|
+
SwapByStopPoint: _extends({}, SwapByStopPoint, {
|
|
7994
|
+
referral_id: referralId || ''
|
|
7995
|
+
})
|
|
7991
7996
|
});
|
|
7992
7997
|
transactions.push({
|
|
7993
7998
|
receiverId: tokenA.id,
|
|
@@ -8091,12 +8096,12 @@
|
|
|
8091
8096
|
var DCLSwapByInputOnBestPool = /*#__PURE__*/function () {
|
|
8092
8097
|
var _ref7 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref6) {
|
|
8093
8098
|
var _bestEstimate$tag, _bestEstimate$tag$spl, _bestEstimate$tag2, _bestEstimate$tag2$sp;
|
|
8094
|
-
var tokenA, tokenB, amountA, slippageTolerance, AccountId, estimates, bestEstimate, bestFee;
|
|
8099
|
+
var tokenA, tokenB, amountA, slippageTolerance, AccountId, referralId, estimates, bestEstimate, bestFee;
|
|
8095
8100
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
8096
8101
|
while (1) {
|
|
8097
8102
|
switch (_context5.prev = _context5.next) {
|
|
8098
8103
|
case 0:
|
|
8099
|
-
tokenA = _ref6.tokenA, tokenB = _ref6.tokenB, amountA = _ref6.amountA, slippageTolerance = _ref6.slippageTolerance, AccountId = _ref6.AccountId;
|
|
8104
|
+
tokenA = _ref6.tokenA, tokenB = _ref6.tokenB, amountA = _ref6.amountA, slippageTolerance = _ref6.slippageTolerance, AccountId = _ref6.AccountId, referralId = _ref6.referralId;
|
|
8100
8105
|
if (!(slippageTolerance <= 0 || slippageTolerance >= 100)) {
|
|
8101
8106
|
_context5.next = 3;
|
|
8102
8107
|
break;
|
|
@@ -8158,7 +8163,8 @@
|
|
|
8158
8163
|
pool_ids: [getDCLPoolId(tokenA.id, tokenB.id, bestFee)],
|
|
8159
8164
|
min_output_amount: percentLess(slippageTolerance, bestEstimate.amount)
|
|
8160
8165
|
},
|
|
8161
|
-
AccountId: AccountId
|
|
8166
|
+
AccountId: AccountId,
|
|
8167
|
+
referralId: referralId
|
|
8162
8168
|
}));
|
|
8163
8169
|
case 11:
|
|
8164
8170
|
case "end":
|