aftermath-ts-sdk 0.0.143 → 0.0.145
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/general/api/transactionsApiHelpers.d.ts.map +1 -1
- package/dist/general/api/transactionsApiHelpers.js +4 -6
- package/dist/general/historicalData/historicalData.d.ts +14 -0
- package/dist/general/historicalData/historicalData.d.ts.map +1 -0
- package/dist/general/historicalData/historicalData.js +41 -0
- package/dist/general/historicalData/historicalDataApi.d.ts +10 -0
- package/dist/general/historicalData/historicalDataApi.d.ts.map +1 -0
- package/dist/general/historicalData/historicalDataApi.js +20 -0
- package/dist/general/historicalData/historicalDataTypes.d.ts +10 -0
- package/dist/general/historicalData/historicalDataTypes.d.ts.map +1 -0
- package/dist/general/historicalData/historicalDataTypes.js +2 -0
- package/dist/general/prices/coingecko/coinGeckoApiHelpers.d.ts +17 -0
- package/dist/general/prices/coingecko/coinGeckoApiHelpers.d.ts.map +1 -0
- package/dist/general/prices/coingecko/coinGeckoApiHelpers.js +115 -0
- package/dist/general/prices/coingecko/coinGeckoPricesApi.d.ts +19 -0
- package/dist/general/prices/coingecko/coinGeckoPricesApi.d.ts.map +1 -0
- package/dist/general/prices/coingecko/coinGeckoPricesApi.js +63 -0
- package/dist/general/prices/coingecko/coinGeckoTypes.d.ts +9 -0
- package/dist/general/prices/coingecko/coinGeckoTypes.d.ts.map +1 -0
- package/dist/general/prices/coingecko/coinGeckoTypes.js +2 -0
- package/dist/general/prices/prices.d.ts +7 -1
- package/dist/general/prices/prices.d.ts.map +1 -1
- package/dist/general/prices/prices.js +18 -5
- package/dist/general/prices/pyth/pythPricesApi.d.ts +1 -2
- package/dist/general/prices/pyth/pythPricesApi.d.ts.map +1 -1
- package/dist/general/prices/pyth/pythPricesApi.js +2 -2
- package/dist/general/prices/pyth/pythPricesApiHelpers.d.ts +1 -3
- package/dist/general/prices/pyth/pythPricesApiHelpers.d.ts.map +1 -1
- package/dist/general/prices/pyth/pythPricesApiHelpers.js +1 -3
- package/dist/general/providers/aftermath.d.ts +3 -1
- package/dist/general/providers/aftermath.d.ts.map +1 -1
- package/dist/general/providers/aftermath.js +2 -0
- package/dist/general/providers/aftermathApi.d.ts +6 -3
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +8 -3
- package/dist/general/types/suiTypes.d.ts +1 -1
- package/dist/general/types/suiTypes.d.ts.map +1 -1
- package/dist/general/utils/caller.d.ts.map +1 -1
- package/dist/general/utils/caller.js +4 -2
- package/dist/general/utils/helpers.js +1 -1
- package/dist/general/wallet/walletApi.d.ts.map +1 -1
- package/dist/general/wallet/walletApi.js +2 -2
- package/dist/packages/coin/api/coinApi.d.ts +1 -0
- package/dist/packages/coin/api/coinApi.d.ts.map +1 -1
- package/dist/packages/coin/api/coinApi.js +47 -10
- package/dist/packages/coin/api/coinApiHelpers.d.ts +1 -10
- package/dist/packages/coin/api/coinApiHelpers.d.ts.map +1 -1
- package/dist/packages/coin/api/coinApiHelpers.js +86 -56
- package/dist/packages/coin/coin.d.ts +10 -7
- package/dist/packages/coin/coin.d.ts.map +1 -1
- package/dist/packages/coin/coin.js +39 -14
- package/dist/packages/coin/coinTypes.d.ts +7 -1
- package/dist/packages/coin/coinTypes.d.ts.map +1 -1
- package/dist/packages/external/turbos/turbosApiHelpers.d.ts.map +1 -1
- package/dist/packages/external/turbos/turbosApiHelpers.js +0 -1
- package/dist/packages/faucet/api/faucetApi.d.ts +3 -1
- package/dist/packages/faucet/api/faucetApi.d.ts.map +1 -1
- package/dist/packages/faucet/api/faucetApi.js +5 -4
- package/dist/packages/pools/api/poolsApi.d.ts +20 -7
- package/dist/packages/pools/api/poolsApi.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApi.js +17 -15
- package/dist/packages/pools/api/poolsApiHelpers.d.ts +14 -4
- package/dist/packages/pools/api/poolsApiHelpers.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApiHelpers.js +14 -17
- package/dist/packages/pools/pool.d.ts +6 -3
- package/dist/packages/pools/pool.d.ts.map +1 -1
- package/dist/packages/pools/pool.js +24 -12
- package/dist/packages/pools/pools.d.ts +3 -2
- package/dist/packages/pools/pools.d.ts.map +1 -1
- package/dist/packages/pools/pools.js +3 -2
- package/dist/packages/pools/poolsTypes.d.ts +2 -2
- package/dist/packages/pools/poolsTypes.d.ts.map +1 -1
- package/dist/packages/router/api/routerApi.d.ts.map +1 -1
- package/dist/packages/router/router.d.ts +1 -1
- package/dist/packages/router/router.js +1 -1
- package/dist/packages/router/utils/synchronous/routerGraph.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerGraph.js +0 -1
- package/dist/packages/router/utils/synchronous/routerPools/aftermathRouterPool.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerPools/aftermathRouterPool.js +5 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aftermathRouterPool.d.ts","sourceRoot":"","sources":["../../../../../../src/packages/router/utils/synchronous/routerPools/aftermathRouterPool.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,OAAO,EACP,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,GAAG,EACH,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"aftermathRouterPool.d.ts","sourceRoot":"","sources":["../../../../../../src/packages/router/utils/synchronous/routerPools/aftermathRouterPool.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,OAAO,EACP,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,GAAG,EACH,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B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,gBAAgB,WAAY;QAC3B,UAAU,EAAE,QAAQ,CAAC;QACrB,aAAa,EAAE,OAAO,CAAC;QACvB,WAAW,EAAE,QAAQ,CAAC;QACtB,QAAQ,CAAC,EAAE,UAAU,CAAC;KACtB,KAAG,OAAO,CAiCT;IAEF,yBAAyB,WAAY;QACpC,UAAU,EAAE,QAAQ,CAAC;QACrB,YAAY,EAAE,OAAO,CAAC;QACtB,WAAW,EAAE,QAAQ,CAAC;QACtB,aAAa,EAAE,OAAO,CAAC;KACvB,KAAG,mBAAmB,CAMrB;IAEF,wBAAwB,WAAY;QACnC,UAAU,EAAE,QAAQ,CAAC;QACrB,YAAY,EAAE,OAAO,CAAC;QACtB,WAAW,EAAE,QAAQ,CAAC;QACtB,aAAa,EAAE,OAAO,CAAC;KACvB,KAAG,mBAAmB,CA8BrB;CACF;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -45,13 +45,11 @@ class AftermathRouterPool {
|
|
|
45
45
|
// TODO: move this estimation to helper function within sdk
|
|
46
46
|
const poolCoinOut = this.pool.coins[inputs.coinOutType];
|
|
47
47
|
const coinOutPoolBalance = poolCoinOut.balance;
|
|
48
|
-
const coinOutWeight = pools_1.Pools.coinWeightWithDecimals(poolCoinOut.weight);
|
|
49
48
|
const lpCoinSupply = Number(this.pool.lpCoinSupply);
|
|
50
49
|
const lpTotal = Number(inputs.coinInAmount);
|
|
51
50
|
const poolCoinAmount = lpTotal < 0
|
|
52
51
|
? 0
|
|
53
|
-
: Number(coinOutPoolBalance) *
|
|
54
|
-
(lpTotal / (lpCoinSupply * coinOutWeight));
|
|
52
|
+
: Number(coinOutPoolBalance) * (lpTotal / lpCoinSupply);
|
|
55
53
|
const amountOutEstimate = BigInt(Math.floor(poolCoinAmount));
|
|
56
54
|
const amountsOuts = this.poolClass.getWithdrawAmountsOut({
|
|
57
55
|
lpRatio,
|
|
@@ -155,7 +153,10 @@ class AftermathRouterPool {
|
|
|
155
153
|
this.pool = pool;
|
|
156
154
|
this.network = network;
|
|
157
155
|
this.uid = pool.objectId;
|
|
158
|
-
this.coinTypes = [
|
|
156
|
+
this.coinTypes = [
|
|
157
|
+
...Object.keys(pool.coins),
|
|
158
|
+
// pool.lpCoinType
|
|
159
|
+
];
|
|
159
160
|
this.poolClass = new pools_1.Pool(pool, network);
|
|
160
161
|
}
|
|
161
162
|
}
|