EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

how to get ram market information via EOSJS? #310

Closed ghost closed 6 years ago

ghost commented 6 years ago

we get rammarket informaction via cleos command line like this: $ cleos -u https://api.eosnewyork.io get table eosio eosio rammarket information returned: {
"rows": [{
"supply": "10000000000.0000 RAMCORE",
"base": {
"balance": "28860504208 RAM",
"weight": "0.50000000000000000"
},
"quote": {
"balance": "3199730.4381 EOS",
"weight": "0.50000000000000000"
}
}
],
"more": false
}

my problem is : how can I get current RAM market information via EOSJS? thanks a lot!

ghost commented 6 years ago

@jcalfee I found it in file "src/schema/eosio.system.abi.json", and I learned how to use it. but don't know how to do that.

jcalfee commented 6 years ago

When it comes to block chain read APIs and transactions eosjs . Everything follows a pattern.

eos.getTableRows() // for help
await eos.getTableRows(false, 'eosio', 'eosio', 'rammarket') // for real
ghost commented 6 years ago

It help me so well