getMixedTokenWithIndex()
function getMixedTokenWithIndex(client, props): Promise<`0x${string}`>
Reads the mixed token address with index.
Parameters
Parameter | Type | Description |
---|---|---|
client | ReadClient | ReadClient The read client to use. |
props | FactoryGetMixedTokenAddressWithIndexProps | FactoryGetMixedTokenAddressWithIndexProps The properties to use. |
type FactoryGetMixedTokenAddressWithIndexProps: {
address: Address;
mixedTokenIndex: bigint;
};
Returns
Promise
<`0x${string}`>
The mixed token address.
Example
factory.ts
// for reading the index 0 mixed token
import { factory } from '@solio/core';
import { createClient, http } from 'viem';
import { sepolia } from 'viem/chains';
const readClient = createClient({
chain: sepolia,
transport: http(),
});
const mixedTokenAddress = await factory.read.getMixedTokenWithIndex(readClient, {
address: '0x...', // factory contract address
mixedTokenIndex: 0n
});
console.log(mixedTokenAddress);