Skip to main content
Version: 6.11.0

Namespace: starknetId

Enumerations​

Variables​

StarknetIdMulticallContract​

• Const StarknetIdMulticallContract: "0x034ffb8f4452df7a613a0210824d6414dbadcddce6c6e19bf4ddc9e22ce5f970"

Defined in​

src/utils/starknetId.ts:189

Functions​

useDecoded​

â–¸ useDecoded(encoded): string

Decodes an array of BigInts into a string using the given algorithm.

Parameters​

NameTypeDescription
encodedbigint[]The encoded array of BigInts.

Returns​

string

The decoded string.

Example

const result = starknetId.useDecoded([3015206943634620n]);
// result = "starknetjs.stark"

Defined in​

src/utils/starknetId.ts:33


useEncoded​

â–¸ useEncoded(decoded): bigint

Encodes a string into a bigint value.

Parameters​

NameTypeDescription
decodedstringThe string to be encoded.

Returns​

bigint

The encoded bigint value.

Example

const result = starknetId.useEncoded('starknet.js');
// result = 3015206943634620n

Defined in​

src/utils/starknetId.ts:85


getStarknetIdContract​

â–¸ getStarknetIdContract(chainId): string

Returns the Starknet ID contract address based on the provided chain ID.

Parameters​

NameTypeDescription
chainIdStarknetChainIdThe chain ID of the Starknet network.

Returns​

string

The Starknet ID contract address.

Throws

Throws an error if the Starknet ID contract is not deployed on the network.

Example

const result = starknetId.getStarknetIdContract(constants.StarknetChainId.SN_SEPOLIA);
// result = "0x154bc2e1af9260b9e66af0e9c46fc757ff893b3ff6a85718a810baf1474"

Defined in​

src/utils/starknetId.ts:144


getStarknetIdIdentityContract​

â–¸ getStarknetIdIdentityContract(chainId): string

Returns the Starknet ID identity contract address for the given chain ID.

Parameters​

NameTypeDescription
chainIdStarknetChainIdThe chain ID for the specified network.

Returns​

string

The Starknet ID identity contract address for the specified network.

Throws

If the Starknet ID verifier contract is not deployed on the network.

Example

const result = starknetId.getStarknetIdIdentityContract(constants.StarknetChainId.SN_SEPOLIA);
// result = "0x3697660a0981d734780731949ecb2b4a38d6a58fc41629ed611e8defda"

Defined in​

src/utils/starknetId.ts:176


getStarknetIdMulticallContract​

â–¸ getStarknetIdMulticallContract(chainId): string

Returns the Starknet.id multicall contract address based on the provided chainId.

Parameters​

NameTypeDescription
chainIdStarknetChainIdThe chainId of the network.

Returns​

string

  • The address of the Starknet.id multicall contract.

Throws

  • If the Starknet.id multicall contract is not deployed on the network.

Example

const result = starknetId.getStarknetIdMulticallContract(constants.StarknetChainId.SN_SEPOLIA);
// result = "0x034ffb8f4452df7a613a0210824d6414dbadcddce6c6e19bf4ddc9e22ce5f970"

Defined in​

src/utils/starknetId.ts:204


getStarknetIdVerifierContract​

â–¸ getStarknetIdVerifierContract(chainId): string

Returns the address of the Starknet ID Verifier contract based on the specified chain ID.

Parameters​

NameTypeDescription
chainIdStarknetChainIdThe ID of the Starknet chain.

Returns​

string

  • The address of the Starknet ID Verifier contract.

Throws

  • If the Starknet ID Verifier contract is not deployed on the specified network.

Example

const result = starknetId.getStarknetIdVerifierContract(constants.StarknetChainId.SN_SEPOLIA);
// result = "0x60B94fEDe525f815AE5E8377A463e121C787cCCf3a36358Aa9B18c12c4D566"

Defined in​

src/utils/starknetId.ts:234


getStarknetIdPfpContract​

â–¸ getStarknetIdPfpContract(chainId): string

