Skip to content

near-api-js v6.0.1

Compare
Choose a tag to compare
@gagdiez gagdiez released this 21 May 18:29
· 114 commits to master since this release
e931d6c

Changes

Modularity

Packages are now truly independent and can be imported separately both in esm and cjs projects. We strongly encourage users to use the modularized packages instead of the monolithic near-api-js package.

All subpackages now share the same version number to avoid confusion on compatibilities:

Changes on Relevant packages

Provider

Provider now contains new functions to access the most common RPC methods (e.g. functionCall was not present in v5) - changelog

Account

Account has received major changes to its interface. We added functions to create Transactions (before you could only get signed Transactions), create meta Transactions, etc.

We also removed the need to have a signer when instantiating an account.

Please check the @near-js/accounts CHANGELOG

Connection

Connection has been deprecated, as it is no longer used by the Account class

Signer

The Signer class was completely overwritten, as the previous one was closer to a Key Managment system than a simple signer. Now signers limit themselves to sign transactions, meta transactions and nep413 messages - @near-js/signers CHANGELOG

Tokens

A new package @near-js/tokens has been added, which allows to work with tokens on the NEAR blockchain. This includes the Native NEAR, Fungible Tokens and Non-Fungible Tokens.

Tokens know how to getBalance of a user, make a transfer to other users, and even convert between units and decimal numbers


PR With All Changes

  • #1513 a8e1046 Thanks @denbite! - Major update for Signer and Account APIs to streamline development