A cli for for third party clients to programatically interact with nearx using staderlabs nearx-sdk
- 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
- 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.
nearx-cli nearx-balance --accountId=example.near --network=mainnet
nearx-cli user-account --accountId=example.near --network=mainnet
nearx-cli nearx-info --network=mainnet
nearx-cli nearx-validators --network=mainnet
nearx-cli stake --accountId=example.near --amount=1000000000000000000000000 --network=mainnet
nearx-cli unstake --accountId=example.near --amount=1000000000000000000000000 --network=mainnet
nearx-cli unstake-all --accountId=example.near --network=mainnet
nearx-cli withdraw --accountId=example.near --amount=1000000000000000000000000 --network=mainnet
nearx-cli withdraw-all --accountId=example.near --network=mainnet