Skip to content

Commit 33cf3ef

Browse files
mdcryptonftsMike D
andauthored
added refunding balance to /helper/chain/eos (DefiLlama#11402)
Co-authored-by: Mike D <[email protected]>
1 parent eda97be commit 33cf3ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

projects/helper/chain/eos.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ function get_precision(symbol) {
4040
async function get_staked(account_name, symbol, chain = "eos") {
4141
const response = await post(`${RPC_ENDPOINTS[chain]}/v1/chain/get_account`, { account_name })
4242
try {
43-
return response.voter_info.staked / (10 ** get_precision(symbol))
43+
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)))
4449
} catch (e) {
4550
return 0;
4651
}

0 commit comments

Comments
 (0)