getNextAccountIndex
Read the index that the next account for a username will receive. Use this to derive a new account's address before creating it.
Signature
function getNextAccountIndex(
client: Client,
parameters: {
username: Username
height?: number
},
): Promise<AccountIndex>Example
import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const index = await client.getNextAccountIndex({ username: "alice" })Parameters
username — Username. The user owning the new account.
height — number, optional. Block height. Default 0 (latest).
Returns
AccountIndex — number. The index that will be assigned.