We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eda97be commit 33cf3efCopy full SHA for 33cf3ef
projects/helper/chain/eos.js
@@ -40,7 +40,12 @@ function get_precision(symbol) {
40
async function get_staked(account_name, symbol, chain = "eos") {
41
const response = await post(`${RPC_ENDPOINTS[chain]}/v1/chain/get_account`, { account_name })
42
try {
43
- return response.voter_info.staked / (10 ** get_precision(symbol))
+ let refunding = 0;
44
+ if(response.refund_request){
45
+ refunding += parseFloat(response.refund_request.cpu_amount);
46
+ refunding += parseFloat(response.refund_request.net_amount);
47
+ }
48
+ return refunding + (response.voter_info.staked / (10 ** get_precision(symbol)))
49
} catch (e) {
50
return 0;
51
}
0 commit comments