Types and Interfaces

Types and Interfaces


Enumerated list of account abstraction versions.

  • None = 0 (Used for contracts that are not accounts.)
  • Version1 = 1


Enumerated list of account nonce ordering formats.

  • Sequential = 0
  • Arbitrary = 1


0x-prefixed, hex-encoded, Ethereum account address as string.


Interface representation of approval based paymaster input containing various fields including an ApprovalBased type.

  • type: 'ApprovalBased';
  • token: Address;
  • minimalAllowance: BigNumber;
  • innerInput: BytesLike;


Type defining a map object containing accounts and their balances.

  • { [key: string]: BigNumber }


Interface representation of batch information containing various optional and mandatory fields.

  • number: number;
  • timestamp: number;
  • l1TxCount: number;
  • l2TxCount: number;
  • rootHash?: string;
  • status: string;
  • commitTxHash?: string;
  • committedAt?: Date;
  • proveTxHash?: string;
  • provenAt?: Date;
  • executeTxHash?: string;
  • executedAt?: Date;
  • l1GasPrice: number;
  • l2FairGasPrice: number;


Interface representation of a block that extends the Ethers providers.Blockopen in new window definition with additional fields.

  • l1BatchNumber: number;
  • l1BatchTimestamp: number;


Interface representation of block information containing various optional and mandatory fields.

  • number: number;
  • timestamp: number;
  • l1BatchNumber: number;
  • l1TxCount: number;
  • l2TxCount: number;
  • rootHash?: string;
  • status: string;
  • commitTxHash?: string;
  • committedAt?: Date;
  • proveTxHash?: string;
  • provenAt?: Date;
  • executeTxHash?: string;
  • executedAt?: Date;


Pipe-delimited list of block labels that includes block number in binary and hex plus block statuses.

  • number
  • string // hex representation of block number
  • committed
  • finalized
  • latest
  • earliest
  • pending


Interface representation of a block with transaction(s) that extends the Ethers BlockWithTransactions definition with additional fields.

  • l1BatchNumber: number;
  • l1BatchTimestamp: number;
  • transactions: Array<TransactionResponse>;


Interface representation for contract account information containing information on account abstraction version and nonce ordering format.

  • supportedAAVersion: AccountAbstractionVersion;
  • nonceOrdering: AccountNonceOrdering;


Interface representation of deployment information with various fields.

  • sender: Address;
  • bytecodeHash: string;
  • deployedAddress: Address;


Pipe-delimited choice of two deployment types that support all create2 variants.

  • create
  • createAccount


Type defining an EIP-712 transaction with optional parameters.

  • gasPerPubdata?: BigNumberish;
  • factoryDeps?: BytesLike[];
  • customSignature?: BytesLike;
  • paymasterParams?: PaymasterParams;


Interface representation of an Ethereum signature.

  • v: number;
  • r: BytesLike;
  • s: BytesLike;


Interface representation of event filter containing various fields.

  • topics?: Array<string | Array<string> | null>;
  • address?: Address | Array<Address>;
  • fromBlock?: BlockTag;
  • toBlock?: BlockTag;
  • blockHash?: string;


Interface representation of transaction fee.

  • gasLimit: BigNumber;
  • gasPerPubdataLimit: BigNumber;
  • maxPriorityFeePerGas: BigNumber;
  • maxFeePerGas: BigNumber;


Interface representation of finalize withdrawal parameters.

  • l1BatchNumber: number | null;
  • l2MessageIndex: number;
  • l2TxNumberInBlock: number | null;
  • message: any;
  • sender: string;
  • proof: string[];


Interface representation of full deposit fee containing various mandatory and optional fields.

  • maxFeePerGas?: BigNumber;
  • maxPriorityFeePerGas?: BigNumber;
  • gasPrice?: BigNumber;
  • baseCost: BigNumber;
  • l1GasLimit: BigNumber;
  • l2GasLimit: BigNumber;


Interface representation of general paymaster input containing a couple of fields, including a General type.

  • type: 'General';
  • innerInput: BytesLike;


