forked from polkadot-js/extension
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/webapp-yield' into webapp-dev
- Loading branch information
Showing
13 changed files
with
87 additions
and
8 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions
44
packages/extension-base/src/koni/api/yield/stDOT-staking.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2019-2022 @subwallet/extension-base | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { _ChainInfo } from '@subwallet/chain-list/types'; | ||
import { YieldPoolInfo } from '@subwallet/extension-base/background/KoniTypes'; | ||
import { YIELD_POOL_STAT_REFRESH_INTERVAL } from '@subwallet/extension-base/koni/api/yield/helper/utils'; | ||
import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; | ||
|
||
export function subscribestDOTLiquidStakingStats (chainApi: _SubstrateApi, chainInfoMap: Record<string, _ChainInfo>, poolInfo: YieldPoolInfo, callback: (rs: YieldPoolInfo) => void) { | ||
function getPoolStat () { | ||
// eslint-disable-next-line node/no-callback-literal | ||
callback({ | ||
...poolInfo, | ||
stats: { | ||
isAvailable: false, | ||
assetEarning: [ | ||
{ | ||
slug: poolInfo.rewardAssets[0], | ||
apr: -1, | ||
exchangeRate: -1 | ||
} | ||
], | ||
maxCandidatePerFarmer: 1, | ||
maxWithdrawalRequestPerFarmer: 1, | ||
minJoinPool: '50000000000', | ||
minWithdrawal: '0', | ||
totalApr: -1, | ||
tvl: '0' | ||
} | ||
}); | ||
} | ||
|
||
function getStatInterval () { | ||
getPoolStat(); | ||
} | ||
|
||
getStatInterval(); | ||
|
||
const interval = setInterval(getStatInterval, YIELD_POOL_STAT_REFRESH_INTERVAL); | ||
|
||
return () => { | ||
clearInterval(interval); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.