-
Notifications
You must be signed in to change notification settings - Fork 465
Metamask provider not wrapped in MetamaskSubprovider error - EIP712 #1223
Comments
hey @MarcZenn
I've quickly forked the codesandbox to use provider engine. It should popup a signing window on load. Which I've just tested locally on Metamask 5.0.0. Can you confirm whether you see the same errors in this code sandbox, or if the signing window appears? |
Hmm the signing window appears in the codesandbox and works as expected. |
Can you JSON stringify the order and signerAddress/makerAddress you are using in your example? |
JSON stringifying results in a type error |
I've found the cause of my issue! There was a method in my code overriding the @dekz want me to close the issue? |
@MarcZenn ah that would do it. Let me know if you run into any other issues. |
Expected Behavior
Per the examples provider here - #1169, I've setup the following
MetamaskSubprovider
implementation:This should display order data in the Metamask signing prompt when an order is signed via the following 0x.js signature utils method:
Current Behavior
At the moment that method when invoked is producing an error that when logged outputs
Error: MetaMask provider must be wrapped in a MetamaskSubprovider (from the '@0x/subproviders' package) in order to work with this method.
to the console.This is accompanied by
MetaMask - RPC Error: TypeError: e.toLowerCase is not a function chrome-at L extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background.js
type error.Possible Solution
Unsure of a solution but passing
MetamaskSuprovider
directly toecSignTypedDataOrderAsync
i.e.signatureUtils.ecSignTypedDataOrderAsync(new MetamaskSuprovider(web.currentProvider, order, makerAddress)
works as expected.Steps to Reproduce (for bugs)
I will post up a minimal repo as soon as I can.
Environment
0x.js 2.0.0
@0x/subproviders 2.1.0
@0x/web3-wrapper 3.1.0
metamask plugin 5.0.0
node 8.9.0
The text was updated successfully, but these errors were encountered: