const { paramsTypes, encodedParams } = encodeOrderParams(params);
For a given array of params used to create a maker order, generate the corresponding array of param types, and encode the params in a data hex string.
- params (any[]): The list of params used to create the maker order.
({ paramsTypes, encodedParams }): Params types array, and encoded params.
const { domain, type } = getMakerOrderTypeAndDomain(chainId, verifyingContract);
Generate the EIP-712 type
and domain
information used to sign an order on LooksRare.
- chainId (SupportedChainId): Chain ID of the blockchain where your application is running.
- verifyingContract (string?): Contract address where the signature will be used. It will always be the LooksRareExchange address (EXCHANGE in the addresses list. The address differs based on the chain you are using). If you don't provide it, it will use the exchange address for the chainId you provided.
({ type, domain }): Type and domain used to sign the order.
const { domain, value, type } = generateMakerOrderTypedData(signer, chainId, makerOrder, verifyingContract);
Generate the domain, value, and type used to generate an EIP-712 (typed data signing) signature.
- signer (string): The signer address.
- chainId (SupportedChainId): Chain ID of the blockchain where your application is running.
- makerOrder (MakerOrder): The maker order object.
- verifyingContract (string?): Contract address where the signature will be used. It will always be the LooksRareExchange address (EXCHANGE in the addresses list. The address differs based on the chain you are using). If you don't provide it, it will use the exchange address for the chainId you provided.
const signature = await signMakerOrder(signer, chainId, order, verifyingContractAddress);
- signer (JsonRpcSigner): Json RPC signer object from ethers.
- chainId (SupportedChainId): Chain ID of the blockchain where your application is running.
- order (MakerOrder):
- verifyingContractAddress (string): Contract address where the signature will be used. It will always be the LooksRareExchange address (EXCHANGE in the addresses list. The address differs based on the chain you are using). If you don't provide it, it will use the exchange address for the chainId you provided.
(string): Signature hash. You can decompose the signature with splitSignature.