nearx-cli
v1.1.0
Published
A cli for for third party clients to programatically interact with NEARX using staderlabs nearx-sdk
Downloads
2
Readme
nearx-cli
A cli for for third party clients to programatically interact with nearx using staderlabs nearx-sdk
Get Started
- Install nearx-cli by running
npm i -g nearx-cli
- Run
near login
to import the private keys of your account to ~/.near-credentials directory. If you intend to interact with the mainnet contract then runNEAR_ENV=mainnet near login
Important Parameters
- accountId: All the commands which performs a state change like stake, unstake and withdraw take in an accountId parameters.
- network: Network can be either be mainnet or testnet. Mainnet option will perform the operations on v2-nearx.stader-labs.near contract and the testnet option will perform the operations on v2-nearx.staderlabs.testnet.
Usage
To check a user's NEARX balance on mainnet contract
nearx-cli nearx-balance --accountId=example.near --network=mainnet
To check a user's account on mainnet contract
nearx-cli user-account --accountId=example.near --network=mainnet
To get general info on NEARX like total NEAR staked, NEARX supply and NEARX price
nearx-cli nearx-info --network=mainnet
To get info related to all the NEARX validators
nearx-cli nearx-validators --network=mainnet
To stake NEAR and get NEARX
nearx-cli stake --accountId=example.near --amount=1000000000000000000000000 --network=mainnet
To unstake NEARX and get back your staked NEAR
nearx-cli unstake --accountId=example.near --amount=1000000000000000000000000 --network=mainnet
To unstake all NEARX and get back your staked NEAR
nearx-cli unstake-all --accountId=example.near --network=mainnet
To withdraw your unstaked NEAR
nearx-cli withdraw --accountId=example.near --amount=1000000000000000000000000 --network=mainnet
To withdraw all your unstaked NEAR
nearx-cli withdraw-all --accountId=example.near --network=mainnet