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

getAccountInfo

Fetch account details (index, owner, username) for a given account address.

Signature

function getAccountInfo(
  client: Client,
  parameters: {
    address: Address
    height?: number
  },
): Promise<AccountDetails | null>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
import type { Address } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const address: Address = "0x1234567890abcdef1234567890abcdef12345678"
 
const info = await client.getAccountInfo({ address })
console.log(info?.username, info?.index)

Parameters

addressAddress. The account address.

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

Returns

AccountDetails | null{ address, index, owner, username } or null if the address is not a registered account.

Notes

  • This makes two queries: one to the account factory and one to resolve the user's username via getUser.

See also