getStarknetIdNames
Action for getting names associated with multiple Starknet IDs.
Import
import { getStarknetIdNames } from "starkweb/core";
Usage
index.ts
import { getStarknetIdNames } from "starkweb/core";
import { config } from "./config";
const names = await getStarknetIdNames(config, {
starknetIds: ["0x123...", "0x456..."],
});
Parameters
import { type GetStarknetIdNamesParameters } from "starkweb/core";
starknetIds
Hex[]
Array of Starknet IDs to get names for.
index.ts
import { getStarknetIdNames } from "starkweb/core";
import { config } from "./config";
const names = await getStarknetIdNames(config, {
starknetIds: ["0x123...", "0x456..."],
});
chainId (optional)
Hex | undefined
The chain ID to query. If not provided, uses the current chain.
index.ts
import { getStarknetIdNames } from "starkweb/core";
import { mainnet } from "starkweb/chains";
import { config } from "./config";
const names = await getStarknetIdNames(config, {
starknetIds: ["0x123...", "0x456..."],
chainId: mainnet.chain_id,
});
Return Type
import { type GetStarknetIdNamesReturnType } from "starkweb/core";
string[]
Array of names associated with the provided Starknet IDs.
Example
example.ts
import { getStarknetIdNames } from "starkweb/core";
import { mainnet } from "starkweb/chains";
import { config } from "./config";
// Get names on current chain
const names = await getStarknetIdNames(config, {
starknetIds: ["0x123...", "0x456..."],
});
console.log("Names:", names);
// Get names on specific chain
const mainnetNames = await getStarknetIdNames(config, {
starknetIds: ["0x123...", "0x456..."],
chainId: mainnet.chain_id,
});
Error
import { type GetStarknetIdNamesErrorType } from "starkweb/core";
TanStack Query
import {
type GetStarknetIdNamesData,
type GetStarknetIdNamesOptions,
type GetStarknetIdNamesQueryFnData,
type GetStarknetIdNamesQueryKey,
getStarknetIdNamesQueryKey,
getStarknetIdNamesQueryOptions,
} from "starkweb/query";