1.5.5 (2022-03-19)
- react-native compatibility for v0.64+ (b906444)
1.5.4 (2022-03-16)
1.5.3 (2022-03-15)
1.5.2 (2022-03-15)
- deps: bump axios from 0.24.0 to 0.26.1 (#288) (240c3f0)
- deps: bump ethers from 5.5.3 to 5.6.0 (#287) (3632dd6)
1.5.1 (2022-03-15)
- send sessionToken with apiRequest for correct rate-limiting (bef928b)
1.5.0 (2022-03-15)
- add metrics for start event (28bb292)
1.4.1 (2022-03-15)
1.4.0 (2022-03-14)
1.3.5 (2022-03-01)
1.3.4 (2022-03-01)
1.3.3 (2022-03-01)
1.3.2 (2022-02-14)
1.3.1 (2022-02-09)
- FromWei type from number to string (#257) (fdb5804)
- overloaded functions for executeFunction (#256) (28b2468)
1.3.0 (2022-02-09)
- add web3Auth as connection method (a7724f1)
1.2.7 (2022-02-07)
- newsession param for walletconnect and magic (a0928dc)
- prevent cleanup when enabling web3 (01a7cd0)
- prevent double cleanup on authentication (bc4abe1)
- types for anyNetwork in enableWeb3 (4573a8a)
1.2.6 (2022-02-04)
1.2.5 (2022-02-04)
- cleanup web3 on logout (#250) (d676d87)
- expose setting of 'any' network on provider (#251) (16537fa)
- preserve sessions for walletconnect and magic (#249) (82c33e6)
1.2.4 (2022-01-31)
1.2.3 (2022-01-28)
1.2.2 (2022-01-28)
1.2.1 (2022-01-28)
1.2.0 (2022-01-27)
- add authentication via MagicLink (9420eb9)
1.1.2 (2022-01-26)
- set default address for Web3API and SolanaAPI (57d15cc)
1.1.1 (2022-01-26)
- avoid duplicate enableWeb3 calls (8df9484)
- better error message when no appId provided (225a696)
- expose Moralis.web3Library (59a7c28)
1.1.0 (2022-01-21)
- add SolanaAPI (f870001)
1.0.7 (2022-01-20)
1.0.6 (2022-01-20)
- filter out walletconnect dependency warning (#220) (31e94ac)
- include details on WEB3_DEACTIVATED event (#218) (f2fe3e1)
- move MoralisWeb3 types to Moralis (#219) (945e79b)
1.0.5 (2022-01-20)
1.0.4 (2022-01-20)
1.0.3 (2022-01-19)
- deps: bump ethers from 5.5.1 to 5.5.3 (#184) (abafda3)
- deps: bump ws from 8.4.0 to 8.4.2 (#202) (ab99bea)
1.0.2 (2022-01-19)
- typings for ethers (855b41d)
1.0.1 (2022-01-17)
- re-add isMetaMaskInstalled (4673e18)
1.0.0 (2022-01-17)
- Removed dependency of web3.js in favour of ethers.js
- Introducing custom connectors
Moralis.web3 and Moralis.enableWeb3 will now return an instance of Ethers.js instead of an instance of Web3.js. To account for these changes you should
- Adjust your code to use the Ethers.js library
Or
- Initialize your own Web3 library by using
Moralis.provider
import Web3 from 'web3'
import Moralis from 'moralis'
await Moralis.enableWeb3()
const web3 = new Web3(Moralis.provider)
Return values are changed for Moralis.executeFunction and Moralis.transfer. They are now a transaction response from Ethers.js: This object contains all data about the transaction. If you need data about the result of the transation, then you need to wait for the transaction to be confirmed.
You can do this via transaction.wait()
to wait for 1 confirmation (or transaction.wait(5)
to wait for 5 confirmations for example):
const transaction = await Moralis.transfer(options)
const result = await transaction.wait()
Instead of returning the results from the provider directly, moralis generalizes these events so that they can be used for anny connector: metamask, walletconnect, network etc.
A notable change is the renamning of Moralis.onAccountsChanged
to Moralis.onAccountChanged
Previously, it was possible to overwrite the enableWeb3()
function. This allowed for custom implementation to connect wallets that are not supported by Moralis out-of-the-box.
This approach is not possible anymore, to allow for better scaling and more consistent behavior.
Instead, now you can implement your own connector
, which extends the AbstractConnector class.
This class should implement
- An
activate()
function that resolves to an object with:- provider: A valid EIP-1193 provider
- chainId (optional): the chain that is being connected to (in hex)
- account (optional): the account of the user that is being connected
- Subscribes to the EIP-1193 events. This should be mostly done automatically by calling
this.subscribeToEvents(provider)
in theactivate
function. - the
type
field to indicate a name for the connector - (optionally) a
deactivate
function that extends the default deactivate function. Implement this when you need to clean up data/subscriptions upon ending/switching the connection.
Then you can include this CustomConnector
in the authenticate/enableWeb3 call as an option:
Moralis.authenticate({ connector: CustomConnector })
See for example implementations:
- The WalletConnectConnector, that is used when you specify
provider: "walletconnect"
. - The InjectedWeb3Connector (metamask), that is used when you don't specify any connector.
0.0.184 (2022-01-13)
0.0.183 (2022-01-05)
- debug (c426bd7)
- set correct version during compiling (5723a14)
- update sdk-check to account for beta branches (077c3f9)
0.0.182 (2022-01-04)
- re-add default decimals value of 18 for fromWei (f127ab2)
0.0.181 (2022-01-03)
- update CDN build version correctly (c3e3044)
0.0.180 (2022-01-03)
- update build version correctly (3ba6a19)
0.0.179 (2022-01-03)
- avoid floating decimals in utils (0a1de0a)
0.0.178 (2021-12-30)
0.0.177 (2021-12-30)
- prevent floating error on Moralis.Units.Token (2704e5b)
0.0.176 (2021-12-30)
- web3api type for 201 response (5ad68bb)
Features
- Initial move from private repository