starknet 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +62 -4
- package/dist/index.global.js +315 -9
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +315 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +315 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [6.3.0](https://github.com/starknet-io/starknet.js/compare/v6.2.1...v6.3.0) (2024-03-11)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- update starknetId class and add getStarkProfile function ([ae71c97](https://github.com/starknet-io/starknet.js/commit/ae71c97b38974d4d7b3392532388957e1ea499bb))
|
|
6
|
+
|
|
7
|
+
## [6.2.1](https://github.com/starknet-io/starknet.js/compare/v6.2.0...v6.2.1) (2024-03-11)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- repair Cairo 1 nested and enum tuple handling ([ce2e541](https://github.com/starknet-io/starknet.js/commit/ce2e5417e6c42af17418408dc1ca6aab4c570473))
|
|
12
|
+
|
|
1
13
|
# [6.2.0](https://github.com/starknet-io/starknet.js/compare/v6.1.5...v6.2.0) (2024-03-07)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/dist/index.d.ts
CHANGED
|
@@ -3190,6 +3190,14 @@ type EstimateFeeAction = {
|
|
|
3190
3190
|
type: TransactionType.DEPLOY;
|
|
3191
3191
|
payload: UniversalDeployerContractPayload;
|
|
3192
3192
|
};
|
|
3193
|
+
type StarkProfile = {
|
|
3194
|
+
name?: string;
|
|
3195
|
+
profilePicture?: string;
|
|
3196
|
+
discord?: string;
|
|
3197
|
+
twitter?: string;
|
|
3198
|
+
github?: string;
|
|
3199
|
+
proofOfPersonhood?: boolean;
|
|
3200
|
+
};
|
|
3193
3201
|
|
|
3194
3202
|
declare enum ValidateType {
|
|
3195
3203
|
DEPLOY = "DEPLOY",
|
|
@@ -3453,6 +3461,7 @@ type index$2_StarkNetDomain = StarkNetDomain;
|
|
|
3453
3461
|
type index$2_StarkNetEnumType = StarkNetEnumType;
|
|
3454
3462
|
type index$2_StarkNetMerkleType = StarkNetMerkleType;
|
|
3455
3463
|
type index$2_StarkNetType = StarkNetType;
|
|
3464
|
+
type index$2_StarkProfile = StarkProfile;
|
|
3456
3465
|
type index$2_StateUpdate = StateUpdate;
|
|
3457
3466
|
type index$2_StateUpdateResponse = StateUpdateResponse;
|
|
3458
3467
|
type index$2_Storage = Storage;
|
|
@@ -3490,7 +3499,7 @@ type index$2_getEstimateFeeBulkOptions = getEstimateFeeBulkOptions;
|
|
|
3490
3499
|
type index$2_getSimulateTransactionOptions = getSimulateTransactionOptions;
|
|
3491
3500
|
type index$2_waitForTransactionOptions = waitForTransactionOptions;
|
|
3492
3501
|
declare namespace index$2 {
|
|
3493
|
-
export { type index$2_Abi as Abi, type index$2_AbiEntry as AbiEntry, type index$2_AbiEnums as AbiEnums, type index$2_AbiEvents as AbiEvents, type index$2_AbiStructs as AbiStructs, type index$2_AccountInvocationItem as AccountInvocationItem, type index$2_AccountInvocations as AccountInvocations, type index$2_AccountInvocationsFactoryDetails as AccountInvocationsFactoryDetails, type index$2_AllowArray as AllowArray, type index$2_Args as Args, type index$2_ArgsOrCalldata as ArgsOrCalldata, type index$2_ArgsOrCalldataWithOptions as ArgsOrCalldataWithOptions, type index$2_ArraySignatureType as ArraySignatureType, type index$2_AsyncContractFunction as AsyncContractFunction, type index$2_BigNumberish as BigNumberish, type Block$1 as Block, type index$2_BlockIdentifier as BlockIdentifier, type index$2_BlockNumber as BlockNumber, index$2_BlockStatus as BlockStatus, index$2_BlockTag as BlockTag, type index$2_BlockWithTxHashes as BlockWithTxHashes, type index$2_Builtins as Builtins, type index$2_ByteArray as ByteArray, type index$2_ByteCode as ByteCode, type index$2_Cairo1Event as Cairo1Event, type index$2_CairoAssembly as CairoAssembly, type index$2_CairoContract as CairoContract, type index$2_CairoEnum as CairoEnum, type index$2_CairoVersion as CairoVersion, type index$2_Call as Call, type index$2_CallContractResponse as CallContractResponse, type index$2_CallDetails as CallDetails, type index$2_CallOptions as CallOptions, type index$2_CallStruct as CallStruct, type index$2_Calldata as Calldata, type index$2_CompiledContract as CompiledContract, type index$2_CompiledSierra as CompiledSierra, type index$2_CompiledSierraCasm as CompiledSierraCasm, type index$2_CompilerVersion as CompilerVersion, type index$2_CompleteDeclareContractPayload as CompleteDeclareContractPayload, type index$2_CompressedProgram as CompressedProgram, type index$2_ContractClass as ContractClass, type index$2_ContractClassPayload as ContractClassPayload, type index$2_ContractClassResponse as ContractClassResponse, type index$2_ContractEntryPointFields as ContractEntryPointFields, type index$2_ContractFunction as ContractFunction, type index$2_ContractOptions as ContractOptions, type index$2_ContractVersion as ContractVersion, type index$2_DeclareAndDeployContractPayload as DeclareAndDeployContractPayload, type index$2_DeclareContractPayload as DeclareContractPayload, type index$2_DeclareContractResponse as DeclareContractResponse, type index$2_DeclareContractTransaction as DeclareContractTransaction, type index$2_DeclareDeployUDCResponse as DeclareDeployUDCResponse, type index$2_DeclareSignerDetails as DeclareSignerDetails, type index$2_DeclareTransactionReceiptResponse as DeclareTransactionReceiptResponse, type index$2_DeployAccountContractPayload as DeployAccountContractPayload, type index$2_DeployAccountContractTransaction as DeployAccountContractTransaction, type index$2_DeployAccountSignerDetails as DeployAccountSignerDetails, type index$2_DeployAccountTransactionReceiptResponse as DeployAccountTransactionReceiptResponse, type index$2_DeployContractResponse as DeployContractResponse, type index$2_DeployContractUDCResponse as DeployContractUDCResponse, type index$2_DeployTransactionReceiptResponse as DeployTransactionReceiptResponse, type index$2_Details as Details, index$2_EntryPointType as EntryPointType, type index$2_EntryPointsByType as EntryPointsByType, type index$2_EnumAbi as EnumAbi, type index$2_EstimateFee as EstimateFee, type index$2_EstimateFeeAction as EstimateFeeAction, type index$2_EstimateFeeBulk as EstimateFeeBulk, type index$2_EstimateFeeDetails as EstimateFeeDetails, type index$2_EstimateFeeResponse as EstimateFeeResponse, type index$2_EstimateFeeResponseBulk as EstimateFeeResponseBulk, type index$2_EventAbi as EventAbi, type index$2_EventEntry as EventEntry, type index$2_FeeEstimate as FeeEstimate, type index$2_FunctionAbi as FunctionAbi, type index$2_GetBlockResponse as GetBlockResponse, type index$2_GetTransactionReceiptResponse as GetTransactionReceiptResponse, type index$2_GetTransactionResponse as GetTransactionResponse, type index$2_HexCalldata as HexCalldata, type index$2_Invocation as Invocation, type index$2_Invocations as Invocations, type index$2_InvocationsDetails as InvocationsDetails, type index$2_InvocationsDetailsWithNonce as InvocationsDetailsWithNonce, type index$2_InvocationsSignerDetails as InvocationsSignerDetails, type index$2_InvokeFunctionResponse as InvokeFunctionResponse, type index$2_InvokeOptions as InvokeOptions, type index$2_InvokeTransactionReceiptResponse as InvokeTransactionReceiptResponse, type index$2_L1HandlerTransactionReceiptResponse as L1HandlerTransactionReceiptResponse, type index$2_LegacyCompiledContract as LegacyCompiledContract, type index$2_LegacyContractClass as LegacyContractClass, type index$2_LegacyEvent as LegacyEvent, index$2_Literal as Literal, type index$2_MultiDeployContractResponse as MultiDeployContractResponse, type index$2_MultiType as MultiType, type index$2_Nonce as Nonce, type index$2_OptionalPayload as OptionalPayload, type index$2_ParsedEvent as ParsedEvent, type index$2_ParsedEvents as ParsedEvents, type index$2_ParsedStruct as ParsedStruct, type index$2_PendingBlock as PendingBlock, type index$2_PendingStateUpdate as PendingStateUpdate, type index$2_Program as Program, type index$2_ProviderOptions as ProviderOptions, type index$2_PythonicHints as PythonicHints, index$3 as RPC, type index$2_RawArgs as RawArgs, type index$2_RawArgsArray as RawArgsArray, type index$2_RawArgsObject as RawArgsObject, type index$2_RawCalldata as RawCalldata, type index$2_Result as Result, type index$2_RpcProviderOptions as RpcProviderOptions, index$2_SIMULATION_FLAG as SIMULATION_FLAG, type index$2_SierraContractClass as SierraContractClass, type index$2_SierraContractEntryPointFields as SierraContractEntryPointFields, type index$2_SierraEntryPointsByType as SierraEntryPointsByType, type index$2_SierraProgramDebugInfo as SierraProgramDebugInfo, type index$2_Signature as Signature, type index$2_SimulateTransactionDetails as SimulateTransactionDetails, type index$2_SimulateTransactionResponse as SimulateTransactionResponse, type index$2_SimulatedTransaction as SimulatedTransaction, type index$2_SimulationFlags as SimulationFlags, type index$2_StarkNetDomain as StarkNetDomain, type index$2_StarkNetEnumType as StarkNetEnumType, type index$2_StarkNetMerkleType as StarkNetMerkleType, type index$2_StarkNetType as StarkNetType, type index$2_StateUpdate as StateUpdate, type index$2_StateUpdateResponse as StateUpdateResponse, type index$2_Storage as Storage, type index$2_StructAbi as StructAbi, index$2_TransactionExecutionStatus as TransactionExecutionStatus, index$2_TransactionFinalityStatus as TransactionFinalityStatus, type index$2_TransactionReceipt as TransactionReceipt, index$2_TransactionStatus as TransactionStatus, index$2_TransactionType as TransactionType, type index$2_Tupled as Tupled, type index$2_TypedData as TypedData, index$2_TypedDataRevision as TypedDataRevision, index$2_Uint as Uint, type index$2_Uint256 as Uint256, type index$2_UniversalDeployerContractPayload as UniversalDeployerContractPayload, type index$2_UniversalDetails as UniversalDetails, type index$2_V2DeclareSignerDetails as V2DeclareSignerDetails, type index$2_V2DeployAccountSignerDetails as V2DeployAccountSignerDetails, type index$2_V2InvocationsSignerDetails as V2InvocationsSignerDetails, type index$2_V3DeclareSignerDetails as V3DeclareSignerDetails, type index$2_V3DeployAccountSignerDetails as V3DeployAccountSignerDetails, type index$2_V3InvocationsSignerDetails as V3InvocationsSignerDetails, type index$2_V3TransactionDetails as V3TransactionDetails, index$2_ValidateType as ValidateType, type index$2_WeierstrassSignatureType as WeierstrassSignatureType, type index$2_getContractVersionOptions as getContractVersionOptions, type index$2_getEstimateFeeBulkOptions as getEstimateFeeBulkOptions, type index$2_getSimulateTransactionOptions as getSimulateTransactionOptions, type index$2_waitForTransactionOptions as waitForTransactionOptions };
|
|
3502
|
+
export { type index$2_Abi as Abi, type index$2_AbiEntry as AbiEntry, type index$2_AbiEnums as AbiEnums, type index$2_AbiEvents as AbiEvents, type index$2_AbiStructs as AbiStructs, type index$2_AccountInvocationItem as AccountInvocationItem, type index$2_AccountInvocations as AccountInvocations, type index$2_AccountInvocationsFactoryDetails as AccountInvocationsFactoryDetails, type index$2_AllowArray as AllowArray, type index$2_Args as Args, type index$2_ArgsOrCalldata as ArgsOrCalldata, type index$2_ArgsOrCalldataWithOptions as ArgsOrCalldataWithOptions, type index$2_ArraySignatureType as ArraySignatureType, type index$2_AsyncContractFunction as AsyncContractFunction, type index$2_BigNumberish as BigNumberish, type Block$1 as Block, type index$2_BlockIdentifier as BlockIdentifier, type index$2_BlockNumber as BlockNumber, index$2_BlockStatus as BlockStatus, index$2_BlockTag as BlockTag, type index$2_BlockWithTxHashes as BlockWithTxHashes, type index$2_Builtins as Builtins, type index$2_ByteArray as ByteArray, type index$2_ByteCode as ByteCode, type index$2_Cairo1Event as Cairo1Event, type index$2_CairoAssembly as CairoAssembly, type index$2_CairoContract as CairoContract, type index$2_CairoEnum as CairoEnum, type index$2_CairoVersion as CairoVersion, type index$2_Call as Call, type index$2_CallContractResponse as CallContractResponse, type index$2_CallDetails as CallDetails, type index$2_CallOptions as CallOptions, type index$2_CallStruct as CallStruct, type index$2_Calldata as Calldata, type index$2_CompiledContract as CompiledContract, type index$2_CompiledSierra as CompiledSierra, type index$2_CompiledSierraCasm as CompiledSierraCasm, type index$2_CompilerVersion as CompilerVersion, type index$2_CompleteDeclareContractPayload as CompleteDeclareContractPayload, type index$2_CompressedProgram as CompressedProgram, type index$2_ContractClass as ContractClass, type index$2_ContractClassPayload as ContractClassPayload, type index$2_ContractClassResponse as ContractClassResponse, type index$2_ContractEntryPointFields as ContractEntryPointFields, type index$2_ContractFunction as ContractFunction, type index$2_ContractOptions as ContractOptions, type index$2_ContractVersion as ContractVersion, type index$2_DeclareAndDeployContractPayload as DeclareAndDeployContractPayload, type index$2_DeclareContractPayload as DeclareContractPayload, type index$2_DeclareContractResponse as DeclareContractResponse, type index$2_DeclareContractTransaction as DeclareContractTransaction, type index$2_DeclareDeployUDCResponse as DeclareDeployUDCResponse, type index$2_DeclareSignerDetails as DeclareSignerDetails, type index$2_DeclareTransactionReceiptResponse as DeclareTransactionReceiptResponse, type index$2_DeployAccountContractPayload as DeployAccountContractPayload, type index$2_DeployAccountContractTransaction as DeployAccountContractTransaction, type index$2_DeployAccountSignerDetails as DeployAccountSignerDetails, type index$2_DeployAccountTransactionReceiptResponse as DeployAccountTransactionReceiptResponse, type index$2_DeployContractResponse as DeployContractResponse, type index$2_DeployContractUDCResponse as DeployContractUDCResponse, type index$2_DeployTransactionReceiptResponse as DeployTransactionReceiptResponse, type index$2_Details as Details, index$2_EntryPointType as EntryPointType, type index$2_EntryPointsByType as EntryPointsByType, type index$2_EnumAbi as EnumAbi, type index$2_EstimateFee as EstimateFee, type index$2_EstimateFeeAction as EstimateFeeAction, type index$2_EstimateFeeBulk as EstimateFeeBulk, type index$2_EstimateFeeDetails as EstimateFeeDetails, type index$2_EstimateFeeResponse as EstimateFeeResponse, type index$2_EstimateFeeResponseBulk as EstimateFeeResponseBulk, type index$2_EventAbi as EventAbi, type index$2_EventEntry as EventEntry, type index$2_FeeEstimate as FeeEstimate, type index$2_FunctionAbi as FunctionAbi, type index$2_GetBlockResponse as GetBlockResponse, type index$2_GetTransactionReceiptResponse as GetTransactionReceiptResponse, type index$2_GetTransactionResponse as GetTransactionResponse, type index$2_HexCalldata as HexCalldata, type index$2_Invocation as Invocation, type index$2_Invocations as Invocations, type index$2_InvocationsDetails as InvocationsDetails, type index$2_InvocationsDetailsWithNonce as InvocationsDetailsWithNonce, type index$2_InvocationsSignerDetails as InvocationsSignerDetails, type index$2_InvokeFunctionResponse as InvokeFunctionResponse, type index$2_InvokeOptions as InvokeOptions, type index$2_InvokeTransactionReceiptResponse as InvokeTransactionReceiptResponse, type index$2_L1HandlerTransactionReceiptResponse as L1HandlerTransactionReceiptResponse, type index$2_LegacyCompiledContract as LegacyCompiledContract, type index$2_LegacyContractClass as LegacyContractClass, type index$2_LegacyEvent as LegacyEvent, index$2_Literal as Literal, type index$2_MultiDeployContractResponse as MultiDeployContractResponse, type index$2_MultiType as MultiType, type index$2_Nonce as Nonce, type index$2_OptionalPayload as OptionalPayload, type index$2_ParsedEvent as ParsedEvent, type index$2_ParsedEvents as ParsedEvents, type index$2_ParsedStruct as ParsedStruct, type index$2_PendingBlock as PendingBlock, type index$2_PendingStateUpdate as PendingStateUpdate, type index$2_Program as Program, type index$2_ProviderOptions as ProviderOptions, type index$2_PythonicHints as PythonicHints, index$3 as RPC, type index$2_RawArgs as RawArgs, type index$2_RawArgsArray as RawArgsArray, type index$2_RawArgsObject as RawArgsObject, type index$2_RawCalldata as RawCalldata, type index$2_Result as Result, type index$2_RpcProviderOptions as RpcProviderOptions, index$2_SIMULATION_FLAG as SIMULATION_FLAG, type index$2_SierraContractClass as SierraContractClass, type index$2_SierraContractEntryPointFields as SierraContractEntryPointFields, type index$2_SierraEntryPointsByType as SierraEntryPointsByType, type index$2_SierraProgramDebugInfo as SierraProgramDebugInfo, type index$2_Signature as Signature, type index$2_SimulateTransactionDetails as SimulateTransactionDetails, type index$2_SimulateTransactionResponse as SimulateTransactionResponse, type index$2_SimulatedTransaction as SimulatedTransaction, type index$2_SimulationFlags as SimulationFlags, type index$2_StarkNetDomain as StarkNetDomain, type index$2_StarkNetEnumType as StarkNetEnumType, type index$2_StarkNetMerkleType as StarkNetMerkleType, type index$2_StarkNetType as StarkNetType, type index$2_StarkProfile as StarkProfile, type index$2_StateUpdate as StateUpdate, type index$2_StateUpdateResponse as StateUpdateResponse, type index$2_Storage as Storage, type index$2_StructAbi as StructAbi, index$2_TransactionExecutionStatus as TransactionExecutionStatus, index$2_TransactionFinalityStatus as TransactionFinalityStatus, type index$2_TransactionReceipt as TransactionReceipt, index$2_TransactionStatus as TransactionStatus, index$2_TransactionType as TransactionType, type index$2_Tupled as Tupled, type index$2_TypedData as TypedData, index$2_TypedDataRevision as TypedDataRevision, index$2_Uint as Uint, type index$2_Uint256 as Uint256, type index$2_UniversalDeployerContractPayload as UniversalDeployerContractPayload, type index$2_UniversalDetails as UniversalDetails, type index$2_V2DeclareSignerDetails as V2DeclareSignerDetails, type index$2_V2DeployAccountSignerDetails as V2DeployAccountSignerDetails, type index$2_V2InvocationsSignerDetails as V2InvocationsSignerDetails, type index$2_V3DeclareSignerDetails as V3DeclareSignerDetails, type index$2_V3DeployAccountSignerDetails as V3DeployAccountSignerDetails, type index$2_V3InvocationsSignerDetails as V3InvocationsSignerDetails, type index$2_V3TransactionDetails as V3TransactionDetails, index$2_ValidateType as ValidateType, type index$2_WeierstrassSignatureType as WeierstrassSignatureType, type index$2_getContractVersionOptions as getContractVersionOptions, type index$2_getEstimateFeeBulkOptions as getEstimateFeeBulkOptions, type index$2_getSimulateTransactionOptions as getSimulateTransactionOptions, type index$2_waitForTransactionOptions as waitForTransactionOptions };
|
|
3494
3503
|
}
|
|
3495
3504
|
|
|
3496
3505
|
declare class RpcChannel$1 {
|
|
@@ -5708,8 +5717,10 @@ declare class RpcProvider$1 implements ProviderInterface {
|
|
|
5708
5717
|
declare class StarknetId {
|
|
5709
5718
|
getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise<string>;
|
|
5710
5719
|
getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise<string>;
|
|
5720
|
+
getStarkProfile(address: BigNumberish, StarknetIdContract?: string, StarknetIdIdentityContract?: string, StarknetIdVerifierContract?: string, StarknetIdPfpContract?: string, StarknetIdPopContract?: string, StarknetIdMulticallContract?: string): Promise<StarkProfile>;
|
|
5711
5721
|
static getStarkName(provider: ProviderInterface, address: BigNumberish, StarknetIdContract?: string): Promise<string>;
|
|
5712
5722
|
static getAddressFromStarkName(provider: ProviderInterface, name: string, StarknetIdContract?: string): Promise<string>;
|
|
5723
|
+
static getStarkProfile(provider: ProviderInterface, address: BigNumberish, StarknetIdContract?: string, StarknetIdIdentityContract?: string, StarknetIdVerifierContract?: string, StarknetIdPfpContract?: string, StarknetIdPopContract?: string, StarknetIdMulticallContract?: string): Promise<StarkProfile>;
|
|
5713
5724
|
}
|
|
5714
5725
|
|
|
5715
5726
|
declare const RpcProvider_base: ts_mixer_dist_types_types.Class<any[], RpcProvider$1 & StarknetId, typeof RpcProvider$1 & typeof StarknetId>;
|
|
@@ -7148,17 +7159,64 @@ declare function useDecoded(encoded: bigint[]): string;
|
|
|
7148
7159
|
declare function useEncoded(decoded: string): bigint;
|
|
7149
7160
|
declare const enum StarknetIdContract {
|
|
7150
7161
|
MAINNET = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678",
|
|
7151
|
-
TESTNET = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce"
|
|
7162
|
+
TESTNET = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce",
|
|
7163
|
+
TESTNET_SEPOLIA = "0x5847d20f9757de24395a7b3b47303684003753858737bf288716855dfb0aaf2"
|
|
7152
7164
|
}
|
|
7153
7165
|
declare function getStarknetIdContract(chainId: StarknetChainId): string;
|
|
7166
|
+
declare const enum StarknetIdIdentityContract {
|
|
7167
|
+
MAINNET = "0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af",
|
|
7168
|
+
TESTNET = "0x783a9097b26eae0586373b2ce0ed3529ddc44069d1e0fbc4f66d42b69d6850d",
|
|
7169
|
+
TESTNET_SEPOLIA = "0x718d9172f6e36183abeeff1a0db76a1851cef4ed9b9c13896da79ef4bfcb4d0"
|
|
7170
|
+
}
|
|
7171
|
+
declare function getStarknetIdIdentityContract(chainId: StarknetChainId): string;
|
|
7172
|
+
declare const StarknetIdMulticallContract = "0x034ffb8f4452df7a613a0210824d6414dbadcddce6c6e19bf4ddc9e22ce5f970";
|
|
7173
|
+
declare function getStarknetIdMulticallContract(chainId: StarknetChainId): string;
|
|
7174
|
+
declare const enum StarknetIdVerifierContract {
|
|
7175
|
+
MAINNET = "0x07d14dfd8ee95b41fce179170d88ba1f0d5a512e13aeb232f19cfeec0a88f8bf",
|
|
7176
|
+
TESTNET = "0x057c942544063c3aea6ea6c37009cc9d1beacd750cb6801549a129c7265f0f11",
|
|
7177
|
+
TESTNET_SEPOLIA = "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf"
|
|
7178
|
+
}
|
|
7179
|
+
declare function getStarknetIdVerifierContract(chainId: StarknetChainId): string;
|
|
7180
|
+
declare const enum StarknetIdPfpContract {
|
|
7181
|
+
MAINNET = "0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a32306aff7d59c7",
|
|
7182
|
+
TESTNET = "0x03cac3228b434259734ee0e4ff445f642206ea11adace7e4f45edd2596748698",
|
|
7183
|
+
TESTNET_SEPOLIA = "0x070c035557d6fed57eed2ed7fa861616b487f8a95439347b805639ca076f29f0"
|
|
7184
|
+
}
|
|
7185
|
+
declare function getStarknetIdPfpContract(chainId: StarknetChainId): string;
|
|
7186
|
+
declare const enum StarknetIdPopContract {
|
|
7187
|
+
MAINNET = "0x0293eb2ba9862f762bd3036586d5755a782bd22e6f5028320f1d0405fd47bff4",
|
|
7188
|
+
TESTNET = "0x03528caf090179e337931ee669a5b0214041e1bae30d460ff07d2cea2c7a9106",
|
|
7189
|
+
TESTNET_SEPOLIA = "0x00f80f68443becd0e0a4a08ff5734e36dd8028507333e4a0ec034dcfdf1b793e"
|
|
7190
|
+
}
|
|
7191
|
+
declare function getStarknetIdPopContract(chainId: StarknetChainId): string;
|
|
7192
|
+
declare function execution(staticEx: {} | undefined, ifEqual?: number[] | undefined, ifNotEqual?: number[] | undefined): CairoCustomEnum;
|
|
7193
|
+
declare function dynamicFelt(hardcoded: BigNumberish | undefined, reference?: number[] | undefined): CairoCustomEnum;
|
|
7194
|
+
declare function dynamicCallData(hardcoded: BigNumberish | undefined, reference?: BigNumberish[] | undefined, arrayReference?: BigNumberish[] | undefined): CairoCustomEnum;
|
|
7154
7195
|
|
|
7155
7196
|
type starknetId_StarknetIdContract = StarknetIdContract;
|
|
7156
7197
|
declare const starknetId_StarknetIdContract: typeof StarknetIdContract;
|
|
7198
|
+
type starknetId_StarknetIdIdentityContract = StarknetIdIdentityContract;
|
|
7199
|
+
declare const starknetId_StarknetIdIdentityContract: typeof StarknetIdIdentityContract;
|
|
7200
|
+
declare const starknetId_StarknetIdMulticallContract: typeof StarknetIdMulticallContract;
|
|
7201
|
+
type starknetId_StarknetIdPfpContract = StarknetIdPfpContract;
|
|
7202
|
+
declare const starknetId_StarknetIdPfpContract: typeof StarknetIdPfpContract;
|
|
7203
|
+
type starknetId_StarknetIdPopContract = StarknetIdPopContract;
|
|
7204
|
+
declare const starknetId_StarknetIdPopContract: typeof StarknetIdPopContract;
|
|
7205
|
+
type starknetId_StarknetIdVerifierContract = StarknetIdVerifierContract;
|
|
7206
|
+
declare const starknetId_StarknetIdVerifierContract: typeof StarknetIdVerifierContract;
|
|
7207
|
+
declare const starknetId_dynamicCallData: typeof dynamicCallData;
|
|
7208
|
+
declare const starknetId_dynamicFelt: typeof dynamicFelt;
|
|
7209
|
+
declare const starknetId_execution: typeof execution;
|
|
7157
7210
|
declare const starknetId_getStarknetIdContract: typeof getStarknetIdContract;
|
|
7211
|
+
declare const starknetId_getStarknetIdIdentityContract: typeof getStarknetIdIdentityContract;
|
|
7212
|
+
declare const starknetId_getStarknetIdMulticallContract: typeof getStarknetIdMulticallContract;
|
|
7213
|
+
declare const starknetId_getStarknetIdPfpContract: typeof getStarknetIdPfpContract;
|
|
7214
|
+
declare const starknetId_getStarknetIdPopContract: typeof getStarknetIdPopContract;
|
|
7215
|
+
declare const starknetId_getStarknetIdVerifierContract: typeof getStarknetIdVerifierContract;
|
|
7158
7216
|
declare const starknetId_useDecoded: typeof useDecoded;
|
|
7159
7217
|
declare const starknetId_useEncoded: typeof useEncoded;
|
|
7160
7218
|
declare namespace starknetId {
|
|
7161
|
-
export { starknetId_StarknetIdContract as StarknetIdContract, starknetId_getStarknetIdContract as getStarknetIdContract, starknetId_useDecoded as useDecoded, starknetId_useEncoded as useEncoded };
|
|
7219
|
+
export { starknetId_StarknetIdContract as StarknetIdContract, starknetId_StarknetIdIdentityContract as StarknetIdIdentityContract, starknetId_StarknetIdMulticallContract as StarknetIdMulticallContract, starknetId_StarknetIdPfpContract as StarknetIdPfpContract, starknetId_StarknetIdPopContract as StarknetIdPopContract, starknetId_StarknetIdVerifierContract as StarknetIdVerifierContract, starknetId_dynamicCallData as dynamicCallData, starknetId_dynamicFelt as dynamicFelt, starknetId_execution as execution, starknetId_getStarknetIdContract as getStarknetIdContract, starknetId_getStarknetIdIdentityContract as getStarknetIdIdentityContract, starknetId_getStarknetIdMulticallContract as getStarknetIdMulticallContract, starknetId_getStarknetIdPfpContract as getStarknetIdPfpContract, starknetId_getStarknetIdPopContract as getStarknetIdPopContract, starknetId_getStarknetIdVerifierContract as getStarknetIdVerifierContract, starknetId_useDecoded as useDecoded, starknetId_useEncoded as useEncoded };
|
|
7162
7220
|
}
|
|
7163
7221
|
|
|
7164
7222
|
/**
|
|
@@ -7533,4 +7591,4 @@ declare function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse): {
|
|
|
7533
7591
|
/** @deprecated prefer the 'num' naming */
|
|
7534
7592
|
declare const number: typeof num;
|
|
7535
7593
|
|
|
7536
|
-
export { type Abi, type AbiEntry, type AbiEnums, type AbiEvents, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AllowArray, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type Cairo1Event, type CairoAssembly, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallStruct, type Calldata, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, ContractFactory, type ContractFactoryParams, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, CustomError, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransactionReceiptResponse, type Details, EntryPointType, type EntryPointsByType, type EnumAbi, type EstimateFee, type EstimateFeeAction, type EstimateFeeBulk, type EstimateFeeDetails, type EstimateFeeResponse, type EstimateFeeResponseBulk, EthSigner, type EventAbi, type EventEntry, type FeeEstimate, type FunctionAbi, GatewayError, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type HexCalldata, HttpError, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeOptions, type InvokeTransactionReceiptResponse, type L1HandlerTransactionReceiptResponse, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type MultiDeployContractResponse, type MultiType, type Nonce, type OptionalPayload, type ParsedEvent, type ParsedEvents, type ParsedStruct, type PendingBlock, type PendingStateUpdate, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type PythonicHints, index$3 as RPC, rpc_0_6 as RPC06, rpc_0_7 as RPC07, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Result, RpcChannel, RpcProvider, type RpcProviderOptions, SIMULATION_FLAG, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type SimulateTransactionDetails, type SimulateTransactionResponse, type SimulatedTransaction, type SimulationFlags, type StarkNetDomain, type StarkNetEnumType, type StarkNetMerkleType, type StarkNetType, type StateUpdate, type StateUpdateResponse, type Storage, type StructAbi, TransactionExecutionStatus, TransactionFinalityStatus, type TransactionReceipt, TransactionStatus, TransactionType, type Tupled, type TypedContractV2, type TypedData, TypedDataRevision, Uint, type Uint256, type UniversalDeployerContractPayload, type UniversalDetails, type V2DeclareSignerDetails, type V2DeployAccountSignerDetails, type V2InvocationsSignerDetails, type V3DeclareSignerDetails, type V3DeployAccountSignerDetails, type V3InvocationsSignerDetails, type V3TransactionDetails, ValidateType, type WeierstrassSignatureType, addAddressPadding, buildUrl, byteArray, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, eth, index as events, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, type getSimulateTransactionOptions, index$1 as hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index$2 as types, uint256$1 as uint256, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, type waitForTransactionOptions };
|
|
7594
|
+
export { type Abi, type AbiEntry, type AbiEnums, type AbiEvents, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AllowArray, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type Cairo1Event, type CairoAssembly, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallStruct, type Calldata, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, ContractFactory, type ContractFactoryParams, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, CustomError, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransactionReceiptResponse, type Details, EntryPointType, type EntryPointsByType, type EnumAbi, type EstimateFee, type EstimateFeeAction, type EstimateFeeBulk, type EstimateFeeDetails, type EstimateFeeResponse, type EstimateFeeResponseBulk, EthSigner, type EventAbi, type EventEntry, type FeeEstimate, type FunctionAbi, GatewayError, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type HexCalldata, HttpError, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeOptions, type InvokeTransactionReceiptResponse, type L1HandlerTransactionReceiptResponse, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type MultiDeployContractResponse, type MultiType, type Nonce, type OptionalPayload, type ParsedEvent, type ParsedEvents, type ParsedStruct, type PendingBlock, type PendingStateUpdate, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type PythonicHints, index$3 as RPC, rpc_0_6 as RPC06, rpc_0_7 as RPC07, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Result, RpcChannel, RpcProvider, type RpcProviderOptions, SIMULATION_FLAG, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type SimulateTransactionDetails, type SimulateTransactionResponse, type SimulatedTransaction, type SimulationFlags, type StarkNetDomain, type StarkNetEnumType, type StarkNetMerkleType, type StarkNetType, type StarkProfile, type StateUpdate, type StateUpdateResponse, type Storage, type StructAbi, TransactionExecutionStatus, TransactionFinalityStatus, type TransactionReceipt, TransactionStatus, TransactionType, type Tupled, type TypedContractV2, type TypedData, TypedDataRevision, Uint, type Uint256, type UniversalDeployerContractPayload, type UniversalDetails, type V2DeclareSignerDetails, type V2DeployAccountSignerDetails, type V2InvocationsSignerDetails, type V3DeclareSignerDetails, type V3DeployAccountSignerDetails, type V3InvocationsSignerDetails, type V3TransactionDetails, ValidateType, type WeierstrassSignatureType, addAddressPadding, buildUrl, byteArray, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, eth, index as events, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, type getSimulateTransactionOptions, index$1 as hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index$2 as types, uint256$1 as uint256, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, type waitForTransactionOptions };
|
package/dist/index.global.js
CHANGED
|
@@ -16773,13 +16773,40 @@ var starknet = (() => {
|
|
|
16773
16773
|
}
|
|
16774
16774
|
return recomposed;
|
|
16775
16775
|
}
|
|
16776
|
+
function getClosureOffset(input, open, close) {
|
|
16777
|
+
for (let i = 0, counter = 0; i < input.length; i++) {
|
|
16778
|
+
if (input[i] === open) {
|
|
16779
|
+
counter++;
|
|
16780
|
+
} else if (input[i] === close && --counter === 0) {
|
|
16781
|
+
return i;
|
|
16782
|
+
}
|
|
16783
|
+
}
|
|
16784
|
+
return Number.POSITIVE_INFINITY;
|
|
16785
|
+
}
|
|
16776
16786
|
function extractCairo1Tuple(type) {
|
|
16777
|
-
const
|
|
16778
|
-
const
|
|
16779
|
-
|
|
16780
|
-
|
|
16781
|
-
|
|
16782
|
-
|
|
16787
|
+
const input = type.slice(1, -1);
|
|
16788
|
+
const result = [];
|
|
16789
|
+
let currentIndex = 0;
|
|
16790
|
+
let limitIndex;
|
|
16791
|
+
while (currentIndex < input.length) {
|
|
16792
|
+
switch (true) {
|
|
16793
|
+
case input[currentIndex] === "(": {
|
|
16794
|
+
limitIndex = currentIndex + getClosureOffset(input.slice(currentIndex), "(", ")") + 1;
|
|
16795
|
+
break;
|
|
16796
|
+
}
|
|
16797
|
+
case (input.startsWith("core::result::Result::<", currentIndex) || input.startsWith("core::array::Array::<", currentIndex) || input.startsWith("core::option::Option::<", currentIndex)): {
|
|
16798
|
+
limitIndex = currentIndex + getClosureOffset(input.slice(currentIndex), "<", ">") + 1;
|
|
16799
|
+
break;
|
|
16800
|
+
}
|
|
16801
|
+
default: {
|
|
16802
|
+
const commaIndex = input.indexOf(",", currentIndex);
|
|
16803
|
+
limitIndex = commaIndex !== -1 ? commaIndex : Number.POSITIVE_INFINITY;
|
|
16804
|
+
}
|
|
16805
|
+
}
|
|
16806
|
+
result.push(input.slice(currentIndex, limitIndex));
|
|
16807
|
+
currentIndex = limitIndex + 2;
|
|
16808
|
+
}
|
|
16809
|
+
return result;
|
|
16783
16810
|
}
|
|
16784
16811
|
function extractTupleMemberTypes(type) {
|
|
16785
16812
|
if (isCairo1Type(type)) {
|
|
@@ -25007,7 +25034,20 @@ var starknet = (() => {
|
|
|
25007
25034
|
var starknetId_exports = {};
|
|
25008
25035
|
__export(starknetId_exports, {
|
|
25009
25036
|
StarknetIdContract: () => StarknetIdContract,
|
|
25037
|
+
StarknetIdIdentityContract: () => StarknetIdIdentityContract,
|
|
25038
|
+
StarknetIdMulticallContract: () => StarknetIdMulticallContract,
|
|
25039
|
+
StarknetIdPfpContract: () => StarknetIdPfpContract,
|
|
25040
|
+
StarknetIdPopContract: () => StarknetIdPopContract,
|
|
25041
|
+
StarknetIdVerifierContract: () => StarknetIdVerifierContract,
|
|
25042
|
+
dynamicCallData: () => dynamicCallData,
|
|
25043
|
+
dynamicFelt: () => dynamicFelt,
|
|
25044
|
+
execution: () => execution,
|
|
25010
25045
|
getStarknetIdContract: () => getStarknetIdContract,
|
|
25046
|
+
getStarknetIdIdentityContract: () => getStarknetIdIdentityContract,
|
|
25047
|
+
getStarknetIdMulticallContract: () => getStarknetIdMulticallContract,
|
|
25048
|
+
getStarknetIdPfpContract: () => getStarknetIdPfpContract,
|
|
25049
|
+
getStarknetIdPopContract: () => getStarknetIdPopContract,
|
|
25050
|
+
getStarknetIdVerifierContract: () => getStarknetIdVerifierContract,
|
|
25011
25051
|
useDecoded: () => useDecoded,
|
|
25012
25052
|
useEncoded: () => useEncoded
|
|
25013
25053
|
});
|
|
@@ -25095,6 +25135,7 @@ var starknet = (() => {
|
|
|
25095
25135
|
var StarknetIdContract = /* @__PURE__ */ ((StarknetIdContract2) => {
|
|
25096
25136
|
StarknetIdContract2["MAINNET"] = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678";
|
|
25097
25137
|
StarknetIdContract2["TESTNET"] = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce";
|
|
25138
|
+
StarknetIdContract2["TESTNET_SEPOLIA"] = "0x5847d20f9757de24395a7b3b47303684003753858737bf288716855dfb0aaf2";
|
|
25098
25139
|
return StarknetIdContract2;
|
|
25099
25140
|
})(StarknetIdContract || {});
|
|
25100
25141
|
function getStarknetIdContract(chainId) {
|
|
@@ -25103,10 +25144,121 @@ var starknet = (() => {
|
|
|
25103
25144
|
return "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678" /* MAINNET */;
|
|
25104
25145
|
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25105
25146
|
return "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce" /* TESTNET */;
|
|
25147
|
+
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25148
|
+
return "0x5847d20f9757de24395a7b3b47303684003753858737bf288716855dfb0aaf2" /* TESTNET_SEPOLIA */;
|
|
25106
25149
|
default:
|
|
25107
25150
|
throw new Error("Starknet.id is not yet deployed on this network");
|
|
25108
25151
|
}
|
|
25109
25152
|
}
|
|
25153
|
+
var StarknetIdIdentityContract = /* @__PURE__ */ ((StarknetIdIdentityContract2) => {
|
|
25154
|
+
StarknetIdIdentityContract2["MAINNET"] = "0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af";
|
|
25155
|
+
StarknetIdIdentityContract2["TESTNET"] = "0x783a9097b26eae0586373b2ce0ed3529ddc44069d1e0fbc4f66d42b69d6850d";
|
|
25156
|
+
StarknetIdIdentityContract2["TESTNET_SEPOLIA"] = "0x718d9172f6e36183abeeff1a0db76a1851cef4ed9b9c13896da79ef4bfcb4d0";
|
|
25157
|
+
return StarknetIdIdentityContract2;
|
|
25158
|
+
})(StarknetIdIdentityContract || {});
|
|
25159
|
+
function getStarknetIdIdentityContract(chainId) {
|
|
25160
|
+
switch (chainId) {
|
|
25161
|
+
case "0x534e5f4d41494e" /* SN_MAIN */:
|
|
25162
|
+
return "0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af" /* MAINNET */;
|
|
25163
|
+
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25164
|
+
return "0x783a9097b26eae0586373b2ce0ed3529ddc44069d1e0fbc4f66d42b69d6850d" /* TESTNET */;
|
|
25165
|
+
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25166
|
+
return "0x718d9172f6e36183abeeff1a0db76a1851cef4ed9b9c13896da79ef4bfcb4d0" /* TESTNET_SEPOLIA */;
|
|
25167
|
+
default:
|
|
25168
|
+
throw new Error("Starknet.id verifier contract is not yet deployed on this network");
|
|
25169
|
+
}
|
|
25170
|
+
}
|
|
25171
|
+
var StarknetIdMulticallContract = "0x034ffb8f4452df7a613a0210824d6414dbadcddce6c6e19bf4ddc9e22ce5f970";
|
|
25172
|
+
function getStarknetIdMulticallContract(chainId) {
|
|
25173
|
+
switch (chainId) {
|
|
25174
|
+
case "0x534e5f4d41494e" /* SN_MAIN */:
|
|
25175
|
+
return StarknetIdMulticallContract;
|
|
25176
|
+
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25177
|
+
return StarknetIdMulticallContract;
|
|
25178
|
+
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25179
|
+
return StarknetIdMulticallContract;
|
|
25180
|
+
default:
|
|
25181
|
+
throw new Error("Starknet.id multicall contract is not yet deployed on this network");
|
|
25182
|
+
}
|
|
25183
|
+
}
|
|
25184
|
+
var StarknetIdVerifierContract = /* @__PURE__ */ ((StarknetIdVerifierContract2) => {
|
|
25185
|
+
StarknetIdVerifierContract2["MAINNET"] = "0x07d14dfd8ee95b41fce179170d88ba1f0d5a512e13aeb232f19cfeec0a88f8bf";
|
|
25186
|
+
StarknetIdVerifierContract2["TESTNET"] = "0x057c942544063c3aea6ea6c37009cc9d1beacd750cb6801549a129c7265f0f11";
|
|
25187
|
+
StarknetIdVerifierContract2["TESTNET_SEPOLIA"] = "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf";
|
|
25188
|
+
return StarknetIdVerifierContract2;
|
|
25189
|
+
})(StarknetIdVerifierContract || {});
|
|
25190
|
+
function getStarknetIdVerifierContract(chainId) {
|
|
25191
|
+
switch (chainId) {
|
|
25192
|
+
case "0x534e5f4d41494e" /* SN_MAIN */:
|
|
25193
|
+
return "0x07d14dfd8ee95b41fce179170d88ba1f0d5a512e13aeb232f19cfeec0a88f8bf" /* MAINNET */;
|
|
25194
|
+
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25195
|
+
return "0x057c942544063c3aea6ea6c37009cc9d1beacd750cb6801549a129c7265f0f11" /* TESTNET */;
|
|
25196
|
+
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25197
|
+
return "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf" /* TESTNET_SEPOLIA */;
|
|
25198
|
+
default:
|
|
25199
|
+
throw new Error("Starknet.id verifier contract is not yet deployed on this network");
|
|
25200
|
+
}
|
|
25201
|
+
}
|
|
25202
|
+
var StarknetIdPfpContract = /* @__PURE__ */ ((StarknetIdPfpContract2) => {
|
|
25203
|
+
StarknetIdPfpContract2["MAINNET"] = "0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a32306aff7d59c7";
|
|
25204
|
+
StarknetIdPfpContract2["TESTNET"] = "0x03cac3228b434259734ee0e4ff445f642206ea11adace7e4f45edd2596748698";
|
|
25205
|
+
StarknetIdPfpContract2["TESTNET_SEPOLIA"] = "0x070c035557d6fed57eed2ed7fa861616b487f8a95439347b805639ca076f29f0";
|
|
25206
|
+
return StarknetIdPfpContract2;
|
|
25207
|
+
})(StarknetIdPfpContract || {});
|
|
25208
|
+
function getStarknetIdPfpContract(chainId) {
|
|
25209
|
+
switch (chainId) {
|
|
25210
|
+
case "0x534e5f4d41494e" /* SN_MAIN */:
|
|
25211
|
+
return "0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a32306aff7d59c7" /* MAINNET */;
|
|
25212
|
+
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25213
|
+
return "0x03cac3228b434259734ee0e4ff445f642206ea11adace7e4f45edd2596748698" /* TESTNET */;
|
|
25214
|
+
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25215
|
+
return "0x070c035557d6fed57eed2ed7fa861616b487f8a95439347b805639ca076f29f0" /* TESTNET_SEPOLIA */;
|
|
25216
|
+
default:
|
|
25217
|
+
throw new Error(
|
|
25218
|
+
"Starknet.id profile picture verifier contract is not yet deployed on this network"
|
|
25219
|
+
);
|
|
25220
|
+
}
|
|
25221
|
+
}
|
|
25222
|
+
var StarknetIdPopContract = /* @__PURE__ */ ((StarknetIdPopContract2) => {
|
|
25223
|
+
StarknetIdPopContract2["MAINNET"] = "0x0293eb2ba9862f762bd3036586d5755a782bd22e6f5028320f1d0405fd47bff4";
|
|
25224
|
+
StarknetIdPopContract2["TESTNET"] = "0x03528caf090179e337931ee669a5b0214041e1bae30d460ff07d2cea2c7a9106";
|
|
25225
|
+
StarknetIdPopContract2["TESTNET_SEPOLIA"] = "0x00f80f68443becd0e0a4a08ff5734e36dd8028507333e4a0ec034dcfdf1b793e";
|
|
25226
|
+
return StarknetIdPopContract2;
|
|
25227
|
+
})(StarknetIdPopContract || {});
|
|
25228
|
+
function getStarknetIdPopContract(chainId) {
|
|
25229
|
+
switch (chainId) {
|
|
25230
|
+
case "0x534e5f4d41494e" /* SN_MAIN */:
|
|
25231
|
+
return "0x0293eb2ba9862f762bd3036586d5755a782bd22e6f5028320f1d0405fd47bff4" /* MAINNET */;
|
|
25232
|
+
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25233
|
+
return "0x03528caf090179e337931ee669a5b0214041e1bae30d460ff07d2cea2c7a9106" /* TESTNET */;
|
|
25234
|
+
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25235
|
+
return "0x00f80f68443becd0e0a4a08ff5734e36dd8028507333e4a0ec034dcfdf1b793e" /* TESTNET_SEPOLIA */;
|
|
25236
|
+
default:
|
|
25237
|
+
throw new Error(
|
|
25238
|
+
"Starknet.id proof of personhood verifier contract is not yet deployed on this network"
|
|
25239
|
+
);
|
|
25240
|
+
}
|
|
25241
|
+
}
|
|
25242
|
+
function execution(staticEx, ifEqual = void 0, ifNotEqual = void 0) {
|
|
25243
|
+
return new CairoCustomEnum({
|
|
25244
|
+
Static: staticEx,
|
|
25245
|
+
IfEqual: ifEqual ? tuple(ifEqual[0], ifEqual[1], ifEqual[2]) : void 0,
|
|
25246
|
+
IfNotEqual: ifNotEqual ? tuple(ifNotEqual[0], ifNotEqual[1], ifNotEqual[2]) : void 0
|
|
25247
|
+
});
|
|
25248
|
+
}
|
|
25249
|
+
function dynamicFelt(hardcoded, reference = void 0) {
|
|
25250
|
+
return new CairoCustomEnum({
|
|
25251
|
+
Hardcoded: hardcoded,
|
|
25252
|
+
Reference: reference ? tuple(reference[0], reference[1]) : void 0
|
|
25253
|
+
});
|
|
25254
|
+
}
|
|
25255
|
+
function dynamicCallData(hardcoded, reference = void 0, arrayReference = void 0) {
|
|
25256
|
+
return new CairoCustomEnum({
|
|
25257
|
+
Hardcoded: hardcoded,
|
|
25258
|
+
Reference: reference ? tuple(reference[0], reference[1]) : void 0,
|
|
25259
|
+
ArrayReference: arrayReference ? tuple(arrayReference[0], arrayReference[1]) : void 0
|
|
25260
|
+
});
|
|
25261
|
+
}
|
|
25110
25262
|
|
|
25111
25263
|
// src/provider/extensions/starknetId.ts
|
|
25112
25264
|
var StarknetId = class _StarknetId {
|
|
@@ -25126,6 +25278,19 @@ var starknet = (() => {
|
|
|
25126
25278
|
StarknetIdContract2
|
|
25127
25279
|
);
|
|
25128
25280
|
}
|
|
25281
|
+
async getStarkProfile(address, StarknetIdContract2, StarknetIdIdentityContract2, StarknetIdVerifierContract2, StarknetIdPfpContract2, StarknetIdPopContract2, StarknetIdMulticallContract2) {
|
|
25282
|
+
return _StarknetId.getStarkProfile(
|
|
25283
|
+
// After Mixin, this is ProviderInterface
|
|
25284
|
+
this,
|
|
25285
|
+
address,
|
|
25286
|
+
StarknetIdContract2,
|
|
25287
|
+
StarknetIdIdentityContract2,
|
|
25288
|
+
StarknetIdVerifierContract2,
|
|
25289
|
+
StarknetIdPfpContract2,
|
|
25290
|
+
StarknetIdPopContract2,
|
|
25291
|
+
StarknetIdMulticallContract2
|
|
25292
|
+
);
|
|
25293
|
+
}
|
|
25129
25294
|
static async getStarkName(provider, address, StarknetIdContract2) {
|
|
25130
25295
|
const chainId = await provider.getChainId();
|
|
25131
25296
|
const contract = StarknetIdContract2 ?? getStarknetIdContract(chainId);
|
|
@@ -25154,18 +25319,159 @@ var starknet = (() => {
|
|
|
25154
25319
|
const chainId = await provider.getChainId();
|
|
25155
25320
|
const contract = StarknetIdContract2 ?? getStarknetIdContract(chainId);
|
|
25156
25321
|
try {
|
|
25322
|
+
const encodedDomain = name.replace(".stark", "").split(".").map((part) => useEncoded(part).toString(10));
|
|
25157
25323
|
const addressData = await provider.callContract({
|
|
25158
25324
|
contractAddress: contract,
|
|
25159
25325
|
entrypoint: "domain_to_address",
|
|
25160
|
-
calldata: CallData.compile({
|
|
25161
|
-
domain: [useEncoded(name.replace(".stark", "")).toString(10)]
|
|
25162
|
-
})
|
|
25326
|
+
calldata: CallData.compile({ domain: encodedDomain, hint: [] })
|
|
25163
25327
|
});
|
|
25164
25328
|
return addressData[0];
|
|
25165
25329
|
} catch {
|
|
25166
25330
|
throw Error("Could not get address from stark name");
|
|
25167
25331
|
}
|
|
25168
25332
|
}
|
|
25333
|
+
static async getStarkProfile(provider, address, StarknetIdContract2, StarknetIdIdentityContract2, StarknetIdVerifierContract2, StarknetIdPfpContract2, StarknetIdPopContract2, StarknetIdMulticallContract2) {
|
|
25334
|
+
const chainId = await provider.getChainId();
|
|
25335
|
+
const contract = StarknetIdContract2 ?? getStarknetIdContract(chainId);
|
|
25336
|
+
const identityContract = StarknetIdIdentityContract2 ?? getStarknetIdIdentityContract(chainId);
|
|
25337
|
+
const verifierContract = StarknetIdVerifierContract2 ?? getStarknetIdVerifierContract(chainId);
|
|
25338
|
+
const pfpContract = StarknetIdPfpContract2 ?? getStarknetIdPfpContract(chainId);
|
|
25339
|
+
const popContract = StarknetIdPopContract2 ?? getStarknetIdPopContract(chainId);
|
|
25340
|
+
const multicallAddress = StarknetIdMulticallContract2 ?? getStarknetIdMulticallContract(chainId);
|
|
25341
|
+
try {
|
|
25342
|
+
const data = await provider.callContract({
|
|
25343
|
+
contractAddress: multicallAddress,
|
|
25344
|
+
entrypoint: "aggregate",
|
|
25345
|
+
calldata: CallData.compile({
|
|
25346
|
+
calls: [
|
|
25347
|
+
{
|
|
25348
|
+
execution: execution({}),
|
|
25349
|
+
to: dynamicFelt(contract),
|
|
25350
|
+
selector: dynamicFelt(getSelectorFromName("address_to_domain")),
|
|
25351
|
+
calldata: [dynamicCallData(address)]
|
|
25352
|
+
},
|
|
25353
|
+
{
|
|
25354
|
+
execution: execution({}),
|
|
25355
|
+
to: dynamicFelt(contract),
|
|
25356
|
+
selector: dynamicFelt(getSelectorFromName("domain_to_id")),
|
|
25357
|
+
calldata: [dynamicCallData(void 0, void 0, [0, 0])]
|
|
25358
|
+
},
|
|
25359
|
+
{
|
|
25360
|
+
execution: execution({}),
|
|
25361
|
+
to: dynamicFelt(identityContract),
|
|
25362
|
+
selector: dynamicFelt(getSelectorFromName("get_verifier_data")),
|
|
25363
|
+
calldata: [
|
|
25364
|
+
dynamicCallData(void 0, [1, 0]),
|
|
25365
|
+
dynamicCallData(encodeShortString("twitter")),
|
|
25366
|
+
dynamicCallData(verifierContract),
|
|
25367
|
+
dynamicCallData("0")
|
|
25368
|
+
]
|
|
25369
|
+
},
|
|
25370
|
+
{
|
|
25371
|
+
execution: execution({}),
|
|
25372
|
+
to: dynamicFelt(identityContract),
|
|
25373
|
+
selector: dynamicFelt(getSelectorFromName("get_verifier_data")),
|
|
25374
|
+
calldata: [
|
|
25375
|
+
dynamicCallData(void 0, [1, 0]),
|
|
25376
|
+
dynamicCallData(encodeShortString("github")),
|
|
25377
|
+
dynamicCallData(verifierContract),
|
|
25378
|
+
dynamicCallData("0")
|
|
25379
|
+
]
|
|
25380
|
+
},
|
|
25381
|
+
{
|
|
25382
|
+
execution: execution({}),
|
|
25383
|
+
to: dynamicFelt(identityContract),
|
|
25384
|
+
selector: dynamicFelt(getSelectorFromName("get_verifier_data")),
|
|
25385
|
+
calldata: [
|
|
25386
|
+
dynamicCallData(void 0, [1, 0]),
|
|
25387
|
+
dynamicCallData(encodeShortString("discord")),
|
|
25388
|
+
dynamicCallData(verifierContract),
|
|
25389
|
+
dynamicCallData("0")
|
|
25390
|
+
]
|
|
25391
|
+
},
|
|
25392
|
+
{
|
|
25393
|
+
execution: execution({}),
|
|
25394
|
+
to: dynamicFelt(identityContract),
|
|
25395
|
+
selector: dynamicFelt(getSelectorFromName("get_verifier_data")),
|
|
25396
|
+
calldata: [
|
|
25397
|
+
dynamicCallData(void 0, [1, 0]),
|
|
25398
|
+
dynamicCallData(encodeShortString("proof_of_personhood")),
|
|
25399
|
+
dynamicCallData(popContract),
|
|
25400
|
+
dynamicCallData("0")
|
|
25401
|
+
]
|
|
25402
|
+
},
|
|
25403
|
+
// PFP
|
|
25404
|
+
{
|
|
25405
|
+
execution: execution({}),
|
|
25406
|
+
to: dynamicFelt(identityContract),
|
|
25407
|
+
selector: dynamicFelt(getSelectorFromName("get_verifier_data")),
|
|
25408
|
+
calldata: [
|
|
25409
|
+
dynamicCallData(void 0, [1, 0]),
|
|
25410
|
+
dynamicCallData(encodeShortString("nft_pp_contract")),
|
|
25411
|
+
dynamicCallData(pfpContract),
|
|
25412
|
+
dynamicCallData("0")
|
|
25413
|
+
]
|
|
25414
|
+
},
|
|
25415
|
+
{
|
|
25416
|
+
execution: execution({}),
|
|
25417
|
+
to: dynamicFelt(identityContract),
|
|
25418
|
+
selector: dynamicFelt(getSelectorFromName("get_extended_verifier_data")),
|
|
25419
|
+
calldata: [
|
|
25420
|
+
dynamicCallData(void 0, [1, 0]),
|
|
25421
|
+
dynamicCallData(encodeShortString("nft_pp_id")),
|
|
25422
|
+
dynamicCallData("2"),
|
|
25423
|
+
dynamicCallData(pfpContract),
|
|
25424
|
+
dynamicCallData("0")
|
|
25425
|
+
]
|
|
25426
|
+
},
|
|
25427
|
+
{
|
|
25428
|
+
execution: execution(void 0, void 0, [6, 0, 0]),
|
|
25429
|
+
to: dynamicFelt(void 0, [6, 0]),
|
|
25430
|
+
selector: dynamicFelt(getSelectorFromName("tokenURI")),
|
|
25431
|
+
calldata: [dynamicCallData(void 0, [7, 1]), dynamicCallData(void 0, [7, 2])]
|
|
25432
|
+
}
|
|
25433
|
+
]
|
|
25434
|
+
})
|
|
25435
|
+
});
|
|
25436
|
+
if (Array.isArray(data)) {
|
|
25437
|
+
const size = parseInt(data[0], 16);
|
|
25438
|
+
const finalArray = [];
|
|
25439
|
+
let index = 1;
|
|
25440
|
+
for (let i = 0; i < size; i += 1) {
|
|
25441
|
+
if (index < data.length) {
|
|
25442
|
+
const subArraySize = parseInt(data[index], 16);
|
|
25443
|
+
index += 1;
|
|
25444
|
+
const subArray = data.slice(index, index + subArraySize);
|
|
25445
|
+
finalArray.push(subArray);
|
|
25446
|
+
index += subArraySize;
|
|
25447
|
+
} else {
|
|
25448
|
+
break;
|
|
25449
|
+
}
|
|
25450
|
+
}
|
|
25451
|
+
const name = useDecoded(finalArray[0].slice(1).map((hexString) => BigInt(hexString)));
|
|
25452
|
+
const twitter = finalArray[2][0] !== "0x0" ? BigInt(finalArray[2][0]).toString() : void 0;
|
|
25453
|
+
const github = finalArray[3][0] !== "0x0" ? BigInt(finalArray[3][0]).toString() : void 0;
|
|
25454
|
+
const discord = finalArray[4][0] !== "0x0" ? BigInt(finalArray[4][0]).toString() : void 0;
|
|
25455
|
+
const proofOfPersonhood = finalArray[5][0] === "0x1";
|
|
25456
|
+
const profilePictureMetadata = data[0] === "0x9" ? finalArray[8].slice(1).map((val) => decodeShortString(val)).join("") : void 0;
|
|
25457
|
+
const profilePicture = profilePictureMetadata || `https://starknet.id/api/identicons/${BigInt(finalArray[1][0]).toString()}`;
|
|
25458
|
+
return {
|
|
25459
|
+
name,
|
|
25460
|
+
twitter,
|
|
25461
|
+
github,
|
|
25462
|
+
discord,
|
|
25463
|
+
proofOfPersonhood,
|
|
25464
|
+
profilePicture
|
|
25465
|
+
};
|
|
25466
|
+
}
|
|
25467
|
+
throw Error("Error while calling aggregate function");
|
|
25468
|
+
} catch (e) {
|
|
25469
|
+
if (e instanceof Error) {
|
|
25470
|
+
throw e;
|
|
25471
|
+
}
|
|
25472
|
+
throw Error("Could not get user stark profile data from address");
|
|
25473
|
+
}
|
|
25474
|
+
}
|
|
25169
25475
|
};
|
|
25170
25476
|
|
|
25171
25477
|
// src/provider/extensions/default.ts
|