@ref-finance/ref-sdk 1.1.3 → 1.1.4
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/ref-sdk.cjs.development.js +12 -6
- 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 +12 -6
- package/dist/ref-sdk.esm.js.map +1 -1
- package/dist/ref-sdk.umd.development.js +12 -6
- 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 +5 -2
package/dist/ref-sdk.esm.js
CHANGED
|
@@ -48,7 +48,7 @@ function getConfig(env) {
|
|
|
48
48
|
case 'testnet':
|
|
49
49
|
return {
|
|
50
50
|
networkId: 'testnet',
|
|
51
|
-
nodeUrl: 'https://
|
|
51
|
+
nodeUrl: 'https://rpc.testnet.near.org',
|
|
52
52
|
walletUrl: 'https://wallet.testnet.near.org',
|
|
53
53
|
indexerUrl: 'https://testnet-indexer.ref-finance.com',
|
|
54
54
|
WRAP_NEAR_CONTRACT_ID: 'wrap.testnet',
|
|
@@ -635,7 +635,7 @@ var calc_y = function calc_y(amp, x_c_amount, current_c_amounts, index_x, index_
|
|
|
635
635
|
var c = d * d / x_c_amount;
|
|
636
636
|
|
|
637
637
|
for (var i = 0; i < token_num; i++) {
|
|
638
|
-
if (i
|
|
638
|
+
if (i !== index_x && i !== index_y) {
|
|
639
639
|
s += current_c_amounts[i];
|
|
640
640
|
c = c * d / current_c_amounts[i];
|
|
641
641
|
}
|
|
@@ -3008,7 +3008,7 @@ var singlePoolSwap = function singlePoolSwap(_ref3) {
|
|
|
3008
3008
|
var parsedAmountIn = toNonDivisibleNumber(tokenIn.decimals, amountIn); // const pools = simplePools.concat(stablePools);
|
|
3009
3009
|
|
|
3010
3010
|
var simplePoolsThisPair = simplePools.filter(function (p) {
|
|
3011
|
-
return p.tokenIds.includes(tokenIn.id) && p.tokenIds.includes(tokenOut.id);
|
|
3011
|
+
return p.tokenIds.includes(tokenIn.id) && p.tokenIds.includes(tokenOut.id) && (!stablePools || !isStablePool(stablePools, p.id));
|
|
3012
3012
|
});
|
|
3013
3013
|
var estimatesSimplePool = simplePoolsThisPair.map(function (pool) {
|
|
3014
3014
|
return getSimplePoolEstimate({
|
|
@@ -7145,11 +7145,17 @@ var SwapWidget = function SwapWidget(props) {
|
|
|
7145
7145
|
tokenIn: tokenIn,
|
|
7146
7146
|
tokenOut: tokenOut,
|
|
7147
7147
|
amountIn: amountIn,
|
|
7148
|
-
simplePools: allPools.simplePools
|
|
7148
|
+
simplePools: allPools.simplePools.filter(function (p) {
|
|
7149
|
+
return Number(p.shareSupply) > 0;
|
|
7150
|
+
}),
|
|
7149
7151
|
options: {
|
|
7150
7152
|
enableSmartRouting: enableSmartRouting,
|
|
7151
|
-
stablePools: allPools.ratedPools.concat(allPools.unRatedPools)
|
|
7152
|
-
|
|
7153
|
+
stablePools: allPools.ratedPools.concat(allPools.unRatedPools).filter(function (p) {
|
|
7154
|
+
return Number(p.shareSupply) > 0;
|
|
7155
|
+
}),
|
|
7156
|
+
stablePoolsDetail: allStablePools.filter(function (p) {
|
|
7157
|
+
return Number(p.shares_total_supply) > 0;
|
|
7158
|
+
})
|
|
7153
7159
|
},
|
|
7154
7160
|
slippageTolerance: slippageTolerance,
|
|
7155
7161
|
onSwap: onSwap,
|