Near class constructor.
Network
Controls which NEAR network to connect to.string | NetworkConfig
required
The network to connect to.Presets: Sandbox: Passing a
"mainnet", "testnet", "localnet"Custom config:Sandbox instance automatically configures RPC and the root account key.string
Override the RPC URL for a preset network (e.g., to use a specific provider like Infura or Lava).
Record<string, string>
Custom HTTP headers for RPC requests.
Credentials & Signing
near-kit checks these in order: wallet > signer > privateKey > keyStore.
string
A single private key (
ed25519:...). Useful for scripts.KeyStore
A storage backend for multiple keys.
WalletAdapter
A wrapper around a browser wallet.
(hash: Uint8Array) => Promise<Signature>
A custom signing function. Use this for hardware wallets, KMS, or multi-sig logic.
string
The account ID to use when calling
near.transaction() without arguments.Execution Behavior
string
default:"EXECUTED_OPTIMISTIC"
Controls how long
.send() waits before returning.object
Configuration for automatic retries on network errors.