Skip to content

Latest commit

 

History

History
509 lines (299 loc) · 22.9 KB

CHANGELOG.md

File metadata and controls

509 lines (299 loc) · 22.9 KB

@moralisweb3/api-utils

2.8.2

Patch Changes

  • Updated dependencies [0cefcef6, 0cefcef6]:
    • @moralisweb3/common-evm-utils@2.8.2
    • @moralisweb3/common-core@2.8.2

2.8.1

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/common-core@2.8.1
    • @moralisweb3/common-evm-utils@2.8.1

2.8.0

Minor Changes

  • #777 f1336a35 Thanks @ErnoW! - Move @moralisweb3/core package to @moralisweb3/common-core
  • #846 1374573d Thanks @ErnoW! - # Api responses (breaking change)

    For any api call, you get a resultAdapter response. The value of the toJSON() value has changed. Now it is the same value as .raw. Previously this caused a lot of confusion, and as both return a json. The value of this method has changed. So if you used .toJSON() on an api result you can:

    • Use .result, this will probably contain dataTypes with lots of utility functions. If you only care about the data, you can call .format() or .toJSON() on this datatype. This is the prefered way as it provides you wilt additional utilites and extra properties. We suggest you to use Typescript, to easily see the available properties/methods on these datatypes.
    • Or. use the new values (or values from .raw), these values are identical as they are provided by the internal api, without any data transformation. The types might be different than before, so please check this (we suggest to use Typescript, as all responses are typed, otherwise you can log the output and see any differences)

    Package name changes (deprecated, upcomming breaking change)

    If you're using some of our internal packages @moralisweb3/core for example then these names have been changed to differentiate between server-side packages, and packages that are compatible with client-side and server-side. We name these common-*. This is a first step to provide better client-side support:

    Migration guide

    • @moralisweb3/core -> @moralisweb3/common-core
    • @moralisweb3/evm-utils -> @moralisweb3/common-evm-utils
    • @moralisweb3/sol-utils -> @moralisweb3/common-sol-utils

    Change your dependencies in package.json and the corresponding imports in your code to the new names.

    For the time being, the old packages will remain, and we use them to forward to the common-* package, this will be removed in a future version, so please update to the new package name.

    NextJs package

    For easy integration we created a nextJs package. See packages/next. This contains:

    • hooks to all api endpoints
    • adapter to integrate into NextJs authentication via Moralis Auth

    For a demo check out demos/nextjs

    Operation types

    The parameters and return types are now exported for every api operation. These are exported from

    • moralis/common-evm-utils for evm api methods
    • moralis/common-sol-utils for sol api methods
    • moralis/common-auth-utils for auth methods
    • moralis/common-streams-utils for streams methods

    For example:

    import Moralis from 'moralis';
    import { GetContractNFTsRequest, EvmChain, GetContractNFTsResponse } from 'moralis/common-evm-utils';
    
    const getBlockOptions: GetContractNFTsRequest = {
      address: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
      chain: EvmChain.ETHEREUM,
    };
    
    let result: GetContractNFTsResponse;
    
    const response = await Moralis.EvmApi.nft.getContractNFTs(getBlockOptions);
    result = response.result;

    Dataytypes support in client-side projects

    As a first step to provide better client-side support, all datatypes are now usable in server-side and client-side.

Patch Changes

  • Updated dependencies [f1336a35, 62036ef3, 1374573d]:
    • @moralisweb3/common-core@2.8.0
    • @moralisweb3/common-evm-utils@2.8.0

2.7.4

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.7.4

2.7.3

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.7.3

2.7.2

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.7.2

2.7.1

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.7.1

2.7.0

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.7.0

2.6.7

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.6.7

2.6.6

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.6.6

2.6.5

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.6.5

2.6.4

Patch Changes

  • #733 77eb29bf Thanks @ErnoW! - Sent body in delete requests. This fixes issues with Moralis.Streams.deleteAddress

  • Updated dependencies [77eb29bf]:

    • @moralisweb3/core@2.6.4

2.6.3

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.6.3

2.6.2

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.6.2

2.6.1

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.6.1

2.6.0

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.6.0

2.5.8

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.5.8

2.5.7

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.5.7

2.5.6

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.5.6

2.5.5

Patch Changes

  • Updated dependencies [d79800ad]:
    • @moralisweb3/core@2.5.5

2.5.4

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.5.4

2.5.3

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.5.3

2.5.2

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.5.2

2.5.1

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.5.1

2.5.0

Patch Changes

  • Updated dependencies [c719cc2f]:
    • @moralisweb3/core@2.5.0

2.4.0

Minor Changes

  • #658 7fffd1e4 Thanks @sogunshola! - Intergrating stream API in code base, creating a new package @moralisweb3/streams

Patch Changes

  • Updated dependencies [7fffd1e4]:
    • @moralisweb3/core@2.4.0

2.3.1

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.3.1

2.3.0

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.3.0

2.2.0

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.2.0

2.1.1

Patch Changes

  • #619 5bfb635 Thanks @b4rtaz! - Fixed creating a body of POST requests.

  • Updated dependencies []:

    • @moralisweb3/core@2.1.1

2.1.0

Minor Changes

Patch Changes

  • Updated dependencies [761d0d7]:
    • @moralisweb3/core@2.1.0

2.0.3

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.0.3

2.0.2

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.0.2

2.0.1

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.0.1

2.0.0

