import { ABIEvent, TransactionClause, Revision, TransactionBody as TransactionBody$1, VET, VTHO, Address, HexUInt, BlockId, ClauseOptions, ContractClause, ABIFunction, DeployParams, Hex, Transaction, Clause } from '@vechain/sdk-core'; import { TypedDataDomain as TypedDataDomain$1, TypedDataParameter as TypedDataParameter$1, GetEventArgs, AbiEvent } from 'viem'; import { EventEmitter } from 'events'; import { Abi, ExtractAbiFunctionNames, AbiFunction, AbiParametersToPrimitiveTypes, ExtractAbiFunction, ExtractAbiEvent, ExtractAbiEventNames } from 'abitype'; import { JsonRpcApiProvider, JsonRpcPayload, JsonRpcResult, JsonRpcError } from 'ethers'; /** * Enumeration for HTTP methods. * * @property {string} GET - The GET method requests a representation of the specified resource. * @property {string} POST - The POST method is used to submit data to be processed to a specified resource. */ declare enum HttpMethod { GET = "GET", POST = "POST" } /** * Represents the parameters for making an HTTP request. * * This interface specifies options for configuring an HTTP request, * including query parameters, request body, custom headers, * and a function to validate response headers. */ interface HttpParams { /** * The request body, which can be of any type. */ body?: unknown; /** * Raw request body to be sent as-is without JSON.stringify. * If provided, this takes precedence over `body`. */ rawBody?: string | Uint8Array; /** * Custom headers to be included in the request. */ headers?: Record; /** * Query parameters to include in the request. */ query?: Record; /** * A callback function to validate response headers. * @param headers - The response headers to validate. */ validateResponseHeader?: (headers: Record) => void; } /** * Interface representing an HTTP client. * * The HttpClient interface provides methods for making HTTP requests */ interface HttpClient { /** * The base URL for the API requests. * This endpoint serves as the root URL for constructing all subsequent API calls. */ baseURL: string; /** * Makes an HTTP GET request to the specified path with optional query parameters. * * @param {string} path - The endpoint path for the GET request. * @param {HttpParams} [params] - Optional query parameters to include in the request. * @return {Promise} A promise that resolves to the response of the GET request. */ get: (path: string, params?: HttpParams) => Promise; /** * Sends an HTTP request using the specified method, path, and optional parameters. * * @param {HttpMethod} method - The HTTP method to be used for the request (e.g., 'GET', 'POST'). * @param {string} path - The endpoint path for the HTTP request. * @param {HttpParams} [params] - Optional parameters to include in the HTTP request. * @returns {Promise} A promise that resolves with the response of the HTTP request. */ http: (method: HttpMethod, path: string, params?: HttpParams) => Promise; /** * Sends a POST request to the specified path with the given parameters. * * @param {string} path - The endpoint to which the POST request is sent. * @param {HttpParams} [params] - Optional parameters to be included in the POST request body. * @returns {Promise} - A promise that resolves to the response of the POST request. */ post: (path: string, params?: HttpParams) => Promise; } /** * This class implements the HttpClient interface using the Fetch API. * * The SimpleHttpClient allows making {@link HttpMethod} requests with timeout * and base URL configuration. */ declare class SimpleHttpClient implements HttpClient { /** * Represent the default timeout duration for network requests in milliseconds. */ static readonly DEFAULT_TIMEOUT = 10000; /** * Return the root URL for the API endpoints. */ readonly baseURL: string; readonly headers: HeadersInit; /** * Return the amount of time in milliseconds before a timeout occurs * when requesting with HTTP methods. */ readonly timeout: number; /** * Constructs an instance of SimpleHttpClient with the given base URL, * timeout period and HTTP headers. * The HTTP headers are used each time this client send a request to the URL, * if not overwritten by the {@link HttpParams} of the method sending the request. * * @param {string} baseURL - The base URL for HTTP requests. * @param {HeadersInit} [headers=new Headers()] - The default headers for HTTP requests. * @param {number} [timeout=SimpleHttpClient.DEFAULT_TIMEOUT] - The timeout duration in milliseconds. */ constructor(baseURL: string, headers?: HeadersInit, timeout?: number); /** * Sends an HTTP GET request to the specified path with optional query parameters. * * @param {string} path - The endpoint path to which the HTTP GET request is sent. * @param {HttpParams} [params] - Optional parameters for the request, * including query parameters, headers, body, and response validation. * {@link HttpParams.headers} override {@link SimpleHttpClient.headers}. * @return {Promise} A promise that resolves with the response of the GET request. */ get(path: string, params?: HttpParams): Promise; /** * Determines if specified url is valid * @param {string} url Url to check * @returns {boolean} if value */ private isValidUrl; /** * Executes an HTTP request with the specified method, path, and optional parameters. * * @param {HttpMethod} method - The HTTP method to use for the request (e.g., GET, POST). * @param {string} path - The URL path for the request. Leading slashes will be automatically removed. * @param {HttpParams} [params] - Optional parameters for the request, * including query parameters, headers, body, and response validation. * {@link HttpParams.headers} override {@link SimpleHttpClient.headers}. * @return {Promise} A promise that resolves to the response of the HTTP request. * @throws {InvalidHTTPRequest} Throws an error if the HTTP request fails. */ http(method: HttpMethod, path: string, params?: HttpParams): Promise; /** * Makes an HTTP POST request to the specified path with optional parameters. * * @param {string} path - The endpoint to which the POST request is made. * @param {HttpParams} [params] - Optional parameters for the request, * including query parameters, headers, body, and response validation. * {@link HttpParams.headers} override {@link SimpleHttpClient.headers}. * @return {Promise} A promise that resolves with the response from the server. */ post(path: string, params?: HttpParams): Promise; } /** * HTTP trace logger for detailed request/response logging * * This logger is only activated when the SDK_TRACE environment variable is set to 'true' * It helps developers debug the exact HTTP traffic between the SDK and Thor nodes */ /** * Checks if trace logging is enabled via environment variable */ declare const isTraceEnabled: () => boolean; /** * Interface for HTTP trace log data */ interface TraceLogData { category: string; method?: string; url?: string; requestHeaders?: Record; requestBody?: unknown; responseHeaders?: Record; responseBody?: unknown; timestamp: number; duration?: number; error?: unknown; } /** * Logs HTTP request details before sending */ declare const logRequest: (method: string, url: string, headers?: Record, body?: unknown) => number; /** * Logs HTTP response details after receiving */ declare const logResponse: (startTimestamp: number, url: string, responseHeaders?: Record, responseBody?: unknown) => void; /** * Logs HTTP error details */ declare const logError: (startTimestamp: number, url: string, method: string, error: unknown) => void; // @NOTE: Errors handling (https://eips.ethereum.org/EIPS/eip-1193#errors) will be delegated to `errors` package /** * Interface for EIP-1193 provider request arguments. * * @see https://eips.ethereum.org/EIPS/eip-1193#request */ interface EIP1193RequestArguments { readonly method: string; readonly params?: unknown[]; } /** * Standardized provider interface for EIP-1193. * * @see https://eips.ethereum.org/EIPS/eip-1193#message * * The Final usage will be: * * ```typescript * EIP1193ProviderMessage.request(args: EIP1193RequestArguments): Promise; * ``` */ interface EIP1193ProviderMessage { request: (args: EIP1193RequestArguments) => Promise; } /* --- Input options start --- */ /** * Range interface for specifying a range of data. */ interface Range { /** * The unit for specifying the range (block or time). */ unit?: 'block' | 'time'; // The unit for specifying the range (block or time). /** * The starting point of the range. */ from?: number; /** * The ending point of the range. */ to?: number; } /** * Options interface for specifying Pagination Options (offset and limits). */ interface PaginationOptions { /** * Offset for pagination. */ offset?: number; /** * Limit for the number of results to return. */ limit?: number; } /** * FilterCriteria interface for filtering event logs. */ interface FilterCriteria { criteria: EventCriteria; eventAbi: ABIEvent; } /** * EventCriteria interface for filtering event logs. */ interface EventCriteria { /** * Address filter for event criteria. */ address?: string; /** * Event topics filter. */ topic0?: string; topic1?: string; topic2?: string; topic3?: string; topic4?: string; } /** * Order interface for filtering event logs. */ type EventDisplayOrder = 'asc' | 'desc'; /** * FilterRawEventLogsArg interface for filtering raw event logs. */ interface FilterRawEventLogsOptions { /** * Block range */ range?: Range; /** * Pagination options */ options?: PaginationOptions; /** * Event filters */ criteriaSet?: EventCriteria[]; /** * Sorting order */ order?: EventDisplayOrder; } /** * FilterEventLogsArg interface for filtering decoded event logs. */ interface FilterEventLogsOptions { /** * Block range */ range?: Range; /** * Pagination options */ options?: PaginationOptions; /** * Event filters */ criteriaSet?: FilterCriteria[]; /** * Sorting order */ order?: EventDisplayOrder; } /** * FilterTransferLogsArg interface for filtering transfer logs. */ interface FilterTransferLogsOptions { /** * Block range to query */ range?: Range; /** * Pagination options */ options?: PaginationOptions; /** * Criteria to filter transfers by */ criteriaSet: TransferCriteria[]; /** * Ordering of results */ order: EventDisplayOrder; } /* --- Input options end --- */ /* --- Responses Outputs start --- */ /** * Event metadata for an entity. */ interface Metadata { /** * Block identifier associated with the entity */ blockID: string; /** * Block number associated with the entity */ blockNumber: number; /** * Timestamp of the block */ blockTimestamp: number; /** * Transaction ID associated with the entity */ txID: string; /** * Transaction origin information */ txOrigin: string; /** * Index of the clause */ clauseIndex: number; } /** * TransferCriteria interface for filtering transfer logs. */ interface TransferCriteria { /** * Transaction origin filter for transfer criteria. */ txOrigin?: string; /** * Sender's address filter. */ sender?: string; /** * Recipient's address filter. */ recipient?: string; } /** * Event interface representing event data. */ interface Event { /** * The address related to the event. */ address: string; /** * Event topics or categories. */ topics: string[]; /** * Event data. */ data: string; } /** * Transfer interface representing transfer data. */ interface Transfer { /** * The sender's address in the transfer. */ sender: string; /** * The recipient's address in the transfer. */ recipient: string; /** * The amount being transferred. */ amount: string; } /** * EventLogs interface, combining Event and EventMetadata. */ interface EventLogs extends Event { /** * Event logs with associated metadata */ meta: Metadata; /** * The decoded data from the event. */ decodedData?: unknown[]; } /** * TransferLogs interface, combining Transfer and WithMeta. */ interface TransferLogs extends Transfer { /** * Transfer logs with associated metadata */ meta: Metadata; } /** * The `LogsClient` class provides methods to interact with log-related endpoints * of the VeChainThor blockchain. It allows filtering event and transfer logs. */ declare class LogsModule { readonly blocksModule: BlocksModule; constructor(blocksModule: BlocksModule); /** * Filters event logs based on the provided criteria. Raw event logs are not decoded. * * @param filterOptions - An object specifying filtering criteria for event logs. * @returns A promise that resolves to filtered event logs. */ filterRawEventLogs(filterOptions: FilterRawEventLogsOptions): Promise; /** * Filters event logs based on the provided criteria and decodes them using the provided ABI items. * The decoded data is added to the event logs as a new property. * @param filterOptions - An object specifying filtering criteria for event logs. */ filterEventLogs(filterOptions: FilterEventLogsOptions): Promise; /** * Filters event logs based on the provided criteria and decodes them using the provided ABI items. * The decoded data is added to the event logs as a new property. * The result is an array of event logs grouped by the event topic hash. * @param filterOptions * @returns A promise that resolves to an array of event logs grouped by event. */ filterGroupedEventLogs(filterOptions: FilterEventLogsOptions): Promise; /** * Filters event logs based on the provided criteria without decoding them. * @param filterOptions - An object specifying filtering criteria for event logs. * @private Returns a promise that resolves to filtered non decoded event logs. */ private getRawEventLogs; /** * Removes duplicated ABI items from the provided array. ABI items are considered duplicated if they have the same topic hash. * @param eventAbis - An array of event ABI items. * @private Returns a map of unique ABI items. */ private removeDuplicatedAbis; /** * Filters transfer logs based on the provided criteria. * * @param filterOptions - An object specifying filtering criteria for transfer logs. * @returns A promise that resolves to filtered transfer logs. */ filterTransferLogs(filterOptions: FilterTransferLogsOptions): Promise; } /* --- Input options start --- */ /** * Input options for Blocks module. */ interface BlocksModuleOptions { /** * (Optional) Whether the polling is enabled. */ isPollingEnabled?: boolean; /** * (Optional) Callback function called when an error occurs. */ onBlockError?: (error: Error) => undefined; } /** * Options for `waitForBlockCompressed` and `waitForBlockExpanded` methods. */ interface WaitForBlockOptions { /** * Timeout in milliseconds. * After this time, the method will throw an error. */ timeoutMs?: number; /** * Interval in milliseconds. * The method will check the blocks status every `intervalMs` milliseconds. */ intervalMs?: number; } /* --- Input options end --- */ /* --- Responses Outputs start --- */ /** * BlockDetail is an interface representing detailed information about a blockchain block. */ interface BlockDetail { /** * Unique identifier for the block. */ id: string; /** * Block number in the blockchain. */ number: number; /** * Size of the block in bytes. */ size: number; /** * Identifier of the parent block. */ parentID: string; /** * Timestamp when the block was created. */ timestamp: number; /** * Maximum gas limit for transactions in the block. */ gasLimit: number; /** * Address of the beneficiary (miner) of the block. */ beneficiary: string; /** * Total gas used by transactions in the block. */ gasUsed: number; /** * The minimum amount of fee required to include a transaction in the current block */ baseFeePerGas?: string; /** * Represents the Accumulated Witness Number (AWN) of the block. * It is used when selecting the trunk block in the VeChainThor consensus algorithm. * * @link see [VeChainThor Trunk](https://docs.vechain.org/introduction-to-vechain/about-the-vechain-blockchain/consensus-deep-dive#meta-transaction-features-3) */ totalScore: number; /** * Root hash of the transactions in the block. */ txsRoot: string; /** * Optional features associated with transactions. */ txsFeatures?: number; /** * Root hash of the state tree after applying transactions. */ stateRoot: string; /** * Root hash of the receipts of transactions. */ receiptsRoot: string; /** * Address of the signer or validator for the block. */ signer: string; /** * Indicates if the block contains a community fund (com). */ com?: boolean; /** * Indicates if the block is finalized (optional). */ isFinalized?: boolean; /** * Since there is no computational competition in PoA, the "longest chain" rule does not apply. * Instead, we consider the better branch as the one witnessed by more AMs (Authority Master nodes). * * @link see [VeChainThor Trunk](https://docs.vechain.org/introduction-to-vechain/about-the-vechain-blockchain/consensus-deep-dive#meta-transaction-features-3) */ isTrunk: boolean; } /** * Type for the compressed block detail. * Here we have the transactions as an array of strings. */ interface CompressedBlockDetail extends BlockDetail { transactions: string[]; } /** * Type for the expanded block detail. * Here we have the transactions expanded with the details. */ interface ExpandedBlockDetail extends BlockDetail { transactions: TransactionsExpandedBlockDetail[]; } /** * Output represents the result or consequence of a blockchain transaction. */ interface Output { /** * address of the contract involved in the clause output. */ contractAddress: string | null; /** * Events emitted by executing the clause. */ events: Event[]; /** * Transfers of VET or VIP180 tokens that occur from the clause. */ transfers: Transfer[]; } /** * TransactionsExpandedBlockDetail is an interface representing detailed information about transactions in a blockchain block. */ interface TransactionsExpandedBlockDetail { /** * Unique identifier for the transaction. */ id: string; /** * Type of the transaction (ex: type 81). */ type?: number; /** * Chain tag of the blockchain. */ chainTag: string; /** * Reference to the block. */ blockRef: string; /** * Expiration timestamp of the transaction. */ expiration: number; /** * Clauses represent the individual conditions or terms in a blockchain transaction. */ clauses: TransactionClause[]; /** * The maximum amount that can be spent to pay for base fee and priority fee expressed in hex. * This is an optional hexadecimal expression or null. */ maxFeePerGas?: string | null; /** * The maximum amount that can be spent to pay for base fee and priority fee expressed in hex. * This is an optional hexadecimal expression or null. */ maxPriorityFeePerGas?: string | null; /** * Gas price coefficient for the transaction. */ gasPriceCoef?: number; /** * Gas limit for the transaction. */ gas: number; /** * Origin (sender) of the transaction. */ origin: string; /** * The address of the gas-payer of the transaction. * * **NOTE!** * * * The property name `delegator` is exposed by * [Tx](https://mainnet.vechain.org/doc/stoplight-ui/#/schemas/Tx) * response of the end-point * [Retrieve a block](https://mainnet.vechain.org/doc/stoplight-ui/#/paths/blocks-revision/get) * with query set as `?expanded=true`. * * In the rest of the SDK the address of the sponsor of the transaction is exposed by properties named * `gasPayer`. * It's suggested to read as "delegated" the term written as "delegator". * * This interface exposes the property {@link gasPayer} to express the address of the sponsor of the * transaction, either {@link origin} or {@link delegator}. */ delegator: string; /** * Nonce value for preventing replay attacks. */ nonce: string; /** * Transaction dependency. */ dependsOn: string; /** * Size of the transaction in bytes. */ size: number; /** * Gas used by the transaction. */ gasUsed: number; /** * Account paying for the gas. */ gasPayer: string; /** * Amount paid for the transaction. */ paid: string; /** * Reward associated with the transaction. */ reward: string; /** * Indicates if the transaction is reverted. */ reverted: boolean; /** * Outputs represent the results or consequences of a blockchain transaction. */ outputs: Output[]; } /** The `BlocksModule` class encapsulates functionality for interacting with blocks * on the VeChainThor blockchain. */ declare class BlocksModule { readonly httpClient: HttpClient; /** * The head block (best block). This is updated by the event poll instance every time a new block is produced. * @private */ private headBlock; /** * Error handler for block-related errors. */ onBlockError?: (error: Error) => undefined; /** * The Poll instance for event polling * @private */ private pollInstance?; /** * Initializes a new instance of the `Thor` class. * @param httpClient - The Thor instance used to interact with the VeChain blockchain API. * @param options - (Optional) Other optional parameters for polling and error handling. */ constructor(httpClient: HttpClient, options?: BlocksModuleOptions); /** * Destroys the instance by stopping the event poll. */ destroy(): void; /** * Sets up the event polling for the best block. * @private * */ private setupPolling; /** * Retrieves details of a compressed specific block identified by its revision (block number or ID). * * @param revision - The block number or ID to query details for. * @returns A promise that resolves to an object containing the details of the compressed block. * @throws {InvalidDataType} */ getBlockCompressed(revision: string | number): Promise; /** * Retrieves details of an expanded specific block identified by its revision (block number or ID). * * @param revision - The block number or ID to query details for. * @returns A promise that resolves to an object containing the details of the expanded block. * @throws {InvalidDataType} */ getBlockExpanded(revision: string | number): Promise; /** * Retrieves details of the latest block. * * @returns A promise that resolves to an object containing the compressed block details. */ getBestBlockCompressed(): Promise; /** * Retrieves details of the latest block. * * @returns A promise that resolves to an object containing the expanded block details. */ getBestBlockExpanded(): Promise; /** * Retrieves the base fee per gas of the best block. * * @returns A promise that resolves to the base fee per gas of the best block. */ getBestBlockBaseFeePerGas(): Promise; /** * Asynchronously retrieves a reference to the best block in the blockchain. * * This method first calls `getBestBlockCompressed()` to obtain the current best block. If no block is found (i.e., if `getBestBlockCompressed()` returns `null`), * the method returns `null` indicating that there's no block to reference. Otherwise, it extracts and returns the first 18 characters of the * block's ID, providing the ref to the best block. * * @returns {Promise} A promise that resolves to either a string representing the first 18 characters of the best block's ID, * or `null` if no best block is found. * * @Example: * const blockRef = await getBestBlockRef(); * if (blockRef) { * console.log(`Reference to the best block: ${blockRef}`); * } else { * console.log("No best block found."); * } */ getBestBlockRef(): Promise; /** * Retrieves the finalized block. * * @returns A promise that resolves to an object containing the finalized block. */ getFinalBlockCompressed(): Promise; /** * Retrieves details of the finalized block. * * @returns A promise that resolves to an object containing the finalized block details. */ getFinalBlockExpanded(): Promise; /** * Synchronously waits for a specific block revision using polling. * * @param blockNumber - The block number to wait for. * @param expanded - A boolean indicating whether to wait for an expanded block. * @param options - (Optional) Allows to specify timeout and interval in milliseconds * @returns A promise that resolves to an object containing the compressed block. * @throws {InvalidDataType} */ private _waitForBlock; /** * Synchronously waits for a specific block revision using polling. * * @param blockNumber - The block number to wait for. * @param options - (Optional) Allows to specify timeout and interval in milliseconds * @returns A promise that resolves to an object containing the compressed block. */ waitForBlockCompressed(blockNumber: number, options?: WaitForBlockOptions): Promise; /** * Synchronously waits for a specific expanded block revision using polling. * * @param blockNumber - The block number to wait for. * @param options - (Optional) Allows to specify timeout and interval in milliseconds * @returns A promise that resolves to an object containing the expanded block details. */ waitForBlockExpanded(blockNumber: number, options?: WaitForBlockOptions): Promise; /** * Returns the head block (best block). * @returns {BlockDetail | null} The head block (best block). */ getHeadBlock(): CompressedBlockDetail | null; /** * Retrieves details of the genesis block. * * @returns A promise that resolves to an object containing the block details of the genesis block. */ getGenesisBlock(): Promise; /** * Retrieves all addresses involved in a given block. This includes beneficiary, signer, clauses, * gas payer, origin, contract addresses, event addresses, and transfer recipients and senders. * * @param {ExpandedBlockDetail} block - The block object to extract addresses from. * * @returns {string[]} - An array of addresses involved in the block, included * empty addresses, duplicate elements are removed. * */ getAllAddressesIntoABlock(block: ExpandedBlockDetail): string[]; } /** * Transaction clause type for transaction simulation having value only string. */ type SimulateTransactionClause = TransactionClause; /* --- Input options start --- */ /** * Options for `waitForTransaction` method. */ interface WaitForTransactionOptions { /** * Timeout in milliseconds. * After this time, the method will return `null` if the transaction is not included in a block. * If not specified, a default timeout of 30 seconds will be used. */ timeoutMs?: number; /** * Interval in milliseconds. * The method will check the transaction status every `intervalMs` milliseconds. * If not specified, a default interval of 1000 milliseconds (1 second) will be used. */ intervalMs?: number; } /** * Options for `buildTransactionBody` method. */ interface TransactionBodyOptions { /** * 8 bytes prefix of some block's ID */ blockRef?: string; /** * Last byte of genesis block ID */ chainTag?: number; /** * The ID of the transaction that this transaction depends on. */ dependsOn?: string; /** * The expiration time of the transaction. * The transaction will expire after the number of blocks specified by this value. */ expiration?: number; /** * The maximum amount of gas to allow this transaction to consume. */ gas?: string | number; /** * The maximum amount of gas to allow this transaction to consume. * @deprecated Use `gas` instead. This property will be removed in a future release. */ gasLimit?: string; /** * The gas price to use for legacy transactions or transactions on * legacy networks. * * Most of the time the ``max*FeePerGas`` is preferred. */ gasPrice?: string; /** * Coefficient used to calculate the gas price for the transaction. * Value must be between 0 and 255. */ gasPriceCoef?: number; /** * Whether the transaction is delegated to another account for gas payment. */ isDelegated?: boolean; /** * Nonce value for various purposes. * Basic is to prevent replay attack by make transaction unique. * Every transaction with same chainTag, blockRef, ... must have different nonce. */ nonce?: string | number; /** * The maximum fee per gas for the transaction. */ maxFeePerGas?: string | number; /** * The maximum priority fee per gas for the transaction. */ maxPriorityFeePerGas?: string | number; } /** * Options for `signTransaction` method. */ type SignTransactionOptions = | { gasPayerServiceUrl: string; gasPayerPrivateKey?: never } | { gasPayerPrivateKey: string; gasPayerServiceUrl?: never }; /** * Input options for: * * getTransactionReceipt * Methods */ interface GetTransactionReceiptInputOptions { /** * (Optional) The block number or ID to reference the transaction. */ head?: string; } /** * Input options for: * * getTransaction * Methods */ type GetTransactionInputOptions = GetTransactionReceiptInputOptions & { /** * (Optional) If true, returns the pending transaction details instead of the final transaction details. */ pending?: boolean; }; /** * Type for transaction simulation options. */ interface SimulateTransactionOptions { /** * The block number or block ID of which the transaction simulation is based on */ revision?: Revision; /** * The offered gas for the transaction simulation */ gas?: string | number; /** * The price of gas for the transaction simulation */ gasPrice?: string; /** * The caller of the transaction simulation. (i.e., the address that performs the transaction) */ caller?: string; // ------ START: EXTENDED EVM CONTEXT OPTIONS ------ // /* The following options are useful when simulating transactions that provide additional context to the EVM. The additional context is handled by the built-in Extension-V2 Smart contract (https://docs.vechain.org/developer-resources/built-in-contracts#extension-v2-sol) The contract allows for smart contract developers to obtain additional context about the transaction in their smart contract code, for example: - The expiration of the transaction - The block reference of the transaction - The gas payer of the transaction - The proved work of the transaction (https://docs.vechain.org/core-concepts/transactions/transaction-calculation#proof-of-work) */ /** * The VeChainThor blockchain allows for transaction-level proof of work (PoW) and converts the proved work into extra gas price that will be used by * the system to generate more reward to the block generator, the Authority Master node, that validates the transaction. * In other words, users can utilize their local computational power to make their transactions more likely to be included in a new block. * * @link [VeChainThor Proof of Work](https://docs.vechain.org/core-concepts/transactions/transaction-calculation#proof-of-work) */ provedWork?: string; /** * The address that pays for the gas fee of the transaction simulation. * If different from the caller, then a delegated transaction is simulated. */ gasPayer?: string; /** * The expiration of the transaction simulation. * Represents how long, in terms of the number of blocks, the transaction will be allowed to be mined in VeChainThor */ expiration?: number; /** * BlockRef stores the reference to a particular block whose next block is the earliest block the current transaction can be included. * * @link [VeChainThor BlockRef](https://docs.vechain.org/core-concepts/transactions/meta-transaction-features/controllable-transaction-lifecycle) */ blockRef?: string; // ------ END: EXTENDED EVM CONTEXT OPTIONS ------ // } /* --- Input options end --- */ /* --- Responses Outputs start --- */ /** * Represents the result of sending a transaction. * * @interface SendTransactionResult */ interface SendTransactionResult { /** * The unique identifier associated with the transaction. * * @type {string} */ id: string; wait: ( options?: WaitForTransactionOptions ) => Promise; } /** * Represents the result of getting a delegation signature. */ interface GetDelegationSignatureResult { /** * The signature of the transaction. */ signature: string; } /** * Transaction Metadata interface. */ interface TransactionMetadata { blockID: string; blockNumber: number; blockTimestamp: number; txID?: string; txOrigin?: string; } /** * Type for RAW transaction detail. * It is the response of `getTransaction` with `raw` set to `true`. */ interface TransactionDetailRaw { /** * Raw data */ raw: string; /** * Transaction meta data */ meta: Omit; } /** * Type for NO RAW transaction detail. * It is the response of `getTransaction` with `raw` set to `false`. */ type TransactionDetailNoRaw = TransactionBody$1 & { id: string; origin: string; gasPayer: string | null; size: number; meta: TransactionMetadata; type: number; }; /** * Type for transaction receipt. */ interface TransactionReceipt { /** * Gas used in the transaction */ gasUsed: number; /** * For delegated transactions the gas payer * */ gasPayer: string; /** * Energy paid for used gas */ paid: string; /** * Energy reward given to block proposer */ reward: string; /** * If the transaction has been reverted */ reverted: boolean; /** * Outputs of the transaction, e.g. contract, events, transfers */ outputs: Output[]; /** * Data associated with the transaction e.g. blockID, blockNumber, txID */ meta: TransactionMetadata; /** * The maximum fee per gas for the transaction. */ maxFeePerGas?: string; /** * The maximum priority fee per gas for the transaction. */ maxPriorityFeePerGas?: string; } /** * [Event](http://127.0.0.1:8669/doc/stoplight-ui/#/schemas/Event) */ interface TransactionSimulationEvent { /** * The address of the contract that emitted the event. */ address: string; /** * Topics are indexed parameters to an event. The first topic is always the event signature. */ topics: string[]; /** * The data associated with the event. */ data: string; } /** * Type for transaction call simulation result. */ interface TransactionSimulationResult { /** * Data returned from the transaction simulation */ data: string; /** * Events emitted from the transaction simulation */ events: TransactionSimulationEvent[]; /** * Transfers that occur from the transaction simulation */ transfers: Transfer[]; /** * Gas used from the transaction simulation */ gasUsed: number; /** * Boolean indicating if the transaction simulation reverted */ reverted: boolean; /** * Error message from the transaction simulation if it reverted */ vmError: string; } /** * Available types for the VeChainProvider's * * @NOTE: We use our supported providers instead of ethers providers. * If you create a new provider, you need to add it here. */ type AvailableVeChainProviders = VeChainProvider | HardhatVeChainProvider; /** * EIP-712 types in case we change the provider (viem as of now) */ type TypedDataDomain = Omit & { chainId?: number | bigint | string; }; type TypedDataParameter = TypedDataParameter$1; /** * Type for transaction input * * @note Types of the properties can differ WRT ethers.TransactionRequest */ interface TransactionRequestInput { /** * The target of the transaction. */ to?: null | string; /** * The sender of the transaction. */ from?: null | string; /** * Nonce value for various purposes. * Basic is to prevent replay attack by make transaction unique. * Every transaction with same chainTag, blockRef, ... must have different nonce. */ nonce?: string | number; /** * The maximum amount of gas to allow this transaction to consume. */ gas?: string | number; /** * The maximum amount of gas to allow this transaction to consume. * @deprecated Use `gas` instead. This property will be removed in a future release. */ gasLimit?: string; /** * The gas price to use for legacy transactions or transactions on * legacy networks. * * Most of the time the ``max*FeePerGas`` is preferred. */ gasPrice?: string; /** * Coefficient used to calculate the gas price for the transaction. * Value must be between 0 and 255. */ gasPriceCoef?: number; /** * The transaction data. */ data?: string; /** * The transaction value (in wei). */ value?: string | number; /** * When using ``call`` or ``estimateGas``, this allows a specific * block to be queried. Many backends do not support this and when * unsupported errors are silently squelched and ``"latest"`` is used. */ blockTag?: string; /** * Add clauses to ethers.TransactionRequest */ clauses?: TransactionClause[]; /** * The ID of the transaction that this transaction depends on. */ dependsOn?: string; /** * The expiration time of the transaction. * The transaction will expire after the number of blocks specified by this value. */ expiration?: number; /** * 8 bytes prefix of some block's ID */ blockRef?: string; /** * Last byte of genesis block ID */ chainTag?: number; /** * A reserved field intended for features use. * * In standard EVM transactions, this reserved field typically is not present. * However, it's been designed to cater to VIP-191, which deals with fee delegation. * * If the `features` within the `reserved` field is set as `1111...111`, it indicates that the transaction has been delegated. * The method to check if the transaction is delegated is: * * ```typescript * reserved.features & 1 === 1 * ``` * * @example * * 1. * ```typescript * feature = 111101; * isDelegated = (111101 & 111111) === 111101; // false (not delegated) * ``` * * 2. * ```typescript * feature = 111111; * isDelegated = (111111 & 111111) === 111111; // true (delegated) * ``` * * @remarks * For more information on the subject, refer to {@link https://github.com/vechain/VIPs/blob/master/vips/VIP-191.md | VIP-191}. */ reserved?: { /** * Tx feature bits */ features?: number; /** * Unused */ unused?: Uint8Array[]; }; /** * The VeChainThor blockchain allows for transaction-level proof of work (PoW) and converts the proved work into extra gas price that will be used by * the system to generate more reward to the block generator, the Authority Masternode, that validates the transaction. * In other words, users can utilize their local computational power to make their transactions more likely to be included in a new block. * * @link [VeChainThor Proof of Work](https://docs.vechain.org/core-concepts/transactions/transaction-calculation#proof-of-work) */ provedWork?: string; /** * The address that pays for the gas fee of the transaction simulation. * If different from the caller, then a delegated transaction is simulated. */ gasPayer?: string; /** * The delegation URL to use to sponsor the transaction. */ delegationUrl?: string; /** * A comment describing the transaction request. */ comment?: string; // START: NOT SUPPORTED FIELDS in VeChain BUT added to take compatibility with ethers /** * The chain ID for the network this transaction is valid on. */ chainId?: string; /** * The [[link-eip-2930]] access list. Storage slots included in the access * list are //warmed// by preloading them, so their initial cost to * fetch is guaranteed, but then each additional access is cheaper. */ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents accessList?: null | AccessListish; /** * A custom object, which can be passed along for network-specific * values. */ customData?: unknown; /** * The [[link-eip-1559]] maximum priority fee to pay per gas. */ maxPriorityFeePerGas?: string | number; /** * The [[link-eip-1559]] maximum total fee to pay per gas. The actual * value used is protocol enforced to be the block's base fee. */ maxFeePerGas?: string | number; /** * The transaction type. */ type?: null | number; /** * When using ``call``, this enables CCIP-read, which permits the * provider to be redirected to web-based content during execution, * which is then further validated by the contract. * * There are potential security implications allowing CCIP-read, as * it could be used to expose the IP address or user activity during * the fetch to unexpected parties. */ enableCcipRead?: boolean; // END: NOT SUPPORTED FIELDS in VeChain BUT added to take compatibility with ethers } /** * Options for signing typed data * * @NOTE: To enhance compatibility with extension and mobile and to allow account switching when signing typed data, we define this interface. */ interface SignTypedDataOptions { signer?: string; } /** * A signer for VeChain, adding specific methods for VeChain to the ethers signer * * @NOTE: Su support completely our providers (that already support ethers provider format) * We use our supported providers instead of ethers providers */ interface VeChainSigner { /** * The provider attached to this Signer (if any). */ provider?: AvailableVeChainProviders; /** * Returns a new instance of this Signer connected to //provider// or detached * from any Provider if undefined. * * @param provider - The provider to connect to * @returns a new instance of this Signer connected to //provider// or detached */ connect: (provider: AvailableVeChainProviders) => this; /** * Get the address of the Signer. * * @returns the address of the signer */ getAddress: () => Promise; /** * Gets the next nonce required for this Signer to send a transaction. * * @param blockTag - The blocktag to base the transaction count on, keep in mind * many nodes do not honour this value and silently ignore it [default: ``"latest"``] * * @NOTE: This method generates a random number as nonce. It is because the nonce in VeChain is a 6-byte number. */ getNonce: (blockTag?: string) => Promise; /** * Prepares a {@link TransactionRequestInput} for calling: * - resolves ``to`` and ``from`` addresses * - if ``from`` is specified, check that it matches this Signer * * @note: Here the base support of multi-clause transaction is added. * So, if clauses are provided in the transaction, it will be used as it is. * Otherwise, standard transaction will be prepared. * * @param transactionToPopulate - The call to prepare * @returns the prepared call transaction */ populateCall: ( transactionToPopulate: TransactionRequestInput ) => Promise; /** * Prepares a {@link TransactionRequestInput} for sending to the network by * populating any missing properties: * - resolves ``to`` and ``from`` addresses * - if ``from`` is specified , check that it matches this Signer * - populates ``nonce`` via ``signer.getNonce("pending")`` * - populates gas parameters via ``signer.estimateGas(tx)`` * - ... and other necessary properties * * @param transactionToPopulate - The call to prepare * @returns the prepared transaction */ populateTransaction: ( transactionToPopulate: TransactionRequestInput ) => Promise; /** * Estimates the required gas required to execute //tx// on the Blockchain. This * will be the expected amount a transaction will require * to successfully run all the necessary computations and store the needed state * that the transaction intends. * * @param transactionToEstimate - The transaction to estimate gas for * @returns the total estimated gas required */ estimateGas: ( transactionToEstimate: TransactionRequestInput ) => Promise; /** * Evaluates the //tx// by running it against the current Blockchain state. This * cannot change state and has no cost, as it is effectively simulating * execution. * * This can be used to have the Blockchain perform computations based on its state * (e.g. running a Contract's getters) or to simulate the effect of a transaction * before actually performing an operation. * * @param transactionToEvaluate - The transaction to evaluate * @param revision - The revision to evaluate the transaction against * @returns the result of the evaluation */ call: ( transactionToEvaluate: TransactionRequestInput, revision?: Revision ) => Promise; /** * Signs %%transactionToSign%%, returning the fully signed transaction. This does not * populate any additional properties within the transaction. * * @param transactionToSign - The transaction to sign * @returns The fully signed transaction */ signTransaction: ( transactionToSign: TransactionRequestInput ) => Promise; /** * Sends %%transactionToSend%% to the Network. The ``signer.populateTransaction(transactionToSend)`` * is called first to ensure all necessary properties for the * transaction to be valid have been populated first. * * @param transactionToSend - The transaction to send * @returns The transaction response */ sendTransaction: ( transactionToSend: TransactionRequestInput ) => Promise; /** * Signs an [[link-eip-191]] prefixed a personal message. * * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is **not** * interpreted as a [[BytesLike]]; so the string ``"0x1234"`` is signed as six * characters, **not** two bytes. * * To sign that example as two bytes, the Uint8Array should be used * (i.e. ``new Uint8Array([ 0x12, 0x34 ])``). */ signMessage: (message: string | Uint8Array) => Promise; /** * Signs the [[link-eip-712]] typed data. */ signTypedData: ( domain: TypedDataDomain, types: Record, message: Record, primaryType?: string, options?: SignTypedDataOptions ) => Promise; /** * Resolves an VNS Name to an address. */ resolveName: (vnsName: string) => Promise; } /** * Utility method to convert a transaction body to a transaction request input * * @param transactionBody - The transaction body to convert * @param from - The address of the sender * * @returns The transaction request input * @throws Error if nonce is negative */ declare function transactionBodyToTransactionRequestInput(transactionBody: TransactionBody$1, from: string): TransactionRequestInput; declare const signerUtils: { transactionBodyToTransactionRequestInput: typeof transactionBodyToTransactionRequestInput; }; /** * The account details represent the balance, energy & whether the account is a smart contract. */ interface AccountData { /** * The hexadecimal expression of the wei VET value of the balance. */ balance: string; /** * The hexadecimal expression of the wei VTHO value of the energy balance. */ energy: string; /** * Whether the account is a smart contract (i.e., hasCode is true) */ hasCode: boolean; } /** * Represents detailed account information. * * Implements the {@link AccountData} interface. */ declare class AccountDetail implements AccountData { /** * Return the hexadecimal expression of the wei VET value of the balance. */ readonly balance: string; /** * Return the hexadecimal expression of the wei VTHO value of the energy balance. */ readonly energy: string; /** * Return `true` if the account is a smart contract, otherwise `false`. */ readonly hasCode: boolean; /** * Returns the balance of the account in {@link VET}. */ get vet(): VET; /** * Returns the energy balance of the account in {@link VTHO}. */ get vtho(): VTHO; /** * Constructs a new instance of the class. * * @param {AccountData} accountData - The data to initialize the account with. */ constructor(accountData: AccountData); } /** * Input options for: * * {@link AccountModule.getAccount}, * * {@link AccountModule.getBytecode}, * * {@link AccountModule.getStorage}, */ interface AccountInputOptions { /** * (Optional) The block number or ID to reference the bytecode version. */ revision?: Revision; } /** * of the VeChain Thor blockchain. * It allows to retrieve details, bytecode, and storage data for a specific blockchain account. */ declare class AccountsModule { readonly httpClient: HttpClient; /** * Creates an instance of the class with a specified HTTP client. * * @param {HttpClient} httpClient - The HTTP client instance to be used for making requests. */ constructor(httpClient: HttpClient); /** * Retrieves the details of an account given the account address and optional parameters. * * @param {Address} address - The address of the account to be retrieved. * @param {AccountInputOptions} [options] - Optional parameters to modify the account retrieval. * @return {Promise} Returns a promise that resolves to the account details. */ getAccount(address: Address, options?: AccountInputOptions): Promise; /** * Retrieves the bytecode of the smart contract deployed at the specified address. * * @param {Address} address - The address of the smart contract. * @param {AccountInputOptions} [options] - Optional settings for the request, including the block revision. * @return {Promise} A promise that resolves to the bytecode of the smart contract. */ getBytecode(address: Address, options?: AccountInputOptions): Promise; /** * Retrieves the storage value at the specified storage position for a given address. * * @param {Address} address - The address of the account whose storage value is to be retrieved. * @param {ThorId} position - The position in the storage from where the value is to be retrieved. * @param {AccountInputOptions} [options] - Optional parameters including revision for specifying the block number or ID to query against. * @return {Promise} - A promise that resolves to the storage value as a string. */ getStorageAt(address: Address, position: BlockId, options?: AccountInputOptions): Promise; } /* --- Input options start --- */ type EstimateGasOptions = Omit & { /** * percentage of gas to add on top of the estimated gas. * Value must be between (0, 1]. (e.g. 0.1 = 10%) */ gasPadding?: number; }; /** * Options for the getFeeHistory method */ interface FeeHistoryOptions { /** * Number of blocks in the requested range */ blockCount: number; /** * Highest block of the requested range */ newestBlock: string | number; /** * Optional array of percentiles to compute */ rewardPercentiles?: number[]; } /* --- Input options end --- */ /* --- Responses Outputs start --- */ /** * The result of estimating the gas cost of a transaction. */ interface EstimateGasResult { /** * The total gas cost estimation of the transaction. */ totalGas: number; /** * Boolean indicating whether the transaction reverted or not. */ reverted: boolean; /** * Decoded Solidity revert reasons for each clause. * If the n-th clause reverted, then the n-th element of this array will be the decoded revert reason for the n-th clause. * * @note revertReasons will be undefined if the transaction did not revert. */ revertReasons: Array; /** * The error message produced by the Virtual Machine. * * @note vmErrors will be undefined if the transaction did not revert. */ vmErrors: string[]; } /** * Response from the /fees/priority endpoint */ interface FeesPriorityResponse { /** * The suggested priority fee per gas in wei (hex string) */ maxPriorityFeePerGas: string; } /** * Response from the eth_feeHistory method */ interface FeeHistoryResponse { /** * Lowest number block of the returned range */ oldestBlock: string; /** * An array of block base fee per gas */ baseFeePerGas: string[]; /** * An array of block gas used ratio */ gasUsedRatio: string[]; /** * An array of effective priority fee per gas data points from a single block */ reward?: string[][]; } declare module 'abitype' { export interface Register { AddressType: string; } } declare module 'viem/node_modules/abitype' { export interface Register { AddressType: string; } } /* --------- Input types Start --------- */ /** * Defines the options for executing a contract transaction. * Includes all EstimateGasOptions properties (revision, gas, gasPrice, provedWork, gasPayer, expiration, blockRef) * plus the gasPadding property for gas estimation padding. */ type ContractTransactionOptions = { signTransactionOptions?: SignTransactionOptions; /** * The delegation URL to use to sponsor the transaction. */ delegationUrl?: string; } & TransactionBodyOptions & EstimateGasOptions & ClauseOptions; /** * Defines the options for executing a contract call within a blockchain environment. * Includes all EstimateGasOptions properties (revision, gas, gasPrice, provedWork, gasPayer, expiration, blockRef) * plus the gasPadding property for gas estimation padding. */ type ContractCallOptions = EstimateGasOptions & ClauseOptions; /* --------- Input types End --------- */ /** * Represents the result of a contract call operation, encapsulating the output of the call. */ interface ContractCallResult { success: boolean; result: { plain?: unknown; // Success result as a plain value (might be literal or object). array?: unknown[]; // Success result as an array (values are the same as in plain). errorMessage?: string; }; } /** * Represents a filter for events emitted by a smart contract. This class allows for the specification of criteria to filter * events and provides a method to fetch event logs based on those criteria. */ declare class ContractFilter { /** * The smart contract instance to apply the filter on. */ contract: Contract; /** * A set of criteria used to filter events. */ criteriaSet: FilterCriteria[]; /** * Constructs an instance of the `ContractFilter` class. * * @param contract - The smart contract instance to apply the filter on. * @param criteriaSet - A set of criteria used to filter events. */ constructor(contract: Contract, criteriaSet: FilterCriteria[]); /** * Retrieves event logs based on the specified filter criteria, range, pagination options, and order. * * @returns An array of event logs that match the specified criteria. * @param param - The filter options to apply to the event logs. */ get(param?: TransferFilterOptions): Promise; } /** * Represents a generic contract function type that accepts an arbitrary number of arguments * and returns a value of generic type `T`. This type is typically used to model the behavior of * smart contract functions in a blockchain context. * * @typeParam T - The expected return type of the function. Defaults to `unknown` if not specified. * @param args - An array of arguments that the contract function accepts. The types of these arguments * are not specified, allowing for flexibility in function signatures. * @returns A value of type `T`, representing the result of the contract function execution. */ type ContractFunctionSync = ( ...args: [ ...( | [ Partial<{ value: number | string | bigint; revision: string; comment: string; }> ] | [] ), ...AbiParametersToPrimitiveTypes ] ) => T; /** * Represents a generic contract function type that accepts an arbitrary number of arguments * and returns a promise that resolves to a generic type `T`. This type is typically used to * model the behavior of smart contract functions in a blockchain context. * * @typeParam T - The expected return type of the promise. Defaults to `unknown` if not specified. * @param args - An array of arguments that the contract function accepts. The types of these arguments * are not specified, allowing for flexibility in function signatures. * @returns A promise that resolves to the type `T`, representing the result of the contract function execution. */ type ContractFunctionAsync = ( ...args: [ ...( | [ Partial<{ value: number | string | bigint; revision: string; comment: string; }> ] | [] ), ...AbiParametersToPrimitiveTypes ] ) => Promise; /** * Defines a mapping of contract function names to their corresponding read-only contract functions. * Each function in this record is expected to return a `Promise` that resolves to `ContractCallResult`, * which should encapsulate the result of a read-only contract call. * * The keys of this record represent the names of the contract functions, and the values are the contract * functions themselves, adhering to the `ContractFunctionAsync` type with `ContractCallResult` as the return type. * * @template TAbi - The ABI of the contract which includes the contract functions. * @template TFunctionName - The names of the contract functions extracted from the ABI that are either 'pure' or 'view'. * @template TAbiFunction - The contract function extracted from the ABI based on the function name. */ type ContractFunctionRead< TAbi extends Abi, TFunctionName extends ExtractAbiFunctionNames > = { [key in TFunctionName]: ContractFunctionAsync< AbiParametersToPrimitiveTypes< ExtractAbiFunction['outputs'], 'outputs' >, ExtractAbiFunction >; }; /** * Defines a mapping of contract function names to their corresponding transactional contract functions. * Each function in this record is expected to return a `Promise` that resolves to `SendTransactionResult`, * which should encapsulate the result of a transactional contract call (e.g., modifying state on the blockchain). * * The keys of this record represent the names of the contract functions, and the values are the contract * functions themselves, adhering to the `ContractFunctionAsync` type with `SendTransactionResult` as the return type. * * @template TAbi - The ABI of the contract which includes the contract functions. * @template TFunctionName - The names of the contract functions extracted from the ABI that are either 'payable' or 'nonpayable'. * @template TAbiFunction - The contract function extracted from the ABI based on the function name. */ type ContractFunctionTransact< TAbi extends Abi, TFunctionName extends ExtractAbiFunctionNames< TAbi, 'payable' | 'non payable' > > = { [key in TFunctionName]: ContractFunctionAsync< SendTransactionResult, ExtractAbiFunction >; }; /** * Defines a mapping of contract event names to their corresponding filter criteria contract functions. * Each function in this record is expected to return a value of type `ContractFilter`, which represents * a filter that can be used to query events emitted by the contract. * The keys of this record represent the names of the contract events, and the values are the contract * functions themselves. * @template TAbi - The ABI (Application Binary Interface) of the contract. * @template TEventNames - The names of the events extracted from the ABI. * @template TAbiEvent - The event type extracted from the ABI for a given event name. */ type ContractFunctionFilter< TAbi extends Abi, TEventNames extends string, TABIEvent extends AbiFunction = ExtractAbiEvent > = { [K in TEventNames]: ( args?: | GetEventArgs | Partial< AbiParametersToPrimitiveTypes > ) => ContractFilter; }; /** * Defines a mapping of contract function names to their corresponding transactional contract functions. * Each function in this record is expected to return a value of type `TransactionClause`, which represents * a transaction clause that can be used to interact with the contract. * * The keys of this record represent the names of the contract functions, and the values are the contract * functions themselves, adhering to the `ContractFunctionSync` type with `ContractClause` as the return type. * * @template TAbi - The ABI (Application Binary Interface) of the contract. * @template TFunctionName - The names of the functions extracted from the ABI, restricted to 'pure' or 'view' functions. * @template TAbiFunction - The function type extracted from the ABI for a given function name. */ type ContractFunctionClause< TAbi extends Abi, TFunctionName extends ExtractAbiFunctionNames > = { [key in TFunctionName]: ContractFunctionSync< ContractClause, ExtractAbiFunction >; }; /** * Defines a mapping of contract event names to their corresponding filter criteria contract functions. * Each function in this record is expected to return a value of type `FilterCriteria`, which represents * a filter that can be used to query events emitted by the contract. * The keys of this record represent the names of the contract events, and the values are the contract * functions themselves. * @template TAbi - The ABI (Application Binary Interface) of the contract. * @template TEventNames - The names of the events extracted from the ABI. * @template TABIEvent - The event type extracted from the ABI for a given event name. */ type ContractFunctionCriteria< TAbi extends Abi, TEventNames extends string, TABIEvent extends AbiFunction = ExtractAbiEvent > = { [K in TEventNames]: ( args?: | GetEventArgs | Partial< AbiParametersToPrimitiveTypes > ) => FilterCriteria; }; /** * Represents the options for the get method of the `ContractFilter` class. */ interface TransferFilterOptions { range?: Range; options?: PaginationOptions; order?: EventDisplayOrder; } /** * A class representing a smart contract deployed on the blockchain. */ declare class Contract { readonly contractsModule: ContractsModule; readonly address: string; readonly abi: Abi; private signer?; readonly deployTransactionReceipt: TransactionReceipt | undefined; read: ContractFunctionRead>; transact: ContractFunctionTransact>; filters: ContractFunctionFilter>; clause: ContractFunctionClause>; criteria: ContractFunctionCriteria>; private contractCallOptions; private contractTransactionOptions; /** * Initializes a new instance of the `Contract` class. * @param address The address of the contract. * @param abi The Application Binary Interface (ABI) of the contract, which defines the contract's methods and events. * @param thor An instance of ThorClient to interact with the blockchain. * @param signer The signer caller used for signing transactions. * @param transactionReceipt (Optional) The transaction receipt of the contract deployment. */ constructor(address: string, abi: Abi, contractsModule: ContractsModule, signer?: VeChainSigner, transactionReceipt?: TransactionReceipt); /** * Sets the options for contract calls. * @param options - The contract call options to set. * @returns The updated contract call options. */ setContractReadOptions(options: ContractCallOptions): ContractCallOptions; /** * Clears the current contract call options, resetting them to an empty object. * @returns The updated contract call options. */ getContractReadOptions(): ContractCallOptions; /** * Clears the current contract call options, resetting them to an empty object. */ clearContractReadOptions(): void; /** * Sets the options for contract transactions. * @param options - The contract transaction options to set. * @returns The updated contract transaction options. */ setContractTransactOptions(options: ContractTransactionOptions): ContractTransactionOptions; /** * Retrieves the options for contract transactions. * @returns The contract transaction options. */ getContractTransactOptions(): ContractTransactionOptions; /** * Clears the current contract transaction options, resetting them to an empty object. */ clearContractTransactOptions(): void; /** * Sets the private key of the caller for signing transactions. * @param signer - The caller signer */ setSigner(signer: VeChainSigner): VeChainSigner; /** * Get the caller signer used for signing transactions. * @returns The signer used for signing transactions. */ getSigner(): VeChainSigner | undefined; /** * Retrieves the function ABI for the specified function name. * @param prop - The name of the function. * @return The function ABI for the specified event name. * @throws {InvalidAbiItem} * */ getFunctionAbi(prop: string | symbol): ABIFunction; /** * Retrieves the event ABI for the specified event name. * @param eventName - The name of the event. * @return The event ABI for the specified event name. * @throws {InvalidAbiItem} */ getEventAbi(eventName: string | symbol): ABIEvent; } /** * A factory class for deploying smart contracts to a blockchain using a ThorClient. */ declare class ContractFactory { /** * The ABI (Application Binary Interface) of the contract. */ private readonly abi; /** * The bytecode of the smart contract. */ private readonly bytecode; /** * The signer used for signing transactions. */ private readonly signer; /** * The result of the deployment transaction, undefined until a deployment is started. */ private deployTransaction; readonly contractsModule: ContractsModule; /** * Initializes a new instance of the `ContractFactory` class. * @param abi The Application Binary Interface (ABI) of the contract, which defines the contract's methods and events. * @param bytecode The compiled bytecode of the contract, representing the contract's executable code. * @param signer The signer used for signing transactions during contract deployment, ensuring the deployer's identity. * @param contractsModule An instance of the module to interact with the blockchain. */ constructor(abi: Abi, bytecode: string, signer: VeChainSigner, contractsModule: ContractsModule); /** * Initiates the deployment of a smart contract. * * This method performs several steps to deploy a smart contract: * 1. Builds a transaction clause for deploying the contract. * 2. Estimates the gas cost required for the transaction. * 3. Constructs the transaction body with the estimated gas cost. * 4. Signs the transaction using the provided signer. * 5. Sends the signed transaction to the blockchain. * * @param {DeployParams?} deployParams (Optional) parameters for contract deployment. * @param {ContractTransactionOptions?} options (Optional) transaction options, such as gas limit. * @returns {Promise} A promise that resolves to the instance of `ContractFactory`, * allowing for fluent chaining of further actions or queries. * @throws {Error} Throws an error if any step in the deployment process fails. */ startDeployment(deployParams?: DeployParams, options?: ContractTransactionOptions): Promise>; /** * Waits for the completion of a contract deployment transaction. * * This method checks for the presence of a deployed transaction result and then * waits for the transaction to be processed. Upon successful processing, it * constructs and returns a new `Contract` instance based on the transaction receipt. * * @returns {Promise} A promise that resolves to a `Contract` instance * once the deployment transaction is completed. * @throws {CannotFindTransaction, ContractDeploymentFailed} */ waitForDeployment(): Promise>; /** * Returns the deploy transaction result, if available. */ getDeployTransaction(): SendTransactionResult | undefined; } /** * Type for input for trace contract call - target contract. */ interface ContractTraceTarget { /** * The recipient of the call. * Null indicates contract deployment. */ to?: Address | null; /** * The input data for the contract call. */ data?: Hex; /** * The amount of token to be transferred. */ value?: VET; } /** * Return type for retrieve storage range function */ interface RetrieveStorageRange { /** * The next key to be used for the next retrieve storage range call. */ nextKey: string | null; /** * The data is non-nullable, but an empty object is returned if no data is found. */ storage: Record< string, { /** * Storage key. */ key: string; /** * Storage value. */ value: string; } >; } /** * Type for input options * for retrieve storage range function */ interface RetrieveStorageRangeOptions { /** * The address of the contract/ account to be traced. */ address?: Address; /** * The start key of the storage range. * Default is 0x0000000000000000000000000000000000000000000000000000000000000000. */ keyStart?: BlockId; /** * The maximum number of results to be returned. Default is 1000. */ maxResult?: number; } /** * Type for target of TraceTransactionClause. */ interface TransactionTraceTarget { /** * Block ID. */ blockId: BlockId; /** * Clause index. */ clauseIndex: number; /** * Transaction index if `number`, else ID if `ThorId`. */ transaction: number | BlockId; } /** * Config for the '4byte' name type */ type FourByteNameConfig = Record; /** * Return type for the '4byte' name type */ type FourByteNameReturnType = Record; /** * Config for the 'bigram' name type */ type BigramNameConfig = Record; /** * Return type for the 'bigram' name type */ type BigramNameReturnType = Record; /** * Config for the 'call' name type */ type CallNameConfig = Record; /** * Return type for the 'call' name type */ interface CallNameReturnType { /** * Transaction parameters */ from: string; gas: string; gasUsed: string; to: string; input: string; output?: string; /** * Transaction errors (if any) */ error?: string; /** * Trace clause type (/debug/tracers endpoint) */ calls?: Array<{ from: string; gas: string; gasUsed: string; to: string; input: string; output: string; type: string; }>; /** * Trace contract type (/debug/tracers/call endpoint) */ value?: string; type?: string; } /** * Config for the default ('' or null) name type */ type DefaultNameConfig = Record; /** * Return type for the default ('' or null) name type */ interface DefaultNameReturnType { gas: number; failed: boolean; returnValue: string; structLogs: Array<{ pc: number; op: string; gas: number; gasCost: number; depth: number; stack: string[]; }>; } /** * Config for the 'evmdis' name type */ type EVMDisNameConfig = Record; /** * Return type for the 'evmdis' name type */ type EVMDisNameReturnType = Array<{ op: number; depth: number; result: string[]; len: number; }>; /** * Config for the 'noop' name type */ type NoopNameConfig = Record; /** * Return type for the 'noop' name type */ type NoopNameReturnType = Record; /** * Config for the 'opcount' name type */ type OPCountNameConfig = Record; /** * Return type for the 'opcount' name type */ // eslint-disable-next-line sonarjs/redundant-type-aliases type OPCountNameReturnType = number; /** * Config for the 'prestate' name type */ type PreStateNameConfig = Record; /** * Return type for the 'prestate' name type */ type PreStateNameReturnType = Record< string, { balance: string; energy: string; code?: string; storage?: Record; } >; /** * Config for the 'trigram' name type */ type TrigramNameConfig = Record; /** * Return type for the 'trigram' name type */ type TrigramNameReturnType = Record; /** * Config for the 'unigram' name type */ type UnigramNameConfig = Record; /** * Return type for the 'unigram' name type */ type UnigramNameReturnType = Record; /** * TracerName is the name of the tracer to use. * * It determines Output and Input configuration. * * An empty name stands for the default struct logger tracer. */ type TracerName = | '' | '4byte' | 'call' | 'noop' | 'prestate' | 'unigram' | 'bigram' | 'trigram' | 'evmdis' | 'opcount' | null; /** * The configuration of the tracer. * * Used for traceTransactionClause and traceContractCall functions. * * It is specific to the name of the tracer. * * @see{TracerName} */ type TracerConfig = TraceNameType extends '' ? DefaultNameConfig : TraceNameType extends '4byte' ? FourByteNameConfig : TraceNameType extends 'call' ? CallNameConfig : TraceNameType extends 'noop' ? NoopNameConfig : TraceNameType extends 'prestate' ? PreStateNameConfig : TraceNameType extends 'unigram' ? UnigramNameConfig : TraceNameType extends 'bigram' ? BigramNameConfig : TraceNameType extends 'trigram' ? TrigramNameConfig : TraceNameType extends 'evmdis' ? EVMDisNameConfig : TraceNameType extends 'opcount' ? OPCountNameConfig : TraceNameType extends null ? DefaultNameConfig : TraceNameType extends undefined ? DefaultNameConfig : never; /** * The return type of the tracer. * * Used for traceTransactionClause and traceContractCall functions. * * It is specific to the name of the tracer. * * @see{TracerName} */ type TraceReturnType = TraceNameType extends '' ? DefaultNameReturnType : TraceNameType extends '4byte' ? FourByteNameReturnType : TraceNameType extends 'call' ? CallNameReturnType : TraceNameType extends 'noop' ? NoopNameReturnType : TraceNameType extends 'prestate' ? PreStateNameReturnType : TraceNameType extends 'unigram' ? UnigramNameReturnType : TraceNameType extends 'bigram' ? BigramNameReturnType : TraceNameType extends 'trigram' ? TrigramNameReturnType : TraceNameType extends 'evmdis' ? EVMDisNameReturnType : TraceNameType extends 'opcount' ? OPCountNameReturnType : TraceNameType extends null ? DefaultNameReturnType : TraceNameType extends undefined ? DefaultNameReturnType : never; /** * Type for input for trace contract call - transaction options. */ type ContractTraceOptions = Omit; /** * The class provides methods to debug the VeChain Thor blockchain. */ declare class DebugModule { readonly httpClient: HttpClient; /** * Creates an instance of the class with a specified HTTP client. * * @param {HttpClient} httpClient - The HTTP client instance to be used for making requests. */ constructor(httpClient: HttpClient); /** * Retrieve the storage range for a specified transaction trace target. * * @param {Object} input - The input parameters. * @param {TransactionTraceTarget} input.target - The transaction trace target containing the block ID, transaction, and clause index. * @param {RetrieveStorageRangeOptions} [input.options] - Optional settings for the retrieval process. * @param {Address} [input.options.address] - The address for which to retrieve the storage range. * @param {KeyStart} [input.options.keyStart] - The starting key for the storage range retrieval. * @param {number} [input.options.maxResult] - The maximum number of results to retrieve. * * @return {Promise} The storage range data for the specified target. * * @throws IllegalDataType If {@link TransactionTraceTarget} `input.target` has a negative `clauseIndex` or `transaction` property. */ retrieveStorageRange(input: { target: TransactionTraceTarget; options?: RetrieveStorageRangeOptions; }): Promise; /** * Traces a contract call using the specified target, options, and configuration. * * @param {Object} input - The input parameters for the contract call trace. * @param {ContractTraceTarget} [input.target] - The target contract details. * @param {ContractTraceOptions} [input.options] - Optional configuration for the contract trace. * @param {TracerConfig} [input.config] - Configuration for the tracer. * @param {TracerName} [name] - The name of the tracer to be used. * @return {Promise>} A promise that resolves to the trace result. */ traceContractCall(input: { target?: ContractTraceTarget; options?: ContractTraceOptions; config?: TracerConfig; }, name?: TracerName): Promise>; /** * Traces a transaction clause based on the provided target and configuration. * * Tracers are instrumental in monitoring and analyzing the execution flow within the EVM. * * @param {Object} input - The input object containing the transaction trace target and optional tracer config. * @param {TransactionTraceTarget} input.target - The target transaction details including block ID, transaction ID, and clause index. * @param {TracerConfig} [input.config] - Optional tracer configuration settings. * @param {TracerName} [name] - Optional name for the tracer. * @return {Promise>} - The result of the trace operation. * @throws {InvalidDataType} - If the `input.target.transaction` or `input.target.clauseIndex` properties are invalid. */ traceTransactionClause(input: { target: TransactionTraceTarget; config?: TracerConfig; }, name?: TracerName): Promise>; /** * Validates the properties of a TransactionTraceTarget object. * * @param {TransactionTraceTarget} target - The target object containing transaction details to be validated. * @param {string} functionName - The name of the function where this validation is invoked. * @throws {InvalidDataType} If the transaction or clauseIndex properties in the target object are invalid. */ private validateTarget; } declare class ForkDetector { private readonly httpClient; constructor(httpClient: HttpClient); /** * Checks if the given block is Galactica-forked by inspecting the block details. * * Criteria: * - baseFeePerGas is defined (indicating a possible Galactica fork). * * @param revision Block number or ID (e.g., 'best', 'finalized', or numeric). * @returns `true` if Galactica-forked, otherwise `false`. * @throws {InvalidDataType} If the revision is invalid. */ isGalacticaForked(revision?: string | number): Promise; /** * Detects if the current network is on the Galactica fork by checking the best block. * This is an alias for isGalacticaForked('best'). * * @param {string | number} revision - Block number or ID (e.g., 'best', 'finalized', or numeric) * @returns {Promise} A promise that resolves to true if Galactica fork is detected, false otherwise. */ detectGalactica(revision?: string | number): Promise; /** * Clears the Galactica fork detection cache. * This is mainly useful for testing purposes. */ clearCache(): void; } interface TransactionModuleInterface { estimateGas: (clauses: (SimulateTransactionClause | ContractClause)[], caller?: string, options?: EstimateGasOptions) => Promise; } /** * The `GasModule` handles gas related operations and provides * convenient methods for estimating the gas cost of a transaction. */ declare class GasModule { readonly httpClient: HttpClient; protected transactionsModule: TransactionModuleInterface | null; constructor(httpClient: HttpClient); /** * Sets the transactions module. * * @param transactionsModule - The transactions module to set. */ setTransactionsModule(transactionsModule: TransactionModuleInterface): void; /** * Simulates a transaction and returns an object containing information regarding the gas used and whether the transaction reverted. * * @note The caller option is suggested as estimation without this parameter may not be accurate. * * @param clauses - The clauses of the transaction to simulate. * @param caller - The address of the account sending the transaction. * @param options - Optional parameters for the request. Includes all options of the `simulateTransaction` method excluding the `caller` option. * @see {@link TransactionsClient#simulateTransaction} * Also, includes the `gasPadding` option which is a percentage of gas to add on top of the estimated gas. The value must be between (0, 1]. * @returns An object containing information regarding the gas used and whether the transaction reverted, together with the decoded revert reason and VM errors. * @throws{InvalidDataType} */ estimateGas(clauses: (SimulateTransactionClause | ContractClause)[], caller?: string, options?: EstimateGasOptions): Promise; /** * Returns the suggested priority fee per gas in wei. * This is calculated based on the current base fee and network conditions. * * @returns Suggested priority fee per gas in wei (hex string) * @throws {InvalidDataType} */ getMaxPriorityFeePerGas(): Promise; /** * Returns fee history for the returned block range. * * @param options - The options for the fee history request * @returns Fee history for the returned block range * @throws {InvalidDataType} */ getFeeHistory(options: FeeHistoryOptions): Promise; /** * Returns the base fee per gas of the next block. * @returns The base fee per gas of the next block. */ getNextBlockBaseFeePerGas(): Promise; } /** * The `TransactionsModule` handles transaction related operations and provides * convenient methods for sending transactions and waiting for transaction confirmation. */ declare class TransactionsModule { readonly blocksModule: BlocksModule; readonly debugModule: DebugModule; readonly logsModule: LogsModule; readonly gasModule: GasModule; readonly forkDetector: ForkDetector; constructor(blocksModule: BlocksModule, debugModule: DebugModule, logsModule: LogsModule, gasModule: GasModule, forkDetector: ForkDetector); /** * Retrieves the details of a transaction. * * @param id - Transaction ID of the transaction to retrieve. * @param options - (Optional) Other optional parameters for the request. * @returns A promise that resolves to the details of the transaction. * @throws {InvalidDataType} */ getTransaction(id: string, options?: GetTransactionInputOptions): Promise; /** * Retrieves the details of a transaction. * * @param id - Transaction ID of the transaction to retrieve. * @param options - (Optional) Other optional parameters for the request. * @returns A promise that resolves to the details of the transaction. * @throws {InvalidDataType} */ getTransactionRaw(id: string, options?: GetTransactionInputOptions): Promise; /** * Retrieves the receipt of a transaction. * * @param id - Transaction ID of the transaction to retrieve. * @param options - (Optional) Other optional parameters for the request. * If `head` is not specified, the receipt of the transaction at the best block is returned. * @returns A promise that resolves to the receipt of the transaction. * @throws {InvalidDataType} */ getTransactionReceipt(id: string, options?: GetTransactionReceiptInputOptions): Promise; /** * Retrieves the receipt of a transaction. * * @param raw - The raw transaction. * @returns The transaction id of send transaction. * @throws {InvalidDataType} */ sendRawTransaction(raw: string): Promise; /** * Sends a signed transaction to the network. * * @param signedTx - the transaction to send. It must be signed. * @returns A promise that resolves to the transaction ID of the sent transaction. * @throws {InvalidDataType} */ sendTransaction(signedTx: Transaction): Promise; /** * Waits for a transaction to be included in a block. * * @param txID - The transaction ID of the transaction to wait for. * @param options - Optional parameters for the request. Includes the timeout and interval between requests. * Both parameters are in milliseconds. If the timeout is not specified, the request will not time out! * @returns A promise that resolves to the transaction receipt of the transaction. If the transaction is not included in a block before the timeout, * the promise will resolve to `null`. * @throws {InvalidDataType} */ waitForTransaction(txID: string, options?: WaitForTransactionOptions): Promise; /** * Builds a transaction body with the given clauses without having to * specify the chainTag, expiration, gasPriceCoef, gas, dependsOn and reserved fields. * * @param clauses - The clauses of the transaction. * @param gas - The gas to be used to perform the transaction. * @param options - Optional parameters for the request. Includes the expiration, gasPriceCoef, maxFeePerGas, maxPriorityFeePerGas, gas, dependsOn and isDelegated fields. * If the `expiration` is not specified, the transaction will expire after 32 blocks. * If the `gasPriceCoef` is not specified & galactica fork didn't happen yet, the transaction will use the default gas price coef of 0. * If the `gasPriceCoef` is not specified & galactica fork happened, the transaction will use the default maxFeePerGas and maxPriorityFeePerGas. * If the `gas` is specified in options, it will override the gas parameter. * If the `dependsOn` is not specified, the transaction will not depend on any other transaction. * If the `isDelegated` is not specified, the transaction will not be delegated. * * @returns A promise that resolves to the transaction body. * * @throws an error if the genesis block or the latest block cannot be retrieved. */ buildTransactionBody(clauses: TransactionClause[] | Clause[] | ContractClause['clause'], gas: number, options?: TransactionBodyOptions): Promise; /** * Fills the transaction body with the default options. * * @param body - The transaction body to fill. * @returns A promise that resolves to the filled transaction body. * @throws {InvalidDataType} */ fillTransactionBody(body: TransactionBody$1): Promise; /** * Fills the default body options for a transaction. * * @param options - The transaction body options to fill. * @returns A promise that resolves to the filled transaction body options. * @throws {InvalidDataType} */ fillDefaultBodyOptions(options?: TransactionBodyOptions): Promise; /** * Calculates the default max priority fee per gas based on the current base fee * and historical 75th percentile rewards. * * Uses the FAST (HIGH) speed threshold: min(0.046*baseFee, 75_percentile) * * @param baseFee - The current base fee per gas * @returns A promise that resolves to the default max priority fee per gas as a hex string */ private calculateDefaultMaxPriorityFeePerGas; /** * Ensures that names in clauses are resolved to addresses * * @param clauses - The clauses of the transaction. * @returns A promise that resolves to clauses with resolved addresses */ resolveNamesInClauses(clauses: TransactionClause[]): Promise; /** * Simulates the execution of a transaction. * Allows to estimate the gas cost of a transaction without sending it, as well as to retrieve the return value(s) of the transaction. * * @param clauses - The clauses of the transaction to simulate. * @param options - (Optional) The options for simulating the transaction. * @returns A promise that resolves to an array of simulation results. * Each element of the array represents the result of simulating a clause. * @throws {InvalidDataType} */ simulateTransaction(clauses: SimulateTransactionClause[], options?: SimulateTransactionOptions): Promise; /** * Decode the revert reason from the encoded revert reason into a transaction. * * @param encodedRevertReason - The encoded revert reason to decode. * @param errorFragment - (Optional) The error fragment to use to decode the revert reason (For Solidity custom errors). * @returns A promise that resolves to the decoded revert reason. * Revert reason can be a string error or Panic(error_code) */ decodeRevertReason(encodedRevertReason: string, errorFragment?: string): string; /** * Get the revert reason of an existing transaction. * * @param transactionHash - The hash of the transaction to get the revert reason for. * @param errorFragment - (Optional) The error fragment to use to decode the revert reason (For Solidity custom errors). * @returns A promise that resolves to the revert reason of the transaction. */ getRevertReason(transactionHash: string, errorFragment?: string): Promise; /** * Estimates the amount of gas required to execute a set of transaction clauses. * * @param {SimulateTransactionClause[]} clauses - An array of clauses to be simulated. Must contain at least one clause. * @param {string} [caller] - The address initiating the transaction. Optional. * @param {EstimateGasOptions} [options] - Additional options for the estimation, including gas padding. * @return {Promise} - The estimated gas result, including total gas required, whether the transaction reverted, revert reasons, and any VM errors. * @throws {InvalidDataType} - If clauses array is empty or if gas padding is not within the range (0, 1]. * * @see {@link TransactionsModule#simulateTransaction} */ estimateGas(clauses: (SimulateTransactionClause | ContractClause)[], caller?: string, options?: EstimateGasOptions): Promise; /** * Executes a read-only call to a smart contract function, simulating the transaction to obtain the result. * * The method simulates a transaction using the provided parameters * without submitting it to the blockchain, allowing read-only operations * to be tested without incurring gas costs or modifying the blockchain state. * * @param {string} contractAddress - The address of the smart contract. * @param {ABIFunction} functionAbi - The ABI definition of the smart contract function to be called. * @param {unknown[]} functionData - The arguments to be passed to the smart contract function. * @param {ContractCallOptions} [contractCallOptions] - Optional parameters for the contract call execution. * @return {Promise} The result of the contract call. */ executeCall(contractAddress: string, functionAbi: ABIFunction, functionData: unknown[], contractCallOptions?: ContractCallOptions): Promise; /** * Executes and simulates multiple read-only smart-contract clause calls, * simulating the transaction to obtain the results. * * @param {ContractClause[]} clauses - The array of contract clauses to be executed. * @param {SimulateTransactionOptions} [options] - Optional simulation transaction settings. * @return {Promise} - The decoded results of the contract calls. */ executeMultipleClausesCall(clauses: ContractClause[], options?: SimulateTransactionOptions): Promise; /** * Executes a transaction with a smart-contract on the VeChain blockchain. * * @param {VeChainSigner} signer - The signer instance to sign the transaction. * @param {string} contractAddress - The address of the smart contract. * @param {ABIFunction} functionAbi - The ABI of the contract function to be called. * @param {unknown[]} functionData - The input parameters for the contract function. * @param {ContractTransactionOptions} [options] - Optional transaction parameters. * @return {Promise} - A promise that resolves to the result of the transaction. * * @see {@link TransactionsModule.buildTransactionBody} */ executeTransaction(signer: VeChainSigner, contractAddress: string, functionAbi: ABIFunction, functionData: unknown[], options?: ContractTransactionOptions): Promise; /** * Executes a transaction with multiple clauses on the VeChain blockchain. * * @param {ContractClause[]} clauses - Array of contract clauses to be included in the transaction. * @param {VeChainSigner} signer - A VeChain signer instance used to sign and send the transaction. * @param {ContractTransactionOptions} [options] - Optional parameters to customize the transaction. * @return {Promise} The result of the transaction, including transaction ID and a wait function. */ executeMultipleClausesTransaction(clauses: ContractClause[] | TransactionClause[], signer: VeChainSigner, options?: ContractTransactionOptions): Promise; /** * Retrieves the base gas price from the blockchain parameters. * * This method sends a call to the blockchain parameters contract to fetch the current base gas price. * The base gas price is the minimum gas price that can be used for a transaction. * It is used to obtain the VTHO (energy) cost of a transaction. * @link [Total Gas Price](https://docs.vechain.org/core-concepts/transactions/transaction-calculation#total-gas-price) * * @return {Promise} A promise that resolves to the result of the contract call, containing the base gas price. */ getLegacyBaseGasPrice(): Promise; /** * Decode the result of a contract call from the result of a simulated transaction. * * @param {string} encodedData - The encoded data received from the contract call. * @param {ABIFunction} functionAbi - The ABI function definition used for decoding the result. * @param {boolean} reverted - Indicates if the contract call reverted. * @return {ContractCallResult} An object containing the success status and the decoded result. */ private getContractCallResult; } /** * Provide a set of utils for the delegation type. * It is a mutual exclusion between gasPayerPrivateKey and gasPayerServiceUrl. (@see SignTransactionOptions) * * The aim of this handler is to: * - Understand the kind of delegation and the delegation info * - Provide a method to get the delegation signature * * @param gasPayer - The gasPayer options. */ declare const DelegationHandler: (gasPayer?: SignTransactionOptions | null) => { isDelegated: () => boolean; gasPayerOrUndefined: () => SignTransactionOptions | undefined; gasPayerOrNull: () => SignTransactionOptions | null; getDelegationSignatureUsingUrl: (tx: Transaction, originAddress: string, httpClient: HttpClient) => Promise; }; /** * Represents a module for interacting with smart contracts on the blockchain. */ declare class ContractsModule { readonly transactionsModule: TransactionsModule; constructor(transactionsModule: TransactionsModule); /** * Creates a new instance of `ContractFactory` configured with the specified ABI, bytecode, and signer. * This factory is used to deploy new smart contracts to the blockchain network managed by this instance. * * @param abi - The Application Binary Interface (ABI) of the contract, which defines the contract's methods and events. * @param bytecode - The compiled bytecode of the contract, representing the contract's executable code. * @param signer - The signer used for signing transactions during contract deployment, ensuring the deployer's identity. * @returns An instance of `ContractFactory` configured with the provided ABI, bytecode, and signer, ready for deploying contracts. */ createContractFactory(abi: TAbi, bytecode: string, signer: VeChainSigner): ContractFactory; /** * Initializes and returns a new Contract instance with the provided parameters. * * @param address - The blockchain address of the contract to load. * @param abi - The Application Binary Interface (ABI) of the contract, which defines the contract's methods and structures. * @param signer - Optional. The signer caller, used for signing transactions when interacting with the contract. * @returns A new instance of the Contract, initialized with the provided address, ABI, and optionally, a signer. */ load(address: string, abi: Tabi, signer?: VeChainSigner): Contract; /** * This method is going to be deprecated in next release. * Use {@link TransactionsModule.executeCall} instead. */ executeCall(contractAddress: string, functionAbi: ABIFunction, functionData: unknown[], contractCallOptions?: ContractCallOptions): Promise; /** * This method is going to be deprecated in the next release. * Use {@link TransactionsModule.executeMultipleClausesCall} next. */ executeMultipleClausesCall(clauses: ContractClause[], options?: SimulateTransactionOptions): Promise; /** * This method is going to be deprecated in the next release. * Use {@link TransactionsModule.executeTransaction} instead. */ executeTransaction(signer: VeChainSigner, contractAddress: string, functionAbi: ABIFunction, functionData: unknown[], options?: ContractTransactionOptions): Promise; /** * This method is going to be deprected in the next release. * Use {@link TransactionsModule.executeMultipleClausesTransaction} instead. */ executeMultipleClausesTransaction(clauses: ContractClause[] | TransactionClause[], signer: VeChainSigner, options?: ContractTransactionOptions): Promise; /** * This method is going to be deprecated in the next release. * Use {@link TransactionsModule.getLegacyBaseGasPrice} instead. */ getLegacyBaseGasPrice(): Promise; } /* --- Responses Outputs start --- */ /** * Type for connected peer. * A connected peer is a node that is connected to the node you have specified for the thorest client. */ interface ConnectedPeer { /** * Name of the peer in the format of `[network]/[version]-[gitcommit]-[versionmeta]/[os]/[goversion]`. * e.g., `thor/v2.1.0-2b5853f-release/linux/go1.21.0` */ name: string; /** * Represents the block ID of the best block of the peer. */ bestBlockID: string; /** * Represents the Accumulated Witness Number (AWN) of the best block of the peer. */ totalScore: number; /** * ID of the peer. */ peerID: string; /** * IP address of the peer. */ netAddr: string; /** * indicates whether the connection to a peer is inbound or outbound. * If `inbound` is true, the peer has initiated the connection to your node. In other words, the connection request came from the peer to your VeChainThor node. * If `inbound` is false, your node has initiated the connection to the peer. In other words, the connection request came from your VeChainThor node to the peer. */ inbound: boolean; /** * Duration of the connection with the peer. */ duration: number; } /** * The `NodesModule` class serves as a module for node-related functionality, for example, checking the health of a node. */ declare class NodesModule { readonly blocksModule: BlocksModule; constructor(blocksModule: BlocksModule); /** * Retrieves connected peers of a node. * * @returns A promise that resolves to the list of connected peers. */ getNodes(): Promise; /** * Checks the health of a node using the following algorithm: * 1. Make an HTTP GET request to retrieve the last block timestamp. * 2. Calculates the difference between the current time and the last block timestamp. * 3. If the difference is less than the tolerance, the node is healthy. * Note, we could also check '/node/network/peers since' but the difficulty with this approach is * if you consider a scenario where the node is connected to 20+ peers, which is healthy, and it receives the new blocks as expected. * But what if the node's disk is full, and it's not writing the new blocks to its database? In this case the node is off-sync even * though it's technically alive and connected * @returns A boolean indicating whether the node is healthy. * @throws {InvalidDataTypeError} */ isHealthy(): Promise; /** * Extracts the timestamp from the block * @remarks * This function throws an error if the timestamp key does not exist in the response from the API call to the node * @param response the response from the API call to the node * @returns the timestamp from the block * @throws{InvalidDataType} */ private readonly getTimestampFromBlock; /** * Retrieves and caches the chainTag from the genesis block of the given ThorClient. * Uses the same short-circuit caching logic as eth_chainId(). */ getChaintag(): Promise; } /** * The `ThorClient` class serves as an interface to interact with the VeChainThor blockchain. * It provides various methods. */ declare class ThorClient { readonly httpClient: HttpClient; /** * The `AccountsModule` instance */ readonly accounts: AccountsModule; /** * The `NodesModule` instance */ readonly nodes: NodesModule; /** * The `BlocksModule` instance */ readonly blocks: BlocksModule; /** * The `LogsModule` instance used for interacting with log-related endpoints. */ readonly logs: LogsModule; readonly transactions: TransactionsModule; /** * The 'ContractClient' instance */ readonly contracts: ContractsModule; /** * The 'GalacticaForkDetector' instance */ readonly forkDetector: ForkDetector; /** * The `GasModule` instance */ readonly gas: GasModule; /** * The `DebugModule` instance */ readonly debug: DebugModule; /** * Constructs a new `ThorClient` instance with a given HTTP client. * * @param httpClient - The HTTP client instance used for making network requests. * @param options - (Optional) Other optional parameters for polling and error handling. */ constructor(httpClient: HttpClient, options?: BlocksModuleOptions); /** * Creates a new `ThorClient` instance from a given URL. * * @param {string} networkUrl - The URL of the network to connect to. * @param {BlocksModuleOptions} [options] - Optional configuration settings for the Blocks module. * @return {ThorClient} A ThorClient instance connected to the specified network URL. */ static at(networkUrl: string, options?: BlocksModuleOptions): ThorClient; /** * Destroys the `ThorClient` instance by stopping the event polling * and any other cleanup. */ destroy(): void; /** * Creates a ThorClient instance from a network URL. * * @param {string} networkUrl - The URL of the network to connect to. * @param {BlocksModuleOptions} [options] - Optional configuration settings for the Blocks module. * @return {ThorClient} A ThorClient instance connected to the specified network URL. * * @deprecated Use {@link ThorClient.at} instead. */ static fromUrl(networkUrl: string, options?: BlocksModuleOptions): ThorClient; } /** * Abstract VeChain signer. * This abstract class avoids people every time implementing standard signer * methods. * By implementing this abstract class, it will be easier to create new signers */ declare abstract class VeChainAbstractSigner implements VeChainSigner { protected readonly MESSAGE_PREFIX: Uint8Array; /** * The provider attached to this Signer (if any). */ provider?: AvailableVeChainProviders; /** * Create a new VeChainPrivateKeySigner. * A signer can be initialized using a private key. * * @param provider - The provider to connect to */ protected constructor(provider?: AvailableVeChainProviders); /** * Returns a new instance of this Signer connected to //provider// or detached * from any Provider if undefined. * * @param provider - The provider to connect to * @returns a new instance of this Signer connected to //provider// or detached */ abstract connect(provider: AvailableVeChainProviders): this; /** * Get the address of the Signer. * * @returns the address of the signer */ abstract getAddress(): Promise; /** * Prepares a {@link TransactionRequestInput} for calling: * - resolves ``to`` and ``from`` addresses * - if ``from`` is specified, check that it matches this Signer * * @note: Here the base support of multi-clause transaction is added. * So, if clauses are provided in the transaction, it will be used as it is. * Otherwise, standard transaction will be prepared. * * @param transactionToPopulate - The call to prepare * @returns the prepared call transaction * @throws {InvalidDataType} */ populateCall(transactionToPopulate: TransactionRequestInput): Promise; /** * Prepares a {@link TransactionRequestInput} for sending to the network by * populating any missing properties: * - resolves ``to`` and ``from`` addresses * - if ``from`` is specified , check that it matches this Signer * - populates ``nonce`` via ``signer.getNonce("pending")`` * - populates gas parameters via ``signer.estimateGas(tx)`` * - ... and other necessary properties * * @param transactionToPopulate - The call to prepare * @returns the prepared transaction * @throws {JSONRPCInvalidParams} */ populateTransaction(transactionToPopulate: TransactionRequestInput): Promise; /** * Estimates the gas required to execute //tx// on the Blockchain. This * will be the expected amount a transaction will need * to successfully run all the necessary computations and store the changed state * that the transaction intends. * * @param transactionToEstimate - The transaction to estimate gas for * @returns the total estimated gas required * @throws {JSONRPCInvalidParams} */ estimateGas(transactionToEstimate: TransactionRequestInput): Promise; /** * Evaluates the //tx// by running it against the current Blockchain state. This * cannot change state and has no cost, as it is effectively simulating * execution. * * This can be used to have the Blockchain perform computations based on its state * (e.g. running a Contract's getters) or to simulate the effect of a transaction * before actually performing an operation. * * @param transactionToEvaluate - The transaction to evaluate * @param revision - The block number or block ID of which the transaction simulation is based on * @returns the result of the evaluation * @throws {JSONRPCInvalidParams} */ call(transactionToEvaluate: TransactionRequestInput, revision?: Revision): Promise; /** * Gets the next nonce required for this Signer to send a transaction. * * @param blockTag - The blocktag to base the transaction count on, keep in mind * many nodes do not honour this value and silently ignore it [default: ``"latest"``] * * @NOTE: This method generates a random number as nonce. It is because the nonce in VeChain is a 6-byte number. */ getNonce(blockTag?: string): Promise; /** * Signs %%transactionToSign%%, returning the fully signed transaction. This does not * populate any additional properties with eth_getTransactionCount: RPC_METHODS, p0: (string | undefined)[], args: EIP1193RequestArguments* @param transactionToSign - The transaction to sign * @returns The fully signed transaction */ abstract signTransaction(transactionToSign: TransactionRequestInput): Promise; /** * Sends %%transactionToSend%% to the Network. The ``signer.populateTransaction(transactionToSend)`` * is called first to ensure all necessary properties for the * transaction to be valid have been populated first. * * @param transactionToSend - The transaction to send * @returns The transaction response */ abstract sendTransaction(transactionToSend: TransactionRequestInput): Promise; /** * Signs a bytes payload returning the VeChain signature in hexadecimal format. * @param {Uint8Array} payload in bytes to sign. * @returns {string} The VeChain signature in hexadecimal format. */ abstract signPayload(payload: Uint8Array): Promise; /** * Signs an [[link-eip-191]] prefixed a personal message. * * @param {string|Uint8Array} message - The message to be signed. * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. * It is **not** interpreted as a [[BytesLike]]; * so the string ``"0x1234"`` is signed as six characters, **not** two bytes. * @return {Promise} - A Promise that resolves to the signature as a string. */ signMessage(message: string | Uint8Array): Promise; /** * Deduces the primary from the types if not given. * The primary type will be the only type that is not used in any other type. * @param {Record} types - The types used for EIP712. * @returns {string} The primary type. */ private deducePrimaryType; /** * Signs the [[link-eip-712]] typed data. * * @param {TypedDataDomain} domain - The domain parameters used for signing. * @param {Record} types - The types used for signing. * @param {Record} message - The message data to be signed. * @param {string} primaryType - The primary type used for signing. * * @return {Promise} - A promise that resolves with the signature string. */ signTypedData(domain: TypedDataDomain, types: Record, message: Record, primaryType?: string): Promise; /** * Use vet.domains to resolve name to address * @param vnsName - The name to resolve * @returns the address for a name or null */ resolveName(vnsName: string): Promise; /** * Build the transaction clauses * form a transaction given as input * * @param transaction - The transaction to sign * @returns The transaction clauses */ protected _buildClauses(transaction: TransactionRequestInput): TransactionClause[]; } /** * Basic VeChain signer with the private key. * This signer can be initialized using a private key. */ declare class VeChainPrivateKeySigner extends VeChainAbstractSigner { private readonly privateKey; /** * Create a new VeChainPrivateKeySigner. * A signer can be initialized using a private key. * * @param privateKey - The private key of the signer * @param provider - The provider to connect to */ constructor(privateKey: Uint8Array, provider?: AvailableVeChainProviders); /** * Returns a new instance of this Signer connected to //provider// or detached * from any Provider if null. * * @param provider - The provider to connect to * @returns a new instance of this Signer connected to //provider// or detached */ connect(provider: AvailableVeChainProviders): this; /** * Get the address checksum of the Signer. * * @returns the address checksum of the signer */ getAddress(): Promise; /** * Signs %%transactionToSign%%, returning the fully signed transaction. This does not * populate any additional properties with eth_getTransactionCount: RPC_METHODS, p0: (string | undefined)[], args: EIP1193RequestArguments* @param transactionToSign - The transaction to sign * @returns The fully signed transaction */ signTransaction(transactionToSign: TransactionRequestInput): Promise; /** * Sends a transaction to the blockchain. * * @param {TransactionRequestInput} transactionToSend - The transaction object to be sent. * This includes all the necessary details such as `to`, `value`, `data`, `gas`, etc. * Note: `gasLimit` is deprecated and will be removed in a future release. Use `gas` instead. * @return {Promise} A promise that resolves to the transaction hash as a string * once the transaction is successfully sent. * @throws {JSONRPCInvalidParams} Throws an error if the provider is not attached * to the signer, indicating the signer's inability to send the transaction. */ sendTransaction(transactionToSend: TransactionRequestInput): Promise; /** * Signs a payload. * * @param {Uint8Array} payload - The payload to be signed as a byte array * @return {Promise} - A Promise that resolves to the signature as a string. */ signPayload(payload: Uint8Array): Promise; /** * Signs a transaction internal method * * @param transaction - The transaction to sign * @param gasPayer - The gasPayer to use * @param thorClient - The ThorClient instance * @returns The fully signed transaction * @throws {InvalidSecp256k1PrivateKey, InvalidDataType} */ _signFlow(transaction: TransactionRequestInput, gasPayer: SignTransactionOptions | null, thorClient: ThorClient): Promise; /** * Signs a transaction where the gas fee is paid by a gasPayer. * * @param unsignedTransactionBody - The unsigned transaction body to sign. * @param originPrivateKey - The private key of the origin account. * @param thorClient - The ThorClient instance. * @param gasPayerOptions - Optional parameters for the request. Includes the `gasPayerServiceUrl` and `gasPayerPrivateKey` fields. * Only one of the following options can be specified: `gasPayerServiceUrl`, `gasPayerPrivateKey`. * @returns A promise that resolves to the signed transaction. * @throws {NotDelegatedTransaction} */ private _signWithGasPayer; } /** * Represent a single account in a provider internal wallet. * Basically an account is a triple of **address**, **private key** and **public key**. */ interface ProviderInternalWalletAccount { /** * Address of the account. */ address: string; /** * Private key of the account. */ privateKey?: Uint8Array; /** * Public key of the account. */ publicKey?: Uint8Array; } /** * Represent a provider internal base wallet. * Basically it is a list {@link ProviderInternalWalletAccount} used to contain account data into provider. * A provider internal wallet is able to generate a signer when it is needed by the provider. * * e.g., Provider can need the Signer with methods like eth_sendTransaction, ... * * @note To be compatible with provider-internal-wallet stack it is better * to implement this interface for each kind of provider internal wallet you want to use. */ interface ProviderInternalWallet { /** * Options for signing a transaction with gasPayer. */ gasPayer?: SignTransactionOptions; /** * List of accounts in the wallet. */ accounts: ProviderInternalWalletAccount[]; /** * Get a signer into the internal wallet provider * for the given address. * * @param parentProvider - The parent provider of the Internal Wallet. * @param addressOrIndex - Address or index of the account. * @returns The signer for the given address. */ getSigner: ( parentProvider: AvailableVeChainProviders, addressOrIndex?: string | number ) => Promise; /** * SYNC Version of getSigner() * * Get a signer into the internal wallet provider * for the given address. * * @param parentProvider - The parent provider of the Internal Wallet. * @param addressOrIndex - Address or index of the account. * @returns The signer for the given address. */ getSignerSync: ( parentProvider: AvailableVeChainProviders, addressOrIndex?: string | number ) => VeChainSigner | null; /** * Get the list of addresses in the wallet. * * @returns The list of addresses in the wallet. */ getAddresses: () => Promise; /** * SYNC Version of getAddresses() * * Get the list of addresses in the wallet. * * @returns The list of addresses in the wallet. */ getAddressesSync: () => string[]; /** * Get an account given an address or an index. * * @param addressOrIndex - Address or index of the account. * @returns The account with the given address, or null if not found. */ getAccount: ( addressOrIndex?: string | number ) => Promise; /** * SYNC Version of getAccount() * * Get an account given an address or an index. * * @param addressOrIndex - Address or index of the account. * @returns The account with the given address, or null if not found. */ getAccountSync: ( addressOrIndex?: string | number ) => ProviderInternalWalletAccount | null; /** * Get the options for signing a transaction with gasPayer (if any). * * @returns The options for signing a transaction with gasPayer. */ getGasPayer: () => Promise; /** * SYNC Version of getGasPayer() * * Get the options for signing a transaction with gasPayer (if any). * * @returns The options for signing a transaction with gasPayer. */ getGasPayerSync: () => SignTransactionOptions | null; } /** * Abstract implementation of Provider internal wallet class. */ declare abstract class AbstractProviderInternalWallet implements ProviderInternalWallet { /** * List of accounts in the wallet. */ readonly accounts: ProviderInternalWalletAccount[]; /** * Options for signing a transaction with gasPayer. */ readonly gasPayer?: SignTransactionOptions; /** * Create a new wallet. * * @param accounts List of accounts in the wallet. * @param options Optional options for signing a transaction with gasPayer. */ constructor(accounts: ProviderInternalWalletAccount[], options?: { gasPayer?: SignTransactionOptions; }); /** * Get a signer into the internal wallet provider * for the given address. * * @param parentProvider - The parent provider of the Internal Wallet. * @param addressOrIndex - Address of the account. * @returns The signer for the given address. */ abstract getSigner(parentProvider: AvailableVeChainProviders, addressOrIndex?: string | number): Promise; /** * SYNC Version of getSigner() * * Get a signer into the internal wallet provider * for the given address. * * @param parentProvider - The parent provider of the Internal Wallet. * @param addressOrIndex - Address or index of the account. * @returns The signer for the given address. */ getSignerSync(parentProvider: AvailableVeChainProviders, addressOrIndex?: string | number): VeChainSigner | null; /** * Get the list of addresses in the wallet. * * @returns The list of addresses in the wallet. */ abstract getAddresses(): Promise; /** * SYNC Version of getAddresses() * * Get the list of addresses in the wallet. * * @returns The list of addresses in the wallet. */ getAddressesSync(): string[]; /** * Get an account given an address or an index. * * @param addressOrIndex - Address or index of the account. * @returns The account with the given address, or null if not found. */ abstract getAccount(addressOrIndex?: string | number): Promise; /** * SYNC Version of getAccount() * * Get an account given an address or an index. * * @param addressOrIndex - Address or index of the account. * @returns The account with the given address, or null if not found. * @throws {InvalidDataType} */ getAccountSync(addressOrIndex?: string | number): ProviderInternalWalletAccount | null; /** * Get the options for signing a transaction with gasPayer (if any). * * @returns The options for signing a transaction with gasPayer. */ abstract getGasPayer(): Promise; /** * SYNC Version of getGasPayer() * * Get the options for signing a transaction with gasPayer (if any). * * @returns The options for signing a transaction with gasPayer. */ getGasPayerSync(): SignTransactionOptions | null; } /** * Provider internal Base wallet class. * * This is the most basic wallet implementation we can have: * * This wallet is generated by a list of private keys */ declare class ProviderInternalBaseWallet extends AbstractProviderInternalWallet { /** * Get a signer into the internal wallet provider * for the given address. * * @param parentProvider - The parent provider of the Internal Wallet. * @param addressOrIndex - Address of the account. * @returns The signer for the given address. */ getSigner(parentProvider: AvailableVeChainProviders, addressOrIndex?: string | number): Promise; /** * Get the list of addresses in the wallet. * * @returns The list of addresses in the wallet. */ getAddresses(): Promise; /** * Get an account given an address or an index. * * @param addressOrIndex - Address or index of the account. * @returns The account with the given address, or null if not found. */ getAccount(addressOrIndex?: string | number): Promise; /** * Get the options for signing a transaction with gasPayer (if any). * * @returns The options for signing a transaction with gasPayer. */ getGasPayer(): Promise; } declare class ProviderInternalHDWallet extends ProviderInternalBaseWallet { /** * Mnemonic of the wallet. */ readonly mnemonic: string[]; /** * Derivation path of the wallet. */ readonly derivationPath: string; /** * Number of accounts to generate. */ readonly count: number; /** * Initial index of the accounts to generate. */ readonly initialIndex: number; /** * Create a new HD wallet. * * @param mnemonic - Mnemonic of the wallet as an array of words. * @param count - Number of accounts to generate. * @param initialIndex - Initial index of the accounts to generate. * @param derivationPath - Derivation path of the wallet. * @param options - Options for signing a transaction with gasPayer. */ constructor(mnemonic: string[], count?: number, initialIndex?: number, derivationPath?: string, options?: { gasPayer?: SignTransactionOptions; }); } /** * Built-in contracts. */ declare const BUILT_IN_CONTRACTS: { PARAMS_ABI: readonly [{ readonly constant: false; readonly inputs: readonly [{ readonly name: "_key"; readonly type: "bytes32"; }, { readonly name: "_value"; readonly type: "uint256"; }]; readonly name: "set"; readonly outputs: readonly []; readonly payable: false; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly constant: true; readonly inputs: readonly [{ readonly name: "_key"; readonly type: "bytes32"; }]; readonly name: "get"; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; readonly payable: false; readonly stateMutability: "view"; readonly type: "function"; }, { readonly constant: true; readonly inputs: readonly []; readonly name: "executor"; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; }]; readonly payable: false; readonly stateMutability: "view"; readonly type: "function"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly name: "key"; readonly type: "bytes32"; }, { readonly indexed: false; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "Set"; readonly type: "event"; }]; PARAMS_ADDRESS: string; ENERGY_ABI: readonly [{ readonly constant: true; readonly inputs: readonly []; readonly name: "name"; readonly outputs: readonly [{ readonly name: ""; readonly type: "string"; }]; readonly payable: false; readonly stateMutability: "pure"; readonly type: "function"; }, { readonly constant: false; readonly inputs: readonly [{ readonly name: "_spender"; readonly type: "address"; }, { readonly name: "_value"; readonly type: "uint256"; }]; readonly name: "approve"; readonly outputs: readonly [{ readonly name: "success"; readonly type: "bool"; }]; readonly payable: false; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly constant: true; readonly inputs: readonly []; readonly name: "totalSupply"; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; readonly payable: false; readonly stateMutability: "view"; readonly type: "function"; }, { readonly constant: false; readonly inputs: readonly [{ readonly name: "_from"; readonly type: "address"; }, { readonly name: "_to"; readonly type: "address"; }, { readonly name: "_amount"; readonly type: "uint256"; }]; readonly name: "transferFrom"; readonly outputs: readonly [{ readonly name: "success"; readonly type: "bool"; }]; readonly payable: false; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly constant: true; readonly inputs: readonly []; readonly name: "decimals"; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint8"; }]; readonly payable: false; readonly stateMutability: "pure"; readonly type: "function"; }, { readonly constant: true; readonly inputs: readonly [{ readonly name: "_owner"; readonly type: "address"; }]; readonly name: "balanceOf"; readonly outputs: readonly [{ readonly name: "balance"; readonly type: "uint256"; }]; readonly payable: false; readonly stateMutability: "view"; readonly type: "function"; }, { readonly constant: true; readonly inputs: readonly []; readonly name: "symbol"; readonly outputs: readonly [{ readonly name: ""; readonly type: "string"; }]; readonly payable: false; readonly stateMutability: "pure"; readonly type: "function"; }, { readonly constant: false; readonly inputs: readonly [{ readonly name: "_to"; readonly type: "address"; }, { readonly name: "_amount"; readonly type: "uint256"; }]; readonly name: "transfer"; readonly outputs: readonly [{ readonly name: "success"; readonly type: "bool"; }]; readonly payable: false; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly constant: false; readonly inputs: readonly [{ readonly name: "_from"; readonly type: "address"; }, { readonly name: "_to"; readonly type: "address"; }, { readonly name: "_amount"; readonly type: "uint256"; }]; readonly name: "move"; readonly outputs: readonly [{ readonly name: "success"; readonly type: "bool"; }]; readonly payable: false; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly constant: true; readonly inputs: readonly []; readonly name: "totalBurned"; readonly outputs: readonly [{ readonly name: ""; readonly type: "uint256"; }]; readonly payable: false; readonly stateMutability: "view"; readonly type: "function"; }, { readonly constant: true; readonly inputs: readonly [{ readonly name: "_owner"; readonly type: "address"; }, { readonly name: "_spender"; readonly type: "address"; }]; readonly name: "allowance"; readonly outputs: readonly [{ readonly name: "remaining"; readonly type: "uint256"; }]; readonly payable: false; readonly stateMutability: "view"; readonly type: "function"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly name: "_from"; readonly type: "address"; }, { readonly indexed: true; readonly name: "_to"; readonly type: "address"; }, { readonly indexed: false; readonly name: "_value"; readonly type: "uint256"; }]; readonly name: "Transfer"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly name: "_owner"; readonly type: "address"; }, { readonly indexed: true; readonly name: "_spender"; readonly type: "address"; }, { readonly indexed: false; readonly name: "_value"; readonly type: "uint256"; }]; readonly name: "Approval"; readonly type: "event"; }]; ENERGY_ADDRESS: string; }; /** * HTTP regex. */ declare const HTTP_REGEX: RegExp; /** * HTTPS regex. */ declare const HTTPS_REGEX: RegExp; /** * Node healthcheck Tolerance in seconds. * @example When set to 30, it means that we consider a node healthy even when it's off-sync by roughly 3 blocks. */ declare const NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS = 30; /** * The selector for the error event. */ declare const ERROR_SELECTOR: string; /** * The selector for the panic event. */ declare const PANIC_SELECTOR: string; /** * Url of the mainnet */ declare const MAINNET_URL = "https://mainnet.vechain.org"; /** * Url of the testnet */ declare const TESTNET_URL = "https://testnet.vechain.org"; /** * Url of the solo network * Using explicit IPv4 (127.0.0.1) instead of localhost to avoid IPv6 resolution issues in CI */ declare const THOR_SOLO_URL = "http://127.0.0.1:8669"; /** * Documentation link of RPC methods */ declare const RPC_DOCUMENTATION_URL = "https://ethereum.github.io/execution-apis/api-documentation/"; /** * Constructs a query object for HTTP requests by filtering out undefined values. * * @param params - An object containing the query parameters with potential undefined values. * @returns An object containing only the defined query parameters. */ declare const buildQuery: (params: Record) => Record; /** * Options for the force stop of the sync polling. */ interface SyncPollInputOptions { /** * The maximum number of iterations. * Poll will stop after this number of iterations, no matter condition is met or not. * * @note If not specified limit on iterations is NOT given. */ maximumIterations?: number; /** * The interval of time (in milliseconds) between each function call. * * @note If not specified a default value is given. */ requestIntervalInMilliseconds?: number; /** * The maximum amount of time (in milliseconds) to wait for the condition to be met. * * @note If not specified limit on time is NOT given. */ maximumWaitingTimeInMilliseconds?: number; } /** * Poll until the condition is met. * * @note: Be careful!, this function is synchronous and will block the thread until the condition is met. * Thus mean it can run forever if the condition is never met. * To avoid infinite loop, you can use the `options.maximumIterations` parameter. * * @example It can be used to wait until: * - A balance is updated after a transaction is sent * - A transaction is mined * - A block is mined * ... * * @param pollingFunction - The function to be called. * @param options - Polling options. @see {SyncPollInputOptions} type. If not specified, the default values are used. In particular: `requestIntervalInMilliseconds` is 1000, `maximumIterations` is not specified * and `maximumWaitingTimeInMilliseconds` is not specified. * @returns An object with a `waitUntil` method. It blocks execution until the condition is met. When the condition is met, it returns the result of the poll. * @throws {InvalidDataType, PollExecution} */ declare function SyncPoll(pollingFunction: () => Promise | TReturnType, options?: SyncPollInputOptions): { waitUntil: (condition: (data: TReturnType) => boolean) => Promise; }; /** * Poll in an event based way. * This Poll is Asynchronous. It exploits: * - The EventEmitter to emit events * - The setInterval function to poll * * @example It can be used to trigger events every time * - When balance is updated after a transaction is sent a message is sent * - When a transaction is mined a message is sent * - When a certain block is mined an operation can start * ... */ declare class EventPoll extends EventEmitter { /** * The current iteration. It counts how many iterations have been done. * This parameter is useful to know how many iterations have been done. * For example, it can be used to stop the poll after a certain number of iterations. */ private currentIteration; /** * Error thrown during the execution of the poll. */ private error?; /** * Indicates whether to stop execution on error of the * {@link _intervalLoop} function. * * @type {boolean} */ private readonly hasToStopOnError; /** * The interval used to poll. */ private intervalId?; /** * The function to be called. */ private readonly pollingFunction; /** * The interval of time (in milliseconds) between each request. */ private readonly requestIntervalInMilliseconds; /** * Constructor for creating an instance of EventPoll. * * @param {Function} pollingFunction - The function to be executed repeatedly. * @param {number} requestIntervalInMilliseconds - The interval in milliseconds between each execution of the polling function. * @param {boolean} [hasToStopOnError=true] - Indicates whether to stop polling if an error occurs. * @throws {InvalidDataType} */ constructor(pollingFunction: () => Promise, requestIntervalInMilliseconds: number, hasToStopOnError: boolean); /** * Get how many iterations have been done. * * @returns The number of iterations. */ get getCurrentIteration(): number; /** * Basic interval loop function. * This function must be called into setInterval. * It calls the promise and emit the event. */ private _intervalLoop; /** * Listen to the 'data' event. * This method is the redefinition of the EventEmitter.on method. * Because the EventEmitter.on method does not allow to specify the type of the data. * And we must be type safe. * * This is equivalent to: * * ```typescript * eventPoll.on('data', (data) => { ... }); * ``` * @param onDataCallback - The callback to be called when the event is emitted. */ onData(onDataCallback: (data: TReturnType, eventPoll: EventPoll) => void): this; /** * Listen to the 'error' event. * This method is the redefinition of the EventEmitter.on method. * Because the EventEmitter.on method does not allow to specify the type of the data. * And we must be type safe. * * This is equivalent to: * * ```typescript * eventPoll.on('error', (data) => { ... }); * ``` * @param onErrorCallback - The callback to be called when the event is emitted. */ onError(onErrorCallback: (error: Error) => void): this; /** * Listen to the 'start' event. * This happens when the poll is stopped. * * @param onStartCallback - The callback to be called when the event is emitted. */ onStart(onStartCallback: (eventPoll: EventPoll) => void): this; /** * Listen to the 'stop' event. * This happens when the poll is stopped. * * @param onStopCallback - The callback to be called when the event is emitted. */ onStop(onStopCallback: (eventPoll: EventPoll) => void): this; /** * Start listening to the event. */ startListen(): void; /** * Stop listening to the event. */ stopListen(): void; } /** * Creates an event poll that performs a callback function repeatedly at a specified interval. * This method is useful to create an event poll in a more readable way. * * @param {Function} callBack - The callback function to be executed on each interval. It should return a Promise. * @param {number} requestIntervalInMilliseconds - The interval in milliseconds at which the callback function will be executed. * @param {boolean} [hasToStopOnError=true] - Optional parameter to specify whether the poll should stop on error. Default is true. * @returns {EventPoll} - The created event poll instance. */ declare function createEventPoll(callBack: () => Promise, requestIntervalInMilliseconds: number, hasToStopOnError?: boolean): EventPoll; declare const Poll: { SyncPoll: typeof SyncPoll; createEventPoll: typeof createEventPoll; }; /** * Generates a query string from a record of key-value pairs. * Only includes keys in the query string whose values are defined. * * @param params - The record of key-value pairs. * @returns The query string. */ declare const toQueryString: (params: Record) => string; /** * Sanitizes a base URL by removing trailing slashes and adding the protocol if missing. * * @param url - The URL to validate. * @returns The sanitized URL without the protocol. * @throws {InvalidDataType} */ declare const sanitizeWebsocketBaseURL: (url: string) => string; /* --- Input options start --- */ interface EventOptions { /** * The block id to start from, defaults to the best block. */ position?: string; /** * The contract address to filter events by. */ contractAddress?: string; /** * The topic0 to filter events by. */ topic0?: string; /** * The topic1 to filter events by. */ topic1?: string; /** * The topic2 to filter events by. */ topic2?: string; /** * The topic3 to filter events by. */ topic3?: string; /** * The topic4 to filter events by. */ topic4?: string; } interface VetTransferOptions { /** * The block id to start from, defaults to the best block. */ position?: string; /** * The signer address to filter transfers by. */ signerAddress?: string; /** * The sender address to filter transfers by. */ sender?: string; /** * The receiver address to filter transfers by. */ receiver?: string; } /** * Endpoints for the REST API. */ declare const thorest: { /** * Accounts related endpoints. */ accounts: { get: { ACCOUNT_DETAIL: (address: string) => string; ACCOUNT_BYTECODE: (address: string) => string; STORAGE_AT: (address: string, position: string) => string; }; post: { SIMULATE_TRANSACTION: (revision?: string) => string; }; }; /** * Blocks related endpoints. */ blocks: { get: { BLOCK_DETAIL: (revision: string | number) => string; }; }; /** * Nodes related endpoints. */ nodes: { get: { NODES: () => string; }; }; /** * Logs related endpoints. */ logs: { post: { EVENT_LOGS: () => string; TRANSFER_LOGS: () => string; }; }; /** * Transactions related endpoints. */ transactions: { get: { TRANSACTION: (id: string) => string; TRANSACTION_RECEIPT: (id: string) => string; }; post: { TRANSACTION: () => string; }; }; /** * Subscriptions related endpoints. */ subscriptions: { get: { /** * Subscribe to new blocks. * * @param baseURL - The URL of the node to request the subscription from. * @param position - (optional) The block id to start from, defaults to the best block. * * @returns The websocket subscription URL. */ BLOCK: (baseURL: string, position?: string) => string; /** * Subscribe to new events. * * @param baseURL - The URL of the node to request the subscription from. * @param options - (optional) The options for the subscription. * * @returns The websocket subscription URL. */ EVENT: (baseURL: string, options?: EventOptions) => string; /** * Subscribe to new VET transfers. * * @param baseURL - The URL of the node to request the subscription from. * @param options - (optional) The options for the subscription. * * @returns The websocket subscription URL. */ VET_TRANSFER: (baseURL: string, options?: VetTransferOptions) => string; /** * Subscribe to new legacy beats. * A beat is a notification that a new block has been added to the blockchain with a bloom filter which can be used to check if the block contains any relevant account. * @note This subscription has been improved with dynamic size bloom filter with the new `BEAT` subscription. * * @param baseURL - The URL of the node to request the subscription from. * @param position - (optional) The block id to start from, defaults to the best block. * * @returns The websocket subscription URL. */ BEAT_LEGACY: (baseURL: string, position?: string) => string; /** * Subscribe to new beats. * A beat is a notification that a new block has been added to the blockchain with a bloom filter which can be used to check if the block contains any relevant account. * * @param baseURL - The URL of the node to request the subscription from. * @param position - (optional) The block id to start from, defaults to the best block. * * @returns The websocket subscription URL. */ BEAT: (baseURL: string, position?: string) => string; /** * Subscribe to new transactions. * * @returns The websocket subscription URL. */ NEW_TRANSACTIONS: (baseURL: string) => string; }; }; /** * Debug related endpoints. */ debug: { post: { TRACE_TRANSACTION_CLAUSE: () => string; TRACE_CONTRACT_CALL: () => string; RETRIEVE_STORAGE_RANGE: () => string; }; }; /** * Fees related endpoints. */ fees: { get: { FEES_HISTORY: (blockCount: number, newestBlock: string | number, rewardPercentiles?: number[]) => string; }; }; }; /* --------- Event types start --------- */ /** * An Event Parameter ABI object. */ interface EventParameter { /** * Whether the parameter is an indexed parameter. */ indexed: boolean; /** * The name of the parameter. */ name: string; /** * The type of the parameter. */ type: string; /** * The internal type of the parameter. */ internalType?: string; } /** * An Event ABI object. */ interface EventAbi { /** * Whether the event was declared as anonymous. */ anonymous: boolean; /** * The inputs of the event. */ inputs: EventParameter[]; /** * The name of the event. */ name: string; /** * The type of the event. For an event, this is always 'event'. */ type: string; } /** * An event represented as a string, an EventAbi object or an abitype AbiEvent. * If a string is provided, it must adhere to abitype's AbiEvent. * * @see [AbiEvent](https://abitype.dev/api/types#abievent) */ type EventLike = string | AbiEvent | EventAbi; /* --------- Event types end --------- */ /* --- Input options start --- */ /** * Options for event subscription. */ interface EventSubscriptionOptions { /** * The block id from which to start the subscription. * * @note the Block ID must refer to a block that does not exceed the backtrace limit of the node. (Default: 1000) * @see [Backtrace limit](https://docs.vechain.org/start-building/tutorials/how-to-run-a-thor-solo-node#command-line-options) */ blockID?: string; /** * The address of the contract that emitted the event to subscribe to. */ address?: string; } interface BlockSubscriptionOptions { /** * The block id from which to start the subscription. * * @note the Block ID must refer to a block that does not exceed the backtrace limit of the node. (Default: 1000) * @see [Backtrace limit](https://docs.vechain.org/start-building/tutorials/how-to-run-a-thor-solo-node#command-line-options) */ blockID?: string; } interface VETtransfersSubscriptionOptions { /** * The block id from which to start the subscription. * * @note the Block ID must refer to a block that does not exceed the backtrace limit of the node. (Default: 1000) * @see [Backtrace limit](https://docs.vechain.org/start-building/tutorials/how-to-run-a-thor-solo-node#command-line-options) */ blockID?: string; /** * The address of the contract that emitted the event to subscribe to. */ signerAddress?: string; /** * The address of the sender of the VET transfer to subscribe to. */ sender?: string; /** * The address of the recipient of the VET transfer to subscribe to. */ recipient?: string; } /** * Subscriptions utilities. * Contains functions for obtaining URLs for subscribing to events through a websocket connection. */ declare const subscriptions: { getEventSubscriptionUrl: (baseURL: string, event: EventLike, indexedValues?: unknown[], options?: EventSubscriptionOptions) => string; getBlockSubscriptionUrl: (baseURL: string, options?: BlockSubscriptionOptions) => string; getNewTransactionsSubscriptionUrl: (baseURL: string) => string; getVETtransfersSubscriptionUrl: (baseURL: string, options?: VETtransfersSubscriptionOptions) => string; getLegacyBeatSubscriptionUrl: (baseURL: string, options?: BlockSubscriptionOptions) => string; getBeatSubscriptionUrl: (baseURL: string, options?: BlockSubscriptionOptions) => string; }; declare const vnsUtils: { resolveName: (thorClient: ThorClient, name: string) => Promise; resolveNames: (blocksModule: BlocksModule, transactionsModule: TransactionsModule, names: string[]) => Promise>; lookupAddress: (thorClient: ThorClient, address: string) => Promise; lookupAddresses: (thorClient: ThorClient, addresses: string[]) => Promise>; }; /** * Represents the parameters for a subscription. * This interface includes all necessary details for managing a subscription. */ interface SubscriptionParams { /** * The unique identifier for the subscription. * This string uniquely identifies the subscription instance. */ readonly subscription: string; /** * The result associated with the subscription. * This can be of any type and contains the data or outcome that the subscription yields. */ readonly result: unknown; } /** * Describes an event related to a subscription. * This interface encapsulates the method invoked and the parameters associated with the subscription event. */ interface SubscriptionEvent { /** * The name of the method associated with the subscription event. */ readonly method: string; /** * The parameters associated with the subscription event. * This includes all necessary details such as the subscription identifier and the result. */ readonly params: SubscriptionParams; } /** * Defines the options used to filter events in a subscription. These options can specify which events to include based on various blockchain parameters. */ interface FilterOptions { /** * The contract address or addresses to filter for events. */ address?: string | string[]; /** * The starting block number (inclusive) from which to begin filtering events. */ fromBlock?: string; /** * The ending block number (inclusive) at which to stop filtering events. */ toBlock?: string; /** * An array of topic identifiers to filter events. Each event must match all specified topics to be included. */ topics?: string[]; /** * The hash of a specific block. If defined, only events from this block are included. */ blockhash?: string; } /** * Represents a subscription to a specific type of data or event within a system. * This could be used for subscribing to updates or changes in the data. */ interface Subscription { /** * The type of subscription, indicating what kind of data or events this subscription pertains to. */ type: string; /** * Optional configuration options for the subscription that can filter or modify the data received. */ options?: FilterOptions; } interface NewHeadsSubscription { readonly subscriptionId: string; readonly subscription: Subscription; } /** * Manages multiple subscriptions within a system, keeping track of active subscriptions and the current block number. */ interface SubscriptionManager { /** * A map of subscription identifiers to Subscription objects, keeping track of all log-related subscriptions. */ logSubscriptions: Map; /** * An optional collection of subscriptions specifically for new block headers, indexed by a unique identifier. */ newHeadsSubscription?: NewHeadsSubscription; /** * The most recent block number that has been processed or observed by the manager, serving as a point of reference for new events. */ currentBlockNumber: number; } /** * Our core provider class for VeChain */ declare class VeChainProvider extends EventEmitter implements EIP1193ProviderMessage { readonly thorClient: ThorClient; readonly wallet?: ProviderInternalWallet | undefined; readonly enableDelegation: boolean; readonly subscriptionManager: SubscriptionManager; /** * Poll instance for subscriptions * * @private */ private pollInstance?; /** * Constructor for VeChainProvider * * @param thorClient - ThorClient instance. * @param wallet - ProviderInternalWallet instance. It is optional because the majority of the methods do not require a wallet. * @param enableDelegation - Enable fee delegation or not. * @throws {JSONRPCInvalidParams} * */ constructor(thorClient: ThorClient, wallet?: ProviderInternalWallet | undefined, enableDelegation?: boolean); /** * Destroys the provider by closing the thorClient and stopping the provider poll instance if present. * This is because thorClient and the provider might be initialized with a polling interval. */ destroy(): void; /** * This method is used to send a request to the provider. * Basically, it is a wrapper around the RPCMethodsMap. * * @param args - Method and parameters to be used for the request. * @returns The result of the request. * @throws {JSONRPCMethodNotFound} */ request(args: EIP1193RequestArguments): Promise; /** * Initializes and starts the polling mechanism for subscription events. * This method sets up an event poll that periodically checks for new events related to active * subscriptions, such as 'newHeads' or log subscriptions. When new data is available, it emits * these events to listeners. * * This method leverages the `Poll.createEventPoll` utility to create the polling mechanism, * which is then started by invoking `startListen` on the poll instance. */ startSubscriptionsPolling(): boolean; /** * Stops the polling mechanism for subscription events. * This method stops the polling mechanism for subscription events, if it is active. * * @returns {boolean} A boolean indicating whether the polling mechanism was stopped. */ stopSubscriptionsPolling(): boolean; /** * Checks if there are active subscriptions. * This method checks if there are any active log subscriptions or a new heads subscription. * * @returns {boolean} A boolean indicating whether there are active subscriptions. */ isThereActiveSubscriptions(): boolean; /** * Returns the poll instance for subscriptions. */ getPollInstance(): EventPoll | undefined; /** * Fetches logs for all active log subscriptions managed by `subscriptionManager`. * This method iterates over each log subscription, constructs filter options based on the * subscription details, and then queries for logs using these filter options. * * Each log query is performed asynchronously, and the method waits for all queries to complete * before returning. The result for each subscription is encapsulated in a `SubscriptionEvent` * object, which includes the subscription ID and the fetched logs. * * This function is intended to be called when there's a need to update or fetch the latest * logs for all active subscriptions, typically in response to a new block being mined or * at regular intervals to keep subscription data up to date. * * @returns {Promise} A promise that resolves to an array of `SubscriptionEvent` * objects, each containing the subscription ID and the corresponding logs fetched for that * subscription. The promise resolves to an empty array if there are no active log subscriptions. */ private getLogsRPC; /** * Fetches the current block details from the VeChain node. * * @private */ private getCurrentBlock; /** * Get a signer into the internal wallet provider * for the given address. * * @param addressOrIndex - Address of index of the account. * @returns The signer for the given address. */ getSigner(addressOrIndex?: string | number): Promise; /** * Use vet.domains to resolve name to address * @param vnsName - The name to resolve * @returns the address for a name or null */ resolveName(vnsName: string): Promise; /** * Use vet.domains to look up a verified primary name for an address * @param address - The address to lookup * @returns the primary name for an address or null */ lookupAddress(address: string): Promise; } /** * Type for a JSON-RPC request. * It is a wrapped JsonRpcRequest of hardhat. * you can find the original into "hardhat/types". * * @note we wrap here the original type to avoid * the usage of hardhat dependency for provider package. */ interface JsonRpcRequest { jsonrpc: string; method: string; params: unknown[]; id: number; } /** * Type for a JSON-RPC response. * It is a wrapped JsonRpcResponse of hardhat. * you can find the original into "hardhat/types". * * @note we wrap here the original type to avoid * the usage of hardhat dependency for provider package. */ interface JsonRpcResponse { jsonrpc: string; id: number; result?: unknown; error?: { code: number; message: string; data?: unknown; }; } /** * Type for hardhat error function callback * * @note we use this callback to delegate the hardhat import * to the final code who will use provider */ type BuildHardhatErrorFunction = (message: string, parent?: Error) => Error; /** * This class is a wrapper for the VeChainProvider that Hardhat uses. * * It exposes the interface that Hardhat expects, and uses the VeChainProvider as wrapped provider. */ declare class HardhatVeChainProvider extends VeChainProvider { /** * Debug mode. */ debug: boolean; /** * The function to use to build Hardhat errors. */ buildHardhatErrorFunctionCallback: BuildHardhatErrorFunction; /** * RPC configuration. */ rpcConfiguration: { ethGetTransactionCountMustReturn0: boolean; }; /** * Constructor with the network configuration. * * @param walletToUse - The wallet to use. * @param nodeUrl - The node url to use * @param buildHardhatErrorFunctionCallback - The function to use to build Hardhat errors. * @param debug - Debug mode. * @param enableDelegation - Enable fee delegation or not. */ constructor(walletToUse: ProviderInternalWallet, nodeUrl: string, buildHardhatErrorFunctionCallback: BuildHardhatErrorFunction, debug?: boolean, enableDelegation?: boolean, rpcConfiguration?: { ethGetTransactionCountMustReturn0: boolean; }); /** * Overload of the send method * * @param method - The method to call. * @param params - The parameters to pass to the method. */ send(method: string, params?: unknown[]): Promise; /** * Overload of the sendAsync method. * It is the same of the send method, but with a callback. * Instead of returning the result, it calls the callback with the result. * * @param payload - The request payload (it contains method and params as 'send' method). * @param callback - The callback to call with the result. */ sendAsync(payload: JsonRpcRequest, callback: (error: unknown, response: JsonRpcResponse) => void): Promise; /** * It sends the request through the VeChainProvider. * * @param args - The request arguments. */ request(args: EIP1193RequestArguments): Promise; } /** * JSON RPC provider for ethers. * Needed to customize ethers functionality into hardhat plugin. */ declare class JSONRPCEthersProvider extends JsonRpcApiProvider { /** * Instance of Hardhat VeChain provider to wrap */ hardhatProvider: HardhatVeChainProvider; /** * Constructor with parameters. * * @param chainId - The chain id of the network * @param networkName - The name of the network * @param hardhatProvider - The hardhat provider to wrap */ constructor(chainId: number, networkName: string, hardhatProvider: HardhatVeChainProvider); /** * Override the send method to use the hardhat provider and to call _start method. * * @param method - The method to call * @param params - The parameters of the method */ send(method: string, params: unknown[] | Record): Promise; /** * Internal method to send the payload to the hardhat provider. * This method is able to send multiple payloads. (send in batch) * * @param payload - The payload to send (request and method)'s */ _send(payload: JsonRpcPayload | JsonRpcPayload[]): Promise>; } /** * List of all valid ethereum RPC methods * * @note following links for more details: * * https://eth.wiki/json-rpc/API * * https://ethereum.github.io/execution-apis/api-documentation/ */ declare enum RPC_METHODS { /** * IMPLEMENTED METHODS: */ eth_blockNumber = "eth_blockNumber", eth_chainId = "eth_chainId", eth_getBalance = "eth_getBalance", eth_getCode = "eth_getCode", eth_getStorageAt = "eth_getStorageAt", eth_estimateGas = "eth_estimateGas", eth_call = "eth_call", eth_sendRawTransaction = "eth_sendRawTransaction", eth_getLogs = "eth_getLogs", eth_getBlockByHash = "eth_getBlockByHash", eth_getBlockByNumber = "eth_getBlockByNumber", eth_accounts = "eth_accounts", eth_requestAccounts = "eth_requestAccounts", eth_gasPrice = "eth_gasPrice", eth_getTransactionByHash = "eth_getTransactionByHash", eth_getTransactionCount = "eth_getTransactionCount", eth_getTransactionReceipt = "eth_getTransactionReceipt", eth_getTransactionByBlockNumberAndIndex = "eth_getTransactionByBlockNumberAndIndex", eth_getTransactionByBlockHashAndIndex = "eth_getTransactionByBlockHashAndIndex", eth_getBlockTransactionCountByHash = "eth_getBlockTransactionCountByHash", eth_getBlockTransactionCountByNumber = "eth_getBlockTransactionCountByNumber", eth_sendTransaction = "eth_sendTransaction", eth_syncing = "eth_syncing", net_version = "net_version", web3_clientVersion = "web3_clientVersion", eth_subscribe = "eth_subscribe", eth_unsubscribe = "eth_unsubscribe", debug_traceTransaction = "debug_traceTransaction", debug_traceCall = "debug_traceCall", evm_mine = "evm_mine", evm_increaseTime = "evm_increaseTime",// Uses evm_mine under the hood, required for hardhat web3_sha3 = "web3_sha3", net_peerCount = "net_peerCount", net_listening = "net_listening", eth_getUncleByBlockNumberAndIndex = "eth_getUncleByBlockNumberAndIndex", eth_getUncleByBlockHashAndIndex = "eth_getUncleByBlockHashAndIndex", txpool_inspect = "txpool_inspect", txpool_contentFrom = "txpool_contentFrom", txpool_content = "txpool_content", txpool_status = "txpool_status", eth_signTransaction = "eth_signTransaction", debug_traceBlockByHash = "debug_traceBlockByHash", debug_traceBlockByNumber = "debug_traceBlockByNumber", eth_getUncleCountByBlockHash = "eth_getUncleCountByBlockHash", eth_getUncleCountByBlockNumber = "eth_getUncleCountByBlockNumber", eth_signTypedData_v4 = "eth_signTypedData_v4", eth_getBlockReceipts = "eth_getBlockReceipts", /** * TO BE IMPLEMENTED METHODS: * Add to packages/network/src/provider/utils/rpc-mapper/methods/index.ts to implement */ eth_coinbase = "eth_coinbase", eth_feeHistory = "eth_feeHistory", eth_getWork = "eth_getWork", eth_mining = "eth_mining", eth_hashrate = "eth_hashrate", eth_protocolVersion = "eth_protocolVersion", eth_sign = "eth_sign", eth_submitWork = "eth_submitWork", parity_nextNonce = "parity_nextNonce", eth_newFilter = "eth_newFilter", eth_newBlockFilter = "eth_newBlockFilter", eth_newPendingTransactionFilter = "eth_newPendingTransactionFilter", eth_getFilterLogs = "eth_getFilterLogs", eth_getFilterChanges = "eth_getFilterChanges", eth_uninstallFilter = "eth_uninstallFilter", debug_getBadBlocks = "debug_getBadBlocks", debug_getRawBlock = "debug_getRawBlock", debug_getRawHeader = "debug_getRawHeader", debug_getRawReceipts = "debug_getRawReceipts", debug_getRawTransaction = "debug_getRawTransaction", engine_exchangeCapabilities = "engine_exchangeCapabilities", engine_exchangeTransitionConfigurationV1 = "engine_exchangeTransitionConfigurationV1", engine_forkchoiceUpdatedV1 = "engine_forkchoiceUpdatedV1", engine_forkchoiceUpdatedV2 = "engine_forkchoiceUpdatedV2", engine_forkchoiceUpdatedV3 = "engine_forkchoiceUpdatedV3", engine_getPayloadBodiesByHashV1 = "engine_getPayloadBodiesByHashV1", engine_getPayloadBodiesByRangeV1 = "engine_getPayloadBodiesByRangeV1", engine_getPayloadV1 = "engine_getPayloadV1", engine_getPayloadV2 = "engine_getPayloadV2", engine_getPayloadV3 = "engine_getPayloadV3", engine_newPayloadV1 = "engine_newPayloadV1", engine_newPayloadV2 = "engine_newPayloadV2", engine_newPayloadV3 = "engine_newPayloadV3", eth_createAccessList = "eth_createAccessList", eth_getProof = "eth_getProof", eth_maxPriorityFeePerGas = "eth_maxPriorityFeePerGas" } /** * Polling interval for the subscription events polling mechanism for the VeChain provider. */ declare const POLLING_INTERVAL: number; type DefaultBlock = `0x${string}` | 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized'; /** * Maps the Ethereum "default block" type to VeChainThor Revision type. * Ethereum "default block" can be: * - 'latest' or 'earliest' or 'pending' or 'safe' or 'finalized' * - a hexadecimal block number * VeChainThor revision type can be: * - 'best', 'next', 'justified', 'finalized' * - a hexadecimal block Id * - a integer block number * * @param defaultBlock - The Ethereum default block type to convert * @returns The VeChainThor revision type */ declare const DefaultBlockToRevision: (defaultBlock: DefaultBlock) => Revision; /** * Chain ID's this is the blockId of the genesis block */ declare const CHAIN_ID: { MAINNET: string; TESTNET: string; SOLO_DEFAULT: string; }; declare const CHAIN_TAG: { MAINNET: string; TESTNET: string; SOLO_DEFAULT: string; }; /** * Converts a chain tag to a chain Id * @param chainTag chain tag as last byte of genesis block id * @returns chain id */ declare const chainTagToChainId: (chainTag: HexUInt) => HexUInt; /** * The return type of transaction according to the Ethereum RPC standard. * * @link [Ethereum JSON RPC Transaction Object](https://docs.infura.io/networks/ethereum/json-rpc-methods/eth_gettransactionbyhash#returns) */ interface TransactionRPC { /** * Hash of the transaction. */ hash: string; /** * Hash of the block where this transaction is included. */ blockHash: string; /** * Number of the block where this transaction is included. */ blockNumber: string; /** * Address of the sender of this transaction. */ from: string; /** * The address of the receiver. null when it's a contract creation transaction */ to: string | null; /** * The value transferred in wei encoded as hexadecimal */ value: string; /** * The gas provided by the sender, encoded as hexadecimal */ gas: string; /** * The data sent along with the transaction */ input: string; /** * The integer of the transaction's index position that the log was created from. null when it's a pending log */ transactionIndex: string; /** * The chain id of the transaction */ chainId: string; /** * The nonce of the transaction. * * @note Differs from Ethereum as it's not the sequential nonce. */ nonce: string; /** * The transaction type in number, currently 0(Legacy Transaction) and 81(DynamicFee Transaction) are supported. */ type: string; /** * The maximum amount that can be spent to pay for base fee and priority fee expressed in hex. */ maxFeePerGas: string | undefined; /** * The maximum amount that can be tipped to the validator expressed in hex. */ maxPriorityFeePerGas: string | undefined; // incompatible fields r: string; s: string; v: string; gasPrice: string; accessList: Array<{ address: string; storageKeys: string[] }>; yParity: string; } /** * The return type of transaction receipt logs according to the Ethereum RPC standard. * * @link [Ethereum JSON RPC Transaction Receipt Log Object](https://docs.infura.io/networks/ethereum/json-rpc-methods/eth_gettransactionreceipt#returns) */ interface TransactionReceiptLogsRPC { /** * The address from which this log was generated */ address: string; /** * The hash of the block where this log was in */ blockHash: string; /** * The block number where this log was in */ blockNumber: string; /** * The 32 byte non-indexed argument of the log */ data: string; /** * The integer of log index position in the block encoded as hexadecimal. null if the log is pending */ logIndex: string; /** * It is true if log was removed, due to a chain reorganization and false if it's a valid log */ removed: false; /** * An array of zero to four 32 Bytes DATA of indexed log arguments. * In Solidity, the first topic is the hash of the signature of the event (e.g. Deposit(address, bytes32, uint256)), * except you declare the event with the anonymous specifier */ topics: string[]; /** * The hash of the transaction from which this log was created from. null if the log is pending */ transactionHash: string; /** * The transactions index position from which this log was created from. null if the log is pending */ transactionIndex: string; } /** * Return type of transaction receipt according to the Ethereum RPC standard. * * @link [Ethereum JSON RPC Transaction Receipt Object](https://docs.infura.io/networks/ethereum/json-rpc-methods/eth_gettransactionreceipt#returns) */ interface TransactionReceiptRPC { /** * 32 bytes. Hash of the block including this transaction. */ blockHash: string; /** * Block number including this transaction. */ blockNumber: string; /** * 20 bytes. The address of the contract created, if the transaction was a contract creation, otherwise null. */ contractAddress: string | null; /** * The total amount of gas used when this transaction was executed in the block. */ cumulativeGasUsed: string; /** * The actual value per gas deducted from the sender's account. Before EIP-1559, equal to the gas price. */ effectiveGasPrice: string; /** * 20 bytes. The address of the sender. */ from: string; /** * The total amount of gas used when this transaction was executed in the block. */ gasUsed: string; /** * Array of log objects, which this transaction generated. */ logs: TransactionReceiptLogsRPC[]; /** * 256 bytes. Bloom filter for light clients to quickly retrieve related logs. */ logsBloom: string; /** * Either 1 (success) or 0 (failure) */ status: '0x0' | '0x1'; /** * 20 bytes. The address of the receiver. null when it's a contract creation transaction */ to: string | null; /** * 32 bytes. Hash of the transaction. */ transactionHash: string; /** * Hexadecimal of the transaction's index position in the block. */ transactionIndex: string; /** * The transaction type. * @see https://docs.infura.io/networks/ethereum/concepts/transaction-types */ type: '0x0' | '0x1' | '0x2'; } /** * Return type of block header for RPC standard. */ interface BlockHeaderRPC { /** * Header number in hex string format */ number: string; /** * Hash in bytes32 format */ hash: string; /** * Parent hash in bytes32 format */ parentHash: string; /** * Transactions root in bytes32 format */ transactionsRoot: string; /** * State root in bytes32 format */ stateRoot: string; /** * Receipts root in bytes32 format */ receiptsRoot: string; /** * Miner address in bytes20 format */ miner: string; /** * Gas limit in hex string format */ gasLimit: string; /** * Gas used in hex string format */ gasUsed: string; /** * Timestamp in hex string format */ timestamp: string; /** * Unsupported fields */ sha3Uncles: string; nonce: string; logsBloom: string; extraData: string; } /** * Return type of blocks for RPC standard. * * Our SDK uses `BlockDetail` type from `@vechain/sdk-network` package. * * @link [Ethereum JSON RPC Block Object](https://docs.infura.io/networks/ethereum/json-rpc-methods/eth_getblockbynumber#returns) */ interface BlocksRPC extends BlockHeaderRPC { /** * Block number in hex string format */ size: string; /** * List of transactions as bytes32 array or TransactionRPC array */ transactions: string[] | TransactionRPC[]; /** * Base fee per gas in hex string format (since the Galactica fork) */ baseFeePerGas?: string; /** * Unsupported fields */ difficulty: string; totalDifficulty: string; uncles: string[]; mixHash: string; } /** * Return type of eth_syncing for RPC method. */ interface SyncBlockRPC { startingBlock: null; currentBlock: BlocksRPC | null; highestBlock: string | null; } declare const blocksFormatter: { formatToRPCStandard: (block: CompressedBlockDetail | ExpandedBlockDetail, chainId: string) => BlocksRPC; }; /** * Available tracers for the RPC standard. */ type TracerNameRPC = 'call' | 'prestate'; /** * Return type for the following RPC endpoints: * * debug_traceTransaction * * debug_traceCall */ type TracerReturnTypeRPC = TracerNameType extends 'call' ? CallTracerRPC : PrestateTracerRPC; /** * The return type of the 'call' tracer for the RPC standard. */ type CallTracerRPC = TraceReturnType<'call'> & { /** * Same of the 'call' tracer of VeChain, * BUT with the addition of the revertReason field. * * @note This is not part of the VeChain's 'call' tracer. * For this reason, it will have a default value of ''. */ revertReason?: ''; }; /** * The return type of the 'prestate' tracer for the RPC standard. */ type PrestateTracerRPC = Record< string, { balance: string; code?: string; storage?: Record; /** * Same of the 'prestate' tracer of VeChain, * BUT with the addition of the nonce field. * This field substitutes the 'energy' field * of the VeChain's 'prestate' tracer. * * @note This is not part of the VeChain's 'prestate' tracer. * For this reason, it will have a default value of 0. */ nonce: 0; } >; /** * Output formatter for RPC debug endpoints: * * debug_traceTransaction * * debug_traceCall * It converts our endpoint calls output to the RPC standard output. * * @param tracerName - Tracer name used for the debug endpoint. * @param debugDetails - Debug details to be formatted. */ declare function formatToRPCStandard(tracerName: TDebugType, debugDetails: TraceReturnType): TracerReturnTypeRPC<'call'> | TracerReturnTypeRPC<'prestate'>; declare const debugFormatter: { formatToRPCStandard: typeof formatToRPCStandard; }; /** * Return type of logs according to the Ethereum RPC standard. */ interface LogsRPC { /** * (boolean) true when the log was removed, due to a chain reorganization. false if it's a valid log. */ removed: boolean; /** * Hexadecimal of the log index position in the block. Null when it is a pending log. */ logIndex: string; /** * Hexadecimal of the transaction index position from which the log created. Null when it is a pending log. */ transactionIndex: string; /** * 32 bytes. Hash of the transactions from which this log was created. Null when it is a pending log. */ transactionHash: string; /** * 32 bytes. Hash of the block where this log was in. Null when it is a pending log. */ blockHash: string; /** * Block number where this log was in. Null when it is a pending log. */ blockNumber: string; /** * 20 bytes. Address from which this log originated. */ address: string; /** * Contains one or more 32-bytes non-indexed arguments of the log. */ data: string; /** * An array of 0 to 4 indexed log arguments, each 32 bytes. In solidity the first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except when you declared the event with the anonymous specifier. */ topics: string[]; } /** * Output formatter for Event logs. * It converts the Event logs into the RPC standard. * * @param eventLogs - The Event logs to be formatted. */ declare const formatToLogsRPC: (eventLogs: EventLogs[]) => LogsRPC[]; /** * Function to generate a set of event criteria based on input criteria. * The function takes an object with optional address and topics properties, * and returns an array of EventCriteria objects. * * @param {Object} criteria - The input criteria object. * @param {string|string[]} [criteria.address] - A single address string or an array of address strings. * @param {string[]|string[][]} [criteria.topics] - A single array of topics or an array of arrays of topics. * @returns {EventCriteria[]} An array of EventCriteria objects. */ declare const getCriteriaSetForInput: (criteria: { address?: string | string[]; topics?: string[] | string[][]; }) => EventCriteria[]; /** * Output formatter for Transaction Receipt details. * It converts the Transaction Receipt details, Transaction details and block into the RPC standard. * * @param transactionHash - The hash of the transaction to be formatted. * @param receipt - The Transaction Receipt to be formatted. * @param transaction - The Transaction details to be formatted. * @param blockContainsTransaction - The block contains the transaction to be formatted. * @param chainId - The chain ID of the network. */ declare function formatTransactionReceiptToRPCStandard(transactionHash: string, receipt: TransactionReceipt, transaction: TransactionDetailNoRaw, blockContainsTransaction: ExpandedBlockDetail, chainId: string): TransactionReceiptRPC; declare const transactionsFormatter: { formatToRPCStandard: (tx: TransactionDetailNoRaw, chainId: string, txIndex: number) => TransactionRPC; formatExpandedBlockToRPCStandard: (tx: TransactionsExpandedBlockDetail, block: ExpandedBlockDetail, txIndex: number, chainId: string) => TransactionRPC; formatTransactionReceiptToRPCStandard: typeof formatTransactionReceiptToRPCStandard; }; /** * RPC Method debug_traceBlockByHash implementation * * @link [debug_traceBlockByHash](https://www.quicknode.com/docs/ethereum/debug_traceBlockByHash) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The block hash of block to get. * * params[1]: options - object - This describes the options for the trace. It has the following parameters: * * tracer - string to specify the type of tracer. Currently, it supports callTracer and prestateTracer. * * tracerConfig - Object to specify configurations for the tracer. It has the following parameter: * * onlyTopCall - boolean Setting this to true will only trace the main (top-level) call and none of the sub-calls. * This avoids extra processing for each call frame if only the top-level call info are required (useful for getting revertReason). * * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const debugTraceBlockByHash: (thorClient: ThorClient, params: unknown[]) => Promise | TracerReturnTypeRPC<"prestate">; }>>; /** * RPC Method debug_traceBlockByNumber implementation * * @link [debug_traceBlockByNumber](https://www.quicknode.com/docs/ethereum/debug_traceBlockByNumber) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The block number to get as a hex string or "latest" or "finalized". * * params[1]: options - object - This describes the options for the trace. It has the following parameters: * * tracer - string to specify the type of tracer. Currently, it supports callTracer and prestateTracer. * * tracerConfig - Object to specify configurations for the tracer. It has the following parameter: * * onlyTopCall - boolean Setting this to true will only trace the main (top-level) call and none of the sub-calls. * This avoids extra processing for each call frame if only the top-level call info are required (useful for getting revertReason). * * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const debugTraceBlockByNumber: (thorClient: ThorClient, params: unknown[]) => Promise | TracerReturnTypeRPC<"prestate">; }>>; /** * RPC Method debug_traceCall implementation * * @link [debug_traceCall](https://www.quicknode.com/docs/ethereum/debug_traceCall) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: transaction - object - This describes the transaction info with following properties: * * from - 20 bytes - Address the transaction is sent from. * * to - 20 bytes [Required] - Address the transaction is directed to. * * gas - Hexadecimal value of the gas provided for the transaction execution as hex string. * * gasPrice - Hexadecimal value of the gasPrice used for each paid gas. * * value - Hexadecimal of the value sent with this transaction. * * data - Hash of the method signature and encoded parameters. * * params[1]: blockNumber - string - The block number parameter. A hexadecimal number or (latest, earliest or pending). (NOT SUPPORTED YET) * * params[2]: options - object - This describes the options for the trace. It has the following parameters: * * tracer - string to specify the type of tracer. Currently, it supports callTracer and prestateTracer. * * tracerConfig - Object to specify configurations for the tracer. It has the following parameters: * * onlyTopCall - boolean Setting this to true will only trace the main (top-level) call and none of the sub-calls. This avoids extra processing for each call frame if only the top-level call info are required (useful for getting revertReason). * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const debugTraceCall: (thorClient: ThorClient, params: unknown[]) => Promise | TracerReturnTypeRPC<"prestate">>; /** * RPC Method debug_traceTransaction implementation * * @link [debug_traceTransaction](https://www.quicknode.com/docs/ethereum/debug_traceTransaction) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: transactionHash - hex string - This describes the transaction hash of the transaction that needs to be traced. * * params[1]: options - object - This describes the options for the trace. It has the following parameters: * * tracer - string to specify the type of tracer. Currently, it supports callTracer and prestateTracer. * * timeout - string - A duration string of decimal numbers that overrides the default timeout of 5 seconds for JavaScript-based tracing calls. * Max timeout is "10s". Valid time units are "ns", "us", "ms", "s" each with an optional fraction, such as "300ms" or "2s45ms" * * tracerConfig - Object to specify configurations for the tracer. It has the following parameter: * * onlyTopCall - boolean Setting this to true will only trace the main (top-level) call and none of the sub-calls. * This avoids extra processing for each call frame if only the top-level call info are required (useful for getting revertReason). * * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const debugTraceTransaction: (thorClient: ThorClient, params: unknown[]) => Promise | TracerReturnTypeRPC<"prestate">>; /** * Type for trace options */ interface TraceOptionsRPC { tracer: 'callTracer' | 'prestateTracer'; tracerConfig?: { onlyTopCall?: boolean }; // Not supported yet timeout?: string; } /** * RPC Method engine_getPayloadBodiesByHashV1 implementation * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * @note: * * params[0]: ... * * params[1]: ... * * params[n]: ... */ declare const engineGetPayloadBodiesByHashV1: () => Promise<"METHOD NOT IMPLEMENTED">; /** * RPC Method engine_getPayloadBodiesByRangeV1 implementation * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * @note: * * params[0]: ... * * params[1]: ... * * params[n]: ... */ declare const engineGetPayloadBodiesByRangeV1: () => Promise<"METHOD NOT IMPLEMENTED">; /** * RPC Method eth_accounts implementation * * @param provider - Provider with ProviderInternalWallet instance to use. */ declare const ethAccounts: (provider?: VeChainProvider) => Promise; /** * RPC Method eth_blockNumber implementation * * @link [eth_blockNumber](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @returns the latest block number as a hex string. If the block number cannot be retrieved, it will return '0x0' * @throws {JSONRPCInternalError} */ declare const ethBlockNumber: (thorClient: ThorClient) => Promise; /** * RPC Method eth_call implementation * * @link [eth_call](https://ethereum.github.io/execution-apis/api-documentation/) * @param thorClient - The thor client instance to use. * @param params - The transaction call object * @returns The return value of executed contract. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethCall: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_chainId implementation * * @link [eth_chainId](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - ThorClient instance. * @returns Returns the block id of the genesis block. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethChainId: (thorClient: ThorClient) => Promise; declare const getCachedChainId: (thorClient: ThorClient) => Promise; declare const getCachedChainTag: (thorClient: ThorClient) => Promise; /** * RPC Method eth_estimateGas implementation * * @link [eth_estimateGas](https://ethereum.github.io/execution-apis/api-documentation/) * * @note At the moment only the `to`, `value` and `data` fields are supported. * * @param thorClient - ThorClient instance. * @param params - The standard array of rpc call parameters. * * params[0]: The transaction call object. * * params[1]: A string representing a block number, or one of the string tags latest, earliest, or pending. * @returns A hexadecimal number representing the estimation of the gas for a given transaction. * @throws {JSONRPCInvalidParams, JSONRPCInternalError, JSONRPCTransactionRevertError} */ declare const ethEstimateGas: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_feeHistory implementation for Galactica hardfork * * @link [eth_feeHistory](https://ethereum.github.io/execution-apis/api-documentation/) * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: blockCount - number of blocks in the requested range * * params[1]: newestBlock - highest block of the requested range * * params[2]: rewardPercentiles - optional array of percentiles to compute * @param provider - The provider instance to use. * @returns Fee history for the returned block range * @throws {JSONRPCInvalidParams} | {JSONRPCInternalError} | {JSONRPCMethodNotImplemented} */ declare const ethFeeHistory: (thorClient: ThorClient, params: unknown[], _provider?: VeChainProvider) => Promise; /** * RPC Method eth_gasPrice implementation * @link [ethGasPrice](https://ethereum.github.io/execution-apis/api-documentation/) * @returns The current gas price in Wei unit considering that 1 VTHO equals 1e18 Wei. */ declare const ethGasPrice: (thorClient: ThorClient) => Promise; /** * RPC Method eth_getBalance implementation * * @link [eth_getBalance](https://ethereum.github.io/execution-apis/api-documentation/) * * @note Only 'latest' and 'finalized' block numbers are supported. * * @param thorClient - ThorClient instance. * @param params - The standard array of rpc call parameters. * * params[0]: The address to get the balance for as a hex string. * * params[1]: The block number to get the balance at as a hex string or "latest". * @returns the balance of the account at the given address formatted to the RPC standard. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetBalance: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getBlockByHash implementation * * @link [eth_getBlockByHash](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The block hash of block to get. * * params[1]: The transaction hydrated detail flag. If true, the block will contain the transaction details, otherwise it will only contain the transaction hashes. * @returns the block at the given block hash formatted to the RPC standard or null if the block does not exist. * @note Ethereum block hash is passed to Thor as the block id. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetBlockByHash: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getBlockByNumber implementation * * @link [eth_getBlockByNumber](https://ethereum.github.io/execution-apis/api-documentation/) * * @note * * Standard RPC method `eth_getBlockByNumber` support following block numbers: hex number of block, 'earliest', 'latest', 'safe', 'finalized', 'pending'. (@see https://ethereum.org/en/developers/docs/apis/json-rpc#default-block) * * Currently, VeChainonly supports hex number of block, 'latest' and 'finalized'. * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The block number to get as a hex string or "latest" or "finalized". * * params[1]: The transaction detail flag. If true, the block will contain the transaction details, otherwise it will only contain the transaction hashes. * @returns the block at the given block number formatted to the RPC standard or null if the block does not exist. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetBlockByNumber: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getBlockReceipts implementation * * @link [eth_getBlockReceipts](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * @note: * * params[0]: blockNumber - The block number to get the receipts for as a hex string or "latest". * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetBlockReceipts: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getBlockTransactionCountByHash implementation * * @link [eth_getBlockTransactionCountByHash](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The block hash of block to get. * @returns The number of transactions in the block with the given block hash. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetBlockTransactionCountByHash: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getBlockTransactionCountByNumber implementation * * @link [eth_getBlockTransactionCountByNumber](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The block hash of block to get. * @returns The number of transactions in the block with the given block hash. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetBlockTransactionCountByNumber: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getCode implementation * * @link [eth_getCode](https://ethereum.github.io/execution-apis/api-documentation/) * * @note Only 'latest' and 'finalized' block numbers are supported. * * @param thorClient - ThorClient instance. * @param params - The standard array of rpc call parameters. * * params[0]: The address to get the code for as a hex string. * * params[1]: The block number to get the code at as a hex string or "latest". * @returns The code of the account at the given address formatted to the RPC standard. * @throws {JSONRPCInternalError} */ declare const ethGetCode: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getFilterChanges implementation * * @link [eth_getFilterChanges](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * @note: * * params[0]: ... * * params[1]: ... * * params[n]: ... */ declare const ethGetFilterChanges: () => Promise<"METHOD NOT IMPLEMENTED">; /** * RPC Method eth_getFilterLogs implementation * * @link [eth_getFilterLogs](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * @note: * * params[0]: ... * * params[1]: ... * * params[n]: ... */ declare const ethGetFilterLogs: () => Promise<"METHOD NOT IMPLEMENTED">; /** * RPC Method eth_getLogs implementation * * @link [eth_getLogs](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * @returns An array of log objects, or an empty array if nothing has changed since last poll * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetLogs: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getStorageAt implementation * * @link [eth_getStorageAt](https://ethereum.github.io/execution-apis/api-documentation/) * * @note Only 'latest' and 'finalized' block numbers are supported. * * @param thorClient - ThorClient instance. * @param params - The standard array of rpc call parameters. * * params[0]: The address to get the storage slot for as a hex string. * * params[1]: The storage position to get as a hex string. * * params[2]: The block number to get the storage slot at as a hex string or "latest". * @returns The storage slot of the account at the given address formatted to the RPC standard. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetStorageAt: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getTransactionByBlockHashAndIndex implementation * * @link [eth_getTransactionByBlockHashAndIndex](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * @note: * * params[0]: ... * * params[1]: ... * * params[n]: ... */ declare const ethGetTransactionByBlockHashAndIndex: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getTransactionByBlockNumberAndIndex implementation * * @link [eth_getTransactionByBlockNumberAndIndex](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * @note: * * params[0]: block parameter, a hexadecimal block number (or best, latest, finalized). * * params[1]: transaction index position, a hexadecimal of the integer representing the position in the block. * @returns A transaction object, or null when no transaction was found. */ declare const ethGetTransactionByBlockNumberAndIndex: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getTransactionByHash implementation * * @link [eth_getTransactionByHash](https://docs.infura.io/networks/ethereum/json-rpc-methods/eth_gettransactionbyhash) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The transaction hash to get as a hex string. * @returns the transaction at the given hash formatted to the RPC standard or null if the transaction does not exist. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetTransactionByHash: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getTransactionCount implementation * * @link [eth_getTransactionCount](https://ethereum.github.io/execution-apis/api-documentation/) * * @note: To respect differences between VeChain and Ethereum, in this function we will give a random number as output. * Basically Ethereum to get nonce to use the number of transactions sent from an address, * while VeChain uses a random number. * * @param params - The standard array of rpc call parameters. * * params[0]: address: string, is the address to get the number of transactions from. * * params[1]: A string representing a block number, or one of the string tags latest, earliest, or pending. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethGetTransactionCount: (params: unknown[]) => Promise; /** * RPC Method eth_getTransactionReceipt implementation * * @link [eth_getTransactionReceipt](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * * @param params - The standard array of rpc call parameters. * * params[0]: The transaction hash to get as a hex string. * * @throws {ProviderRpcError} - Will throw an error if the retrieval of the transaction fails. */ declare const ethGetTransactionReceipt: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_getUncleByBlockHashAndIndex implementation * * @link [eth_getUncleByBlockHashAndIndex](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/eth_getunclebyblockhashandindex) * * @note * * Standard RPC method `eth_getUncleByBlockHashAndIndex` support following block numbers: hex number of block, 'earliest', 'latest', 'safe', 'finalized', 'pending'. (@see https://ethereum.org/en/developers/docs/apis/json-rpc#default-block) * * Currently, VeChain only supports hex number of block, 'latest' and 'finalized'. * * We return a constant empty object for now. * * @param params - The standard array of rpc call parameters. * * params[0]: The block hash to get as a hex string. * * params[1]: A hexadecimal equivalent of the integer indicating the uncle's index position. * @returns The uncle block at the given block number and index. * @throws {JSONRPCInvalidParams} */ declare const ethGetUncleByBlockHashAndIndex: (params: unknown[]) => Promise; /** * RPC Method eth_getUncleByBlockNumberAndIndex implementation * * @link [eth_getUncleByBlockNumberAndIndex](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/eth_getunclebyblocknumberandindex) * * @note * * Standard RPC method `eth_getUncleByBlockNumberAndIndex` support following block numbers: hex number of block, 'earliest', 'latest', 'safe', 'finalized', 'pending'. (@see https://ethereum.org/en/developers/docs/apis/json-rpc#default-block) * * Currently, VeChain only supports hex number of block, 'latest' and 'finalized'. * * We return a constant empty object for now. * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The block number to get as a hex string or "latest" or "finalized". * * params[1]: A hexadecimal equivalent of the integer indicating the uncle's index position. * @returns The uncle block at the given block number and index. * @throws {JSONRPCInvalidParams} */ declare const ethGetUncleByBlockNumberAndIndex: (params: unknown[]) => Promise; /** * RPC Method eth_getUncleCountByBlockHash implementation * * @param params - The standard array of rpc call parameters. * * params[0]: The block hash to get as a hex string. */ declare const ethGetUncleCountByBlockHash: (params: unknown[]) => Promise; /** * RPC Method eth_getUncleCountByBlockNumber implementation * * @param params - The standard array of rpc call parameters. * * params[0]: The block number to get as a hex string or "latest" or "finalized". */ declare const ethGetUncleCountByBlockNumber: (params: unknown[]) => Promise; /** * RPC Method eth_maxPriorityFeePerGas implementation for Galactica hardfork * Returns the suggested priority fee per gas in wei. * This is calculated based on the current base fee and network conditions. * * @link [eth_maxPriorityFeePerGas](https://ethereum.github.io/execution-apis/api-documentation/) * @param thorClient - The thor client instance to use. * @param _params - The standard array of rpc call parameters. * @param _provider - The provider instance to use. * @returns Suggested priority fee per gas in wei (hex string) * @throws {JSONRPCInternalError} | {JSONRPCMethodNotImplemented} */ declare const ethMaxPriorityFeePerGas: (thorClient: ThorClient, _params: unknown[], _provider?: VeChainProvider) => Promise; /** * RPC Method eth_requestAccounts implementation * * @param provider - Provider with ProviderInternalWallet instance to use. * @throws {JSONRPCInvalidParams} */ declare const ethRequestAccounts: (provider?: VeChainProvider) => Promise; /** * RPC Method eth_sendRawTransaction implementation * * @link [eth_sendrawtransaction](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The signed transaction data as a hex string. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethSendRawTransaction: (thorClient: ThorClient, params: unknown[]) => Promise; /** * RPC Method eth_sendTransaction implementation * * @link [eth_sendTransaction](https://ethereum.github.io/execution-apis/api-documentation/) * * @NOTE: If 'to' address is not provided. * It will be assumed that the transaction is a contract creation transaction. * The 'data' field of the transaction will be used as the contract initialization code. * * @NOTE: 'gasPrice' cannot be used together with 'maxPriorityFeePerGas' and 'maxFeePerGas'. * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: transaction - object - This describes the transaction info with following properties: * * to: 20 bytes - Address the transaction is directed to. * * from: 20 bytes [Required] - Address the transaction is sent from. * * gas: Hexadecimal value of the gas provided for the transaction execution as hex string. * * gasPrice: Hexadecimal value of the gasPrice used for each paid gas. * * value: Hexadecimal of the value sent with this transaction. * * data: Hash of the method signature and encoded parameters. * * maxPriorityFeePerGas: Maximum fee per gas the sender is willing to pay to miners in wei. Used in 1559 transactions. * * maxFeePerGas: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei. Used in 1559 transactions. * @param provider - The provider instance to use. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethSendTransaction: (thorClient: ThorClient, params: unknown[], provider?: VeChainProvider) => Promise; /** * Transaction object input type */ interface BaseTransactionObjectInput { gas?: string; gasPrice?: string; value?: string; data?: string; } /** * Transaction object input type */ interface TransactionObjectInput extends BaseTransactionObjectInput { from: string; to?: string; chainId?: string; } /** * RPC Method eth_signTransaction implementation * * @link [eth_signTransaction](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: transaction - object - This describes the transaction info with following properties: * * to: 20 bytes - Address the transaction is directed to. * * from: 20 bytes [Required] - Address the transaction is sent from. * * gas: Hexadecimal value of the gas provided for the transaction execution as hex string. * * gasPrice: Hexadecimal value of the gasPrice used for each paid gas. * * value: Hexadecimal of the value sent with this transaction. * * data: Hash of the method signature and encoded parameters. * * nonce: The nonce of the transaction. * @param provider - The provider instance to use. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethSignTransaction: (thorClient: ThorClient, params: unknown[], provider?: VeChainProvider) => Promise; /** * RPC Method eth_signTypedDataV4 implementation * * @link [eth_signTypedDataV4](https://docs.metamask.io/wallet/reference/eth_signtypeddata_v4/) * * @param thorClient - The thor client instance to use. * @param params - The standard array of rpc call parameters. * * params[0]: The hex encoded address of the account to sign the typed message. * * params[1] An object or a JSON string containing: * * types - An array of EIP712Domain object. It is an array specifying one or more (name, version, chainId, verifyingContract) tuples. * * domain - Contains the domain separator values specified in the EIP712Domain type. * * primaryType: A string specifying the name of the primary type for the message. * * message: An object containing the data to sign. * @param provider - The provider instance to use. * @throws {JSONRPCInvalidParams, JSONRPCInternalError} */ declare const ethSignTypedDataV4: (thorClient: ThorClient, params: unknown[], provider?: VeChainProvider) => Promise; /** * Enumerates the types of subscriptions supported by the`eth_subscribe` RPC method. */ declare enum SUBSCRIPTION_TYPE { /** * Subscription type for receiving notifications about new blocks added to the blockchain. */ NEW_HEADS = "newHeads", /** * Subscription type for receiving log entries that match specific filter criteria, * allowing clients to listen for specific events emitted by smart contracts. */ LOGS = "logs" } /** * Defines the parameter types accepted by the `eth_subscribe` RPC method. */ type ethSubscribeParams = [SUBSCRIPTION_TYPE, string | string[]] | unknown[]; /** * Initiates a subscription to the blockchain events based on the specified parameters. * This function supports subscriptions to new block headers ('newHeads') and log entries ('logs') * that match given filter criteria. It ensures that the provided parameters are valid and that * the provider is available before setting up the subscription and generating a unique subscription ID. * * @link [eth_subscribe](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/subscription-methods/eth_subscribe) * * @param thorClient - An instance of `ThorClient` used to interact with the blockchain, such as * retrieving the current best block when setting up a new subscription. * @param params - Parameters for the subscription, conforming to `ethSubscribeParams`. The first * element of the array specifies the type of subscription, and the second element * (if present) provides additional options, such as filter criteria for log subscriptions. * @param provider - An optional `VeChainProvider` instance that contains the subscription manager. * The subscription manager is used to store and manage active subscriptions. * If the provider is not provided or is undefined, the function throws an error. * * @returns A `Promise` that resolves to a string representing the unique ID of the created subscription. * @throws {JSONRPCInternalError, JSONRPCInvalidParams, JSONRPCServerError} */ declare const ethSubscribe: (thorClient: ThorClient, params: ethSubscribeParams, provider?: VeChainProvider) => Promise; /** * RPC Method eth_syncing implementation * * @link [eth_syncing](https://ethereum.github.io/execution-apis/api-documentation/) * * @param thorClient - The thor client instance to use. * * @note The startingBlock parameter is not supported. * * @returns Returns an object with the sync status of the node if the node is out-of-sync and is syncing. Returns false when the node is already in sync. */ declare const ethSyncing: (thorClient: ThorClient) => Promise; /** * Asynchronously unsubscribes from a VeChain event subscription. * This function attempts to unsubscribe from either 'newHeads' or log subscriptions * based on the provided `subscriptionId`. If the provider is not available or the * `subscriptionId` does not match any active subscriptions, it may throw an error * or return `false`, respectively. * * @link [eth_unsubscribe](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/subscription-methods/eth_unsubscribe) * * @param params - An array containing the subscription ID as its first element. * The subscription ID is used to identify and unsubscribe from the corresponding * Ethereum event subscription. * @param provider - An optional `VeChainProvider` instance that contains the * subscription manager. This manager holds the active subscriptions and is used * to unsubscribe from them. If the provider is not provided or is undefined, * the function throws an error indicating that the provider is not available. * @returns A `Promise` that resolves to `true` if the unsubscription was successful, * or `false` if the specified subscription ID does not match any active subscriptions. * @throws {JSONRPCInternalError} */ declare const ethUnsubscribe: (params: unknown[], provider?: VeChainProvider) => Promise; /** * RPC Method evm_mine implementation * * @link [evm_mine](https://hardhat.org/hardhat-network/docs/explanation/mining-modes) * * @param thorClient - The thor client instance to use. * @returns The new block or null if the block is not available. * @throws {JSONRPCInternalError} */ declare const evmMine: (thorClient: ThorClient) => Promise; /** * RPC Method net_listening implementation * * @link [net_listening](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/net_listening) * * @param thorClient - The thor client instance to use. */ declare const netListening: (thorClient: ThorClient) => Promise; /** * RPC Method net_peerCount implementation * * @link [net_peerCount](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/net_peercount) * * @param thorClient - The thor client instance to use. */ declare const netPeerCount: (thorClient: ThorClient) => Promise; /** * RPC Method net_version implementation * * @link [net_version](https://docs.infura.io/networks/ethereum/json-rpc-methods/net_version) * * @param thorClient - ThorClient instance. * * @returns The net version (equivalent to chain id in our case). */ declare const netVersion: (thorClient: ThorClient) => Promise; /** * RPC Method txpool_content implementation * * @link [txpool_content](https://www.quicknode.com/docs/ethereum/txpool_content) * * @note * * We return a constant empty object for now. * * @returns The transaction pool status */ declare const txPoolContent: () => Promise; /** * RPC Method txpool_contentFrom implementation * * @link [txpool_contentFrom](https://www.quicknode.com/docs/ethereum/txpool_contentFrom) * * @note * * We return a constant empty object for now. * * @param params - The standard array of rpc call parameters. * params[0]: The address to get the transaction pool status from * @returns The transaction pool status */ declare const txPoolContentFrom: (params: unknown[]) => Promise; /** * RPC Method txpool_inspect implementation * * @link [txpool_inspect](https://www.quicknode.com/docs/ethereum/txpool_inspect) * * @note * * We return a constant empty object for now. * * @returns The transaction pool status */ declare const txPoolInspect: () => Promise; /** * RPC Method txpool_status implementation * * @link [txpool_status](https://www.quicknode.com/docs/ethereum/txpool_status) * * @note * * We return a constant empty object for now. * * @returns The transaction pool status */ declare const txPoolStatus: () => Promise; /** * RPC Method web3_clientVersion implementation * * @link [web3_clientVersion](https://docs.infura.io/networks/ethereum/json-rpc-methods/web3_clientversion) * * @returns A string representing the current client version. */ declare const web3ClientVersion: () => Promise; /** * RPC Method web3_sha3 implementation * * @link [web3_sha3](https://docs.alchemy.com/reference/web3-sha3) * @param params - The standard array of rpc call parameters. * * params[0]: The data to hash. * @returns A string representing the current client version. */ declare const web3Sha3: (params: unknown[]) => Promise; type MethodHandlerType = (params: TParams[]) => Promise; /** * Map of RPC methods to their implementations with the SDK. * We can consider this as an "RPC Mapper" for the SDK. * * List of all RPC methods: * * https://eth.wiki/json-rpc/API * * https://ethereum.github.io/execution-apis/api-documentation/ * * @param thorClient - ThorClient instance. * @param provider - Provider instance. It is optional because the majority of the methods do not require a provider. */ declare const RPCMethodsMap: (thorClient: ThorClient, provider?: VeChainProvider) => Record>; /** * Get the index of the transaction in the specified block. * * @param block - The block to search in. * @param hash - The hash of the transaction to search for. * @returns the index of the transaction in the block or null if the transaction is not in the block. * @throws {InvalidDataType} */ declare const getTransactionIndexIntoBlock: (block: BlocksRPC, hash: string) => number; /** * Get the number of logs ahead of a transaction into a block. * * @param blockExpanded - The block to search in. * @param transactionId - The hash of the transaction to search for. * @param chainId - The chain ID of the network. */ declare const getNumberOfLogsAheadOfTransactionIntoBlockExpanded: (blockExpanded: ExpandedBlockDetail, transactionId: string, chainId: string) => number; type network_AccountData = AccountData; type network_AccountDetail = AccountDetail; declare const network_AccountDetail: typeof AccountDetail; type network_AccountInputOptions = AccountInputOptions; type network_AccountsModule = AccountsModule; declare const network_AccountsModule: typeof AccountsModule; type network_AvailableVeChainProviders = AvailableVeChainProviders; declare const network_BUILT_IN_CONTRACTS: typeof BUILT_IN_CONTRACTS; type network_BigramNameConfig = BigramNameConfig; type network_BigramNameReturnType = BigramNameReturnType; type network_BlockDetail = BlockDetail; type network_BlockHeaderRPC = BlockHeaderRPC; type network_BlockSubscriptionOptions = BlockSubscriptionOptions; type network_BlocksModule = BlocksModule; declare const network_BlocksModule: typeof BlocksModule; type network_BlocksModuleOptions = BlocksModuleOptions; type network_BlocksRPC = BlocksRPC; type network_BuildHardhatErrorFunction = BuildHardhatErrorFunction; declare const network_CHAIN_ID: typeof CHAIN_ID; declare const network_CHAIN_TAG: typeof CHAIN_TAG; type network_CallNameConfig = CallNameConfig; type network_CallNameReturnType = CallNameReturnType; type network_CallTracerRPC = CallTracerRPC; type network_CompressedBlockDetail = CompressedBlockDetail; type network_ConnectedPeer = ConnectedPeer; type network_Contract = Contract; declare const network_Contract: typeof Contract; type network_ContractCallOptions = ContractCallOptions; type network_ContractCallResult = ContractCallResult; type network_ContractFactory = ContractFactory; declare const network_ContractFactory: typeof ContractFactory; type network_ContractFunctionAsync = ContractFunctionAsync; type network_ContractTraceOptions = ContractTraceOptions; type network_ContractTraceTarget = ContractTraceTarget; type network_ContractTransactionOptions = ContractTransactionOptions; type network_ContractsModule = ContractsModule; declare const network_ContractsModule: typeof ContractsModule; type network_DebugModule = DebugModule; declare const network_DebugModule: typeof DebugModule; type network_DefaultBlock = DefaultBlock; declare const network_DefaultBlockToRevision: typeof DefaultBlockToRevision; type network_DefaultNameConfig = DefaultNameConfig; type network_DefaultNameReturnType = DefaultNameReturnType; declare const network_DelegationHandler: typeof DelegationHandler; type network_EIP1193ProviderMessage = EIP1193ProviderMessage; type network_EIP1193RequestArguments = EIP1193RequestArguments; declare const network_ERROR_SELECTOR: typeof ERROR_SELECTOR; type network_EVMDisNameConfig = EVMDisNameConfig; type network_EVMDisNameReturnType = EVMDisNameReturnType; type network_EstimateGasOptions = EstimateGasOptions; type network_EstimateGasResult = EstimateGasResult; type network_Event = Event; type network_EventCriteria = EventCriteria; type network_EventDisplayOrder = EventDisplayOrder; type network_EventLike = EventLike; type network_EventLogs = EventLogs; type network_EventOptions = EventOptions; type network_EventPoll = EventPoll; declare const network_EventPoll: typeof EventPoll; type network_EventSubscriptionOptions = EventSubscriptionOptions; type network_ExpandedBlockDetail = ExpandedBlockDetail; type network_FeeHistoryOptions = FeeHistoryOptions; type network_FeeHistoryResponse = FeeHistoryResponse; type network_FeesPriorityResponse = FeesPriorityResponse; type network_FilterCriteria = FilterCriteria; type network_FilterEventLogsOptions = FilterEventLogsOptions; type network_FilterOptions = FilterOptions; type network_FilterRawEventLogsOptions = FilterRawEventLogsOptions; type network_FilterTransferLogsOptions = FilterTransferLogsOptions; type network_ForkDetector = ForkDetector; declare const network_ForkDetector: typeof ForkDetector; type network_FourByteNameConfig = FourByteNameConfig; type network_FourByteNameReturnType = FourByteNameReturnType; type network_GasModule = GasModule; declare const network_GasModule: typeof GasModule; type network_GetDelegationSignatureResult = GetDelegationSignatureResult; type network_GetTransactionInputOptions = GetTransactionInputOptions; type network_GetTransactionReceiptInputOptions = GetTransactionReceiptInputOptions; declare const network_HTTPS_REGEX: typeof HTTPS_REGEX; declare const network_HTTP_REGEX: typeof HTTP_REGEX; type network_HardhatVeChainProvider = HardhatVeChainProvider; declare const network_HardhatVeChainProvider: typeof HardhatVeChainProvider; type network_HttpClient = HttpClient; type network_HttpMethod = HttpMethod; declare const network_HttpMethod: typeof HttpMethod; type network_HttpParams = HttpParams; type network_JSONRPCEthersProvider = JSONRPCEthersProvider; declare const network_JSONRPCEthersProvider: typeof JSONRPCEthersProvider; type network_JsonRpcRequest = JsonRpcRequest; type network_JsonRpcResponse = JsonRpcResponse; type network_LogsModule = LogsModule; declare const network_LogsModule: typeof LogsModule; type network_LogsRPC = LogsRPC; declare const network_MAINNET_URL: typeof MAINNET_URL; declare const network_NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS: typeof NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS; type network_NodesModule = NodesModule; declare const network_NodesModule: typeof NodesModule; type network_NoopNameConfig = NoopNameConfig; type network_NoopNameReturnType = NoopNameReturnType; type network_OPCountNameConfig = OPCountNameConfig; type network_OPCountNameReturnType = OPCountNameReturnType; type network_Output = Output; declare const network_PANIC_SELECTOR: typeof PANIC_SELECTOR; declare const network_POLLING_INTERVAL: typeof POLLING_INTERVAL; type network_PaginationOptions = PaginationOptions; declare const network_Poll: typeof Poll; type network_PreStateNameConfig = PreStateNameConfig; type network_PreStateNameReturnType = PreStateNameReturnType; type network_PrestateTracerRPC = PrestateTracerRPC; type network_ProviderInternalBaseWallet = ProviderInternalBaseWallet; declare const network_ProviderInternalBaseWallet: typeof ProviderInternalBaseWallet; type network_ProviderInternalHDWallet = ProviderInternalHDWallet; declare const network_ProviderInternalHDWallet: typeof ProviderInternalHDWallet; type network_ProviderInternalWallet = ProviderInternalWallet; type network_ProviderInternalWalletAccount = ProviderInternalWalletAccount; declare const network_RPCMethodsMap: typeof RPCMethodsMap; declare const network_RPC_DOCUMENTATION_URL: typeof RPC_DOCUMENTATION_URL; type network_RPC_METHODS = RPC_METHODS; declare const network_RPC_METHODS: typeof RPC_METHODS; type network_Range = Range; type network_RetrieveStorageRange = RetrieveStorageRange; type network_RetrieveStorageRangeOptions = RetrieveStorageRangeOptions; type network_SendTransactionResult = SendTransactionResult; type network_SignTransactionOptions = SignTransactionOptions; type network_SignTypedDataOptions = SignTypedDataOptions; type network_SimpleHttpClient = SimpleHttpClient; declare const network_SimpleHttpClient: typeof SimpleHttpClient; type network_SimulateTransactionClause = SimulateTransactionClause; type network_SimulateTransactionOptions = SimulateTransactionOptions; type network_SubscriptionEvent = SubscriptionEvent; type network_SubscriptionManager = SubscriptionManager; type network_SyncBlockRPC = SyncBlockRPC; type network_SyncPollInputOptions = SyncPollInputOptions; declare const network_TESTNET_URL: typeof TESTNET_URL; declare const network_THOR_SOLO_URL: typeof THOR_SOLO_URL; type network_ThorClient = ThorClient; declare const network_ThorClient: typeof ThorClient; type network_TraceLogData = TraceLogData; type network_TraceOptionsRPC = TraceOptionsRPC; type network_TraceReturnType = TraceReturnType; type network_TracerConfig = TracerConfig; type network_TracerName = TracerName; type network_TracerNameRPC = TracerNameRPC; type network_TracerReturnTypeRPC = TracerReturnTypeRPC; type network_TransactionBodyOptions = TransactionBodyOptions; type network_TransactionDetailNoRaw = TransactionDetailNoRaw; type network_TransactionDetailRaw = TransactionDetailRaw; type network_TransactionObjectInput = TransactionObjectInput; type network_TransactionRPC = TransactionRPC; type network_TransactionReceipt = TransactionReceipt; type network_TransactionReceiptLogsRPC = TransactionReceiptLogsRPC; type network_TransactionReceiptRPC = TransactionReceiptRPC; type network_TransactionRequestInput = TransactionRequestInput; type network_TransactionSimulationEvent = TransactionSimulationEvent; type network_TransactionSimulationResult = TransactionSimulationResult; type network_TransactionTraceTarget = TransactionTraceTarget; type network_TransactionsExpandedBlockDetail = TransactionsExpandedBlockDetail; type network_TransactionsModule = TransactionsModule; declare const network_TransactionsModule: typeof TransactionsModule; type network_Transfer = Transfer; type network_TransferLogs = TransferLogs; type network_TrigramNameConfig = TrigramNameConfig; type network_TrigramNameReturnType = TrigramNameReturnType; type network_TypedDataDomain = TypedDataDomain; type network_TypedDataParameter = TypedDataParameter; type network_UnigramNameConfig = UnigramNameConfig; type network_UnigramNameReturnType = UnigramNameReturnType; type network_VETtransfersSubscriptionOptions = VETtransfersSubscriptionOptions; type network_VeChainAbstractSigner = VeChainAbstractSigner; declare const network_VeChainAbstractSigner: typeof VeChainAbstractSigner; type network_VeChainPrivateKeySigner = VeChainPrivateKeySigner; declare const network_VeChainPrivateKeySigner: typeof VeChainPrivateKeySigner; type network_VeChainProvider = VeChainProvider; declare const network_VeChainProvider: typeof VeChainProvider; type network_VeChainSigner = VeChainSigner; type network_VetTransferOptions = VetTransferOptions; type network_WaitForBlockOptions = WaitForBlockOptions; type network_WaitForTransactionOptions = WaitForTransactionOptions; declare const network_blocksFormatter: typeof blocksFormatter; declare const network_buildQuery: typeof buildQuery; declare const network_chainTagToChainId: typeof chainTagToChainId; declare const network_debugFormatter: typeof debugFormatter; declare const network_debugTraceBlockByHash: typeof debugTraceBlockByHash; declare const network_debugTraceBlockByNumber: typeof debugTraceBlockByNumber; declare const network_debugTraceCall: typeof debugTraceCall; declare const network_debugTraceTransaction: typeof debugTraceTransaction; declare const network_engineGetPayloadBodiesByHashV1: typeof engineGetPayloadBodiesByHashV1; declare const network_engineGetPayloadBodiesByRangeV1: typeof engineGetPayloadBodiesByRangeV1; declare const network_ethAccounts: typeof ethAccounts; declare const network_ethBlockNumber: typeof ethBlockNumber; declare const network_ethCall: typeof ethCall; declare const network_ethChainId: typeof ethChainId; declare const network_ethEstimateGas: typeof ethEstimateGas; declare const network_ethFeeHistory: typeof ethFeeHistory; declare const network_ethGasPrice: typeof ethGasPrice; declare const network_ethGetBalance: typeof ethGetBalance; declare const network_ethGetBlockByHash: typeof ethGetBlockByHash; declare const network_ethGetBlockByNumber: typeof ethGetBlockByNumber; declare const network_ethGetBlockReceipts: typeof ethGetBlockReceipts; declare const network_ethGetBlockTransactionCountByHash: typeof ethGetBlockTransactionCountByHash; declare const network_ethGetBlockTransactionCountByNumber: typeof ethGetBlockTransactionCountByNumber; declare const network_ethGetCode: typeof ethGetCode; declare const network_ethGetFilterChanges: typeof ethGetFilterChanges; declare const network_ethGetFilterLogs: typeof ethGetFilterLogs; declare const network_ethGetLogs: typeof ethGetLogs; declare const network_ethGetStorageAt: typeof ethGetStorageAt; declare const network_ethGetTransactionByBlockHashAndIndex: typeof ethGetTransactionByBlockHashAndIndex; declare const network_ethGetTransactionByBlockNumberAndIndex: typeof ethGetTransactionByBlockNumberAndIndex; declare const network_ethGetTransactionByHash: typeof ethGetTransactionByHash; declare const network_ethGetTransactionCount: typeof ethGetTransactionCount; declare const network_ethGetTransactionReceipt: typeof ethGetTransactionReceipt; declare const network_ethGetUncleByBlockHashAndIndex: typeof ethGetUncleByBlockHashAndIndex; declare const network_ethGetUncleByBlockNumberAndIndex: typeof ethGetUncleByBlockNumberAndIndex; declare const network_ethGetUncleCountByBlockHash: typeof ethGetUncleCountByBlockHash; declare const network_ethGetUncleCountByBlockNumber: typeof ethGetUncleCountByBlockNumber; declare const network_ethMaxPriorityFeePerGas: typeof ethMaxPriorityFeePerGas; declare const network_ethRequestAccounts: typeof ethRequestAccounts; declare const network_ethSendRawTransaction: typeof ethSendRawTransaction; declare const network_ethSendTransaction: typeof ethSendTransaction; declare const network_ethSignTransaction: typeof ethSignTransaction; declare const network_ethSignTypedDataV4: typeof ethSignTypedDataV4; declare const network_ethSubscribe: typeof ethSubscribe; declare const network_ethSyncing: typeof ethSyncing; declare const network_ethUnsubscribe: typeof ethUnsubscribe; declare const network_evmMine: typeof evmMine; declare const network_formatToLogsRPC: typeof formatToLogsRPC; declare const network_formatToRPCStandard: typeof formatToRPCStandard; declare const network_getCachedChainId: typeof getCachedChainId; declare const network_getCachedChainTag: typeof getCachedChainTag; declare const network_getCriteriaSetForInput: typeof getCriteriaSetForInput; declare const network_getNumberOfLogsAheadOfTransactionIntoBlockExpanded: typeof getNumberOfLogsAheadOfTransactionIntoBlockExpanded; declare const network_getTransactionIndexIntoBlock: typeof getTransactionIndexIntoBlock; declare const network_isTraceEnabled: typeof isTraceEnabled; declare const network_logError: typeof logError; declare const network_logRequest: typeof logRequest; declare const network_logResponse: typeof logResponse; declare const network_netListening: typeof netListening; declare const network_netPeerCount: typeof netPeerCount; declare const network_netVersion: typeof netVersion; declare const network_sanitizeWebsocketBaseURL: typeof sanitizeWebsocketBaseURL; declare const network_signerUtils: typeof signerUtils; declare const network_subscriptions: typeof subscriptions; declare const network_thorest: typeof thorest; declare const network_toQueryString: typeof toQueryString; declare const network_transactionsFormatter: typeof transactionsFormatter; declare const network_txPoolContent: typeof txPoolContent; declare const network_txPoolContentFrom: typeof txPoolContentFrom; declare const network_txPoolInspect: typeof txPoolInspect; declare const network_txPoolStatus: typeof txPoolStatus; declare const network_vnsUtils: typeof vnsUtils; declare const network_web3ClientVersion: typeof web3ClientVersion; declare const network_web3Sha3: typeof web3Sha3; declare namespace network { export { type network_AccountData as AccountData, network_AccountDetail as AccountDetail, type network_AccountInputOptions as AccountInputOptions, network_AccountsModule as AccountsModule, type network_AvailableVeChainProviders as AvailableVeChainProviders, network_BUILT_IN_CONTRACTS as BUILT_IN_CONTRACTS, type network_BigramNameConfig as BigramNameConfig, type network_BigramNameReturnType as BigramNameReturnType, type network_BlockDetail as BlockDetail, type network_BlockHeaderRPC as BlockHeaderRPC, type network_BlockSubscriptionOptions as BlockSubscriptionOptions, network_BlocksModule as BlocksModule, type network_BlocksModuleOptions as BlocksModuleOptions, type network_BlocksRPC as BlocksRPC, type network_BuildHardhatErrorFunction as BuildHardhatErrorFunction, network_CHAIN_ID as CHAIN_ID, network_CHAIN_TAG as CHAIN_TAG, type network_CallNameConfig as CallNameConfig, type network_CallNameReturnType as CallNameReturnType, type network_CallTracerRPC as CallTracerRPC, type network_CompressedBlockDetail as CompressedBlockDetail, type network_ConnectedPeer as ConnectedPeer, network_Contract as Contract, type network_ContractCallOptions as ContractCallOptions, type network_ContractCallResult as ContractCallResult, network_ContractFactory as ContractFactory, type network_ContractFunctionAsync as ContractFunctionAsync, type network_ContractTraceOptions as ContractTraceOptions, type network_ContractTraceTarget as ContractTraceTarget, type network_ContractTransactionOptions as ContractTransactionOptions, network_ContractsModule as ContractsModule, network_DebugModule as DebugModule, type network_DefaultBlock as DefaultBlock, network_DefaultBlockToRevision as DefaultBlockToRevision, type network_DefaultNameConfig as DefaultNameConfig, type network_DefaultNameReturnType as DefaultNameReturnType, network_DelegationHandler as DelegationHandler, type network_EIP1193ProviderMessage as EIP1193ProviderMessage, type network_EIP1193RequestArguments as EIP1193RequestArguments, network_ERROR_SELECTOR as ERROR_SELECTOR, type network_EVMDisNameConfig as EVMDisNameConfig, type network_EVMDisNameReturnType as EVMDisNameReturnType, type network_EstimateGasOptions as EstimateGasOptions, type network_EstimateGasResult as EstimateGasResult, type network_Event as Event, type network_EventCriteria as EventCriteria, type network_EventDisplayOrder as EventDisplayOrder, type network_EventLike as EventLike, type network_EventLogs as EventLogs, type network_EventOptions as EventOptions, network_EventPoll as EventPoll, type network_EventSubscriptionOptions as EventSubscriptionOptions, type network_ExpandedBlockDetail as ExpandedBlockDetail, type network_FeeHistoryOptions as FeeHistoryOptions, type network_FeeHistoryResponse as FeeHistoryResponse, type network_FeesPriorityResponse as FeesPriorityResponse, type network_FilterCriteria as FilterCriteria, type network_FilterEventLogsOptions as FilterEventLogsOptions, type network_FilterOptions as FilterOptions, type network_FilterRawEventLogsOptions as FilterRawEventLogsOptions, type network_FilterTransferLogsOptions as FilterTransferLogsOptions, network_ForkDetector as ForkDetector, type network_FourByteNameConfig as FourByteNameConfig, type network_FourByteNameReturnType as FourByteNameReturnType, network_GasModule as GasModule, type network_GetDelegationSignatureResult as GetDelegationSignatureResult, type network_GetTransactionInputOptions as GetTransactionInputOptions, type network_GetTransactionReceiptInputOptions as GetTransactionReceiptInputOptions, network_HTTPS_REGEX as HTTPS_REGEX, network_HTTP_REGEX as HTTP_REGEX, network_HardhatVeChainProvider as HardhatVeChainProvider, type network_HttpClient as HttpClient, network_HttpMethod as HttpMethod, type network_HttpParams as HttpParams, network_JSONRPCEthersProvider as JSONRPCEthersProvider, type network_JsonRpcRequest as JsonRpcRequest, type network_JsonRpcResponse as JsonRpcResponse, network_LogsModule as LogsModule, type network_LogsRPC as LogsRPC, network_MAINNET_URL as MAINNET_URL, network_NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS as NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS, network_NodesModule as NodesModule, type network_NoopNameConfig as NoopNameConfig, type network_NoopNameReturnType as NoopNameReturnType, type network_OPCountNameConfig as OPCountNameConfig, type network_OPCountNameReturnType as OPCountNameReturnType, type network_Output as Output, network_PANIC_SELECTOR as PANIC_SELECTOR, network_POLLING_INTERVAL as POLLING_INTERVAL, type network_PaginationOptions as PaginationOptions, network_Poll as Poll, type network_PreStateNameConfig as PreStateNameConfig, type network_PreStateNameReturnType as PreStateNameReturnType, type network_PrestateTracerRPC as PrestateTracerRPC, network_ProviderInternalBaseWallet as ProviderInternalBaseWallet, network_ProviderInternalHDWallet as ProviderInternalHDWallet, type network_ProviderInternalWallet as ProviderInternalWallet, type network_ProviderInternalWalletAccount as ProviderInternalWalletAccount, network_RPCMethodsMap as RPCMethodsMap, network_RPC_DOCUMENTATION_URL as RPC_DOCUMENTATION_URL, network_RPC_METHODS as RPC_METHODS, type network_Range as Range, type network_RetrieveStorageRange as RetrieveStorageRange, type network_RetrieveStorageRangeOptions as RetrieveStorageRangeOptions, type network_SendTransactionResult as SendTransactionResult, type network_SignTransactionOptions as SignTransactionOptions, type network_SignTypedDataOptions as SignTypedDataOptions, network_SimpleHttpClient as SimpleHttpClient, type network_SimulateTransactionClause as SimulateTransactionClause, type network_SimulateTransactionOptions as SimulateTransactionOptions, type network_SubscriptionEvent as SubscriptionEvent, type network_SubscriptionManager as SubscriptionManager, type network_SyncBlockRPC as SyncBlockRPC, type network_SyncPollInputOptions as SyncPollInputOptions, network_TESTNET_URL as TESTNET_URL, network_THOR_SOLO_URL as THOR_SOLO_URL, network_ThorClient as ThorClient, type network_TraceLogData as TraceLogData, type network_TraceOptionsRPC as TraceOptionsRPC, type network_TraceReturnType as TraceReturnType, type network_TracerConfig as TracerConfig, type network_TracerName as TracerName, type network_TracerNameRPC as TracerNameRPC, type network_TracerReturnTypeRPC as TracerReturnTypeRPC, type network_TransactionBodyOptions as TransactionBodyOptions, type network_TransactionDetailNoRaw as TransactionDetailNoRaw, type network_TransactionDetailRaw as TransactionDetailRaw, type network_TransactionObjectInput as TransactionObjectInput, type network_TransactionRPC as TransactionRPC, type network_TransactionReceipt as TransactionReceipt, type network_TransactionReceiptLogsRPC as TransactionReceiptLogsRPC, type network_TransactionReceiptRPC as TransactionReceiptRPC, type network_TransactionRequestInput as TransactionRequestInput, type network_TransactionSimulationEvent as TransactionSimulationEvent, type network_TransactionSimulationResult as TransactionSimulationResult, type network_TransactionTraceTarget as TransactionTraceTarget, type network_TransactionsExpandedBlockDetail as TransactionsExpandedBlockDetail, network_TransactionsModule as TransactionsModule, type network_Transfer as Transfer, type network_TransferLogs as TransferLogs, type network_TrigramNameConfig as TrigramNameConfig, type network_TrigramNameReturnType as TrigramNameReturnType, type network_TypedDataDomain as TypedDataDomain, type network_TypedDataParameter as TypedDataParameter, type network_UnigramNameConfig as UnigramNameConfig, type network_UnigramNameReturnType as UnigramNameReturnType, type network_VETtransfersSubscriptionOptions as VETtransfersSubscriptionOptions, network_VeChainAbstractSigner as VeChainAbstractSigner, network_VeChainPrivateKeySigner as VeChainPrivateKeySigner, network_VeChainProvider as VeChainProvider, type network_VeChainSigner as VeChainSigner, type network_VetTransferOptions as VetTransferOptions, type network_WaitForBlockOptions as WaitForBlockOptions, type network_WaitForTransactionOptions as WaitForTransactionOptions, network_blocksFormatter as blocksFormatter, network_buildQuery as buildQuery, network_chainTagToChainId as chainTagToChainId, network_debugFormatter as debugFormatter, network_debugTraceBlockByHash as debugTraceBlockByHash, network_debugTraceBlockByNumber as debugTraceBlockByNumber, network_debugTraceCall as debugTraceCall, network_debugTraceTransaction as debugTraceTransaction, network_engineGetPayloadBodiesByHashV1 as engineGetPayloadBodiesByHashV1, network_engineGetPayloadBodiesByRangeV1 as engineGetPayloadBodiesByRangeV1, network_ethAccounts as ethAccounts, network_ethBlockNumber as ethBlockNumber, network_ethCall as ethCall, network_ethChainId as ethChainId, network_ethEstimateGas as ethEstimateGas, network_ethFeeHistory as ethFeeHistory, network_ethGasPrice as ethGasPrice, network_ethGetBalance as ethGetBalance, network_ethGetBlockByHash as ethGetBlockByHash, network_ethGetBlockByNumber as ethGetBlockByNumber, network_ethGetBlockReceipts as ethGetBlockReceipts, network_ethGetBlockTransactionCountByHash as ethGetBlockTransactionCountByHash, network_ethGetBlockTransactionCountByNumber as ethGetBlockTransactionCountByNumber, network_ethGetCode as ethGetCode, network_ethGetFilterChanges as ethGetFilterChanges, network_ethGetFilterLogs as ethGetFilterLogs, network_ethGetLogs as ethGetLogs, network_ethGetStorageAt as ethGetStorageAt, network_ethGetTransactionByBlockHashAndIndex as ethGetTransactionByBlockHashAndIndex, network_ethGetTransactionByBlockNumberAndIndex as ethGetTransactionByBlockNumberAndIndex, network_ethGetTransactionByHash as ethGetTransactionByHash, network_ethGetTransactionCount as ethGetTransactionCount, network_ethGetTransactionReceipt as ethGetTransactionReceipt, network_ethGetUncleByBlockHashAndIndex as ethGetUncleByBlockHashAndIndex, network_ethGetUncleByBlockNumberAndIndex as ethGetUncleByBlockNumberAndIndex, network_ethGetUncleCountByBlockHash as ethGetUncleCountByBlockHash, network_ethGetUncleCountByBlockNumber as ethGetUncleCountByBlockNumber, network_ethMaxPriorityFeePerGas as ethMaxPriorityFeePerGas, network_ethRequestAccounts as ethRequestAccounts, network_ethSendRawTransaction as ethSendRawTransaction, network_ethSendTransaction as ethSendTransaction, network_ethSignTransaction as ethSignTransaction, network_ethSignTypedDataV4 as ethSignTypedDataV4, network_ethSubscribe as ethSubscribe, network_ethSyncing as ethSyncing, network_ethUnsubscribe as ethUnsubscribe, network_evmMine as evmMine, network_formatToLogsRPC as formatToLogsRPC, network_formatToRPCStandard as formatToRPCStandard, network_getCachedChainId as getCachedChainId, network_getCachedChainTag as getCachedChainTag, network_getCriteriaSetForInput as getCriteriaSetForInput, network_getNumberOfLogsAheadOfTransactionIntoBlockExpanded as getNumberOfLogsAheadOfTransactionIntoBlockExpanded, network_getTransactionIndexIntoBlock as getTransactionIndexIntoBlock, network_isTraceEnabled as isTraceEnabled, network_logError as logError, network_logRequest as logRequest, network_logResponse as logResponse, network_netListening as netListening, network_netPeerCount as netPeerCount, network_netVersion as netVersion, network_sanitizeWebsocketBaseURL as sanitizeWebsocketBaseURL, network_signerUtils as signerUtils, network_subscriptions as subscriptions, network_thorest as thorest, network_toQueryString as toQueryString, network_transactionsFormatter as transactionsFormatter, network_txPoolContent as txPoolContent, network_txPoolContentFrom as txPoolContentFrom, network_txPoolInspect as txPoolInspect, network_txPoolStatus as txPoolStatus, network_vnsUtils as vnsUtils, network_web3ClientVersion as web3ClientVersion, network_web3Sha3 as web3Sha3 }; } export { type AccountData, AccountDetail, type AccountInputOptions, AccountsModule, type AvailableVeChainProviders, BUILT_IN_CONTRACTS, type BigramNameConfig, type BigramNameReturnType, type BlockDetail, type BlockHeaderRPC, type BlockSubscriptionOptions, BlocksModule, type BlocksModuleOptions, type BlocksRPC, type BuildHardhatErrorFunction, CHAIN_ID, CHAIN_TAG, type CallNameConfig, type CallNameReturnType, type CallTracerRPC, type CompressedBlockDetail, type ConnectedPeer, Contract, type ContractCallOptions, type ContractCallResult, ContractFactory, type ContractFunctionAsync, type ContractTraceOptions, type ContractTraceTarget, type ContractTransactionOptions, ContractsModule, DebugModule, type DefaultBlock, DefaultBlockToRevision, type DefaultNameConfig, type DefaultNameReturnType, DelegationHandler, type EIP1193ProviderMessage, type EIP1193RequestArguments, ERROR_SELECTOR, type EVMDisNameConfig, type EVMDisNameReturnType, type EstimateGasOptions, type EstimateGasResult, type Event, type EventCriteria, type EventDisplayOrder, type EventLike, type EventLogs, type EventOptions, EventPoll, type EventSubscriptionOptions, type ExpandedBlockDetail, type FeeHistoryOptions, type FeeHistoryResponse, type FeesPriorityResponse, type FilterCriteria, type FilterEventLogsOptions, type FilterOptions, type FilterRawEventLogsOptions, type FilterTransferLogsOptions, ForkDetector, type FourByteNameConfig, type FourByteNameReturnType, GasModule, type GetDelegationSignatureResult, type GetTransactionInputOptions, type GetTransactionReceiptInputOptions, HTTPS_REGEX, HTTP_REGEX, HardhatVeChainProvider, type HttpClient, HttpMethod, type HttpParams, JSONRPCEthersProvider, type JsonRpcRequest, type JsonRpcResponse, LogsModule, type LogsRPC, MAINNET_URL, NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS, NodesModule, type NoopNameConfig, type NoopNameReturnType, type OPCountNameConfig, type OPCountNameReturnType, type Output, PANIC_SELECTOR, POLLING_INTERVAL, type PaginationOptions, Poll, type PreStateNameConfig, type PreStateNameReturnType, type PrestateTracerRPC, ProviderInternalBaseWallet, ProviderInternalHDWallet, type ProviderInternalWallet, type ProviderInternalWalletAccount, RPCMethodsMap, RPC_DOCUMENTATION_URL, RPC_METHODS, type Range, type RetrieveStorageRange, type RetrieveStorageRangeOptions, type SendTransactionResult, type SignTransactionOptions, type SignTypedDataOptions, SimpleHttpClient, type SimulateTransactionClause, type SimulateTransactionOptions, type SubscriptionEvent, type SubscriptionManager, type SyncBlockRPC, type SyncPollInputOptions, TESTNET_URL, THOR_SOLO_URL, ThorClient, type TraceLogData, type TraceOptionsRPC, type TraceReturnType, type TracerConfig, type TracerName, type TracerNameRPC, type TracerReturnTypeRPC, type TransactionBodyOptions, type TransactionDetailNoRaw, type TransactionDetailRaw, type TransactionObjectInput, type TransactionRPC, type TransactionReceipt, type TransactionReceiptLogsRPC, type TransactionReceiptRPC, type TransactionRequestInput, type TransactionSimulationEvent, type TransactionSimulationResult, type TransactionTraceTarget, type TransactionsExpandedBlockDetail, TransactionsModule, type Transfer, type TransferLogs, type TrigramNameConfig, type TrigramNameReturnType, type TypedDataDomain, type TypedDataParameter, type UnigramNameConfig, type UnigramNameReturnType, type VETtransfersSubscriptionOptions, VeChainAbstractSigner, VeChainPrivateKeySigner, VeChainProvider, type VeChainSigner, type VetTransferOptions, type WaitForBlockOptions, type WaitForTransactionOptions, blocksFormatter, buildQuery, chainTagToChainId, debugFormatter, debugTraceBlockByHash, debugTraceBlockByNumber, debugTraceCall, debugTraceTransaction, engineGetPayloadBodiesByHashV1, engineGetPayloadBodiesByRangeV1, ethAccounts, ethBlockNumber, ethCall, ethChainId, ethEstimateGas, ethFeeHistory, ethGasPrice, ethGetBalance, ethGetBlockByHash, ethGetBlockByNumber, ethGetBlockReceipts, ethGetBlockTransactionCountByHash, ethGetBlockTransactionCountByNumber, ethGetCode, ethGetFilterChanges, ethGetFilterLogs, ethGetLogs, ethGetStorageAt, ethGetTransactionByBlockHashAndIndex, ethGetTransactionByBlockNumberAndIndex, ethGetTransactionByHash, ethGetTransactionCount, ethGetTransactionReceipt, ethGetUncleByBlockHashAndIndex, ethGetUncleByBlockNumberAndIndex, ethGetUncleCountByBlockHash, ethGetUncleCountByBlockNumber, ethMaxPriorityFeePerGas, ethRequestAccounts, ethSendRawTransaction, ethSendTransaction, ethSignTransaction, ethSignTypedDataV4, ethSubscribe, ethSyncing, ethUnsubscribe, evmMine, formatToLogsRPC, formatToRPCStandard, getCachedChainId, getCachedChainTag, getCriteriaSetForInput, getNumberOfLogsAheadOfTransactionIntoBlockExpanded, getTransactionIndexIntoBlock, isTraceEnabled, logError, logRequest, logResponse, netListening, netPeerCount, netVersion, network, sanitizeWebsocketBaseURL, signerUtils, subscriptions, thorest, toQueryString, transactionsFormatter, txPoolContent, txPoolContentFrom, txPoolInspect, txPoolStatus, vnsUtils, web3ClientVersion, web3Sha3 };