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
Name | Type |
---|---|
config | NearConfig |
Defined in
Properties
accountCreator
Readonly
accountCreator: AccountCreator
Defined in
config
Readonly
config: any
Defined in
connection
Readonly
connection: Connection
Defined in
Methods
account
account(accountId
): Promise
<Account
>
Parameters
Name | Type | Description |
---|---|---|
accountId | string | near accountId used to interact with the network. |
Returns
Promise
<Account
>
Defined in
createAccount
createAccount(accountId
, publicKey
): Promise
<Account
>
Create an account using the AccountCreator. Either:
- using a masterAccount with LocalAccountCreator
- using the helperUrl with UrlAccountCreator
See
Parameters
Name | Type |
---|---|
accountId | string |
publicKey | PublicKey |
Returns
Promise
<Account
>