@aurigami/sdk 1.6.2 → 1.6.3
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/consts/constants.d.ts +3 -0
- package/dist/sdk.cjs.development.js +26 -10
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +26 -11
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/consts/constants.ts +10 -1
- package/src/consts/decimals.ts +1 -0
- package/src/helpers/priceFetcher.ts +4 -1
package/dist/sdk.esm.js
CHANGED
|
@@ -65,6 +65,10 @@ var networkAddresses = {
|
|
|
65
65
|
name: 'auPLY',
|
|
66
66
|
address: /*#__PURE__*/MAINNET_ADDRESSES.auTokens.PLY.toLowerCase(),
|
|
67
67
|
underlying: /*#__PURE__*/'0x09c9d464b58d96837f8d8b6f4d9fe4ad408d3a4f'.toLowerCase()
|
|
68
|
+
}, {
|
|
69
|
+
name: 'auUSN',
|
|
70
|
+
address: /*#__PURE__*/MAINNET_ADDRESSES.auTokens.USN.toLowerCase(),
|
|
71
|
+
underlying: /*#__PURE__*/'0x5183e1b1091804bc2602586919e6880ac1cf2896'.toLowerCase()
|
|
68
72
|
}],
|
|
69
73
|
misc: {
|
|
70
74
|
COMPTROLLER: /*#__PURE__*/MAINNET_ADDRESSES.comptroller.toLowerCase(),
|
|
@@ -85,9 +89,10 @@ var networkAddresses = {
|
|
|
85
89
|
USDC: /*#__PURE__*/'0xb12bfca5a55806aaf64e99521918a4bf0fc40802'.toLowerCase(),
|
|
86
90
|
WNEAR: /*#__PURE__*/'0xC42C30aC6Cc15faC9bD938618BcaA1a1FaE8501d'.toLowerCase(),
|
|
87
91
|
TRI: /*#__PURE__*/'0xFa94348467f64D5A457F75F8bc40495D33c65aBB'.toLowerCase(),
|
|
88
|
-
META: /*#__PURE__*/'0xc21ff01229e982d7c8b8691163b0a3cb8f357453'.
|
|
92
|
+
META: /*#__PURE__*/'0xc21ff01229e982d7c8b8691163b0a3cb8f357453'.toLowerCase(),
|
|
89
93
|
PULP: /*#__PURE__*/MAINNET_ADDRESSES.PULP.toLowerCase(),
|
|
90
|
-
PLYWNEAR: /*#__PURE__*/MAINNET_ADDRESSES.ply_wnear_lp.toLowerCase()
|
|
94
|
+
PLYWNEAR: /*#__PURE__*/MAINNET_ADDRESSES.ply_wnear_lp.toLowerCase(),
|
|
95
|
+
USN: /*#__PURE__*/'0x5183e1b1091804bc2602586919e6880ac1cf2896'.toLowerCase()
|
|
91
96
|
}
|
|
92
97
|
}; // All token that we can calculate the price via oracle + coingecko
|
|
93
98
|
|
|
@@ -124,6 +129,7 @@ Object.entries({
|
|
|
124
129
|
}));
|
|
125
130
|
var BORROW_NEAR_REWARDS_PER_WEEK = {// currently 0 for all markets
|
|
126
131
|
};
|
|
132
|
+
var HARDCODE_PRICE_TOKENS = /*#__PURE__*/Object.fromEntries([[/*#__PURE__*/networkAddresses.tokens.USN.toLowerCase(), '1']]);
|
|
127
133
|
|
|
128
134
|
var decimalRecords = {
|
|
129
135
|
'0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee': 18,
|
|
@@ -147,7 +153,8 @@ var decimalRecords = {
|
|
|
147
153
|
'0xf4eb217ba2454613b15dbdea6e5f22276410e89e': 8,
|
|
148
154
|
'0xc21ff01229e982d7c8b8691163b0a3cb8f357453': 24,
|
|
149
155
|
'0x04ac48711bcdc45b4d223fb021e09da73c71095e': 18,
|
|
150
|
-
'0x044b6b0cd3bb13d2b9057781df4459c66781dce7': 18
|
|
156
|
+
'0x044b6b0cd3bb13d2b9057781df4459c66781dce7': 18,
|
|
157
|
+
'0x5183e1b1091804bc2602586919e6880ac1cf2896': 18
|
|
151
158
|
};
|
|
152
159
|
|
|
153
160
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2621,33 +2628,41 @@ function _fetchPrice3() {
|
|
|
2621
2628
|
while (1) {
|
|
2622
2629
|
switch (_context10.prev = _context10.next) {
|
|
2623
2630
|
case 0:
|
|
2624
|
-
if (!
|
|
2631
|
+
if (!(address.toLowerCase() in HARDCODE_PRICE_TOKENS)) {
|
|
2625
2632
|
_context10.next = 4;
|
|
2626
2633
|
break;
|
|
2627
2634
|
}
|
|
2628
2635
|
|
|
2629
|
-
return _context10.abrupt("return",
|
|
2636
|
+
return _context10.abrupt("return", new BigNumber(HARDCODE_PRICE_TOKENS[address.toLowerCase()]));
|
|
2630
2637
|
|
|
2631
2638
|
case 4:
|
|
2632
|
-
if (!isSameAddress(address, networkAddresses.tokens.
|
|
2639
|
+
if (!isSameAddress(address, networkAddresses.tokens.PLYWNEAR)) {
|
|
2633
2640
|
_context10.next = 8;
|
|
2634
2641
|
break;
|
|
2635
2642
|
}
|
|
2636
2643
|
|
|
2637
|
-
return _context10.abrupt("return",
|
|
2644
|
+
return _context10.abrupt("return", fetchLPPrice(address, provider));
|
|
2638
2645
|
|
|
2639
2646
|
case 8:
|
|
2647
|
+
if (!isSameAddress(address, networkAddresses.tokens.PLY)) {
|
|
2648
|
+
_context10.next = 12;
|
|
2649
|
+
break;
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
return _context10.abrupt("return", fetchPLYPrice(provider));
|
|
2653
|
+
|
|
2654
|
+
case 12:
|
|
2640
2655
|
if (!isSameAddress(address, networkAddresses.tokens.PULP)) {
|
|
2641
|
-
_context10.next =
|
|
2656
|
+
_context10.next = 14;
|
|
2642
2657
|
break;
|
|
2643
2658
|
}
|
|
2644
2659
|
|
|
2645
2660
|
return _context10.abrupt("return", fetchPULPPrice(provider));
|
|
2646
2661
|
|
|
2647
|
-
case
|
|
2662
|
+
case 14:
|
|
2648
2663
|
return _context10.abrupt("return", _fetchPrice(address, provider));
|
|
2649
2664
|
|
|
2650
|
-
case
|
|
2665
|
+
case 15:
|
|
2651
2666
|
case "end":
|
|
2652
2667
|
return _context10.stop();
|
|
2653
2668
|
}
|
|
@@ -108342,5 +108357,5 @@ BigNumber.config({
|
|
|
108342
108357
|
DECIMAL_PLACES: 50
|
|
108343
108358
|
});
|
|
108344
108359
|
|
|
108345
|
-
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, Airdrop, AirdropRead, AirdropReadWrite, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, ETHAddress, INF, MarketAction, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getBlockBeforeTimestamp, getBlockTimestamp, getCurrentTimestamp, getDecimal, getQuery, isSameAddress, networkAddresses, validateAndParseAddress, valuateToken };
|
|
108360
|
+
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, Airdrop, AirdropRead, AirdropReadWrite, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getBlockBeforeTimestamp, getBlockTimestamp, getCurrentTimestamp, getDecimal, getQuery, isSameAddress, networkAddresses, validateAndParseAddress, valuateToken };
|
|
108346
108361
|
//# sourceMappingURL=sdk.esm.js.map
|