-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix net price for powerup and stake #211
Conversation
✅ Deploy Preview for unicove ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Deploying unicove with Cloudflare Pages
|
src/pages/resources/resources.ts
Outdated
[activeBlockchain, msToRent, sampleUsage], | ||
([$activeBlockchain, $msToRent, $sampleUsage]) => { | ||
if ($msToRent && $sampleUsage) { | ||
const {account} = $sampleUsage | ||
const { account } = $sampleUsage | ||
const cpu_weight = Number(account.total_resources.cpu_weight.units) | ||
const cpu_limit = Number(account.cpu_limit.max.value) | ||
let price = cpu_weight / cpu_limit | ||
if ($activeBlockchain.resourceSampleMilliseconds) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resourceSampleMilliseconds of the telos chain is 1000, not sure if it has any impact
70ac369
to
313258b
Compare
313258b
to
f374336
Compare
src/pages/resources/resources.ts
Outdated
|
||
const getResourceClient = (chain: ChainConfig) => { | ||
const api = getClient(chain) | ||
const options: any = {api} | ||
const options: any = { api } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that we don't want to spend too much time on this project, but we could probably use a proper type here instead of any
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResourcesOptions it not exported. Otherwise, need to change greymass/eosio-resources,Can this be ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, I left you a few comments.
It looks like CI checks are failing because of this error so we should also fix that:
|
91a5c9b
to
931ed3c
Compare
ed1b51f
to
d47431f
Compare
d47431f
to
300b843
Compare
* fix net price for powerup and stake * fix rex price for net rent * fix eos symbol to core token symbol * fix REXInfo import error * format resources.ts
add net powerup price、rex price、staking price
case1: powerup rent, 0.0001 EOS per kb
======Base
Available:102981.54 kb
Used:0.00 kb
Maximum:102981.54 kb
====After Rent 1000KB for 0.1000 EOS
Available: 103981.54 kb
Used: 0.00 kb
Maximum: 103981.54 kb
case2: rex rent, 0.00004 EOS per kb
======Base
Available: 103981.54 kb
Used:0.00 kb
Maximum:103981.54 kb
======After Rent 100KB for 0.0040 EOS
Available:106955.54 kb
Used:0.00 kb
Maximum:106955.54 kb
case3: staking rent, 0.0528 EOS per kb
======Base
Available:106955.54 kb
Used:0.00 kb
Maximum:106955.54 kb
======After: rent 0.0528 EOS
Available:106956.54 kb
Used:0.00 kb
Maximum:106956.54 kb
calculate stakingprice in kb or ms, avoid the situation where the asset value is 0 in smaller units