-
#1877
eb345dfThanks @mikedotexe! - Replace Buffer usage with Uint8Array and Web Standard APIs (TextEncoder/TextDecoder, @scure/base) for CommonJS compatibility -
#1872
dd086d4Thanks @gagdiez! - Added a signer that knows how to use the legacy keystore -
#1877
eb345dfThanks @mikedotexe! - Replace secp256k1 native crypto dependency with @noble/curves/secp256k1, adapting to the v2 API (prehash option, signature byte ordering)
-
#1871
e35f223Thanks @gagdiez! - fix account creation error message -
#1886
381b240Thanks @gagdiez! - fix: decode transactions into the right types
-
#1822
8493b36Thanks @denbite! - Explicitly declare the return type ofAccount.signAndSendTransactionso it doesn't fallback toany -
#1819
e6f4db2Thanks @gagdiez! - Correctly expose the newActionsinterface, which simplify creating actions, and hide the oldActionclass, which needs a lot of manual work and is incredibly confusing. Importantly,Action(and its different instances) are still being exported as a type, to devs can figure out how to distinguis between differentActions. -
#1818
a82e47fThanks @denbite! - Attach finalizedblockHashto transaction created usingAccount.createTransactionto preventTransactionExpiredErrorerrors.Previously, transactions could be created with a
blockHashthat had not yet fully propagated across the network. In some cases, receiver RPC nodes were unable to look up the referenced block, resulting inTransactionExpiredErrorfailures (often due to a small propagation delay of a few milliseconds).
-
#1691
f8666a0Thanks @r-near! - UpdateparseNearAmountto only accept either a numeric string, or actual number, and not undefined, as well as throw error rather than silently returnnull -
#1691
f8666a0Thanks @r-near! - Rename stableviewValidatorsV2function back toviewValidators -
#1809
eee87c2Thanks @gagdiez! - Consolidate functionality of the@near-js/*packages into a single, tree-shakeablenear-api-jspackage -
#1805
9356419Thanks @denbite! - Remove no longer needed error utils likegetErrorTypeFromErrorMessage,parseRpcError,parseResultError, etc from the package as errors are now handled internally thanks to strongly typed RPC errors and end users can simply catch them in their application using specific error classes imported fromrpc-errorssub-path -
#1781
1caddf4Thanks @denbite! - ReplaceTypedErrorclass with a few specific errors created from fully type-safe RPC interfaces -
#1808
bf7c148Thanks @denbite! - RenameTypedContractback toContract -
#1669
683e1dbThanks @denbite! - Remove no longer maintained packages@near-js/iframe-rpc,@near-js/biometric-ed25519and@near-js/clientwith@near-js/cookbookexamples -
#1670
54e4d48Thanks @denbite! - Remove no longer maintained packages@near-js/keystores,@near-js/keystores-nodeand@near-js/keystores-browser -
#1673
5d86344Thanks @denbite! - Consolidate@near-js/*packages into a singlenear-api-jscodebase -
#1795
b96c604Thanks @denbite! - RenovateProvider.queryby removing the deprecated inline-argument overload and fully aligning the method with the nearcore RPC API spec.Previously supported (no longer works):
provider.query("view_account", JSON.stringify({ ... }));
New required usage (fully typed):
provider.query({ request_type: "view_account", ... });
Once
request_typeis specified, remaining parameters are inferred automatically by the IDE. -
#1668
20672fbThanks @denbite! - Remove deprecated functionality -
#1813
858783cThanks @gagdiez! - Renamed actionCreator helper object to simply "actions", and separated the helper addKey into addFullAccessKey and addFunctionCallKey -
#1589
5cfdab8Thanks @AlexKushnir1! - Refactor the abstract classSignerto implement every method, except forgetPublicKeyandsignBytes, which are intended for users
-
#1790
2f7a30dThanks @denbite! - Introduce many specific errors based on generated response types from OpenAPI spec and which are thrown when callingProvider.sendJsonRpcmethod -
#1798
a52592bThanks @gagdiez! - Added a new multi-key signer which handles multiples keys and transparently rotates them as users ask to sign transactions -
#1751
85f279eThanks @denbite! - Addnep413module that implementssignMessageandverifyMessagefunctions -
#1748
917cceaThanks @denbite! - MakeAccountto takeKeyPairStringas third parameter -
#1761
9d8799bThanks @denbite! - IntroduceteraToGasandgigaToGashelper functions to convertGasamounts conviniently -
#1761
fcbb1feThanks @denbite! - IntroduceyoctoToNearandnearToYoctohelper functions -
#1796
c2601e2Thanks @denbite! - Add a newProvider.viewGlobalContractCodemethod for retrieving global contract code using either acodeHash, or anaccountIdidentifier.Example usage:
provider.viewGlobalContractCode({ identifier: { accountId: "global_contract.near" }, }); provider.viewGlobalContractCode({ identifier: { codeHash: "J1arLz48fgXcGyCPVckFwLnewNH6j1uw79thsvwqGYTY" }, });
-
#1799
a7c3cd9Thanks @denbite! - AddparseSeedPhrasemethod, exported via theseed-phrasesub-path, which converts a string seed phrase into aKeyPair.For example:
import { parseSeedPhrase } from "near-api-js/seed-phrase"; const keyPair = parseSeedPhrase("tag interest match ..."); keyPair.getPublicKey().toString(); // ed25519:9uMmkWHW... keyPair.toString(); // ed25519:3N6TYZVRrkQxh...
-
#1747
493d9e5Thanks @denbite! - Add sub-path exports for "tokens", "tokens/mainnet" and "tokens/testnet" to improve tree-shaking -
#1794
7b6ff4fThanks @denbite! - Extend theAccountconstructor to accept an RPC URL string in addition to aProvider, making account instantiation simpler and more ergonomic.New supported usage:
new Account("user.near", "https://rpc.testnet.near.org");
Previously, users had to always manually create a provider:
const provider = new JsonRpcProvider({ url: "https://rpc.testnet.near.org" }); new Account("user.near", provider);
-
#1803
9f3e14dThanks @denbite! - Export strongly typed RPC error classes behind therpc-errorssub-path, for end users to reliably handle specific RPC failures.For example, end users can now catch action-level errors (e.g. when a transaction fails because the recipient account does not exist):
import { AccountDoesNotExistActionError } from "near-api-js/rpc-errors"; try { await account.transfer({ amount: nearToYocto(0.01), receiverId: "unexisted_account_111.testnet", }); } catch (error) { if (error instanceof AccountDoesNotExistActionError) { console.error( `Transaction ${error.txHash} failed because recipient ${error.accountId} does not exist!` ); } }
Or, RPC request validation and parsing errors can also be handled explicitly (e.g. when an invalid account ID format is included in a transaction):
import { RpcRequestParseError } from "near-api-js/rpc-errors"; try { await account.transfer({ amount: nearToYocto(0.001), receiverId: "account_name_that_fail_validation%.testnet", }); } catch (error) { if (error instanceof RpcRequestParseError) { // Failed parsing args: the value could not be decoded from borsh due to: // invalid value: "account_name_that_fail_validation%.testnet", // the Account ID contains an invalid character '%' at index 33 console.error(error.message); } }
Or, some requests may reference data that is no longer available or cannot be resolved by the node (e.g. querying a block that cannot be found):
import { UnknownBlockError } from "near-api-js/rpc-errors"; const unexistedBlockHeight = 1_000_000_000_000_000; try { await provider.viewBlock({ blockId: unexistedBlockHeight }); } catch (error) { if (error instanceof UnknownBlockError) { console.error( `Block at height ${unexistedBlockHeight} could not be found on the node!` ); } }
All exported errors ultimately extend the
RpcErrorbase class, so applications can also catch and handle any RPC-related error in a single place when fine-grained handling is not required:import { RpcError } from "near-api-js/rpc-errors"; try { await provider.viewAccessKey({ accountId: "user.testnet", publicKey: "ed25519:EaQnZxCMwh9yhkqW2XE2umd21iNmXep1BkM6Wtw2Qr1b", }); } catch (error) { if (error instanceof RpcError) { // Access key ed25519:EaQnZx... does not exist at block height ... console.error(error.message); } } try { await provider.viewAccessKey({ accountId: "user.testnet", publicKey: "ed25519:EaQnZxCMwh9yhkqW2XE2umd21iNmXep1BkM6Wtw2Qr1bxxxx", // invalid key here }); } catch (error) { if (error instanceof RpcError) { // Failed parsing args: invalid key length: expected the input of 32 bytes, but 33 was given console.error(error.message); } }
-
#1754
b3b2947Thanks @gagdiez! - Added optional signer argument to signing functions on account class -
#1793
ddceeabThanks @denbite! - Add concurrent transactions support by introducing nonce caching and automatic retries onInvalidNonceError.The following example that previously failed due to nonce collisions, now works reliably:
await Promise.all([ account.transfer({ amount: nearToYocto(1), receiverId: "user1.testnet", }), account.transfer({ amount: nearToYocto(2), receiverId: "user2.testnet", }), account.transfer({ amount: nearToYocto(3), receiverId: "user3.testnet", }), ]);
-
#1752
e6c61aeThanks @denbite! - Remove redundantnullargument fromProvider.viewValidatorsmethod -
#1691
f8666a0Thanks @r-near! - Add defaultEXECUTED_OPTIMISTICvalue towaitUntilargument ofviewTransactionStatusandviewTransactionStatusWithReceipts -
#1692
4ecebdeThanks @r-near! - feat: replace ESLint with Biome for linting -
#1762
c711103Thanks @denbite! - Speed up someAccountmethods by merging sequentialPromisesintoPromise.all()for slightly better performance -
#1693
26ed0cdThanks @denbite! - Enable TypeScriptstrictmode for better reliability -
#1774
741671bThanks @denbite! - ExtendProviderinterfaces using types generated fromnearcoreOpenAPI spec -
#1806
7d73ef1Thanks @denbite! - Handle HTTP 502 and 429 errors -
#1743
a1ea9aaThanks @denbite! - Switch to object args for public APIs across the package -
#1801
3e045feThanks @gagdiez! - Replaced some dependencies by internal functions -
#1720
1a41e6cThanks @denbite! - Use the most strictest checks intsconfig
- #1805
9356419Thanks @denbite! - Remove no longer needed error utils likegetErrorTypeFromErrorMessage,parseRpcError,parseResultError, etc from the package as errors are now handled internally thanks to strongly typed RPC errors and end users can simply catch them in their application using specific error classes imported fromrpc-errorssub-path
-
#1803
9f3e14dThanks @denbite! - Export strongly typed RPC error classes behind therpc-errorssub-path, for end users to reliably handle specific RPC failures.For example, end users can now catch action-level errors (e.g. when a transaction fails because the recipient account does not exist):
import { AccountDoesNotExistActionError } from "near-api-js/rpc-errors"; try { await account.transfer({ amount: nearToYocto(0.01), receiverId: "unexisted_account_111.testnet", }); } catch (error) { if (error instanceof AccountDoesNotExistActionError) { console.error( `Transaction ${error.txHash} failed because recipient ${error.accountId} does not exist!` ); } }
Or, RPC request validation and parsing errors can also be handled explicitly (e.g. when an invalid account ID format is included in a transaction):
import { RpcRequestParseError } from "near-api-js/rpc-errors"; try { await account.transfer({ amount: nearToYocto(0.001), receiverId: "account_name_that_fail_validation%.testnet", }); } catch (error) { if (error instanceof RpcRequestParseError) { // Failed parsing args: the value could not be decoded from borsh due to: // invalid value: "account_name_that_fail_validation%.testnet", // the Account ID contains an invalid character '%' at index 33 console.error(error.message); } }
Or, some requests may reference data that is no longer available or cannot be resolved by the node (e.g. querying a block that cannot be found):
import { UnknownBlockError } from "near-api-js/rpc-errors"; const unexistedBlockHeight = 1_000_000_000_000_000; try { await provider.viewBlock({ blockId: unexistedBlockHeight }); } catch (error) { if (error instanceof UnknownBlockError) { console.error( `Block at height ${unexistedBlockHeight} could not be found on the node!` ); } }
All exported errors ultimately extend the
RpcErrorbase class, so applications can also catch and handle any RPC-related error in a single place when fine-grained handling is not required:import { RpcError } from "near-api-js/rpc-errors"; try { await provider.viewAccessKey({ accountId: "user.testnet", publicKey: "ed25519:EaQnZxCMwh9yhkqW2XE2umd21iNmXep1BkM6Wtw2Qr1b", }); } catch (error) { if (error instanceof RpcError) { // Access key ed25519:EaQnZx... does not exist at block height ... console.error(error.message); } } try { await provider.viewAccessKey({ accountId: "user.testnet", publicKey: "ed25519:EaQnZxCMwh9yhkqW2XE2umd21iNmXep1BkM6Wtw2Qr1bxxxx", // invalid key here }); } catch (error) { if (error instanceof RpcError) { // Failed parsing args: invalid key length: expected the input of 32 bytes, but 33 was given console.error(error.message); } }
-
#1799
a7c3cd9Thanks @denbite! - AddparseSeedPhrasemethod, exported via theseed-phrasesub-path, which converts a string seed phrase into aKeyPair.For example:
import { parseSeedPhrase } from "near-api-js/seed-phrase"; const keyPair = parseSeedPhrase("tag interest match ..."); keyPair.getPublicKey().toString(); // ed25519:9uMmkWHW... keyPair.toString(); // ed25519:3N6TYZVRrkQxh...
-
#1781
1caddf4Thanks @denbite! - ReplaceTypedErrorclass with a few specific errors created from fully type-safe RPC interfaces -
#1795
b96c604Thanks @denbite! - RenovateProvider.queryby removing the deprecated inline-argument overload and fully aligning the method with the nearcore RPC API spec.Previously supported (no longer works):
provider.query("view_account", JSON.stringify({ ... }));
New required usage (fully typed):
provider.query({ request_type: "view_account", ... });
Once
request_typeis specified, remaining parameters are inferred automatically by the IDE.
-
#1790
2f7a30dThanks @denbite! - Introduce many specific errors based on generated response types from OpenAPI spec and which are thrown when callingProvider.sendJsonRpcmethod -
#1798
a52592bThanks @gagdiez! - Added a new multi-key signer which handles multiples keys and transparently rotates them as users ask to sign transactions -
#1796
c2601e2Thanks @denbite! - Add a newProvider.viewGlobalContractCodemethod for retrieving global contract code using either acodeHash, or anaccountIdidentifier.Example usage:
provider.viewGlobalContractCode({ identifier: { accountId: "global_contract.near" }, }); provider.viewGlobalContractCode({ identifier: { codeHash: "J1arLz48fgXcGyCPVckFwLnewNH6j1uw79thsvwqGYTY" }, });
-
#1794
7b6ff4fThanks @denbite! - Extend theAccountconstructor to accept an RPC URL string in addition to aProvider, making account instantiation simpler and more ergonomic.New supported usage:
new Account("user.near", "https://rpc.testnet.near.org");
Previously, users had to always manually create a provider:
const provider = new JsonRpcProvider({ url: "https://rpc.testnet.near.org" }); new Account("user.near", provider);
-
#1793
ddceeabThanks @denbite! - Add concurrent transactions support by introducing nonce caching and automatic retries onInvalidNonceError.The following example that previously failed due to nonce collisions, now works reliably:
await Promise.all([ account.transfer({ amount: nearToYocto(1), receiverId: "user1.testnet", }), account.transfer({ amount: nearToYocto(2), receiverId: "user2.testnet", }), account.transfer({ amount: nearToYocto(3), receiverId: "user3.testnet", }), ]);
- #1774
741671bThanks @denbite! - ExtendProviderinterfaces using types generated fromnearcoreOpenAPI spec
-
#1761
9d8799bThanks @denbite! - IntroduceteraToGasandgigaToGashelper functions to convertGasamounts conviniently -
#1761
fcbb1feThanks @denbite! - IntroduceyoctoToNearandnearToYoctohelper functions
-
#1762
c711103Thanks @denbite! - Speed up someAccountmethods by merging sequentialPromisesintoPromise.all()for slightly better performance
-
#1691
f8666a0Thanks @r-near! - UpdateparseNearAmountto only accept either a numeric string, or actual number, and not undefined, as well as throw error rather than silently returnnull -
#1691
f8666a0Thanks @r-near! - Rename stableviewValidatorsV2function back toviewValidators -
#1672
eee87c2Thanks @github-actions! - Consolidate functionality of the@near-js/*packages into a single, tree-shakeablenear-api-jspackage -
#1669
683e1dbThanks @denbite! - Remove no longer maintained packages@near-js/iframe-rpc,@near-js/biometric-ed25519and@near-js/clientwith@near-js/cookbookexamples -
#1670
54e4d48Thanks @denbite! - Remove no longer maintained packages@near-js/keystores,@near-js/keystores-nodeand@near-js/keystores-browser -
#1673
5d86344Thanks @denbite! - Consolidate@near-js/*packages into a singlenear-api-jscodebase -
#1668
20672fbThanks @denbite! - Remove deprecated functionality -
#1589
5cfdab8Thanks @AlexKushnir1! - Refactor the abstract classSignerto implement every method, except forgetPublicKeyandsignBytes, which are intended for users
-
#1751
85f279eThanks @denbite! - Addnep413module that implementssignMessageandverifyMessagefunctions -
#1748
917cceaThanks @denbite! - MakeAccountto takeKeyPairStringas third parameter -
#1747
493d9e5Thanks @denbite! - Add sub-path exports for "tokens", "tokens/mainnet" and "tokens/testnet" to improve tree-shaking -
#1754
b3b2947Thanks @gagdiez! - Added optional signer argument to signing functions on account class
-
#1752
e6c61aeThanks @denbite! - Remove redundantnullargument fromProvider.viewValidatorsmethod -
#1691
f8666a0Thanks @r-near! - Add defaultEXECUTED_OPTIMISTICvalue towaitUntilargument ofviewTransactionStatusandviewTransactionStatusWithReceipts -
#1692
4ecebdeThanks @r-near! - feat: replace ESLint with Biome for linting -
#1693
26ed0cdThanks @denbite! - Enable TypeScriptstrictmode for better reliability -
#1743
a1ea9aaThanks @denbite! - Switch to object args for public APIs across the package -
#1720
1a41e6cThanks @denbite! - Use the most strictest checks intsconfig
-
#1662
aad9fd6Thanks @denbite! - Add duplicate ofkeyToImplicitAddressto@near-js/cryptoto prevent cycle dependency between packages -
#1663
8e9a81bThanks @denbite! - Remove a redundantassertcall in@near-js/providers -
#1661
5375dccThanks @denbite! - Add@near-js/keystoresas dependency to@near-js/accounts, not as dev-dep -
Updated dependencies [
aad9fd6,8e9a81b,5375dcc]:- @near-js/crypto@2.5.1
- @near-js/utils@2.5.1
- @near-js/providers@2.5.1
- @near-js/accounts@2.5.1
- @near-js/keystores@2.5.1
- @near-js/keystores-browser@2.5.1
- @near-js/keystores-node@2.5.1
- @near-js/signers@2.5.1
- @near-js/transactions@2.5.1
- @near-js/types@2.5.1
- #1659
d4d33b9Thanks @denbite! - AddviewValidatorsV2method toProviderthat allows to query data using eitherepoch_id, orblock_id
- Updated dependencies [
d4d33b9]:- @near-js/providers@2.5.0
- @near-js/accounts@2.5.0
- @near-js/crypto@2.5.0
- @near-js/keystores@2.5.0
- @near-js/keystores-browser@2.5.0
- @near-js/keystores-node@2.5.0
- @near-js/signers@2.5.0
- @near-js/transactions@2.5.0
- @near-js/types@2.5.0
- @near-js/utils@2.5.0
-
#1654
e10be3dThanks @denbite! - Bring backInMemorySignerto maintain backward compatibility for legacy projects -
#1652
18a696bThanks @denbite! - Extend input type forformatNearAmountfunction -
Updated dependencies [
e10be3d,fdb29a2,18a696b]:- @near-js/accounts@2.4.1
- @near-js/signers@2.4.1
- @near-js/crypto@2.4.1
- @near-js/utils@2.4.1
- @near-js/keystores@2.4.1
- @near-js/keystores-browser@2.4.1
- @near-js/keystores-node@2.4.1
- @near-js/providers@2.4.1
- @near-js/transactions@2.4.1
- @near-js/types@2.4.1
- #1648
dc7f602Thanks @denbite! - AllowUint8Arrayas args input forcallFunctionRawandcallFunction
- Updated dependencies [
dc7f602]:- @near-js/providers@2.4.0
- @near-js/accounts@2.4.0
- @near-js/crypto@2.4.0
- @near-js/keystores@2.4.0
- @near-js/keystores-browser@2.4.0
- @near-js/keystores-node@2.4.0
- @near-js/signers@2.4.0
- @near-js/transactions@2.4.0
- @near-js/types@2.4.0
- @near-js/utils@2.4.0
-
#1640
706a5ddThanks @denbite! - Respectnullas a valid result of method ofFailoverRpcProvider -
Updated dependencies [
706a5dd]:- @near-js/providers@2.3.4
- @near-js/accounts@2.3.4
- @near-js/crypto@2.3.4
- @near-js/keystores@2.3.4
- @near-js/keystores-browser@2.3.4
- @near-js/keystores-node@2.3.4
- @near-js/signers@2.3.4
- @near-js/transactions@2.3.4
- @near-js/types@2.3.4
- @near-js/utils@2.3.4
-
#1621
0a99da4Thanks @denbite! - Add deprecation annotations and warnings to functions/classes that will be removed in the next major release -
Updated dependencies [
0bef0bd,0a99da4]:- @near-js/accounts@2.3.0
- @near-js/types@2.3.0
- @near-js/utils@2.3.0
- @near-js/crypto@2.3.0
- @near-js/keystores@2.3.0
- @near-js/keystores-browser@2.3.0
- @near-js/keystores-node@2.3.0
- @near-js/providers@2.3.0
- @near-js/signers@2.3.0
- @near-js/transactions@2.3.0
-
#1620
0ce235dThanks @denbite! - Useoptimisticfinality as default one for RPC queries made fromAccount -
Updated dependencies [
0ce235d]:- @near-js/accounts@2.2.6
- @near-js/crypto@2.2.6
- @near-js/keystores@2.2.6
- @near-js/keystores-browser@2.2.6
- @near-js/keystores-node@2.2.6
- @near-js/providers@2.2.6
- @near-js/signers@2.2.6
- @near-js/transactions@2.2.6
- @near-js/types@2.2.6
- @near-js/utils@2.2.6
-
#1613
b78f334Thanks @denbite! - Provide default value{}for headers asconnection.headerscould beundefinedin some cases -
#1613
e8a01e9Thanks @denbite! - Update interfaces ofJsonRpcProviderandFailoverRpcProviderto be aligned withProvider -
#1613
d399fe5Thanks @denbite! - Make parameter type of functionProvider.gasPricenullable (to be aligned with actual implemention inJsonRpcProvider) -
Updated dependencies [
b78f334,e8a01e9,d399fe5]:- @near-js/providers@2.2.5
- @near-js/accounts@2.2.5
- @near-js/crypto@2.2.5
- @near-js/keystores@2.2.5
- @near-js/keystores-browser@2.2.5
- @near-js/keystores-node@2.2.5
- @near-js/signers@2.2.5
- @near-js/transactions@2.2.5
- @near-js/types@2.2.5
- @near-js/utils@2.2.5
-
#1611
30403a7Thanks @denbite! - AddsignedDelegatetoClassicActionsschema to align the indices ofdeployGlobalContractanduseGlobalContractactions -
Updated dependencies [
30403a7]:- @near-js/transactions@2.2.4
- @near-js/accounts@2.2.4
- @near-js/crypto@2.2.4
- @near-js/keystores@2.2.4
- @near-js/keystores-browser@2.2.4
- @near-js/keystores-node@2.2.4
- @near-js/providers@2.2.4
- @near-js/signers@2.2.4
- @near-js/types@2.2.4
- @near-js/utils@2.2.4
-
#1604
edcadb6Thanks @denbite! - Added generic type forProvider.callFunctionto allow client explicitly specify expected return type -
#1604
4f89a24Thanks @denbite! - Added generic type forAccount.callFunctionto allow client explicitly specify expected return type -
Updated dependencies [
edcadb6,4f89a24]:- @near-js/providers@2.2.3
- @near-js/accounts@2.2.3
- @near-js/crypto@2.2.3
- @near-js/keystores@2.2.3
- @near-js/keystores-browser@2.2.3
- @near-js/keystores-node@2.2.3
- @near-js/signers@2.2.3
- @near-js/transactions@2.2.3
- @near-js/types@2.2.3
- @near-js/utils@2.2.3
-
#1602
3cd7545Thanks @Elabar! - Fix meta transaction is not signing correctly -
Updated dependencies [
3cd7545]:- @near-js/signers@2.2.2
- @near-js/accounts@2.2.2
- @near-js/crypto@2.2.2
- @near-js/keystores@2.2.2
- @near-js/keystores-browser@2.2.2
- @near-js/keystores-node@2.2.2
- @near-js/providers@2.2.2
- @near-js/transactions@2.2.2
- @near-js/types@2.2.2
- @near-js/utils@2.2.2
- #1595
55667ebThanks @denbite! - AddAccount.callFunctionRawmethod that returns raw transaction outcome
-
#1591
bfc969aThanks @denbite! - Migrate to building withtsupfornear-api-js -
Updated dependencies [
e368604,55667eb]:- @near-js/accounts@2.2.0
- @near-js/crypto@2.2.0
- @near-js/keystores@2.2.0
- @near-js/keystores-browser@2.2.0
- @near-js/keystores-node@2.2.0
- @near-js/providers@2.2.0
- @near-js/signers@2.2.0
- @near-js/transactions@2.2.0
- @near-js/types@2.2.0
- @near-js/utils@2.2.0
- Updated dependencies [
46e5d4e,fec4678,ff2f6ea,c511649,99f3486,34df601,af571dc]:- @near-js/accounts@2.1.0
- @near-js/keystores-browser@2.1.0
- @near-js/keystores-node@2.1.0
- @near-js/transactions@2.1.0
- @near-js/keystores@2.1.0
- @near-js/providers@2.1.0
- @near-js/signers@2.1.0
- @near-js/crypto@2.1.0
- @near-js/types@2.1.0
- @near-js/utils@2.1.0
-
#1556
4971e77Thanks @denbite! - RenamecreateTopLevelAccountback tocreateAccountfor the sake of better naming -
#1560
3349d4bThanks @denbite! - Fix the bug withft_balance_ofalways returningundefinedfor FungibleToken -
Updated dependencies [
4971e77,59d3dc9]:- @near-js/accounts@2.0.2
- @near-js/crypto@2.0.2
- @near-js/keystores-browser@2.0.2
- @near-js/keystores-node@2.0.2
- @near-js/keystores@2.0.2
- @near-js/providers@2.0.2
- @near-js/signers@2.0.2
- @near-js/transactions@2.0.2
- @near-js/types@2.0.2
- @near-js/utils@2.0.2
-
#1554
13f93ebThanks @denbite! - Redeploy recent release as patch -
Updated dependencies [
13f93eb]:- @near-js/accounts@2.0.1
- @near-js/crypto@2.0.1
- @near-js/keystores@2.0.1
- @near-js/keystores-browser@2.0.1
- @near-js/keystores-node@2.0.1
- @near-js/providers@2.0.1
- @near-js/signers@2.0.1
- @near-js/transactions@2.0.1
- @near-js/types@2.0.1
- @near-js/utils@2.0.1
Packages are now truly independent and can be imported separately. We strongly encourage users to use the modularized packages instead of the monolithic near-api-js package.
-
Accounthas received major changes to its interface, we recommend reading theCHANGELOGfor the@near-js/accountspackage -
Signerclass has received major changes to its interface, we recommend reading theCHANGELOGfor the@near-js/signerspackage -
Connectionhas been deprecated, as it is no longer used by theAccountclass -
A new package
@near-js/tokenshas been added, which allows to work with tokens on the NEAR blockchain. This includes the Native NEAR, Fungible Tokens and Non-Fungible Tokens. -
#1513
a8e1046Thanks @denbite! - Major update for Signer and Account APIs to streamline development
- Updated dependencies [
a8e1046]:- @near-js/transactions@2.0.0
- @near-js/providers@2.0.0
- @near-js/accounts@2.0.0
- @near-js/signers@2.0.0
- @near-js/types@2.0.0
- @near-js/crypto@2.0.0
- @near-js/keystores@2.0.0
- @near-js/keystores-browser@2.0.0
- @near-js/keystores-node@2.0.0
- @near-js/utils@2.0.0
- Updated dependencies [
e408cfc,9cb5f56]:- @near-js/providers@1.0.3
- @near-js/transactions@1.3.3
- @near-js/accounts@1.4.1
- @near-js/wallet-account@1.3.3
- Updated dependencies [
ef530cf6,c85d12d3]:- @near-js/accounts@1.4.0
- @near-js/providers@1.0.2
- @near-js/utils@1.1.0
- @near-js/wallet-account@1.3.2
- @near-js/crypto@1.4.2
- @near-js/transactions@1.3.2
- @near-js/keystores@0.2.2
- @near-js/keystores-browser@0.2.2
- @near-js/keystores-node@0.1.2
- @near-js/signers@0.2.2
- Updated dependencies [
5b0bbbc1]:- @near-js/crypto@1.4.1
- @near-js/providers@1.0.1
- @near-js/types@0.3.1
- @near-js/utils@1.0.1
- @near-js/accounts@1.3.1
- @near-js/keystores@0.2.1
- @near-js/keystores-browser@0.2.1
- @near-js/keystores-node@0.1.1
- @near-js/signers@0.2.1
- @near-js/transactions@1.3.1
- @near-js/wallet-account@1.3.1
-
#1353
73690557Thanks @andy-haynes! - Update to Node.js 20 LTS & pnpm 9.4, modularize packages, simplify dependencies, and update testsBreaking Changes
-
near-api-js@5.0.0- The following functions are no longer exported:
logWarningfetchJson- the unnamed wrapped
fetchfunction exported fromsetup-node-fetch.ts
- The browser bundle is no longer being built in version 5; for browser support please use modules
- The following functions are no longer exported:
-
@near-js/providers@1.0.0- The following functions are no longer exported:
fetchJson
- The following functions are no longer exported:
-
@near-js/utils@1.0.0- The following functions are no longer exported:
logWarning
- The following functions are no longer exported:
-
- Updated dependencies [
73690557]:- @near-js/accounts@1.3.0
- @near-js/crypto@1.4.0
- @near-js/keystores@0.2.0
- @near-js/keystores-browser@0.2.0
- @near-js/keystores-node@0.1.0
- @near-js/providers@1.0.0
- @near-js/signers@0.2.0
- @near-js/transactions@1.3.0
- @near-js/types@0.3.0
- @near-js/utils@1.0.0
- @near-js/wallet-account@1.3.0
-
Updated dependencies [
9c7db11c,bad95007,7d5a8244]:- @near-js/keystores@0.1.0
- @near-js/keystores-browser@0.1.0
- @near-js/utils@0.3.0
- @near-js/crypto@1.3.0
- @near-js/accounts@1.2.2
- @near-js/signers@0.1.5
- @near-js/transactions@1.2.3
- @near-js/wallet-account@1.2.3
- @near-js/keystores-node@0.0.13
- @near-js/providers@0.2.3
- Updated dependencies [
ecdf1741,92a6f5be]:- @near-js/providers@0.2.2
- @near-js/types@0.2.1
- @near-js/accounts@1.2.1
- @near-js/wallet-account@1.2.2
- @near-js/crypto@1.2.4
- @near-js/keystores@0.0.12
- @near-js/transactions@1.2.2
- @near-js/utils@0.2.2
- @near-js/keystores-browser@0.0.12
- @near-js/keystores-node@0.0.12
- @near-js/signers@0.1.4
- Updated dependencies [
06baa81d]:- @near-js/accounts@1.2.0
- @near-js/types@0.2.0
- @near-js/wallet-account@1.2.1
- @near-js/crypto@1.2.3
- @near-js/keystores@0.0.11
- @near-js/providers@0.2.1
- @near-js/transactions@1.2.1
- @near-js/utils@0.2.1
- @near-js/keystores-browser@0.0.11
- @near-js/keystores-node@0.0.11
- @near-js/signers@0.1.3
-
#1292
f739324bThanks @gtsonevv! - replace ajv with is-my-json-valid -
Updated dependencies [
9060b781,cc401a6c,3f363113,f739324b]:- @near-js/accounts@1.1.0
- @near-js/transactions@1.2.0
- @near-js/types@0.1.0
- @near-js/utils@0.2.0
- @near-js/crypto@1.2.2
- @near-js/providers@0.2.0
- @near-js/wallet-account@1.2.0
- @near-js/keystores@0.0.10
- @near-js/keystores-browser@0.0.10
- @near-js/keystores-node@0.0.10
- @near-js/signers@0.1.2
- Updated dependencies [
42dc7e2a]:- @near-js/transactions@1.1.2
- @near-js/accounts@1.0.4
- @near-js/providers@0.1.1
- @near-js/wallet-account@1.1.1
- Updated dependencies [
662cc13d,c4655576,15885dd1]:- @near-js/providers@0.1.0
- @near-js/utils@0.1.0
- @near-js/crypto@1.2.1
- @near-js/wallet-account@1.1.0
- @near-js/accounts@1.0.3
- @near-js/transactions@1.1.1
- @near-js/keystores@0.0.9
- @near-js/keystores-browser@0.0.9
- @near-js/keystores-node@0.0.9
- @near-js/signers@0.1.1
- Updated dependencies [
1900c490,c6cdc8c7]:- @near-js/crypto@1.2.0
- @near-js/signers@0.1.0
- @near-js/transactions@1.1.0
- @near-js/accounts@1.0.2
- @near-js/keystores@0.0.8
- @near-js/keystores-browser@0.0.8
- @near-js/keystores-node@0.0.8
- @near-js/wallet-account@1.0.2
- @near-js/providers@0.0.10
- Updated dependencies [
aeeb1502]:- @near-js/crypto@1.1.0
- @near-js/accounts@1.0.1
- @near-js/keystores@0.0.7
- @near-js/keystores-browser@0.0.7
- @near-js/keystores-node@0.0.7
- @near-js/signers@0.0.7
- @near-js/transactions@1.0.1
- @near-js/wallet-account@1.0.1
- @near-js/providers@0.0.9
- #1215
ecf29e2dThanks @denbite! - Internal logging library with capabilities for integration with modern logging libraries like Pino, Winston, etc
-
#1195
695220e7Thanks @ShaunSHamilton! - add check for global 'process' object -
#1209
cdd8d1c8Thanks @gtsonevv! - Replace tweetnacl by @noble/curves -
#1194
038b9b9fThanks @andrew-scott-fischer! - fixes override of global fetch property -
Updated dependencies [
0f764ee0,695220e7,0be6c420,ecf29e2d,61349aec,cdd8d1c8,038b9b9f]:- @near-js/accounts@1.0.0
- @near-js/providers@0.0.8
- @near-js/utils@0.0.5
- @near-js/wallet-account@1.0.0
- @near-js/crypto@1.0.0
- @near-js/transactions@1.0.0
- @near-js/keystores@0.0.6
- @near-js/keystores-browser@0.0.6
- @near-js/keystores-node@0.0.6
- @near-js/signers@0.0.6
- Updated dependencies [
40fa6465]:- @near-js/crypto@0.0.5
- @near-js/accounts@0.1.4
- @near-js/keystores@0.0.5
- @near-js/keystores-browser@0.0.5
- @near-js/keystores-node@0.0.5
- @near-js/signers@0.0.5
- @near-js/transactions@0.2.1
- @near-js/wallet-account@0.0.7
- @near-js/providers@0.0.7
-
#1128
e21ff896Thanks @andy-haynes! - Compatibility shim for NearSocial/VM -
Updated dependencies [
e21ff896,00b4d2ba]:- @near-js/transactions@0.2.0
- @near-js/accounts@0.1.3
- @near-js/providers@0.0.6
- @near-js/wallet-account@0.0.6
-
#1124
c1dcf3b8Thanks @andy-haynes! - Allow use of legacydeps.keyStorepath in NearConfig -
Updated dependencies [
bf81ddc1,c1dcf3b8]:- @near-js/types@0.0.4
- @near-js/wallet-account@0.0.5
- @near-js/accounts@0.1.2
- @near-js/crypto@0.0.4
- @near-js/keystores@0.0.4
- @near-js/providers@0.0.5
- @near-js/transactions@0.1.1
- @near-js/utils@0.0.4
- @near-js/keystores-browser@0.0.4
- @near-js/keystores-node@0.0.4
- @near-js/signers@0.0.4
- Updated dependencies [
d6d53ab1]:- @near-js/providers@0.0.4
- @near-js/accounts@0.1.1
- @near-js/wallet-account@0.0.4
- #1103
b713ae78Thanks @austinabell! - Implement light client block retrieval and relevant types
-
#1106
bc53c32cThanks @austinabell! - Adds missing timestamp_nanosec field to light client proof header -
Updated dependencies [
b713ae78,bc53c32c,b7b6c6a1,d97d2a6e,4704ee77,8c6bf391]:- @near-js/providers@0.0.3
- @near-js/types@0.0.3
- @near-js/accounts@0.1.0
- @near-js/transactions@0.1.0
- @near-js/crypto@0.0.3
- @near-js/keystores@0.0.3
- @near-js/utils@0.0.3
- @near-js/wallet-account@0.0.3
- @near-js/keystores-browser@0.0.3
- @near-js/keystores-node@0.0.3
- @near-js/signers@0.0.3
- #1093
94311587Thanks @andy-haynes! - Publish repackaging
- Updated dependencies [
ca458cac]:- @near-js/accounts@0.0.2
- @near-js/crypto@0.0.2
- @near-js/keystores@0.0.2
- @near-js/keystores-browser@0.0.2
- @near-js/keystores-node@0.0.2
- @near-js/providers@0.0.2
- @near-js/signers@0.0.2
- @near-js/transactions@0.0.2
- @near-js/types@0.0.2
- @near-js/utils@0.0.2
- @near-js/wallet-account@0.0.2
- #1089
c1ffd501Thanks @andy-haynes! - CI update
- #1087
4f9e3d4dThanks @andy-haynes! - Use new packages in @near-js/biometric-ed25519
-
#1006
8ee564c0Thanks @morgsmccauley! - MakeAccount.signAndSendTransactionpublicso transactions can be sent directly fromAccountinstances -
#1014
8feb1997Thanks @esaminu! - MakeappKeyPrefixa required arg toWalletConnectionconstructorUsers that were doing
new WalletConnection(near);
will now have to do
new WalletConnection(near, "undefined");
If they want to access the keys they had potentially accumulated
-
#935
c740afc8Thanks @hcho112! -account.viewFunctionnow takes a single object argument rather than individual args. Callsites will now need to be updated like so:-await account.viewFunction( - 'wrap.near', - 'storage_balance_of', - { account_id: 'example.near' } -); +await account.viewFunction({ + contractId: 'wrap.near', + methodName: 'storage_balance_of', + args: { account_id: 'example.near' }, +});
-
#1056
b823ada7Thanks @andy-haynes! - Major functionality in near-api-js has now been broken up into packages under @near-jsBreaking changes:
KeyPairEd25519no longer supports thefromStringstatic method. This method is now only available on theKeyPairclass.
-
#1003
726b7953Thanks @marcinbodnar! - Fix error types. WIth this changes bothJsonRpcProvider.queryandJsonRpcProvider.sendJsonRpcmethods will return proper error type for these errors:AccountDoesNotExist,AccessKeyDoesNotExist,CodeDoesNotExist,InvalidNonce.An additional fix to
getErrorTypeFromErrorMessagefunction. NowgetErrorTypeFromErrorMessagewill not change error type if it already exists.
- #1007
fff4b44dThanks @morgsmccauley! - IntroducegetActiveDelegatedStakeBalanceto return delegated stake balance of an account
- #1007
fff4b44dThanks @morgsmccauley! - Removed unused variables and dependencies.