This project provides a developer tool for exploring the Polkadot JS API in a much more effortless way.
Only support
api.query.<module>.<method>
right now.
$ git clone https://github.com/cryptolab-network/polkadot-api-cli.git
$ cd polkadot-api-cli
$ npm install
$ npm run build && npm run start
api-cli (wss://kusama-rpc.polkadot.io/) >
## Usage: api <...params>
## ex: api.query.staking.activeEra
api-cli (wss://kusama-rpc.polkadot.io/) > api.query.staking.activeEra
{ index: 2316, start: 1622438874002 }
## ex: api.query.staking.erasTotalStake 2316
api-cli (wss://kusama-rpc.polkadot.io/) > api.query.staking.erasTotalStake 2316
'0x00000000000000004d4ad5e593a16553'
## Usage: -w, --ws <endpoint>, choose a wss endpoint to execute this program, ex., wss://kusama-rpc.polkadot.io/
$ node ./dist/index.js -w wss://rpc.polkadot.io/
api-cli (wss://rpc.polkadot.io/) >
Distributed under the MIT License. See LICENSE
for more information.