From 25be54bd0cc5327095e671adbbbe747a39269734 Mon Sep 17 00:00:00 2001 From: Vignesh Hirudayakanth Date: Wed, 3 Jan 2024 12:30:17 -0500 Subject: [PATCH] Add option to disable cdCompress for mints --- .changeset/funny-singers-fly.md | 5 +++++ packages/sdk/src/contract/edition-v2/write/mint.ts | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .changeset/funny-singers-fly.md diff --git a/.changeset/funny-singers-fly.md b/.changeset/funny-singers-fly.md new file mode 100644 index 00000000..36abb336 --- /dev/null +++ b/.changeset/funny-singers-fly.md @@ -0,0 +1,5 @@ +--- +'@soundxyz/sdk': patch +--- + +Add option to disable cdCompress for mints diff --git a/packages/sdk/src/contract/edition-v2/write/mint.ts b/packages/sdk/src/contract/edition-v2/write/mint.ts index 3ea664b1..7b0cc004 100644 --- a/packages/sdk/src/contract/edition-v2/write/mint.ts +++ b/packages/sdk/src/contract/edition-v2/write/mint.ts @@ -5,17 +5,16 @@ import { cdCompress } from '../../../utils/calldata' export function editionMint>( client: Client, - { input }: EditionMintContractInput, + { input, disableCdCompress }: EditionMintContractInput & { disableCdCompress?: boolean }, ) { const calldata = encodeFunctionData({ abi: input.abi, functionName: input.functionName, args: input.args }) - const compressedCalldata = cdCompress(calldata) return client.sendTransaction({ account: input.account, chain: input.chain, value: input.value, to: input.address, - data: compressedCalldata, + data: !!disableCdCompress ? calldata : cdCompress(calldata), gas: input.gas, maxFeePerGas: input.maxFeePerGas, maxPriorityFeePerGas: input.maxPriorityFeePerGas,