near-api-js 6.0.0
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.
- The latest release in the 6.0 line.
- Newest near-api-js: near-api-js 7.4.0
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:
- @near-js/[email protected]
- @near-js/[email protected]
- @near-js/[email protected]
- @near-js/[email protected]
- @near-js/[email protected]
- @near-js/[email protected]
- @near-js/[email protected]
- @near-js/[email protected]
- @near-js/[email protected]
- @near-js/[email protected]
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