Retrieves the contract address of the Starknet.id profile picture verifier contract based on the given chain ID.

Parameters​

NameTypeDescription
chainIdStarknetChainIdThe chain ID of the network.

Returns​

string

  • The contract address of the Starknet.id profile picture verifier contract.

Throws

  • Throws an error if the Starknet.id profile picture verifier contract is not yet deployed on the network.

Example

const result = starknetId.getStarknetIdPfpContract(constants.StarknetChainId.SN_SEPOLIA);
// result = "0x9e7bdb8dabd02ea8cfc23b1d1c5278e46490f193f87516ed5ff2dfec02"

Defined in​

src/utils/starknetId.ts:264


getStarknetIdPopContract​

â–¸ getStarknetIdPopContract(chainId): string

Retrieves the Starknet ID Proof of Personhood (IdPop) verifier contract address for the given chain ID.

Parameters​

NameTypeDescription
chainIdStarknetChainIdThe chain ID of the Starknet network.

Returns​

string

  • The Starknet ID Pop contract address.

Throws

  • If the Starknet ID Pop contract is not deployed on the specified network.

Example

const result = starknetId.getStarknetIdPopContract(constants.StarknetChainId.SN_SEPOLIA);
// result = "0x15ae88ae054caa74090b89025c1595683f12edf7a4ed2ad0274de3e1d4a"

Defined in​

src/utils/starknetId.ts:296


execution​

â–¸ execution(staticEx?, ifEqual?, ifNotEqual?): CairoCustomEnum

Returns a CairoCustomEnum object.

Functions to build CairoCustomEnum for multiCall contracts

Parameters​

NameTypeDefault valueDescription
staticEx?ObjectundefinedAn optional object defining the "Static" value of the CairoCustomEnum.
ifEqual?number[]undefinedAn optional array defining the "IfEqual" value of the CairoCustomEnum.
ifNotEqual?number[]undefinedAn optional array defining the "IfNotEqual" value of the CairoCustomEnum.

Returns​

CairoCustomEnum

  • The created CairoCustomEnum object.

Example

const result: CairoCustomEnum = starknetId.execution(undefined, [1, 2, 3], undefined);
// result = CairoCustomEnum {
// variant: {
// Static: undefined,
// IfEqual: { '0': 1, '1': 2, '2': 3 },
// IfNotEqual: undefined
// }
// }

Defined in​

src/utils/starknetId.ts:331


dynamicFelt​

â–¸ dynamicFelt(hardcoded?, reference?): CairoCustomEnum

Creates a new instance of CairoCustomEnum.

Parameters​

NameTypeDefault valueDescription
hardcoded?BigNumberishundefinedThe hardcoded value for the CairoCustomEnum.
reference?number[]undefinedThe reference array for the CairoCustomEnum.

Returns​

CairoCustomEnum

The new instance of CairoCustomEnum.

Example

const result: CairoCustomEnum = starknetId.dynamicFelt(undefined, [1, 2]);
// result = CairoCustomEnum {
// variant: { Hardcoded: undefined, Reference: { '0': 1, '1': 2 } }
// }

Defined in​

src/utils/starknetId.ts:357


dynamicCallData​

â–¸ dynamicCallData(hardcoded?, reference?, arrayReference?): CairoCustomEnum

Creates a new instance of CairoCustomEnum with the given parameters.

Parameters​

NameTypeDefault valueDescription
hardcoded?BigNumberishundefinedThe hardcoded value.
reference?BigNumberish[]undefinedThe reference value (optional).
arrayReference?BigNumberish[]undefinedThe array reference value (optional).

Returns​

CairoCustomEnum

The new instance of CairoCustomEnum.

Example

const result: CairoCustomEnum = starknetId.dynamicCallData(undefined, [1, 2], undefined);
// result = CairoCustomEnum {
// variant: {
// Hardcoded: undefined,
// Reference: { '0': 1, '1': 2 },
// ArrayReference: undefined
// }
// }

Defined in​

src/utils/starknetId.ts:385