SDKs@solio/coreContractsMixedTokensetTaxRate

setTaxRate()

function setTaxRate(client, props): Promise<`0x${string}`>

Sets the mint and burn tax rates of a mixed token contract.

Parameters

ParameterTypeDescription
clientWriteClientWriteClient The write client to use.
propsMixedTokenSetTaxRatePropsMixedTokenSetTaxRateProps The properties to use for setting the tax rates.
type MixedTokenSetTaxRateProps: WriteContractBaseProps & {
  address: Address;
  mintTax: number;
  burnTax: number;
};

Returns

Promise<`0x${string}`>

A promise that resolves to the result of the write contract.

Example

mixed-token.ts
import { mixedToken } from '@solio/core';
import { createWalletClient, custom } from 'viem';
import { sepolia } from 'viem/chains';
const writeClient = createWalletClient({
 chain: sepolia,
 transport: custom(window.ethereum),
});
const hash = await mixedToken.write.setTaxRate(writeClient, {
 address: '0x...', // mixed token contract address
 mintTax: 0.05,
 burnTax: 0.05
});
console.log(hash);