@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.
@@ -33,3 +33,6 @@ export declare const DEPOSIT_NEAR_REWARDS_PER_WEEK: {
33
33
  export declare const BORROW_NEAR_REWARDS_PER_WEEK: {
34
34
  [k: string]: string;
35
35
  };
36
+ export declare const HARDCODE_PRICE_TOKENS: {
37
+ [k: string]: string;
38
+ };
@@ -70,6 +70,10 @@ var networkAddresses = {
70
70
  name: 'auPLY',
71
71
  address: /*#__PURE__*/MAINNET_ADDRESSES.auTokens.PLY.toLowerCase(),
72
72
  underlying: /*#__PURE__*/'0x09c9d464b58d96837f8d8b6f4d9fe4ad408d3a4f'.toLowerCase()
73
+ }, {
74
+ name: 'auUSN',
75
+ address: /*#__PURE__*/MAINNET_ADDRESSES.auTokens.USN.toLowerCase(),
76
+ underlying: /*#__PURE__*/'0x5183e1b1091804bc2602586919e6880ac1cf2896'.toLowerCase()
73
77
  }],
74
78
  misc: {
75
79
  COMPTROLLER: /*#__PURE__*/MAINNET_ADDRESSES.comptroller.toLowerCase(),
@@ -90,9 +94,10 @@ var networkAddresses = {
90
94
  USDC: /*#__PURE__*/'0xb12bfca5a55806aaf64e99521918a4bf0fc40802'.toLowerCase(),
91
95
  WNEAR: /*#__PURE__*/'0xC42C30aC6Cc15faC9bD938618BcaA1a1FaE8501d'.toLowerCase(),
92
96
  TRI: /*#__PURE__*/'0xFa94348467f64D5A457F75F8bc40495D33c65aBB'.toLowerCase(),
93
- META: /*#__PURE__*/'0xc21ff01229e982d7c8b8691163b0a3cb8f357453'.toLocaleLowerCase(),
97
+ META: /*#__PURE__*/'0xc21ff01229e982d7c8b8691163b0a3cb8f357453'.toLowerCase(),
94
98
  PULP: /*#__PURE__*/MAINNET_ADDRESSES.PULP.toLowerCase(),
95
- PLYWNEAR: /*#__PURE__*/MAINNET_ADDRESSES.ply_wnear_lp.toLowerCase()
99
+ PLYWNEAR: /*#__PURE__*/MAINNET_ADDRESSES.ply_wnear_lp.toLowerCase(),
100
+ USN: /*#__PURE__*/'0x5183e1b1091804bc2602586919e6880ac1cf2896'.toLowerCase()
96
101
  }
97
102
  }; // All token that we can calculate the price via oracle + coingecko
98
103
 
@@ -129,6 +134,7 @@ Object.entries({
129
134
  }));
130
135
  var BORROW_NEAR_REWARDS_PER_WEEK = {// currently 0 for all markets
131
136
  };
137
+ var HARDCODE_PRICE_TOKENS = /*#__PURE__*/Object.fromEntries([[/*#__PURE__*/networkAddresses.tokens.USN.toLowerCase(), '1']]);
132
138
 
133
139
  var decimalRecords = {
134
140
  '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee': 18,
@@ -152,7 +158,8 @@ var decimalRecords = {
152
158
  '0xf4eb217ba2454613b15dbdea6e5f22276410e89e': 8,
153
159
  '0xc21ff01229e982d7c8b8691163b0a3cb8f357453': 24,
154
160
  '0x04ac48711bcdc45b4d223fb021e09da73c71095e': 18,
155
- '0x044b6b0cd3bb13d2b9057781df4459c66781dce7': 18
161
+ '0x044b6b0cd3bb13d2b9057781df4459c66781dce7': 18,
162
+ '0x5183e1b1091804bc2602586919e6880ac1cf2896': 18
156
163
  };
157
164
 
158
165
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -2626,33 +2633,41 @@ function _fetchPrice3() {
2626
2633
  while (1) {
2627
2634
  switch (_context10.prev = _context10.next) {
2628
2635
  case 0:
2629
- if (!isSameAddress(address, networkAddresses.tokens.PLYWNEAR)) {
2636
+ if (!(address.toLowerCase() in HARDCODE_PRICE_TOKENS)) {
2630
2637
  _context10.next = 4;
2631
2638
  break;
2632
2639
  }
2633
2640
 
2634
- return _context10.abrupt("return", fetchLPPrice(address, provider));
2641
+ return _context10.abrupt("return", new BigNumber(HARDCODE_PRICE_TOKENS[address.toLowerCase()]));
2635
2642
 
2636
2643
  case 4:
2637
- if (!isSameAddress(address, networkAddresses.tokens.PLY)) {
2644
+ if (!isSameAddress(address, networkAddresses.tokens.PLYWNEAR)) {
2638
2645
  _context10.next = 8;
2639
2646
  break;
2640
2647
  }
2641
2648
 
2642
- return _context10.abrupt("return", fetchPLYPrice(provider));
2649
+ return _context10.abrupt("return", fetchLPPrice(address, provider));
2643
2650
 
2644
2651
  case 8:
2652
+ if (!isSameAddress(address, networkAddresses.tokens.PLY)) {
2653
+ _context10.next = 12;
2654
+ break;
2655
+ }
2656
+
2657
+ return _context10.abrupt("return", fetchPLYPrice(provider));
2658
+
2659
+ case 12:
2645
2660
  if (!isSameAddress(address, networkAddresses.tokens.PULP)) {
2646
- _context10.next = 10;
2661
+ _context10.next = 14;
2647
2662
  break;
2648
2663
  }
2649
2664
 
2650
2665
  return _context10.abrupt("return", fetchPULPPrice(provider));
2651
2666
 
2652
- case 10:
2667
+ case 14:
2653
2668
  return _context10.abrupt("return", _fetchPrice(address, provider));
2654
2669
 
2655
- case 11:
2670
+ case 15:
2656
2671
  case "end":
2657
2672
  return _context10.stop();
2658
2673
  }
@@ -108361,6 +108376,7 @@ exports.BlockchainEntityReadWrite = BlockchainEntityReadWrite;
108361
108376
  exports.DECIMAL_PRECISION = DECIMAL_PRECISION;
108362
108377
  exports.DEPOSIT_NEAR_REWARDS_PER_WEEK = DEPOSIT_NEAR_REWARDS_PER_WEEK;
108363
108378
  exports.ETHAddress = ETHAddress;
108379
+ exports.HARDCODE_PRICE_TOKENS = HARDCODE_PRICE_TOKENS;
108364
108380
  exports.INF = INF;
108365
108381
  exports.MoneyMarket = MoneyMarket;
108366
108382
  exports.MoneyMarketRead = MoneyMarketRead;