Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan committed Nov 28, 2023
1 parent c8619de commit 3717b77
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions packages/protocol-sdk/src/mint/mint-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,13 @@ export async function get721MintCosts({
args: [BigInt(quantityToMint)],
});

const tokenPurchaseCost = BigInt(mintable.cost.native_price.raw) * quantityToMint;
const tokenPurchaseCost =
BigInt(mintable.cost.native_price.raw) * quantityToMint;
return {
mintFee,
tokenPurchaseCost,
totalCost: mintFee + tokenPurchaseCost,
}
};
}

async function makePrepareMint721TokenParams({
Expand All @@ -202,11 +203,13 @@ async function makePrepareMint721TokenParams({
throw new Error("Minted token type must be for 1155");
}

const mintValue = (await get721MintCosts({
mintable,
publicClient,
quantityToMint: BigInt(mintArguments.quantityToMint),
})).totalCost;
const mintValue = (
await get721MintCosts({
mintable,
publicClient,
quantityToMint: BigInt(mintArguments.quantityToMint),
})
).totalCost;

const result = {
abi: zora721Abi,
Expand Down Expand Up @@ -240,10 +243,10 @@ export async function get1155MintFee({
}

export type MintCosts = {
mintFee: bigint,
tokenPurchaseCost: bigint,
totalCost: bigint,
}
mintFee: bigint;
tokenPurchaseCost: bigint;
totalCost: bigint;
};

export async function get1155MintCosts({
mintable,
Expand All @@ -262,13 +265,14 @@ export async function get1155MintCosts({
});

const mintFeeForTokens = mintFee * quantityToMint;
const tokenPurchaseCost = BigInt(mintable.cost.native_price.raw) * quantityToMint;
const tokenPurchaseCost =
BigInt(mintable.cost.native_price.raw) * quantityToMint;

return {
mintFee: mintFeeForTokens,
tokenPurchaseCost,
totalCost: mintFeeForTokens + tokenPurchaseCost,
}
};
}

async function makePrepareMint1155TokenParams({
Expand All @@ -294,11 +298,13 @@ async function makePrepareMint1155TokenParams({

const address = mintable.collection.address as Address;

const mintValue = (await get1155MintCosts({
mintable,
publicClient,
quantityToMint: mintQuantity,
})).totalCost;
const mintValue = (
await get1155MintCosts({
mintable,
publicClient,
quantityToMint: mintQuantity,
})
).totalCost;

const tokenFixedPriceMinter = await apiClient.getSalesConfigFixedPrice({
contractAddress: address,
Expand Down

0 comments on commit 3717b77

Please sign in to comment.