Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

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

usernameUsername. The user owning the new account.

heightnumber, optional. Block height. Default 0 (latest).

Returns

AccountIndexnumber. The index that will be assigned.

See also