Skip to content

getStarknetIdStarkProfiles

Action for getting Stark profiles associated with a Starknet ID.

Import

import { getStarknetIdStarkProfiles } from "starkweb/core";

Usage

index.ts
import { getStarknetIdStarkProfiles } from "starkweb/core";
import { config } from "./config";
 
const profiles = await getStarknetIdStarkProfiles(config, {
  starknetId: "0x123...", 
});

Parameters

import { type GetStarknetIdStarkProfilesParameters } from "starkweb/core";

starknetId

Hex

The Starknet ID to get Stark profiles for.

index.ts
import { getStarknetIdStarkProfiles } from "starkweb/core";
import { config } from "./config";
 
const profiles = await getStarknetIdStarkProfiles(config, {
  starknetId: "0x123...", 
});

chainId (optional)

Hex | undefined

The chain ID to query. If not provided, uses the current chain.

index.ts
import { getStarknetIdStarkProfiles } from "starkweb/core";
import { mainnet } from "starkweb/chains"; 
import { config } from "./config";
 
const profiles = await getStarknetIdStarkProfiles(config, {
  starknetId: "0x123...",
  chainId: mainnet.chain_id, 
});

Return Type

import { type GetStarknetIdStarkProfilesReturnType } from "starkweb/core";

Returns an array of Stark profiles, each containing:

id

string

The profile identifier.

name

string

The profile name.

metadata

Record<string, unknown>

Additional profile metadata.

Example

example.ts
import { getStarknetIdStarkProfiles } from "starkweb/core";
import { mainnet } from "starkweb/chains"; 
import { config } from "./config";
 
// Get profiles on current chain
const profiles = await getStarknetIdStarkProfiles(config, {
  starknetId: "0x123...", 
});
console.log("Profiles:", profiles);
 
// Get profiles on specific chain
const mainnetProfiles = await getStarknetIdStarkProfiles(config, {
  starknetId: "0x123...",
  chainId: mainnet.chain_id, 
});

Error

import { type GetStarknetIdStarkProfilesErrorType } from "starkweb/core";

TanStack Query

import {
  type GetStarknetIdStarkProfilesData,
  type GetStarknetIdStarkProfilesOptions,
  type GetStarknetIdStarkProfilesQueryFnData,
  type GetStarknetIdStarkProfilesQueryKey,
  getStarknetIdStarkProfilesQueryKey,
  getStarknetIdStarkProfilesQueryOptions,
} from "starkweb/query";