@aurigami/sdk 1.19.3 → 1.19.5
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/sdk.cjs.development.js +15 -7
- 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 +15 -7
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/priceFetcher.ts +3 -0
- package/src/interactors/Staking.ts +4 -2
package/package.json
CHANGED
|
@@ -297,6 +297,9 @@ async function _fetchPrice(address: Address, provider: providers.Provider): Prom
|
|
|
297
297
|
PRICE_WHITELISTED.has(address.toLocaleLowerCase()),
|
|
298
298
|
`Address ${address} is not whitelisted for price fetching`
|
|
299
299
|
);
|
|
300
|
+
if (address.toLowerCase() == networkAddresses.tokens.META) {
|
|
301
|
+
return fetchPriceFromDefiLlamaAndCoingecko(address);
|
|
302
|
+
}
|
|
300
303
|
if (shouldFetchFromKyberSwap(address)) {
|
|
301
304
|
return fetchPriceFromKyberSwap(address, provider).catch((e) => {
|
|
302
305
|
return fetchPriceFromDefiLlamaAndCoingecko(address);
|
|
@@ -28,8 +28,10 @@ export class StakingRead extends BlockchainEntityRead {
|
|
|
28
28
|
.getPoolInfo(consts.PLYWNEAR_POOL_ID)
|
|
29
29
|
.then((res) => {
|
|
30
30
|
const endedTime = res.endTime;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const startTime = res.startTime;
|
|
32
|
+
const now = Date.now() / 1000;
|
|
33
|
+
// If the pool has ended or not started, return 0 reward per second
|
|
34
|
+
if (endedTime < now || startTime > now) {
|
|
33
35
|
return {
|
|
34
36
|
stakedLiquidity: res.totalStake,
|
|
35
37
|
rewardPerSeconds: res.rewardPerSeconds.map((_) => BN.from(0)),
|