SDKs@solio/coreContractsMixedTokengetEstimateMintNeed

getEstimateMintNeed()

function getEstimateMintNeed(client, props): Promise<{
  raisingAmount: bigint;
  platformFee: bigint;
  projectFee: bigint;
 }>

Estimates the native token amount that needs to be paid when a certain amount of mixed token is minted.

Parameters

ParameterTypeDescription
clientReadClientReadClient The read client to use.
propsMixedTokenGetEstimateMintNeedPropsMixedTokenGetEstimateMintNeedProps The properties to use.
type MixedTokenGetEstimateMintNeedProps: {
  address: Address;
  mixedTokenAmount: bigint;
};

Returns

Promise<{ raisingAmount: bigint; platformFee: bigint; projectFee: bigint; }>

The native token amount, platform fee, and project fee.

Example

mixed-token.ts
import { mixedToken } from '@solio/core';
import { createClient, http } from 'viem';
import { sepolia } from 'viem/chains';
const readClient = createClient({
 chain: sepolia,
 transport: http(),
});
const { raisingAmount, platformFee, projectFee } = await mixedToken.read.getEstimateMintNeed(readClient, {
 address: '0x...', // mixed token address
 mixedTokenAmount: 1n
});
console.log(raisingAmount, platformFee, projectFee);