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

getUserKeys

Fetch the list of public keys associated with a user, via the indexer.

Signature

function getUserKeys(
  client: Client,
  parameters: { userIndex: number },
): Promise<PublicKey[]>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const keys = await client.getUserKeys({ userIndex: 42 })
keys.forEach((k) => console.log(k.keyType, k.keyHash))

Parameters

userIndexnumber. The user's numeric index.

Returns

PublicKey[] — array of { keyHash, publicKey, keyType, createdBlockHeight, createdAt }.

Notes

  • Queries the indexer's GraphQL endpoint, not the on-chain contract. Indexer lag may apply.

See also