Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sound): amount zero fix #468

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading