Skip to content

Commit

Permalink
add version (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshka committed Dec 18, 2023
1 parent 7acf15a commit 202bca1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-waves-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@soundxyz/sdk': patch
---

add version to getTotalMintPriceAndFees
28 changes: 16 additions & 12 deletions packages/sdk/src/contract/edition-v2/read/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,26 @@ export async function getTotalMintPriceAndFees<Client extends Pick<PublicClient,
switch (superMinter.version) {
case '1': {
const { abi, address } = superMinter
return client.readContract({
abi,
address,
functionName: 'totalPriceAndFees',
args: [editionAddress, tier, scheduleNum, quantity],
})
return client
.readContract({
abi,
address,
functionName: 'totalPriceAndFees',
args: [editionAddress, tier, scheduleNum, quantity],
})
.then((res) => ({ ...res, version: superMinter.version }))
}

case '2': {
const { abi, address } = superMinter
return client.readContract({
abi,
address,
functionName: 'totalPriceAndFees',
args: [editionAddress, tier, scheduleNum, quantity, false],
})
return client
.readContract({
abi,
address,
functionName: 'totalPriceAndFees',
args: [editionAddress, tier, scheduleNum, quantity, false],
})
.then((res) => ({ ...res, version: superMinter.version }))
}
default:
exhaustiveGuard(superMinter)
Expand Down

0 comments on commit 202bca1

Please sign in to comment.