getEstimateMint()
function getEstimateMint(client, props): Promise<{
mixedTokenAmount: bigint;
platformFee: bigint;
projectFee: bigint;
}>
Estimates the mixed token amount that needs to be minted when a certain amount of native token is raised.
Parameters
Parameter | Type | Description |
---|---|---|
client | ReadClient | ReadClient The read client to use. |
props | MixedTokenGetEstimateMintProps | MixedTokenGetEstimateMintProps The properties to use. |
type MixedTokenGetEstimateMintProps: {
address: Address;
raisingAmount: bigint;
};
Returns
Promise
<{
mixedTokenAmount
: bigint
;
platformFee
: bigint
;
projectFee
: bigint
;
}>
The mixed 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 { mixedTokenAmount, platformFee, projectFee } = await mixedToken.read.getEstimateMint(readClient, {
address: '0x...',
raisingAmount: 1n
});
console.log(mixedTokenAmount, platformFee, projectFee);