Interface representation of a layer 2 to layer 1 transaction log containing various fields.

  • blockNumber: number;
  • blockHash: string;
  • l1BatchNumber: number;
  • transactionIndex: number;
  • shardId: number;
  • isService: boolean;
  • sender: string;
  • key: string;
  • value: string;
  • transactionHash: string;
  • logIndex: number;


Interface representation of log that extends Ethers providers.Logopen in new window and supplies the layer 1 batch number.

  • l1BatchNumber: number;


Interface representation of message proof containing various fields.

  • id: number;
  • proof: string[];
  • root: string;


Enumerated list of networks and their ids.

  • Mainnet = 1
  • Ropsten = 3
  • Rinkeby = 4
  • Sepolia = 6,
  • localhost = 9


Type definition for a paymaster input specified as either approval based or general.

  • ApprovalBasedPaymasterInput | GeneralPaymasterInput


Type defining a paymaster by address and the bytestream input.

  • paymaster: Address;
  • paymasterInput: BytesLike;


Signs various types of payloads, optionally using a some kind of secret.

  • payload: BytesLike;
  • secret: any;
  • provider null | Provider;


Interface representation of priority op response that extends TransactionResponse and adds a function that waits to commit a layer 1 transaction, including when given on optional confirmation number.

  • waitL1Commit(confirmation?: number): Promise<providers.TransactionReceipt>;


Interface representation of raw block with transactions

  • common_data:
    • L2:
      • nonce: number;
      • fee:
        • gas_limit: BigInt;
        • max_fee_per_gas: BigInt;
        • max_priority_fee_per_gas: BigInt;
        • gas_per_pubdata_limit: BigInt;
      • initiatorAddress: Address;
      • signature: Uint8Array;
      • transactionType: string;
      • input
        • hash: string;
        • data: Uint8Array;
      • paymasterParams:
        • paymaster: Address;
        • paymasterInput: Uint8Array;
  • execute:
    • calldata: string;
    • contractAddress: Address;
    • factoryDeps: BytesLike[];
    • value: BigInt;
  • received_timestamp_ms: number;
  • raw_bytes: string;


0x-prefixed, hex-encoded, ECDSA signature as string.


Encapsulates the required input parameters for creating a signer for SmartAccount.

  • address: string;
  • secret: any;
  • payloadSigner: PayloadSigner;
  • transactionBuilder: TransactionBuilder;


Interface representation of Merkle proofs for storage values.

  • address: string;
  • storageProof (Array):
    • key: string;
    • value: string;
    • index: number;
    • proof: string[];


Interface representation of token containing various fields.

  • l1Address: Address;
  • l2Address: Address;
  • address: Address; // backward compatible field although @deprecated in favor of l2Address
  • name: string;
  • symbol: string;
  • decimals: number;


Populates missing fields in a transaction with default values.

  • transaction: TransactionRequest;
  • secret: any;
  • provider: null | Provider;


Interface representation of transaction details containing various mandatory and optional fields.

  • isL1Originated: boolean;
  • status: string;
  • fee: BigNumberish;
  • initiatorAddress: Address;
  • receivedAt: Date;
  • ethCommitTxHash?: string;
  • ethProveTxHash?: string;
  • ethExecuteTxHash?: string;


Interface representation of transaction receipt that extends from Ethers providers.TransactionReceiptopen in new window with additional fields.

  • l1BatchNumber: number;
  • l1BatchTxIndex: number;
  • logs: Array<Log>;
  • l2ToL1Logs: Array<L2ToL1Log>;


Interface representation of transaction request that extends from Ethers providers.TransactionRequestopen in new window which adds an optional field for EIP-712 transactions.

  • customData?: Eip712Meta;


Interface representation of transaction response that extends from Ethers providers.TransactionResponseopen in new window with additional fields.

  • l1BatchNumber: number;
  • l1BatchTxIndex: number;
  • waitFinalize(): Promise<TransactionReceipt>;


Non-enumerated enum list of transaction statuses.

  • NotFound = not-found
  • Processing = processing
  • Committed = committed
  • Finalized = finalized

More info

Find the code definition of the types above on the zkSync Era GitHub repo.open in new window