Socket
Socket
Sign inDemoInstall

near-cli

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

near-cli

General purpose command line tools for interacting with NEAR Protocol


Version published
Weekly downloads
223
increased by13.2%
Maintainers
3
Weekly downloads
 
Created
Source

NEAR CLI (command line interface)

Build Status Gitpod Ready-to-Code

NEAR CLI is a Node.js application that relies on near-api-js to generate secure keys, connect to the NEAR platform and send transactions to the network on your behalf.

note that Node.js version 10+ is required to run NEAR CLI

Installation

npm install -g near-cli

Usage

In command line, from the directory with your project:

near <command>

Commands

For account:
  near login                                       # logging in through NEAR protocol wallet
  near create-account <accountId>                  # create a developer account with --masterAccount (required), publicKey and initialBalance
  near state <accountId>                           # view account state
  near keys <accountId>                            # view account public keys
  near send <sender> <receiver> <amount>           # send tokens to given receiver
  near stake <accountId> <stakingKey> <amount>     # create staking transaction (stakingKey is base58 encoded)
  near delete <accountId> <beneficiaryId>          # delete an account and transfer funds to beneficiary account
  near delete-key [accessKey]                      # delete access key
For smart contract:
  near deploy [accountId] [wasmFile] [initFunction] [initArgs] [initGas] [initDeposit]  # deploy your smart contract
  near dev-deploy [wasmFile]                       # deploy your smart contract using temporary account (TestNet only)
  near call <contractName> <methodName> [args]     # schedule smart contract call which can modify state
  near view <contractName> <methodName> [args]     # make smart contract call which can view state
  near clean                                       # clean the smart contract build locally (remove ./out )
For transactions:
  near tx-status <hash>                            # lookup transaction status by hash
For validators:
  near validators <epoch>                          # lookup validating nodes by epoch(or "current", "next")
  near proposals                                   # lookup current proposals
REPL:
near repl

Launch interactive Node.js shell with NEAR connection available to use. The repl's initial context contains nearAPI, nearand account if an accountId cli argument is provided. To load a script into the repl use .load script.js.

Usage example:
near repl --acountId bob
> console.log(account)
> .load script.js
Misc:
  near repl                                        # launch interactive Node.js shell with NEAR connection available to use
  near generate-key <account-id>                   # generate key locally (Note: this does not create another access key automatically)

Options

OptionDescriptionTypeDefault
--helpShow help[boolean]
--versionShow version number[boolean]
--nodeUrlNEAR node URL[string]"http://localhost:3030"
--networkIdNEAR network ID for different keys by network[string]"default"
--helperUrlNEAR contract helper URL[string]
--keyPathPath to master account key[string]
--accountIdUnique identifier for the account[string] [required]
--masterAccountAccount used to create requested account.[string] [required]
--publicKeyPublic key to initialize the account with[string] [required]
--initialBalanceNumber of tokens to transfer to newly account[string] [required]

License

This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE and LICENSE-APACHE for details.

Keywords

FAQs

Package last updated on 27 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc