getTaxRate()
function getTaxRate(client, props): Promise<{
mintTax: number;
burnTax: number;
}>
Reads the mint and burn tax rates of a mixed token.
Parameters
Parameter | Type | Description |
---|---|---|
client | ReadClient | ReadClient The read client to use. |
props | MixedTokenGetTaxRateProps | MixedTokenGetTaxRateProps The properties to use. |
type MixedTokenGetTaxRateProps: {
address: Address;
};
Returns
Promise
<{
mintTax
: number
;
burnTax
: number
;
}>
The mint and burn tax rates, formatted as ratios.
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 { mintTax, burnTax } = await mixedToken.read.getTaxRate(readClient, {
address: '0x...', // mixed token address
});
console.log(mintTax, burnTax);