preparePurchase
Parameters
Parameter
Type
Required
Description
Returns: PreparedPurchase
Example
import { createClient, type AppType, isBlindMintProduct } from '@manifoldxyz/client-sdk'
const client = createClient();
const product = await client.getProduct('12311232')
if (!isBlindMintProduct(product)) {
throw new Error(`Unsupported app type`)
}
try {
const preparedPurchase = await product.preparePurchase({
userAddress: '0x....', // the connected wallet
payload: {
quantity: 1
},
gasBuffer: {
multiplier: 0.25 // 25% gas buffer
}
});
} catch (error: ClientSDKError) {
console.log(`Error: ${error.message}`)
return
}
console.log('Total cost:', simulation.totalCost.formatted);Code
Message
data
Last updated