Near class constructor.
Network
Controls which NEAR network to connect to.The network to connect to.Presets: Sandbox: Passing a
"mainnet", "testnet", "localnet"Custom config:Sandbox instance automatically configures RPC and the root account key.Override the RPC URL for a preset network (e.g., to use a specific provider like Infura or Lava).
Custom HTTP headers for RPC requests.
Credentials & Signing
near-kit checks these in order: wallet > signer > privateKey > keyStore.
A single private key (
ed25519:...). Useful for scripts.A storage backend for multiple keys.
| KeyStore | Environment | Description |
|---|---|---|
InMemoryKeyStore | Any | Default, keys in memory |
FileKeyStore | Node.js | Stores in ~/.near-credentials |
NativeKeyStore | Node.js | macOS Keychain / Windows Credential Manager |
RotatingKeyStore | Any | For high-concurrency apps |
A wrapper around a browser wallet.
A custom signing function. Use this for hardware wallets, KMS, or multi-sig logic.
The account ID to use when calling
near.transaction() without arguments.Execution Behavior
Controls how long
.send() waits before returning.| Value | Description |
|---|---|
"INCLUDED" | Return as soon as the network accepts it (fastest, no result value) |
"EXECUTED_OPTIMISTIC" | Transaction is executed and result is available (default) |
"FINAL" | Wait for BFT finality (safest, slowest) |
Configuration for automatic retries on network errors.