Skip to main content
Version: near-api-js@1.1.0

Class: Near

near.Near

This is the main class developers should use to interact with NEAR.

Example

const near = new Near(config);

Constructors

constructor

new Near(config)

Parameters

NameType
configNearConfig

Defined in

near.ts:84

Properties

accountCreator

Readonly accountCreator: AccountCreator

Defined in

near.ts:82


config

Readonly config: any

Defined in

near.ts:80


connection

Readonly connection: Connection

Defined in

near.ts:81

Methods

account

account(accountId): Promise<Account>

Parameters

NameTypeDescription
accountIdstringnear accountId used to interact with the network.

Returns

Promise<Account>

Defined in

near.ts:108


createAccount

createAccount(accountId, publicKey): Promise<Account>

Create an account using the AccountCreator. Either:

See

masterAccount and helperUrl

Parameters

NameType
accountIdstring
publicKeyPublicKey

Returns

Promise<Account>

Defined in

near.ts:122