SDKs@solio/coreContractsMixedTokengetEstimateBurn

getEstimateBurn()

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

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

Parameters

ParameterTypeDescription
clientReadClientReadClient The read client to use.
propsMixedTokenGetEstimateBurnPropsMixedTokenGetEstimateBurnProps The properties to use.
type MixedTokenGetEstimateBurnProps: {
  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.getEstimateBurn(readClient, {
 address: '0x...', // mixed token address
 mixedTokenAmount: 1n
});
console.log(raisingAmount, platformFee, projectFee);