-
Notifications
You must be signed in to change notification settings - Fork 465
Release: 0x.js 2.0.0 Things you need to know #1169
Comments
I found the new version added the @0x/contract-addresses package and some old utility functions, such as contractWrappers.etherToken.getContractAddressIfExists() are gone. It'd be nice to announce these changes as well and also add the new contract-addresses package to the 0x documentation. |
Given the following implementation:
Is there any reason why I would be seeing |
Nothing looks obvious from the code you linked.
What’s your version of Metamask installed? Are you able to create an order in the [Codesandbox](https://codesandbox.io/s/github/0xproject/0x-codesandbox)? Just tested this out on 4.17 and 5.0 Metamask.
|
Sandbox works fine for me but I noticed it doesn't implement provider engine which I believe is where the error is coming from. I'm also seeing this in my console. I'm using Metamask version 5.0.0. I can open a separate issue for this. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because no activity occured in 7 days after being marked as stale. If it's still relevant - feel free to reopen. Thank you for your contributions. |
Hey everyone!
We've recently published 0x.js 2.0.0, order-utils 2.0.0 and web3-wrapper 3.1.0.
Below are a list of major changes, but be sure to read through the general CHANGELOG for the exhaustive list of changes.
Moved to a new NPM organisation
Our packages have moved to a new NPM organisation. Where previously you would use
@0xproject
from this release onwards new versions will now be published under@0x
.EIP712 Sign Typed Data
This had brought
eth_signTypedData
support to our packages, which means your users can now start to see the data they are signing. Currently this is supported in the latest version of Metamask 4.14.0.With this release there are a few changes to the way signing behaves.
Firstly, we are introducing
MetamaskSubprovider
which is exported from 0x.js and the subproviders package. This is a compatibility wrapper for Metamask, so if your users use Metamask, you must use the MetamaskSubprovider.This removes the previous
SignerType
where you would need to supply eitherSignerType.Metamask
orSignerType.Default
.So, if you're used to using
web3.currentProvider
whenever an order needs to be signed, this will need to be wrapped inMetamaskSubprovider
.Example - Signing with Metamask
Example - Handling multiple web3 browsers (like Coinbase Wallet)
Only the Metamask injected Web3 needs to be wrapped, other web3 browsers and wallets behave correctly.
Example - Provider Engine and multiple web3 browsers
New ways to Sign
Since there will be intermittent support of
eth_signTypedData
from the various web3 wallets and browsers, we have provided a helper functionecSignOrderAsync
. It will first attempteth_signTypedData
and then fall back to the previouseth_sign
of the order hash. This function returns aSignedOrder
.If you would like to use
eth_signTypedData
only, this can be done by usingecSignTypedDataOrderAsync
.We have renamed
ecSignOrderHashAsync
toecSignHashAsync
as this function can be used to sign more than just an order hash (like 0x transactions or any hash data).SignerType
has been removed (so remember to wrap Metamask web3 in the compatibility wrapper). This useseth_sign
implementation and behaves as it did in previous versions.Resolving contract addresses
A new package
@0x/contract-addresses
has been published and contains a lookup for the deployed contracts on a given network. Previous functions for resolving addresses have been removed formcontract-wrappers
. Though they can be found as properties on the contract, or via a lookup.Be sure to read through the general CHANGELOG for the exhaustive list of changes.
Any questions bugs or problems, reach out here in this Github issue or in our Rocket chat.
The text was updated successfully, but these errors were encountered: