Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Latest commit

 

History

History
66 lines (41 loc) · 3.49 KB

signature.md

File metadata and controls

66 lines (41 loc) · 3.49 KB

Signatures

encodeOrderParams

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

  • params (any[]): The list of params used to create the maker order.

Returns

({ paramsTypes, encodedParams }): Params types array, and encoded params.

getMakerOrderTypeAndDomain

const { domain, type } = getMakerOrderTypeAndDomain(chainId, verifyingContract);

Generate the EIP-712 type and domain information used to sign an order on LooksRare.

Params

  • 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.

Returns

({ type, domain }): Type and domain used to sign the order.

generateMakerOrderTypedData

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.

Params

  • 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.

signMakerOrder

const signature = await signMakerOrder(signer, chainId, order, verifyingContractAddress);

Params

  • 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.

Returns

(string): Signature hash. You can decompose the signature with splitSignature.