Skip to content

Commit

Permalink
Add option to disable cdCompress for mints (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshka authored Jan 3, 2024
1 parent 122109f commit 6032816
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-singers-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@soundxyz/sdk': patch
---

Add option to disable cdCompress for mints
5 changes: 2 additions & 3 deletions packages/sdk/src/contract/edition-v2/write/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ import { cdCompress } from '../../../utils/calldata'

export function editionMint<Client extends Pick<WalletClient, 'writeContract' | 'sendTransaction'>>(
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,
Expand Down

0 comments on commit 6032816

Please sign in to comment.