Connect to NEAR using the provided configuration.

ConnectConfig#networkId and ConnectConfig#nodeUrl are required.

To sign transactions you can also pass:

  1. ConnectConfig#keyStore
  2. ConnectConfig#keyPath
  3. ConnectConfig#deps.keyStore (deprecated, only for use in legacy applications)

If all three are passed they are prioritize in that order.

See

ConnectConfig

Example

async function initNear() {
const near = await connect({
networkId: 'testnet',
nodeUrl: 'https://rpc.testnet.near.org'
})
}

Index

Interfaces

Functions

Generated using TypeDoc