Skip to content
by Unity Nodes
near-api-jsPre-release

near-api-js 2.0.0

[email protected]github.com

#1006 8ee564c0 Thanks @morgsmccauley! - Make Account.signAndSendTransaction public so transactions can be sent directly from Account instances; #1014 8feb1997 Thanks @esaminu! - Make appKeyPrefix a required arg to…

Major Changes

  • #1006 8ee564c0 Thanks @morgsmccauley! - Make Account.signAndSendTransaction public so transactions can be sent directly from Account instances

  • #1014 8feb1997 Thanks @esaminu! - Make appKeyPrefix a required arg to WalletConnection constructor

    Users 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 c740afc8 Thanks @hcho112! - account.viewFunction now 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 b823ada7 Thanks @andy-haynes! - Major functionality in near-api-js has now been broken up into packages under @near-js

    Breaking changes:

    • KeyPairEd25519 no longer supports the fromString static method. This method is now only available on the KeyPair class.

Minor Changes

Patch Changes

  • #1003 726b7953 Thanks @marcinbodnar! - Fix error types. WIth this changes both JsonRpcProvider.query and JsonRpcProvider.sendJsonRpc methods will return proper error type for these errors: AccountDoesNotExist, AccessKeyDoesNotExist, CodeDoesNotExist, InvalidNonce.

    An additional fix to getErrorTypeFromErrorMessage function. Now getErrorTypeFromErrorMessage will not change error type if it already exists.

@near-js/[email protected]

Patch Changes

@near-js/[email protected]

Patch Changes