Skip to content

Commit

Permalink
Merge pull request #468 from rabbitholegg/mmackz/sound/amount-zero
Browse files Browse the repository at this point in the history
fix(sound): amount zero fix
  • Loading branch information
mmackz authored Jul 10, 2024
2 parents bb9c058 + 325c6dc commit 2f0d70d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-trains-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk-plugin-soundxyz": patch
---

fix for quantity zero
10 changes: 6 additions & 4 deletions packages/soundxyz/src/Soundxyz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import {
type MintIntentParams,
chainIdToViemChain,
getExitAddresses,
formatAmount,
getMintAmount,
} from '@rabbitholegg/questdk-plugin-utils'
import {
type Address,
Expand All @@ -48,7 +50,7 @@ export const mint = async (
$abiAbstract: SUPERMINTER_V2_ABI,
p: {
edition: contractAddress,
quantity: amount,
quantity: formatAmount(amount),
tier: tokenId,
to: recipient, // Can be given as gift, so recipient will not always match sender
},
Expand All @@ -61,7 +63,7 @@ export const getMintIntent = async (
): Promise<TransactionRequest> => {
const { contractAddress, recipient, tokenId, amount } = mint
const tier = await getDefaultMintTier(mint.chainId, contractAddress, tokenId)
const quantity = amount ?? 1
const quantity = getMintAmount(amount)

const mintTo = {
edition: contractAddress,
Expand Down Expand Up @@ -114,7 +116,7 @@ export const simulateMint = async (
tokenId,
_client,
)
const quantity = amount ?? 1
const quantity = getMintAmount(amount)

const mintTo = {
edition: contractAddress,
Expand Down Expand Up @@ -181,7 +183,7 @@ export const getFees = async (
tokenId,
client,
)
const quantity = amount ?? 1
const quantity = getMintAmount(amount)

try {
const totalPriceAndFees = (await client.readContract({
Expand Down

0 comments on commit 2f0d70d

Please sign in to comment.