From 028c3aa1a8adf6866cdd56d09df53ba5bb65c15e Mon Sep 17 00:00:00 2001 From: Dan Oved Date: Wed, 29 Nov 2023 14:28:15 -0800 Subject: [PATCH] destructure is valid sig args --- packages/protocol-sdk/src/premint/premint-client.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/protocol-sdk/src/premint/premint-client.ts b/packages/protocol-sdk/src/premint/premint-client.ts index 8dfd3509f..3ea4d8e1b 100644 --- a/packages/protocol-sdk/src/premint/premint-client.ts +++ b/packages/protocol-sdk/src/premint/premint-client.ts @@ -525,16 +525,20 @@ class PremintClient { * @param data Signature data from the API * @returns isValid = signature is valid or not, recoveredSigner = signer from contract */ - async isValidSignature(data: PremintSignatureResponse): Promise<{ + async isValidSignature({ + signature, + premint, + collection, + }: PremintSignatureResponse): Promise<{ isValid: boolean; recoveredSigner: Address | undefined; }> { const { isAuthorized, recoveredAddress } = await isValidSignature({ chainId: this.chain.id, - signature: data.signature as Hex, - premintConfig: convertPremintV1(data.premint), + signature: signature as Hex, + premintConfig: convertPremintV1(premint), premintConfigVersion: PremintConfigVersion.V1, - collection: convertCollection(data.collection), + collection: convertCollection(collection), publicClient: this.publicClient, });