Skip to content

getStarknetIdVerifierData

Action for getting verifier data associated with a Starknet ID.

Import

import { getStarknetIdVerifierData } from "starkweb/core";

Usage

index.ts
import { getStarknetIdVerifierData } from "starkweb/core";
import { config } from "./config";
 
const verifierData = await getStarknetIdVerifierData(config, {
  starknetId: "0x123...", 
  field: "twitter", 
  verifier: "0x456...", 
});

Parameters

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

starknetId

Hex

The Starknet ID to get verifier data for.

field

string

The specific field of verifier data to retrieve.

verifier

Hex

The address of the verifier.

index.ts
import { getStarknetIdVerifierData } from "starkweb/core";
import { config } from "./config";
 
const verifierData = await getStarknetIdVerifierData(config, {
  starknetId: "0x123...", 
  field: "twitter", 
  verifier: "0x456...", 
});

chainId (optional)

Hex | undefined

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

index.ts
import { getStarknetIdVerifierData } from "starkweb/core";
import { mainnet } from "starkweb/chains"; 
import { config } from "./config";
 
const verifierData = await getStarknetIdVerifierData(config, {
  starknetId: "0x123...",
  field: "twitter",
  verifier: "0x456...",
  chainId: mainnet.chain_id, 
});

Return Type

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

string

The verifier data value for the specified field.

Example

example.ts
import { getStarknetIdVerifierData } from "starkweb/core";
import { mainnet } from "starkweb/chains"; 
import { config } from "./config";
 
// Get verifier data on current chain
const twitterVerification = await getStarknetIdVerifierData(config, {
  starknetId: "0x123...", 
  field: "twitter", 
  verifier: "0x456...", 
});
console.log("Twitter verification:", twitterVerification);
 
// Get verifier data on specific chain
const mainnetVerification = await getStarknetIdVerifierData(config, {
  starknetId: "0x123...",
  field: "twitter",
  verifier: "0x456...",
  chainId: mainnet.chain_id, 
});

Error

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

TanStack Query

import {
  type GetStarknetIdVerifierDataData,
  type GetStarknetIdVerifierDataOptions,
  type GetStarknetIdVerifierDataQueryFnData,
  type GetStarknetIdVerifierDataQueryKey,
  getStarknetIdVerifierDataQueryKey,
  getStarknetIdVerifierDataQueryOptions,
} from "starkweb/query";