burn()
function burn(client, props): Promise<`0x${string}`>
Burns mixed tokens by returning a specified amount of native tokens.
Parameters
Parameter | Type | Description |
---|---|---|
client | WriteClient | WriteClient The write client to use. |
props | MixedTokenBurnProps | MixedTokenBurnProps The properties to use for burning. |
type MixedTokenBurnProps: WriteContractBaseProps & {
address: Address;
raisingAmount: bigint;
minMixedTokenAmount: bigint;
};
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.burn(writeClient, {
address: '0x...', // mixed token contract address
raisingAmount: 1n,
minMixedTokenAmount: 1n
});
console.log(hash);