Major Changes

  • 639053e Thanks @ErnoW! - # Release of v2.0

    This release contains many breaking changes as it moves from a Javascript SDK (for react-native, browser, and NodeJs) to a NodeJs-only SDK.

    Note: we will still support the v1.x version as a moralis-v1 package (see https://github.com/MoralisWeb3/Moralis-JS-SDK-v1).

    These changes are to focus on Backend-only features, to facilitate self-hosted servers. Below you will find an overview of removed features and how to replace them:

    • Plugins: plugins in Moralis are mostly a wrapper around an API, where the API secret is managed on the moralis backend. When using the moralis sdk in NodeJs, you can safely implement your API secret, and implement any api (opensea/pinata etc.) directly without the need of utilities in the moralis sdk
    • Connecting to EVM: If you want to connect to EVM chains client-side, then this sdk is not suitable anymore. There are other open-source libraries that will have lots of utilities that can help you with this (web3js, ethers, wagmi, useDapp, web3-react)
    • Server interaction: interacting with the server can be done by installing the parse-server sdk (parse).

    Features

    The new sdk comes with the following featurs:

    • Moralis.EvmApi: A set of methods to interact and read from EVM chains
    • Moralis.SolApi: A set of methods to interact and read from Solana networks
    • Moralis.Auth: Utilities to implement web3 authentication in NodeJs

    Get started

    To get started, simply call

    Moralis.start({
      apiKey: 'YOUR_API_KEY'
    })
    

    Then you can access the apis via

    • Moralis.EvmApi.account.getNFTs(options)
    • Moralis.SolApi.account.getNFTs(options)
    • Moralis.Auth.requestMessage(options)

    More info

    For more info see the docs: http://docs.moralis.io Or reach out in our forums: https://forum.moralis.io

Minor Changes

  • #560 d413073 Thanks @ErnoW! - Improve Erc20Value logic by:

    • geters for Erc20 for: token.decimals, token.name, token.symbol, token.contractAddress, token.chain, token.logo, token.logoHash and token.thumbnail,
    • adding an optional token reference for Erc20Value. This can be used by calling Erc20Value.create(amount, { token })
    • fixes and additions for output of Erc20Value:
      • erc20Value.value now returns the value in a decimal string "123.567"
      • erc20Value.amount returns the Bignumber value withtout taking decimals into account
      • erc20Value.decimals returns the decimals
      • erc20Value.toNumber() returns the value in a decimal number (or throws an error if the value is too big): 123.456
      • erc20Value.display() returns the value in a readable string with the token symbol if available: "123.456 LINK" (or "123.456")
    • Moralis.EvmApi.getTokenBalances() now returns an Erc20Value object with associated token information.
  • #552 81effa1 Thanks @ErnoW! - Add headers to api calls to enable tracking of api version usage

Patch Changes

  • #562 4683492 Thanks @ErnoW! - Update type definition and resolvers after changes in the Evm Api

2.0.0-beta.11

Patch Changes

  • Updated dependencies []:
    • @moralisweb3/core@2.0.0-beta.11

2.0.0-beta.10

Patch Changes

  • Updated dependencies [51e0446]:
    • @moralisweb3/core@2.0.0-beta.10

2.0.0-beta.9

Patch Changes

  • #562 4683492 Thanks @ErnoW! - Update type definition and resolvers after changes in the Evm Api

  • Updated dependencies [4683492]:

    • @moralisweb3/core@2.0.0-beta.9

2.0.0-beta.8

Minor Changes

  • #560 d413073 Thanks @ErnoW! - Improve Erc20Value logic by:

    • geters for Erc20 for: token.decimals, token.name, token.symbol, token.contractAddress, token.chain, token.logo, token.logoHash and token.thumbnail,
    • adding an optional token reference for Erc20Value. This can be used by calling Erc20Value.create(amount, { token })
    • fixes and additions for output of Erc20Value:
      • erc20Value.value now returns the value in a decimal string "123.567"
      • erc20Value.amount returns the Bignumber value withtout taking decimals into account
      • erc20Value.decimals returns the decimals
      • erc20Value.toNumber() returns the value in a decimal number (or throws an error if the value is too big): 123.456
      • erc20Value.display() returns the value in a readable string with the token symbol if available: "123.456 LINK" (or "123.456")
    • Moralis.EvmApi.getTokenBalances() now returns an Erc20Value object with associated token information.

Patch Changes

  • Updated dependencies [d413073]:
    • @moralisweb3/core@2.0.0-beta.8

2.0.0-beta.7

Patch Changes

  • #558 0c47bae Thanks @b4rtaz! - Deleted redundant search parameters in API URLs.

  • Updated dependencies []:

    • @moralisweb3/core@2.0.0-beta.7

2.0.0-beta.6

Minor Changes

  • #555 3f511ed Thanks @ErnoW! - Include all files from /lib in npm builds. This fixes a bug where only the index.js file and .d.ts files were included in builds.

Patch Changes

  • Updated dependencies [36dd9a9, 3f511ed]:
    • @moralisweb3/core@2.0.0-beta.6

2.0.0-beta.5

Major Changes

Patch Changes

  • Updated dependencies [2948339]:
    • @moralisweb3/core@2.0.0-beta.5

2.0.0-alpha.4

Minor Changes

  • #552 81effa1 Thanks @ErnoW! - Add headers to api calls to enable tracking of api version usage

Patch Changes

  • #552 81effa1 Thanks @ErnoW! - Fix Typescript reference between the packages in production builds

2.0.0-alpha.3

Minor Changes

Patch Changes