-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protocol-utils: Signing with SignatureType.EIP712 throws error #116
Comments
|
Yes, I use the 8.1.11 version extension on Chrome browser. Also, signing V3 Limit Orders worked with the same setup. |
Are you signing from a hardware wallet? |
No |
Alright, so I'm actually having trouble replicating your issue but I do see how it could happen. I have a couple PRs in the works to address this (0xProject/tools#21 and #124). Could you maybe show me how you create FWIW I am able to get it to work using the following: import { LimitOrder, SignatureType } from '@0x/protocol-utils';
import { providerUtils } from '@0x/utils';
import { Web3ProviderEngine, MetamaskSubprovider } from '@0x/subproviders';
import { Web3Wrapper } from '@0x/web3-wrapper';
async signOrder() {
const [maker] = await window.ethereum.request({ method: 'eth_requestAccounts' });
const provider = providerUtils.standardizeOrThrow(window.ethereum);
const order = new LimitOrder({ maker, chainId: parseInt(window.ethereum.chainId.slice(2), 16) });
console.log(await order.getSignatureWithProviderAsync(provider, SignatureType.EIP712));
} |
Just merged and published the fixes. Try updating your dependencies and let me know if they work for you. |
Confirm this works! Removing ProviderEngine dependency and Subproviders solved the problem. |
Current Behavior
Signing RFQ orders as follows:
throws error:
On the other hand, signing with SignatureType.EthSign works fine.
It is possible
eth_signTypedData_v4
method has limited support by the subprovider engine.Environment
"@0x/protocol-utils": "^1.1.4",
"@0x/subproviders": "^6.3.0"
| Network |
| mainnet |
The text was updated successfully, but these errors were encountered: