From 48f8bea4601e826fb038073b70eb813bff4888cc Mon Sep 17 00:00:00 2001 From: Lawrence Forman Date: Tue, 2 Feb 2021 23:30:26 -0500 Subject: [PATCH] `docs`: Fix wrong method name for order signature generation (#128) Co-authored-by: Lawrence Forman --- docs/basics/orders.rst | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/basics/orders.rst b/docs/basics/orders.rst index f74dea8a7a..bbd6807e4e 100644 --- a/docs/basics/orders.rst +++ b/docs/basics/orders.rst @@ -123,19 +123,27 @@ In both cases, the ``@0x/protocol-utils`` package simplifies generating these si takerToken: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH ... // Other fields }); - // Generate an EIP712 signature - const signature = await order.eip712SignTypedDataWithProviderAsync( + // Generate an EthSign signature with a provider. + const signature = await order.getSignatureWithProviderAsync( web3.currentProvider, - makerAddress, ); - // Generate an EthSign signature - const signature = await order.ethSignHashWithProviderAsync( + // Generate an EthSign signature with a private key. + const signature = await order.getSignatureWithKey( + '0x123456...', // Maker's 32-byte private key, in hex. + ); + // Generate an EIP712 signature with a provider (e.g., metamask). + const signature = await order.getSignatureWithProviderAsync( web3.currentProvider, - makerAddress, + utils.SignatureType.EIP712, + ); + // Generate an EIP712 signature with a private key. + const signature = await order.getSignatureWithKey( + '0x123456...', // Maker's 32-byte private key, in hex. + utils.SignatureType.EIP712, ); -The Orderbook +The Orderbook ======================= Orders are shared through a decentralized and permissionless network, called `0x Mesh `_. The simplest way to post and discover orders is through `0x API `_. See `this guide `_ tailored for Market Makers. @@ -167,4 +175,4 @@ A ``RFQOrder`` should be serialized to JSON as following: "s": string, "r": string, } - } \ No newline at end of file + }