Skip to content

How can I find the digest of a Seaport order? #133

Answered by 0xFloop
0xFloop asked this question in Q&A
Discussion options

You must be logged in to vote

here is the solution I found for anyone else who ever experiences this

const verifyOrder = async (order: any, signer: string) => {
  let provider = new ethers.providers.JsonRpcProvider(
    "alchemy url"
  );
  const seaport = new Seaport(provider);

  let message = JSON.parse(await seaport._getMessageToSign(order["parameters"], 0));
  let types = message["types"];
  delete types["EIP712Domain"];

  let typedAddress = ethers.utils.verifyTypedData(
    message["domain"],
    types,
    message["message"],
    order["signature"]
  );


  return typedAddress == signer;
};

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sahinhakan
Comment options

Answer selected by 0xFloop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants