import type { ContractClass, EDataAvailabilityMode, ResourceBounds } from '@starknet-io/types-js'; import type * as weierstrass from '@noble/curves/abstract/weierstrass'; import type { CairoEnum } from './cairoEnum.js'; import type { StarknetChainId } from './constants.js'; import type { CompiledContract, CompiledSierraCasm } from './contract.js'; import type { ValuesType } from './helpers.js'; export type WeierstrassSignatureType = weierstrass.SignatureType; export type ArraySignatureType = string[]; export type Signature = ArraySignatureType | WeierstrassSignatureType; export type BigNumberish = string | number | bigint; export type ByteArray = { data: BigNumberish[]; pending_word: BigNumberish; pending_word_len: BigNumberish; }; /** * Compiled calldata ready to be sent * * decimal-string array */ export type Calldata = string[] & { readonly __compiled__?: true; }; /** * Represents an integer in the range [0, 2^256) */ export interface Uint256 { low: BigNumberish; high: BigNumberish; } /** * Represents an integer in the range [0, 2^256) */ export interface Uint512 { limb0: BigNumberish; limb1: BigNumberish; limb2: BigNumberish; limb3: BigNumberish; } /** * BigNumberish array * * use CallData.compile() to convert to Calldata */ export type RawCalldata = BigNumberish[]; /** * Hexadecimal-string array */ export type HexCalldata = string[]; export type AllowArray = T | T[]; export type OptionalPayload = { payload: T; } | T; export type RawArgs = RawArgsObject | RawArgsArray; export type RawArgsObject = { [inputName: string]: MultiType | MultiType[] | RawArgs; }; export type RawArgsArray = Array; export type MultiType = BigNumberish | Uint256 | object | boolean | CairoEnum; export type UniversalDeployerContractPayload = { classHash: BigNumberish; salt?: string; unique?: boolean; constructorCalldata?: RawArgs; }; export type DeployAccountContractPayload = { classHash: string; constructorCalldata?: RawArgs; addressSalt?: BigNumberish; contractAddress?: string; }; export type DeployAccountContractTransaction = Omit & { signature?: Signature; }; export type DeclareContractPayload = { contract: CompiledContract | string; classHash?: string; casm?: CompiledSierraCasm; compiledClassHash?: string; }; export type CompleteDeclareContractPayload = { contract: CompiledContract | string; classHash: string; casm?: CompiledSierraCasm; compiledClassHash?: string; }; export type DeclareAndDeployContractPayload = Omit & DeclareContractPayload; export type DeclareContractTransaction = { contract: ContractClass; senderAddress: string; signature?: Signature; compiledClassHash?: string; }; export type CallDetails = { contractAddress: string; calldata?: RawArgs | Calldata; entrypoint?: string; }; export type Invocation = CallDetails & { signature?: Signature; }; export type Call = CallDetails & { entrypoint: string; }; export type CairoVersion = '0' | '1' | undefined; export type CompilerVersion = '0' | '1' | '2' | undefined; export type InvocationsDetails = { nonce?: BigNumberish; maxFee?: BigNumberish; version?: BigNumberish; } & Partial; export type V3TransactionDetails = { nonce: BigNumberish; version: BigNumberish; resourceBounds: ResourceBounds; tip: BigNumberish; paymasterData: BigNumberish[]; accountDeploymentData: BigNumberish[]; nonceDataAvailabilityMode: EDataAvailabilityMode; feeDataAvailabilityMode: EDataAvailabilityMode; }; /** * Contain all additional details params */ export type Details = { nonce: BigNumberish; maxFee: BigNumberish; version: BigNumberish; chainId: StarknetChainId; }; export type InvocationsDetailsWithNonce = (InvocationsDetails & { nonce: BigNumberish; }) | V3TransactionDetails; export declare const TransactionType: { readonly DECLARE: "DECLARE"; readonly DEPLOY: "DEPLOY"; readonly DEPLOY_ACCOUNT: "DEPLOY_ACCOUNT"; readonly INVOKE: "INVOKE_FUNCTION"; }; export type TransactionType = ValuesType; /** * new statuses are defined by props: finality_status and execution_status * to be #deprecated */ export declare const TransactionStatus: { readonly NOT_RECEIVED: "NOT_RECEIVED"; readonly RECEIVED: "RECEIVED"; readonly ACCEPTED_ON_L2: "ACCEPTED_ON_L2"; readonly ACCEPTED_ON_L1: "ACCEPTED_ON_L1"; readonly REJECTED: "REJECTED"; readonly REVERTED: "REVERTED"; }; export type TransactionStatus = ValuesType; export declare const TransactionFinalityStatus: { readonly NOT_RECEIVED: "NOT_RECEIVED"; readonly RECEIVED: "RECEIVED"; readonly ACCEPTED_ON_L2: "ACCEPTED_ON_L2"; readonly ACCEPTED_ON_L1: "ACCEPTED_ON_L1"; }; export type TransactionFinalityStatus = ValuesType; export declare const TransactionExecutionStatus: { readonly REJECTED: "REJECTED"; readonly REVERTED: "REVERTED"; readonly SUCCEEDED: "SUCCEEDED"; }; export type TransactionExecutionStatus = ValuesType; export declare const BlockStatus: { readonly PENDING: "PENDING"; readonly ACCEPTED_ON_L1: "ACCEPTED_ON_L1"; readonly ACCEPTED_ON_L2: "ACCEPTED_ON_L2"; readonly REJECTED: "REJECTED"; }; export type BlockStatus = ValuesType; export declare const BlockTag: { readonly PENDING: "pending"; readonly LATEST: "latest"; }; export type BlockTag = ValuesType; export type BlockNumber = BlockTag | null | number; /** * hex string and BigInt are detected as block hashes * * decimal string and number are detected as block numbers * * text string are detected as block tag * * null return 'pending' block tag */ export type BlockIdentifier = BlockNumber | BigNumberish; /** * items used by AccountInvocations */ export type AccountInvocationItem = (({ type: typeof TransactionType.DECLARE; } & DeclareContractTransaction) | ({ type: typeof TransactionType.DEPLOY_ACCOUNT; } & DeployAccountContractTransaction) | ({ type: typeof TransactionType.INVOKE; } & Invocation)) & InvocationsDetailsWithNonce; /** * Complete invocations array with account details (internal type from account -> provider) */ export type AccountInvocations = AccountInvocationItem[]; /** * Invocations array user provide to bulk method (simulate) */ export type Invocations = Array<({ type: typeof TransactionType.DECLARE; } & OptionalPayload) | ({ type: typeof TransactionType.DEPLOY; } & OptionalPayload>) | ({ type: typeof TransactionType.DEPLOY_ACCOUNT; } & OptionalPayload) | ({ type: typeof TransactionType.INVOKE; } & OptionalPayload>)>; export type Tupled = { element: any; type: string; }; export type Args = { [inputName: string]: BigNumberish | BigNumberish[] | ParsedStruct | ParsedStruct[]; }; export type ParsedStruct = { [key: string]: BigNumberish | BigNumberish[] | ParsedStruct | Uint256; }; export type waitForTransactionOptions = { retryInterval?: number; successStates?: Array; errorStates?: Array; }; export type getSimulateTransactionOptions = { blockIdentifier?: BlockIdentifier; skipValidate?: boolean; skipExecute?: boolean; skipFeeCharge?: boolean; }; export type getContractVersionOptions = { blockIdentifier?: BlockIdentifier; compiler?: boolean; }; export type getEstimateFeeBulkOptions = { blockIdentifier?: BlockIdentifier; skipValidate?: boolean; }; export interface CallStruct { to: string; selector: string; calldata: string[]; } /** * Represent Contract version */ export type ContractVersion = { /** version of the cairo language */ cairo: CairoVersion; /** version of the cairo compiler used to compile the contract */ compiler: CompilerVersion; }; //# sourceMappingURL=lib.d.ts.map