{"version":3,"sources":["../src/network.ts","../src/http/HttpMethod.ts","../src/http/trace-logger.ts","../src/http/SimpleHttpClient.ts","../src/signer/signers/utils/utils.ts","../src/signer/signers/utils/index.ts","../src/provider/utils/const/rpc-mapper/rpc-methods.ts","../src/thor-client/accounts/AccountDetail.ts","../src/utils/const/built-in/built-in.ts","../src/utils/const/client/http-client.ts","../src/utils/const/client/nodes.ts","../src/utils/const/client/transactions.ts","../src/utils/const/network/network.ts","../src/utils/const/rpc/rpc.ts","../src/utils/helpers/request.ts","../src/utils/poll/sync.ts","../src/utils/poll/event.ts","../src/utils/poll/index.ts","../src/utils/thorest/helpers.ts","../src/utils/thorest/thorest.ts","../src/utils/subscriptions/beat.ts","../src/utils/subscriptions/block.ts","../src/utils/subscriptions/event.ts","../src/utils/subscriptions/transaction.ts","../src/utils/subscriptions/transfer.ts","../src/utils/subscriptions/index.ts","../src/utils/vns/addresses.ts","../src/utils/vns/index.ts","../src/thor-client/accounts/AccountsModule.ts","../src/thor-client/blocks/blocks-module.ts","../src/thor-client/contracts/model/contract-filter.ts","../src/thor-client/contracts/model/contract-proxy.ts","../src/thor-client/contracts/model/contract.ts","../src/thor-client/contracts/model/contract-factory.ts","../src/thor-client/contracts/contracts-module.ts","../src/thor-client/debug/DebugModule.ts","../src/thor-client/gas/gas-module.ts","../src/thor-client/logs/logs-module.ts","../src/thor-client/nodes/nodes-module.ts","../src/thor-client/gas/helpers/const.ts","../src/thor-client/gas/helpers/decode-evm-error.ts","../src/thor-client/transactions/transactions-module.ts","../src/thor-client/transactions/helpers/delegation-handler.ts","../src/thor-client/fork/forkDetector.ts","../src/thor-client/ThorClient.ts","../src/signer/signers/vechain-abstract-signer/vechain-abstract-signer.ts","../src/signer/signers/vechain-private-key-signer/vechain-private-key-signer.ts","../src/provider/helpers/provider-internal-wallets/abstract-wallet/abstract-provider-internal-wallet.ts","../src/provider/helpers/provider-internal-wallets/base-wallet/provider-internal-base-wallet.ts","../src/provider/helpers/provider-internal-wallets/hd-wallet/provider-internal-hd-wallet.ts","../src/provider/providers/ethers-provider/json-rpc-ethers-provider.ts","../src/provider/utils/const/providers/const.ts","../src/provider/utils/const/blocks/blocks.ts","../src/provider/utils/const/chain-id/chain-id.ts","../src/provider/utils/helpers/transaction/transaction-helpers.ts","../src/provider/utils/formatter/transactions/formatter.ts","../src/provider/utils/formatter/transactions/index.ts","../src/provider/utils/formatter/blocks/formatter.ts","../src/provider/utils/formatter/blocks/index.ts","../src/provider/utils/formatter/debug/formatter.ts","../src/provider/utils/formatter/debug/index.ts","../src/provider/utils/formatter/logs/formatter.ts","../src/provider/utils/rpc-mapper/methods/eth_chainId/eth_chainId.ts","../src/provider/utils/rpc-mapper/methods/eth_getTransactionReceipt/eth_getTransactionReceipt.ts","../src/provider/utils/rpc-mapper/methods/debug_traceTransaction/debug_traceTransaction.ts","../src/provider/utils/rpc-mapper/methods/eth_getBlockByHash/eth_getBlockByHash.ts","../src/provider/utils/rpc-mapper/methods/debug_traceBlockByHash/debug_traceBlockByHash.ts","../src/provider/utils/rpc-mapper/methods/eth_getBlockByNumber/eth_getBlockByNumber.ts","../src/provider/utils/rpc-mapper/methods/debug_traceBlockByNumber/debug_traceBlockByNumber.ts","../src/provider/utils/rpc-mapper/methods/debug_traceCall/debug_traceCall.ts","../src/provider/utils/rpc-mapper/methods/engine_getPayloadBodiesByHashV1/engine_getPayloadBodiesByHashV1.ts","../src/provider/utils/rpc-mapper/methods/engine_getPayloadBodiesByRangeV1/engine_getPayloadBodiesByRangeV1.ts","../src/provider/utils/rpc-mapper/methods/eth_accounts/eth_accounts.ts","../src/provider/utils/rpc-mapper/methods/eth_blockNumber/eth_blockNumber.ts","../src/provider/utils/rpc-mapper/methods/eth_call/eth_call.ts","../src/provider/utils/rpc-mapper/methods/eth_estimateGas/eth_estimateGas.ts","../src/provider/utils/rpc-mapper/methods/eth_feeHistory/eth_feeHistory.ts","../src/provider/utils/rpc-mapper/methods/eth_gasPrice/eth_gasPrice.ts","../src/provider/utils/rpc-mapper/methods/eth_getBalance/eth_getBalance.ts","../src/provider/utils/rpc-mapper/methods/eth_getBlockReceipts/eth_getBlockReceipts.ts","../src/provider/utils/rpc-mapper/methods/eth_getBlockTransactionCountByHash/eth_getBlockTransactionCountByHash.ts","../src/provider/utils/rpc-mapper/methods/eth_getBlockTransactionCountByNumber/eth_getBlockTransactionCountByNumber.ts","../src/provider/utils/rpc-mapper/methods/eth_getCode/eth_getCode.ts","../src/provider/utils/rpc-mapper/methods/eth_getFilterChanges/eth_getFilterChanges.ts","../src/provider/utils/rpc-mapper/methods/eth_getFilterLogs/eth_getFilterLogs.ts","../src/provider/utils/rpc-mapper/methods/eth_getLogs/eth_getLogs.ts","../src/provider/utils/rpc-mapper/methods/eth_getStorageAt/eth_getStorageAt.ts","../src/provider/utils/rpc-mapper/methods/eth_getTransactionByHash/eth_getTransactionByHash.ts","../src/provider/utils/rpc-mapper/methods/eth_getTransactionByBlockHashAndIndex/eth_getTransactionByBlockHashAndIndex.ts","../src/provider/utils/rpc-mapper/methods/eth_getTransactionByBlockNumberAndIndex/eth_getTransactionByBlockNumberAndIndex.ts","../src/provider/utils/rpc-mapper/methods/eth_getTransactionCount/eth_getTransactionCount.ts","../src/provider/utils/rpc-mapper/methods/eth_getUncleByBlockHashAndIndex/eth_getUncleByBlockHashAndIndex.ts","../src/provider/utils/rpc-mapper/methods/eth_getUncleByBlockNumberAndIndex/eth_getUncleByBlockNumberAndIndex.ts","../src/provider/utils/rpc-mapper/methods/eth_getUncleCountByBlockHash/eth_getUncleCountByBlockHash.ts","../src/provider/utils/rpc-mapper/methods/eth_getUncleCountByBlockNumber/eth_getUncleCountByBlockNumber.ts","../src/provider/utils/rpc-mapper/methods/eth_maxPriorityFeePerGas/eth_maxPriorityFeePerGas.ts","../src/provider/utils/rpc-mapper/methods/eth_requestAccounts/eth_requestAccounts.ts","../src/provider/utils/rpc-mapper/methods/eth_sendRawTransaction/eth_sendRawTransaction.ts","../src/provider/utils/rpc-mapper/methods/eth_sendTransaction/eth_sendTransaction.ts","../src/provider/utils/rpc-mapper/methods/eth_signTransaction/eth_signTransaction.ts","../src/provider/utils/rpc-mapper/methods/eth_signTypedData_v4/eth_signTypedData_v4.ts","../src/provider/utils/rpc-mapper/methods/eth_subscribe/eth_subscribe.ts","../src/provider/utils/rpc-mapper/methods/eth_syncing/eth_syncing.ts","../src/provider/utils/rpc-mapper/methods/eth_unsubscribe/eth_unsubscribe.ts","../src/provider/utils/rpc-mapper/methods/evm_mine/evm_mine.ts","../src/provider/utils/rpc-mapper/methods/net_listening/net_listening.ts","../src/provider/utils/rpc-mapper/methods/net_peerCount/net_peerCount.ts","../src/provider/utils/rpc-mapper/methods/net_version/net_version.ts","../src/provider/utils/rpc-mapper/methods/txpool_content/txpool_content.ts","../src/provider/utils/rpc-mapper/methods/txpool_contentFrom/txpool_contentFrom.ts","../src/provider/utils/rpc-mapper/methods/txpool_inspect/txpool_inspect.ts","../src/provider/utils/rpc-mapper/methods/txpool_status/txpool_status.ts","../src/provider/utils/rpc-mapper/methods/web3_clientVersion/web3_clientVersion.ts","../src/provider/utils/rpc-mapper/methods/web3_sha3/web3_sha3.ts","../src/provider/utils/rpc-mapper/rpc-mapper.ts","../src/provider/providers/vechain-provider/vechain-provider.ts","../src/provider/providers/hardhat-provider/hardhat-provider.ts"],"names":["network_exports","__export","AccountDetail","AccountsModule","BUILT_IN_CONTRACTS","BlocksModule","CHAIN_ID","CHAIN_TAG","Contract","ContractFactory","ContractsModule","DebugModule","DefaultBlockToRevision","DelegationHandler","ERROR_SELECTOR","ForkDetector","GasModule","HTTPS_REGEX","HTTP_REGEX","HardhatVeChainProvider","HttpMethod","JSONRPCEthersProvider","LogsModule","MAINNET_URL","NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS","NodesModule","PANIC_SELECTOR","POLLING_INTERVAL","Poll","ProviderInternalBaseWallet","ProviderInternalHDWallet","RPCMethodsMap","RPC_DOCUMENTATION_URL","RPC_METHODS","SimpleHttpClient","TESTNET_URL","THOR_SOLO_URL","ThorClient","TransactionsModule","VeChainAbstractSigner","VeChainPrivateKeySigner","VeChainProvider","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","sanitizeWebsocketBaseURL","signerUtils","subscriptions","thorest","toQueryString","transactionsFormatter","txPoolContent","txPoolContentFrom","txPoolInspect","txPoolStatus","vnsUtils","web3ClientVersion","web3Sha3","value","method","url","headers","body","timestamp","data","key","startTimestamp","responseHeaders","responseBody","endTimestamp","duration","error","_SimpleHttpClient","baseURL","timeout","path","params","controller","timeoutId","requestStartTime","headerObj","response","responseBodyText","errorMessage","trimmedBody","jsonData","errorObj","errorCode","errorMsg","errorData","firstLine","field","message","urlString","HttpNetworkError","InvalidHTTPRequest","fallbackUrl","InvalidHTTPParams","transactionBodyToTransactionRequestInput","transactionBody","from","VET","Units","FixedPointNumber","VTHO","accountData","PARAMS_ADDRESS","ENERGY_ADDRESS","PARAMS_ABI","ENERGY_ABI","Keccak256","Txt","definedParams","MAX_SAFE_ITERATIONS","sleep","delayInMilliseconds","resolve","SyncPoll","pollingFunction","options","InvalidDataType","currentIteration","currentResult","pollingCondition","startTime","condition","consecutiveNetworkErrors","maxConsecutiveNetworkErrors","isConditionSatisfied","PollExecution","isMaximumIterationsReached","isTimeLimitReached","EventPoll","EventEmitter","requestIntervalInMilliseconds","hasToStopOnError","onDataCallback","onErrorCallback","onStartCallback","onStopCallback","createEventPoll","callBack","queryParts","urlRegex","address","position","revision","id","queryParams","blockCount","newestBlock","rewardPercentiles","getLegacyBeatSubscriptionUrl","getBeatSubscriptionUrl","getBlockSubscriptionUrl","getEventSubscriptionUrl","event","indexedValues","encodedTopics","ABIEvent","getNewTransactionsSubscriptionUrl","getVETtransfersSubscriptionUrl","NetworkContracts","MAINNET_NETWORK","TESTNET_NETWORK","SOLO_NETWORK","resolveName","thorClient","name","resolveNames","blocksModule","transactionsModule","names","genesisBlock","Address","resolveUtilsAddress","callGetAddresses","ABIItem","ABIFunction","addresses","ZERO_ADDRESS","lookupAddress","lookupAddresses","callGetNames","httpClient","result","HexUInt","pos","Revision","bestBlock","blockNumber","expanded","block","transaction","clause","output","transfer","ContractFilter","contract","criteriaSet","param","filterEventLogsOptions","getReadProxy","_target","prop","args","extractOptionsResult","extractAndRemoveAdditionalOptions","clauseAdditionalOptions","functionAbi","callOptions","executeCallResult","ContractCallError","getTransactProxy","InvalidTransactionField","transactionOptions","extractAdditionalOptionsResult","transactionValue","clauseComment","getFilterProxy","buildCriteria","getClauseProxy","Clause","getCriteriaProxy","eventAbi","topics","topic","index","getTransactionValue","getClauseComment","clauseRevision","getRevision","arg","isTransactionValue","isTransactionComment","isRevision","found","obj","abi","contractsModule","signer","transactionReceipt","ABIContract","eventName","bytecode","deployParams","deployContractClause","gasResult","txBody","signedTx","Transaction","CannotFindTransaction","ContractDeploymentFailed","contractAddress","functionData","contractCallOptions","clauses","input","parsedTarget","target","functionName","caller","feeHistory","filterOptions","eventAbis","c","eventLogs","uniqueEventAbis","log","InvalidAbiItem","Hex","f","filterRawEventLogsOptions","chainTagCache","lastBlockTimestamp","secondsSinceLastBlock","cached","chainTag","SOLIDITY_ERROR_SELECTOR","SOLIDITY_PANIC_SELECTOR","decodeRevertReason","ABI","decoded","debugModule","logsModule","gasModule","forkDetector","ThorId","raw","transactionResult","rawTx","txID","timeoutMs","intervalMs","deadline","receipt","gas","blockRef","filledOptions","processedClauses","extractedOptions","hasMaxFeePerGas","hasMaxPriorityFeePerGas","hasGasPriceCoef","galacticaHappened","biNextBlockBaseFeePerGas","defaultMaxPriorityFeePerGas","biMaxPriorityFeePerGas","biMaxFeePerGas","baseFee","percentile75","latestBlockRewards","sum","count","blockRewards","baseFeeCap","priorityFee","uniqueNames","map","nameList","gasPrice","gasPayer","expiration","provedWork","encodedRevertReason","errorFragment","Interface","ErrorFragment","transactionHash","transactionIndex","transactionClauseIndex","debuggedClause","clausesToEstimate","simulations","isReverted","simulation","intrinsicGas","totalSimulatedGas","totalGas","res","dataUtils","encodedData","reverted","encodedResult","plain","array","_getDelegationSignature","tx","gasPayerServiceUrl","originAddress","sponsorRequestBody","NotDelegatedTransaction","gasPayerIsUndefined","isDelegatedWithUrl","isDelegatedWithPrivateKey","galacticaForkCache","NEGATIVE_CACHE_TTL","galacticaForkDetected","revisionKey","cachedResult","now","_ThorClient","networkUrl","provider","transactionToPopulate","JSONRPCInvalidParams","populatedTransaction","totalGasResult","transactionToEstimate","transactionToEvaluate","blockTag","payload","payloadHashed","concatBytes","SignerMethodError","types","parents","type","primaryTypes","n","domain","primaryType","viemDomain","hashTypedData","vnsName","_VeChainPrivateKeySigner","privateKey","Secp256k1","InvalidSecp256k1PrivateKey","transactionToSign","transactionToSend","signedTransaction","sign","unsignedTransactionBody","originPrivateKey","gasPayerOptions","unsignedTx","gasPayerSignature","originSignature","signature","AbstractProviderInternalWallet","accounts","parentProvider","addressOrIndex","signerAccount","account","mnemonic","initialIndex","derivationPath","HDKey","privateKeyBuffer","JsonRpcApiProvider","chainId","networkName","hardhatProvider","requestPayloadArray","responses","jsonRpcPayload","e","stringifyData","defaultBlockTags","defaultBlock","defaultBlockValue","JSONRPCInvalidDefaultBlock","hash","idx","blockExpanded","transactionId","logIndex","currentTransaction","mapVeChainTypeToEthereumType","vechainType","fromTransactionType","TransactionType","_formatTransactionToRPC","blockHash","txIndex","txType","Quantity","formatExpandedBlockToRPCStandard","formatTransactionReceiptToRPCStandard","blockContainsTransaction","logIndexOffset","logs","ZERO_BYTES","transactions","tracerName","debugDetails","valueWithoutEnergy","eventLog","HexInt","_scatterArrayTopic","criteriaTopicsArray","criteria","criteriaAddress","addr","getTopicsPerAddress","notArrayTopics","arrayTopics","cachedChainId","cachedChainTag","cachedGenesisBlockId","JSONRPCInternalError","transactionDetail","traceOptions","tracerToUse","trace","isTxDetail","traces","tracerOptions","VeChainSDKLogger","latestBlock","inputOptions","simulatedTx","JSONRPCTransactionRevertError","estimatedGas","revertReason","reason","revertData","_provider","JSONRPCMethodNotImplemented","blockCountNum","baseFeePerGas","maxPriorityFeePerGas","priority","blockIdentifier","transactionsIntoTheBlock","transactionReceipts","MAX_LIMIT","storagePosition","_params","signedTransactionData","typedData","parsed","isObject","hasFields","JSONRPCServerError","subscriptionId","_isBlockNotOutOfSyncInTime","highestBlockNumber","head","wallet","enableDelegation","JSONRPCMethodNotFound","methodsMap","currentBlock","subscriptionEvents","promises","subscriptionDetails","walletToUse","nodeUrl","buildHardhatErrorFunctionCallback","debug","rpcConfiguration","callback","mustReturn0","VechainSDKError"],"mappings":"4hCAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA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iBzQ,CAAAA,CAAK,MAAM,CAAA,OAAA,CAAA,CACnC,QAAA,CAAU,CAAC,CAAA,QAAA,EAAWsN,aAAAA,CAAc1O,CAAM,CAAC,CAAA,CAAE,CACjD,CAAC,CAAA,CAGEA,CACX,CAAA,MAASlH,CAAAA,CAAO,CAeZ,GAbI,IAAA,CAAK,KAAA,EACL+Y,gBAAAA,CAAiB,OAAO,CAAA,CAAE,GAAA,CACtB,IAAIR,oBAAAA,CACAjQ,CAAAA,CAAK,MAAA,CACL,CAAA,mBAAA,EAAsBA,CAAAA,CAAK,MAAM,CAAA,CAAA,CACjC,CACI,IAAA,CAAAA,CACJ,CACJ,CACJ,CAAA,CAIAtI,CAAAA,YAAiBmZ,6BAAAA,CACjB,MAAMnZ,CAAAA,CAGV,GAAIA,CAAAA,YAAiB6b,eAAAA,CACjB,MAAM,IAAA,CAAK,iCAAA,CACP,CAAA,iBAAA,EAAoBvT,CAAAA,CAAK,MAAM,CAAA,EAAA,EAAKtI,CAAAA,CAAM,UAAU,CAAA,CAAA,CACpDA,CACJ,CAER,CACJ,CACJ","file":"index.mjs","sourcesContent":["export * from './http';\nexport * from './provider';\nexport * from './signer';\nexport * from './thor-client';\nexport * from './utils';\n","/**\n * Enumeration for HTTP methods.\n *\n * @property {string} GET - The GET method requests a representation of the specified resource.\n * @property {string} POST - The POST method is used to submit data to be processed to a specified resource.\n */\nexport enum HttpMethod {\n    GET = 'GET',\n    POST = 'POST'\n}\n","/**\n * HTTP trace logger for detailed request/response logging\n *\n * This logger is only activated when the SDK_TRACE environment variable is set to 'true'\n * It helps developers debug the exact HTTP traffic between the SDK and Thor nodes\n */\n\n/**\n * Checks if trace logging is enabled via environment variable\n */\nexport const isTraceEnabled = (): boolean => {\n    const value = process?.env?.SDK_TRACE?.toLowerCase();\n    return value === 'true' || value === '1';\n};\n\n/**\n * Interface for HTTP trace log data\n */\nexport interface TraceLogData {\n    category: string;\n    method?: string;\n    url?: string;\n    requestHeaders?: Record<string, string>;\n    requestBody?: unknown;\n    responseHeaders?: Record<string, string>;\n    responseBody?: unknown;\n    timestamp: number;\n    duration?: number;\n    error?: unknown;\n}\n\n/**\n * Logs HTTP request details before sending\n */\nexport const logRequest = (\n    method: string,\n    url: string,\n    headers?: Record<string, string>,\n    body?: unknown\n): number => {\n    if (!isTraceEnabled()) {\n        return Date.now(); // Return timestamp for duration calculation but don't log\n    }\n\n    const timestamp = Date.now();\n    const data: TraceLogData = {\n        category: 'HTTP Request',\n        method,\n        url,\n        requestHeaders: headers,\n        requestBody: body,\n        timestamp\n    };\n\n    console.log(\n        `\\n⚡ [TRACE] HTTP Request (${new Date(timestamp).toISOString()})`\n    );\n    console.log(`➡️ ${JSON.stringify(data, null, 2)}`);\n\n    if (headers != null && Object.keys(headers).length > 0) {\n        console.log('📋 Headers:');\n        Object.entries(headers).forEach(([key, value]) => {\n            console.log(`   ${key}: ${value}`);\n        });\n    }\n\n    if (body !== undefined) {\n        console.log('📦 Body:');\n        try {\n            console.log(\n                typeof body === 'string' ? body : JSON.stringify(body, null, 2)\n            );\n        } catch {\n            console.log('[Complex body object]');\n        }\n    }\n\n    return timestamp;\n};\n\n/**\n * Logs HTTP response details after receiving\n */\nexport const logResponse = (\n    startTimestamp: number,\n    url: string,\n    responseHeaders?: Record<string, string>,\n    responseBody?: unknown\n): void => {\n    if (!isTraceEnabled()) {\n        return;\n    }\n\n    const endTimestamp = Date.now();\n    const duration = endTimestamp - startTimestamp;\n\n    const data: TraceLogData = {\n        category: 'HTTP Response',\n        url,\n        responseHeaders,\n        responseBody,\n        timestamp: endTimestamp,\n        duration\n    };\n\n    console.log(\n        `\\n⚡ [TRACE] HTTP Response (${new Date(endTimestamp).toISOString()})`\n    );\n    console.log(`➡️ ${JSON.stringify(data, null, 2)}`);\n    console.log(`⬅️ ${url} (${duration}ms)`);\n\n    if (responseHeaders != null && Object.keys(responseHeaders).length > 0) {\n        console.log('📋 Headers:');\n        Object.entries(responseHeaders).forEach(([key, value]) => {\n            console.log(`   ${key}: ${value}`);\n        });\n    }\n\n    if (responseBody !== null) {\n        console.log('📦 Body:');\n        try {\n            console.log(\n                typeof responseBody === 'string'\n                    ? responseBody\n                    : JSON.stringify(responseBody, null, 2)\n            );\n        } catch {\n            console.log('[Complex response body]');\n        }\n    }\n};\n\n/**\n * Logs HTTP error details\n */\nexport const logError = (\n    startTimestamp: number,\n    url: string,\n    method: string,\n    error: unknown\n): void => {\n    if (!isTraceEnabled()) {\n        return;\n    }\n\n    const endTimestamp = Date.now();\n    const duration = endTimestamp - startTimestamp;\n\n    const data: TraceLogData = {\n        category: 'HTTP Error',\n        method,\n        url,\n        error,\n        timestamp: endTimestamp,\n        duration\n    };\n\n    console.log(\n        `\\n⚡ [TRACE] HTTP Error (${new Date(endTimestamp).toISOString()})`\n    );\n    console.log(`➡️ ${JSON.stringify(data, null, 2)}`);\n    console.log(`❌ ${method} ${url} (${duration}ms)`);\n    console.log('⛔ Error:');\n\n    if (error !== null && error !== undefined && error instanceof Error) {\n        console.log(`   ${error.name}: ${error.message}`);\n\n        if (error.stack != null) {\n            console.log(`   Stack: ${error.stack}`);\n        }\n\n        if ('cause' in error && error.cause != null) {\n            console.log('   Cause:');\n            console.log(error.cause);\n        }\n    } else {\n        console.log(error);\n    }\n};\n","import { HttpMethod } from './HttpMethod';\nimport {\n    InvalidHTTPParams,\n    InvalidHTTPRequest,\n    HttpNetworkError\n} from '@vechain/sdk-errors';\nimport { type HttpClient } from './HttpClient';\nimport { type HttpParams } from './HttpParams';\nimport { logRequest, logResponse, logError } from './trace-logger';\n\n/**\n * This class implements the HttpClient interface using the Fetch API.\n *\n * The SimpleHttpClient allows making {@link HttpMethod} requests with timeout\n * and base URL configuration.\n */\nclass SimpleHttpClient implements HttpClient {\n    /**\n     * Represent the default timeout duration for network requests in milliseconds.\n     */\n    public static readonly DEFAULT_TIMEOUT = 10000;\n\n    /**\n     * Return the root URL for the API endpoints.\n     */\n    public readonly baseURL: string;\n\n    public readonly headers: HeadersInit;\n\n    /**\n     * Return the amount of time in milliseconds before a timeout occurs\n     * when requesting with HTTP methods.\n     */\n    public readonly timeout: number;\n\n    /**\n     * Constructs an instance of SimpleHttpClient with the given base URL,\n     * timeout period and HTTP headers.\n     * The HTTP headers are used each time this client send a request to the URL,\n     * if not overwritten by the {@link HttpParams} of the method sending the request.\n     *\n     * @param {string} baseURL - The base URL for HTTP requests.\n     * @param {HeadersInit} [headers=new Headers()] - The default headers for HTTP requests.\n     * @param {number} [timeout=SimpleHttpClient.DEFAULT_TIMEOUT] - The timeout duration in milliseconds.\n     */\n    constructor(\n        baseURL: string,\n        headers: HeadersInit = new Headers(),\n        timeout: number = SimpleHttpClient.DEFAULT_TIMEOUT\n    ) {\n        this.baseURL = baseURL;\n        this.timeout = timeout;\n        this.headers = headers;\n    }\n\n    /**\n     * Sends an HTTP GET request to the specified path with optional query parameters.\n     *\n     * @param {string} path - The endpoint path to which the HTTP GET request is sent.\n     * @param {HttpParams} [params] - Optional parameters for the request,\n     * including query parameters, headers, body, and response validation.\n     * {@link HttpParams.headers} override {@link SimpleHttpClient.headers}.\n     * @return {Promise<unknown>} A promise that resolves with the response of the GET request.\n     */\n    public async get(path: string, params?: HttpParams): Promise<unknown> {\n        return await this.http(HttpMethod.GET, path, params);\n    }\n\n    /**\n     * Determines if specified url is valid\n     * @param {string} url Url to check\n     * @returns {boolean} if value\n     */\n    private isValidUrl(url: string): boolean {\n        try {\n            new URL(url);\n            return true;\n        } catch {\n            return false;\n        }\n    }\n\n    /**\n     * Executes an HTTP request with the specified method, path, and optional parameters.\n     *\n     * @param {HttpMethod} method - The HTTP method to use for the request (e.g., GET, POST).\n     * @param {string} path - The URL path for the request. Leading slashes will be automatically removed.\n     * @param {HttpParams} [params] - Optional parameters for the request,\n     * including query parameters, headers, body, and response validation.\n     * {@link HttpParams.headers} override {@link SimpleHttpClient.headers}.\n     * @return {Promise<unknown>} A promise that resolves to the response of the HTTP request.\n     * @throws {InvalidHTTPRequest} Throws an error if the HTTP request fails.\n     */\n    public async http(\n        method: HttpMethod,\n        path: string,\n        params?: HttpParams\n    ): Promise<unknown> {\n        const controller = new AbortController();\n        const timeoutId = setTimeout(() => {\n            controller.abort();\n        }, this.timeout);\n\n        let url: URL | undefined;\n        let requestStartTime = Date.now(); // Initialize with current timestamp\n        let headerObj: Record<string, string> = {};\n\n        try {\n            // Remove leading slash from path\n            if (path.startsWith('/')) {\n                path = path.slice(1);\n            }\n            // Add trailing slash from baseURL if not present\n            let baseURL = this.baseURL;\n            if (!baseURL.endsWith('/')) {\n                baseURL += '/';\n            }\n            // Check if path is already a fully qualified URL\n            if (/^https?:\\/\\//.exec(path)) {\n                url = new URL(path);\n            } else {\n                url = new URL(path, baseURL);\n            }\n\n            if (params?.query && url !== undefined) {\n                Object.entries(params.query).forEach(([key, value]) => {\n                    (url as URL).searchParams.append(key, String(value));\n                });\n            }\n\n            if (\n                params?.query !== undefined &&\n                params?.query != null &&\n                url !== undefined\n            ) {\n                Object.entries(params.query).forEach(([key, value]) => {\n                    (url as URL).searchParams.append(key, String(value));\n                });\n            }\n\n            const headers = new Headers(this.headers);\n            if (params?.headers !== undefined && params?.headers != null) {\n                Object.entries(params.headers).forEach(([key, value]) => {\n                    headers.append(key, String(value));\n                });\n            }\n\n            // Convert Headers to plain object for logging\n            headerObj = Object.fromEntries(headers.entries());\n\n            // Log the request\n            requestStartTime = logRequest(\n                method,\n                url.toString(),\n                headerObj,\n                method !== HttpMethod.GET ? params?.body : undefined\n            );\n\n            // Send request\n            const response = await fetch(url.toString(), {\n                method,\n                headers,\n                body:\n                    method !== HttpMethod.GET\n                        ? params?.rawBody !== undefined\n                            ? (params.rawBody as BodyInit)\n                            : JSON.stringify(params?.body)\n                        : undefined,\n                signal: controller.signal\n            });\n\n            const responseHeaders = Object.fromEntries(\n                response.headers.entries()\n            );\n\n            if (response.ok) {\n                if (\n                    params?.validateResponseHeader != null &&\n                    responseHeaders != null\n                ) {\n                    params.validateResponseHeader(responseHeaders);\n                }\n\n                // Parse response body\n                // Using explicit type annotation to handle the 'any' returned by response.json()\n                const responseBody: unknown = await response.json();\n\n                // Log the successful response\n                logResponse(\n                    requestStartTime,\n                    url.toString(),\n                    responseHeaders,\n                    responseBody\n                );\n\n                // Return the responseBody as unknown rather than 'any'\n                return responseBody;\n            }\n\n            // Extract response body for error context\n            let responseBodyText: string | undefined;\n            try {\n                // Clone the response to avoid consuming it\n                const clonedResponse = response.clone();\n                responseBodyText = await clonedResponse.text();\n            } catch {\n                // If we can't read the response body, continue without it\n                responseBodyText = undefined;\n            }\n\n            // Create error message with response body if available\n            let errorMessage = `HTTP ${response.status} ${response.statusText}`;\n            if (responseBodyText?.trim()) {\n                const trimmedBody = responseBodyText.trim();\n\n                // Skip HTML responses\n                if (trimmedBody.includes('<!DOCTYPE html>')) {\n                    // Don't include HTML content\n                }\n                // Try to parse JSON and extract error code and message\n                else if (\n                    trimmedBody.startsWith('{') ||\n                    trimmedBody.startsWith('[')\n                ) {\n                    try {\n                        const jsonData = JSON.parse(trimmedBody) as Record<\n                            string,\n                            unknown\n                        >;\n                        if (\n                            jsonData.error &&\n                            typeof jsonData.error === 'object' &&\n                            jsonData.error !== null\n                        ) {\n                            const errorObj = jsonData.error as Record<\n                                string,\n                                unknown\n                            >;\n                            const errorCode = (errorObj.code as string) ?? '';\n                            const errorMsg =\n                                (errorObj.message as string) ??\n                                (errorObj.msg as string) ??\n                                '';\n\n                            // Include error code, message, and data if it's a string\n                            if (errorCode) errorMessage += ` [${errorCode}]`;\n                            if (errorMsg) errorMessage += ` - ${errorMsg}`;\n\n                            // Include data if it's a string (not an object)\n                            const errorData = errorObj.data;\n                            if (\n                                errorData &&\n                                typeof errorData === 'string' &&\n                                errorData.trim()\n                            ) {\n                                errorMessage += ` (${errorData})`;\n                            }\n                        }\n                    } catch {\n                        // If JSON parsing fails, don't include anything\n                    }\n                }\n                // For plain text, parse and extract useful information\n                else if (\n                    // Include plain text error bodies (even if long) as they often contain\n                    // crucial details coming directly from Thor (e.g. \"invalid character 'x' ...\").\n                    // We only skip HTML payloads.\n                    !trimmedBody.includes('<!DOCTYPE html>')\n                ) {\n                    // Try to extract key information from plain text\n                    const lines = trimmedBody.split('\\n');\n                    const firstLine = lines[0].trim();\n\n                    // Look for common error patterns\n                    if (firstLine.includes(': ')) {\n                        // Format: \"field: error message\"\n                        const [field, message] = firstLine.split(': ', 2);\n                        if (field && message) {\n                            errorMessage += ` - ${field}: ${message}`;\n                        } else {\n                            errorMessage += ` - ${firstLine}`;\n                        }\n                    } else if (firstLine.includes(' - ')) {\n                        // Format: \"error - details\"\n                        errorMessage += ` - ${firstLine}`;\n                    } else {\n                        // Just include the first line if it's short\n                        errorMessage += ` - ${firstLine}`;\n                    }\n                }\n            }\n\n            throw new Error(errorMessage, {\n                cause: response\n            });\n        } catch (error) {\n            // Different error handling based on whether it's a params error or request error\n            if (url) {\n                // Log the error if url is defined (request was started)\n                const urlString = url.toString();\n                logError(requestStartTime, urlString, method, error);\n\n                // Check if this is a network communication error\n                // According to Fetch API spec: https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch#exceptions\n                // Network errors throw TypeError, while HTTP errors (4xx/5xx) are handled in the response.ok check\n                if (error instanceof TypeError) {\n                    throw new HttpNetworkError(\n                        'HttpClient.http()',\n                        error.message,\n                        {\n                            method,\n                            url: urlString,\n                            networkErrorType: 'TypeError'\n                        },\n                        error\n                    );\n                }\n\n                // If not a network error, treat as HTTP protocol error\n                throw new InvalidHTTPRequest(\n                    'HttpClient.http()',\n                    (error as Error).message,\n                    {\n                        method,\n                        url: urlString\n                    },\n                    error\n                );\n            } else {\n                // Parameter error before request was even started\n                const fallbackUrl = !this.isValidUrl(this.baseURL)\n                    ? path\n                    : new URL(path, this.baseURL).toString();\n\n                throw new InvalidHTTPParams(\n                    'HttpClient.http()',\n                    (error as Error).message,\n                    {\n                        method,\n                        url: fallbackUrl\n                    },\n                    error\n                );\n            }\n        } finally {\n            clearTimeout(timeoutId);\n        }\n    }\n\n    /**\n     * Makes an HTTP POST request to the specified path with optional parameters.\n     *\n     * @param {string} path - The endpoint to which the POST request is made.\n     * @param {HttpParams} [params] - Optional parameters for the request,\n     * including query parameters, headers, body, and response validation.\n     * {@link HttpParams.headers} override {@link SimpleHttpClient.headers}.\n     * @return {Promise<unknown>} A promise that resolves with the response from the server.\n     */\n    public async post(path: string, params?: HttpParams): Promise<unknown> {\n        return await this.http(HttpMethod.POST, path, params);\n    }\n}\n\nexport { SimpleHttpClient };\n","import { type TransactionBody } from '@vechain/sdk-core';\nimport { type TransactionRequestInput } from '../types';\n\n/**\n * Utility method to convert a transaction body to a transaction request input\n *\n * @param transactionBody - The transaction body to convert\n * @param from - The address of the sender\n *\n * @returns The transaction request input\n * @throws Error if nonce is negative\n */\nfunction transactionBodyToTransactionRequestInput(\n    transactionBody: TransactionBody,\n    from: string\n): TransactionRequestInput {\n    // Validate that nonce is not negative\n    if (transactionBody.nonce !== undefined) {\n        const nonceValue =\n            typeof transactionBody.nonce === 'string'\n                ? parseInt(transactionBody.nonce, 10)\n                : transactionBody.nonce;\n\n        if (nonceValue < 0) {\n            throw new Error('Transaction nonce must be a positive number');\n        }\n    }\n\n    return {\n        from,\n        chainTag: transactionBody.chainTag,\n        blockRef: transactionBody.blockRef,\n        expiration: transactionBody.expiration,\n        clauses: transactionBody.clauses,\n        gasPriceCoef: transactionBody.gasPriceCoef,\n        gas: transactionBody.gas,\n        dependsOn: transactionBody.dependsOn ?? undefined,\n        nonce: transactionBody.nonce,\n        reserved: transactionBody.reserved,\n        maxPriorityFeePerGas: transactionBody.maxPriorityFeePerGas ?? undefined,\n        maxFeePerGas: transactionBody.maxFeePerGas ?? undefined\n    } satisfies TransactionRequestInput;\n}\n\nexport { transactionBodyToTransactionRequestInput };\n","import { transactionBodyToTransactionRequestInput } from './utils';\n\nconst signerUtils = {\n    transactionBodyToTransactionRequestInput\n};\nexport { signerUtils };\n","/**\n * List of all valid ethereum RPC methods\n *\n * @note following links for more details:\n * * https://eth.wiki/json-rpc/API\n * * https://ethereum.github.io/execution-apis/api-documentation/\n */\nenum RPC_METHODS {\n    /**\n     * IMPLEMENTED METHODS:\n     */\n    eth_blockNumber = 'eth_blockNumber',\n    eth_chainId = 'eth_chainId',\n    eth_getBalance = 'eth_getBalance',\n    eth_getCode = 'eth_getCode',\n    eth_getStorageAt = 'eth_getStorageAt',\n    eth_estimateGas = 'eth_estimateGas',\n    eth_call = 'eth_call',\n    eth_sendRawTransaction = 'eth_sendRawTransaction',\n    eth_getLogs = 'eth_getLogs',\n    eth_getBlockByHash = 'eth_getBlockByHash',\n    eth_getBlockByNumber = 'eth_getBlockByNumber',\n    eth_accounts = 'eth_accounts',\n    eth_requestAccounts = 'eth_requestAccounts',\n    eth_gasPrice = 'eth_gasPrice',\n    eth_getTransactionByHash = 'eth_getTransactionByHash',\n    eth_getTransactionCount = 'eth_getTransactionCount',\n    eth_getTransactionReceipt = 'eth_getTransactionReceipt',\n    eth_getTransactionByBlockNumberAndIndex = 'eth_getTransactionByBlockNumberAndIndex',\n    eth_getTransactionByBlockHashAndIndex = 'eth_getTransactionByBlockHashAndIndex',\n    eth_getBlockTransactionCountByHash = 'eth_getBlockTransactionCountByHash',\n    eth_getBlockTransactionCountByNumber = 'eth_getBlockTransactionCountByNumber',\n    eth_sendTransaction = 'eth_sendTransaction',\n    eth_syncing = 'eth_syncing',\n    net_version = 'net_version',\n    web3_clientVersion = 'web3_clientVersion',\n    eth_subscribe = 'eth_subscribe',\n    eth_unsubscribe = 'eth_unsubscribe',\n    debug_traceTransaction = 'debug_traceTransaction',\n    debug_traceCall = 'debug_traceCall',\n    evm_mine = 'evm_mine',\n    evm_increaseTime = 'evm_increaseTime', // Uses evm_mine under the hood, required for hardhat\n    web3_sha3 = 'web3_sha3',\n    net_peerCount = 'net_peerCount',\n    net_listening = 'net_listening',\n    eth_getUncleByBlockNumberAndIndex = 'eth_getUncleByBlockNumberAndIndex',\n    eth_getUncleByBlockHashAndIndex = 'eth_getUncleByBlockHashAndIndex',\n    txpool_inspect = 'txpool_inspect',\n    txpool_contentFrom = 'txpool_contentFrom',\n    txpool_content = 'txpool_content',\n    txpool_status = 'txpool_status',\n    eth_signTransaction = 'eth_signTransaction',\n    debug_traceBlockByHash = 'debug_traceBlockByHash',\n    debug_traceBlockByNumber = 'debug_traceBlockByNumber',\n    eth_getUncleCountByBlockHash = 'eth_getUncleCountByBlockHash',\n    eth_getUncleCountByBlockNumber = 'eth_getUncleCountByBlockNumber',\n    eth_signTypedData_v4 = 'eth_signTypedData_v4',\n    eth_getBlockReceipts = 'eth_getBlockReceipts',\n\n    /**\n     * TO BE IMPLEMENTED METHODS:\n     * Add to packages/network/src/provider/utils/rpc-mapper/methods/index.ts to implement\n     */\n    eth_coinbase = 'eth_coinbase',\n    eth_feeHistory = 'eth_feeHistory',\n    eth_getWork = 'eth_getWork',\n    eth_mining = 'eth_mining',\n    eth_hashrate = 'eth_hashrate',\n    eth_protocolVersion = 'eth_protocolVersion',\n    eth_sign = 'eth_sign',\n    eth_submitWork = 'eth_submitWork',\n    parity_nextNonce = 'parity_nextNonce',\n    eth_newFilter = 'eth_newFilter',\n    eth_newBlockFilter = 'eth_newBlockFilter',\n    eth_newPendingTransactionFilter = 'eth_newPendingTransactionFilter',\n    eth_getFilterLogs = 'eth_getFilterLogs',\n    eth_getFilterChanges = 'eth_getFilterChanges',\n    eth_uninstallFilter = 'eth_uninstallFilter',\n    debug_getBadBlocks = 'debug_getBadBlocks',\n    debug_getRawBlock = 'debug_getRawBlock',\n    debug_getRawHeader = 'debug_getRawHeader',\n    debug_getRawReceipts = 'debug_getRawReceipts',\n    debug_getRawTransaction = 'debug_getRawTransaction',\n    engine_exchangeCapabilities = 'engine_exchangeCapabilities',\n    engine_exchangeTransitionConfigurationV1 = 'engine_exchangeTransitionConfigurationV1',\n    engine_forkchoiceUpdatedV1 = 'engine_forkchoiceUpdatedV1',\n    engine_forkchoiceUpdatedV2 = 'engine_forkchoiceUpdatedV2',\n    engine_forkchoiceUpdatedV3 = 'engine_forkchoiceUpdatedV3',\n    engine_getPayloadBodiesByHashV1 = 'engine_getPayloadBodiesByHashV1',\n    engine_getPayloadBodiesByRangeV1 = 'engine_getPayloadBodiesByRangeV1',\n    engine_getPayloadV1 = 'engine_getPayloadV1',\n    engine_getPayloadV2 = 'engine_getPayloadV2',\n    engine_getPayloadV3 = 'engine_getPayloadV3',\n    engine_newPayloadV1 = 'engine_newPayloadV1',\n    engine_newPayloadV2 = 'engine_newPayloadV2',\n    engine_newPayloadV3 = 'engine_newPayloadV3',\n    eth_createAccessList = 'eth_createAccessList',\n    eth_getProof = 'eth_getProof',\n    eth_maxPriorityFeePerGas = 'eth_maxPriorityFeePerGas'\n}\n\nexport { RPC_METHODS };\n","import { FixedPointNumber, Units, VET, VTHO } from '@vechain/sdk-core';\nimport { type AccountData } from './AccountData';\n\n/**\n * Represents detailed account information.\n *\n * Implements the {@link AccountData} interface.\n */\nclass AccountDetail implements AccountData {\n    /**\n     * Return the hexadecimal expression of the wei VET value of the balance.\n     */\n    readonly balance: string;\n\n    /**\n     * Return the hexadecimal expression of the wei VTHO value of the energy balance.\n     */\n    readonly energy: string;\n\n    /**\n     * Return `true` if the account is a smart contract, otherwise `false`.\n     */\n    readonly hasCode: boolean;\n\n    /**\n     * Returns the balance of the account in {@link VET}.\n     */\n    get vet(): VET {\n        return VET.of(Units.formatEther(FixedPointNumber.of(this.balance)));\n    }\n\n    /**\n     * Returns the energy balance of the account in {@link VTHO}.\n     */\n    get vtho(): VTHO {\n        return VTHO.of(Units.formatEther(FixedPointNumber.of(this.energy)));\n    }\n\n    /**\n     * Constructs a new instance of the class.\n     *\n     * @param {AccountData} accountData - The data to initialize the account with.\n     */\n    constructor(accountData: AccountData) {\n        this.balance = accountData.balance;\n        this.energy = accountData.energy;\n        this.hasCode = accountData.hasCode;\n    }\n}\n\nexport { AccountDetail };\n","/**\n * Address of the Params built-in contract.\n *\n * @link see [params.sol](https://docs.vechain.org/developer-resources/built-in-contracts#params-sol)\n */\nconst PARAMS_ADDRESS = '0x0000000000000000000000000000506172616d73';\n\n/**\n * Address of the Energy built-in contract.\n *\n * @link see [energy.sol](https://docs.vechain.org/developer-resources/built-in-contracts#energy-sol)\n */\nconst ENERGY_ADDRESS = '0x0000000000000000000000000000456e65726779';\n\n/**\n * ABI of the Params built-in contract.\n *\n * @link see [params.sol](https://docs.vechain.org/developer-resources/built-in-contracts#params-sol)\n */\nconst PARAMS_ABI = [\n    {\n        constant: false,\n        inputs: [\n            {\n                name: '_key',\n                type: 'bytes32'\n            },\n            {\n                name: '_value',\n                type: 'uint256'\n            }\n        ],\n        name: 'set',\n        outputs: [],\n        payable: false,\n        stateMutability: 'nonpayable',\n        type: 'function'\n    },\n    {\n        constant: true,\n        inputs: [\n            {\n                name: '_key',\n                type: 'bytes32'\n            }\n        ],\n        name: 'get',\n        outputs: [\n            {\n                name: '',\n                type: 'uint256'\n            }\n        ],\n        payable: false,\n        stateMutability: 'view',\n        type: 'function'\n    },\n    {\n        constant: true,\n        inputs: [],\n        name: 'executor',\n        outputs: [\n            {\n                name: '',\n                type: 'address'\n            }\n        ],\n        payable: false,\n        stateMutability: 'view',\n        type: 'function'\n    },\n    {\n        anonymous: false,\n        inputs: [\n            {\n                indexed: true,\n                name: 'key',\n                type: 'bytes32'\n            },\n            {\n                indexed: false,\n                name: 'value',\n                type: 'uint256'\n            }\n        ],\n        name: 'Set',\n        type: 'event'\n    }\n] as const;\n\n/**\n * ABI of the Energy built-in contract. (VTHO)\n *\n * @link see [energy.sol](https://docs.vechain.org/developer-resources/built-in-contracts#energy-sol)\n */\nconst ENERGY_ABI = [\n    {\n        constant: true,\n        inputs: [],\n        name: 'name',\n        outputs: [\n            {\n                name: '',\n                type: 'string'\n            }\n        ],\n        payable: false,\n        stateMutability: 'pure',\n        type: 'function'\n    },\n    {\n        constant: false,\n        inputs: [\n            {\n                name: '_spender',\n                type: 'address'\n            },\n            {\n                name: '_value',\n                type: 'uint256'\n            }\n        ],\n        name: 'approve',\n        outputs: [\n            {\n                name: 'success',\n                type: 'bool'\n            }\n        ],\n        payable: false,\n        stateMutability: 'nonpayable',\n        type: 'function'\n    },\n    {\n        constant: true,\n        inputs: [],\n        name: 'totalSupply',\n        outputs: [\n            {\n                name: '',\n                type: 'uint256'\n            }\n        ],\n        payable: false,\n        stateMutability: 'view',\n        type: 'function'\n    },\n    {\n        constant: false,\n        inputs: [\n            {\n                name: '_from',\n                type: 'address'\n            },\n            {\n                name: '_to',\n                type: 'address'\n            },\n            {\n                name: '_amount',\n                type: 'uint256'\n            }\n        ],\n        name: 'transferFrom',\n        outputs: [\n            {\n                name: 'success',\n                type: 'bool'\n            }\n        ],\n        payable: false,\n        stateMutability: 'nonpayable',\n        type: 'function'\n    },\n    {\n        constant: true,\n        inputs: [],\n        name: 'decimals',\n        outputs: [\n            {\n                name: '',\n                type: 'uint8'\n            }\n        ],\n        payable: false,\n        stateMutability: 'pure',\n        type: 'function'\n    },\n    {\n        constant: true,\n        inputs: [\n            {\n                name: '_owner',\n                type: 'address'\n            }\n        ],\n        name: 'balanceOf',\n        outputs: [\n            {\n                name: 'balance',\n                type: 'uint256'\n            }\n        ],\n        payable: false,\n        stateMutability: 'view',\n        type: 'function'\n    },\n    {\n        constant: true,\n        inputs: [],\n        name: 'symbol',\n        outputs: [\n            {\n                name: '',\n                type: 'string'\n            }\n        ],\n        payable: false,\n        stateMutability: 'pure',\n        type: 'function'\n    },\n    {\n        constant: false,\n        inputs: [\n            {\n                name: '_to',\n                type: 'address'\n            },\n            {\n                name: '_amount',\n                type: 'uint256'\n            }\n        ],\n        name: 'transfer',\n        outputs: [\n            {\n                name: 'success',\n                type: 'bool'\n            }\n        ],\n        payable: false,\n        stateMutability: 'nonpayable',\n        type: 'function'\n    },\n    {\n        constant: false,\n        inputs: [\n            {\n                name: '_from',\n                type: 'address'\n            },\n            {\n                name: '_to',\n                type: 'address'\n            },\n            {\n                name: '_amount',\n                type: 'uint256'\n            }\n        ],\n        name: 'move',\n        outputs: [\n            {\n                name: 'success',\n                type: 'bool'\n            }\n        ],\n        payable: false,\n        stateMutability: 'nonpayable',\n        type: 'function'\n    },\n    {\n        constant: true,\n        inputs: [],\n        name: 'totalBurned',\n        outputs: [\n            {\n                name: '',\n                type: 'uint256'\n            }\n        ],\n        payable: false,\n        stateMutability: 'view',\n        type: 'function'\n    },\n    {\n        constant: true,\n        inputs: [\n            {\n                name: '_owner',\n                type: 'address'\n            },\n            {\n                name: '_spender',\n                type: 'address'\n            }\n        ],\n        name: 'allowance',\n        outputs: [\n            {\n                name: 'remaining',\n                type: 'uint256'\n            }\n        ],\n        payable: false,\n        stateMutability: 'view',\n        type: 'function'\n    },\n    {\n        anonymous: false,\n        inputs: [\n            {\n                indexed: true,\n                name: '_from',\n                type: 'address'\n            },\n            {\n                indexed: true,\n                name: '_to',\n                type: 'address'\n            },\n            {\n                indexed: false,\n                name: '_value',\n                type: 'uint256'\n            }\n        ],\n        name: 'Transfer',\n        type: 'event'\n    },\n    {\n        anonymous: false,\n        inputs: [\n            {\n                indexed: true,\n                name: '_owner',\n                type: 'address'\n            },\n            {\n                indexed: true,\n                name: '_spender',\n                type: 'address'\n            },\n            {\n                indexed: false,\n                name: '_value',\n                type: 'uint256'\n            }\n        ],\n        name: 'Approval',\n        type: 'event'\n    }\n] as const;\n\n/**\n * Built-in contracts.\n */\nexport const BUILT_IN_CONTRACTS = {\n    PARAMS_ABI,\n    PARAMS_ADDRESS,\n    ENERGY_ABI,\n    ENERGY_ADDRESS\n};\n","/**\n * HTTP regex.\n */\nconst HTTP_REGEX: RegExp = /^http:\\/\\//;\n\n/**\n * HTTPS regex.\n */\nconst HTTPS_REGEX: RegExp = /^https:\\/\\//;\n\nexport { HTTP_REGEX, HTTPS_REGEX };\n","/**\n * Node healthcheck Tolerance in seconds.\n * @example When set to 30, it means that we consider a node healthy even when it's off-sync by roughly 3 blocks.\n */\nconst NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS = 30;\n\nexport { NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS };\n","import { Keccak256, Txt } from '@vechain/sdk-core';\n\n/**\n * The selector for the error event.\n */\nconst ERROR_SELECTOR = Keccak256.of(Txt.of('Error(string)').bytes)\n    .toString()\n    .slice(0, 10);\n\n/**\n * The selector for the panic event.\n */\nconst PANIC_SELECTOR = Keccak256.of(Txt.of('Panic(uint256)').bytes)\n    .toString()\n    .slice(0, 10);\n\nexport { ERROR_SELECTOR, PANIC_SELECTOR };\n","/**\n * Url of the mainnet\n */\nconst MAINNET_URL = 'https://mainnet.vechain.org';\n\n/**\n * Url of the testnet\n */\nconst TESTNET_URL = 'https://testnet.vechain.org';\n\n/**\n * Url of the solo network\n * Using explicit IPv4 (127.0.0.1) instead of localhost to avoid IPv6 resolution issues in CI\n */\nconst THOR_SOLO_URL = 'http://127.0.0.1:8669';\n\nexport { MAINNET_URL, TESTNET_URL, THOR_SOLO_URL };\n","/**\n * Documentation link of RPC methods\n */\nconst RPC_DOCUMENTATION_URL =\n    'https://ethereum.github.io/execution-apis/api-documentation/';\n\nexport { RPC_DOCUMENTATION_URL };\n","/**\n * Constructs a query object for HTTP requests by filtering out undefined values.\n *\n * @param params - An object containing the query parameters with potential undefined values.\n * @returns An object containing only the defined query parameters.\n */\nconst buildQuery = (\n    params: Record<string, string | boolean | undefined>\n): Record<string, string> => {\n    const definedParams: Record<string, string> = {};\n\n    // Iterate over each property in the params object\n    for (const key in params) {\n        // Check if the value is not undefined\n        if (params[key] !== undefined) {\n            // If the value is defined, add it to the definedParams object\n            definedParams[key] = params[key] as string;\n        }\n    }\n\n    return definedParams;\n};\n\nexport { buildQuery };\n","import { type SyncPollInputOptions } from './types';\nimport {\n    InvalidDataType,\n    PollExecution,\n    HttpNetworkError\n} from '@vechain/sdk-errors';\n\nconst MAX_SAFE_ITERATIONS = 1000;\n\n/**\n * Sleep for a given amount of time (in milliseconds).\n *\n * @param delayInMilliseconds - The amount of time to sleep in milliseconds.\n */\nasync function sleep(delayInMilliseconds: number): Promise<void> {\n    await new Promise((resolve) => setTimeout(resolve, delayInMilliseconds));\n}\n\n/**\n * Poll until the condition is met.\n *\n * @note: Be careful!, this function is synchronous and will block the thread until the condition is met.\n * Thus mean it can run forever if the condition is never met.\n * To avoid infinite loop, you can use the `options.maximumIterations` parameter.\n *\n * @example It can be used to wait until:\n *  - A balance is updated after a transaction is sent\n *  - A transaction is mined\n *  - A block is mined\n *  ...\n *\n * @param pollingFunction - The function to be called.\n * @param options - Polling options. @see {SyncPollInputOptions} type. If not specified, the default values are used. In particular: `requestIntervalInMilliseconds` is 1000, `maximumIterations` is not specified\n *                  and `maximumWaitingTimeInMilliseconds` is not specified.\n * @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.\n * @throws {InvalidDataType, PollExecution}\n */\nfunction SyncPoll<TReturnType>(\n    pollingFunction: () => Promise<TReturnType> | TReturnType,\n    options?: SyncPollInputOptions\n): {\n    waitUntil: (\n        condition: (data: TReturnType) => boolean\n    ) => Promise<TReturnType>;\n} {\n    // Positive number for the request interval\n    if (\n        options?.requestIntervalInMilliseconds !== undefined &&\n        (options.requestIntervalInMilliseconds <= 0 ||\n            !Number.isInteger(options.requestIntervalInMilliseconds))\n    ) {\n        throw new InvalidDataType(\n            'SyncPoll()',\n            'Polling failed: Invalid input for field \"options?.requestIntervalInMilliseconds\" it must be a positive number',\n            {\n                requestIntervalInMilliseconds:\n                    options.requestIntervalInMilliseconds\n            }\n        );\n    }\n\n    // Positive number for maximum iterations\n    if (\n        options?.maximumIterations !== undefined &&\n        (options.maximumIterations <= 0 ||\n            !Number.isInteger(options.maximumIterations))\n    ) {\n        throw new InvalidDataType(\n            'SyncPoll()',\n            'Polling failed: Invalid input for field \"options?.maximumIterations\" it must be a positive number',\n            {\n                maximumIterations: options.maximumIterations\n            }\n        );\n    }\n\n    // Positive number for maximum waiting time\n    if (\n        options?.maximumWaitingTimeInMilliseconds !== undefined &&\n        (options.maximumWaitingTimeInMilliseconds <= 0 ||\n            !Number.isInteger(options.maximumWaitingTimeInMilliseconds))\n    ) {\n        throw new InvalidDataType(\n            'SyncPoll()',\n            'Polling failed: Invalid input for field \"options?.maximumWaitingTimeInMilliseconds\" it must be a positive number',\n            {\n                maximumWaitingTimeInMilliseconds:\n                    options.maximumWaitingTimeInMilliseconds\n            }\n        );\n    }\n\n    // Number of iterations\n    let currentIteration = 0;\n\n    // Current result\n    let currentResult: TReturnType;\n\n    // Polling condition\n    let pollingCondition: boolean = false;\n\n    // Initialize the start time\n    const startTime = Date.now();\n\n    return {\n        /**\n         * Poll until the condition is met.\n         *\n         * @param condition - The condition to be met.\n         * @returns The result of the poll after the condition is met.\n         */\n        waitUntil: async (\n            condition: (data: TReturnType) => boolean\n        ): Promise<TReturnType> => {\n            let consecutiveNetworkErrors = 0;\n            const maxConsecutiveNetworkErrors = 10;\n            let isConditionSatisfied = false;\n\n            try {\n                do {\n                    try {\n                        // 1 - Fetch the result of promise\n                        currentResult = await pollingFunction();\n                        consecutiveNetworkErrors = 0;\n                        isConditionSatisfied = condition(currentResult);\n                        if (isConditionSatisfied) {\n                            // If the condition is satisfied, return the current result\n                            return currentResult;\n                        }\n                    } catch (error) {\n                        if (error instanceof HttpNetworkError) {\n                            consecutiveNetworkErrors++;\n                            if (\n                                consecutiveNetworkErrors >=\n                                maxConsecutiveNetworkErrors\n                            ) {\n                                throw new PollExecution(\n                                    'SyncPoll.waitUntil()',\n                                    'Polling failed: Too many consecutive network errors.',\n                                    {\n                                        functionName: pollingFunction.name\n                                    },\n                                    error\n                                );\n                            }\n                            // Continue polling for network errors without incrementing iteration\n                            await sleep(\n                                options?.requestIntervalInMilliseconds ?? 1000\n                            );\n                            continue;\n                        } else {\n                            // Re-throw non-network errors immediately\n                            throw error;\n                        }\n                    }\n\n                    // 2 - Sleep for the interval (in a synchronous way)\n                    await sleep(options?.requestIntervalInMilliseconds ?? 1000);\n\n                    // 3 - Increment the current iteration\n                    currentIteration = currentIteration + 1;\n\n                    // 4.1 - Stop forced on iterations\n                    const isMaximumIterationsReached =\n                        options?.maximumIterations !== undefined\n                            ? currentIteration >= options.maximumIterations\n                            : currentIteration >= MAX_SAFE_ITERATIONS;\n\n                    // 4.2 - Stop forced on maximum waiting time\n                    const isTimeLimitReached =\n                        options?.maximumWaitingTimeInMilliseconds !==\n                            undefined &&\n                        Date.now() - startTime >=\n                            options.maximumWaitingTimeInMilliseconds;\n\n                    // Stop the polling if the condition is met OR the maximum iterations is reached OR the maximum waiting time is reached\n                    pollingCondition = !(\n                        isConditionSatisfied ||\n                        isMaximumIterationsReached ||\n                        isTimeLimitReached\n                    );\n\n                    // Additional safety check for maximum iterations\n                    if (currentIteration >= MAX_SAFE_ITERATIONS) {\n                        throw new PollExecution(\n                            'SyncPoll.waitUntil()',\n                            'Polling failed: Maximum safe iterations reached.',\n                            {\n                                functionName: pollingFunction.name\n                            }\n                        );\n                    }\n                } while (pollingCondition);\n\n                return currentResult;\n            } catch (error) {\n                throw new PollExecution(\n                    'SyncPoll.waitUntil()',\n                    'Polling failed: Function execution error encountered during synchronous polling.',\n                    {\n                        functionName: pollingFunction.name\n                    },\n                    error\n                );\n            }\n        }\n    };\n}\n\nexport { SyncPoll };\n","import { EventEmitter } from 'events';\nimport {\n    InvalidDataType,\n    PollExecution,\n    HttpNetworkError\n} from '@vechain/sdk-errors';\n\n/**\n * Poll in an event based way.\n * This Poll is Asynchronous. It exploits:\n * - The EventEmitter to emit events\n * - The setInterval function to poll\n *\n * @example It can be used to trigger events every time\n *  - When balance is updated after a transaction is sent a message is sent\n *  - When a transaction is mined a message is sent\n *  - When a certain block is mined an operation can start\n *  ...\n */\nclass EventPoll<TReturnType> extends EventEmitter {\n    /**\n     * The current iteration. It counts how many iterations have been done.\n     * This parameter is useful to know how many iterations have been done.\n     * For example, it can be used to stop the poll after a certain number of iterations.\n     */\n    private currentIteration: number = 0;\n\n    /**\n     * Error thrown during the execution of the poll.\n     */\n    private error?: Error;\n\n    /**\n     * Indicates whether to stop execution on error of the\n     * {@link _intervalLoop} function.\n     *\n     * @type {boolean}\n     */\n    private readonly hasToStopOnError: boolean;\n\n    /**\n     * The interval used to poll.\n     */\n    private intervalId?: NodeJS.Timeout;\n\n    /**\n     * The function to be called.\n     */\n    private readonly pollingFunction: () => Promise<TReturnType>;\n\n    /**\n     * The interval of time (in milliseconds) between each request.\n     */\n    private readonly requestIntervalInMilliseconds: number;\n\n    /**\n     * Constructor for creating an instance of EventPoll.\n     *\n     * @param {Function} pollingFunction - The function to be executed repeatedly.\n     * @param {number} requestIntervalInMilliseconds - The interval in milliseconds between each execution of the polling function.\n     * @param {boolean} [hasToStopOnError=true] - Indicates whether to stop polling if an error occurs.\n     * @throws {InvalidDataType}\n     */\n    constructor(\n        pollingFunction: () => Promise<TReturnType>,\n        requestIntervalInMilliseconds: number,\n        hasToStopOnError: boolean\n    ) {\n        super();\n        this.pollingFunction = pollingFunction;\n        this.hasToStopOnError = hasToStopOnError;\n\n        // Positive number for request interval\n        if (\n            requestIntervalInMilliseconds !== undefined &&\n            (requestIntervalInMilliseconds <= 0 ||\n                !Number.isInteger(requestIntervalInMilliseconds))\n        ) {\n            throw new InvalidDataType(\n                'SyncPoll()',\n                'Polling failed: Invalid input for field \"options?.maximumWaitingTimeInMilliseconds\" it must be a positive number',\n                {\n                    requestIntervalInMilliseconds\n                }\n            );\n        }\n\n        this.requestIntervalInMilliseconds = requestIntervalInMilliseconds;\n    }\n\n    /**\n     * Get how many iterations have been done.\n     *\n     * @returns The number of iterations.\n     */\n    public get getCurrentIteration(): number {\n        return this.currentIteration;\n    }\n\n    /**\n     * Basic interval loop function.\n     * This function must be called into setInterval.\n     * It calls the promise and emit the event.\n     */\n    private async _intervalLoop(): Promise<void> {\n        try {\n            // Get data and emit the event\n            const data = await this.pollingFunction();\n            this.emit('data', { data, eventPoll: this });\n        } catch (error) {\n            // Check if this is a network communication error\n            if (error instanceof HttpNetworkError) {\n                // For network errors, we might want to continue polling\n                // Log the network error but don't stop polling\n                console.warn(\n                    'Network error during polling, continuing:',\n                    error.message\n                );\n\n                // Emit the network error but don't stop\n                this.emit('error', { error });\n\n                // Don't stop polling for network errors unless explicitly configured\n                if (this.hasToStopOnError) {\n                    this.stopListen();\n                }\n            } else {\n                // For other errors, create a PollExecution error\n                this.error = new PollExecution(\n                    'EventPoll - main interval loop function',\n                    `Error during the execution of the poll ${(error as Error).message}`,\n                    {\n                        functionName: this.pollingFunction.name\n                    }\n                );\n\n                // Emit the error\n                this.emit('error', { error: this.error });\n\n                // Stop listening for non-network errors\n                if (this.hasToStopOnError) {\n                    this.stopListen();\n                }\n            }\n        }\n\n        // Increment the iteration\n        this.currentIteration = this.currentIteration + 1;\n    }\n\n    /**\n     * Listen to the 'data' event.\n     * This method is the redefinition of the EventEmitter.on method.\n     * Because the EventEmitter.on method does not allow to specify the type of the data.\n     * And we must be type safe.\n     *\n     * This is equivalent to:\n     *\n     * ```typescript\n     * eventPoll.on('data', (data) => { ... });\n     * ```\n     * @param onDataCallback - The callback to be called when the event is emitted.\n     */\n    public onData(\n        onDataCallback: (\n            data: TReturnType,\n            eventPoll: EventPoll<TReturnType>\n        ) => void\n    ): this {\n        this.on('data', (data) => {\n            onDataCallback(\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n                data.data as TReturnType,\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n                data.eventPoll as EventPoll<TReturnType>\n            );\n        });\n\n        return this;\n    }\n\n    /* --- Overloaded of 'on' event emitter start --- */\n\n    /**\n     * Listen to the 'error' event.\n     * This method is the redefinition of the EventEmitter.on method.\n     * Because the EventEmitter.on method does not allow to specify the type of the data.\n     * And we must be type safe.\n     *\n     * This is equivalent to:\n     *\n     * ```typescript\n     * eventPoll.on('error', (data) => { ... });\n     * ```\n     * @param onErrorCallback - The callback to be called when the event is emitted.\n     */\n    public onError(onErrorCallback: (error: Error) => void): this {\n        this.on('error', (error) => {\n            onErrorCallback(\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n                error.error as Error\n            );\n        });\n\n        return this;\n    }\n\n    /**\n     * Listen to the 'start' event.\n     * This happens when the poll is stopped.\n     *\n     * @param onStartCallback - The callback to be called when the event is emitted.\n     */\n    public onStart(\n        onStartCallback: (eventPoll: EventPoll<TReturnType>) => void\n    ): this {\n        this.on('start', (data) => {\n            onStartCallback(\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n                data.eventPoll as EventPoll<TReturnType>\n            );\n        });\n\n        return this;\n    }\n\n    /**\n     * Listen to the 'stop' event.\n     * This happens when the poll is stopped.\n     *\n     * @param onStopCallback - The callback to be called when the event is emitted.\n     */\n    public onStop(\n        onStopCallback: (eventPoll: EventPoll<TReturnType>) => void\n    ): this {\n        this.on('stop', (data) => {\n            onStopCallback(\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n                data.eventPoll as EventPoll<TReturnType>\n            );\n        });\n\n        return this;\n    }\n\n    /**\n     * Start listening to the event.\n     */\n    startListen(): void {\n        // Start listening\n        this.emit('start', { eventPoll: this });\n\n        // Execute `_intervalLoop` and then set an interval which calls `_intervalLoop` every `requestIntervalInMilliseconds`\n        void this._intervalLoop().then(() => {\n            // Create an interval\n            this.intervalId = setInterval(() => {\n                void (async (): Promise<void> => {\n                    try {\n                        await this._intervalLoop();\n                    } catch (error) {\n                        // Log the error for debugging\n                        console.error('EventPoll interval error:', error);\n\n                        // If we should stop on error, stop listening permanently\n                        if (this.hasToStopOnError) {\n                            this.stopListen();\n                        } else {\n                            // If we shouldn't stop on error, continue with the next iteration\n                            // The error is already handled within _intervalLoop\n                        }\n                    }\n                })();\n            }, this.requestIntervalInMilliseconds);\n        }); // No need for .catch(), errors are handled within _intervalLoop\n    }\n\n    /**\n     * Stop listening to the event.\n     */\n    stopListen(): void {\n        clearInterval(this.intervalId);\n        this.emit('stop', { eventPoll: this });\n    }\n\n    /* --- Overloaded of 'on' event emitter end --- */\n}\n\n/**\n * Creates an event poll that performs a callback function repeatedly at a specified interval.\n * This method is useful to create an event poll in a more readable way.\n *\n * @param {Function} callBack - The callback function to be executed on each interval. It should return a Promise.\n * @param {number} requestIntervalInMilliseconds - The interval in milliseconds at which the callback function will be executed.\n * @param {boolean} [hasToStopOnError=true] - Optional parameter to specify whether the poll should stop on error. Default is true.\n * @returns {EventPoll} - The created event poll instance.\n */\nfunction createEventPoll<TReturnType>(\n    callBack: () => Promise<TReturnType>,\n    requestIntervalInMilliseconds: number,\n    hasToStopOnError: boolean = true\n): EventPoll<TReturnType> {\n    return new EventPoll<TReturnType>(\n        callBack,\n        requestIntervalInMilliseconds,\n        hasToStopOnError\n    );\n}\n\nexport { EventPoll, createEventPoll };\n","// Synchronous Polling\nimport { SyncPoll } from './sync';\n\n// Asynchronous Event Polling\nimport { createEventPoll, type EventPoll } from './event';\n\n// Types\nexport type * from './types.d';\n\nconst Poll = { SyncPoll, createEventPoll };\nexport { Poll, type EventPoll };\n","import { InvalidDataType } from '@vechain/sdk-errors';\nimport { HTTP_REGEX, HTTPS_REGEX } from '../const';\n\n/**\n * Generates a query string from a record of key-value pairs.\n * Only includes keys in the query string whose values are defined.\n *\n * @param params - The record of key-value pairs.\n * @returns The query string.\n */\nconst toQueryString = (\n    params: Record<string, string | number | boolean | undefined>\n): string => {\n    // Filter out undefined values and map to 'key=value' strings\n    const queryParts = Object.entries(params)\n        .filter(([, value]) => value !== undefined)\n        .map(\n            ([key, value]) =>\n                `${encodeURIComponent(key)}=${encodeURIComponent(\n                    value as string\n                )}`\n        );\n\n    // Join the parts with '&' and prepend a '?' if not empty\n    return queryParts.length > 0 ? `?${queryParts.join('&')}` : '';\n};\n\n/**\n * Sanitizes a base URL by removing trailing slashes and adding the protocol if missing.\n *\n * @param url - The URL to validate.\n * @returns The sanitized URL without the protocol.\n * @throws {InvalidDataType}\n */\nconst sanitizeWebsocketBaseURL = (url: string): string => {\n    // Clean the url\n    url = url.trim();\n\n    // Simplified regex to check if the URL is valid\n    const urlRegex =\n        /^(https?:\\/\\/)([a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*)(:\\d+)?\\/?$/;\n\n    if (!urlRegex.test(url))\n        throw new InvalidDataType(\n            'sanitizeWebsocketBaseURL()',\n            `Invalid url: ${url}. Must adhere to the regex: ${urlRegex}.`,\n            { url, urlRegex }\n        );\n\n    // Remove trailing slash\n    url = url.replace(/\\/$/, '');\n\n    // Replace http with ws and https with wss\n    url =\n        HTTP_REGEX.exec(url) !== null\n            ? url.replace(HTTP_REGEX, 'ws://')\n            : url.replace(HTTPS_REGEX, 'wss://');\n\n    return url;\n};\n\nexport { toQueryString, sanitizeWebsocketBaseURL };\n","import { sanitizeWebsocketBaseURL, toQueryString } from './helpers';\nimport { type VetTransferOptions, type EventOptions } from './types';\n\n/**\n * Endpoints for the REST API.\n */\nconst thorest = {\n    /**\n     * Accounts related endpoints.\n     */\n    accounts: {\n        get: {\n            ACCOUNT_DETAIL: (address: string): string => `/accounts/${address}`,\n            ACCOUNT_BYTECODE: (address: string): string =>\n                `/accounts/${address}/code`,\n            STORAGE_AT: (address: string, position: string): string =>\n                `/accounts/${address}/storage/${position}`\n        },\n        post: {\n            SIMULATE_TRANSACTION: (revision?: string): string => {\n                return revision != null\n                    ? `/accounts/*?revision=${revision}`\n                    : `/accounts/*`;\n            }\n        }\n    },\n\n    /**\n     * Blocks related endpoints.\n     */\n    blocks: {\n        get: {\n            BLOCK_DETAIL: (revision: string | number): string =>\n                `/blocks/${revision}`\n        }\n    },\n\n    /**\n     * Nodes related endpoints.\n     */\n    nodes: {\n        get: {\n            NODES: (): string => '/node/network/peers'\n        }\n    },\n\n    /**\n     * Logs related endpoints.\n     */\n    logs: {\n        post: {\n            EVENT_LOGS: (): string => '/logs/event',\n            TRANSFER_LOGS: (): string => '/logs/transfer'\n        }\n    },\n\n    /**\n     * Transactions related endpoints.\n     */\n    transactions: {\n        get: {\n            TRANSACTION: (id: string): string => `/transactions/${id}`,\n            TRANSACTION_RECEIPT: (id: string): string =>\n                `/transactions/${id}/receipt`\n        },\n        post: {\n            TRANSACTION: (): string => `/transactions`\n        }\n    },\n\n    /**\n     * Subscriptions related endpoints.\n     */\n    subscriptions: {\n        get: {\n            /**\n             * Subscribe to new blocks.\n             *\n             * @param baseURL - The URL of the node to request the subscription from.\n             * @param position - (optional) The block id to start from, defaults to the best block.\n             *\n             * @returns The websocket subscription URL.\n             */\n            BLOCK: (baseURL: string, position?: string): string => {\n                const queryParams = toQueryString({\n                    pos: position\n                });\n\n                return `${sanitizeWebsocketBaseURL(\n                    baseURL\n                )}/subscriptions/block${queryParams}`;\n            },\n\n            /**\n             * Subscribe to new events.\n             *\n             * @param baseURL - The URL of the node to request the subscription from.\n             * @param options - (optional) The options for the subscription.\n             *\n             * @returns The websocket subscription URL.\n             */\n            EVENT: (baseURL: string, options?: EventOptions): string => {\n                const queryParams = toQueryString({\n                    pos: options?.position,\n                    addr: options?.contractAddress,\n                    t0: options?.topic0,\n                    t1: options?.topic1,\n                    t2: options?.topic2,\n                    t3: options?.topic3,\n                    t4: options?.topic4\n                });\n\n                return `${sanitizeWebsocketBaseURL(\n                    baseURL\n                )}/subscriptions/event${queryParams}`;\n            },\n\n            /**\n             * Subscribe to new VET transfers.\n             *\n             * @param baseURL - The URL of the node to request the subscription from.\n             * @param options - (optional) The options for the subscription.\n             *\n             * @returns The websocket subscription URL.\n             */\n            VET_TRANSFER: (\n                baseURL: string,\n                options?: VetTransferOptions\n            ): string => {\n                const queryParams = toQueryString({\n                    pos: options?.position,\n                    txOrigin: options?.signerAddress,\n                    sender: options?.sender,\n                    recipient: options?.receiver\n                });\n\n                return `${sanitizeWebsocketBaseURL(\n                    baseURL\n                )}/subscriptions/transfer${queryParams}`;\n            },\n\n            /**\n             * Subscribe to new legacy beats.\n             * 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.\n             * @note This subscription has been improved with dynamic size bloom filter with the new `BEAT` subscription.\n             *\n             * @param baseURL - The URL of the node to request the subscription from.\n             * @param position - (optional) The block id to start from, defaults to the best block.\n             *\n             * @returns The websocket subscription URL.\n             */\n            BEAT_LEGACY: (baseURL: string, position?: string): string => {\n                const queryParams = toQueryString({\n                    pos: position\n                });\n\n                return `${sanitizeWebsocketBaseURL(\n                    baseURL\n                )}/subscriptions/beat${queryParams}`;\n            },\n\n            /**\n             * Subscribe to new beats.\n             * 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.\n             *\n             * @param baseURL - The URL of the node to request the subscription from.\n             * @param position - (optional) The block id to start from, defaults to the best block.\n             *\n             * @returns The websocket subscription URL.\n             */\n            BEAT: (baseURL: string, position?: string): string => {\n                const queryParams = toQueryString({\n                    pos: position\n                });\n\n                return `${sanitizeWebsocketBaseURL(\n                    baseURL\n                )}/subscriptions/beat2${queryParams}`;\n            },\n\n            /**\n             * Subscribe to new transactions.\n             *\n             * @returns The websocket subscription URL.\n             */\n            NEW_TRANSACTIONS: (baseURL: string): string =>\n                `${sanitizeWebsocketBaseURL(baseURL)}/subscriptions/txpool`\n        }\n    },\n\n    /**\n     * Debug related endpoints.\n     */\n    debug: {\n        post: {\n            TRACE_TRANSACTION_CLAUSE: (): string => `/debug/tracers`,\n            TRACE_CONTRACT_CALL: (): string => `/debug/tracers/call`,\n            RETRIEVE_STORAGE_RANGE: (): string => `/debug/storage-range`\n        }\n    },\n\n    /**\n     * Fees related endpoints.\n     */\n    fees: {\n        get: {\n            FEES_HISTORY: (\n                blockCount: number,\n                newestBlock: string | number,\n                rewardPercentiles?: number[]\n            ): string => {\n                const queryParams = toQueryString({\n                    blockCount,\n                    newestBlock,\n                    rewardPercentiles: rewardPercentiles?.join(',')\n                });\n                return `/fees/history${queryParams}`;\n            }\n        }\n    }\n};\n\nexport { thorest };\n","import { thorest } from '../thorest';\nimport { type BlockSubscriptionOptions } from './types';\n\n/**\n * Returns the URL for subscribing to new beats through a websocket connection.\n * @note This subscribes to the legacy beats.\n * [Legacy Beat source code](https://github.com/vechain/thor/blob/abf1da466b554dcc9c1ad30cb8e75a860b046bf5/api/subscriptions/beat_reader.go#L29)\n *\n * @param baseURL - The URL of the node to request the subscription from.\n * @param options - (optional) other optional parameters for the request.\n *                  `blockID` - The block id to start from, defaults to the best block.\n *\n * @returns The websocket subscription URL.\n */\nconst getLegacyBeatSubscriptionUrl = (\n    baseURL: string,\n    options?: BlockSubscriptionOptions\n): string => {\n    return thorest.subscriptions.get.BEAT_LEGACY(baseURL, options?.blockID);\n};\n\n/**\n * Returns the URL for subscribing to new beats through a websocket connection.\n * @note this subscribes to the updated version of the beats. The new version uses a dynamic size bloom filter.\n *\n * @param baseURL - The URL of the node to request the subscription from.\n * @param options - (optional) other optional parameters for the request.\n *                 `blockID` - The block id to start from, defaults to the best block.\n *\n * @returns The websocket subscription URL.\n */\nconst getBeatSubscriptionUrl = (\n    baseURL: string,\n    options?: BlockSubscriptionOptions\n): string => {\n    return thorest.subscriptions.get.BEAT(baseURL, options?.blockID);\n};\n\nexport { getLegacyBeatSubscriptionUrl, getBeatSubscriptionUrl };\n","import { thorest } from '../thorest';\nimport { type BlockSubscriptionOptions } from './types';\n\n/**\n * Returns the URL for subscribing to new blocks through a websocket connection.\n *\n * @param baseURL - The URL of the node to request the subscription from.\n * @param options - (optional) other optional parameters for the request.\n *                 `blockID` - The block id to start from, defaults to the best block.\n *\n * @returns The websocket subscription URL.\n */\nconst getBlockSubscriptionUrl = (\n    baseURL: string,\n    options?: BlockSubscriptionOptions\n): string => {\n    return thorest.subscriptions.get.BLOCK(baseURL, options?.blockID);\n};\n\nexport { getBlockSubscriptionUrl };\n","import { ABIEvent } from '@vechain/sdk-core';\nimport { type AbiEvent } from 'abitype';\nimport { thorest } from '../thorest';\nimport { type EventLike, type EventSubscriptionOptions } from './types';\n\n/**\n * Returns the URL for subscribing to an event through a websocket connection.\n *\n * @param baseURL - The URL of the node to request the subscription from.\n * @param event - The event to subscribe to.\n *                Can be an event object or a string representing an event.\n *                @see [Viem Parse ABI Item](https://viem.sh/docs/abi/parseAbiItem.html)\n *\n * @param indexedValues - The values of the indexed parameters to construct the topic filters.\n * @param options - (optional) other optional parameters for the request.\n *                  `blockID` - The block id to start from, defaults to the best block.\n *                  `address` - The contract address to filter events by.\n *\n * @returns The websocket subscription URL.\n *\n * @throws Will throw an error if the event is not a valid event or if the indexed values to encode are invalid.\n */\nconst getEventSubscriptionUrl = (\n    baseURL: string,\n    event: EventLike,\n    indexedValues?: unknown[],\n    options?: EventSubscriptionOptions\n): string => {\n    const ev =\n        typeof event === 'string'\n            ? new ABIEvent(event)\n            : new ABIEvent(event as AbiEvent);\n\n    // Encode the indexed parameters to construct the topic filters\n    const encodedTopics = ev.encodeFilterTopicsNoNull(indexedValues ?? []);\n\n    return thorest.subscriptions.get.EVENT(baseURL, {\n        position: options?.blockID,\n        contractAddress: options?.address,\n        topic0: encodedTopics[0],\n        topic1: encodedTopics[1],\n        topic2: encodedTopics[2],\n        topic3: encodedTopics[3],\n        topic4: encodedTopics[4]\n    });\n};\n\nexport { getEventSubscriptionUrl };\n","import { thorest } from '../thorest';\n\n/**\n * Returns the URL for subscribing to new transactions through a websocket connection.\n *\n * @param baseURL - The URL of the node to request the subscription from.\n * @returns The websocket subscription URL.\n */\nconst getNewTransactionsSubscriptionUrl = (baseURL: string): string => {\n    return thorest.subscriptions.get.NEW_TRANSACTIONS(baseURL);\n};\n\nexport { getNewTransactionsSubscriptionUrl };\n","import { thorest } from '../thorest';\nimport { type VETtransfersSubscriptionOptions } from './types';\n\n/**\n * Returns the URL for subscribing to new VET transfers through a websocket connection.\n *\n * @param baseURL - The URL of the node to request the subscription from.\n * @param options - (optional) other optional parameters for the request.\n *                  `blockID` - The block id to start from, defaults to the best block.\n *                  `signerAddress` - The address of the signer of the transaction to filter transfers by.\n *                  `sender` - The sender address to filter transfers by.\n *                  `recipient` - The recipient address to filter transfers by.\n *\n * @returns The websocket subscription URL.\n */\nconst getVETtransfersSubscriptionUrl = (\n    baseURL: string,\n    options?: VETtransfersSubscriptionOptions\n): string => {\n    return thorest.subscriptions.get.VET_TRANSFER(baseURL, {\n        position: options?.blockID,\n        signerAddress: options?.signerAddress,\n        sender: options?.sender,\n        receiver: options?.recipient\n    });\n};\n\nexport { getVETtransfersSubscriptionUrl };\n","import { getBeatSubscriptionUrl, getLegacyBeatSubscriptionUrl } from './beat';\nimport { getBlockSubscriptionUrl } from './block';\nimport { getEventSubscriptionUrl } from './event';\nimport { getNewTransactionsSubscriptionUrl } from './transaction';\nimport { getVETtransfersSubscriptionUrl } from './transfer';\n\nexport type * from './types.d';\n\n/**\n * Subscriptions utilities.\n * Contains functions for obtaining URLs for subscribing to events through a websocket connection.\n */\nexport const subscriptions = {\n    getEventSubscriptionUrl,\n    getBlockSubscriptionUrl,\n    getNewTransactionsSubscriptionUrl,\n    getVETtransfersSubscriptionUrl,\n    getLegacyBeatSubscriptionUrl,\n    getBeatSubscriptionUrl\n};\n","import {\n    MAINNET_NETWORK,\n    SOLO_NETWORK,\n    TESTNET_NETWORK\n} from '@vechain/sdk-core';\n\nconst NetworkContracts: Record<\n    string,\n    { registry: string; resolveUtils: string }\n> = {\n    [MAINNET_NETWORK.genesisBlock.id]: {\n        registry: '0xa9231da8BF8D10e2df3f6E03Dd5449caD600129b',\n        resolveUtils: '0xA11413086e163e41901bb81fdc5617c975Fa5a1A'\n    },\n\n    [TESTNET_NETWORK.genesisBlock.id]: {\n        registry: '0xcBFB30c1F267914816668d53AcBA7bA7c9806D13',\n        resolveUtils: '0xc403b8EA53F707d7d4de095f0A20bC491Cf2bc94'\n    },\n\n    [SOLO_NETWORK.genesisBlock.id]: {\n        registry: '0x1c4a602ed21f3d1dddd1142c81f231ef1a08c921',\n        resolveUtils: '0xb2f08bbfa8a42b1fbe63feec604cb147385203d7'\n    }\n};\n\nexport { NetworkContracts };\n","import { ABIFunction, ABIItem, Address, ZERO_ADDRESS } from '@vechain/sdk-core';\nimport {\n    type BlocksModule,\n    type ThorClient,\n    type TransactionsModule\n} from '../../thor-client';\nimport { NetworkContracts } from './addresses';\n\n/**\n * Returns a single address or null for a name resolved at vet.domains\n *\n * @param thorClient - The thor client instance to use.\n * @param name - The name to resolve\n * @returns The address or null\n */\nconst resolveName = async (\n    thorClient: ThorClient,\n    name: string\n): Promise<null | string> => {\n    const [address] = await vnsUtils.resolveNames(\n        thorClient.blocks,\n        thorClient.transactions,\n        [name]\n    );\n    return address ?? null;\n};\n\n/**\n * Returns a list of addresses or null for names resolved by vet.domains\n *\n * @param thorClient - The thor client instance to use.\n * @param names - The names to resolve\n * @returns The list of the same size of names with the resolved address or null\n */\nconst resolveNames = async (\n    blocksModule: BlocksModule,\n    transactionsModule: TransactionsModule,\n    names: string[]\n): Promise<Array<null | string>> => {\n    // identify current chain\n    const genesisBlock = await blocksModule.getGenesisBlock();\n\n    // verify configuration for chain exists\n    if (\n        genesisBlock === null ||\n        !Address.isValid(NetworkContracts[genesisBlock.id]?.resolveUtils)\n    ) {\n        return names.map(() => null);\n    }\n\n    const resolveUtilsAddress = NetworkContracts[genesisBlock.id].resolveUtils;\n\n    // use the resolveUtils to lookup names\n    const callGetAddresses = await transactionsModule.executeCall(\n        resolveUtilsAddress,\n        ABIItem.ofSignature(\n            ABIFunction,\n            'function getAddresses(string[] names) returns (address[] addresses)'\n        ),\n        [names]\n    );\n\n    const [addresses] = callGetAddresses.result.array as string[][];\n\n    return addresses.map((address) => {\n        // zero addresses are missing configuration entries\n        if (address === ZERO_ADDRESS || !Address.isValid(address)) {\n            return null;\n        }\n\n        return address;\n    });\n};\n\n/**\n * Returns a single primary name for a given address resolved at vet.domains\n *\n * @param thorClient - The thor client instance to use.\n * @param address - The address to lookup\n * @returns The name or null\n */\nconst lookupAddress = async (\n    thorClient: ThorClient,\n    address: string\n): Promise<null | string> => {\n    const [name] = await vnsUtils.lookupAddresses(thorClient, [address]);\n    return name ?? null;\n};\n\n/**\n * Returns a list of names or null for addresses primary names resolved by vet.domains. Reverse lookup of name to address is verified.\n *\n * @param thorClient - The thor client instance to use.\n * @param addresses - The addresses to lookup\n * @returns The list of the same size of addresses with the resolved primary names or null\n */\nconst lookupAddresses = async (\n    thorClient: ThorClient,\n    addresses: string[]\n): Promise<Array<null | string>> => {\n    // identify current chain\n    const genesisBlock = await thorClient.blocks.getGenesisBlock();\n\n    // verify configuration for chain exists\n    if (\n        genesisBlock === null ||\n        !Address.isValid(NetworkContracts[genesisBlock.id]?.resolveUtils)\n    ) {\n        return addresses.map(() => null);\n    }\n\n    const resolveUtilsAddress = NetworkContracts[genesisBlock.id].resolveUtils;\n\n    // use the resolveUtils to lookup names\n    const callGetNames = await thorClient.contracts.executeCall(\n        resolveUtilsAddress,\n        ABIItem.ofSignature(\n            ABIFunction,\n            'function getNames(address[] addresses) returns (string[] names)'\n        ),\n        [addresses]\n    );\n\n    const [names] = callGetNames.result.array as string[][];\n\n    return names.map((name) => {\n        // empty strings indicate a missing entry\n        if (name === '') {\n            return null;\n        }\n\n        return name;\n    });\n};\n\nconst vnsUtils = { resolveName, resolveNames, lookupAddress, lookupAddresses };\nexport { vnsUtils };\n","import { AccountDetail } from './AccountDetail';\nimport { buildQuery, thorest } from '../../utils';\nimport { type AccountData } from './AccountData';\nimport { type AccountInputOptions } from './AccountInputOptions';\nimport { type Address, type BlockId, HexUInt } from '@vechain/sdk-core';\nimport { type HttpClient } from '../../http';\n\n/**\n * of the VeChain Thor blockchain.\n * It allows to retrieve details, bytecode, and storage data for a specific blockchain account.\n */\nclass AccountsModule {\n    /**\n     * Creates an instance of the class with a specified HTTP client.\n     *\n     * @param {HttpClient} httpClient - The HTTP client instance to be used for making requests.\n     */\n    constructor(readonly httpClient: HttpClient) {}\n\n    /**\n     * Retrieves the details of an account given the account address and optional parameters.\n     *\n     * @param {Address} address - The address of the account to be retrieved.\n     * @param {AccountInputOptions} [options] - Optional parameters to modify the account retrieval.\n     * @return {Promise<AccountDetail>} Returns a promise that resolves to the account details.\n     */\n    public async getAccount(\n        address: Address,\n        options?: AccountInputOptions\n    ): Promise<AccountDetail> {\n        const revision = options?.revision?.toString();\n        return new AccountDetail(\n            (await this.httpClient.get(\n                thorest.accounts.get.ACCOUNT_DETAIL(address.toString()),\n                {\n                    query: buildQuery({ revision })\n                }\n            )) as AccountData\n        );\n    }\n\n    /**\n     * Retrieves the bytecode of the smart contract deployed at the specified address.\n     *\n     * @param {Address} address - The address of the smart contract.\n     * @param {AccountInputOptions} [options] - Optional settings for the request, including the block revision.\n     * @return {Promise<HexUInt>} A promise that resolves to the bytecode of the smart contract.\n     */\n    public async getBytecode(\n        address: Address,\n        options?: AccountInputOptions\n    ): Promise<HexUInt> {\n        const revision = options?.revision?.toString();\n        const result = (await this.httpClient.get(\n            thorest.accounts.get.ACCOUNT_BYTECODE(address.toString()),\n            {\n                query: buildQuery({ revision })\n            }\n        )) as ResponseBytecode;\n        return HexUInt.of(result.code);\n    }\n\n    /**\n     * Retrieves the storage value at the specified storage position for a given address.\n     *\n     * @param {Address} address - The address of the account whose storage value is to be retrieved.\n     * @param {ThorId} position - The position in the storage from where the value is to be retrieved.\n     * @param {AccountInputOptions} [options] - Optional parameters including revision for specifying the block number or ID to query against.\n     * @return {Promise<HexUInt>} - A promise that resolves to the storage value as a string.\n     */\n    public async getStorageAt(\n        address: Address,\n        position: BlockId,\n        options?: AccountInputOptions\n    ): Promise<HexUInt> {\n        const pos = position.toString();\n        const revision = options?.revision?.toString();\n        const result = (await this.httpClient.get(\n            thorest.accounts.get.STORAGE_AT(address.toString(), pos),\n            {\n                query: buildQuery({ pos, revision })\n            }\n        )) as ResponseStorage;\n\n        return HexUInt.of(result.value);\n    }\n}\n\n/**\n * The bytecode of a smart contract.\n * The bytecode is represented in hex string.\n */\ninterface ResponseBytecode {\n    /**\n     * Bytecode of the smart contract\n     */\n    code: string;\n}\n\n/**\n * The storage data of a smart contract at the specified position.\n * The storage data is represented in hex string.\n */\ninterface ResponseStorage {\n    /**\n     * Hex string of the storage data\n     */\n    value: string;\n}\n\nexport { AccountsModule };\n","import { InvalidDataType } from '@vechain/sdk-errors';\nimport { buildQuery, type EventPoll, Poll, thorest } from '../../utils';\nimport {\n    type BlocksModuleOptions,\n    type CompressedBlockDetail,\n    type ExpandedBlockDetail,\n    type TransactionsExpandedBlockDetail,\n    type WaitForBlockOptions\n} from './types';\nimport { Revision, type TransactionClause } from '@vechain/sdk-core';\nimport { type HttpClient, HttpMethod } from '../../http';\n\n/** The `BlocksModule` class encapsulates functionality for interacting with blocks\n * on the VeChainThor blockchain.\n */\nclass BlocksModule {\n    /**\n     * The head block (best block). This is updated by the event poll instance every time a new block is produced.\n     * @private\n     */\n    private headBlock: CompressedBlockDetail | null = null;\n\n    /**\n     * Error handler for block-related errors.\n     */\n    public onBlockError?: (error: Error) => undefined;\n\n    /**\n     * The Poll instance for event polling\n     * @private\n     */\n    private pollInstance?: EventPoll<CompressedBlockDetail | null>;\n\n    /**\n     * Initializes a new instance of the `Thor` class.\n     * @param httpClient - The Thor instance used to interact with the VeChain blockchain API.\n     * @param options - (Optional) Other optional parameters for polling and error handling.\n     */\n    constructor(\n        readonly httpClient: HttpClient,\n        options?: BlocksModuleOptions\n    ) {\n        this.onBlockError = options?.onBlockError;\n        if (options?.isPollingEnabled === true) this.setupPolling();\n    }\n\n    /**\n     * Destroys the instance by stopping the event poll.\n     */\n    public destroy(): void {\n        if (this.pollInstance != null) {\n            this.pollInstance.stopListen();\n        }\n    }\n\n    /**\n     * Sets up the event polling for the best block.\n     * @private\n     * */\n    private setupPolling(): void {\n        this.pollInstance = Poll.createEventPoll(\n            async () => await this.getBestBlockCompressed(),\n            10000 // Poll every 10 seconds,\n        )\n            .onData((data) => {\n                this.headBlock = data;\n            })\n            .onError(this.onBlockError ?? ((): void => {}));\n\n        this.pollInstance.startListen();\n    }\n\n    /**\n     * Retrieves details of a compressed specific block identified by its revision (block number or ID).\n     *\n     * @param revision - The block number or ID to query details for.\n     * @returns A promise that resolves to an object containing the details of the compressed block.\n     * @throws {InvalidDataType}\n     */\n    public async getBlockCompressed(\n        revision: string | number\n    ): Promise<CompressedBlockDetail | null> {\n        // Check if the revision is a valid block number or ID\n        if (\n            revision !== null &&\n            revision !== undefined &&\n            !Revision.isValid(revision)\n        ) {\n            throw new InvalidDataType(\n                'BlocksModule.getBlockCompressed()',\n                'Invalid revision. The revision must be a string representing a block number or block id (also \"best\" is accepted which represents the best block & \"finalized\" for the finalized block).',\n                { revision }\n            );\n        }\n        return (await this.httpClient.http(\n            HttpMethod.GET,\n            thorest.blocks.get.BLOCK_DETAIL(revision)\n        )) as CompressedBlockDetail | null;\n    }\n\n    /**\n     * Retrieves details of an expanded specific block identified by its revision (block number or ID).\n     *\n     * @param revision - The block number or ID to query details for.\n     * @returns A promise that resolves to an object containing the details of the expanded block.\n     * @throws {InvalidDataType}\n     */\n    public async getBlockExpanded(\n        revision: string | number\n    ): Promise<ExpandedBlockDetail | null> {\n        // Check if the revision is a valid block number or ID\n        if (\n            revision !== null &&\n            revision !== undefined &&\n            !Revision.isValid(revision)\n        ) {\n            throw new InvalidDataType(\n                'BlocksModule.getBlockExpanded()',\n                'Invalid revision. The revision must be a string representing a block number or block id (also \"best\" is accepted which represents the best block & \"finalized\" for the finalized block).',\n                { revision }\n            );\n        }\n\n        return (await this.httpClient.http(\n            HttpMethod.GET,\n            thorest.blocks.get.BLOCK_DETAIL(revision),\n            {\n                query: buildQuery({ expanded: true })\n            }\n        )) as ExpandedBlockDetail | null;\n    }\n\n    /**\n     * Retrieves details of the latest block.\n     *\n     * @returns A promise that resolves to an object containing the compressed block details.\n     */\n    public async getBestBlockCompressed(): Promise<CompressedBlockDetail | null> {\n        return await this.getBlockCompressed('best');\n    }\n\n    /**\n     * Retrieves details of the latest block.\n     *\n     * @returns A promise that resolves to an object containing the expanded block details.\n     */\n    public async getBestBlockExpanded(): Promise<ExpandedBlockDetail | null> {\n        return await this.getBlockExpanded('best');\n    }\n\n    /**\n     * Retrieves the base fee per gas of the best block.\n     *\n     * @returns A promise that resolves to the base fee per gas of the best block.\n     */\n    public async getBestBlockBaseFeePerGas(): Promise<string | null> {\n        const bestBlock = await this.getBestBlockCompressed();\n        if (bestBlock === null) return null;\n        return bestBlock.baseFeePerGas ?? null;\n    }\n\n    /**\n     * Asynchronously retrieves a reference to the best block in the blockchain.\n     *\n     * This method first calls `getBestBlockCompressed()` to obtain the current best block. If no block is found (i.e., if `getBestBlockCompressed()` returns `null`),\n     * the method returns `null` indicating that there's no block to reference. Otherwise, it extracts and returns the first 18 characters of the\n     * block's ID, providing the ref to the best block.\n     *\n     * @returns {Promise<string | null>} A promise that resolves to either a string representing the first 18 characters of the best block's ID,\n     * or `null` if no best block is found.\n     *\n     * @Example:\n     * const blockRef = await getBestBlockRef();\n     * if (blockRef) {\n     *     console.log(`Reference to the best block: ${blockRef}`);\n     * } else {\n     *     console.log(\"No best block found.\");\n     * }\n     */\n    public async getBestBlockRef(): Promise<string | null> {\n        const bestBlock = await this.getBestBlockCompressed();\n        if (bestBlock === null) return null;\n        return bestBlock.id.slice(0, 18);\n    }\n\n    /**\n     * Retrieves the finalized block.\n     *\n     * @returns A promise that resolves to an object containing the finalized block.\n     */\n    public async getFinalBlockCompressed(): Promise<CompressedBlockDetail | null> {\n        return await this.getBlockCompressed('finalized');\n    }\n\n    /**\n     * Retrieves details of the finalized block.\n     *\n     * @returns A promise that resolves to an object containing the finalized block details.\n     */\n    public async getFinalBlockExpanded(): Promise<ExpandedBlockDetail | null> {\n        return await this.getBlockExpanded('finalized');\n    }\n\n    /**\n     * Synchronously waits for a specific block revision using polling.\n     *\n     * @param blockNumber - The block number to wait for.\n     * @param expanded - A boolean indicating whether to wait for an expanded block.\n     * @param options - (Optional) Allows to specify timeout and interval in milliseconds\n     * @returns A promise that resolves to an object containing the compressed block.\n     * @throws {InvalidDataType}\n     */\n    private async _waitForBlock(\n        blockNumber: number,\n        expanded: boolean,\n        options?: WaitForBlockOptions\n    ): Promise<CompressedBlockDetail | ExpandedBlockDetail | null> {\n        if (\n            blockNumber !== undefined &&\n            blockNumber !== null &&\n            blockNumber <= 0\n        ) {\n            throw new InvalidDataType(\n                'BlocksModule.waitForBlock()',\n                'Invalid blockNumber. The blockNumber must be a number representing a block number.',\n                { blockNumber }\n            );\n        }\n\n        // Use the Poll.SyncPoll utility to repeatedly call getBestBlock with a specified interval\n        return await Poll.SyncPoll(\n            async () =>\n                expanded\n                    ? await this.getBlockExpanded(blockNumber)\n                    : await this.getBlockCompressed(blockNumber),\n            {\n                requestIntervalInMilliseconds: options?.intervalMs,\n                maximumWaitingTimeInMilliseconds: options?.timeoutMs\n            }\n        ).waitUntil((result) => {\n            // Continue polling until the result's block number matches the specified revision\n            return result != null && result.number == blockNumber;\n        });\n    }\n\n    /**\n     * Synchronously waits for a specific block revision using polling.\n     *\n     * @param blockNumber - The block number to wait for.\n     * @param options - (Optional) Allows to specify timeout and interval in milliseconds\n     * @returns A promise that resolves to an object containing the compressed block.\n     */\n    public async waitForBlockCompressed(\n        blockNumber: number,\n        options?: WaitForBlockOptions\n    ): Promise<CompressedBlockDetail | null> {\n        return (await this._waitForBlock(\n            blockNumber,\n            false,\n            options\n        )) as CompressedBlockDetail | null;\n    }\n\n    /**\n     * Synchronously waits for a specific expanded block revision using polling.\n     *\n     * @param blockNumber - The block number to wait for.\n     * @param options - (Optional) Allows to specify timeout and interval in milliseconds\n     * @returns A promise that resolves to an object containing the expanded block details.\n     */\n    public async waitForBlockExpanded(\n        blockNumber: number,\n        options?: WaitForBlockOptions\n    ): Promise<ExpandedBlockDetail | null> {\n        return (await this._waitForBlock(\n            blockNumber,\n            true,\n            options\n        )) as ExpandedBlockDetail | null;\n    }\n\n    /**\n     * Returns the head block (best block).\n     * @returns {BlockDetail | null} The head block (best block).\n     */\n    public getHeadBlock(): CompressedBlockDetail | null {\n        return this.headBlock;\n    }\n\n    /**\n     * Retrieves details of the genesis block.\n     *\n     * @returns A promise that resolves to an object containing the block details of the genesis block.\n     */\n    public async getGenesisBlock(): Promise<CompressedBlockDetail | null> {\n        return await this.getBlockCompressed(0);\n    }\n\n    /**\n     * Retrieves all addresses involved in a given block. This includes beneficiary, signer, clauses,\n     * gas payer, origin, contract addresses, event addresses, and transfer recipients and senders.\n     *\n     * @param {ExpandedBlockDetail} block - The block object to extract addresses from.\n     *\n     * @returns {string[]} - An array of addresses involved in the block, included\n     * empty addresses, duplicate elements are removed.\n     *\n     */\n    public getAllAddressesIntoABlock(block: ExpandedBlockDetail): string[] {\n        const addresses = new Set<string>();\n        addresses.add(block.beneficiary);\n        addresses.add(block.signer);\n        block.transactions.forEach(\n            (transaction: TransactionsExpandedBlockDetail) => {\n                transaction.clauses.forEach((clause: TransactionClause) => {\n                    if (typeof clause.to === 'string') {\n                        addresses.add(clause.to);\n                    }\n                });\n                addresses.add(transaction.gasPayer);\n                addresses.add(transaction.origin);\n                transaction.outputs.forEach((output) => {\n                    if (typeof output.contractAddress === 'string') {\n                        addresses.add(output.contractAddress);\n                    }\n                    output.events.forEach((event) => {\n                        addresses.add(event.address);\n                    });\n                    output.transfers.forEach((transfer) => {\n                        addresses.add(transfer.recipient);\n                        addresses.add(transfer.sender);\n                    });\n                });\n            }\n        );\n        return Array.from(addresses);\n    }\n}\n\nexport { BlocksModule };\n","import type {\n    EventLogs,\n    FilterCriteria,\n    FilterEventLogsOptions\n} from '../../logs';\nimport { type Contract } from './contract';\nimport { type Abi } from 'abitype';\nimport { type TransferFilterOptions } from './types';\n\n/**\n * Represents a filter for events emitted by a smart contract. This class allows for the specification of criteria to filter\n * events and provides a method to fetch event logs based on those criteria.\n */\nclass ContractFilter<TAbi extends Abi> {\n    /**\n     * The smart contract instance to apply the filter on.\n     */\n    public contract: Contract<TAbi>;\n    /**\n     * A set of criteria used to filter events.\n     */\n    public criteriaSet: FilterCriteria[];\n\n    /**\n     * Constructs an instance of the `ContractFilter` class.\n     *\n     * @param contract - The smart contract instance to apply the filter on.\n     * @param criteriaSet - A set of criteria used to filter events.\n     */\n    constructor(contract: Contract<TAbi>, criteriaSet: FilterCriteria[]) {\n        this.contract = contract;\n        this.criteriaSet = criteriaSet;\n    }\n\n    /**\n     * Retrieves event logs based on the specified filter criteria, range, pagination options, and order.\n     *\n     * @returns An array of event logs that match the specified criteria.\n     * @param param - The filter options to apply to the event logs.\n     */\n    public async get(param?: TransferFilterOptions): Promise<EventLogs[]> {\n        const filterEventLogsOptions: FilterEventLogsOptions = {\n            range: param?.range ?? {\n                unit: 'block',\n                from: 0,\n                to: (\n                    await this.contract.contractsModule.transactionsModule.blocksModule.getBestBlockCompressed()\n                )?.number\n            },\n            criteriaSet: this.criteriaSet,\n            options: param?.options,\n            order: param?.order ?? 'asc'\n        };\n        return await this.contract.contractsModule.transactionsModule.logsModule.filterEventLogs(\n            filterEventLogsOptions\n        );\n    }\n}\nexport { ContractFilter };\n","import {\n    Address,\n    Clause,\n    Revision,\n    type ContractClause,\n    type TransactionClause,\n    Units,\n    VET\n} from '@vechain/sdk-core';\nimport {\n    ContractCallError,\n    InvalidTransactionField\n} from '@vechain/sdk-errors';\nimport type {\n    Abi,\n    AbiParametersToPrimitiveTypes,\n    ExtractAbiEventNames,\n    ExtractAbiFunction,\n    ExtractAbiFunctionNames\n} from 'abitype';\nimport { type VeChainSigner } from '../../../signer';\nimport { type FilterCriteria } from '../../logs';\nimport { type SendTransactionResult } from '../../transactions/types';\nimport { type Contract } from './contract';\nimport { ContractFilter } from './contract-filter';\nimport {\n    type ClauseAdditionalOptions,\n    type ClauseComment,\n    type ClauseRevision,\n    type ContractFunctionClause,\n    type ContractFunctionCriteria,\n    type ContractFunctionFilter,\n    type ContractFunctionRead,\n    type ContractFunctionTransact,\n    type TransactionValue\n} from './types';\nimport type { ContractCallOptions } from '../types';\n\n/**\n * Creates a Proxy object for reading contract functions, allowing for the dynamic invocation of contract read operations.\n * @param contract - The contract instance\n * @returns A Proxy that intercepts calls to read contract functions, automatically handling the invocation with the configured options.\n */\nfunction getReadProxy<TAbi extends Abi>(\n    contract: Contract<TAbi>\n): ContractFunctionRead<TAbi, ExtractAbiFunctionNames<TAbi, 'pure' | 'view'>> {\n    return new Proxy(contract.read, {\n        get: (_target, prop) => {\n            // Otherwise, assume that the function is a contract method\n            return async (\n                ...args: AbiParametersToPrimitiveTypes<\n                    ExtractAbiFunction<TAbi, 'balanceOf'>['inputs'],\n                    'inputs'\n                >\n            ): Promise<unknown[]> => {\n                // check if the clause comment is provided as an argument\n\n                const extractOptionsResult = extractAndRemoveAdditionalOptions(\n                    args as unknown[]\n                );\n\n                const clauseAdditionalOptions =\n                    extractOptionsResult.clauseAdditionalOptions;\n\n                const functionAbi = contract.getFunctionAbi(prop);\n\n                const callOptions = {\n                    caller:\n                        contract.getSigner() !== undefined\n                            ? await contract.getSigner()?.getAddress()\n                            : undefined,\n                    ...contract.getContractReadOptions(),\n                    includeABI: true\n                } as ContractCallOptions & {\n                    caller?: string;\n                    includeABI: boolean;\n                };\n\n                if (clauseAdditionalOptions?.comment !== undefined) {\n                    callOptions.comment = clauseAdditionalOptions.comment;\n                }\n\n                if (clauseAdditionalOptions?.revision !== undefined) {\n                    callOptions.revision = Revision.of(\n                        clauseAdditionalOptions.revision\n                    );\n                }\n\n                const executeCallResult =\n                    await contract.contractsModule.executeCall(\n                        contract.address,\n                        functionAbi,\n                        extractOptionsResult.args,\n                        callOptions\n                    );\n\n                if (!executeCallResult.success) {\n                    throw new ContractCallError(\n                        functionAbi.stringSignature,\n                        executeCallResult.result.errorMessage as string,\n                        {\n                            contractAddress: contract.address\n                        }\n                    );\n                }\n\n                // Return the properly typed result based on the function's outputs\n                return executeCallResult.result.array ?? [];\n            };\n        }\n    });\n}\n\n/**\n * Creates a Proxy object for transacting with contract functions, allowing for the dynamic invocation of contract transaction operations.\n * @param contract - The contract instance\n * @returns A Proxy that intercepts calls to transaction contract functions, automatically handling the invocation with the configured options.\n * @throws {InvalidTransactionField}\n * @private\n */\nfunction getTransactProxy<TAbi extends Abi>(\n    contract: Contract<TAbi>\n): ContractFunctionTransact<\n    TAbi,\n    ExtractAbiFunctionNames<TAbi, 'nonpayable' | 'payable'>\n> {\n    return new Proxy(contract.transact, {\n        get: (_target, prop) => {\n            // Otherwise, assume that the function is a contract method\n            return async (\n                ...args: unknown[]\n            ): Promise<SendTransactionResult> => {\n                if (contract.getSigner() === undefined) {\n                    throw new InvalidTransactionField(\n                        'getTransactProxy()',\n                        'Caller signer is required to transact with the contract.',\n                        { fieldName: 'signer', prop }\n                    );\n                }\n\n                // get the transaction options for the contract\n                const transactionOptions =\n                    contract.getContractTransactOptions();\n\n                // check if the transaction value is provided as an argument\n\n                const extractAdditionalOptionsResult =\n                    extractAndRemoveAdditionalOptions(args);\n\n                const transactionValue =\n                    extractAdditionalOptionsResult.clauseAdditionalOptions\n                        ?.value;\n\n                const clauseComment =\n                    extractAdditionalOptionsResult.clauseAdditionalOptions\n                        ?.comment;\n\n                args = extractAdditionalOptionsResult.args;\n\n                return await contract.contractsModule.executeTransaction(\n                    contract.getSigner() as VeChainSigner,\n                    contract.address,\n                    contract.getFunctionAbi(prop),\n                    args,\n                    {\n                        ...transactionOptions,\n                        value:\n                            transactionOptions.value ??\n                            transactionValue ??\n                            '0x0',\n                        comment: clauseComment,\n                        includeABI: true\n                    }\n                );\n            };\n        }\n    });\n}\n\n/**\n * Creates a Proxy object for filtering contract events, allowing for the dynamic invocation of contract event filtering operations.\n * @param contract - The contract instance to create the filter proxy for.\n * @returns A Proxy that intercepts calls to filter contract events, automatically handling the invocation with the configured options.\n */\nfunction getFilterProxy<TAbi extends Abi>(\n    contract: Contract<TAbi>\n): ContractFunctionFilter<TAbi, ExtractAbiEventNames<TAbi>> {\n    return new Proxy(contract.filters, {\n        get: (_target, prop) => {\n            return (\n                // eslint-disable-next-line sonarjs/use-type-alias\n                args: Record<string, unknown> | unknown[] | undefined\n            ): ContractFilter<TAbi> => {\n                const criteriaSet = buildCriteria(contract, prop, args);\n\n                return new ContractFilter<TAbi>(contract, [criteriaSet]);\n            };\n        }\n    });\n}\n\n/**\n * Creates a Proxy object for interacting with contract functions, allowing for the dynamic invocation of contract functions.\n * @param contract - The contract instance to create the clause proxy for.\n * @returns A Proxy that intercepts calls to contract functions, automatically handling the invocation with the configured options.\n */\nfunction getClauseProxy<TAbi extends Abi>(\n    contract: Contract<TAbi>\n): ContractFunctionClause<TAbi, ExtractAbiFunctionNames<TAbi>> {\n    return new Proxy(contract.clause, {\n        get: (_target, prop) => {\n            return (...args: unknown[]): ContractClause => {\n                // get the transaction options for the contract\n                const transactionOptions =\n                    contract.getContractTransactOptions();\n\n                // check if the transaction value is provided as an argument\n                const extractAdditionalOptionsResult =\n                    extractAndRemoveAdditionalOptions(args);\n\n                const transactionValue =\n                    extractAdditionalOptionsResult.clauseAdditionalOptions\n                        ?.value;\n\n                const clauseComment =\n                    extractAdditionalOptionsResult.clauseAdditionalOptions\n                        ?.comment;\n\n                args = extractAdditionalOptionsResult.args;\n\n                // return the contract clause\n                return {\n                    clause: Clause.callFunction(\n                        Address.of(contract.address),\n                        contract.getFunctionAbi(prop),\n                        args,\n                        VET.of(\n                            transactionOptions.value ?? transactionValue ?? 0,\n                            Units.wei\n                        ),\n                        {\n                            comment: clauseComment,\n                            includeABI: true\n                        }\n                    ) as TransactionClause,\n                    functionAbi: contract.getFunctionAbi(prop)\n                };\n            };\n        }\n    });\n}\n\n/**\n * Create a proxy object for building event criteria for the event filtering.\n * @param contract - The contract instance to create the criteria proxy for.\n * @returns A Proxy that intercepts calls to build event criteria, automatically handling the invocation with the configured options.\n */\nfunction getCriteriaProxy<TAbi extends Abi>(\n    contract: Contract<TAbi>\n): ContractFunctionCriteria<TAbi, ExtractAbiEventNames<TAbi>> {\n    return new Proxy(contract.criteria, {\n        get: (_target, prop) => {\n            return (\n                args: Record<string, unknown> | unknown[] | undefined\n            ): FilterCriteria => {\n                return buildCriteria(contract, prop, args);\n            };\n        }\n    });\n}\n\n/**\n * Builds the filter criteria for the contract filter.\n * @param contract - The contract instance to create the criteria for.\n * @param prop - The property name of the contract event.\n * @param args - The arguments to filter the event.\n * @returns The event criteria for the contract filter.\n */\nfunction buildCriteria<TAbi extends Abi>(\n    contract: Contract<TAbi>,\n    prop: string | symbol,\n    args: Record<string, unknown> | unknown[] | undefined\n): FilterCriteria {\n    // Create the VeChain sdk event ABI\n    const eventAbi = contract.getEventAbi(prop);\n\n    // Create a map of encoded filter topics for the event\n    const topics = new Map<number, string | undefined>(\n        eventAbi\n            .encodeFilterTopicsNoNull(args)\n            .map((topic, index) => [index, topic])\n    );\n\n    // Create the criteria set for the contract filter\n    return {\n        criteria: {\n            address: contract.address,\n            topic0: topics.get(0) as string, // the first topic is always defined since it's the event signature\n            topic1: topics.has(1) ? topics.get(1) : undefined,\n            topic2: topics.has(2) ? topics.get(2) : undefined,\n            topic3: topics.has(3) ? topics.get(3) : undefined,\n            topic4: topics.has(4) ? topics.get(4) : undefined\n        },\n        eventAbi\n    };\n}\n\n/**\n * Extracts the transaction value and comment from the list of arguments, if present.\n * @param args - The list of arguments to search for the transaction value.\n * @returns The transaction value and comment object, if found in the arguments list. Also returns the list of arguments with the clause options removed.\n */\nfunction extractAndRemoveAdditionalOptions(args: unknown[]): {\n    args: unknown[];\n    clauseAdditionalOptions: ClauseAdditionalOptions | undefined;\n} {\n    // check if the transaction value is provided as an argument\n    const transactionValue = getTransactionValue(args);\n    const clauseComment = getClauseComment(args);\n    const clauseRevision = getRevision(args);\n\n    // if present remove the transaction value argument from the list of arguments\n    if (\n        transactionValue !== undefined ||\n        clauseComment !== undefined ||\n        clauseRevision !== undefined\n    ) {\n        args = args.filter(\n            (arg) =>\n                !(\n                    isTransactionValue(arg) ||\n                    isTransactionComment(arg) ||\n                    isRevision(arg)\n                )\n        );\n    }\n\n    return {\n        args,\n        clauseAdditionalOptions: {\n            value: transactionValue?.value,\n            comment: clauseComment?.comment,\n            revision: clauseRevision?.revision\n        }\n    };\n}\n\n/**\n * Extracts the transaction value from the list of arguments, if present.\n * @param args - The list of arguments to search for the transaction value.\n * @returns The transaction value object, if found in the arguments list.\n */\nfunction getTransactionValue(args: unknown[]): TransactionValue | undefined {\n    const found = args.find((arg) => isTransactionValue(arg));\n    if (!found) return undefined;\n    return {\n        value: (found.value as number | string | bigint).toString()\n    } as TransactionValue;\n}\n\n/**\n * Extracts the clause comment from the list of arguments, if present.\n * @param args - The list of arguments to search for the clause comment.\n * @returns The clause comment object, if found in the arguments list.\n */\nfunction getClauseComment(args: unknown[]): ClauseComment | undefined {\n    return args.find((arg) => isTransactionComment(arg)) as\n        | ClauseComment\n        | undefined;\n}\n\n/**\n * Extracts the revision from the list of arguments, if present.\n * @param args - The list of arguments to search for the revision.\n * @returns The revision object, if found in the arguments list.\n */\nfunction getRevision(args: unknown[]): ClauseRevision | undefined {\n    return args.find((arg) => isRevision(arg)) as ClauseRevision | undefined;\n}\n\n/**\n * Type guard function to check if an object is a TransactionValue.\n * @param obj - The object to check.\n * @returns True if the object is a TransactionValue, false otherwise.\n */\nfunction isTransactionValue(obj: unknown): obj is ClauseAdditionalOptions {\n    return (obj as ClauseAdditionalOptions).value !== undefined;\n}\n\n/**\n * Type guard function to check if an object is a ClauseComment.\n * @param obj - The object to check.\n * @returns True if the object is a ClauseComment, false otherwise.\n */\nfunction isTransactionComment(obj: unknown): obj is ClauseAdditionalOptions {\n    return (obj as ClauseAdditionalOptions).comment !== undefined;\n}\n\n/**\n * Type guard function to check if an object is a revision.\n * @param obj - The object to check.\n * @returns True if the object is a revision, false otherwise.\n */\nfunction isRevision(obj: unknown): obj is ClauseAdditionalOptions {\n    return (obj as ClauseAdditionalOptions).revision !== undefined;\n}\n\nexport {\n    getClauseProxy,\n    getCriteriaProxy,\n    getFilterProxy,\n    getReadProxy,\n    getTransactProxy\n};\n","import {\n    ABIContract,\n    type ABIEvent,\n    type ABIFunction\n} from '@vechain/sdk-core';\nimport {\n    type Abi,\n    type ExtractAbiEventNames,\n    type ExtractAbiFunctionNames\n} from 'abitype';\nimport { type VeChainSigner } from '../../../signer';\nimport type { TransactionReceipt } from '../../transactions/types';\nimport { type ContractsModule } from '../contracts-module';\nimport type { ContractCallOptions, ContractTransactionOptions } from '../types';\nimport {\n    getClauseProxy,\n    getCriteriaProxy,\n    getFilterProxy,\n    getReadProxy,\n    getTransactProxy\n} from './contract-proxy';\nimport {\n    type ContractFunctionClause,\n    type ContractFunctionCriteria,\n    type ContractFunctionFilter,\n    type ContractFunctionRead,\n    type ContractFunctionTransact\n} from './types';\n\n/**\n * A class representing a smart contract deployed on the blockchain.\n */\nclass Contract<TAbi extends Abi> {\n    readonly contractsModule: ContractsModule;\n    readonly address: string;\n    readonly abi: Abi;\n    private signer?: VeChainSigner;\n\n    readonly deployTransactionReceipt: TransactionReceipt | undefined;\n\n    public read: ContractFunctionRead<\n        TAbi,\n        ExtractAbiFunctionNames<TAbi, 'pure' | 'view'>\n    > = {} as ContractFunctionRead<\n        TAbi,\n        ExtractAbiFunctionNames<TAbi, 'pure' | 'view'>\n    >;\n\n    public transact: ContractFunctionTransact<\n        TAbi,\n        ExtractAbiFunctionNames<TAbi, 'payable' | 'nonpayable'>\n    > = {} as ContractFunctionTransact<\n        TAbi,\n        ExtractAbiFunctionNames<TAbi, 'payable' | 'nonpayable'>\n    >;\n\n    public filters: ContractFunctionFilter<TAbi, ExtractAbiEventNames<TAbi>> =\n        {} as ContractFunctionFilter<TAbi, ExtractAbiEventNames<TAbi>>;\n\n    public clause: ContractFunctionClause<TAbi, ExtractAbiFunctionNames<TAbi>> =\n        {} as ContractFunctionClause<TAbi, ExtractAbiFunctionNames<TAbi>>;\n\n    public criteria: ContractFunctionCriteria<\n        TAbi,\n        ExtractAbiEventNames<TAbi>\n    > = {} as ContractFunctionCriteria<TAbi, ExtractAbiEventNames<TAbi>>;\n\n    private contractCallOptions: ContractCallOptions = {};\n    private contractTransactionOptions: ContractTransactionOptions = {};\n\n    /**\n     * Initializes a new instance of the `Contract` class.\n     * @param address The address of the contract.\n     * @param abi The Application Binary Interface (ABI) of the contract, which defines the contract's methods and events.\n     * @param thor An instance of ThorClient to interact with the blockchain.\n     * @param signer The signer caller used for signing transactions.\n     * @param transactionReceipt (Optional) The transaction receipt of the contract deployment.\n     */\n    constructor(\n        address: string,\n        abi: Abi,\n        contractsModule: ContractsModule,\n        signer?: VeChainSigner,\n        transactionReceipt?: TransactionReceipt\n    ) {\n        this.abi = abi;\n        this.address = address;\n        this.contractsModule = contractsModule;\n        this.deployTransactionReceipt = transactionReceipt;\n        this.signer = signer;\n        this.read = getReadProxy(this);\n        this.transact = getTransactProxy(this);\n        this.filters = getFilterProxy(this);\n        this.clause = getClauseProxy(this);\n        this.criteria = getCriteriaProxy(this);\n    }\n\n    /**\n     * Sets the options for contract calls.\n     * @param options - The contract call options to set.\n     * @returns The updated contract call options.\n     */\n    public setContractReadOptions(\n        options: ContractCallOptions\n    ): ContractCallOptions {\n        this.contractCallOptions = options;\n        return this.contractCallOptions;\n    }\n\n    /**\n     * Clears the current contract call options, resetting them to an empty object.\n     * @returns The updated contract call options.\n     */\n    public getContractReadOptions(): ContractCallOptions {\n        return this.contractCallOptions;\n    }\n\n    /**\n     * Clears the current contract call options, resetting them to an empty object.\n     */\n    public clearContractReadOptions(): void {\n        this.contractCallOptions = {};\n    }\n\n    /**\n     * Sets the options for contract transactions.\n     * @param options - The contract transaction options to set.\n     * @returns The updated contract transaction options.\n     */\n    public setContractTransactOptions(\n        options: ContractTransactionOptions\n    ): ContractTransactionOptions {\n        this.contractTransactionOptions = options;\n        return this.contractTransactionOptions;\n    }\n\n    /**\n     * Retrieves the options for contract transactions.\n     * @returns The contract transaction options.\n     */\n    public getContractTransactOptions(): ContractTransactionOptions {\n        return this.contractTransactionOptions;\n    }\n\n    /**\n     * Clears the current contract transaction options, resetting them to an empty object.\n     */\n    public clearContractTransactOptions(): void {\n        this.contractTransactionOptions = {};\n    }\n\n    /**\n     * Sets the private key of the caller for signing transactions.\n     * @param signer - The caller signer\n     */\n    public setSigner(signer: VeChainSigner): VeChainSigner {\n        this.signer = signer;\n        return this.signer;\n    }\n\n    /**\n     * Get the caller signer used for signing transactions.\n     * @returns The signer used for signing transactions.\n     */\n    public getSigner(): VeChainSigner | undefined {\n        return this.signer;\n    }\n\n    /**\n     * Retrieves the function ABI for the specified function name.\n     * @param prop - The name of the function.\n     * @return The function ABI for the specified event name.\n     * @throws {InvalidAbiItem}\n     *\n     */\n    public getFunctionAbi(prop: string | symbol): ABIFunction {\n        return ABIContract.ofAbi(this.abi).getFunction(prop.toString());\n    }\n\n    /**\n     * Retrieves the event ABI for the specified event name.\n     * @param eventName - The name of the event.\n     * @return The event ABI for the specified event name.\n     * @throws {InvalidAbiItem}\n     */\n    public getEventAbi(eventName: string | symbol): ABIEvent {\n        return ABIContract.ofAbi(this.abi).getEvent(eventName.toString());\n    }\n}\n\nexport { Contract };\n","import {\n    Clause,\n    HexUInt,\n    Transaction,\n    type DeployParams,\n    type TransactionClause\n} from '@vechain/sdk-core';\nimport {\n    CannotFindTransaction,\n    ContractDeploymentFailed\n} from '@vechain/sdk-errors';\nimport { type Abi } from 'abitype';\nimport { signerUtils, type VeChainSigner } from '../../../signer';\nimport { type SendTransactionResult } from '../../transactions/types';\nimport type { ContractTransactionOptions } from '../types';\nimport { Contract } from './contract';\nimport { type ContractsModule } from '../contracts-module';\n\n/**\n * A factory class for deploying smart contracts to a blockchain using a ThorClient.\n */\nclass ContractFactory<TAbi extends Abi> {\n    /**\n     * The ABI (Application Binary Interface) of the contract.\n     */\n    private readonly abi: Abi;\n\n    /**\n     * The bytecode of the smart contract.\n     */\n    private readonly bytecode: string;\n\n    /**\n     * The signer used for signing transactions.\n     */\n    private readonly signer: VeChainSigner;\n\n    /**\n     * The result of the deployment transaction, undefined until a deployment is started.\n     */\n    private deployTransaction: SendTransactionResult | undefined;\n\n    readonly contractsModule: ContractsModule;\n\n    /**\n     * Initializes a new instance of the `ContractFactory` class.\n     * @param abi The Application Binary Interface (ABI) of the contract, which defines the contract's methods and events.\n     * @param bytecode The compiled bytecode of the contract, representing the contract's executable code.\n     * @param signer The signer used for signing transactions during contract deployment, ensuring the deployer's identity.\n     * @param contractsModule An instance of the module to interact with the blockchain.\n     */\n    constructor(\n        abi: Abi,\n        bytecode: string,\n        signer: VeChainSigner,\n        contractsModule: ContractsModule\n    ) {\n        this.abi = abi;\n        this.bytecode = bytecode;\n        this.signer = signer;\n        this.contractsModule = contractsModule;\n    }\n\n    /**\n     * Initiates the deployment of a smart contract.\n     *\n     * This method performs several steps to deploy a smart contract:\n     * 1. Builds a transaction clause for deploying the contract.\n     * 2. Estimates the gas cost required for the transaction.\n     * 3. Constructs the transaction body with the estimated gas cost.\n     * 4. Signs the transaction using the provided signer.\n     * 5. Sends the signed transaction to the blockchain.\n     *\n     * @param {DeployParams?} deployParams (Optional) parameters for contract deployment.\n     * @param {ContractTransactionOptions?} options (Optional) transaction options, such as gas limit.\n     * @returns {Promise<ContractFactory>} A promise that resolves to the instance of `ContractFactory`,\n     *          allowing for fluent chaining of further actions or queries.\n     * @throws {Error} Throws an error if any step in the deployment process fails.\n     */\n    public async startDeployment(\n        deployParams?: DeployParams,\n        options?: ContractTransactionOptions\n    ): Promise<ContractFactory<TAbi>> {\n        // Build a transaction for deploying the smart contract\n\n        const deployContractClause = Clause.deployContract(\n            HexUInt.of(this.bytecode),\n            deployParams\n        ) as TransactionClause;\n\n        // Estimate the gas cost of the transaction\n        const gasResult =\n            await this.contractsModule.transactionsModule.estimateGas(\n                [deployContractClause],\n                await this.signer.getAddress(),\n                options // Pass through EstimateGasOptions including gasPadding\n            );\n\n        const txBody =\n            await this.contractsModule.transactionsModule.buildTransactionBody(\n                [deployContractClause],\n                gasResult.totalGas,\n                options\n            );\n\n        // Sign the transaction\n        const signedTx = await this.signer.signTransaction(\n            signerUtils.transactionBodyToTransactionRequestInput(\n                txBody,\n                await this.signer.getAddress()\n            )\n        );\n\n        // Send the signed transaction to the blockchain\n        this.deployTransaction =\n            await this.contractsModule.transactionsModule.sendTransaction(\n                Transaction.decode(HexUInt.of(signedTx.slice(2)).bytes, true)\n            );\n\n        return this;\n    }\n\n    /**\n     * Waits for the completion of a contract deployment transaction.\n     *\n     * This method checks for the presence of a deployed transaction result and then\n     * waits for the transaction to be processed. Upon successful processing, it\n     * constructs and returns a new `Contract` instance based on the transaction receipt.\n     *\n     * @returns {Promise<Contract>} A promise that resolves to a `Contract` instance\n     *          once the deployment transaction is completed.\n     * @throws {CannotFindTransaction, ContractDeploymentFailed}\n     */\n    public async waitForDeployment(): Promise<Contract<TAbi>> {\n        // Check if the deploy transaction result is available\n        if (this.deployTransaction?.id === undefined) {\n            throw new CannotFindTransaction(\n                'ContractFactory.waitForDeployment()',\n                'Cannot find a contract deployment transaction',\n                {\n                    networkUrl:\n                        this.contractsModule.transactionsModule.blocksModule\n                            .httpClient.baseURL\n                }\n            );\n        }\n\n        // Wait for the transaction to be processed\n        const transactionReceipt = await this.deployTransaction.wait();\n\n        // Ensure that the transaction receipt is valid\n        if (\n            transactionReceipt?.outputs[0]?.contractAddress === null ||\n            transactionReceipt?.outputs[0]?.contractAddress === undefined\n        ) {\n            throw new ContractDeploymentFailed(\n                'ContractFactory.waitForDeployment()',\n                'Contract deployment failed.',\n                {\n                    deployTransaction: this.deployTransaction\n                }\n            );\n        }\n\n        // Construct and return a new Contract instance\n        return new Contract<TAbi>(\n            transactionReceipt?.outputs[0].contractAddress,\n            this.abi,\n            this.contractsModule,\n            this.signer,\n            transactionReceipt\n        );\n    }\n\n    /**\n     * Returns the deploy transaction result, if available.\n     */\n    public getDeployTransaction(): SendTransactionResult | undefined {\n        return this.deployTransaction;\n    }\n}\n\nexport { ContractFactory };\n","import {\n    TransactionClause,\n    type ABIFunction,\n    type ContractClause\n} from '@vechain/sdk-core';\nimport { type Abi } from 'abitype';\nimport { type VeChainSigner } from '../../signer/signers/types';\nimport {\n    type SendTransactionResult,\n    type SimulateTransactionOptions\n} from '../transactions/types';\nimport { Contract, ContractFactory } from './model';\nimport type {\n    ContractCallOptions,\n    ContractCallResult,\n    ContractTransactionOptions\n} from './types';\nimport { type TransactionsModule } from '../transactions';\n\n/**\n * Represents a module for interacting with smart contracts on the blockchain.\n */\nclass ContractsModule {\n    constructor(readonly transactionsModule: TransactionsModule) {}\n\n    /**\n     * Creates a new instance of `ContractFactory` configured with the specified ABI, bytecode, and signer.\n     * This factory is used to deploy new smart contracts to the blockchain network managed by this instance.\n     *\n     * @param abi - The Application Binary Interface (ABI) of the contract, which defines the contract's methods and events.\n     * @param bytecode - The compiled bytecode of the contract, representing the contract's executable code.\n     * @param signer - The signer used for signing transactions during contract deployment, ensuring the deployer's identity.\n     * @returns An instance of `ContractFactory` configured with the provided ABI, bytecode, and signer, ready for deploying contracts.\n     */\n    public createContractFactory<TAbi extends Abi>(\n        abi: TAbi,\n        bytecode: string,\n        signer: VeChainSigner\n    ): ContractFactory<TAbi> {\n        return new ContractFactory<TAbi>(abi, bytecode, signer, this);\n    }\n\n    /**\n     * Initializes and returns a new Contract instance with the provided parameters.\n     *\n     * @param address - The blockchain address of the contract to load.\n     * @param abi - The Application Binary Interface (ABI) of the contract, which defines the contract's methods and structures.\n     * @param signer - Optional. The signer caller, used for signing transactions when interacting with the contract.\n     * @returns A new instance of the Contract, initialized with the provided address, ABI, and optionally, a signer.\n     */\n    public load<Tabi extends Abi>(\n        address: string,\n        abi: Tabi,\n        signer?: VeChainSigner\n    ): Contract<Tabi> {\n        return new Contract<Tabi>(address, abi, this, signer);\n    }\n\n    /**\n     * This method is going to be deprecated in next release.\n     * Use {@link TransactionsModule.executeCall} instead.\n     */\n    public async executeCall(\n        contractAddress: string,\n        functionAbi: ABIFunction,\n        functionData: unknown[],\n        contractCallOptions?: ContractCallOptions\n    ): Promise<ContractCallResult> {\n        return await this.transactionsModule.executeCall(\n            contractAddress,\n            functionAbi,\n            functionData,\n            contractCallOptions\n        );\n    }\n\n    /**\n     * This method is going to be deprecated in the next release.\n     * Use {@link TransactionsModule.executeMultipleClausesCall} next.\n     */\n    public async executeMultipleClausesCall(\n        clauses: ContractClause[],\n        options?: SimulateTransactionOptions\n    ): Promise<ContractCallResult[]> {\n        if (clauses.every((clause) => 'clause' in clause)) {\n            return await this.transactionsModule.executeMultipleClausesCall(\n                clauses,\n                options\n            );\n        }\n        return await this.transactionsModule.executeMultipleClausesCall(\n            clauses,\n            options\n        );\n    }\n\n    /**\n     * This method is going to be deprecated in the next release.\n     * Use {@link TransactionsModule.executeTransaction} instead.\n     */\n    public async executeTransaction(\n        signer: VeChainSigner,\n        contractAddress: string,\n        functionAbi: ABIFunction,\n        functionData: unknown[],\n        options?: ContractTransactionOptions\n    ): Promise<SendTransactionResult> {\n        return await this.transactionsModule.executeTransaction(\n            signer,\n            contractAddress,\n            functionAbi,\n            functionData,\n            options\n        );\n    }\n\n    /**\n     * This method is going to be deprected in the next release.\n     * Use {@link TransactionsModule.executeMultipleClausesTransaction} instead.\n     */\n    public async executeMultipleClausesTransaction(\n        clauses: ContractClause[] | TransactionClause[],\n        signer: VeChainSigner,\n        options?: ContractTransactionOptions\n    ): Promise<SendTransactionResult> {\n        return await this.transactionsModule.executeMultipleClausesTransaction(\n            clauses,\n            signer,\n            options\n        );\n    }\n\n    /**\n     * This method is going to be deprecated in the next release.\n     * Use {@link TransactionsModule.getLegacyBaseGasPrice} instead.\n     */\n    public async getLegacyBaseGasPrice(): Promise<ContractCallResult> {\n        return await this.transactionsModule.getLegacyBaseGasPrice();\n    }\n}\n\nexport { ContractsModule };\n","import { InvalidDataType } from '@vechain/sdk-errors';\nimport { thorest } from '../../utils';\nimport { type ContractTraceTarget } from './ContractTraceTarget';\nimport { type HttpClient } from '../../http';\nimport { type RetrieveStorageRange } from './RetrieveStorageRange';\nimport { type RetrieveStorageRangeOptions } from './RetrieveStorageRangeOptions';\nimport { type TransactionTraceTarget } from './TransactionTraceTarget';\nimport {\n    type ContractTraceOptions,\n    type TracerConfig,\n    type TraceReturnType,\n    type TracerName\n} from './types';\nimport { HexUInt } from '@vechain/sdk-core';\n\n/**\n * The class provides methods to debug the VeChain Thor blockchain.\n */\nclass DebugModule {\n    /**\n     * Creates an instance of the class with a specified HTTP client.\n     *\n     * @param {HttpClient} httpClient - The HTTP client instance to be used for making requests.\n     */\n    constructor(readonly httpClient: HttpClient) {}\n\n    /**\n     * Retrieve the storage range for a specified transaction trace target.\n     *\n     * @param {Object} input - The input parameters.\n     * @param {TransactionTraceTarget} input.target - The transaction trace target containing the block ID, transaction, and clause index.\n     * @param {RetrieveStorageRangeOptions} [input.options] - Optional settings for the retrieval process.\n     * @param {Address} [input.options.address] - The address for which to retrieve the storage range.\n     * @param {KeyStart} [input.options.keyStart] - The starting key for the storage range retrieval.\n     * @param {number} [input.options.maxResult] - The maximum number of results to retrieve.\n     *\n     * @return {Promise<RetrieveStorageRange>} The storage range data for the specified target.\n     *\n     * @throws IllegalDataType If {@link TransactionTraceTarget} `input.target` has a negative `clauseIndex` or `transaction` property.\n     */\n    public async retrieveStorageRange(input: {\n        target: TransactionTraceTarget;\n        options?: RetrieveStorageRangeOptions;\n    }): Promise<RetrieveStorageRange> {\n        // Validate target. If invalid, assert\n        this.validateTarget(input.target, 'retrieveStorageRange');\n\n        // Parse target\n        const parsedTarget = `${input.target.blockId}/${input.target.transaction}/${input.target.clauseIndex}`;\n\n        // Send request\n        return (await this.httpClient.post(\n            thorest.debug.post.RETRIEVE_STORAGE_RANGE(),\n            {\n                query: {},\n                body: {\n                    target: parsedTarget,\n                    address: input.options?.address?.toString(),\n                    keyStart: input.options?.keyStart?.toString(),\n                    maxResult: input.options?.maxResult\n                },\n                headers: {}\n            }\n        )) as RetrieveStorageRange;\n    }\n\n    /**\n     * Traces a contract call using the specified target, options, and configuration.\n     *\n     * @param {Object} input - The input parameters for the contract call trace.\n     * @param {ContractTraceTarget} [input.target] - The target contract details.\n     * @param {ContractTraceOptions} [input.options] - Optional configuration for the contract trace.\n     * @param {TracerConfig<typeof name>} [input.config] - Configuration for the tracer.\n     * @param {TracerName} [name] - The name of the tracer to be used.\n     * @return {Promise<TraceReturnType<typeof name>>} A promise that resolves to the trace result.\n     */\n    public async traceContractCall(\n        input: {\n            target?: ContractTraceTarget;\n            options?: ContractTraceOptions;\n            config?: TracerConfig<typeof name>;\n        },\n        name?: TracerName\n    ): Promise<TraceReturnType<typeof name>> {\n        // Send request\n        return (await this.httpClient.post(\n            thorest.debug.post.TRACE_CONTRACT_CALL(),\n            {\n                query: {},\n                body: {\n                    to: input.target?.to?.toString(),\n                    data: input.target?.data?.toString(),\n                    value:\n                        typeof input.target?.value?.wei === 'bigint'\n                            ? HexUInt.of(input.target.value.wei).toString()\n                            : undefined,\n                    name,\n                    gas: input.options?.gas,\n                    gasPrice: input.options?.gasPrice,\n                    caller: input.options?.caller,\n                    provedWork: input.options?.provedWork,\n                    gasPayer: input.options?.gasPayer,\n                    expiration: input.options?.expiration,\n                    blockRef: input.options?.blockRef,\n                    config: input.config\n                },\n                headers: {}\n            }\n        )) as TraceReturnType<typeof name>;\n    }\n\n    /**\n     * Traces a transaction clause based on the provided target and configuration.\n     *\n     * Tracers are instrumental in monitoring and analyzing the execution flow within the EVM.\n     *\n     * @param {Object} input - The input object containing the transaction trace target and optional tracer config.\n     * @param {TransactionTraceTarget} input.target - The target transaction details including block ID, transaction ID, and clause index.\n     * @param {TracerConfig<typeof name>} [input.config] - Optional tracer configuration settings.\n     * @param {TracerName} [name] - Optional name for the tracer.\n     * @return {Promise<TraceReturnType<typeof name>>} - The result of the trace operation.\n     * @throws {InvalidDataType} - If the `input.target.transaction`  or `input.target.clauseIndex` properties are invalid.\n     */\n    public async traceTransactionClause(\n        input: {\n            target: TransactionTraceTarget;\n            config?: TracerConfig<typeof name>;\n        },\n        name?: TracerName\n    ): Promise<TraceReturnType<typeof name>> {\n        // Validate target. If invalid, assert\n        this.validateTarget(input.target, 'traceTransactionClause');\n        // Parse target\n        const parsedTarget = `${input.target.blockId}/${input.target.transaction}/${input.target.clauseIndex}`;\n        // Send request\n        return (await this.httpClient.post(\n            thorest.debug.post.TRACE_TRANSACTION_CLAUSE(),\n            {\n                query: {},\n                body: {\n                    target: parsedTarget,\n                    name,\n                    config: input.config\n                },\n                headers: {}\n            }\n        )) as TraceReturnType<typeof name>;\n    }\n\n    /**\n     * Validates the properties of a TransactionTraceTarget object.\n     *\n     * @param {TransactionTraceTarget} target - The target object containing transaction details to be validated.\n     * @param {string} functionName - The name of the function where this validation is invoked.\n     * @throws {InvalidDataType} If the transaction or clauseIndex properties in the target object are invalid.\n     */\n    private validateTarget(\n        target: TransactionTraceTarget,\n        functionName: string\n    ): void {\n        // Validate target - transaction\n        if (typeof target.transaction === 'number') {\n            if (target.transaction < 0) {\n                throw new InvalidDataType(\n                    'DebugModule.validateTarget()',\n                    `invalid transaction index '${target.transaction}' given as input for ${functionName}.`,\n                    {\n                        transaction: target.transaction,\n                        functionName\n                    }\n                );\n            }\n        }\n        // Validate target - clauseIndex\n        if (target.clauseIndex < 0) {\n            throw new InvalidDataType(\n                'DebugModule.validateTarget()',\n                `invalid clause index '${target.clauseIndex}' given as input for ${functionName}.`,\n                { clauseIndex: target.clauseIndex, functionName }\n            );\n        }\n    }\n}\n\nexport { DebugModule };\n","import {\n    type FeesPriorityResponse,\n    type FeeHistoryResponse,\n    type FeeHistoryOptions,\n    type EstimateGasOptions,\n    type EstimateGasResult\n} from './types';\nimport { InvalidDataType } from '@vechain/sdk-errors';\nimport { HttpMethod, type HttpClient } from '../../http';\nimport { ContractClause, HexUInt, Revision } from '@vechain/sdk-core';\nimport { thorest } from '../../utils';\nimport { type SimulateTransactionClause } from '../transactions/types';\n\ninterface TransactionModuleInterface {\n    estimateGas: (\n        clauses: (SimulateTransactionClause | ContractClause)[],\n        caller?: string,\n        options?: EstimateGasOptions\n    ) => Promise<EstimateGasResult>;\n}\n\n/**\n * The `GasModule` handles gas related operations and provides\n * convenient methods for estimating the gas cost of a transaction.\n */\nclass GasModule {\n    readonly httpClient: HttpClient;\n    protected transactionsModule: TransactionModuleInterface | null;\n\n    constructor(httpClient: HttpClient) {\n        this.httpClient = httpClient;\n        this.transactionsModule = null;\n    }\n\n    /**\n     * Sets the transactions module.\n     *\n     * @param transactionsModule - The transactions module to set.\n     */\n    public setTransactionsModule(\n        transactionsModule: TransactionModuleInterface\n    ): void {\n        this.transactionsModule = transactionsModule;\n    }\n\n    /**\n     * Simulates a transaction and returns an object containing information regarding the gas used and whether the transaction reverted.\n     *\n     * @note The caller option is suggested as estimation without this parameter may not be accurate.\n     *\n     * @param clauses - The clauses of the transaction to simulate.\n     * @param caller - The address of the account sending the transaction.\n     * @param options - Optional parameters for the request. Includes all options of the `simulateTransaction` method excluding the `caller` option.\n     *                  @see {@link TransactionsClient#simulateTransaction}\n     *                  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].\n     * @returns An object containing information regarding the gas used and whether the transaction reverted, together with the decoded revert reason and VM errors.\n     * @throws{InvalidDataType}\n     */\n    public async estimateGas(\n        clauses: (SimulateTransactionClause | ContractClause)[],\n        caller?: string,\n        options?: EstimateGasOptions\n    ): Promise<EstimateGasResult> {\n        if (this.transactionsModule == null) {\n            throw new InvalidDataType(\n                'estimateGas()',\n                'Transactions module not set',\n                {}\n            );\n        }\n        return await this.transactionsModule.estimateGas(\n            clauses,\n            caller,\n            options\n        );\n    }\n\n    /**\n     * Returns the suggested priority fee per gas in wei.\n     * This is calculated based on the current base fee and network conditions.\n     *\n     * @returns Suggested priority fee per gas in wei (hex string)\n     * @throws {InvalidDataType}\n     */\n    public async getMaxPriorityFeePerGas(): Promise<string> {\n        const response = (await this.httpClient.get(\n            '/fees/priority'\n        )) as FeesPriorityResponse;\n\n        // Validate response\n        if (\n            response === null ||\n            response === undefined ||\n            typeof response !== 'object'\n        ) {\n            throw new InvalidDataType(\n                'getMaxPriorityFeePerGas()',\n                'Invalid response format from /fees/priority endpoint',\n                { response }\n            );\n        }\n\n        if (\n            response.maxPriorityFeePerGas === undefined ||\n            response.maxPriorityFeePerGas === null ||\n            response.maxPriorityFeePerGas === '' ||\n            typeof response.maxPriorityFeePerGas !== 'string'\n        ) {\n            throw new InvalidDataType(\n                'getMaxPriorityFeePerGas()',\n                'Missing or invalid maxPriorityFeePerGas in response',\n                { response }\n            );\n        }\n\n        return response.maxPriorityFeePerGas;\n    }\n\n    /**\n     * Returns fee history for the returned block range.\n     *\n     * @param options - The options for the fee history request\n     * @returns Fee history for the returned block range\n     * @throws {InvalidDataType}\n     */\n    public async getFeeHistory(\n        options: FeeHistoryOptions\n    ): Promise<FeeHistoryResponse> {\n        if (\n            options === null ||\n            options === undefined ||\n            typeof options.blockCount !== 'number' ||\n            !Number.isFinite(options.blockCount) ||\n            options.blockCount <= 0\n        ) {\n            throw new InvalidDataType(\n                'getFeeHistory()',\n                'Invalid blockCount parameter',\n                { options }\n            );\n        }\n\n        if (\n            options.newestBlock !== null &&\n            options.newestBlock !== undefined &&\n            !Revision.isValid(options.newestBlock)\n        ) {\n            throw new InvalidDataType(\n                'getFeeHistory()',\n                'Invalid revision. The revision must be a string representing a block number or block id (also \"best\" is accepted which represents the best block & \"finalized\" for the finalized block).',\n                { options }\n            );\n        }\n\n        const response = await this.httpClient.http(\n            HttpMethod.GET,\n            thorest.fees.get.FEES_HISTORY(\n                options.blockCount,\n                options.newestBlock,\n                options.rewardPercentiles\n            )\n        );\n        if (\n            response === null ||\n            response === undefined ||\n            typeof response !== 'object'\n        ) {\n            throw new InvalidDataType(\n                'getFeeHistory()',\n                'Invalid response format from /fees/history endpoint',\n                { response }\n            );\n        }\n\n        return response as FeeHistoryResponse;\n    }\n\n    /**\n     * Returns the base fee per gas of the next block.\n     * @returns The base fee per gas of the next block.\n     */\n    public async getNextBlockBaseFeePerGas(): Promise<bigint | null> {\n        const options: FeeHistoryOptions = {\n            blockCount: 1,\n            newestBlock: 'next'\n        };\n        const feeHistory = await this.getFeeHistory(options);\n        if (\n            feeHistory.baseFeePerGas === null ||\n            feeHistory.baseFeePerGas === undefined ||\n            feeHistory.baseFeePerGas.length === 0\n        ) {\n            return null;\n        }\n        return HexUInt.of(feeHistory.baseFeePerGas[0]).bi;\n    }\n}\n\nexport { GasModule };\n","import { type ABIEvent, Hex } from '@vechain/sdk-core';\nimport { InvalidAbiItem } from '@vechain/sdk-errors';\nimport { thorest } from '../../utils/thorest/thorest';\nimport {\n    type EventLogs,\n    type FilterEventLogsOptions,\n    type FilterRawEventLogsOptions,\n    type FilterTransferLogsOptions,\n    type TransferLogs\n} from './types';\nimport { HttpMethod } from '../../http';\nimport { type BlocksModule } from '../blocks';\n\n/**\n * The `LogsClient` class provides methods to interact with log-related endpoints\n * of the VeChainThor blockchain. It allows filtering event and transfer logs.\n */\nclass LogsModule {\n    readonly blocksModule: BlocksModule;\n\n    constructor(blocksModule: BlocksModule) {\n        this.blocksModule = blocksModule;\n    }\n\n    /**\n     * Filters event logs based on the provided criteria. Raw event logs are not decoded.\n     *\n     * @param filterOptions - An object specifying filtering criteria for event logs.\n     * @returns A promise that resolves to filtered event logs.\n     */\n    public async filterRawEventLogs(\n        filterOptions: FilterRawEventLogsOptions\n    ): Promise<EventLogs[]> {\n        return (await this.blocksModule.httpClient.http(\n            HttpMethod.POST,\n            thorest.logs.post.EVENT_LOGS(),\n            {\n                query: {},\n                body: filterOptions,\n                headers: {}\n            }\n        )) as EventLogs[];\n    }\n\n    /**\n     * Filters event logs based on the provided criteria and decodes them using the provided ABI items.\n     * The decoded data is added to the event logs as a new property.\n     * @param filterOptions - An object specifying filtering criteria for event logs.\n     */\n    public async filterEventLogs(\n        filterOptions: FilterEventLogsOptions\n    ): Promise<EventLogs[]> {\n        // Extract raw event logs and ABI items from filter options\n        const eventAbis = filterOptions.criteriaSet?.map((c) => c.eventAbi);\n\n        const eventLogs = await this.getRawEventLogs(filterOptions);\n\n        const result: EventLogs[] = [];\n\n        if (eventAbis !== undefined) {\n            const uniqueEventAbis = this.removeDuplicatedAbis(eventAbis);\n\n            eventLogs.forEach((log) => {\n                const eventAbi = uniqueEventAbis.get(log.topics[0]);\n                if (eventAbi === undefined || eventAbi === null) {\n                    throw new InvalidAbiItem(\n                        'LogsModule.filterEventLogs',\n                        'Topic not found in the provided ABIs.',\n                        { type: 'event', value: log.topics[0] }\n                    );\n                }\n                log.decodedData = eventAbi.decodeEventLogAsArray({\n                    data: Hex.of(log.data),\n                    topics: log.topics.map((topic) => Hex.of(topic))\n                });\n                result.push(log);\n            });\n        }\n\n        return result;\n    }\n\n    /**\n     * Filters event logs based on the provided criteria and decodes them using the provided ABI items.\n     * The decoded data is added to the event logs as a new property.\n     * The result is an array of event logs grouped by the event topic hash.\n     * @param filterOptions\n     * @returns A promise that resolves to an array of event logs grouped by event.\n     */\n    public async filterGroupedEventLogs(\n        filterOptions: FilterEventLogsOptions\n    ): Promise<EventLogs[][]> {\n        // Extract raw event logs and ABI items from filter options\n        const eventAbis = filterOptions.criteriaSet?.map((c) => c.eventAbi);\n\n        const eventLogs = await this.getRawEventLogs(filterOptions);\n\n        const result = new Map<string, EventLogs[]>();\n\n        if (eventAbis !== undefined) {\n            const uniqueEventAbis = this.removeDuplicatedAbis(eventAbis);\n\n            // Initialize the result map with empty arrays for each unique ABI item\n            uniqueEventAbis.forEach((f) => result.set(f.signatureHash, []));\n\n            eventLogs.forEach((log) => {\n                const eventAbi = uniqueEventAbis.get(log.topics[0]);\n                if (eventAbi === undefined || eventAbi === null) {\n                    throw new InvalidAbiItem(\n                        'LogsModule.filterGroupedEventLogs',\n                        'Topic not found in the provided ABIs.',\n                        { type: 'event', value: log.topics[0] }\n                    );\n                }\n\n                log.decodedData = eventAbi.decodeEventLogAsArray({\n                    data: Hex.of(log.data),\n                    topics: log.topics.map((topic) => Hex.of(topic))\n                });\n                result.get(log.topics[0])?.push(log);\n            });\n        }\n\n        return Array.from(result.values());\n    }\n\n    /**\n     * Filters event logs based on the provided criteria without decoding them.\n     * @param filterOptions - An object specifying filtering criteria for event logs.\n     * @private Returns a promise that resolves to filtered non decoded event logs.\n     */\n    private async getRawEventLogs(\n        filterOptions: FilterEventLogsOptions\n    ): Promise<EventLogs[]> {\n        const criteriaSet = filterOptions.criteriaSet?.map((c) => c.criteria);\n        // Create new filter options with the criteria set\n        const filterRawEventLogsOptions: FilterRawEventLogsOptions = {\n            range: filterOptions.range ?? {\n                unit: 'block',\n                from: 0,\n                to: (await this.blocksModule.getBestBlockCompressed())?.number\n            },\n            criteriaSet,\n            options: filterOptions.options,\n            order: filterOptions.order ?? 'asc'\n        };\n\n        // Filter event logs based on the provided criteria\n        return await this.filterRawEventLogs(filterRawEventLogsOptions);\n    }\n\n    /**\n     * Removes duplicated ABI items from the provided array. ABI items are considered duplicated if they have the same topic hash.\n     * @param eventAbis - An array of event ABI items.\n     * @private Returns a map of unique ABI items.\n     */\n    private removeDuplicatedAbis(eventAbis: ABIEvent[]): Map<string, ABIEvent> {\n        const uniqueEventAbis = new Map<string, ABIEvent>();\n\n        eventAbis.forEach((obj) => {\n            if (!uniqueEventAbis.has(obj.signatureHash)) {\n                uniqueEventAbis.set(obj.signatureHash, obj);\n            }\n        });\n\n        return uniqueEventAbis;\n    }\n\n    /**\n     * Filters transfer logs based on the provided criteria.\n     *\n     * @param filterOptions - An object specifying filtering criteria for transfer logs.\n     * @returns A promise that resolves to filtered transfer logs.\n     */\n    public async filterTransferLogs(\n        filterOptions: FilterTransferLogsOptions\n    ): Promise<TransferLogs[]> {\n        return (await this.blocksModule.httpClient.http(\n            HttpMethod.POST,\n            thorest.logs.post.TRANSFER_LOGS(),\n            {\n                query: {},\n                body: filterOptions,\n                headers: {}\n            }\n        )) as TransferLogs[];\n    }\n}\n\nexport { LogsModule };\n","import { InvalidDataType } from '@vechain/sdk-errors';\nimport { NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS, thorest } from '../../utils';\nimport { type BlocksModule, type CompressedBlockDetail } from '../blocks';\nimport { type ConnectedPeer } from './types';\nimport { HttpMethod } from '../../http';\n\nconst chainTagCache = new WeakMap<BlocksModule, number>();\n/**\n * The `NodesModule` class serves as a module for node-related functionality, for example, checking the health of a node.\n */\nclass NodesModule {\n    readonly blocksModule: BlocksModule;\n\n    constructor(blocksModule: BlocksModule) {\n        this.blocksModule = blocksModule;\n    }\n\n    /**\n     * Retrieves connected peers of a node.\n     *\n     * @returns A promise that resolves to the list of connected peers.\n     */\n    public async getNodes(): Promise<ConnectedPeer[]> {\n        const nodes = (await this.blocksModule.httpClient.http(\n            HttpMethod.GET,\n            thorest.nodes.get.NODES()\n        )) as ConnectedPeer[] | null;\n        return nodes ?? [];\n    }\n\n    /**\n     * Checks the health of a node using the following algorithm:\n     * 1. Make an HTTP GET request to retrieve the last block timestamp.\n     * 2. Calculates the difference between the current time and the last block timestamp.\n     * 3. If the difference is less than the tolerance, the node is healthy.\n     * Note, we could also check '/node/network/peers since' but the difficulty with this approach is\n     * if you consider a scenario where the node is connected to 20+ peers, which is healthy, and it receives the new blocks as expected.\n     * 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\n     * though it's technically alive and connected\n     * @returns A boolean indicating whether the node is healthy.\n     * @throws {InvalidDataTypeError}\n     */\n    public async isHealthy(): Promise<boolean> {\n        /**\n         * @internal\n         * Perform an HTTP GET request using the SimpleNet instance to get the latest block\n         */\n        const response = await this.blocksModule.getBestBlockCompressed();\n\n        /**\n         * timestamp from the last block and, eventually handle errors\n         * @internal\n         */\n        const lastBlockTimestamp: number = this.getTimestampFromBlock(response);\n\n        /**\n         * seconds elapsed since the timestamp of the last block\n         * @internal\n         */\n        const secondsSinceLastBlock =\n            Math.floor(Date.now() / 1000) - lastBlockTimestamp;\n\n        return (\n            Math.abs(secondsSinceLastBlock) <\n            NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS\n        );\n    }\n\n    /**\n     * Extracts the timestamp from the block\n     * @remarks\n     * This function throws an error if the timestamp key does not exist in the response from the API call to the node\n     * @param response the response from the API call to the node\n     * @returns the timestamp from the block\n     * @throws{InvalidDataType}\n     */\n    private readonly getTimestampFromBlock = (\n        response: CompressedBlockDetail | null\n    ): number => {\n        if (\n            response === null ||\n            response === undefined ||\n            typeof response !== 'object' ||\n            !('timestamp' in response) ||\n            typeof response.timestamp !== 'number'\n        ) {\n            throw new InvalidDataType(\n                'NodesModule.getTimestampFromBlock()',\n                'Sending failed: Input must be a valid raw transaction in hex format.',\n                { response }\n            );\n        }\n\n        return response?.timestamp;\n    };\n\n    /**\n     * Retrieves and caches the chainTag from the genesis block of the given ThorClient.\n     * Uses the same short-circuit caching logic as eth_chainId().\n     */\n    public async getChaintag(): Promise<number> {\n        const cached = chainTagCache.get(this.blocksModule);\n\n        if (cached !== undefined) return cached;\n\n        const genesisBlock = await this.blocksModule.getGenesisBlock();\n\n        if (!genesisBlock?.id) {\n            throw new InvalidDataType(\n                'NodesModule.getChaintag()',\n                'The genesis block id is null or undefined. Unable to get the chain tag.',\n                { url: this.blocksModule.httpClient.baseURL }\n            );\n        }\n\n        // derive chainTag from last byte of the genesis block id\n        const chainTag = Number(`0x${genesisBlock.id.slice(-2)}`);\n        if (Number.isNaN(chainTag)) {\n            throw new InvalidDataType(\n                'NodesModule.getChaintag()',\n                'Invalid genesis block id. Unable to derive chain tag.',\n                { id: genesisBlock.id }\n            );\n        }\n\n        chainTagCache.set(this.blocksModule, chainTag);\n        return chainTag;\n    }\n}\n\nexport { NodesModule };\n","import { Keccak256, Txt } from '@vechain/sdk-core';\n\n/**\n * The selector of the `Error(string)` function in Solidity.\n */\nconst SOLIDITY_ERROR_SELECTOR = Keccak256.of(Txt.of('Error(string)').bytes)\n    .toString()\n    .slice(0, 10);\n\n/**\n * The selector of the `Panic(uint256)` function in Solidity.\n */\nconst SOLIDITY_PANIC_SELECTOR = Keccak256.of(Txt.of('Panic(uint256)').bytes)\n    .toString()\n    .slice(0, 10);\n\nexport { SOLIDITY_ERROR_SELECTOR, SOLIDITY_PANIC_SELECTOR };\n","// https://docs.soliditylang.org/en/v0.8.16/control-structures.html#error-handling-assert-require-revert-and-exceptions\n// builtin errors in solidity, Error(string) and Panic(uint256)\n\nimport { ABI } from '@vechain/sdk-core';\nimport { SOLIDITY_ERROR_SELECTOR, SOLIDITY_PANIC_SELECTOR } from './const';\n\n/**\n * Decodes revert reasons from a given hex-encoded data string, identifying whether the revert is due to an \"Error(string)\" or a \"Panic(uint256)\".\n *\n * @param data - Hex-encoded data containing revert information.\n * @returns Decoded revert reason or an error message if decoding fails.\n *\n * @example\n * ```typescript\n * const revertReason = decodeRevertReason('0x0123456789abcdef0123456789abcdef');\n * console.log(revertReason); // 'Decoded Revert Reason'\n * ```\n */\nfunction decodeRevertReason(data: string): string | undefined {\n    // Check if the revert reason starts with the error selector\n    if (data.startsWith(SOLIDITY_ERROR_SELECTOR))\n        // Decode the error message from the remaining data\n        return ABI.ofEncoded(\n            'string',\n            '0x' + data.slice(SOLIDITY_ERROR_SELECTOR.length)\n        ).getFirstDecodedValue();\n\n    if (data.startsWith(SOLIDITY_PANIC_SELECTOR)) {\n        // Decode the panic code and format it as a string\n        const decoded = ABI.ofEncoded(\n            'uint256',\n            '0x' + data.slice(SOLIDITY_PANIC_SELECTOR.length)\n        ).getFirstDecodedValue<string>();\n        return `Panic(0x${parseInt(decoded).toString(16).padStart(2, '0')})`;\n    }\n}\n\nexport { decodeRevertReason };\n","import {\n    ABI,\n    ABIContract,\n    type ABIFunction,\n    Address,\n    Clause,\n    type ContractClause,\n    dataUtils,\n    Hex,\n    HexUInt,\n    Revision,\n    ThorId,\n    Transaction,\n    type TransactionBody,\n    type TransactionClause,\n    Units,\n    VET\n} from '@vechain/sdk-core';\nimport {\n    InvalidDataType,\n    InvalidTransactionField,\n    HttpNetworkError\n} from '@vechain/sdk-errors';\nimport { ErrorFragment, Interface } from 'ethers';\nimport { HttpMethod } from '../../http';\nimport { blocksFormatter, getTransactionIndexIntoBlock } from '../../provider';\nimport type { VeChainSigner } from '../../signer';\nimport {\n    buildQuery,\n    BUILT_IN_CONTRACTS,\n    ERROR_SELECTOR,\n    PANIC_SELECTOR,\n    thorest,\n    vnsUtils\n} from '../../utils';\nimport { type BlocksModule, type ExpandedBlockDetail } from '../blocks';\nimport type {\n    ContractCallOptions,\n    ContractCallResult,\n    ContractTransactionOptions\n} from '../contracts';\nimport { type CallNameReturnType, type DebugModule } from '../debug';\nimport { type ForkDetector } from '../fork';\nimport { type GasModule } from '../gas';\nimport { decodeRevertReason } from '../gas/helpers/decode-evm-error';\nimport type { EstimateGasOptions, EstimateGasResult } from '../gas/types';\nimport { type LogsModule } from '../logs';\nimport {\n    type GetTransactionInputOptions,\n    type GetTransactionReceiptInputOptions,\n    type SendTransactionResult,\n    type SimulateTransactionClause,\n    type SimulateTransactionOptions,\n    type TransactionBodyOptions,\n    type TransactionDetailNoRaw,\n    type TransactionDetailRaw,\n    type TransactionReceipt,\n    type TransactionSimulationResult,\n    type WaitForTransactionOptions\n} from './types';\n\n/**\n * The `TransactionsModule` handles transaction related operations and provides\n * convenient methods for sending transactions and waiting for transaction confirmation.\n */\nclass TransactionsModule {\n    readonly blocksModule: BlocksModule;\n    readonly debugModule: DebugModule;\n    readonly logsModule: LogsModule;\n    readonly gasModule: GasModule;\n    readonly forkDetector: ForkDetector;\n\n    constructor(\n        blocksModule: BlocksModule,\n        debugModule: DebugModule,\n        logsModule: LogsModule,\n        gasModule: GasModule,\n        forkDetector: ForkDetector\n    ) {\n        this.blocksModule = blocksModule;\n        this.debugModule = debugModule;\n        this.logsModule = logsModule;\n        this.gasModule = gasModule;\n        this.forkDetector = forkDetector;\n    }\n\n    /**\n     * Retrieves the details of a transaction.\n     *\n     * @param id - Transaction ID of the transaction to retrieve.\n     * @param options - (Optional) Other optional parameters for the request.\n     * @returns A promise that resolves to the details of the transaction.\n     * @throws {InvalidDataType}\n     */\n    public async getTransaction(\n        id: string,\n        options?: GetTransactionInputOptions\n    ): Promise<TransactionDetailNoRaw | null> {\n        // Invalid transaction ID\n        if (!ThorId.isValid(id)) {\n            throw new InvalidDataType(\n                'TransactionsModule.getTransaction()',\n                'Invalid transaction ID given as input. Input must be an hex string of length 64.',\n                { id }\n            );\n        }\n\n        // Invalid head\n        if (options?.head !== undefined && !ThorId.isValid(options.head))\n            throw new InvalidDataType(\n                'TransactionsModule.getTransaction()',\n                'Invalid head given as input. Input must be an hex string of length 64.',\n                { head: options?.head }\n            );\n\n        return (await this.blocksModule.httpClient.http(\n            HttpMethod.GET,\n            thorest.transactions.get.TRANSACTION(id),\n            {\n                query: buildQuery({\n                    raw: false,\n                    head: options?.head,\n                    pending: options?.pending\n                })\n            }\n        )) as TransactionDetailNoRaw | null;\n    }\n\n    /**\n     * Retrieves the details of a transaction.\n     *\n     * @param id - Transaction ID of the transaction to retrieve.\n     * @param options - (Optional) Other optional parameters for the request.\n     * @returns A promise that resolves to the details of the transaction.\n     * @throws {InvalidDataType}\n     */\n    public async getTransactionRaw(\n        id: string,\n        options?: GetTransactionInputOptions\n    ): Promise<TransactionDetailRaw | null> {\n        // Invalid transaction ID\n        if (!ThorId.isValid(id)) {\n            throw new InvalidDataType(\n                'TransactionsModule.getTransactionRaw()',\n                'Invalid transaction ID given as input. Input must be an hex string of length 64.',\n                { id }\n            );\n        }\n\n        // Invalid head\n        if (options?.head !== undefined && !ThorId.isValid(options.head))\n            throw new InvalidDataType(\n                'TransactionsModule.getTransaction()',\n                'Invalid head given as input. Input must be an hex string of length 64.',\n                { head: options?.head }\n            );\n\n        return (await this.blocksModule.httpClient.http(\n            HttpMethod.GET,\n            thorest.transactions.get.TRANSACTION(id),\n            {\n                query: buildQuery({\n                    raw: true,\n                    head: options?.head,\n                    pending: options?.pending\n                })\n            }\n        )) as TransactionDetailRaw | null;\n    }\n\n    /**\n     * Retrieves the receipt of a transaction.\n     *\n     * @param id - Transaction ID of the transaction to retrieve.\n     * @param options - (Optional) Other optional parameters for the request.\n     *                  If `head` is not specified, the receipt of the transaction at the best block is returned.\n     * @returns A promise that resolves to the receipt of the transaction.\n     * @throws {InvalidDataType}\n     */\n    public async getTransactionReceipt(\n        id: string,\n        options?: GetTransactionReceiptInputOptions\n    ): Promise<TransactionReceipt | null> {\n        // Invalid transaction ID\n        if (!ThorId.isValid(id)) {\n            throw new InvalidDataType(\n                'TransactionsModule.getTransactionReceipt()',\n                'Invalid transaction ID given as input. Input must be an hex string of length 64.',\n                { id }\n            );\n        }\n\n        // Invalid head\n        if (options?.head !== undefined && !ThorId.isValid(options.head))\n            throw new InvalidDataType(\n                'TransactionsModule.getTransaction()',\n                'Invalid head given as input. Input must be an hex string of length 64.',\n                { head: options?.head }\n            );\n\n        try {\n            return (await this.blocksModule.httpClient.http(\n                HttpMethod.GET,\n                thorest.transactions.get.TRANSACTION_RECEIPT(id),\n                {\n                    query: buildQuery({ head: options?.head })\n                }\n            )) as TransactionReceipt | null;\n        } catch (error) {\n            // Check if this is a network communication error\n            if (error instanceof HttpNetworkError) {\n                // For network errors, return null instead of throwing\n                // This allows the polling mechanism to continue\n                return null;\n            }\n            throw error;\n        }\n    }\n\n    /**\n     * Retrieves the receipt of a transaction.\n     *\n     * @param raw - The raw transaction.\n     * @returns The transaction id of send transaction.\n     * @throws {InvalidDataType}\n     */\n    public async sendRawTransaction(\n        raw: string\n    ): Promise<SendTransactionResult> {\n        // Validate raw transaction\n        if (!Hex.isValid0x(raw)) {\n            throw new InvalidDataType(\n                'TransactionsModule.sendRawTransaction()',\n                'Sending failed: Input must be a valid raw transaction in hex format.',\n                { raw }\n            );\n        }\n\n        // Decode raw transaction to check if raw is ok\n        try {\n            Transaction.decode(HexUInt.of(raw.slice(2)).bytes, true);\n        } catch (error) {\n            throw new InvalidDataType(\n                'TransactionsModule.sendRawTransaction()',\n                'Sending failed: Input must be a valid raw transaction in hex format. Decoding error encountered.',\n                { raw },\n                error\n            );\n        }\n\n        const transactionResult = (await this.blocksModule.httpClient.http(\n            HttpMethod.POST,\n            thorest.transactions.post.TRANSACTION(),\n            {\n                body: { raw }\n            }\n        )) as SendTransactionResult;\n\n        return {\n            id: transactionResult.id,\n            wait: async (options?: WaitForTransactionOptions) =>\n                await this.waitForTransaction(transactionResult.id, options)\n        };\n    }\n\n    /**\n     * Sends a signed transaction to the network.\n     *\n     * @param signedTx - the transaction to send. It must be signed.\n     * @returns A promise that resolves to the transaction ID of the sent transaction.\n     * @throws {InvalidDataType}\n     */\n    public async sendTransaction(\n        signedTx: Transaction\n    ): Promise<SendTransactionResult> {\n        // Assert transaction is signed or not\n        if (!signedTx.isSigned) {\n            throw new InvalidDataType(\n                'TransactionsModule.sendTransaction()',\n                'Invalid transaction given as input. Transaction must be signed.',\n                { signedTx }\n            );\n        }\n\n        const rawTx = Hex.of(signedTx.encoded).toString();\n\n        return await this.sendRawTransaction(rawTx);\n    }\n\n    /**\n     * Waits for a transaction to be included in a block.\n     *\n     * @param txID - The transaction ID of the transaction to wait for.\n     * @param options - Optional parameters for the request. Includes the timeout and interval between requests.\n     *                  Both parameters are in milliseconds. If the timeout is not specified, the request will not time out!\n     * @returns A promise that resolves to the transaction receipt of the transaction. If the transaction is not included in a block before the timeout,\n     *          the promise will resolve to `null`.\n     * @throws {InvalidDataType}\n     */\n    public async waitForTransaction(\n        txID: string,\n        options?: WaitForTransactionOptions\n    ): Promise<TransactionReceipt | null> {\n        // Invalid transaction ID\n        if (!ThorId.isValid(txID)) {\n            throw new InvalidDataType(\n                'TransactionsModule.waitForTransaction()',\n                'Invalid transaction ID given as input. Input must be an hex string of length 64.',\n                { txID }\n            );\n        }\n\n        // If no timeout is specified, use default timeout of 30 seconds\n        const timeoutMs = options?.timeoutMs ?? 30000;\n        const intervalMs = options?.intervalMs ?? 1000;\n\n        const startTime = Date.now();\n        const deadline = startTime + timeoutMs;\n        while (true) {\n            // Check if timeout has been reached\n            if (Date.now() >= deadline) {\n                return null;\n            }\n            // Try to get the transaction receipt\n            const receipt = await this.getTransactionReceipt(txID).catch(\n                () => null\n            );\n            if (receipt !== null) {\n                return receipt;\n            }\n            // Wait for the specified interval before trying again\n            await new Promise((resolve) => setTimeout(resolve, intervalMs));\n        }\n    }\n\n    /**\n     * Builds a transaction body with the given clauses without having to\n     * specify the chainTag, expiration, gasPriceCoef, gas, dependsOn and reserved fields.\n     *\n     * @param clauses - The clauses of the transaction.\n     * @param gas - The gas to be used to perform the transaction.\n     * @param options - Optional parameters for the request. Includes the expiration, gasPriceCoef, maxFeePerGas, maxPriorityFeePerGas, gas, dependsOn and isDelegated fields.\n     *                  If the `expiration` is not specified, the transaction will expire after 32 blocks.\n     *                  If the `gasPriceCoef` is not specified & galactica fork didn't happen yet, the transaction will use the default gas price coef of 0.\n     *                  If the `gasPriceCoef` is not specified & galactica fork happened, the transaction will use the default maxFeePerGas and maxPriorityFeePerGas.\n     *                  If the `gas` is specified in options, it will override the gas parameter.\n     *                  If the `dependsOn` is not specified, the transaction will not depend on any other transaction.\n     *                  If the `isDelegated` is not specified, the transaction will not be delegated.\n     *\n     * @returns A promise that resolves to the transaction body.\n     *\n     * @throws an error if the genesis block or the latest block cannot be retrieved.\n     */\n    public async buildTransactionBody(\n        clauses: TransactionClause[] | Clause[] | ContractClause['clause'],\n        gas: number,\n        options?: TransactionBodyOptions\n    ): Promise<TransactionBody> {\n        // Get the genesis block to get the chainTag\n        const genesisBlock = await this.blocksModule.getBlockCompressed(0);\n        if (genesisBlock === null)\n            throw new InvalidTransactionField(\n                'TransactionsModule.buildTransactionBody()',\n                'Error while building transaction body: Cannot get genesis block.',\n                { fieldName: 'genesisBlock', genesisBlock, clauses, options }\n            );\n\n        const blockRef =\n            options?.blockRef ?? (await this.blocksModule.getBestBlockRef());\n        if (blockRef === null)\n            throw new InvalidTransactionField(\n                'TransactionsModule.buildTransactionBody()',\n                'Error while building transaction body: Cannot get blockRef.',\n                { fieldName: 'blockRef', blockRef, clauses, options }\n            );\n\n        const chainTag =\n            options?.chainTag ?? Number(`0x${genesisBlock.id.slice(-2)}`);\n\n        const filledOptions = await this.fillDefaultBodyOptions(options);\n\n        // Process clauses - handle different clause types properly\n        let processedClauses: TransactionClause[];\n\n        if (Array.isArray(clauses)) {\n            // This is a TransactionClause[] or Clause[] - convert to TransactionClause[]\n            processedClauses = clauses.map((clause) => ({\n                to: clause.to,\n                data: clause.data,\n                value: clause.value\n            }));\n        } else {\n            // Single TransactionClause or Clause\n            processedClauses = [\n                {\n                    to: clauses.to,\n                    data: clauses.data,\n                    value: clauses.value\n                }\n            ];\n        }\n\n        return {\n            blockRef,\n            chainTag,\n            clauses: await this.resolveNamesInClauses(processedClauses),\n            dependsOn: options?.dependsOn ?? null,\n            expiration: options?.expiration ?? 32,\n            gas: options?.gas !== undefined ? Number(options.gas) : gas,\n            gasPriceCoef: filledOptions?.gasPriceCoef,\n            maxFeePerGas: filledOptions?.maxFeePerGas,\n            maxPriorityFeePerGas: filledOptions?.maxPriorityFeePerGas,\n            nonce: options?.nonce ?? Hex.random(8).toString(),\n            reserved:\n                options?.isDelegated === true ? { features: 1 } : undefined\n        };\n    }\n\n    /**\n     * Fills the transaction body with the default options.\n     *\n     * @param body - The transaction body to fill.\n     * @returns A promise that resolves to the filled transaction body.\n     * @throws {InvalidDataType}\n     */\n    public async fillTransactionBody(\n        body: TransactionBody\n    ): Promise<TransactionBody> {\n        const extractedOptions: TransactionBodyOptions = {\n            maxFeePerGas: body.maxFeePerGas,\n            maxPriorityFeePerGas: body.maxPriorityFeePerGas,\n            gasPriceCoef: body.gasPriceCoef\n        };\n\n        const filledOptions =\n            await this.fillDefaultBodyOptions(extractedOptions);\n        return {\n            ...body,\n            ...filledOptions\n        };\n    }\n\n    /**\n     * Fills the default body options for a transaction.\n     *\n     * @param options - The transaction body options to fill.\n     * @returns A promise that resolves to the filled transaction body options.\n     * @throws {InvalidDataType}\n     */\n    public async fillDefaultBodyOptions(\n        options?: TransactionBodyOptions\n    ): Promise<TransactionBodyOptions> {\n        options ??= {};\n\n        // Check for invalid parameter combinations first\n        const hasMaxFeePerGas = options.maxFeePerGas !== undefined;\n        const hasMaxPriorityFeePerGas =\n            options.maxPriorityFeePerGas !== undefined;\n        const hasGasPriceCoef = options.gasPriceCoef !== undefined;\n\n        // Case 3: maxPriorityFeePerGas + gasPriceCoef (error)\n        if (hasMaxPriorityFeePerGas && hasGasPriceCoef && !hasMaxFeePerGas) {\n            throw new InvalidDataType(\n                'TransactionsModule.fillDefaultBodyOptions()',\n                'Invalid parameter combination: maxPriorityFeePerGas and gasPriceCoef cannot be used together without maxFeePerGas.',\n                { options }\n            );\n        }\n\n        // Case 4: maxFeePerGas + gasPriceCoef (error)\n        if (hasMaxFeePerGas && hasGasPriceCoef && !hasMaxPriorityFeePerGas) {\n            throw new InvalidDataType(\n                'TransactionsModule.fillDefaultBodyOptions()',\n                'Invalid parameter combination: maxFeePerGas and gasPriceCoef cannot be used together without maxPriorityFeePerGas.',\n                { options }\n            );\n        }\n\n        // Case 1: maxPriorityFeePerGas + maxFeePerGas + gasPriceCoef (only 1 and 2 are used)\n        if (hasMaxPriorityFeePerGas && hasMaxFeePerGas && hasGasPriceCoef) {\n            options.gasPriceCoef = undefined;\n            // Continue with dynamic fee processing below\n        } else if (hasMaxPriorityFeePerGas && hasMaxFeePerGas) {\n            // Case 2: maxPriorityFeePerGas + maxFeePerGas (1 and 2 are used)\n            options.gasPriceCoef = undefined;\n            // Continue with dynamic fee processing below\n        } else if (\n            hasGasPriceCoef &&\n            !hasMaxPriorityFeePerGas &&\n            !hasMaxFeePerGas\n        ) {\n            // Case 5: gasPriceCoef only (3 is used - legacy transaction)\n            options.maxFeePerGas = undefined;\n            options.maxPriorityFeePerGas = undefined;\n            return options;\n        }\n\n        // check if fork happened\n        const galacticaHappened =\n            await this.forkDetector.isGalacticaForked('best');\n        if (\n            !galacticaHappened &&\n            (hasMaxFeePerGas || hasMaxPriorityFeePerGas)\n        ) {\n            // user has specified dynamic fee tx, but fork didn't happen yet\n            throw new InvalidDataType(\n                'TransactionsModule.fillDefaultBodyOptions()',\n                'Invalid transaction body options. Dynamic fee tx is not allowed before Galactica fork.',\n                { options }\n            );\n        }\n        if (!galacticaHappened && !hasGasPriceCoef) {\n            // galactica hasn't happened yet, default is legacy fee\n            options.gasPriceCoef = 0;\n            return options;\n        }\n        if (galacticaHappened && hasMaxFeePerGas && hasMaxPriorityFeePerGas) {\n            // galactica happened, user specified new fee type\n            return options;\n        }\n        // default to dynamic fee tx\n        options.gasPriceCoef = undefined;\n\n        // Get next block base fee per gas\n        const biNextBlockBaseFeePerGas =\n            await this.gasModule.getNextBlockBaseFeePerGas();\n        if (\n            biNextBlockBaseFeePerGas === null ||\n            biNextBlockBaseFeePerGas === undefined\n        ) {\n            throw new InvalidDataType(\n                'TransactionsModule.fillDefaultBodyOptions()',\n                'Invalid transaction body options. Unable to get next block base fee per gas.',\n                { options }\n            );\n        }\n\n        // set maxPriorityFeePerGas if not specified already\n        if (\n            options.maxPriorityFeePerGas === undefined ||\n            options.maxPriorityFeePerGas === null\n        ) {\n            // Calculate maxPriorityFeePerGas based on fee history (75th percentile)\n            // and the HIGH speed threshold (min(0.046*baseFee, 75_percentile))\n            const defaultMaxPriorityFeePerGas =\n                await this.calculateDefaultMaxPriorityFeePerGas(\n                    biNextBlockBaseFeePerGas\n                );\n            options.maxPriorityFeePerGas = defaultMaxPriorityFeePerGas;\n        }\n\n        // set maxFeePerGas if not specified already\n        if (\n            options.maxFeePerGas === undefined ||\n            options.maxFeePerGas === null\n        ) {\n            // compute maxFeePerGas\n            const biMaxPriorityFeePerGas = HexUInt.of(\n                options.maxPriorityFeePerGas\n            ).bi;\n            // maxFeePerGas = 1.12 * baseFeePerGas + maxPriorityFeePerGas\n            const biMaxFeePerGas =\n                (112n * biNextBlockBaseFeePerGas) / 100n +\n                biMaxPriorityFeePerGas;\n            options.maxFeePerGas = HexUInt.of(biMaxFeePerGas).toString();\n        }\n        return options;\n    }\n\n    /**\n     * Calculates the default max priority fee per gas based on the current base fee\n     * and historical 75th percentile rewards.\n     *\n     * Uses the FAST (HIGH) speed threshold: min(0.046*baseFee, 75_percentile)\n     *\n     * @param baseFee - The current base fee per gas\n     * @returns A promise that resolves to the default max priority fee per gas as a hex string\n     */\n    private async calculateDefaultMaxPriorityFeePerGas(\n        baseFee: bigint\n    ): Promise<string> {\n        // Get fee history for recent blocks\n        const feeHistory = await this.gasModule.getFeeHistory({\n            blockCount: 10,\n            newestBlock: 'best',\n            rewardPercentiles: [25, 50, 75] // Get 25th, 50th and 75th percentiles\n        });\n\n        // Get the 75th percentile reward from the most recent block\n        let percentile75: bigint;\n\n        if (\n            feeHistory.reward !== null &&\n            feeHistory.reward !== undefined &&\n            feeHistory.reward.length > 0\n        ) {\n            const latestBlockRewards =\n                feeHistory.reward[feeHistory.reward.length - 1];\n            const equalRewardsOnLastBlock =\n                new Set(latestBlockRewards).size === 3;\n\n            // If rewards are equal in the last block, use the first one (75th percentile)\n            // Otherwise, calculate the average of 75th percentiles across blocks\n            if (equalRewardsOnLastBlock) {\n                percentile75 = HexUInt.of(latestBlockRewards[2]).bi; // 75th percentile at index 2\n            } else {\n                // Calculate average of 75th percentiles across blocks\n                let sum = 0n;\n                let count = 0;\n\n                for (const blockRewards of feeHistory.reward) {\n                    if (\n                        blockRewards.length !== null &&\n                        blockRewards.length > 2 &&\n                        blockRewards[2] !== null &&\n                        blockRewards[2] !== undefined\n                    ) {\n                        sum += HexUInt.of(blockRewards[2]).bi;\n                        count++;\n                    }\n                }\n\n                percentile75 = count > 0 ? sum / BigInt(count) : 0n;\n            }\n        } else {\n            // Fallback to getMaxPriorityFeePerGas if fee history is not available\n            percentile75 = HexUInt.of(\n                await this.gasModule.getMaxPriorityFeePerGas()\n            ).bi;\n        }\n\n        // Calculate 4.6% of base fee (HIGH speed threshold)\n        const baseFeeCap = (baseFee * 46n) / 1000n; // 0.046 * baseFee\n\n        // Use the minimum of the two values\n        const priorityFee =\n            baseFeeCap < percentile75 ? baseFeeCap : percentile75;\n\n        return HexUInt.of(priorityFee).toString();\n    }\n\n    /**\n     * Ensures that names in clauses are resolved to addresses\n     *\n     * @param clauses - The clauses of the transaction.\n     * @returns A promise that resolves to clauses with resolved addresses\n     */\n    public async resolveNamesInClauses(\n        clauses: TransactionClause[]\n    ): Promise<TransactionClause[]> {\n        // find unique names in the clause list\n        const uniqueNames = clauses.reduce((map, clause) => {\n            if (\n                typeof clause.to === 'string' &&\n                !map.has(clause.to) &&\n                clause.to.includes('.')\n            ) {\n                map.set(clause.to, clause.to);\n            }\n            return map;\n        }, new Map<string, string>());\n\n        const nameList = [...uniqueNames.keys()];\n\n        // no names, return the original clauses\n        if (uniqueNames.size === 0) {\n            return clauses;\n        }\n\n        // resolve the names to addresses\n        const addresses = await vnsUtils.resolveNames(\n            this.blocksModule,\n            this,\n            nameList\n        );\n\n        // map unique names with resolved addresses\n        addresses.forEach((address, index) => {\n            if (address !== null) {\n                uniqueNames.set(nameList[index], address);\n            }\n        });\n\n        // replace names with resolved addresses, or leave unchanged\n        return clauses.map((clause) => {\n            if (typeof clause.to !== 'string') {\n                return clause;\n            }\n\n            return {\n                to: uniqueNames.get(clause.to) ?? clause.to,\n                data: clause.data,\n                value: clause.value\n            };\n        });\n    }\n\n    /**\n     * Simulates the execution of a transaction.\n     * Allows to estimate the gas cost of a transaction without sending it, as well as to retrieve the return value(s) of the transaction.\n     *\n     * @param clauses - The clauses of the transaction to simulate.\n     * @param options - (Optional) The options for simulating the transaction.\n     * @returns A promise that resolves to an array of simulation results.\n     *          Each element of the array represents the result of simulating a clause.\n     * @throws {InvalidDataType}\n     */\n    public async simulateTransaction(\n        clauses: SimulateTransactionClause[],\n        options?: SimulateTransactionOptions\n    ): Promise<TransactionSimulationResult[]> {\n        const {\n            revision,\n            caller,\n            gasPrice,\n            gasPayer,\n            gas,\n            blockRef,\n            expiration,\n            provedWork\n        } = options ?? {};\n        if (\n            revision !== undefined &&\n            revision !== null &&\n            !Revision.isValid(revision.toString())\n        ) {\n            throw new InvalidDataType(\n                'TransactionsModule.simulateTransaction()',\n                'Invalid revision given as input. Input must be a valid revision (i.e., a block number or block ID).',\n                { revision }\n            );\n        }\n\n        return (await this.blocksModule.httpClient.http(\n            HttpMethod.POST,\n            thorest.accounts.post.SIMULATE_TRANSACTION(revision?.toString()),\n            {\n                query: buildQuery({ revision: revision?.toString() }),\n                body: {\n                    clauses: await this.resolveNamesInClauses(\n                        clauses.map((clause) => {\n                            return {\n                                to: clause.to,\n                                data: clause.data,\n                                value: BigInt(clause.value).toString()\n                            };\n                        })\n                    ),\n                    gas,\n                    gasPrice,\n                    caller,\n                    provedWork,\n                    gasPayer,\n                    expiration,\n                    blockRef\n                }\n            }\n        )) as TransactionSimulationResult[];\n    }\n\n    /**\n     * Decode the revert reason from the encoded revert reason into a transaction.\n     *\n     * @param encodedRevertReason - The encoded revert reason to decode.\n     * @param errorFragment - (Optional) The error fragment to use to decode the revert reason (For Solidity custom errors).\n     * @returns A promise that resolves to the decoded revert reason.\n     * Revert reason can be a string error or Panic(error_code)\n     */\n    public decodeRevertReason(\n        encodedRevertReason: string,\n        errorFragment?: string\n    ): string {\n        // Error selector\n        if (encodedRevertReason.startsWith(ERROR_SELECTOR))\n            return ABI.ofEncoded(\n                'string',\n                `0x${encodedRevertReason.slice(ERROR_SELECTOR.length)}`\n            ).getFirstDecodedValue();\n        // Panic selector\n        else if (encodedRevertReason.startsWith(PANIC_SELECTOR)) {\n            const decoded = ABI.ofEncoded(\n                'uint256',\n                `0x${encodedRevertReason.slice(PANIC_SELECTOR.length)}`\n            ).getFirstDecodedValue<string>();\n            return `Panic(0x${parseInt(decoded).toString(16).padStart(2, '0')})`;\n        }\n        // Solidity error, an error fragment is provided, so decode the revert reason using solidity error\n        else if (errorFragment !== undefined) {\n            const errorInterface = new Interface([\n                ErrorFragment.from(errorFragment)\n            ]);\n            return errorInterface\n                .decodeErrorResult(\n                    ErrorFragment.from(errorFragment),\n                    encodedRevertReason\n                )\n                .toArray()[0] as string;\n        }\n\n        // Unknown revert reason (we know ONLY that transaction is reverted)\n        return ``;\n    }\n\n    /**\n     * Get the revert reason of an existing transaction.\n     *\n     * @param transactionHash - The hash of the transaction to get the revert reason for.\n     * @param errorFragment - (Optional) The error fragment to use to decode the revert reason (For Solidity custom errors).\n     * @returns A promise that resolves to the revert reason of the transaction.\n     */\n    public async getRevertReason(\n        transactionHash: string,\n        errorFragment?: string\n    ): Promise<string | null> {\n        // 1 - Init Blocks and Debug modules\n        const blocksModule = this.blocksModule;\n        const debugModule = this.debugModule;\n\n        // 2 - Get the transaction details\n        const transaction = await this.getTransaction(transactionHash);\n\n        // 3 - Get the block details (to get the transaction index)\n        const block =\n            transaction !== null\n                ? ((await blocksModule.getBlockExpanded(\n                      transaction.meta.blockID\n                  )) as ExpandedBlockDetail)\n                : null;\n\n        // Block or transaction not found\n        if (block === null || transaction === null) return null;\n\n        // 4 - Get the transaction index into the block (we know the transaction is in the block)\n        const transactionIndex = getTransactionIndexIntoBlock(\n            blocksFormatter.formatToRPCStandard(block, ''),\n            transactionHash\n        );\n\n        // 5 - Get the error or panic reason. By iterating over the clauses of the transaction\n        for (\n            let transactionClauseIndex = 0;\n            transactionClauseIndex < transaction.clauses.length;\n            transactionClauseIndex++\n        ) {\n            // 5.1 - Debug the clause\n            const debuggedClause = (await debugModule.traceTransactionClause(\n                {\n                    target: {\n                        blockId: ThorId.of(block.id),\n                        transaction: transactionIndex,\n                        clauseIndex: transactionClauseIndex\n                    },\n                    // Optimized for top call\n                    config: {\n                        OnlyTopCall: true\n                    }\n                },\n                'call'\n            )) as CallNameReturnType;\n\n            // 5.2 - Error or panic present, so decode the revert reason\n            if (debuggedClause.output !== undefined) {\n                return this.decodeRevertReason(\n                    debuggedClause.output,\n                    errorFragment\n                );\n            }\n        }\n\n        // No revert reason found\n        return null;\n    }\n\n    /**\n     * Estimates the amount of gas required to execute a set of transaction clauses.\n     *\n     * @param {SimulateTransactionClause[]} clauses - An array of clauses to be simulated. Must contain at least one clause.\n     * @param {string} [caller] - The address initiating the transaction. Optional.\n     * @param {EstimateGasOptions} [options] - Additional options for the estimation, including gas padding.\n     * @return {Promise<EstimateGasResult>} - The estimated gas result, including total gas required, whether the transaction reverted, revert reasons, and any VM errors.\n     * @throws {InvalidDataType} - If clauses array is empty or if gas padding is not within the range (0, 1].\n     *\n     * @see {@link TransactionsModule#simulateTransaction}\n     */\n    public async estimateGas(\n        clauses: (SimulateTransactionClause | ContractClause)[],\n        caller?: string,\n        options?: EstimateGasOptions\n    ): Promise<EstimateGasResult> {\n        // Normalize to SimulateTransactionClause[]\n        const clausesToEstimate: SimulateTransactionClause[] = clauses.map(\n            (clause) => {\n                if (clause === undefined) {\n                    throw new InvalidDataType(\n                        'TransactionsModule.estimateGas()',\n                        'Invalid ContractClause provided: missing inner clause.',\n                        { clause }\n                    );\n                }\n                if ('clause' in clause) {\n                    return clause.clause;\n                }\n                return clause;\n            }\n        );\n\n        // Validate the normalized set is non-empty\n        if (clausesToEstimate.length === 0) {\n            throw new InvalidDataType(\n                'TransactionsModule.estimateGas()',\n                'Invalid clauses. Clauses must be an array with at least one clause.',\n                { clauses, caller, options }\n            );\n        }\n\n        // gasPadding must be a number between (0, 1]\n        if (\n            options?.gasPadding !== undefined &&\n            (options.gasPadding <= 0 || options.gasPadding > 1)\n        ) {\n            throw new InvalidDataType(\n                'GasModule.estimateGas()',\n                'Invalid gasPadding. gasPadding must be a number between (0, 1].',\n                { gasPadding: options?.gasPadding }\n            );\n        }\n\n        // Simulate the transaction to get the simulations of each clause\n        const simulations = await this.simulateTransaction(clausesToEstimate, {\n            caller,\n            ...options\n        });\n\n        // If any of the clauses reverted, then the transaction reverted\n        const isReverted = simulations.some((simulation) => {\n            return simulation.reverted;\n        });\n\n        // The intrinsic gas of the transaction\n        const intrinsicGas = Number(\n            Transaction.intrinsicGas(clausesToEstimate).wei\n        );\n\n        // totalSimulatedGas represents the summation of all clauses' gasUsed\n        const totalSimulatedGas = simulations.reduce((sum, simulation) => {\n            return sum + simulation.gasUsed;\n        }, 0);\n\n        // The total gas of the transaction\n        // If the transaction involves contract interaction, a constant 15000 gas is added to the total gas\n        const totalGas = Math.ceil(\n            (intrinsicGas +\n                (totalSimulatedGas !== 0 ? totalSimulatedGas + 15000 : 0)) *\n                (1 + (options?.gasPadding ?? 0))\n        ); // Add gasPadding if it is defined\n        return isReverted\n            ? {\n                  totalGas,\n                  reverted: true,\n                  revertReasons: simulations.map((simulation) => {\n                      /**\n                       * The decoded revert reason of the transaction.\n                       * Solidity may revert with Error(string) or Panic(uint256).\n                       *\n                       * @link see [Error handling: Assert, Require, Revert and Exceptions](https://docs.soliditylang.org/en/latest/control-structures.html#error-handling-assert-require-revert-and-exceptions)\n                       */\n                      return decodeRevertReason(simulation.data) ?? '';\n                  }),\n                  vmErrors: simulations.map((simulation) => {\n                      return simulation.vmError;\n                  })\n              }\n            : {\n                  totalGas,\n                  reverted: false,\n                  revertReasons: [],\n                  vmErrors: []\n              };\n    }\n\n    /**\n     * Executes a read-only call to a smart contract function, simulating the transaction to obtain the result.\n     *\n     * The method simulates a transaction using the provided parameters\n     * without submitting it to the blockchain, allowing read-only operations\n     * to be tested without incurring gas costs or modifying the blockchain state.\n     *\n     * @param {string} contractAddress - The address of the smart contract.\n     * @param {ABIFunction} functionAbi - The ABI definition of the smart contract function to be called.\n     * @param {unknown[]} functionData - The arguments to be passed to the smart contract function.\n     * @param {ContractCallOptions} [contractCallOptions] - Optional parameters for the contract call execution.\n     * @return {Promise<ContractCallResult>} The result of the contract call.\n     */\n    public async executeCall(\n        contractAddress: string,\n        functionAbi: ABIFunction,\n        functionData: unknown[],\n        contractCallOptions?: ContractCallOptions\n    ): Promise<ContractCallResult> {\n        // Simulate the transaction to get the result of the contract call\n        const response = await this.simulateTransaction(\n            [\n                {\n                    to: contractAddress,\n                    value: '0',\n                    data: functionAbi.encodeData(functionData).toString()\n                }\n            ],\n            contractCallOptions\n        );\n\n        return this.getContractCallResult(\n            response[0].data,\n            functionAbi,\n            response[0].reverted\n        );\n    }\n\n    /**\n     * Executes and simulates multiple read-only smart-contract clause calls,\n     * simulating the transaction to obtain the results.\n     *\n     * @param {ContractClause[]} clauses - The array of contract clauses to be executed.\n     * @param {SimulateTransactionOptions} [options] - Optional simulation transaction settings.\n     * @return {Promise<ContractCallResult[]>} - The decoded results of the contract calls.\n     */\n    public async executeMultipleClausesCall(\n        clauses: ContractClause[],\n        options?: SimulateTransactionOptions\n    ): Promise<ContractCallResult[]> {\n        // Simulate the transaction to get the result of the contract call\n        const response = await this.simulateTransaction(\n            clauses.map((clause) => {\n                if (clause.clause === undefined) {\n                    throw new InvalidDataType(\n                        'TransactionsModule.executeMultipleClausesCall()',\n                        'Invalid ContractClause provided: missing inner clause.',\n                        { clause }\n                    );\n                }\n                return clause.clause;\n            }),\n            options\n        );\n        // Returning the decoded results both as plain and array.\n        return response.map((res, index) =>\n            this.getContractCallResult(\n                res.data,\n                clauses[index].functionAbi,\n                res.reverted\n            )\n        );\n    }\n\n    /**\n     * Executes a transaction with a smart-contract on the VeChain blockchain.\n     *\n     * @param {VeChainSigner} signer - The signer instance to sign the transaction.\n     * @param {string} contractAddress - The address of the smart contract.\n     * @param {ABIFunction} functionAbi - The ABI of the contract function to be called.\n     * @param {unknown[]} functionData - The input parameters for the contract function.\n     * @param {ContractTransactionOptions} [options] - Optional transaction parameters.\n     * @return {Promise<SendTransactionResult>} - A promise that resolves to the result of the transaction.\n     *\n     * @see {@link TransactionsModule.buildTransactionBody}\n     */\n    public async executeTransaction(\n        signer: VeChainSigner,\n        contractAddress: string,\n        functionAbi: ABIFunction,\n        functionData: unknown[],\n        options?: ContractTransactionOptions\n    ): Promise<SendTransactionResult> {\n        // Sign the transaction\n        const id = await signer.sendTransaction({\n            clauses: [\n                // Build a clause to interact with the contract function\n                Clause.callFunction(\n                    Address.of(contractAddress),\n                    functionAbi,\n                    functionData,\n                    VET.of(options?.value ?? 0, Units.wei)\n                )\n            ],\n            gas: options?.gas,\n            gasLimit: options?.gasLimit,\n            gasPrice: options?.gasPrice,\n            gasPriceCoef: options?.gasPriceCoef,\n            maxFeePerGas: options?.maxFeePerGas,\n            maxPriorityFeePerGas: options?.maxPriorityFeePerGas,\n            nonce: options?.nonce,\n            value: options?.value,\n            dependsOn: options?.dependsOn,\n            expiration: options?.expiration,\n            chainTag: options?.chainTag,\n            blockRef: options?.blockRef,\n            delegationUrl: options?.delegationUrl,\n            comment: options?.comment\n        });\n\n        return {\n            id,\n            wait: async (options?: WaitForTransactionOptions) =>\n                await this.waitForTransaction(id, options)\n        };\n    }\n\n    /**\n     * Executes a transaction with multiple clauses on the VeChain blockchain.\n     *\n     * @param {ContractClause[]} clauses - Array of contract clauses to be included in the transaction.\n     * @param {VeChainSigner} signer - A VeChain signer instance used to sign and send the transaction.\n     * @param {ContractTransactionOptions} [options] - Optional parameters to customize the transaction.\n     * @return {Promise<SendTransactionResult>} The result of the transaction, including transaction ID and a wait function.\n     */\n    public async executeMultipleClausesTransaction(\n        clauses: ContractClause[] | TransactionClause[],\n        signer: VeChainSigner,\n        options?: ContractTransactionOptions\n    ): Promise<SendTransactionResult> {\n        const id = await signer.sendTransaction({\n            clauses: clauses.map((clause) => {\n                if (clause === undefined) {\n                    throw new InvalidDataType(\n                        'TransactionsModule.executeMultipleClausesTransaction()',\n                        'Invalid ContractClause[] | TransactionClause[] provided: missing clause.',\n                        { clause }\n                    );\n                }\n                if ('clause' in clause) {\n                    return (clause as unknown as ContractClause).clause;\n                }\n                return clause;\n            }),\n            gas: options?.gas,\n            gasLimit: options?.gasLimit,\n            gasPrice: options?.gasPrice,\n            gasPriceCoef: options?.gasPriceCoef,\n            maxFeePerGas: options?.maxFeePerGas,\n            maxPriorityFeePerGas: options?.maxPriorityFeePerGas,\n            nonce: options?.nonce,\n            value: options?.value,\n            dependsOn: options?.dependsOn,\n            expiration: options?.expiration,\n            chainTag: options?.chainTag,\n            blockRef: options?.blockRef,\n            delegationUrl: options?.delegationUrl,\n            comment: options?.comment\n        });\n\n        return {\n            id,\n            wait: async (options?: WaitForTransactionOptions) =>\n                await this.waitForTransaction(id, options)\n        };\n    }\n\n    /**\n     * Retrieves the base gas price from the blockchain parameters.\n     *\n     * This method sends a call to the blockchain parameters contract to fetch the current base gas price.\n     * The base gas price is the minimum gas price that can be used for a transaction.\n     * It is used to obtain the VTHO (energy) cost of a transaction.\n     * @link [Total Gas Price](https://docs.vechain.org/core-concepts/transactions/transaction-calculation#total-gas-price)\n     *\n     * @return {Promise<ContractCallResult>} A promise that resolves to the result of the contract call, containing the base gas price.\n     */\n    public async getLegacyBaseGasPrice(): Promise<ContractCallResult> {\n        return await this.executeCall(\n            BUILT_IN_CONTRACTS.PARAMS_ADDRESS,\n            ABIContract.ofAbi(BUILT_IN_CONTRACTS.PARAMS_ABI).getFunction('get'),\n            [dataUtils.encodeBytes32String('base-gas-price', 'left')]\n        );\n    }\n\n    /**\n     * Decode the result of a contract call from the result of a simulated transaction.\n     *\n     * @param {string} encodedData - The encoded data received from the contract call.\n     * @param {ABIFunction} functionAbi - The ABI function definition used for decoding the result.\n     * @param {boolean} reverted - Indicates if the contract call reverted.\n     * @return {ContractCallResult} An object containing the success status and the decoded result.\n     */\n    private getContractCallResult(\n        encodedData: string,\n        functionAbi: ABIFunction,\n        reverted: boolean\n    ): ContractCallResult {\n        if (reverted) {\n            const errorMessage = decodeRevertReason(encodedData) ?? '';\n            return {\n                success: false,\n                result: {\n                    errorMessage\n                }\n            };\n        }\n\n        // Returning the decoded result both as plain and array.\n        const encodedResult = Hex.of(encodedData);\n        const plain = functionAbi.decodeResult(encodedResult);\n        const array = functionAbi.decodeOutputAsArray(encodedResult);\n        return {\n            success: true,\n            result: {\n                plain,\n                array\n            }\n        };\n    }\n}\n\nexport { TransactionsModule };\n","import { Hex, HexUInt, type Transaction } from '@vechain/sdk-core';\nimport { NotDelegatedTransaction } from '@vechain/sdk-errors';\nimport {\n    type GetDelegationSignatureResult,\n    type SignTransactionOptions\n} from '../types';\nimport { type HttpClient, HttpMethod } from '../../../http';\n\n/**\n * Retrieves the signature of a delegation transaction from a gasPayer given the endpoint\n * from which to retrieve the signature.\n *\n * @see [Simple Gas Payer Standard](https://github.com/vechain/VIPs/blob/master/vips/VIP-201.md)\n *\n * @param tx - The transaction to delegate.\n * @param gasPayerServiceUrl - The URL of the endpoint of the gasPayer service.\n * @param originAddress - The address of the origin account.\n * @param httpClient - The HTTP client instance used for making HTTP requests.\n * @returns A promise that resolves to the signature of the delegation transaction.\n * @throws {NotDelegatedTransaction}\n */\nconst _getDelegationSignature = async (\n    tx: Transaction,\n    gasPayerServiceUrl: string,\n    originAddress: string,\n    httpClient: HttpClient\n): Promise<Uint8Array> => {\n    const rawTx = Hex.of(tx.encoded).toString();\n\n    /**\n     * The request body for the delegation transaction.\n     *\n     * @see [Obtaining Gas Payer Signature](https://github.com/vechain/VIPs/blob/master/vips/VIP-201.md#obtaining-gas-payer-signature)\n     */\n    const sponsorRequestBody = {\n        origin: originAddress,\n        raw: rawTx\n    };\n\n    try {\n        const response = (await httpClient.http(\n            HttpMethod.POST,\n            gasPayerServiceUrl,\n            {\n                body: sponsorRequestBody,\n                headers: { 'Content-Type': 'application/json' }\n            }\n        )) as GetDelegationSignatureResult;\n\n        return HexUInt.of(response.signature.slice(2)).bytes;\n    } catch (error) {\n        throw new NotDelegatedTransaction(\n            '_getDelegationSignature()',\n            'Delegation failed: Cannot get signature from gasPayerUrl.',\n            {\n                gasPayerUrl: gasPayerServiceUrl\n            },\n            error\n        );\n    }\n};\n\n/**\n * Provide a set of utils for the delegation type.\n * It is a mutual exclusion between gasPayerPrivateKey and gasPayerServiceUrl. (@see SignTransactionOptions)\n *\n * The aim of this handler is to:\n *   - Understand the kind of delegation and the delegation info\n *   - Provide a method to get the delegation signature\n *\n * @param gasPayer - The gasPayer options.\n */\nconst DelegationHandler = (\n    gasPayer?: SignTransactionOptions | null\n): {\n    isDelegated: () => boolean;\n    gasPayerOrUndefined: () => SignTransactionOptions | undefined;\n    gasPayerOrNull: () => SignTransactionOptions | null;\n    getDelegationSignatureUsingUrl: (\n        tx: Transaction,\n        originAddress: string,\n        httpClient: HttpClient\n    ) => Promise<Uint8Array>;\n} => {\n    // Check if gasPayer is undefined (null or undefined)\n    const gasPayerIsUndefined = gasPayer === undefined || gasPayer === null;\n\n    // Check if is delegated by url\n    const isDelegatedWithUrl =\n        !gasPayerIsUndefined && gasPayer?.gasPayerServiceUrl !== undefined;\n\n    // Check if is delegated by private key\n    const isDelegatedWithPrivateKey =\n        !gasPayerIsUndefined && gasPayer?.gasPayerPrivateKey !== undefined;\n\n    return {\n        /**\n         * Check if the transaction is delegated.\n         *\n         * @returns true if the transaction is delegated, false otherwise.\n         */\n        isDelegated: (): boolean =>\n            isDelegatedWithUrl || isDelegatedWithPrivateKey,\n\n        /**\n         * Get the gasPayer options or undefined.\n         * (if gasPayer is undefined or null).\n         *\n         * @returns The gasPayer options or undefined.\n         */\n        gasPayerOrUndefined: (): SignTransactionOptions | undefined =>\n            gasPayerIsUndefined ? undefined : gasPayer,\n\n        /**\n         * Get the gasPayer options or null.\n         * (if gasPayer is undefined or null).\n         *\n         * @returns The gasPayer options or null.\n         */\n        gasPayerOrNull: (): SignTransactionOptions | null =>\n            gasPayerIsUndefined ? null : gasPayer,\n\n        /**\n         * Retrieves the signature of a delegation transaction from a gasPayer given the endpoint\n         * from which to retrieve the signature.\n         *\n         * @see [Simple Gas Payer Standard](https://github.com/vechain/VIPs/blob/master/vips/VIP-201.md)\n         *\n         * @param tx - The transaction to delegate.\n         * @param originAddress - The address of the origin account.\n         * @param httpClient - The HTTP client instance used for making HTTP requests.\n         * @returns A promise that resolves to the signature of the delegation transaction.\n         * @throws {NotDelegatedTransaction}\n         */\n        getDelegationSignatureUsingUrl: async (\n            tx: Transaction,\n            originAddress: string,\n            httpClient: HttpClient\n        ): Promise<Uint8Array> => {\n            // Cannot be delegated by private key\n            if (!isDelegatedWithUrl) {\n                throw new NotDelegatedTransaction(\n                    'DelegationHandler.getDelegationSignatureUsingUrl()',\n                    'Delegation with url failed: gasPayerServiceUrl is not defined.',\n                    undefined\n                );\n            }\n\n            return await _getDelegationSignature(\n                tx,\n                gasPayer?.gasPayerServiceUrl,\n                originAddress,\n                httpClient\n            );\n        }\n    };\n};\n\nexport { DelegationHandler };\n","import { InvalidDataType } from '@vechain/sdk-errors';\nimport { buildQuery, thorest } from '../../utils';\nimport { type BlockDetail } from '../blocks/types';\nimport { Revision } from '@vechain/sdk-core';\nimport { type HttpClient, HttpMethod } from '../../http';\n\n// In-memory cache for fork detection results\ninterface CacheEntry {\n    result: boolean;\n    timestamp: number;\n}\nconst galacticaForkCache = new Map<string, CacheEntry>();\n// Cache TTL in milliseconds for negative results (5 minutes)\nconst NEGATIVE_CACHE_TTL = 5 * 60 * 1000;\n// Track if we've found the Galactica fork on any revision\nlet galacticaForkDetected = false;\n\nclass ForkDetector {\n    constructor(private readonly httpClient: HttpClient) {}\n\n    /**\n     * Checks if the given block is Galactica-forked by inspecting the block details.\n     *\n     * Criteria:\n     * - baseFeePerGas is defined (indicating a possible Galactica fork).\n     *\n     * @param revision Block number or ID (e.g., 'best', 'finalized', or numeric).\n     * @returns `true` if Galactica-forked, otherwise `false`.\n     * @throws {InvalidDataType} If the revision is invalid.\n     */\n    public async isGalacticaForked(\n        revision?: string | number\n    ): Promise<boolean> {\n        // If we've already detected Galactica fork on any revision, return true immediately\n        // This is because once a hard fork happens, it's permanent\n        if (galacticaForkDetected) {\n            return true;\n        }\n\n        revision ??= 'best';\n        if (!Revision.isValid(revision)) {\n            throw new InvalidDataType(\n                'GalacticaForkDetector.isGalacticaForked()',\n                'Invalid revision. Must be a valid block number or ID.',\n                { revision }\n            );\n        }\n\n        const revisionKey = String(revision);\n\n        // Check cache first\n        const cachedResult = galacticaForkCache.get(revisionKey);\n        const now = Date.now();\n\n        // If we have a cached positive result or a non-expired negative result\n        if (cachedResult !== undefined) {\n            // Positive results are kept indefinitely\n            if (cachedResult.result) {\n                galacticaForkDetected = true;\n                return true;\n            }\n\n            // Negative results expire after TTL\n            if (now - cachedResult.timestamp < NEGATIVE_CACHE_TTL) {\n                return false;\n            }\n        }\n\n        // If cache miss or expired negative result, make the request\n        const block = (await this.httpClient.http(\n            HttpMethod.GET,\n            thorest.blocks.get.BLOCK_DETAIL(revision),\n            {\n                query: buildQuery({ expanded: true })\n            }\n        )) as BlockDetail | null;\n\n        if (block === null) {\n            // Cache the negative result with TTL\n            galacticaForkCache.set(revisionKey, {\n                result: false,\n                timestamp: now\n            });\n            return false;\n        }\n\n        const result = block.baseFeePerGas !== undefined;\n\n        // Cache the result\n        galacticaForkCache.set(revisionKey, { result, timestamp: now });\n\n        // If fork is detected, set the global flag\n        if (result) {\n            galacticaForkDetected = true;\n        }\n\n        return result;\n    }\n\n    /**\n     * Detects if the current network is on the Galactica fork by checking the best block.\n     * This is an alias for isGalacticaForked('best').\n     *\n     * @param {string | number} revision - Block number or ID (e.g., 'best', 'finalized', or numeric)\n     * @returns {Promise<boolean>} A promise that resolves to true if Galactica fork is detected, false otherwise.\n     */\n    public async detectGalactica(\n        revision: string | number = 'best'\n    ): Promise<boolean> {\n        return await this.isGalacticaForked(revision);\n    }\n\n    /**\n     * Clears the Galactica fork detection cache.\n     * This is mainly useful for testing purposes.\n     */\n    public clearCache(): void {\n        galacticaForkCache.clear();\n        galacticaForkDetected = false;\n    }\n}\n\nexport { ForkDetector };\n","import {\n    AccountsModule,\n    BlocksModule,\n    type BlocksModuleOptions,\n    ContractsModule,\n    DebugModule,\n    GasModule,\n    LogsModule,\n    NodesModule,\n    TransactionsModule,\n    ForkDetector\n} from '.';\nimport { SimpleHttpClient, type HttpClient } from '../http';\n\n/**\n * The `ThorClient` class serves as an interface to interact with the VeChainThor blockchain.\n * It provides various methods.\n */\nclass ThorClient {\n    /**\n     * The `AccountsModule` instance\n     */\n    public readonly accounts: AccountsModule;\n\n    /**\n     * The `NodesModule` instance\n     */\n    public readonly nodes: NodesModule;\n\n    /**\n     * The `BlocksModule` instance\n     */\n    public readonly blocks: BlocksModule;\n\n    /**\n     * The `LogsModule` instance used for interacting with log-related endpoints.\n     */\n    public readonly logs: LogsModule;\n\n    /*\n     * The `TransactionsModule` instance\n     */\n    public readonly transactions: TransactionsModule;\n\n    /**\n     * The 'ContractClient' instance\n     */\n    public readonly contracts: ContractsModule;\n\n    /**\n     * The 'GalacticaForkDetector' instance\n     */\n    public readonly forkDetector: ForkDetector;\n\n    /**\n     * The `GasModule` instance\n     */\n    public readonly gas: GasModule;\n\n    /**\n     * The `DebugModule` instance\n     */\n    public readonly debug: DebugModule;\n\n    /**\n     * Constructs a new `ThorClient` instance with a given HTTP client.\n     *\n     * @param httpClient - The HTTP client instance used for making network requests.\n     * @param options - (Optional) Other optional parameters for polling and error handling.\n     */\n    constructor(\n        readonly httpClient: HttpClient,\n        options?: BlocksModuleOptions\n    ) {\n        this.accounts = new AccountsModule(httpClient);\n        this.debug = new DebugModule(httpClient);\n        this.blocks = new BlocksModule(httpClient, options);\n        this.logs = new LogsModule(this.blocks);\n        this.nodes = new NodesModule(this.blocks);\n        this.gas = new GasModule(this.httpClient);\n        this.forkDetector = new ForkDetector(this.httpClient);\n        this.transactions = new TransactionsModule(\n            this.blocks,\n            this.debug,\n            this.logs,\n            this.gas,\n            this.forkDetector\n        );\n        this.gas.setTransactionsModule(this.transactions); // gas module requires transaction module\n        this.contracts = new ContractsModule(this.transactions);\n    }\n\n    /**\n     * Creates a new `ThorClient` instance from a given URL.\n     *\n     * @param {string} networkUrl - The URL of the network to connect to.\n     * @param {BlocksModuleOptions} [options] - Optional configuration settings for the Blocks module.\n     * @return {ThorClient} A ThorClient instance connected to the specified network URL.\n     */\n    public static at(\n        networkUrl: string,\n        options?: BlocksModuleOptions\n    ): ThorClient {\n        return new ThorClient(new SimpleHttpClient(networkUrl), options);\n    }\n\n    /**\n     * Destroys the `ThorClient` instance by stopping the event polling\n     * and any other cleanup.\n     */\n    public destroy(): void {\n        this.blocks.destroy();\n    }\n\n    /**\n     * Creates a ThorClient instance from a network URL.\n     *\n     * @param {string} networkUrl - The URL of the network to connect to.\n     * @param {BlocksModuleOptions} [options] - Optional configuration settings for the Blocks module.\n     * @return {ThorClient} A ThorClient instance connected to the specified network URL.\n     *\n     * @deprecated Use {@link ThorClient.at} instead.\n     */\n    public static fromUrl(\n        networkUrl: string,\n        options?: BlocksModuleOptions\n    ): ThorClient {\n        return ThorClient.at(networkUrl, options);\n    }\n}\n\nexport { ThorClient };\n","import { concatBytes } from '@noble/curves/abstract/utils';\nimport {\n    Address,\n    Clause,\n    Hex,\n    HexUInt,\n    Keccak256,\n    Revision,\n    Txt,\n    type TransactionBody,\n    type TransactionClause\n} from '@vechain/sdk-core';\nimport {\n    InvalidDataType,\n    JSONRPCInvalidParams,\n    SignerMethodError\n} from '@vechain/sdk-errors';\nimport { hashTypedData } from 'viem';\nimport { RPC_METHODS } from '../../../provider/utils/const/rpc-mapper/rpc-methods';\nimport { type TransactionSimulationResult } from '../../../thor-client';\nimport { vnsUtils } from '../../../utils';\nimport {\n    type AvailableVeChainProviders,\n    type TransactionRequestInput,\n    type TypedDataDomain,\n    type TypedDataParameter,\n    type VeChainSigner\n} from '../types';\nimport type { TypedDataDomain as viemTypedDataDomain } from 'viem';\n\n/**\n * Abstract VeChain signer.\n * This abstract class avoids people every time implementing standard signer\n * methods.\n * By implementing this abstract class, it will be easier to create new signers\n */\nabstract class VeChainAbstractSigner implements VeChainSigner {\n    protected readonly MESSAGE_PREFIX = Txt.of('\\x19Ethereum Signed Message:\\n')\n        .bytes;\n\n    /**\n     * The provider attached to this Signer (if any).\n     */\n    provider?: AvailableVeChainProviders;\n\n    /**\n     * Create a new VeChainPrivateKeySigner.\n     * A signer can be initialized using a private key.\n     *\n     * @param provider - The provider to connect to\n     */\n    protected constructor(provider?: AvailableVeChainProviders) {\n        // Store provider and gasPayer\n        this.provider = provider;\n    }\n\n    /**\n     *  Returns a new instance of this Signer connected to //provider// or detached\n     *  from any Provider if undefined.\n     *\n     * @param provider - The provider to connect to\n     * @returns a new instance of this Signer connected to //provider// or detached\n     */\n    abstract connect(provider: AvailableVeChainProviders): this;\n\n    /**\n     * Get the address of the Signer.\n     *\n     * @returns the address of the signer\n     */\n    abstract getAddress(): Promise<string>;\n\n    /**\n     *  Prepares a {@link TransactionRequestInput} for calling:\n     *  - resolves ``to`` and ``from`` addresses\n     *  - if ``from`` is specified, check that it matches this Signer\n     *\n     *  @note: Here the base support of multi-clause transaction is added.\n     *  So, if clauses are provided in the transaction, it will be used as it is.\n     *  Otherwise, standard transaction will be prepared.\n     *\n     *  @param transactionToPopulate - The call to prepare\n     *  @returns the prepared call transaction\n     * @throws {InvalidDataType}\n     */\n    async populateCall(\n        transactionToPopulate: TransactionRequestInput\n    ): Promise<TransactionRequestInput> {\n        // 1 - Add from field (if not provided)\n        if (\n            transactionToPopulate.from === undefined ||\n            transactionToPopulate.from === null\n        )\n            transactionToPopulate.from = Address.checksum(\n                HexUInt.of(await this.getAddress())\n            );\n        // Throw an error if the from address does not match the signer address\n        // @note: this because we cannot sign a transaction with a different address\n        else if (\n            Address.checksum(HexUInt.of(transactionToPopulate.from)) !==\n            Address.checksum(HexUInt.of(await this.getAddress()))\n        ) {\n            throw new InvalidDataType(\n                'VeChainAbstractSigner.populateCall()',\n                'From address does not match the signer address.',\n                {\n                    signerAddress: Address.checksum(\n                        HexUInt.of(await this.getAddress())\n                    ),\n                    fromAddress: Address.checksum(\n                        HexUInt.of(transactionToPopulate.from)\n                    )\n                }\n            );\n        }\n\n        // 2 - Set to field\n        if (transactionToPopulate.to === undefined)\n            transactionToPopulate.to = null;\n\n        // 3 - Use directly clauses, if they are provided\n        if (\n            transactionToPopulate.clauses !== undefined &&\n            transactionToPopulate.clauses.length > 0\n        ) {\n            // 2.1 - Set to, value and data fields to be consistent\n            transactionToPopulate.to = transactionToPopulate.clauses[0].to;\n            transactionToPopulate.value =\n                transactionToPopulate.clauses[0].value;\n            transactionToPopulate.data = transactionToPopulate.clauses[0].data;\n        }\n\n        // Return the transaction\n        return transactionToPopulate;\n    }\n\n    /**\n     *  Prepares a {@link TransactionRequestInput} for sending to the network by\n     *  populating any missing properties:\n     *  - resolves ``to`` and ``from`` addresses\n     *  - if ``from`` is specified , check that it matches this Signer\n     *  - populates ``nonce`` via ``signer.getNonce(\"pending\")``\n     *  - populates gas parameters via ``signer.estimateGas(tx)``\n     *  - ... and other necessary properties\n     *\n     *  @param transactionToPopulate - The call to prepare\n     *  @returns the prepared transaction\n     *  @throws {JSONRPCInvalidParams}\n     */\n    async populateTransaction(\n        transactionToPopulate: TransactionRequestInput\n    ): Promise<TransactionBody> {\n        // 1 - Get the thor client\n        if ((this.provider as AvailableVeChainProviders) === undefined) {\n            throw new JSONRPCInvalidParams(\n                'VechainAbstractSigner.populateTransaction()',\n                'Thor client not found into the signer. Please attach a Provider with a thor client to your signer instance.',\n                { provider: this.provider }\n            );\n        }\n\n        const thorClient = (this.provider as AvailableVeChainProviders)\n            .thorClient;\n\n        // 2 - Populate the call, to get proper 'from' and 'to' address (compatible with multi-clause transactions)\n        const populatedTransaction = await this.populateCall(\n            transactionToPopulate\n        );\n\n        // 3 - Handle deprecated gasLimit property and estimate gas\n        let totalGasResult: number;\n\n        // Handle deprecated gasLimit property\n        if (transactionToPopulate.gasLimit !== undefined) {\n            console.warn(\n                '\\n****************** WARNING: Deprecated Property Usage ******************\\n' +\n                    '- The `gasLimit` property is deprecated and will be removed in a future release.\\n' +\n                    '- Please use the `gas` property instead.\\n' +\n                    '- The `gasLimit` value will be used as the `gas` value for this transaction.\\n'\n            );\n            totalGasResult = Number(transactionToPopulate.gasLimit);\n        } else if (transactionToPopulate.gas !== undefined) {\n            totalGasResult = Number(transactionToPopulate.gas);\n        } else {\n            totalGasResult = await this.estimateGas(transactionToPopulate);\n        }\n\n        // 4 - Build the transaction body\n        return await thorClient.transactions.buildTransactionBody(\n            populatedTransaction.clauses ??\n                this._buildClauses(populatedTransaction),\n            totalGasResult,\n            {\n                isDelegated: this.provider?.enableDelegation as boolean,\n                nonce:\n                    populatedTransaction.nonce ??\n                    (await this.getNonce('pending')),\n                blockRef: populatedTransaction.blockRef ?? undefined,\n                chainTag: populatedTransaction.chainTag ?? undefined,\n                dependsOn: populatedTransaction.dependsOn ?? undefined,\n                expiration: populatedTransaction.expiration,\n                gasPriceCoef: populatedTransaction.gasPriceCoef ?? undefined,\n                maxPriorityFeePerGas:\n                    populatedTransaction.maxPriorityFeePerGas ?? undefined,\n                maxFeePerGas: populatedTransaction.maxFeePerGas ?? undefined,\n                gas: transactionToPopulate.gas,\n                gasLimit: transactionToPopulate.gasLimit\n            }\n        );\n    }\n\n    /**\n     * Estimates the gas required to execute //tx// on the Blockchain. This\n     * will be the expected amount a transaction will need\n     * to successfully run all the necessary computations and store the changed state\n     * that the transaction intends.\n     *\n     * @param transactionToEstimate - The transaction to estimate gas for\n     * @returns the total estimated gas required\n     * @throws {JSONRPCInvalidParams}\n     */\n    async estimateGas(\n        transactionToEstimate: TransactionRequestInput\n    ): Promise<number> {\n        // 1 - Get the thor client\n        if ((this.provider as AvailableVeChainProviders) === undefined) {\n            throw new JSONRPCInvalidParams(\n                'VechainAbstractSigner.estimateGas()',\n                'Thor client not found into the signer. Please attach a Provider with a thor client to your signer instance.',\n                { provider: this.provider }\n            );\n        }\n\n        const thorClient = (this.provider as AvailableVeChainProviders)\n            .thorClient;\n\n        // 2 - Populate the call, to get proper from and to address (compatible with multi-clause transactions)\n        const populatedTransaction = await this.populateCall(\n            transactionToEstimate\n        );\n\n        // 3 - Estimate gas\n        const gasEstimation = await thorClient.transactions.estimateGas(\n            populatedTransaction.clauses ??\n                this._buildClauses(populatedTransaction),\n            populatedTransaction.from as string\n        );\n\n        // Return the gas estimation\n        return gasEstimation.totalGas;\n    }\n\n    /**\n     * Evaluates the //tx// by running it against the current Blockchain state. This\n     * cannot change state and has no cost, as it is effectively simulating\n     * execution.\n     *\n     * This can be used to have the Blockchain perform computations based on its state\n     * (e.g. running a Contract's getters) or to simulate the effect of a transaction\n     * before actually performing an operation.\n     *\n     * @param transactionToEvaluate - The transaction to evaluate\n     * @param revision - The block number or block ID of which the transaction simulation is based on\n     * @returns the result of the evaluation\n     * @throws {JSONRPCInvalidParams}\n     */\n    async call(\n        transactionToEvaluate: TransactionRequestInput,\n        revision?: Revision\n    ): Promise<string> {\n        // 1 - Get the thor client\n        if ((this.provider as AvailableVeChainProviders) === undefined) {\n            throw new JSONRPCInvalidParams(\n                'VechainAbstractSigner.call()',\n                'Thor client not found into the signer. Please attach a Provider with a thor client to your signer instance.',\n                { provider: this.provider }\n            );\n        }\n        const thorClient = (this.provider as AvailableVeChainProviders)\n            .thorClient;\n\n        // 2 - Populate the call, to get proper from and to address (compatible with multi-clause transactions)\n        const populatedTransaction = await this.populateCall(\n            transactionToEvaluate\n        );\n\n        // 3 - Evaluate the transaction\n        const simulation: TransactionSimulationResult[] =\n            await thorClient.transactions.simulateTransaction(\n                populatedTransaction.clauses ??\n                    this._buildClauses(populatedTransaction),\n                {\n                    revision: revision ?? undefined,\n                    gas: (populatedTransaction.gas as number) ?? undefined,\n                    gasPrice: populatedTransaction.gasPrice ?? undefined,\n                    caller: populatedTransaction.from as string,\n                    provedWork: populatedTransaction.provedWork ?? undefined,\n                    gasPayer: populatedTransaction.gasPayer ?? undefined,\n                    expiration: populatedTransaction.expiration ?? undefined,\n                    blockRef: populatedTransaction.blockRef ?? undefined\n                }\n            );\n\n        // 4 - Return the result of the evaluation\n        return simulation[0].data;\n    }\n\n    /**\n     *  Gets the next nonce required for this Signer to send a transaction.\n     *\n     *  @param blockTag - The blocktag to base the transaction count on, keep in mind\n     *         many nodes do not honour this value and silently ignore it [default: ``\"latest\"``]\n     *\n     *  @NOTE: This method generates a random number as nonce. It is because the nonce in VeChain is a 6-byte number.\n     */\n    async getNonce(blockTag?: string): Promise<string> {\n        // If provider is available, get the nonce from the provider using eth_getTransactionCount\n        if (this.provider !== undefined) {\n            return (await this.provider.request({\n                method: RPC_METHODS.eth_getTransactionCount,\n                params: [await this.getAddress(), blockTag]\n            })) as string;\n        }\n\n        // Otherwise return a random number\n        return Hex.random(6).toString();\n    }\n\n    /**\n     * Signs %%transactionToSign%%, returning the fully signed transaction. This does not\n     * populate any additional properties with eth_getTransactionCount: RPC_METHODS, p0: (string | undefined)[], args: EIP1193RequestArguments* @param transactionToSign - The transaction to sign\n     * @returns The fully signed transaction\n     */\n    abstract signTransaction(\n        transactionToSign: TransactionRequestInput\n    ): Promise<string>;\n\n    /**\n     *  Sends %%transactionToSend%% to the Network. The ``signer.populateTransaction(transactionToSend)``\n     *  is called first to ensure all necessary properties for the\n     *  transaction to be valid have been populated first.\n     *\n     *  @param transactionToSend - The transaction to send\n     *  @returns The transaction response\n     */\n    abstract sendTransaction(\n        transactionToSend: TransactionRequestInput\n    ): Promise<string>;\n\n    /**\n     * Signs a bytes payload returning the VeChain signature in hexadecimal format.\n     * @param {Uint8Array} payload in bytes to sign.\n     * @returns {string} The VeChain signature in hexadecimal format.\n     */\n    abstract signPayload(payload: Uint8Array): Promise<string>;\n\n    /**\n     * Signs an [[link-eip-191]] prefixed a personal message.\n     *\n     * @param {string|Uint8Array} message - The message to be signed.\n     *                                      If the %%message%% is a string, it is signed as UTF-8 encoded bytes.\n     *                                      It is **not** interpreted as a [[BytesLike]];\n     *                                      so the string ``\"0x1234\"`` is signed as six characters, **not** two bytes.\n     * @return {Promise<string>} - A Promise that resolves to the signature as a string.\n     */\n    public async signMessage(message: string | Uint8Array): Promise<string> {\n        try {\n            const payload =\n                typeof message === 'string' ? Txt.of(message).bytes : message;\n            const payloadHashed = Keccak256.of(\n                concatBytes(\n                    this.MESSAGE_PREFIX,\n                    Txt.of(payload.length).bytes,\n                    payload\n                )\n            ).bytes;\n            return await this.signPayload(payloadHashed);\n        } catch (error) {\n            throw new SignerMethodError(\n                'VeChainAbstractSigner.signMessage',\n                'The message could not be signed.',\n                { message },\n                error\n            );\n        }\n    }\n\n    /**\n     * Deduces the primary from the types if not given.\n     * The primary type will be the only type that is not used in any other type.\n     * @param {Record<string, TypedDataParameter[]>} types - The types used for EIP712.\n     * @returns {string} The primary type.\n     */\n    private deducePrimaryType(\n        types: Record<string, TypedDataParameter[]>\n    ): string {\n        const parents = new Map<string, string[]>();\n\n        // Initialize parents map\n        Object.keys(types).forEach((type) => {\n            parents.set(type, []);\n        });\n\n        // Populate parents map\n        for (const name in types) {\n            for (const field of types[name]) {\n                // In case the type is an array, we get its prefix\n                const type = field.type.split('[')[0];\n                if (parents.has(type)) {\n                    parents.get(type)?.push(name);\n                }\n            }\n        }\n\n        // Find primary types\n        const primaryTypes = Array.from(parents.keys()).filter(\n            (n) => parents.get(n)?.length === 0\n        );\n\n        if (primaryTypes.length !== 1) {\n            throw new SignerMethodError(\n                'VeChainAbstractSigner.deducePrimaryType',\n                'Ambiguous primary types or unused types.',\n                { primaryTypes: primaryTypes.join(', ') }\n            );\n        }\n\n        return primaryTypes[0];\n    }\n\n    /**\n     * Signs the [[link-eip-712]] typed data.\n     *\n     * @param {TypedDataDomain} domain - The domain parameters used for signing.\n     * @param {Record<string, TypedDataParameter[]>} types - The types used for signing.\n     * @param {Record<string, unknown>} message - The message data to be signed.\n     * @param {string} primaryType - The primary type used for signing.\n     *\n     * @return {Promise<string>} - A promise that resolves with the signature string.\n     */\n    public async signTypedData(\n        domain: TypedDataDomain,\n        types: Record<string, TypedDataParameter[]>,\n        message: Record<string, unknown>,\n        primaryType?: string\n    ): Promise<string> {\n        try {\n            const viemDomain: viemTypedDataDomain = {\n                chainId: undefined,\n                name: domain.name,\n                salt: domain.salt,\n                verifyingContract: domain.verifyingContract,\n                version: domain.version\n            };\n            // convert chainId\n            if (domain.chainId !== undefined) {\n                if (\n                    typeof domain.chainId === 'string' ||\n                    typeof domain.chainId === 'number'\n                ) {\n                    viemDomain.chainId = BigInt(domain.chainId);\n                } else if (typeof domain.chainId === 'bigint') {\n                    viemDomain.chainId = domain.chainId;\n                } else {\n                    throw new InvalidDataType(\n                        'VeChainAbstractSigner.signTypedData',\n                        'Invalid chainId type.',\n                        { chainId: domain.chainId }\n                    );\n                }\n            }\n            const payload = Hex.of(\n                hashTypedData({\n                    domain: viemDomain,\n                    types,\n                    primaryType: primaryType ?? this.deducePrimaryType(types), // Deduce the primary type if not provided\n                    message\n                })\n            ).bytes;\n\n            return await this.signPayload(payload);\n        } catch (error) {\n            throw new SignerMethodError(\n                'VeChainAbstractSigner.signTypedData',\n                'The typed data could not be signed.',\n                { domain, types, message, primaryType },\n                error\n            );\n        }\n    }\n\n    /**\n     * Use vet.domains to resolve name to address\n     * @param vnsName - The name to resolve\n     * @returns the address for a name or null\n     */\n    async resolveName(vnsName: string): Promise<null | string> {\n        if (this.provider === undefined) {\n            return null;\n        }\n\n        return await vnsUtils.resolveName(this.provider.thorClient, vnsName);\n    }\n\n    /**\n     * Build the transaction clauses\n     * form a transaction given as input\n     *\n     * @param transaction - The transaction to sign\n     * @returns The transaction clauses\n     */\n    protected _buildClauses(\n        transaction: TransactionRequestInput\n    ): TransactionClause[] {\n        return transaction.to !== undefined && transaction.to !== null\n            ? // Normal transaction\n              [\n                  {\n                      to: transaction.to,\n                      data: transaction.data ?? '0x',\n                      value: transaction.value ?? '0x0'\n                  } satisfies TransactionClause\n              ]\n            : // If 'to' address is not provided, it will be assumed that the transaction is a contract creation transaction.\n              [\n                  Clause.deployContract(\n                      HexUInt.of(transaction.data ?? 0),\n                      undefined,\n                      {\n                          value:\n                              transaction.value === undefined\n                                  ? transaction.value\n                                  : HexUInt.of(transaction.value).toString(\n                                        true\n                                    ),\n                          comment: transaction.comment\n                      }\n                  ) as TransactionClause\n              ];\n    }\n}\n\nexport { VeChainAbstractSigner };\n","import {\n    Address,\n    Hex,\n    HexUInt,\n    Secp256k1,\n    Transaction,\n    type TransactionBody\n} from '@vechain/sdk-core';\nimport {\n    InvalidDataType,\n    InvalidSecp256k1PrivateKey,\n    JSONRPCInvalidParams\n} from '@vechain/sdk-errors';\nimport { RPC_METHODS } from '../../../provider/utils/const/rpc-mapper/rpc-methods';\nimport {\n    DelegationHandler,\n    type SignTransactionOptions,\n    type ThorClient\n} from '../../../thor-client';\nimport {\n    type AvailableVeChainProviders,\n    type TransactionRequestInput\n} from '../types';\nimport { VeChainAbstractSigner } from '../vechain-abstract-signer/vechain-abstract-signer';\n\n/**\n * Basic VeChain signer with the private key.\n * This signer can be initialized using a private key.\n */\nclass VeChainPrivateKeySigner extends VeChainAbstractSigner {\n    /**\n     * Create a new VeChainPrivateKeySigner.\n     * A signer can be initialized using a private key.\n     *\n     * @param privateKey - The private key of the signer\n     * @param provider - The provider to connect to\n     */\n    constructor(\n        private readonly privateKey: Uint8Array,\n        provider?: AvailableVeChainProviders\n    ) {\n        // Assert if the transaction can be signed\n        if (!Secp256k1.isValidPrivateKey(privateKey)) {\n            throw new InvalidSecp256k1PrivateKey(\n                `VeChainPrivateKeySigner.constructor()`,\n                \"Invalid private key used to sign initialize the signer. Ensure it's a valid Secp256k1 private key.\",\n                undefined\n            );\n        }\n\n        // Call the parent constructor\n        super(provider);\n    }\n\n    /**\n     *  Returns a new instance of this Signer connected to //provider// or detached\n     *  from any Provider if null.\n     *\n     * @param provider - The provider to connect to\n     * @returns a new instance of this Signer connected to //provider// or detached\n     */\n    connect(provider: AvailableVeChainProviders): this {\n        return new VeChainPrivateKeySigner(this.privateKey, provider) as this;\n    }\n\n    /**\n     * Get the address checksum of the Signer.\n     *\n     * @returns the address checksum of the signer\n     */\n    async getAddress(): Promise<string> {\n        return Address.checksum(\n            HexUInt.of(\n                await Promise.resolve(\n                    Address.ofPrivateKey(this.privateKey).toString()\n                )\n            )\n        );\n    }\n\n    /**\n     * Signs %%transactionToSign%%, returning the fully signed transaction. This does not\n     * populate any additional properties with eth_getTransactionCount: RPC_METHODS, p0: (string | undefined)[], args: EIP1193RequestArguments* @param transactionToSign - The transaction to sign\n     * @returns The fully signed transaction\n     */\n    async signTransaction(\n        transactionToSign: TransactionRequestInput\n    ): Promise<string> {\n        // Check the provider (needed to sign the transaction)\n        if (this.provider === undefined) {\n            throw new JSONRPCInvalidParams(\n                'VeChainPrivateKeySigner.signTransaction()',\n                'Thor provider is not found into the signer. Please attach a Provider to your signer instance.',\n                { transactionToSign }\n            );\n        }\n\n        let gasPayer = DelegationHandler(\n            await this.provider.wallet?.getGasPayer()\n        ).gasPayerOrNull();\n\n        // Override the gasPayer if the transaction has a delegation URL\n        if (transactionToSign.delegationUrl !== undefined) {\n            gasPayer = {\n                gasPayerServiceUrl: transactionToSign.delegationUrl\n            };\n        }\n\n        // Sign the transaction\n        return await this._signFlow(\n            transactionToSign,\n            gasPayer,\n            this.provider.thorClient\n        );\n    }\n\n    /**\n     * Sends a transaction to the blockchain.\n     *\n     * @param {TransactionRequestInput} transactionToSend - The transaction object to be sent.\n     * This includes all the necessary details such as `to`, `value`, `data`, `gas`, etc.\n     * Note: `gasLimit` is deprecated and will be removed in a future release. Use `gas` instead.\n     * @return {Promise<string>} A promise that resolves to the transaction hash as a string\n     * once the transaction is successfully sent.\n     * @throws {JSONRPCInvalidParams} Throws an error if the provider is not attached\n     * to the signer, indicating the signer's inability to send the transaction.\n     */\n    async sendTransaction(\n        transactionToSend: TransactionRequestInput\n    ): Promise<string> {\n        // 1 - Get the provider (needed to send the raw transaction)\n        if (this.provider === undefined) {\n            throw new JSONRPCInvalidParams(\n                'VeChainPrivateKeySigner.sendTransaction()',\n                'Thor provider is not found into the signer. Please attach a Provider to your signer instance.',\n                { transactionToSend }\n            );\n        }\n\n        const provider = this.provider;\n\n        // 2 - Sign the transaction\n        const signedTransaction = await this.signTransaction(transactionToSend);\n\n        // 3 - Send the signed transaction\n        return (await provider.request({\n            method: RPC_METHODS.eth_sendRawTransaction,\n            params: [signedTransaction]\n        })) as string;\n    }\n\n    /**\n     * Signs a payload.\n     *\n     * @param {Uint8Array} payload - The payload to be signed as a byte array\n     * @return {Promise<string>} - A Promise that resolves to the signature as a string.\n     */\n    async signPayload(payload: Uint8Array): Promise<string> {\n        const sign = Secp256k1.sign(payload, new Uint8Array(this.privateKey));\n        // SCP256K1 encodes the recovery flag in the last byte. EIP-191 adds 27 to it.\n        sign[sign.length - 1] += 27;\n        return await Promise.resolve(Hex.of(sign).toString());\n    }\n\n    /**\n     * Signs a transaction internal method\n     *\n     * @param transaction - The transaction to sign\n     * @param gasPayer - The gasPayer to use\n     * @param thorClient - The ThorClient instance\n     * @returns The fully signed transaction\n     * @throws {InvalidSecp256k1PrivateKey, InvalidDataType}\n     */\n    async _signFlow(\n        transaction: TransactionRequestInput,\n        gasPayer: SignTransactionOptions | null,\n        thorClient: ThorClient\n    ): Promise<string> {\n        // Populate the call, to get proper from and to address (compatible with multi-clause transactions)\n        const populatedTransaction =\n            await this.populateTransaction(transaction);\n\n        // Sign the transaction\n        return gasPayer !== null\n            ? await this._signWithGasPayer(\n                  populatedTransaction,\n                  this.privateKey,\n                  thorClient,\n                  gasPayer\n              )\n            : Hex.of(\n                  Transaction.of(populatedTransaction).sign(this.privateKey)\n                      .encoded\n              ).toString();\n    }\n\n    /**\n     * Signs a transaction where the gas fee is paid by a gasPayer.\n     *\n     * @param unsignedTransactionBody - The unsigned transaction body to sign.\n     * @param originPrivateKey - The private key of the origin account.\n     * @param thorClient - The ThorClient instance.\n     * @param gasPayerOptions - Optional parameters for the request. Includes the `gasPayerServiceUrl` and `gasPayerPrivateKey` fields.\n     *                  Only one of the following options can be specified: `gasPayerServiceUrl`, `gasPayerPrivateKey`.\n     * @returns A promise that resolves to the signed transaction.\n     * @throws {NotDelegatedTransaction}\n     */\n    private async _signWithGasPayer(\n        unsignedTransactionBody: TransactionBody,\n        originPrivateKey: Uint8Array,\n        thorClient: ThorClient,\n        gasPayerOptions?: SignTransactionOptions\n    ): Promise<string> {\n        // Address of the origin account\n        const originAddress = Address.ofPrivateKey(originPrivateKey).toString();\n\n        const unsignedTx = Transaction.of(unsignedTransactionBody);\n\n        // Sign transaction with origin private key and gasPayer private key\n        if (gasPayerOptions?.gasPayerPrivateKey !== undefined) {\n            // Validate the gas payer private key before using it\n            if (!HexUInt.isValid(gasPayerOptions.gasPayerPrivateKey)) {\n                throw new InvalidDataType(\n                    'VeChainPrivateKeySigner._signWithGasPayer',\n                    'Invalid gas payer private key. Ensure it is a valid hexadecimal string.',\n                    { gasPayerPrivateKey: gasPayerOptions.gasPayerPrivateKey }\n                );\n            }\n\n            return Hex.of(\n                Transaction.of(unsignedTransactionBody).signAsSenderAndGasPayer(\n                    originPrivateKey,\n                    HexUInt.of(gasPayerOptions.gasPayerPrivateKey).bytes\n                ).encoded\n            ).toString();\n        }\n\n        // Otherwise, get the signature of the gasPayer from the gasPayer endpoint\n        const gasPayerSignature = await DelegationHandler(\n            gasPayerOptions\n        ).getDelegationSignatureUsingUrl(\n            unsignedTx,\n            originAddress,\n            thorClient.httpClient\n        );\n\n        // Sign transaction with origin private key\n        const originSignature = Secp256k1.sign(\n            unsignedTx.getTransactionHash().bytes,\n            originPrivateKey\n        );\n\n        // Sign the transaction with both signatures. Concat both signatures to get the final signature\n        const signature = new Uint8Array(\n            originSignature.length + gasPayerSignature.length\n        );\n        signature.set(originSignature);\n        signature.set(gasPayerSignature, originSignature.length);\n\n        // Return new signed transaction\n        return Hex.of(\n            Transaction.of(unsignedTx.body, signature).encoded\n        ).toString();\n    }\n}\n\nexport { VeChainPrivateKeySigner };\n","import { Address, HexUInt } from '@vechain/sdk-core';\nimport { InvalidDataType } from '@vechain/sdk-errors';\nimport {\n    type AvailableVeChainProviders,\n    VeChainPrivateKeySigner,\n    type VeChainSigner\n} from '../../../../signer';\nimport {\n    DelegationHandler,\n    type SignTransactionOptions\n} from '../../../../thor-client';\nimport {\n    type ProviderInternalWallet,\n    type ProviderInternalWalletAccount\n} from '../types';\n\n/**\n * Abstract implementation of Provider internal wallet class.\n */\nabstract class AbstractProviderInternalWallet\n    implements ProviderInternalWallet\n{\n    /**\n     * List of accounts in the wallet.\n     */\n    readonly accounts: ProviderInternalWalletAccount[];\n\n    /**\n     * Options for signing a transaction with gasPayer.\n     */\n    readonly gasPayer?: SignTransactionOptions;\n\n    /**\n     * Create a new wallet.\n     *\n     * @param accounts List of accounts in the wallet.\n     * @param options Optional options for signing a transaction with gasPayer.\n     */\n    constructor(\n        accounts: ProviderInternalWalletAccount[],\n        options?: {\n            gasPayer?: SignTransactionOptions;\n        }\n    ) {\n        this.accounts = accounts;\n        this.gasPayer = options?.gasPayer;\n    }\n\n    /**\n     * Get a signer into the internal wallet provider\n     * for the given address.\n     *\n     * @param parentProvider - The parent provider of the Internal Wallet.\n     * @param addressOrIndex - Address of the account.\n     * @returns The signer for the given address.\n     */\n    abstract getSigner(\n        parentProvider: AvailableVeChainProviders,\n        addressOrIndex?: string | number\n    ): Promise<VeChainSigner | null>;\n\n    /**\n     * SYNC Version of getSigner()\n     *\n     * Get a signer into the internal wallet provider\n     * for the given address.\n     *\n     * @param parentProvider - The parent provider of the Internal Wallet.\n     * @param addressOrIndex - Address or index of the account.\n     * @returns The signer for the given address.\n     */\n    getSignerSync(\n        parentProvider: AvailableVeChainProviders,\n        addressOrIndex?: string | number\n    ): VeChainSigner | null {\n        // Get the account from the wallet\n        const signerAccount = this.getAccountSync(addressOrIndex);\n\n        // Return a new signer (if exists)\n        if (signerAccount?.privateKey !== undefined) {\n            return new VeChainPrivateKeySigner(\n                signerAccount.privateKey,\n                parentProvider\n            );\n        }\n\n        // Return null if the account is not found\n        return null;\n    }\n\n    /**\n     * Get the list of addresses in the wallet.\n     *\n     * @returns The list of addresses in the wallet.\n     */\n    abstract getAddresses(): Promise<string[]>;\n\n    /**\n     * SYNC Version of getAddresses()\n     *\n     * Get the list of addresses in the wallet.\n     *\n     * @returns The list of addresses in the wallet.\n     */\n    getAddressesSync(): string[] {\n        return this.accounts.map((account) => account.address);\n    }\n\n    /**\n     * Get an account given an address or an index.\n     *\n     * @param addressOrIndex - Address or index of the account.\n     * @returns The account with the given address, or null if not found.\n     */\n    abstract getAccount(\n        addressOrIndex?: string | number\n    ): Promise<ProviderInternalWalletAccount | null>;\n\n    /**\n     * SYNC Version of getAccount()\n     *\n     * Get an account given an address or an index.\n     *\n     * @param addressOrIndex - Address or index of the account.\n     * @returns The account with the given address, or null if not found.\n     * @throws {InvalidDataType}\n     */\n    getAccountSync(\n        addressOrIndex?: string | number\n    ): ProviderInternalWalletAccount | null {\n        if (\n            addressOrIndex === undefined ||\n            typeof addressOrIndex === 'number'\n        ) {\n            return this.accounts[addressOrIndex ?? 0] ?? null;\n        }\n\n        // Check if the address is valid\n        if (!Address.isValid(addressOrIndex)) {\n            throw new InvalidDataType(\n                'AbstractProviderInternalWallet.getAccountSync()',\n                'Invalid params expected an address.',\n                { addressOrIndex }\n            );\n        }\n\n        // Get the account by address\n        const account = this.accounts.find(\n            (account) =>\n                Address.checksum(HexUInt.of(account.address)) ===\n                Address.checksum(HexUInt.of(addressOrIndex))\n        );\n        return account ?? null;\n    }\n\n    /**\n     * Get the options for signing a transaction with gasPayer (if any).\n     *\n     * @returns The options for signing a transaction with gasPayer.\n     */\n    abstract getGasPayer(): Promise<SignTransactionOptions | null>;\n\n    /**\n     * SYNC Version of getGasPayer()\n     *\n     * Get the options for signing a transaction with gasPayer (if any).\n     *\n     * @returns The options for signing a transaction with gasPayer.\n     */\n    getGasPayerSync(): SignTransactionOptions | null {\n        return DelegationHandler(this.gasPayer).gasPayerOrNull();\n    }\n}\n\nexport { AbstractProviderInternalWallet };\n","import { type ProviderInternalWalletAccount } from '../types';\nimport { type SignTransactionOptions } from '../../../../thor-client/transactions/types';\nimport {\n    type AvailableVeChainProviders,\n    type VeChainSigner\n} from '../../../../signer/signers/types';\nimport { AbstractProviderInternalWallet } from '../abstract-wallet/abstract-provider-internal-wallet';\n\n/**\n * Provider internal Base wallet class.\n *\n * This is the most basic wallet implementation we can have:\n * * This wallet is generated by a list of private keys\n */\nclass ProviderInternalBaseWallet extends AbstractProviderInternalWallet {\n    /**\n     * Get a signer into the internal wallet provider\n     * for the given address.\n     *\n     * @param parentProvider - The parent provider of the Internal Wallet.\n     * @param addressOrIndex - Address of the account.\n     * @returns The signer for the given address.\n     */\n    async getSigner(\n        parentProvider: AvailableVeChainProviders,\n        addressOrIndex?: string | number\n    ): Promise<VeChainSigner | null> {\n        return await Promise.resolve(\n            this.getSignerSync(parentProvider, addressOrIndex)\n        );\n    }\n\n    /**\n     * Get the list of addresses in the wallet.\n     *\n     * @returns The list of addresses in the wallet.\n     */\n    async getAddresses(): Promise<string[]> {\n        return await Promise.resolve(this.getAddressesSync());\n    }\n\n    /**\n     * Get an account given an address or an index.\n     *\n     * @param addressOrIndex - Address or index of the account.\n     * @returns The account with the given address, or null if not found.\n     */\n    async getAccount(\n        addressOrIndex?: string | number\n    ): Promise<ProviderInternalWalletAccount | null> {\n        return await Promise.resolve(this.getAccountSync(addressOrIndex));\n    }\n\n    /**\n     * Get the options for signing a transaction with gasPayer (if any).\n     *\n     * @returns The options for signing a transaction with gasPayer.\n     */\n    async getGasPayer(): Promise<SignTransactionOptions | null> {\n        return await Promise.resolve(this.getGasPayerSync());\n    }\n}\n\nexport { ProviderInternalBaseWallet };\n","import { Address, HDKey, Secp256k1 } from '@vechain/sdk-core';\nimport { type SignTransactionOptions } from '../../../../thor-client';\nimport { ProviderInternalBaseWallet } from '../base-wallet';\n\nclass ProviderInternalHDWallet extends ProviderInternalBaseWallet {\n    /**\n     * Mnemonic of the wallet.\n     */\n    readonly mnemonic: string[];\n\n    /**\n     * Derivation path of the wallet.\n     */\n    readonly derivationPath: string;\n\n    /**\n     * Number of accounts to generate.\n     */\n    readonly count: number;\n\n    /**\n     * Initial index of the accounts to generate.\n     */\n    readonly initialIndex: number;\n\n    /**\n     * Create a new HD wallet.\n     *\n     * @param mnemonic - Mnemonic of the wallet as an array of words.\n     * @param count - Number of accounts to generate.\n     * @param initialIndex - Initial index of the accounts to generate.\n     * @param derivationPath - Derivation path of the wallet.\n     * @param options - Options for signing a transaction with gasPayer.\n     */\n    constructor(\n        mnemonic: string[],\n        count: number = 1,\n        initialIndex: number = 0,\n        derivationPath: string = HDKey.VET_DERIVATION_PATH,\n        options?: {\n            gasPayer?: SignTransactionOptions;\n        }\n    ) {\n        // Initialize the base wallet with the generated accounts\n        super(\n            [...Array(count).keys()].map((path: number) => {\n                // Convert the private key to a buffer\n                const privateKeyBuffer = HDKey.fromMnemonic(\n                    mnemonic,\n                    derivationPath\n                ).deriveChild(path + initialIndex).privateKey as Uint8Array;\n\n                // Derive the public key and address from the private key\n                return {\n                    privateKey: privateKeyBuffer,\n                    publicKey: Secp256k1.derivePublicKey(privateKeyBuffer),\n                    address: Address.ofPrivateKey(privateKeyBuffer).toString()\n                };\n            }),\n            options\n        );\n\n        // Set the wallet properties\n        this.mnemonic = mnemonic;\n        this.derivationPath = derivationPath;\n        this.count = count;\n        this.initialIndex = initialIndex;\n    }\n}\n\nexport { ProviderInternalHDWallet };\n","import { stringifyData } from '@vechain/sdk-errors';\nimport {\n    JsonRpcApiProvider,\n    type JsonRpcError,\n    type JsonRpcPayload,\n    type JsonRpcResult\n} from 'ethers';\nimport { type HardhatVeChainProvider } from '../hardhat-provider/hardhat-provider';\n\n/**\n * JSON RPC provider for ethers.\n * Needed to customize ethers functionality into hardhat plugin.\n */\nclass JSONRPCEthersProvider extends JsonRpcApiProvider {\n    /**\n     * Instance of Hardhat VeChain provider to wrap\n     */\n    hardhatProvider: HardhatVeChainProvider;\n\n    /**\n     * Constructor with parameters.\n     *\n     * @param chainId - The chain id of the network\n     * @param networkName - The name of the network\n     * @param hardhatProvider - The hardhat provider to wrap\n     */\n    constructor(\n        chainId: number,\n        networkName: string,\n        hardhatProvider: HardhatVeChainProvider\n    ) {\n        super({ name: networkName, chainId });\n        this.hardhatProvider = hardhatProvider;\n    }\n\n    /**\n     * Override the send method to use the hardhat provider and to call _start method.\n     *\n     * @param method - The method to call\n     * @param params - The parameters of the method\n     */\n    async send(\n        method: string,\n        params: unknown[] | Record<string, unknown>\n    ): Promise<unknown> {\n        // Call the _start method\n        this._start();\n\n        // Call the _send method\n        return (await super.send(method, params)) as unknown;\n    }\n\n    /**\n     * Internal method to send the payload to the hardhat provider.\n     * This method is able to send multiple payloads. (send in batch)\n     *\n     * @param payload - The payload to send (request and method)'s\n     */\n    async _send(\n        payload: JsonRpcPayload | JsonRpcPayload[]\n    ): Promise<Array<JsonRpcResult | JsonRpcError>> {\n        // Initialize the request array\n        const requestPayloadArray = Array.isArray(payload)\n            ? payload\n            : [payload];\n\n        // Empty response array\n        const responses: Array<JsonRpcResult | JsonRpcError> = [];\n\n        // Call the hardhat provider for each request\n        for (const jsonRpcPayload of requestPayloadArray) {\n            // Do the request\n            try {\n                const result = (await this.hardhatProvider.send(\n                    jsonRpcPayload.method,\n                    jsonRpcPayload.params as unknown[]\n                )) as JsonRpcResult;\n\n                // Push the result to the response array\n                responses.push({\n                    id: jsonRpcPayload.id,\n                    result\n                });\n            } catch (e) {\n                // Push the error to the response array\n                responses.push({\n                    id: jsonRpcPayload.id,\n                    error: {\n                        code: -32603,\n                        message: stringifyData(e)\n                    }\n                });\n            }\n        }\n\n        return responses;\n    }\n}\n\nexport { JSONRPCEthersProvider };\n","/**\n * Polling interval for the subscription events polling mechanism for the VeChain provider.\n */\nconst POLLING_INTERVAL: number = 5000;\n\nexport { POLLING_INTERVAL };\n","import { HexUInt, Revision } from '@vechain/sdk-core';\nimport { JSONRPCInvalidDefaultBlock } from '@vechain/sdk-errors';\n\ntype DefaultBlock =\n    | `0x${string}`\n    | 'latest'\n    | 'earliest'\n    | 'pending'\n    | 'safe'\n    | 'finalized';\nconst defaultBlockTags: DefaultBlock[] = [\n    'latest',\n    'earliest',\n    'pending',\n    'safe',\n    'finalized'\n];\n\n/**\n * Maps the Ethereum \"default block\" type to VeChainThor Revision type.\n * Ethereum \"default block\" can be:\n * - 'latest' or 'earliest' or 'pending' or 'safe' or 'finalized'\n * - a hexadecimal block number\n * VeChainThor revision type can be:\n * - 'best', 'next', 'justified', 'finalized'\n * - a hexadecimal block Id\n * - a integer block number\n *\n * @param defaultBlock - The Ethereum default block type to convert\n * @returns The VeChainThor revision type\n */\nconst DefaultBlockToRevision = (defaultBlock: DefaultBlock): Revision => {\n    // if valid hex then return integer block number\n    if (HexUInt.isValid(defaultBlock)) {\n        return Revision.of(HexUInt.of(defaultBlock).n.toString());\n    }\n    // check if default block is a valid block tag\n    if (!defaultBlockTags.includes(defaultBlock)) {\n        const defaultBlockValue = defaultBlock.toString();\n        throw new JSONRPCInvalidDefaultBlock(\n            'DefaultBlockToRevision',\n            `Invalid default block: ${defaultBlockValue}`,\n            defaultBlockValue,\n            null\n        );\n    }\n    // map block tag to VeChainThor revision\n    if (defaultBlock === 'earliest') {\n        return Revision.of(HexUInt.of(0));\n    } else if (defaultBlock === 'safe') {\n        return Revision.of('justified');\n    } else if (defaultBlock === 'finalized') {\n        return Revision.of('finalized');\n    } else {\n        return Revision.of('best');\n    }\n};\n\nexport { type DefaultBlock, DefaultBlockToRevision };\n","import { HexUInt } from '@vechain/sdk-core';\n\n/**\n * Chain ID's this is the blockId of the genesis block\n */\nconst CHAIN_ID = {\n    MAINNET: '0x186a9',\n    TESTNET: '0x186aa',\n    SOLO_DEFAULT: '0xf6'\n};\n\nconst CHAIN_TAG = {\n    MAINNET: '0x4a',\n    TESTNET: '0x27',\n    SOLO_DEFAULT: '0xf6'\n};\n\n/**\n * Converts a chain tag to a chain Id\n * @param chainTag chain tag as last byte of genesis block id\n * @returns chain id\n */\nconst chainTagToChainId = (chainTag: HexUInt): HexUInt => {\n    if (chainTag.isEqual(HexUInt.of(CHAIN_TAG.MAINNET))) {\n        return HexUInt.of(CHAIN_ID.MAINNET);\n    } else if (chainTag.isEqual(HexUInt.of(CHAIN_TAG.TESTNET))) {\n        return HexUInt.of(CHAIN_ID.TESTNET);\n    } else if (chainTag.isEqual(HexUInt.of(CHAIN_TAG.SOLO_DEFAULT))) {\n        return HexUInt.of(CHAIN_ID.SOLO_DEFAULT);\n    } else {\n        return chainTag;\n    }\n};\n\nexport { CHAIN_ID, CHAIN_TAG, chainTagToChainId };\n","import { InvalidDataType } from '@vechain/sdk-errors';\nimport {\n    blocksFormatter,\n    type BlocksRPC,\n    type TransactionRPC\n} from '../../formatter';\nimport { type ExpandedBlockDetail } from '../../../../thor-client';\n\n/**\n * Get the index of the transaction in the specified block.\n *\n * @param block - The block to search in.\n * @param hash - The hash of the transaction to search for.\n * @returns the index of the transaction in the block or null if the transaction is not in the block.\n * @throws {InvalidDataType}\n */\nconst getTransactionIndexIntoBlock = (\n    block: BlocksRPC,\n    hash: string\n): number => {\n    const idx =\n        typeof block.transactions[0] === 'string'\n            ? (block.transactions as string[]).findIndex(\n                  (tx: string) => tx === hash\n              )\n            : block.transactions.findIndex(\n                  (tx) => (tx as TransactionRPC).hash === hash\n              );\n\n    if (idx === -1) {\n        throw new InvalidDataType(\n            'getTransactionIndexIntoBlock()',\n            'Transaction not found in block.',\n            { block, hash }\n        );\n    }\n\n    return idx;\n};\n\n/**\n * Get the number of logs ahead of a transaction into a block.\n *\n * @param blockExpanded - The block to search in.\n * @param transactionId - The hash of the transaction to search for.\n * @param chainId - The chain ID of the network.\n */\nconst getNumberOfLogsAheadOfTransactionIntoBlockExpanded = (\n    blockExpanded: ExpandedBlockDetail,\n    transactionId: string,\n    chainId: string\n): number => {\n    // Get transaction index into the block\n    const transactionIndex = getTransactionIndexIntoBlock(\n        blocksFormatter.formatToRPCStandard(blockExpanded, chainId),\n        transactionId\n    );\n\n    // Count the number of logs in the txs whose number is lower than txId\n    let logIndex: number = 0;\n\n    // Iterate over the transactions into the block bounded by the transaction index\n    for (let i = 0; i < transactionIndex; i++) {\n        const currentTransaction = blockExpanded.transactions[i];\n\n        // Iterate over the outputs of the current transaction\n        for (const output of currentTransaction.outputs) {\n            logIndex += output.events.length;\n        }\n    }\n\n    return logIndex;\n};\n\nexport {\n    getTransactionIndexIntoBlock,\n    getNumberOfLogsAheadOfTransactionIntoBlockExpanded\n};\n","import {\n    type TransactionReceiptLogsRPC,\n    type TransactionReceiptRPC,\n    type TransactionRPC\n} from './types';\nimport {\n    fromTransactionType,\n    Hex,\n    HexUInt,\n    Quantity,\n    TransactionType,\n    ZERO_BYTES\n} from '@vechain/sdk-core';\nimport {\n    getNumberOfLogsAheadOfTransactionIntoBlockExpanded,\n    getTransactionIndexIntoBlock\n} from '../../helpers/transaction/transaction-helpers';\nimport { blocksFormatter } from '../blocks';\nimport {\n    type ExpandedBlockDetail,\n    type TransactionDetailNoRaw,\n    type TransactionReceipt,\n    type TransactionsExpandedBlockDetail\n} from '../../../../thor-client';\n\n/**\n * Maps VeChain transaction types to Ethereum transaction types.\n * - VeChain Type 0 (legacy) maps to Ethereum Type 0 (legacy) -> '0x0'\n * - VeChain Type 81 (0x51, EIP1559) maps to Ethereum Type 2 (EIP-1559) -> '0x2'\n *\n * @param vechainType - The VeChain transaction type (0 or 81)\n * @returns The Ethereum transaction type as a hex string ('0x0' or '0x2')\n */\nconst mapVeChainTypeToEthereumType = (\n    vechainType: number | undefined | null\n): '0x0' | '0x2' => {\n    // If vechainType is undefined, null, or not a number, default to 0 (legacy)\n    if (\n        vechainType === undefined ||\n        vechainType === null ||\n        typeof vechainType !== 'number'\n    ) {\n        return '0x0';\n    }\n\n    // Type 81 (EIP1559) in VeChain corresponds to Type 2 (EIP-1559) in Ethereum\n    if (vechainType === fromTransactionType(TransactionType.EIP1559)) {\n        return '0x2';\n    }\n    // Default to legacy transaction type (0x0)\n    return '0x0';\n};\n\n/**\n * Output formatter for Transaction details.\n *\n * @param tx - The Transaction details to be formatted.\n * @param blockHash - The hash of the block where the transaction is in.\n * @param blockNumber - The number of the block where the transaction is in.\n * @param chainId - The chain ID of the network.\n * @param txIndex - The index of the transaction in the block.\n *\n * @returns The RPC standard formatted transaction.\n */\nconst _formatTransactionToRPC = (\n    tx: TransactionDetailNoRaw | TransactionsExpandedBlockDetail,\n    blockHash: string,\n    blockNumber: number,\n    chainId: string,\n    txIndex: number\n): TransactionRPC => {\n    // Default to legacy transaction type if 'type' property doesn't exist\n    const txType = 'type' in tx ? tx.type : 0;\n\n    return {\n        // Supported fields\n        blockHash,\n        blockNumber: Quantity.of(blockNumber).toString(),\n        from: tx.origin,\n        gas: Quantity.of(HexUInt.of(tx.gas).bi).toString(),\n        chainId,\n        hash: tx.id,\n        nonce: tx.nonce as string,\n        transactionIndex: Quantity.of(txIndex).toString(),\n\n        /**\n         * `input`, `to`, `value` are being referred to the first clause.\n         * VeChain supports multiple clauses in one transaction, thus the actual data should be obtained by looking into each clause.\n         * Due to the single clause limitation of Ethereum, we assume the first clause is the clause from which we obtain the data.\n         */\n        input: tx.clauses[0]?.data ?? '',\n        to: tx.clauses[0]?.to ?? null,\n        value:\n            tx.clauses[0]?.value !== undefined\n                ? Quantity.of(HexUInt.of(tx.clauses[0].value).bi).toString()\n                : '',\n\n        type: mapVeChainTypeToEthereumType(txType),\n        maxFeePerGas:\n            tx.maxFeePerGas !== undefined && tx.maxFeePerGas !== null\n                ? Quantity.of(HexUInt.of(tx.maxFeePerGas).bi).toString()\n                : undefined,\n        maxPriorityFeePerGas:\n            tx.maxPriorityFeePerGas !== undefined &&\n            tx.maxPriorityFeePerGas !== null\n                ? Quantity.of(HexUInt.of(tx.maxPriorityFeePerGas).bi).toString()\n                : undefined,\n\n        // Unsupported fields\n        gasPrice: '0x0',\n        v: '0x0',\n        r: '0x0',\n        s: '0x0',\n        accessList: [],\n        yParity: '0x0'\n    };\n};\n\n/**\n * Output formatter for Transaction details.\n * It converts the Transaction details into the RPC standard.\n *\n * @param tx - The Transaction details to be formatted.\n * @param chainId - The chain ID of the network.\n * @param txIndex - The index of the transaction in the block.\n *\n * @returns The RPC standard formatted transaction.\n */\nconst formatToRPCStandard = (\n    tx: TransactionDetailNoRaw,\n    chainId: string,\n    txIndex: number\n): TransactionRPC => {\n    return _formatTransactionToRPC(\n        tx,\n        tx.meta.blockID,\n        tx.meta.blockNumber,\n        chainId,\n        txIndex\n    );\n};\n\n/**\n * Output formatter for Transaction details from expanded block.\n * It converts the Transaction details into the RPC standard.\n *\n * @param tx - The Transaction details to be formatted.\n * @param block - The block details to be formatted.\n * @param chainId - The chain ID of the network.\n * @param txIndex - The index of the transaction in the block.\n *\n * @returns The RPC standard formatted transaction.\n */\nconst formatExpandedBlockToRPCStandard = (\n    tx: TransactionsExpandedBlockDetail,\n    block: ExpandedBlockDetail,\n    txIndex: number,\n    chainId: string\n): TransactionRPC => {\n    return _formatTransactionToRPC(\n        tx,\n        block.id,\n        block.number,\n        chainId,\n        txIndex\n    );\n};\n\n/**\n * Output formatter for Transaction Receipt details.\n * It converts the Transaction Receipt details, Transaction details and block into the RPC standard.\n *\n * @param transactionHash - The hash of the transaction to be formatted.\n * @param receipt - The Transaction Receipt to be formatted.\n * @param transaction - The Transaction details to be formatted.\n * @param blockContainsTransaction - The block contains the transaction to be formatted.\n * @param chainId - The chain ID of the network.\n */\nfunction formatTransactionReceiptToRPCStandard(\n    transactionHash: string,\n    receipt: TransactionReceipt,\n    transaction: TransactionDetailNoRaw,\n    blockContainsTransaction: ExpandedBlockDetail,\n    chainId: string\n): TransactionReceiptRPC {\n    // Get transaction index\n    const transactionIndex = getTransactionIndexIntoBlock(\n        blocksFormatter.formatToRPCStandard(blockContainsTransaction, chainId),\n        transactionHash\n    );\n\n    // Format transaction receipt logs\n    const logIndexOffset = getNumberOfLogsAheadOfTransactionIntoBlockExpanded(\n        blockContainsTransaction,\n        transactionHash,\n        chainId\n    );\n\n    const logs: TransactionReceiptLogsRPC[] = [];\n    let logIndex = logIndexOffset;\n    receipt.outputs.forEach((output) => {\n        output.events.forEach((event) => {\n            logs.push({\n                blockHash: receipt.meta.blockID,\n                blockNumber: Quantity.of(receipt.meta.blockNumber).toString(),\n                transactionHash: receipt.meta.txID as string,\n                address: event.address,\n                topics: event.topics.map((topic) => topic),\n                data: event.data,\n                removed: false,\n                transactionIndex: Quantity.of(transactionIndex).toString(),\n                logIndex: Quantity.of(logIndex).toString()\n            });\n            logIndex++;\n        });\n    });\n\n    // Default to legacy transaction type if 'type' property doesn't exist\n    const txType = 'type' in transaction ? transaction.type : 0;\n\n    return {\n        blockHash: receipt.meta.blockID,\n        blockNumber: Quantity.of(receipt.meta.blockNumber).toString(),\n        contractAddress:\n            receipt.outputs.length > 0\n                ? receipt.outputs[0].contractAddress\n                : null,\n        from: transaction.origin,\n        gasUsed: Quantity.of(receipt.gasUsed).toString(),\n        logs,\n        status: receipt.reverted ? '0x0' : '0x1',\n        to: transaction.clauses[0].to,\n        transactionHash: receipt.meta.txID as string,\n        transactionIndex: Quantity.of(transactionIndex).toString(),\n\n        // Incompatible fields\n        logsBloom: Hex.of(ZERO_BYTES(256)).toString(),\n        cumulativeGasUsed: '0x0',\n        effectiveGasPrice: '0x0',\n        type: mapVeChainTypeToEthereumType(txType)\n    };\n}\n\nexport {\n    formatToRPCStandard,\n    formatExpandedBlockToRPCStandard,\n    formatTransactionReceiptToRPCStandard\n};\n","import {\n    formatExpandedBlockToRPCStandard,\n    formatTransactionReceiptToRPCStandard,\n    formatToRPCStandard\n} from './formatter';\n\nexport type * from './types.d';\n\nexport const transactionsFormatter = {\n    formatToRPCStandard,\n    formatExpandedBlockToRPCStandard,\n    formatTransactionReceiptToRPCStandard\n};\n","import { HexUInt, Quantity, ZERO_BYTES } from '@vechain/sdk-core';\nimport {\n    type CompressedBlockDetail,\n    type ExpandedBlockDetail,\n    type TransactionsExpandedBlockDetail\n} from '../../../../thor-client';\nimport { transactionsFormatter } from '../transactions';\nimport { type BlocksRPC } from './types';\n\n/**\n * Output formatter for block details.\n * It converts the block details into the RPC standard.\n *\n * @param block - The block details to be formatted.\n * @param chainId - The chain id to use for the transaction formatting.\n */\nconst formatToRPCStandard = (\n    block: CompressedBlockDetail | ExpandedBlockDetail,\n    chainId: string\n): BlocksRPC => {\n    // Return the transactions array formatted based on the requested expanded flag\n    const transactions =\n        typeof block.transactions[0] === 'string'\n            ? (block.transactions as string[])\n            : block.transactions.map((tx, index) => {\n                  return transactionsFormatter.formatExpandedBlockToRPCStandard(\n                      tx as TransactionsExpandedBlockDetail,\n                      block as ExpandedBlockDetail,\n                      index,\n                      chainId\n                  );\n              });\n\n    return {\n        // Supported fields converted to RPC standard\n        hash: block.id,\n        parentHash: block.parentID,\n        number: Quantity.of(block.number).toString(),\n        size: Quantity.of(block.size).toString(),\n        stateRoot: block.stateRoot,\n        receiptsRoot: block.receiptsRoot,\n        transactionsRoot: block.txsRoot,\n        timestamp: Quantity.of(block.timestamp).toString(),\n        gasLimit: Quantity.of(block.gasLimit).toString(),\n        gasUsed: Quantity.of(block.gasUsed).toString(),\n        transactions,\n        miner: block.beneficiary,\n        baseFeePerGas: block.baseFeePerGas,\n\n        // Unsupported fields\n        difficulty: '0x0',\n        totalDifficulty: '0x0',\n        uncles: [],\n        sha3Uncles: HexUInt.of(ZERO_BYTES(32)).toString(),\n        nonce: HexUInt.of(ZERO_BYTES(8)).toString(),\n        logsBloom: HexUInt.of(ZERO_BYTES(256)).toString(),\n        extraData: '0x',\n        ...(block.baseFeePerGas !== undefined\n            ? { baseFeePerGas: block.baseFeePerGas }\n            : {}),\n        mixHash: HexUInt.of(ZERO_BYTES(32)).toString()\n    };\n};\n\nexport { formatToRPCStandard };\n","import { formatToRPCStandard } from './formatter';\nexport type * from './types.d';\n\nexport const blocksFormatter = { formatToRPCStandard };\n","import { type TracerNameRPC, type TracerReturnTypeRPC } from './types';\nimport { type TraceReturnType } from '../../../../thor-client';\n\n/**\n * Output formatter for RPC debug endpoints:\n * * debug_traceTransaction\n * * debug_traceCall\n * It converts our endpoint calls output to the RPC standard output.\n *\n * @param tracerName - Tracer name used for the debug endpoint.\n * @param debugDetails - Debug details to be formatted.\n */\nfunction formatToRPCStandard<TDebugType extends TracerNameRPC>(\n    tracerName: TDebugType,\n    debugDetails: TraceReturnType<TDebugType>\n): TracerReturnTypeRPC<'call'> | TracerReturnTypeRPC<'prestate'> {\n    if (tracerName === 'call') {\n        return {\n            ...(debugDetails as TraceReturnType<'call'>),\n\n            // Empty revert reason\n            revertReason: ''\n        } satisfies TracerReturnTypeRPC<'call'>;\n    }\n\n    return Object.fromEntries(\n        Object.entries(debugDetails as TraceReturnType<'prestate'>).map(\n            ([key, value]) => {\n                const valueWithoutEnergy = {\n                    balance: value.balance,\n                    code: value.code,\n                    storage: value.storage\n                } satisfies Omit<\n                    {\n                        balance: string;\n                        energy: string;\n                        code?: string;\n                        storage?: Record<string, string>;\n                    },\n                    'energy'\n                >;\n\n                return [key, { ...valueWithoutEnergy, nonce: 0 }];\n            }\n        )\n    ) satisfies TracerReturnTypeRPC<'prestate'>;\n}\n\nexport { formatToRPCStandard };\n","import { formatToRPCStandard } from './formatter';\n\nexport * from './formatter';\nexport type * from './types.d';\n\nexport const debugFormatter = {\n    formatToRPCStandard\n};\n","import { HexInt } from '@vechain/sdk-core';\nimport { type EventCriteria, type EventLogs } from '../../../../thor-client';\nimport { type LogsRPC } from './types';\n\n/**\n * Output formatter for Event logs.\n * It converts the Event logs into the RPC standard.\n *\n * @param eventLogs - The Event logs to be formatted.\n */\nconst formatToLogsRPC = (eventLogs: EventLogs[]): LogsRPC[] => {\n    // Final RPC event logs formatted\n    return eventLogs.map((eventLog: EventLogs) => {\n        return {\n            address: eventLog.address,\n            blockHash: eventLog.meta.blockID,\n            blockNumber: HexInt.of(eventLog.meta.blockNumber).toString(),\n            data: eventLog.data,\n            logIndex: '0x0',\n            // Always false for now\n            removed: false,\n            topics: eventLog.topics,\n            transactionHash: eventLog.meta.txID,\n            transactionIndex: '0x0'\n\n            // @NOTE: logIndex and transactionIndex are not implemented yet. This for performance reasons.\n            //\n            /**\n             * @NOTE: These two fields are not implemented yet.\n             * This for performance reasons.\n             * We can implement them later if needed.\n             *\n             * To have these two fields, we need to query a block for each entry into the logs.\n             * After from the block, we can get the transaction index and the log index.\n             * This is a performance issue because we have to query a block for each entry into the logs.\n             */\n        } satisfies LogsRPC;\n    });\n};\n\n/**\n * Convert the criteria topics into an array of topics.\n *\n * This because the criteria topics are not an array of topics in VeChain,\n * but they are directly enumerated (topic0, topic1, topic2, topic3, topic4).\n *\n * RPC standard requires an array of topics instead.\n *\n * @param criteriaTopicsArray - The criteria topics array.\n * @param address - The address to filter.\n */\nconst _scatterArrayTopic = (\n    criteriaTopicsArray: string[],\n    address?: string\n): EventCriteria => {\n    return {\n        address,\n        topic0: criteriaTopicsArray[0] ?? undefined,\n        topic1: criteriaTopicsArray[1] ?? undefined,\n        topic2: criteriaTopicsArray[2] ?? undefined,\n        topic3: criteriaTopicsArray[3] ?? undefined,\n        topic4: criteriaTopicsArray[4] ?? undefined\n    };\n};\n\n/**\n * Function to generate a set of event criteria based on input criteria.\n * The function takes an object with optional address and topics properties,\n * and returns an array of EventCriteria objects.\n *\n * @param {Object} criteria - The input criteria object.\n * @param {string|string[]} [criteria.address] - A single address string or an array of address strings.\n * @param {string[]|string[][]} [criteria.topics] - A single array of topics or an array of arrays of topics.\n * @returns {EventCriteria[]} An array of EventCriteria objects.\n */\nconst getCriteriaSetForInput = (criteria: {\n    address?: string | string[];\n    topics?: string[] | string[][];\n}): EventCriteria[] => {\n    // String to an array of addresses and topics\n    let criteriaAddress: string[] | undefined[] = [];\n\n    // Convert in any case to an array of addresses\n    if (criteria.address !== undefined) {\n        criteriaAddress =\n            typeof criteria.address === 'string'\n                ? [criteria.address]\n                : criteria.address;\n    } else {\n        criteriaAddress = [undefined];\n    }\n\n    const eventsCriteriaToFlat: EventCriteria[][] = criteriaAddress.map(\n        (addr) => {\n            return getTopicsPerAddress(addr, criteria.topics ?? []);\n        }\n    );\n\n    // Flat the array\n    return eventsCriteriaToFlat.flat();\n};\n\n/**\n * Function to generate a set of event criteria based on input topics and address.\n * The function takes an address and an array of topics and returns an array of EventCriteria objects.\n *\n * @param {string} address - The address to filter.\n * @param {string[]|string[][]} topics - A single array of topics or an array of arrays of topics.\n * @returns {EventCriteria[]} An array of EventCriteria objects.\n */\nconst getTopicsPerAddress = (\n    address: string | undefined,\n    topics: string[] | string[][]\n): EventCriteria[] => {\n    const notArrayTopics: string[] = [];\n    const arrayTopics: string[][] = [];\n\n    topics.forEach((topic) => {\n        if (!Array.isArray(topic)) {\n            notArrayTopics.push(topic);\n        }\n        if (Array.isArray(topic)) {\n            arrayTopics.push(topic);\n        }\n    });\n\n    const criteriaSet: EventCriteria[] = [];\n\n    if (notArrayTopics.length > 0) {\n        criteriaSet.push(_scatterArrayTopic(notArrayTopics, address));\n    }\n\n    arrayTopics.forEach((topics) => {\n        topics.forEach((topic) => {\n            criteriaSet.push({\n                address,\n                topic0: topic,\n                topic1: undefined,\n                topic2: undefined,\n                topic3: undefined,\n                topic4: undefined\n            });\n        });\n    });\n\n    // If no topics are provided, we add an empty criteria set\n    if (criteriaSet.length === 0) {\n        criteriaSet.push({\n            address,\n            topic0: undefined,\n            topic1: undefined,\n            topic2: undefined,\n            topic3: undefined,\n            topic4: undefined\n        });\n    }\n\n    return criteriaSet;\n};\n\nexport { formatToLogsRPC, getCriteriaSetForInput };\n","import { Hex, HexUInt } from '@vechain/sdk-core';\nimport { type ThorClient } from '../../../../../thor-client';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { chainTagToChainId } from '../../../const';\n\n// In-memory cache\nlet cachedChainId: HexUInt | null = null;\nlet cachedChainTag: HexUInt | null = null;\nlet cachedGenesisBlockId: Hex | null = null;\n\n/**\n * RPC Method eth_chainId implementation\n *\n * @link [eth_chainId](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - ThorClient instance.\n * @returns Returns the block id of the genesis block.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethChainId = async (thorClient: ThorClient): Promise<string> => {\n    try {\n        if (cachedChainId !== null) return cachedChainId.toString();\n        const genesisBlock = await thorClient.blocks.getGenesisBlock();\n        if (genesisBlock?.id === null || genesisBlock?.id === undefined) {\n            throw new JSONRPCInvalidParams(\n                'eth_chainId()',\n                'The genesis block id is null or undefined. Unable to get the chain id.',\n                {\n                    url: thorClient.httpClient.baseURL\n                }\n            );\n        }\n        if (!Hex.isValid(genesisBlock.id)) {\n            throw new JSONRPCInvalidParams(\n                'eth_chainId()',\n                'The genesis block id is invalid. Unable to get the chain id.',\n                {\n                    url: thorClient.httpClient.baseURL\n                }\n            );\n        }\n        cachedGenesisBlockId = Hex.of(genesisBlock.id);\n        cachedChainTag = HexUInt.of(cachedGenesisBlockId.bytes.slice(-1));\n        cachedChainId = chainTagToChainId(cachedChainTag);\n        return cachedChainId.toString();\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_chainId()',\n            'Method \"eth_chainId\" failed.',\n            {\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\n/*\n * Get the chain id from the cached value or fetch it from the network.\n *\n * @param thorClient - ThorClient instance.\n * @returns The chain id.\n */\nconst getCachedChainId = async (thorClient: ThorClient): Promise<string> => {\n    return cachedChainId !== null\n        ? cachedChainId.toString()\n        : await ethChainId(thorClient);\n};\n\n/*\n * Get the chain tag from the cached value or fetch it from the network.\n *\n * @param thorClient - ThorClient instance.\n * @returns The chain tag.\n */\nconst getCachedChainTag = async (thorClient: ThorClient): Promise<string> => {\n    return cachedChainTag !== null\n        ? cachedChainTag.toString()\n        : await ethChainId(thorClient);\n};\n\nexport { ethChainId, getCachedChainId, getCachedChainTag };\n","import { ThorId } from '@vechain/sdk-core';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport {\n    type ExpandedBlockDetail,\n    type ThorClient\n} from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils/const/rpc/rpc';\nimport {\n    type TransactionReceiptRPC,\n    transactionsFormatter\n} from '../../../formatter';\nimport { ethChainId } from '../eth_chainId';\n\n/**\n * RPC Method eth_getTransactionReceipt implementation\n *\n * @link [eth_getTransactionReceipt](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n *\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The transaction hash to get as a hex string.\n *\n * @throws {ProviderRpcError} - Will throw an error if the retrieval of the transaction fails.\n */\nconst ethGetTransactionReceipt = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<TransactionReceiptRPC | null> => {\n    // Input validation\n    if (params.length !== 1 || typeof params[0] !== 'string')\n        throw new JSONRPCInvalidParams(\n            'eth_getTransactionReceipt',\n            `Invalid input params for \"eth_getTransactionReceipt\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    // Invalid transaction ID\n    if (!ThorId.isValid(params[0])) {\n        throw new JSONRPCInvalidParams(\n            'eth_getTransactionReceipt',\n            'Invalid transaction ID given as input. Input must be an hex string of length 64.',\n            { params }\n        );\n    }\n\n    try {\n        // Get hash by params\n        const [hash] = params as [string];\n\n        // Get transaction receipt\n        const receipt =\n            await thorClient.transactions.getTransactionReceipt(hash);\n\n        // Receipt is not null (transaction exists. This implies: Block exists and Transaction details exists)\n        if (receipt !== null) {\n            // Get the block containing the transaction. @note: It cannot be null!. If some error occurs, it will be thrown.\n            const blockContainsTransaction =\n                (await thorClient.blocks.getBlockExpanded(\n                    receipt.meta.blockID\n                )) as ExpandedBlockDetail;\n\n            // Get transaction detail. @note: It cannot be null!. If some error occurs, it will be thrown.\n            const transactionDetail =\n                await thorClient.transactions.getTransaction(hash);\n\n            // Get the chain id\n            const chainId = await ethChainId(thorClient);\n\n            // Initialize the result\n            if (transactionDetail !== null)\n                return transactionsFormatter.formatTransactionReceiptToRPCStandard(\n                    hash,\n                    receipt,\n                    transactionDetail,\n                    blockContainsTransaction,\n                    chainId\n                );\n            else return null;\n        } else {\n            return null;\n        }\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getTransactionReceipt()',\n            'Method \"eth_getTransactionReceipt\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetTransactionReceipt };\n","import { ThorId } from '@vechain/sdk-core';\nimport {\n    InvalidDataType,\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport {\n    type ThorClient,\n    type TraceReturnType,\n    type TracerName\n} from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { debugFormatter, type TracerReturnTypeRPC } from '../../../formatter';\nimport { ethGetTransactionReceipt } from '../eth_getTransactionReceipt';\nimport { type TraceOptionsRPC } from './types';\n\n/**\n * RPC Method debug_traceTransaction implementation\n *\n * @link [debug_traceTransaction](https://www.quicknode.com/docs/ethereum/debug_traceTransaction)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: transactionHash - hex string - This describes the transaction hash of the transaction that needs to be traced.\n *                 * params[1]: options - object - This describes the options for the trace. It has the following parameters:\n *                    * tracer - string to specify the type of tracer. Currently, it supports callTracer and prestateTracer.\n *                    * timeout - string - A duration string of decimal numbers that overrides the default timeout of 5 seconds for JavaScript-based tracing calls.\n *                      Max timeout is \"10s\". Valid time units are \"ns\", \"us\", \"ms\", \"s\" each with an optional fraction, such as \"300ms\" or \"2s45ms\"\n *                    * tracerConfig - Object to specify configurations for the tracer. It has the following parameter:\n *                       * onlyTopCall - boolean Setting this to true will only trace the main (top-level) call and none of the sub-calls.\n *                         This avoids extra processing for each call frame if only the top-level call info are required (useful for getting revertReason).\n *\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst debugTraceTransaction = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<TracerReturnTypeRPC<'call'> | TracerReturnTypeRPC<'prestate'>> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        typeof params[1] !== 'object'\n    )\n        throw new JSONRPCInvalidParams(\n            'debug_traceTransaction',\n            `Invalid input params for \"debug_traceTransaction\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    // Init params\n    const [transactionId, traceOptions] = params as [string, TraceOptionsRPC];\n\n    // Invalid transaction ID\n    if (!ThorId.isValid(transactionId)) {\n        throw new InvalidDataType(\n            'debug_traceTransaction()',\n            'Invalid transaction ID given as input. Input must be an hex string of length 64.',\n            { transactionId }\n        );\n    }\n\n    // Tracer to use\n    const tracerToUse: TracerName =\n        traceOptions.tracer === 'callTracer' ? 'call' : 'prestate';\n\n    try {\n        const transactionReceipt = await ethGetTransactionReceipt(thorClient, [\n            transactionId\n        ]);\n\n        const trace = (await thorClient.debug.traceTransactionClause(\n            {\n                target: {\n                    blockId: ThorId.of(transactionReceipt?.blockHash as string),\n                    transaction: ThorId.of(\n                        transactionReceipt?.transactionHash as string\n                    ),\n                    clauseIndex: 0\n                },\n                config: {}\n            },\n            tracerToUse\n        )) as TraceReturnType<'call'> | TraceReturnType<'prestate'>;\n\n        return debugFormatter.formatToRPCStandard(tracerToUse, trace);\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'debug_traceTransaction()',\n            'Method \"debug_traceTransaction\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { debugTraceTransaction };\n","import { ThorId } from '@vechain/sdk-core';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { blocksFormatter, type BlocksRPC } from '../../../formatter';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { ethChainId } from '../eth_chainId';\n\n/**\n * RPC Method eth_getBlockByHash implementation\n *\n * @link [eth_getBlockByHash](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block hash of block to get.\n *                 * params[1]: The transaction hydrated detail flag. If true, the block will contain the transaction details, otherwise it will only contain the transaction hashes.\n * @returns the block at the given block hash formatted to the RPC standard or null if the block does not exist.\n * @note Ethereum block hash is passed to Thor as the block id.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetBlockByHash = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<BlocksRPC | null> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        !ThorId.isValid(params[0]) ||\n        typeof params[1] !== 'boolean'\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getBlockByHash',\n            `Invalid input params for \"eth_getBlockByHash\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    try {\n        const [blockHash, isTxDetail] = params as [string, boolean];\n\n        let chainId: string = '0x0';\n\n        // If the transaction detail flag is set, we need to get the chain id\n        if (isTxDetail) {\n            chainId = await ethChainId(thorClient);\n        }\n\n        const block = isTxDetail\n            ? await thorClient.blocks.getBlockExpanded(blockHash)\n            : await thorClient.blocks.getBlockCompressed(blockHash);\n\n        return block !== null\n            ? blocksFormatter.formatToRPCStandard(block, chainId)\n            : null;\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getBlockByHash()',\n            'Method \"eth_getBlockByHash\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetBlockByHash };\n","import { ThorId } from '@vechain/sdk-core';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport {\n    debugTraceTransaction,\n    type TraceOptionsRPC\n} from '../debug_traceTransaction';\nimport { ethGetBlockByHash } from '../eth_getBlockByHash';\nimport { type TracerReturnTypeRPC } from '../../../formatter/debug/types';\n\n/**\n * RPC Method debug_traceBlockByHash implementation\n *\n * @link [debug_traceBlockByHash](https://www.quicknode.com/docs/ethereum/debug_traceBlockByHash)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block hash of block to get.\n *                 * params[1]: options - object - This describes the options for the trace. It has the following parameters:\n *                    * tracer - string to specify the type of tracer. Currently, it supports callTracer and prestateTracer.\n *                    * tracerConfig - Object to specify configurations for the tracer. It has the following parameter:\n *                       * onlyTopCall - boolean Setting this to true will only trace the main (top-level) call and none of the sub-calls.\n *                         This avoids extra processing for each call frame if only the top-level call info are required (useful for getting revertReason).\n *\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst debugTraceBlockByHash = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<\n    Array<{\n        txHash: string;\n        result: TracerReturnTypeRPC<'call'> | TracerReturnTypeRPC<'prestate'>;\n    }>\n> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        !ThorId.isValid(params[0]) ||\n        typeof params[1] !== 'object'\n    )\n        throw new JSONRPCInvalidParams(\n            'debug_traceBlockByHash',\n            `Invalid input params for \"debug_traceBlockByHash\" method. See https://www.quicknode.com/docs/ethereum/debug_traceBlockByHash for details.`,\n            { params }\n        );\n\n    // Init params\n    const [blockHash, traceOptions] = params as [\n        string,\n        Omit<TraceOptionsRPC, 'timeout'>\n    ];\n\n    try {\n        // Get block and transaction receipts\n        const block = await ethGetBlockByHash(thorClient, [blockHash, false]);\n\n        // if block does not exist\n        if (block === null) {\n            return [];\n        }\n\n        // Block exist, get traces\n        const traces = [];\n\n        // Trace each transaction in the block\n        for (const transaction of block.transactions as string[]) {\n            const trace = await debugTraceTransaction(thorClient, [\n                transaction,\n                { ...traceOptions, timeout: '5s' }\n            ]);\n            traces.push({\n                txHash: transaction,\n                result: trace\n            });\n        }\n\n        // Return traces\n        return traces;\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'debug_traceBlockByHash()',\n            'Method \"debug_traceBlockByHash\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { debugTraceBlockByHash };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type DefaultBlock, DefaultBlockToRevision } from '../../../const';\nimport { blocksFormatter, type BlocksRPC } from '../../../formatter';\nimport { ethChainId } from '../eth_chainId';\n\n/**\n * RPC Method eth_getBlockByNumber implementation\n *\n * @link [eth_getBlockByNumber](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @note\n *  * 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)\n *  * Currently, VeChainonly supports hex number of block, 'latest' and 'finalized'.\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block number to get as a hex string or \"latest\" or \"finalized\".\n *                 * params[1]: The transaction detail flag. If true, the block will contain the transaction details, otherwise it will only contain the transaction hashes.\n * @returns the block at the given block number formatted to the RPC standard or null if the block does not exist.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetBlockByNumber = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<BlocksRPC | null> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        typeof params[1] !== 'boolean'\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getBlockByNumber',\n            `Invalid input params for \"eth_getBlockByNumber\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    try {\n        const [blockNumber, isTxDetail] = params as [DefaultBlock, boolean];\n        const revision = DefaultBlockToRevision(blockNumber);\n\n        let chainId: string = '0x0';\n\n        // If the transaction detail flag is set, we need to get the chain id\n        if (isTxDetail) {\n            chainId = await ethChainId(thorClient);\n        }\n\n        const block = isTxDetail\n            ? await thorClient.blocks.getBlockExpanded(revision.toString())\n            : await thorClient.blocks.getBlockCompressed(revision.toString());\n\n        return block !== null\n            ? blocksFormatter.formatToRPCStandard(block, chainId)\n            : null;\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getBlockByNumber()',\n            'Method \"eth_getBlockByNumber\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetBlockByNumber };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport {\n    debugTraceTransaction,\n    type TraceOptionsRPC\n} from '../debug_traceTransaction';\nimport { type TracerReturnTypeRPC } from '../../../formatter';\nimport { ethGetBlockByNumber } from '../eth_getBlockByNumber';\n\n/**\n * RPC Method debug_traceBlockByNumber implementation\n *\n * @link [debug_traceBlockByNumber](https://www.quicknode.com/docs/ethereum/debug_traceBlockByNumber)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block number to get as a hex string or \"latest\" or \"finalized\".\n *                 * params[1]: options - object - This describes the options for the trace. It has the following parameters:\n *                    * tracer - string to specify the type of tracer. Currently, it supports callTracer and prestateTracer.\n *                    * tracerConfig - Object to specify configurations for the tracer. It has the following parameter:\n *                       * onlyTopCall - boolean Setting this to true will only trace the main (top-level) call and none of the sub-calls.\n *                         This avoids extra processing for each call frame if only the top-level call info are required (useful for getting revertReason).\n *\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst debugTraceBlockByNumber = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<\n    Array<{\n        txHash: string;\n        result: TracerReturnTypeRPC<'call'> | TracerReturnTypeRPC<'prestate'>;\n    }>\n> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        typeof params[1] !== 'object'\n    )\n        throw new JSONRPCInvalidParams(\n            'debug_traceBlockByNumber',\n            `Invalid input params for \"debug_traceBlockByNumber\" method. See https://www.quicknode.com/docs/ethereum/debug_traceBlockByNumber for details.`,\n            { params }\n        );\n\n    // Init params\n    const [blockNumber, traceOptions] = params as [\n        string,\n        Omit<TraceOptionsRPC, 'timeout'>\n    ];\n\n    try {\n        // Get block and transaction receipts\n        const block = await ethGetBlockByNumber(thorClient, [\n            blockNumber,\n            false\n        ]);\n\n        // if block does not exist\n        if (block === null) {\n            return [];\n        }\n\n        // Block exist, get traces\n        const traces = [];\n\n        // Trace each transaction in the block\n        for (const transaction of block.transactions as string[]) {\n            const trace = await debugTraceTransaction(thorClient, [\n                transaction,\n                { ...traceOptions, timeout: '5s' }\n            ]);\n            traces.push({\n                txHash: transaction,\n                result: trace\n            });\n        }\n\n        // Return traces\n        return traces;\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'debug_traceBlockByNumber()',\n            'Method \"debug_traceBlockByNumber\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { debugTraceBlockByNumber };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport {\n    type ThorClient,\n    type TraceReturnType,\n    type TracerName\n} from '../../../../../thor-client';\nimport { debugFormatter, type TracerReturnTypeRPC } from '../../../formatter';\n\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type TraceCallRPC, type TransactionObjectInput } from './types';\nimport { Address, HexUInt } from '@vechain/sdk-core';\n\n/**\n * RPC Method debug_traceCall implementation\n *\n * @link [debug_traceCall](https://www.quicknode.com/docs/ethereum/debug_traceCall)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                * params[0]: transaction - object - This describes the transaction info with following properties:\n *                   * from - 20 bytes - Address the transaction is sent from.\n *                   * to - 20 bytes [Required] - Address the transaction is directed to.\n *                   * gas - Hexadecimal value of the gas provided for the transaction execution as hex string.\n *                   * gasPrice - Hexadecimal value of the gasPrice used for each paid gas.\n *                   * value - Hexadecimal of the value sent with this transaction.\n *                   * data - Hash of the method signature and encoded parameters.\n *                * params[1]: blockNumber - string - The block number parameter. A hexadecimal number or (latest, earliest or pending). (NOT SUPPORTED YET)\n *                * params[2]: options - object - This describes the options for the trace. It has the following parameters:\n *                   * tracer - string to specify the type of tracer. Currently, it supports callTracer and prestateTracer.\n *                   * tracerConfig - Object to specify configurations for the tracer. It has the following parameters:\n *                      * 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).\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst debugTraceCall = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<TracerReturnTypeRPC<'call'> | TracerReturnTypeRPC<'prestate'>> => {\n    // Input validation\n    if (\n        params.length !== 3 ||\n        typeof params[0] !== 'object' ||\n        typeof params[1] !== 'string' ||\n        typeof params[2] !== 'object'\n    )\n        throw new JSONRPCInvalidParams(\n            'debug_traceCall',\n            `Invalid input params for \"debug_traceCall\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    // Init params\n    const transactionOptions = params[0] as TransactionObjectInput;\n    const tracerOptions = params[2] as TraceCallRPC;\n\n    // Tracer to use\n    const tracerToUse: TracerName =\n        tracerOptions.tracer === 'callTracer' ? 'call' : 'prestate';\n\n    try {\n        const trace = (await thorClient.debug.traceContractCall(\n            {\n                options: {\n                    caller: transactionOptions.from,\n                    gas:\n                        transactionOptions.gas !== undefined\n                            ? parseInt(transactionOptions.gas, 16)\n                            : undefined,\n                    gasPrice: transactionOptions.gasPrice\n                },\n                target: {\n                    to:\n                        typeof transactionOptions.to === 'string'\n                            ? Address.of(transactionOptions.to)\n                            : transactionOptions.to,\n                    data:\n                        typeof transactionOptions.data === 'string'\n                            ? HexUInt.of(transactionOptions.data)\n                            : undefined\n                },\n                config: tracerOptions.tracerConfig\n            },\n            tracerToUse\n        )) as TraceReturnType<'call'> | TraceReturnType<'prestate'>;\n\n        return debugFormatter.formatToRPCStandard(tracerToUse, trace);\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'debug_traceCall()',\n            'Method \"debug_traceCall\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { debugTraceCall };\n","import { VeChainSDKLogger } from '@vechain/sdk-logging';\n\n/**\n * RPC Method engine_getPayloadBodiesByHashV1 implementation\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n * @note:\n * * params[0]: ...\n * * params[1]: ...\n * * params[n]: ...\n */\nconst engineGetPayloadBodiesByHashV1 =\n    async (): Promise<'METHOD NOT IMPLEMENTED'> => {\n        // Not implemented yet\n        VeChainSDKLogger('warning').log({\n            title: 'engine_getPayloadBodiesByHashV1',\n            messages: [\n                'Method \"engine_getPayloadBodiesByHashV1\" has not been implemented yet.'\n            ]\n        });\n\n        // To avoid eslint error\n        return await Promise.resolve('METHOD NOT IMPLEMENTED');\n    };\n\nexport { engineGetPayloadBodiesByHashV1 };\n","import { VeChainSDKLogger } from '@vechain/sdk-logging';\n\n/**\n * RPC Method engine_getPayloadBodiesByRangeV1 implementation\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n * @note:\n * * params[0]: ...\n * * params[1]: ...\n * * params[n]: ...\n */\nconst engineGetPayloadBodiesByRangeV1 =\n    async (): Promise<'METHOD NOT IMPLEMENTED'> => {\n        // Not implemented yet\n        VeChainSDKLogger('warning').log({\n            title: 'engine_getPayloadBodiesByRangeV1',\n            messages: [\n                'Method \"engine_getPayloadBodiesByRangeV1\" has not been implemented yet.'\n            ]\n        });\n\n        // To avoid eslint error\n        return await Promise.resolve('METHOD NOT IMPLEMENTED');\n    };\n\nexport { engineGetPayloadBodiesByRangeV1 };\n","import { type VeChainProvider } from '../../../../providers/vechain-provider';\n\n/**\n * RPC Method eth_accounts implementation\n *\n * @param provider - Provider with ProviderInternalWallet instance to use.\n */\nconst ethAccounts = async (provider?: VeChainProvider): Promise<string[]> => {\n    // ProviderInternalWallet exists\n    if (provider?.wallet !== undefined)\n        return await provider?.wallet.getAddresses();\n\n    // In error case (if wallet is not defined), return an empty array\n    return [];\n};\n\nexport { ethAccounts };\n","import { JSONRPCInternalError, stringifyData } from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\n\n/**\n * RPC Method eth_blockNumber implementation\n *\n * @link [eth_blockNumber](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @returns the latest block number as a hex string. If the block number cannot be retrieved, it will return '0x0'\n * @throws {JSONRPCInternalError}\n */\nconst ethBlockNumber = async (thorClient: ThorClient): Promise<string> => {\n    try {\n        // 'best' is the alias for 'latest' in VeChainThorest\n        const latestBlock = await thorClient.blocks.getBestBlockCompressed();\n\n        return latestBlock?.number !== undefined\n            ? `0x${latestBlock.number.toString(16)}`\n            : '0x0';\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_blockNumber()',\n            'Method \"eth_blockNumber\" failed.',\n            {\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethBlockNumber };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    JSONRPCTransactionRevertError,\n    HttpNetworkError,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport {\n    type SimulateTransactionClause,\n    type SimulateTransactionOptions,\n    type ThorClient\n} from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type DefaultBlock, DefaultBlockToRevision } from '../../../const';\nimport { type TransactionObjectInput } from './types';\n\n/**\n * RPC Method eth_call implementation\n *\n * @link [eth_call](https://ethereum.github.io/execution-apis/api-documentation/)\n * @param thorClient - The thor client instance to use.\n * @param params - The transaction call object\n * @returns The return value of executed contract.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethCall = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<string> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'object' ||\n        (typeof params[1] !== 'object' && typeof params[1] !== 'string')\n    ) {\n        throw new JSONRPCInvalidParams(\n            'eth_call',\n            `Invalid input params for \"eth_call\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n    }\n\n    try {\n        const [inputOptions, block] = params as [\n            TransactionObjectInput,\n            DefaultBlock\n        ];\n\n        // Simulate transaction\n        const simulatedTx = await thorClient.transactions.simulateTransaction(\n            [\n                {\n                    to: inputOptions.to ?? null,\n                    value: inputOptions.value ?? '0x0',\n                    data: inputOptions.data ?? '0x0'\n                } satisfies SimulateTransactionClause\n            ],\n            {\n                revision: DefaultBlockToRevision(block),\n                gas:\n                    inputOptions.gas !== undefined\n                        ? parseInt(inputOptions.gas, 16)\n                        : undefined,\n                gasPrice: inputOptions.gasPrice ?? inputOptions.gasPrice,\n                caller: inputOptions.from\n            } satisfies SimulateTransactionOptions\n        );\n\n        if (simulatedTx[0].reverted) {\n            throw new JSONRPCTransactionRevertError(\n                simulatedTx[0].vmError,\n                simulatedTx[0].data\n            );\n        }\n        // Return simulated transaction data\n        return simulatedTx[0].data;\n    } catch (e) {\n        if (e instanceof JSONRPCInternalError) {\n            throw e;\n        }\n        if (e instanceof JSONRPCTransactionRevertError) {\n            throw e;\n        }\n\n        // Check if this is a network communication error\n        if (e instanceof HttpNetworkError) {\n            throw new JSONRPCInternalError(\n                'eth_call()',\n                'Method \"eth_call\" failed due to network communication error.',\n                {\n                    params: stringifyData(params),\n                    url: thorClient.httpClient.baseURL,\n                    networkError: true,\n                    networkErrorType: e.data.networkErrorType,\n                    innerError: stringifyData(e)\n                }\n            );\n        }\n\n        throw new JSONRPCInternalError(\n            'eth_call()',\n            'Method \"eth_call\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethCall };\n","import { HexUInt } from '@vechain/sdk-core';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    JSONRPCTransactionRevertError,\n    HttpNetworkError,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport {\n    type SimulateTransactionClause,\n    type ThorClient\n} from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type DefaultBlock, DefaultBlockToRevision } from '../../../const';\nimport { type TransactionObjectInput } from './types';\n\n/**\n * RPC Method eth_estimateGas implementation\n *\n * @link [eth_estimateGas](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @note At the moment only the `to`, `value` and `data` fields are supported.\n *\n * @param thorClient - ThorClient instance.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The transaction call object.\n *                 * params[1]: A string representing a block number, or one of the string tags latest, earliest, or pending.\n * @returns A hexadecimal number representing the estimation of the gas for a given transaction.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError, JSONRPCTransactionRevertError}\n */\nconst ethEstimateGas = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<string> => {\n    // Input validation\n    if (params.length < 1 || params.length > 2 || typeof params[0] !== 'object')\n        throw new JSONRPCInvalidParams(\n            'eth_estimateGas',\n            `Invalid input params for \"eth_estimateGas\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    try {\n        if (params.length === 1) {\n            params.push('latest');\n        }\n        // NOTE: The standard requires block parameter.\n        // Here it is ignored and can be added in the future compatibility reasons.\n        // (INPUT CHECK TAKE CARE OF THIS)\n        const [inputOptions, defaultBlock] = params as [\n            TransactionObjectInput,\n            DefaultBlock\n        ];\n        const revision = DefaultBlockToRevision(defaultBlock);\n\n        const estimatedGas = await thorClient.transactions.estimateGas(\n            [\n                {\n                    to: inputOptions.to ?? null,\n                    value: inputOptions.value ?? '0x0',\n                    data: inputOptions.data ?? '0x'\n                } satisfies SimulateTransactionClause\n            ],\n            inputOptions.from,\n            {\n                revision: revision\n            }\n        );\n\n        // Check if the transaction would revert and throw error if so\n        if (estimatedGas.reverted) {\n            // To get the proper custom error data, we need to run the simulation ourselves\n            // because estimateGas doesn't provide access to the raw simulation data\n            const simulations =\n                await thorClient.transactions.simulateTransaction(\n                    [\n                        {\n                            to: inputOptions.to ?? null,\n                            value: inputOptions.value ?? '0x0',\n                            data: inputOptions.data ?? '0x'\n                        } satisfies SimulateTransactionClause\n                    ],\n                    {\n                        revision: revision,\n                        caller: inputOptions.from\n                    }\n                );\n\n            // Find the first non-empty revert reason or VM error\n            const revertReason =\n                estimatedGas.revertReasons.find((reason) => reason !== '') ??\n                estimatedGas.vmErrors.find((error) => error !== '') ??\n                'execution reverted';\n\n            // Use the raw simulation data as revert data for hardhat-chai-matchers\n            // This should contain the encoded custom error information\n            let revertData = simulations[0].data || '0x';\n\n            // Make sure revertData is a valid hex string\n            if (!revertData.startsWith('0x')) {\n                revertData = '0x' + revertData;\n            }\n\n            throw new JSONRPCTransactionRevertError(\n                revertReason.toString(),\n                revertData\n            );\n        }\n\n        // Convert intrinsic gas to hex string and return\n        return HexUInt.of(estimatedGas.totalGas).toString(true);\n    } catch (e) {\n        // Re-throw JSONRPCTransactionRevertError as-is\n        if (e instanceof JSONRPCTransactionRevertError) {\n            throw e;\n        }\n\n        // Check if this is a network communication error\n        if (e instanceof HttpNetworkError) {\n            throw new JSONRPCInternalError(\n                'eth_estimateGas()',\n                'Method \"eth_estimateGas\" failed due to network communication error.',\n                {\n                    params: stringifyData(params),\n                    url: thorClient.httpClient.baseURL,\n                    networkError: true,\n                    networkErrorType: e.data.networkErrorType,\n                    innerError: stringifyData(e)\n                }\n            );\n        }\n\n        throw new JSONRPCInternalError(\n            'eth_estimateGas()',\n            'Method \"eth_estimateGas\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethEstimateGas };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    JSONRPCMethodNotImplemented,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { type FeeHistoryResponse } from '../../../../../thor-client/gas/types';\nimport { type VeChainProvider } from '../../../../providers/vechain-provider';\nimport { type DefaultBlock, DefaultBlockToRevision } from '../../../const';\n\n/**\n * RPC Method eth_feeHistory implementation for Galactica hardfork\n *\n * @link [eth_feeHistory](https://ethereum.github.io/execution-apis/api-documentation/)\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: blockCount - number of blocks in the requested range\n *                 * params[1]: newestBlock - highest block of the requested range\n *                 * params[2]: rewardPercentiles - optional array of percentiles to compute\n * @param provider - The provider instance to use.\n * @returns Fee history for the returned block range\n * @throws {JSONRPCInvalidParams} | {JSONRPCInternalError} | {JSONRPCMethodNotImplemented}\n */\nconst ethFeeHistory = async (\n    thorClient: ThorClient,\n    params: unknown[],\n    _provider?: VeChainProvider\n): Promise<FeeHistoryResponse> => {\n    if (!Array.isArray(params) || params.length < 2) {\n        throw new JSONRPCInvalidParams(\n            'eth_feeHistory',\n            'Invalid input params for \"eth_feeHistory\" method.',\n            { params }\n        );\n    }\n\n    // Check if Galactica hardfork has happened\n    const galacticaForked = await thorClient.forkDetector.detectGalactica();\n    if (!galacticaForked) {\n        throw new JSONRPCMethodNotImplemented(\n            'eth_feeHistory',\n            'Method \"eth_feeHistory\" is not available before Galactica hardfork.',\n            { url: thorClient.httpClient.baseURL }\n        );\n    }\n\n    const blockCount = params[0];\n    const newestBlock = params[1];\n    const rewardPercentiles = params[2] as number[] | undefined;\n\n    // Validate newestBlock is a string or number\n    if (typeof newestBlock !== 'string' && typeof newestBlock !== 'number') {\n        throw new JSONRPCInvalidParams(\n            'eth_feeHistory',\n            'Invalid newestBlock parameter. Must be a string or number.',\n            { newestBlock }\n        );\n    }\n\n    // Validate blockCount is a valid number\n    const blockCountNum = Number(blockCount);\n    if (!Number.isFinite(blockCountNum) || blockCountNum <= 0) {\n        throw new JSONRPCInvalidParams(\n            'eth_feeHistory',\n            'blockCount must be a positive finite number.',\n            { blockCount, blockCountNum }\n        );\n    }\n\n    // convert default block to revision\n    const revision = DefaultBlockToRevision(newestBlock as DefaultBlock);\n\n    try {\n        return await thorClient.gas.getFeeHistory({\n            blockCount: blockCountNum,\n            newestBlock: revision.toString(),\n            rewardPercentiles\n        });\n    } catch (e) {\n        if (e instanceof JSONRPCInvalidParams) {\n            throw e;\n        }\n        throw new JSONRPCInternalError(\n            'eth_feeHistory()',\n            'Method \"eth_feeHistory\" failed.',\n            {\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethFeeHistory };\n","import { HexUInt } from '@vechain/sdk-core';\nimport { JSONRPCInternalError } from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\n\n/**\n * RPC Method eth_gasPrice implementation\n * @link [ethGasPrice](https://ethereum.github.io/execution-apis/api-documentation/)\n * @returns The current gas price in Wei unit considering that 1 VTHO equals 1e18 Wei.\n */\nconst ethGasPrice = async (thorClient: ThorClient): Promise<string> => {\n    // Check if Galactica hardfork has happened\n    const galacticaForked = await thorClient.forkDetector.detectGalactica();\n    if (!galacticaForked) {\n        const {\n            result: { plain }\n        } = await thorClient.contracts.getLegacyBaseGasPrice();\n        return HexUInt.of(plain as bigint).toString(true);\n    }\n\n    const bestBlock = await thorClient.blocks.getBestBlockCompressed();\n    const baseFeePerGas = bestBlock?.baseFeePerGas;\n\n    if (baseFeePerGas === undefined) {\n        throw new JSONRPCInternalError(\n            'eth_gasPrice',\n            'Last block should have baseFeePerGas defined.',\n            { params: bestBlock, url: thorClient.httpClient.baseURL }\n        );\n    }\n    const maxPriorityFeePerGas = await thorClient.gas.getMaxPriorityFeePerGas();\n\n    const baseFee = HexUInt.of(baseFeePerGas).bi;\n    const priority = HexUInt.of(maxPriorityFeePerGas).bi;\n\n    return HexUInt.of(baseFee + priority).toString(true);\n};\n\nexport { ethGasPrice };\n","import { type ThorClient } from '../../../../../thor-client';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type DefaultBlock, DefaultBlockToRevision } from '../../../const';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { Address } from '@vechain/sdk-core';\n\n/**\n * RPC Method eth_getBalance implementation\n *\n * @link [eth_getBalance](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @note Only 'latest' and 'finalized' block numbers are supported.\n *\n * @param thorClient - ThorClient instance.\n * @param params - The standard array of rpc call parameters.\n *                * params[0]: The address to get the balance for as a hex string.\n *                * params[1]: The block number to get the balance at as a hex string or \"latest\".\n * @returns the balance of the account at the given address formatted to the RPC standard.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetBalance = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<string> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        (typeof params[1] !== 'object' && typeof params[1] !== 'string')\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getBalance',\n            `Invalid input params for \"eth_getBalance\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    try {\n        const [address, block] = params as [string, DefaultBlock];\n\n        // Get the account details\n        const accountDetails = await thorClient.accounts.getAccount(\n            Address.of(address),\n            {\n                revision: DefaultBlockToRevision(block)\n            }\n        );\n\n        return accountDetails.balance;\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getBalance()',\n            'Method \"eth_getBalance\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetBalance };\n","import { type ThorClient } from '../../../../../thor-client';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport {\n    BlocksRPC,\n    type TransactionReceiptRPC,\n    type TransactionRPC\n} from '../../../formatter';\nimport { ethGetBlockByNumber } from '../eth_getBlockByNumber';\nimport { ethGetTransactionReceipt } from '../eth_getTransactionReceipt';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { HexUInt } from '@vechain/sdk-core';\nimport { ethGetBlockByHash } from '../eth_getBlockByHash';\n\n/**\n * RPC Method eth_getBlockReceipts implementation\n *\n * @link [eth_getBlockReceipts](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n * @note:\n * * params[0]: blockNumber - The block number to get the receipts for as a hex string or \"latest\".\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetBlockReceipts = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<TransactionReceiptRPC[] | null> => {\n    // Input validation\n    if (params.length !== 1 || typeof params[0] !== 'string')\n        throw new JSONRPCInvalidParams(\n            'eth_getBlockReceipts',\n            `Invalid input params for \"eth_getBlockReceipts\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    try {\n        // Initialize the block number from the params\n        const [blockIdentifier] = params as [string];\n\n        let block: BlocksRPC | null = null;\n\n        if (HexUInt.isValid(blockIdentifier) && blockIdentifier.length === 66) {\n            block = await ethGetBlockByHash(thorClient, [\n                blockIdentifier,\n                true\n            ]);\n        } else {\n            block = await ethGetBlockByNumber(thorClient, [\n                blockIdentifier,\n                true\n            ]);\n        }\n\n        // Return the block receipts\n\n        // Block is null, return null\n        if (block === null) return null;\n\n        // Block is not null, return the block receipts\n        const transactionsIntoTheBlock: TransactionRPC[] =\n            block.transactions as TransactionRPC[];\n\n        const transactionReceipts: TransactionReceiptRPC[] = [];\n\n        for (const tx of transactionsIntoTheBlock) {\n            const receipt = (await ethGetTransactionReceipt(thorClient, [\n                tx.hash\n            ])) as TransactionReceiptRPC;\n\n            transactionReceipts.push(receipt);\n        }\n\n        return transactionReceipts;\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getBlockReceipts()',\n            'Method \"eth_getBlockReceipts\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetBlockReceipts };\n","import type { ThorClient } from '../../../../../thor-client';\nimport { JSONRPCInvalidParams } from '@vechain/sdk-errors';\nimport { ethGetBlockByHash } from '../eth_getBlockByHash';\nimport { ThorId } from '@vechain/sdk-core';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\n\n/**\n * RPC Method eth_getBlockTransactionCountByHash implementation\n *\n * @link [eth_getBlockTransactionCountByHash](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block hash of block to get.\n * @returns The number of transactions in the block with the given block hash.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetBlockTransactionCountByHash = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<number> => {\n    // Input validation\n    if (\n        params.length !== 1 ||\n        typeof params[0] !== 'string' ||\n        !ThorId.isValid(params[0])\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getBlockTransactionCountByHash',\n            `Invalid input params for \"eth_getBlockTransactionCountByHash\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    const block = await ethGetBlockByHash(thorClient, [params[0], false]);\n    if (block !== null) return block.transactions.length;\n    return 0;\n};\n\nexport { ethGetBlockTransactionCountByHash };\n","import { JSONRPCInvalidParams } from '@vechain/sdk-errors';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport type { ThorClient } from '../../../../../thor-client';\nimport { ethGetBlockByNumber } from '../eth_getBlockByNumber';\n\n/**\n * RPC Method eth_getBlockTransactionCountByNumber implementation\n *\n * @link [eth_getBlockTransactionCountByNumber](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block hash of block to get.\n * @returns The number of transactions in the block with the given block hash.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetBlockTransactionCountByNumber = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<number> => {\n    // Input validation\n    if (params.length !== 1 || typeof params[0] !== 'string')\n        throw new JSONRPCInvalidParams(\n            'eth_getBlockTransactionCountByNumber',\n            `Invalid input params for \"eth_getBlockTransactionCountByNumber\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    const block = await ethGetBlockByNumber(thorClient, [params[0], true]);\n    if (block !== null) return block.transactions.length;\n    return 0;\n};\n\nexport { ethGetBlockTransactionCountByNumber };\n","import { Address } from '@vechain/sdk-core';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type DefaultBlock, DefaultBlockToRevision } from '../../../const';\n\n/**\n * RPC Method eth_getCode implementation\n *\n * @link [eth_getCode](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @note Only 'latest' and 'finalized' block numbers are supported.\n *\n * @param thorClient - ThorClient instance.\n * @param params - The standard array of rpc call parameters.\n *               * params[0]: The address to get the code for as a hex string.\n *               * params[1]: The block number to get the code at as a hex string or \"latest\".\n * @returns The code of the account at the given address formatted to the RPC standard.\n * @throws {JSONRPCInternalError}\n */\nconst ethGetCode = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<string> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        (typeof params[1] !== 'object' && typeof params[1] !== 'string')\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getCode',\n            `Invalid input params for \"eth_getCode\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    try {\n        const [address, block] = params as [string, DefaultBlock];\n\n        // Get the account bytecode\n        const bytecode = await thorClient.accounts.getBytecode(\n            Address.of(address),\n            {\n                revision: DefaultBlockToRevision(block)\n            }\n        );\n\n        return bytecode.toString();\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getCode()',\n            'Method \"eth_getCode\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetCode };\n","import { VeChainSDKLogger } from '@vechain/sdk-logging';\n\n/**\n * RPC Method eth_getFilterChanges implementation\n *\n * @link [eth_getFilterChanges](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n * @note:\n * * params[0]: ...\n * * params[1]: ...\n * * params[n]: ...\n */\nconst ethGetFilterChanges = async (): Promise<'METHOD NOT IMPLEMENTED'> => {\n    // Not implemented yet\n    VeChainSDKLogger('warning').log({\n        title: 'eth_getFilterChanges',\n        messages: [\n            'Method \"eth_getFilterChanges\" has not been implemented yet.'\n        ]\n    });\n\n    // To avoid eslint error\n    return await Promise.resolve('METHOD NOT IMPLEMENTED');\n};\n\nexport { ethGetFilterChanges };\n","import { VeChainSDKLogger } from '@vechain/sdk-logging';\n\n/**\n * RPC Method eth_getFilterLogs implementation\n *\n * @link [eth_getFilterLogs](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n * @note:\n * * params[0]: ...\n * * params[1]: ...\n * * params[n]: ...\n */\nconst ethGetFilterLogs = async (): Promise<'METHOD NOT IMPLEMENTED'> => {\n    // Not implemented yet\n    VeChainSDKLogger('warning').log({\n        title: 'eth_getFilterLogs',\n        messages: ['Method \"eth_getFilterLogs\" has not been implemented yet.']\n    });\n\n    // To avoid eslint error\n    return await Promise.resolve('METHOD NOT IMPLEMENTED');\n};\n\nexport { ethGetFilterLogs };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport {\n    formatToLogsRPC,\n    getCriteriaSetForInput,\n    type LogsRPC\n} from '../../../formatter';\nimport {\n    type CompressedBlockDetail,\n    type EventCriteria,\n    type EventLogs,\n    type ThorClient\n} from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\n\n/**\n * RPC Method eth_getLogs implementation\n *\n * @link [eth_getLogs](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n * @returns An array of log objects, or an empty array if nothing has changed since last poll\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetLogs = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<LogsRPC[]> => {\n    // Input validation\n    if (params.length !== 1 || typeof params[0] !== 'object')\n        throw new JSONRPCInvalidParams(\n            'eth_getLogs',\n            `Invalid input params for \"eth_getLogs\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    // Block max limit\n    const MAX_LIMIT = 1000;\n\n    // Input params\n    const [filterOptions] = params as [\n        {\n            address?: string | string[] | null;\n            fromBlock?: string;\n            toBlock?: string;\n            topics?: string[] | string[][];\n            blockhash?: string;\n        }\n    ];\n\n    try {\n        // Get the latest block (if fromBlock or toBlock is not defined, we will use the latest block)\n        const latestBlock =\n            (await thorClient.blocks.getBestBlockCompressed()) as CompressedBlockDetail;\n\n        // Get criteria set from input\n        const criteriaSet: EventCriteria[] = getCriteriaSetForInput({\n            address:\n                filterOptions.address !== null\n                    ? filterOptions.address\n                    : undefined,\n            topics: filterOptions.topics\n        });\n\n        // Call thor client to get logs\n        const logs: EventLogs[] = await thorClient.logs.filterRawEventLogs({\n            range: {\n                unit: 'block',\n                from:\n                    filterOptions.fromBlock !== undefined\n                        ? parseInt(filterOptions.fromBlock, 16)\n                        : latestBlock.number,\n                to:\n                    filterOptions.toBlock !== undefined\n                        ? parseInt(filterOptions.toBlock, 16)\n                        : latestBlock.number\n            },\n            criteriaSet,\n            order: 'asc',\n            options: {\n                offset: 0,\n                limit: MAX_LIMIT\n            }\n        });\n\n        // Format logs to RPC\n        return formatToLogsRPC(logs);\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getLogs()',\n            'Method \"eth_getLogs\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetLogs };\n","import { Address, ThorId } from '@vechain/sdk-core';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type DefaultBlock, DefaultBlockToRevision } from '../../../const';\n\n/**\n * RPC Method eth_getStorageAt implementation\n *\n * @link [eth_getStorageAt](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @note Only 'latest' and 'finalized' block numbers are supported.\n *\n * @param thorClient - ThorClient instance.\n * @param params - The standard array of rpc call parameters.\n *               * params[0]: The address to get the storage slot for as a hex string.\n *               * params[1]: The storage position to get as a hex string.\n *               * params[2]: The block number to get the storage slot at as a hex string or \"latest\".\n * @returns The storage slot of the account at the given address formatted to the RPC standard.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetStorageAt = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<string> => {\n    // Input validation\n    if (\n        params.length !== 3 ||\n        typeof params[0] !== 'string' ||\n        (typeof params[1] !== 'string' && typeof params[1] !== 'bigint') ||\n        (params[2] != null &&\n            typeof params[2] !== 'object' &&\n            typeof params[2] !== 'string')\n    ) {\n        throw new JSONRPCInvalidParams(\n            'eth_getStorageAt',\n            `Invalid input params for \"eth_getStorageAt\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n    }\n\n    try {\n        params[2] ??= 'latest';\n        const [address, storagePosition, block] = params as [\n            string,\n            string,\n            DefaultBlock\n        ];\n\n        // Get the account details\n        const storage = await thorClient.accounts.getStorageAt(\n            Address.of(address),\n            ThorId.of(storagePosition),\n            {\n                revision: DefaultBlockToRevision(block)\n            }\n        );\n        return storage.toString();\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getStorageAt()',\n            'Method \"eth_getStorageAt\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetStorageAt };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type TransactionRPC, transactionsFormatter } from '../../../formatter';\nimport { getTransactionIndexIntoBlock } from '../../../helpers';\nimport { ethChainId } from '../eth_chainId';\nimport { ethGetBlockByHash } from '../eth_getBlockByHash';\n\n/**\n * RPC Method eth_getTransactionByHash implementation\n *\n * @link [eth_getTransactionByHash](https://docs.infura.io/networks/ethereum/json-rpc-methods/eth_gettransactionbyhash)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The transaction hash to get as a hex string.\n * @returns the transaction at the given hash formatted to the RPC standard or null if the transaction does not exist.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetTransactionByHash = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<TransactionRPC | null> => {\n    // Input validation\n    if (params.length !== 1 || typeof params[0] !== 'string')\n        throw new JSONRPCInvalidParams(\n            'eth_getTransactionByHash',\n            `Invalid input params for \"eth_getTransactionByHash\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    try {\n        const [hash] = params as [string];\n\n        // Get the VeChainThor transaction\n        const tx = await thorClient.transactions.getTransaction(hash);\n\n        if (tx === null) return null;\n\n        // Get the block containing the transaction\n        const block = await ethGetBlockByHash(thorClient, [\n            tx.meta.blockID,\n            false\n        ]);\n\n        if (block === null) return null;\n\n        // Get the index of the transaction in the block\n        const txIndex = getTransactionIndexIntoBlock(block, hash);\n\n        // Get the chain id\n        const chainId = await ethChainId(thorClient);\n\n        return transactionsFormatter.formatToRPCStandard(tx, chainId, txIndex);\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getTransactionByHash()',\n            'Method \"eth_getTransactionByHash\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetTransactionByHash };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type BlocksRPC, type TransactionRPC } from '../../../formatter';\nimport { ethGetBlockByHash } from '../eth_getBlockByHash';\nimport { ethGetTransactionByHash } from '../eth_getTransactionByHash';\n\n/**\n * RPC Method eth_getTransactionByBlockHashAndIndex implementation\n *\n * @link [eth_getTransactionByBlockHashAndIndex](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n * @note:\n * * params[0]: ...\n * * params[1]: ...\n * * params[n]: ...\n */\nconst ethGetTransactionByBlockHashAndIndex = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<TransactionRPC | null> => {\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        typeof params[1] !== 'string'\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getTransactionByBlockHashAndIndex',\n            `Invalid input params for \"eth_getTransactionByBlockHashAndIndex\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    try {\n        const [blockHash, index] = params as [string, string];\n\n        // Get the block containing the transactions\n        const block = (await ethGetBlockByHash(thorClient, [\n            blockHash,\n            false\n        ])) as BlocksRPC;\n\n        for (const transactionHash of block.transactions) {\n            const transaction = (await ethGetTransactionByHash(thorClient, [\n                transactionHash\n            ])) as TransactionRPC;\n            if (transaction.transactionIndex === index) {\n                return transaction;\n            }\n        }\n\n        return null;\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getTransactionByBlockHashAndIndex()',\n            'Method \"eth_getTransactionByBlockHashAndIndex\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetTransactionByBlockHashAndIndex };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type BlocksRPC, type TransactionRPC } from '../../../formatter';\nimport { ethGetBlockByNumber } from '../eth_getBlockByNumber';\nimport { ethGetTransactionByHash } from '../eth_getTransactionByHash';\n\n/**\n * RPC Method eth_getTransactionByBlockNumberAndIndex implementation\n *\n * @link [eth_getTransactionByBlockNumberAndIndex](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n * @note:\n * * params[0]: block parameter, a hexadecimal block number (or best, latest, finalized).\n * * params[1]: transaction index position, a hexadecimal of the integer representing the position in the block.\n * @returns A transaction object, or null when no transaction was found.\n */\nconst ethGetTransactionByBlockNumberAndIndex = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<TransactionRPC | null> => {\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        typeof params[1] !== 'string'\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getTransactionByBlockNumberAndIndex',\n            `Invalid input params for \"eth_getTransactionByBlockNumberAndIndex\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    try {\n        const [blockHash, index] = params as [string, string];\n\n        // Get the block containing the transactions\n        const block = (await ethGetBlockByNumber(thorClient, [\n            blockHash,\n            false\n        ])) as BlocksRPC;\n\n        for (const transactionHash of block.transactions) {\n            const transaction = (await ethGetTransactionByHash(thorClient, [\n                transactionHash\n            ])) as TransactionRPC;\n            if (transaction.transactionIndex === index) {\n                return transaction;\n            }\n        }\n\n        return null;\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_getTransactionByBlockNumberAndIndex()',\n            'Method \"eth_getTransactionByBlockNumberAndIndex\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethGetTransactionByBlockNumberAndIndex };\n","import { JSONRPCInvalidParams } from '@vechain/sdk-errors';\nimport { Address, Hex, Secp256k1 } from '@vechain/sdk-core';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\n\n/**\n * RPC Method eth_getTransactionCount implementation\n *\n * @link [eth_getTransactionCount](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @note: To respect differences between VeChain and Ethereum, in this function we will give a random number as output.\n * Basically Ethereum to get nonce to use the number of transactions sent from an address,\n * while VeChain uses a random number.\n *\n * @param params - The standard array of rpc call parameters.\n *                * params[0]: address: string, is the address to get the number of transactions from.\n *                * params[1]: A string representing a block number, or one of the string tags latest, earliest, or pending.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethGetTransactionCount = async (params: unknown[]): Promise<string> => {\n    // Input validation\n    if (\n        typeof params[0] !== 'string' ||\n        (typeof params[1] !== 'object' && typeof params[1] !== 'string')\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getTransactionCount',\n            `Invalid input params for \"eth_getTransactionCount\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    // Invalid address\n    if (!Address.isValid(params[0])) {\n        throw new JSONRPCInvalidParams(\n            'eth_getTransactionCount',\n            'Invalid address, expected a 20 bytes address string.',\n            { params }\n        );\n    }\n\n    // Return a random number\n    return await Promise.resolve(Hex.of(Secp256k1.randomBytes(6)).toString());\n};\n\nexport { ethGetTransactionCount };\n","import { JSONRPCInvalidParams } from '@vechain/sdk-errors';\nimport { ThorId } from '@vechain/sdk-core';\n\n/**\n * RPC Method eth_getUncleByBlockHashAndIndex implementation\n *\n * @link [eth_getUncleByBlockHashAndIndex](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/eth_getunclebyblockhashandindex)\n *\n * @note\n *  * 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)\n *  * Currently, VeChain only supports hex number of block, 'latest' and 'finalized'.\n *  * We return a constant empty object for now.\n *\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block hash to get as a hex string.\n *                 * params[1]: A hexadecimal equivalent of the integer indicating the uncle's index position.\n * @returns The uncle block at the given block number and index.\n * @throws {JSONRPCInvalidParams}\n */\nconst ethGetUncleByBlockHashAndIndex = async (\n    params: unknown[]\n): Promise<object | null> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        !ThorId.isValid(params[0]) ||\n        typeof params[1] !== 'string'\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getUncleByBlockHashAndIndex',\n            'Invalid input params for \"eth_getUncleByBlockHashAndIndex\" method. See https://docs.infura.io/api/networks/ethereum/json-rpc-methods/eth_getunclebyblockhashandindex for details.',\n            { params }\n        );\n\n    return await Promise.resolve(null);\n};\n\nexport { ethGetUncleByBlockHashAndIndex };\n","import { JSONRPCInvalidParams } from '@vechain/sdk-errors';\n\n/**\n * RPC Method eth_getUncleByBlockNumberAndIndex implementation\n *\n * @link [eth_getUncleByBlockNumberAndIndex](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/eth_getunclebyblocknumberandindex)\n *\n * @note\n *  * 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)\n *  * Currently, VeChain only supports hex number of block, 'latest' and 'finalized'.\n *  * We return a constant empty object for now.\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block number to get as a hex string or \"latest\" or \"finalized\".\n *                 * params[1]: A hexadecimal equivalent of the integer indicating the uncle's index position.\n * @returns The uncle block at the given block number and index.\n * @throws {JSONRPCInvalidParams}\n */\nconst ethGetUncleByBlockNumberAndIndex = async (\n    params: unknown[]\n): Promise<object | null> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        typeof params[1] !== 'string'\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getUncleByBlockNumberAndIndex',\n            'Invalid input params for \"eth_getUncleByBlockNumberAndIndex\" method. See https://docs.infura.io/api/networks/ethereum/json-rpc-methods/eth_getunclebyblocknumberandindex for details.',\n            { params }\n        );\n\n    return await Promise.resolve(null);\n};\n\nexport { ethGetUncleByBlockNumberAndIndex };\n","import { ThorId } from '@vechain/sdk-core';\nimport { JSONRPCInvalidParams } from '@vechain/sdk-errors';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\n\n/**\n * RPC Method eth_getUncleCountByBlockHash implementation\n *\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block hash to get as a hex string.\n */\nconst ethGetUncleCountByBlockHash = async (\n    params: unknown[]\n): Promise<number> => {\n    // Input validation\n    if (\n        params.length !== 1 ||\n        typeof params[0] !== 'string' ||\n        !ThorId.isValid(params[0])\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_getUncleCountByBlockHash',\n            `Invalid input params for \"eth_getUncleCountByBlockHash\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    return await Promise.resolve(0);\n};\n\nexport { ethGetUncleCountByBlockHash };\n","import { JSONRPCInvalidParams } from '@vechain/sdk-errors';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\n\n/**\n * RPC Method eth_getUncleCountByBlockNumber implementation\n *\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The block number to get as a hex string or \"latest\" or \"finalized\".\n */\nconst ethGetUncleCountByBlockNumber = async (\n    params: unknown[]\n): Promise<number> => {\n    // Input validation\n    if (params.length !== 1 || typeof params[0] !== 'string')\n        throw new JSONRPCInvalidParams(\n            'eth_getUncleCountByBlockNumber',\n            `Invalid input params for \"eth_getUncleCountByBlockNumber\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    return await Promise.resolve(0);\n};\n\nexport { ethGetUncleCountByBlockNumber };\n","import { type ThorClient } from '../../../../../thor-client';\nimport { type VeChainProvider } from '../../../../providers/vechain-provider';\nimport {\n    JSONRPCInternalError,\n    JSONRPCMethodNotImplemented,\n    stringifyData\n} from '@vechain/sdk-errors';\n\n/**\n * RPC Method eth_maxPriorityFeePerGas implementation for Galactica hardfork\n * Returns the suggested priority fee per gas in wei.\n * This is calculated based on the current base fee and network conditions.\n *\n * @link [eth_maxPriorityFeePerGas](https://ethereum.github.io/execution-apis/api-documentation/)\n * @param thorClient - The thor client instance to use.\n * @param _params - The standard array of rpc call parameters.\n * @param _provider - The provider instance to use.\n * @returns Suggested priority fee per gas in wei (hex string)\n * @throws {JSONRPCInternalError} | {JSONRPCMethodNotImplemented}\n */\nconst ethMaxPriorityFeePerGas = async (\n    thorClient: ThorClient,\n    _params: unknown[],\n    _provider?: VeChainProvider\n): Promise<string> => {\n    try {\n        // Check if Galactica hardfork has happened\n        const galacticaForked = await thorClient.forkDetector.detectGalactica();\n        if (!galacticaForked) {\n            throw new JSONRPCMethodNotImplemented(\n                'eth_maxPriorityFeePerGas',\n                'Method \"eth_maxPriorityFeePerGas\" is not available before Galactica hardfork.',\n                { url: thorClient.httpClient.baseURL }\n            );\n        }\n\n        return await thorClient.gas.getMaxPriorityFeePerGas();\n    } catch (e) {\n        if (\n            e instanceof JSONRPCInternalError ||\n            e instanceof JSONRPCMethodNotImplemented\n        ) {\n            throw e;\n        }\n        throw new JSONRPCInternalError(\n            'eth_maxPriorityFeePerGas()',\n            'Method \"eth_maxPriorityFeePerGas\" failed.',\n            {\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethMaxPriorityFeePerGas };\n","import { JSONRPCInvalidParams, stringifyData } from '@vechain/sdk-errors';\nimport { type VeChainProvider } from '../../../../providers/vechain-provider';\nimport { ethAccounts } from '../eth_accounts/eth_accounts';\n\n/**\n * RPC Method eth_requestAccounts implementation\n *\n * @param provider - Provider with ProviderInternalWallet instance to use.\n * @throws {JSONRPCInvalidParams}\n */\nconst ethRequestAccounts = async (\n    provider?: VeChainProvider\n): Promise<string[]> => {\n    // Get the accounts from the wallet\n    const accounts = await ethAccounts(provider);\n\n    // If there are no accounts, throw error\n    // @NOTE: eth_accounts returns an empty array if there are no accounts OR wallet is not defined.\n    // Here, instead, if there are no accounts into wallet OR wallet is not defined, we throw an error\n    if (accounts.length === 0)\n        throw new JSONRPCInvalidParams(\n            'eth_requestAccounts()',\n            'Method \"eth_requestAccounts\" failed.',\n            {\n                provider: stringifyData(provider)\n            }\n        );\n\n    // Otherwise, return the accounts\n    return accounts;\n};\n\nexport { ethRequestAccounts };\n","import { Hex } from '@vechain/sdk-core';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\n\n/**\n * RPC Method eth_sendRawTransaction implementation\n *\n * @link [eth_sendrawtransaction](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *                 * params[0]: The signed transaction data as a hex string.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethSendRawTransaction = async (\n    thorClient: ThorClient,\n    params: unknown[]\n): Promise<string> => {\n    // Input validation\n    if (params.length !== 1 || typeof params[0] !== 'string')\n        throw new JSONRPCInvalidParams(\n            'eth_sendRawTransaction()',\n            `Invalid input params for \"eth_sendRawTransaction\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    // Invalid transaction encoded data\n    if (!Hex.isValid0x(params[0])) {\n        throw new JSONRPCInvalidParams(\n            'eth_sendRawTransaction()',\n            'Invalid transaction encoded data given as input. Input must be a hex string.',\n            { params }\n        );\n    }\n\n    try {\n        const [signedTransactionData] = params as [string];\n\n        const sentTransaction =\n            await thorClient.transactions.sendRawTransaction(\n                signedTransactionData\n            );\n\n        return sentTransaction.id;\n    } catch (error) {\n        throw new JSONRPCInternalError(\n            'eth_sendRawTransaction()',\n            'Method \"eth_sendRawTransaction\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL\n            },\n            error\n        );\n    }\n};\n\nexport { ethSendRawTransaction };\n","import {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    HttpNetworkError,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type VeChainSigner } from '../../../../../signer';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport { type VeChainProvider } from '../../../../providers/vechain-provider';\nimport { getCachedChainId } from '../eth_chainId';\nimport { type TransactionObjectInput } from './types';\n\n/**\n * RPC Method eth_sendTransaction implementation\n *\n * @link [eth_sendTransaction](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @NOTE: If 'to' address is not provided.\n * It will be assumed that the transaction is a contract creation transaction.\n * The 'data' field of the transaction will be used as the contract initialization code.\n *\n * @NOTE: 'gasPrice' cannot be used together with 'maxPriorityFeePerGas' and 'maxFeePerGas'.\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *               * params[0]: transaction - object - This describes the transaction info with following properties:\n *                   * to: 20 bytes - Address the transaction is directed to.\n *                   * from: 20 bytes [Required] - Address the transaction is sent from.\n *                   * gas: Hexadecimal value of the gas provided for the transaction execution as hex string.\n *                   * gasPrice: Hexadecimal value of the gasPrice used for each paid gas.\n *                   * value: Hexadecimal of the value sent with this transaction.\n *                   * data: Hash of the method signature and encoded parameters.\n *                   * maxPriorityFeePerGas: Maximum fee per gas the sender is willing to pay to miners in wei. Used in 1559 transactions.\n *                   * 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.\n * @param provider - The provider instance to use.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethSendTransaction = async (\n    thorClient: ThorClient,\n    params: unknown[],\n    provider?: VeChainProvider\n): Promise<string> => {\n    // Input validation\n    if (\n        params === undefined ||\n        params.length !== 1 ||\n        typeof params[0] !== 'object'\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_sendTransaction',\n            `Invalid input params for \"eth_sendTransaction\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    // Provider must be defined\n    if (provider?.wallet === undefined) {\n        throw new JSONRPCInvalidParams(\n            'eth_sendTransaction',\n            'Provider must be defined with a wallet. Ensure that the provider is defined and connected to the network.',\n            { provider }\n        );\n    }\n\n    // From field is required\n    if ((params[0] as TransactionObjectInput).from === undefined) {\n        throw new JSONRPCInvalidParams(\n            'eth_sendTransaction',\n            'From field is required in the transaction object.',\n            { provider }\n        );\n    }\n\n    // default value for value is 0x0\n    if ((params[0] as TransactionObjectInput).value === undefined) {\n        (params[0] as TransactionObjectInput).value = '0x0';\n    }\n\n    // Input params\n    const [transaction] = params as [TransactionObjectInput];\n\n    // Check if the chainId in the transaction object if specified matches the chainId of the network\n    const chainId = await getCachedChainId(thorClient);\n    if (transaction.chainId != null && transaction.chainId !== chainId) {\n        throw new JSONRPCInvalidParams(\n            'eth_sendTransaction',\n            `ChainId in the transaction object does not match the chainId of the network. Expected: ${chainId}, Received: ${transaction.chainId}`,\n            { chainId: transaction.chainId }\n        );\n    }\n\n    try {\n        // Get the signer of the provider\n        const signer = (await provider.getSigner(\n            transaction.from\n        )) as VeChainSigner;\n\n        // Return the result\n        return await signer.sendTransaction(transaction);\n    } catch (error) {\n        // Check if this is a network communication error\n        if (error instanceof HttpNetworkError) {\n            throw new JSONRPCInternalError(\n                'eth_sendTransaction()',\n                'Method \"eth_sendTransaction\" failed due to network communication error.',\n                {\n                    params: stringifyData(params),\n                    url: thorClient.httpClient.baseURL,\n                    networkError: true,\n                    networkErrorType: error.data.networkErrorType\n                },\n                error\n            );\n        }\n\n        throw new JSONRPCInternalError(\n            'eth_sendTransaction()',\n            'Method \"eth_sendTransaction\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL\n            },\n            error\n        );\n    }\n};\n\nexport { ethSendTransaction };\n","import type { ThorClient } from '../../../../../thor-client';\nimport type { VeChainProvider } from '../../../../providers/vechain-provider';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { RPC_DOCUMENTATION_URL } from '../../../../../utils';\nimport type { TransactionObjectInput } from '../eth_sendTransaction';\nimport type { VeChainSigner } from '../../../../../signer';\n\n/**\n * RPC Method eth_signTransaction implementation\n *\n * @link [eth_signTransaction](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *               * params[0]: transaction - object - This describes the transaction info with following properties:\n *                   * to: 20 bytes - Address the transaction is directed to.\n *                   * from: 20 bytes [Required] - Address the transaction is sent from.\n *                   * gas: Hexadecimal value of the gas provided for the transaction execution as hex string.\n *                   * gasPrice: Hexadecimal value of the gasPrice used for each paid gas.\n *                   * value: Hexadecimal of the value sent with this transaction.\n *                   * data: Hash of the method signature and encoded parameters.\n *                   * nonce: The nonce of the transaction.\n * @param provider - The provider instance to use.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethSignTransaction = async (\n    thorClient: ThorClient,\n    params: unknown[],\n    provider?: VeChainProvider\n): Promise<string> => {\n    // Input validation\n    if (params.length !== 1 || typeof params[0] !== 'object')\n        throw new JSONRPCInvalidParams(\n            'eth_signTransaction',\n            `Invalid input params for \"eth_signTransaction\" method. See ${RPC_DOCUMENTATION_URL} for details.`,\n            { params }\n        );\n\n    // Provider must be defined\n    if (provider?.wallet === undefined) {\n        throw new JSONRPCInvalidParams(\n            'eth_signTransaction',\n            'Provider must be defined with a wallet. Ensure that the provider is defined and connected to the network.',\n            { provider }\n        );\n    }\n\n    // From field is required\n    if ((params[0] as TransactionObjectInput).from === undefined) {\n        throw new JSONRPCInvalidParams(\n            'eth_signTransaction',\n            'From field is required in the transaction object.',\n            { provider }\n        );\n    }\n\n    // Input params\n    const [transaction] = params as [TransactionObjectInput];\n\n    try {\n        // Get the signer of the provider\n        const signer = (await provider.getSigner(\n            transaction.from\n        )) as VeChainSigner;\n\n        // Return the result\n        return await signer.signTransaction(transaction);\n    } catch (error) {\n        throw new JSONRPCInternalError(\n            'eth_signTransaction()',\n            'Method \"eth_signTransaction\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL\n            },\n            error\n        );\n    }\n};\n\nexport { ethSignTransaction };\n","import { Address } from '@vechain/sdk-core';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport type {\n    TypedDataDomain,\n    TypedDataParameter,\n    VeChainSigner\n} from '../../../../../signer/signers';\nimport type { ThorClient } from '../../../../../thor-client';\nimport type { VeChainProvider } from '../../../../providers/vechain-provider';\n\n/**\n * RPC Method eth_signTypedDataV4 implementation\n *\n * @link [eth_signTypedDataV4](https://docs.metamask.io/wallet/reference/eth_signtypeddata_v4/)\n *\n * @param thorClient - The thor client instance to use.\n * @param params - The standard array of rpc call parameters.\n *               * params[0]: The hex encoded address of the account to sign the typed message.\n *               * params[1] An object or a JSON string containing:\n *                   * types - An array of EIP712Domain object. It is an array specifying one or more (name, version, chainId, verifyingContract) tuples.\n *                   * domain - Contains the domain separator values specified in the EIP712Domain type.\n *                   * primaryType: A string specifying the name of the primary type for the message.\n *                   * message: An object containing the data to sign.\n * @param provider - The provider instance to use.\n * @throws {JSONRPCInvalidParams, JSONRPCInternalError}\n */\nconst ethSignTypedDataV4 = async (\n    thorClient: ThorClient,\n    params: unknown[],\n    provider?: VeChainProvider\n): Promise<string> => {\n    // Input validation\n    if (\n        params.length !== 2 ||\n        typeof params[0] !== 'string' ||\n        !Address.isValid(params[0]) ||\n        (typeof params[1] !== 'object' && typeof params[1] !== 'string')\n    )\n        throw new JSONRPCInvalidParams(\n            'eth_signTypedDataV4',\n            `Invalid input params for \"eth_signTypedDataV4\" method. See https://docs.metamask.io/wallet/reference/eth_signtypeddata_v4/ for details.`,\n            { params }\n        );\n\n    // Provider must be defined\n    if (\n        provider?.wallet === undefined ||\n        (await provider.getSigner(params[0])) === null\n    ) {\n        throw new JSONRPCInvalidParams(\n            'eth_signTypedDataV4',\n            `Provider must be defined with a wallet. Ensure that the provider is defined, connected to the network and has the wallet with the address ${params[0]} into it.`,\n            { provider }\n        );\n    }\n\n    // Input params\n    const [address] = params as [string, unknown];\n    let typedData: {\n        primaryType: string;\n        domain: TypedDataDomain;\n        types: Record<string, TypedDataParameter[]>;\n        message: Record<string, unknown>;\n    };\n\n    // Parse typedData if it's a string\n    if (typeof params[1] === 'string') {\n        try {\n            const parsed = JSON.parse(params[1]) as {\n                primaryType: string;\n                domain: TypedDataDomain;\n                types: Record<string, TypedDataParameter[]>;\n                message: Record<string, unknown>;\n            };\n            const isObject =\n                typeof parsed === 'object' &&\n                parsed !== null &&\n                !Array.isArray(parsed);\n            const hasFields =\n                'primaryType' in parsed &&\n                'domain' in parsed &&\n                'types' in parsed &&\n                'message' in parsed;\n            if (!isObject || !hasFields) {\n                throw new JSONRPCInvalidParams(\n                    'eth_signTypedDataV4',\n                    'Invalid typedData structure',\n                    { params }\n                );\n            }\n            typedData = parsed;\n        } catch (error) {\n            throw new JSONRPCInvalidParams(\n                'eth_signTypedData_v4',\n                'Invalid JSON string for typed data parameter',\n                { params },\n                error\n            );\n        }\n    } else {\n        typedData = params[1] as typeof typedData;\n    }\n    // check domain is an object\n    if (typeof typedData.domain !== 'object' || typedData.domain === null) {\n        throw new JSONRPCInvalidParams(\n            'eth_signTypedDataV4',\n            'Invalid typedData structure',\n            { params }\n        );\n    }\n\n    try {\n        // Get the signer of the provider\n        const signer = (await provider.getSigner(address)) as VeChainSigner;\n\n        // Return the result\n        return await signer.signTypedData(\n            typedData.domain,\n            typedData.types,\n            typedData.message,\n            typedData.primaryType\n        );\n    } catch (error) {\n        throw new JSONRPCInternalError(\n            'eth_signTypedDataV4',\n            'Method \"eth_signTypedDataV4\" failed.',\n            {\n                params: stringifyData(params),\n                url: thorClient.httpClient.baseURL\n            },\n            error\n        );\n    }\n};\n\nexport { ethSignTypedDataV4 };\n","import { Hex } from '@vechain/sdk-core';\nimport {\n    JSONRPCInternalError,\n    JSONRPCInvalidParams,\n    JSONRPCServerError,\n    stringifyData\n} from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport {\n    type FilterOptions,\n    type VeChainProvider\n} from '../../../../providers/vechain-provider';\n\n/**\n * Enumerates the types of subscriptions supported by the`eth_subscribe` RPC method.\n */\nenum SUBSCRIPTION_TYPE {\n    /**\n     * Subscription type for receiving notifications about new blocks added to the blockchain.\n     */\n    NEW_HEADS = 'newHeads',\n\n    /**\n     * Subscription type for receiving log entries that match specific filter criteria,\n     * allowing clients to listen for specific events emitted by smart contracts.\n     */\n    LOGS = 'logs'\n}\n\n/**\n * Defines the parameter types accepted by the `eth_subscribe` RPC method.\n */\ntype ethSubscribeParams = [SUBSCRIPTION_TYPE, string | string[]] | unknown[];\n\n/**\n * Initiates a subscription to the blockchain events based on the specified parameters.\n * This function supports subscriptions to new block headers ('newHeads') and log entries ('logs')\n * that match given filter criteria. It ensures that the provided parameters are valid and that\n * the provider is available before setting up the subscription and generating a unique subscription ID.\n *\n * @link [eth_subscribe](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/subscription-methods/eth_subscribe)\n *\n * @param thorClient - An instance of `ThorClient` used to interact with the blockchain, such as\n *                     retrieving the current best block when setting up a new subscription.\n * @param params - Parameters for the subscription, conforming to `ethSubscribeParams`. The first\n *                 element of the array specifies the type of subscription, and the second element\n *                 (if present) provides additional options, such as filter criteria for log subscriptions.\n * @param provider - An optional `VeChainProvider` instance that contains the subscription manager.\n *                   The subscription manager is used to store and manage active subscriptions.\n *                   If the provider is not provided or is undefined, the function throws an error.\n *\n * @returns A `Promise` that resolves to a string representing the unique ID of the created subscription.\n * @throws {JSONRPCInternalError, JSONRPCInvalidParams, JSONRPCServerError}\n */\nconst ethSubscribe = async (\n    thorClient: ThorClient,\n    params: ethSubscribeParams,\n    provider?: VeChainProvider\n): Promise<string> => {\n    if (provider === undefined) {\n        throw new JSONRPCInternalError(\n            'eth_subscribe()',\n            'Method \"eth_subscribe\" failed. Provider is not defined.',\n            {\n                url: thorClient.httpClient.baseURL,\n                params: stringifyData(params)\n            }\n        );\n    }\n    if (\n        params[0] !== SUBSCRIPTION_TYPE.NEW_HEADS &&\n        params[0] !== SUBSCRIPTION_TYPE.LOGS\n    ) {\n        throw new JSONRPCInvalidParams(\n            'eth_subscribe()',\n            'Method \"eth_subscribe\" failed. Invalid subscription type param.',\n            {\n                url: thorClient.httpClient.baseURL,\n                params: stringifyData(params)\n            }\n        );\n    }\n\n    // I check if a poll instance is already active, if not I set a new starting block number for the subscription\n    if (provider.getPollInstance() === undefined) {\n        const block = await thorClient.blocks.getBestBlockCompressed();\n\n        if (block !== undefined && block !== null) {\n            provider.subscriptionManager.currentBlockNumber = block.number;\n        } else\n            throw new JSONRPCServerError(\n                'eth_subscribe()',\n                'Method \"eth_subscribe\" failed. Best block not available.',\n                {\n                    url: thorClient.httpClient.baseURL,\n                    params: stringifyData(params)\n                }\n            );\n\n        provider.startSubscriptionsPolling();\n    }\n    const subscriptionId: string = Hex.random(16).digits;\n\n    if (params.includes(SUBSCRIPTION_TYPE.NEW_HEADS)) {\n        provider.subscriptionManager.newHeadsSubscription = {\n            subscriptionId,\n            subscription: {\n                type: SUBSCRIPTION_TYPE.NEW_HEADS\n            }\n        };\n    }\n\n    if (params.includes(SUBSCRIPTION_TYPE.LOGS)) {\n        provider.subscriptionManager.logSubscriptions.set(subscriptionId, {\n            type: SUBSCRIPTION_TYPE.LOGS,\n            options: params[1] as FilterOptions\n        });\n    }\n    return subscriptionId;\n};\n\nexport { ethSubscribe };\n","import { HexInt } from '@vechain/sdk-core';\nimport { JSONRPCInternalError, stringifyData } from '@vechain/sdk-errors';\nimport {\n    type CompressedBlockDetail,\n    type ThorClient\n} from '../../../../../thor-client';\nimport { blocksFormatter, type SyncBlockRPC } from '../../../formatter';\nimport { ethChainId } from '../eth_chainId';\n\n/**\n * Check if the block is out of sync in time.\n * A block is considered out of sync if the difference between the current time and the block timestamp is GREATER than 11 seconds.\n *\n * @param block - Block to check\n */\nconst _isBlockNotOutOfSyncInTime = (block: CompressedBlockDetail): boolean => {\n    return Math.floor(Date.now() / 1000) - block.timestamp < 11000;\n};\n\n/**\n * RPC Method eth_syncing implementation\n *\n * @link [eth_syncing](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param thorClient - The thor client instance to use.\n *\n * @note The startingBlock parameter is not supported.\n *\n * @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.\n */\nconst ethSyncing = async (\n    thorClient: ThorClient\n): Promise<boolean | SyncBlockRPC> => {\n    try {\n        // Get the best block and the genesis block\n        const bestBlock = await thorClient.blocks.getBestBlockCompressed();\n        const genesisBlock = await thorClient.blocks.getGenesisBlock();\n\n        // Get the highest block number\n        const highestBlockNumber: string | null =\n            genesisBlock !== null\n                ? HexInt.of(\n                      Math.floor((Date.now() - genesisBlock.timestamp) / 10000)\n                  ).toString()\n                : null;\n\n        // Check the latest block\n        if (bestBlock !== null) {\n            // Check if the node is out of sync\n            if (_isBlockNotOutOfSyncInTime(bestBlock)) return false;\n\n            // Calculate the chainId\n            const chainId = await ethChainId(thorClient);\n\n            return {\n                currentBlock: blocksFormatter.formatToRPCStandard(\n                    bestBlock,\n                    chainId\n                ),\n                highestBlock: highestBlockNumber,\n\n                // Not supported field\n                startingBlock: null\n            };\n        }\n\n        // Strange cases when the fetched best block is null\n        return {\n            currentBlock: null,\n            highestBlock: highestBlockNumber,\n\n            // Not supported field\n            startingBlock: null\n        };\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'eth_syncing()',\n            'Method \"eth_syncing\" failed.',\n            {\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { ethSyncing };\n","import { JSONRPCInternalError, stringifyData } from '@vechain/sdk-errors';\nimport type { VeChainProvider } from '../../../../providers/vechain-provider';\n\n/**\n * Asynchronously unsubscribes from a VeChain event subscription.\n * This function attempts to unsubscribe from either 'newHeads' or log subscriptions\n * based on the provided `subscriptionId`. If the provider is not available or the\n * `subscriptionId` does not match any active subscriptions, it may throw an error\n * or return `false`, respectively.\n *\n * @link [eth_unsubscribe](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/subscription-methods/eth_unsubscribe)\n *\n * @param params - An array containing the subscription ID as its first element.\n * The subscription ID is used to identify and unsubscribe from the corresponding\n * Ethereum event subscription.\n * @param provider - An optional `VeChainProvider` instance that contains the\n * subscription manager. This manager holds the active subscriptions and is used\n * to unsubscribe from them. If the provider is not provided or is undefined,\n * the function throws an error indicating that the provider is not available.\n * @returns A `Promise` that resolves to `true` if the unsubscription was successful,\n * or `false` if the specified subscription ID does not match any active subscriptions.\n * @throws {JSONRPCInternalError}\n */\nconst ethUnsubscribe = async (\n    params: unknown[],\n    provider?: VeChainProvider\n): Promise<boolean> => {\n    let result: boolean = false;\n\n    if (provider === undefined) {\n        throw new JSONRPCInternalError(\n            'eth_unsubscribe()',\n            'Method \"eth_unsubscribe\" failed. Provider is not defined.',\n            {\n                params: stringifyData(params)\n            }\n        );\n    }\n\n    const subscriptionId = params[0] as string;\n\n    // Unsubscribe from 'newHeads' events if the subscription ID matches the newHeads subscription\n    if (\n        provider.subscriptionManager.newHeadsSubscription !== undefined &&\n        subscriptionId ===\n            provider.subscriptionManager.newHeadsSubscription.subscriptionId\n    ) {\n        provider.subscriptionManager.newHeadsSubscription = undefined;\n        result = true;\n    }\n    // Unsubscribe from log events if the subscription ID matches a log subscription\n    else {\n        result =\n            provider.subscriptionManager.logSubscriptions.delete(\n                subscriptionId\n            );\n    }\n\n    if (!provider.isThereActiveSubscriptions()) {\n        provider.stopSubscriptionsPolling();\n    }\n\n    return await Promise.resolve(result);\n};\n\nexport { ethUnsubscribe };\n","import { JSONRPCInternalError, stringifyData } from '@vechain/sdk-errors';\nimport { type ThorClient } from '../../../../../thor-client';\nimport { Poll } from '../../../../../utils';\n\n/**\n * RPC Method evm_mine implementation\n *\n * @link [evm_mine](https://hardhat.org/hardhat-network/docs/explanation/mining-modes)\n *\n * @param thorClient - The thor client instance to use.\n * @returns The new block or null if the block is not available.\n * @throws {JSONRPCInternalError}\n */\nconst evmMine = async (thorClient: ThorClient): Promise<null> => {\n    try {\n        const head = await thorClient.blocks.getBestBlockCompressed();\n        if (head === null) {\n            throw new JSONRPCInternalError(\n                'evm_mine()',\n                'Method \"evm_mine\" failed. No best block found.',\n                {\n                    url: thorClient.httpClient.baseURL\n                }\n            );\n        }\n\n        await Poll.SyncPoll(() => thorClient.blocks.getHeadBlock()).waitUntil(\n            (result) => {\n                return result !== head;\n            }\n        );\n\n        return null;\n    } catch (e) {\n        if (e instanceof JSONRPCInternalError) {\n            throw e;\n        }\n\n        throw new JSONRPCInternalError(\n            'evm_mine()',\n            'Method \"evm_mine\" failed.',\n            {\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { evmMine };\n","import { JSONRPCInternalError, stringifyData } from '@vechain/sdk-errors';\nimport type { ThorClient } from '../../../../../thor-client';\n\n/**\n * RPC Method net_listening implementation\n *\n * @link [net_listening](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/net_listening)\n *\n * @param thorClient - The thor client instance to use.\n */\nconst netListening = async (thorClient: ThorClient): Promise<boolean> => {\n    try {\n        return await thorClient.nodes.isHealthy();\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'net_listening()',\n            'Method \"net_listening\" failed.',\n            {\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { netListening };\n","import { type ThorClient } from '../../../../../thor-client';\nimport { JSONRPCInternalError, stringifyData } from '@vechain/sdk-errors';\n\n/**\n * RPC Method net_peerCount implementation\n *\n * @link [net_peerCount](https://docs.infura.io/api/networks/ethereum/json-rpc-methods/net_peercount)\n *\n * @param thorClient - The thor client instance to use.\n */\nconst netPeerCount = async (thorClient: ThorClient): Promise<number> => {\n    try {\n        const peers = await thorClient.nodes.getNodes();\n        return peers.length;\n    } catch (e) {\n        throw new JSONRPCInternalError(\n            'net_peerCount()',\n            'Method \"net_peerCount\" failed.',\n            {\n                url: thorClient.httpClient.baseURL,\n                innerError: stringifyData(e)\n            }\n        );\n    }\n};\n\nexport { netPeerCount };\n","import { type ThorClient } from '../../../../../thor-client';\nimport { ethChainId } from '../eth_chainId';\n\n/**\n * RPC Method net_version implementation\n *\n * @link [net_version](https://docs.infura.io/networks/ethereum/json-rpc-methods/net_version)\n *\n * @param thorClient - ThorClient instance.\n *\n * @returns The net version (equivalent to chain id in our case).\n */\nconst netVersion = async (thorClient: ThorClient): Promise<string> => {\n    return await ethChainId(thorClient);\n};\n\nexport { netVersion };\n","/**\n * RPC Method txpool_content implementation\n *\n * @link [txpool_content](https://www.quicknode.com/docs/ethereum/txpool_content)\n *\n * @note\n *  * We return a constant empty object for now.\n *\n * @returns The transaction pool status\n */\nconst txPoolContent = async (): Promise<object> => {\n    return await Promise.resolve({});\n};\n\nexport { txPoolContent };\n","import { JSONRPCInvalidParams } from '@vechain/sdk-errors';\nimport { Address } from '@vechain/sdk-core';\n\n/**\n * RPC Method txpool_contentFrom implementation\n *\n * @link [txpool_contentFrom](https://www.quicknode.com/docs/ethereum/txpool_contentFrom)\n *\n * @note\n *  * We return a constant empty object for now.\n *\n * @param params - The standard array of rpc call parameters.\n * params[0]: The address to get the transaction pool status from\n * @returns The transaction pool status\n */\nconst txPoolContentFrom = async (params: unknown[]): Promise<object> => {\n    // Validate input\n    if (\n        params.length !== 1 ||\n        typeof params[0] !== 'string' ||\n        !Address.isValid(params[0])\n    )\n        throw new JSONRPCInvalidParams(\n            'txpool_contentFrom()',\n            `Invalid input params for \"txpool_contentFrom\" method. See https://www.quicknode.com/docs/ethereum/txpool_contentFrom for details.`,\n            { params }\n        );\n    return await Promise.resolve({});\n};\n\nexport { txPoolContentFrom };\n","/**\n * RPC Method txpool_inspect implementation\n *\n * @link [txpool_inspect](https://www.quicknode.com/docs/ethereum/txpool_inspect)\n *\n * @note\n *  * We return a constant empty object for now.\n *\n * @returns The transaction pool status\n */\nconst txPoolInspect = async (): Promise<object> => {\n    return await Promise.resolve({});\n};\n\nexport { txPoolInspect };\n","/**\n * RPC Method txpool_status implementation\n *\n * @link [txpool_status](https://www.quicknode.com/docs/ethereum/txpool_status)\n *\n * @note\n *  * We return a constant empty object for now.\n *\n * @returns The transaction pool status\n */\nconst txPoolStatus = async (): Promise<object> => {\n    return await Promise.resolve({});\n};\n\nexport { txPoolStatus };\n","/**\n * RPC Method web3_clientVersion implementation\n *\n * @link [web3_clientVersion](https://docs.infura.io/networks/ethereum/json-rpc-methods/web3_clientversion)\n *\n * @returns A string representing the current client version.\n */\nconst web3ClientVersion = async (): Promise<string> => {\n    return await Promise.resolve('thor');\n};\n\nexport { web3ClientVersion };\n","import { JSONRPCInvalidParams } from '@vechain/sdk-errors';\nimport { Hex, Keccak256 } from '@vechain/sdk-core';\n\n/**\n * RPC Method web3_sha3 implementation\n *\n * @link [web3_sha3](https://docs.alchemy.com/reference/web3-sha3)\n * @param params - The standard array of rpc call parameters.\n *                * params[0]: The data to hash.\n * @returns A string representing the current client version.\n */\nconst web3Sha3 = async (params: unknown[]): Promise<string> => {\n    // Input validation\n    if (\n        params.length !== 1 ||\n        typeof params[0] !== 'string' ||\n        !Hex.isValid(params[0])\n    )\n        throw new JSONRPCInvalidParams(\n            'web3_sha3',\n            `Invalid input params for \"web3_sha3\" method. See 'https://docs.alchemy.com/reference/web3-sha3' for details.`,\n            { params }\n        );\n\n    return await Promise.resolve(Keccak256.of(params[0]).toString());\n};\n\nexport { web3Sha3 };\n","import { type ThorClient } from '../../../thor-client';\nimport { type FeeHistoryResponse } from '../../../thor-client/gas/types';\nimport { type VeChainProvider } from '../../providers/vechain-provider';\nimport { RPC_METHODS } from '../const/rpc-mapper/rpc-methods';\nimport {\n    type BlocksRPC,\n    type LogsRPC,\n    type SyncBlockRPC,\n    type TracerReturnTypeRPC,\n    type TransactionReceiptRPC,\n    type TransactionRPC\n} from '../formatter';\nimport {\n    debugTraceBlockByHash,\n    debugTraceBlockByNumber,\n    debugTraceCall,\n    debugTraceTransaction,\n    ethAccounts,\n    ethBlockNumber,\n    ethCall,\n    ethChainId,\n    ethEstimateGas,\n    ethGasPrice,\n    ethGetBalance,\n    ethGetBlockByHash,\n    ethGetBlockByNumber,\n    ethGetBlockReceipts,\n    ethGetBlockTransactionCountByHash,\n    ethGetBlockTransactionCountByNumber,\n    ethGetCode,\n    ethGetLogs,\n    ethGetStorageAt,\n    ethGetTransactionByBlockHashAndIndex,\n    ethGetTransactionByBlockNumberAndIndex,\n    ethGetTransactionByHash,\n    ethGetTransactionCount,\n    ethGetTransactionReceipt,\n    ethGetUncleByBlockHashAndIndex,\n    ethGetUncleByBlockNumberAndIndex,\n    ethGetUncleCountByBlockHash,\n    ethGetUncleCountByBlockNumber,\n    ethRequestAccounts,\n    ethSendRawTransaction,\n    ethSendTransaction,\n    ethSignTransaction,\n    ethSignTypedDataV4,\n    ethSubscribe,\n    ethSyncing,\n    ethUnsubscribe,\n    evmMine,\n    netListening,\n    netPeerCount,\n    netVersion,\n    txPoolContent,\n    txPoolContentFrom,\n    txPoolInspect,\n    txPoolStatus,\n    web3ClientVersion,\n    web3Sha3\n} from './methods';\nimport { ethFeeHistory } from './methods/eth_feeHistory/eth_feeHistory';\nimport { ethMaxPriorityFeePerGas } from './methods/eth_maxPriorityFeePerGas/eth_maxPriorityFeePerGas';\n\ntype MethodHandlerType<TParams, TReturnType> = (\n    params: TParams[]\n) => Promise<TReturnType>;\n\n/**\n * Map of RPC methods to their implementations with the SDK.\n * We can consider this as an \"RPC Mapper\" for the SDK.\n *\n * List of all RPC methods:\n * * https://eth.wiki/json-rpc/API\n * * https://ethereum.github.io/execution-apis/api-documentation/\n *\n * @param thorClient - ThorClient instance.\n * @param provider - Provider instance. It is optional because the majority of the methods do not require a provider.\n */\nconst RPCMethodsMap = (\n    thorClient: ThorClient,\n    provider?: VeChainProvider\n): Record<string, MethodHandlerType<unknown, unknown>> => {\n    /**\n     * Returns a map of RPC methods to their implementations with our SDK.\n     */\n    return {\n        [RPC_METHODS.eth_blockNumber]: async (): Promise<string> => {\n            return await ethBlockNumber(thorClient);\n        },\n\n        [RPC_METHODS.eth_chainId]: async (): Promise<string> => {\n            return await ethChainId(thorClient);\n        },\n\n        [RPC_METHODS.eth_getBalance]: async (params): Promise<string> => {\n            return await ethGetBalance(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_getCode]: async (params): Promise<string> => {\n            return await ethGetCode(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_getStorageAt]: async (params): Promise<string> => {\n            return await ethGetStorageAt(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_estimateGas]: async (params): Promise<string> => {\n            return await ethEstimateGas(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_call]: async (params): Promise<string> => {\n            return await ethCall(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_sendRawTransaction]: async (\n            params\n        ): Promise<string> => {\n            return await ethSendRawTransaction(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_getLogs]: async (params): Promise<LogsRPC[]> => {\n            return await ethGetLogs(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_getBlockByHash]: async (\n            params\n        ): Promise<BlocksRPC | null> => {\n            return await ethGetBlockByHash(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_getBlockByNumber]: async (\n            params\n        ): Promise<BlocksRPC | null> => {\n            return await ethGetBlockByNumber(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_accounts]: async (): Promise<string[]> => {\n            return await ethAccounts(provider);\n        },\n\n        [RPC_METHODS.eth_gasPrice]: async (): Promise<string> => {\n            return await ethGasPrice(thorClient);\n        },\n\n        [RPC_METHODS.eth_getTransactionByHash]: async (\n            params\n        ): Promise<TransactionRPC | null> => {\n            return await ethGetTransactionByHash(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_getTransactionCount]: async (\n            params\n        ): Promise<string> => {\n            return await ethGetTransactionCount(params);\n        },\n\n        [RPC_METHODS.eth_getTransactionReceipt]: async (\n            params\n        ): Promise<TransactionReceiptRPC | null> => {\n            return await ethGetTransactionReceipt(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_sendTransaction]: async (params): Promise<string> => {\n            return await ethSendTransaction(thorClient, params, provider);\n        },\n\n        [RPC_METHODS.eth_syncing]: async (): Promise<\n            boolean | SyncBlockRPC\n        > => {\n            return await ethSyncing(thorClient);\n        },\n\n        [RPC_METHODS.net_version]: async (): Promise<string> => {\n            return await netVersion(thorClient);\n        },\n\n        [RPC_METHODS.web3_clientVersion]: async (): Promise<string> => {\n            return await web3ClientVersion();\n        },\n\n        [RPC_METHODS.eth_subscribe]: async (params): Promise<string> => {\n            return await ethSubscribe(thorClient, params, provider);\n        },\n\n        [RPC_METHODS.eth_unsubscribe]: async (params): Promise<boolean> => {\n            return await ethUnsubscribe(params, provider);\n        },\n\n        [RPC_METHODS.debug_traceTransaction]: async (\n            params\n        ): Promise<\n            TracerReturnTypeRPC<'call'> | TracerReturnTypeRPC<'prestate'>\n        > => {\n            return await debugTraceTransaction(thorClient, params);\n        },\n\n        [RPC_METHODS.debug_traceCall]: async (\n            params\n        ): Promise<\n            TracerReturnTypeRPC<'call'> | TracerReturnTypeRPC<'prestate'>\n        > => {\n            return await debugTraceCall(thorClient, params);\n        },\n\n        [RPC_METHODS.evm_increaseTime]: async (): Promise<null> => {\n            // @see https://docs.vechain.org/core-concepts/evm-compatibility/test-coverage/hardhat-specific/evm_increasetime\n            // VeChain does not support evm_increaseTime, so we use evm_mine instead\n            // This is a workaround to be able to use hardhat's evm_increaseTime\n            return await evmMine(thorClient);\n        },\n\n        [RPC_METHODS.evm_mine]: async (): Promise<null> => {\n            return await evmMine(thorClient);\n        },\n\n        [RPC_METHODS.eth_getBlockTransactionCountByHash]: async (\n            params\n        ): Promise<number> => {\n            return await ethGetBlockTransactionCountByHash(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_getBlockTransactionCountByNumber]: async (\n            params\n        ): Promise<number> => {\n            return await ethGetBlockTransactionCountByNumber(\n                thorClient,\n                params\n            );\n        },\n\n        [RPC_METHODS.eth_getTransactionByBlockHashAndIndex]: async (\n            params\n        ): Promise<TransactionRPC | null> => {\n            return await ethGetTransactionByBlockHashAndIndex(\n                thorClient,\n                params\n            );\n        },\n\n        [RPC_METHODS.eth_getTransactionByBlockNumberAndIndex]: async (\n            params\n        ): Promise<TransactionRPC | null> => {\n            return await ethGetTransactionByBlockNumberAndIndex(\n                thorClient,\n                params\n            );\n        },\n\n        [RPC_METHODS.eth_getUncleByBlockHashAndIndex]: async (\n            params\n        ): Promise<object | null> => {\n            return await ethGetUncleByBlockHashAndIndex(params);\n        },\n\n        [RPC_METHODS.eth_getUncleByBlockNumberAndIndex]: async (\n            params\n        ): Promise<object | null> => {\n            return await ethGetUncleByBlockNumberAndIndex(params);\n        },\n\n        [RPC_METHODS.eth_getUncleCountByBlockHash]: async (\n            params\n        ): Promise<number> => {\n            return await ethGetUncleCountByBlockHash(params);\n        },\n\n        [RPC_METHODS.eth_getUncleCountByBlockNumber]: async (\n            params\n        ): Promise<number> => {\n            return await ethGetUncleCountByBlockNumber(params);\n        },\n\n        [RPC_METHODS.eth_requestAccounts]: async (): Promise<string[]> => {\n            return await ethRequestAccounts(provider);\n        },\n\n        [RPC_METHODS.net_listening]: async (): Promise<boolean> => {\n            return await netListening(thorClient);\n        },\n\n        [RPC_METHODS.net_peerCount]: async (): Promise<number> => {\n            return await netPeerCount(thorClient);\n        },\n\n        [RPC_METHODS.eth_getBlockReceipts]: async (\n            params\n        ): Promise<TransactionReceiptRPC[] | null> => {\n            return await ethGetBlockReceipts(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_signTransaction]: async (params): Promise<string> => {\n            return await ethSignTransaction(thorClient, params, provider);\n        },\n\n        [RPC_METHODS.web3_sha3]: async (params): Promise<string> => {\n            return await web3Sha3(params);\n        },\n\n        [RPC_METHODS.txpool_inspect]: async (): Promise<object> => {\n            return await txPoolInspect();\n        },\n\n        [RPC_METHODS.txpool_content]: async (): Promise<object> => {\n            return await txPoolContent();\n        },\n\n        [RPC_METHODS.txpool_contentFrom]: async (params): Promise<object> => {\n            return await txPoolContentFrom(params);\n        },\n\n        [RPC_METHODS.txpool_status]: async (): Promise<object> => {\n            return await txPoolStatus();\n        },\n\n        [RPC_METHODS.debug_traceBlockByHash]: async (\n            params\n        ): Promise<\n            Array<{\n                txHash: string;\n                result:\n                    | TracerReturnTypeRPC<'call'>\n                    | TracerReturnTypeRPC<'prestate'>;\n            }>\n        > => {\n            return await debugTraceBlockByHash(thorClient, params);\n        },\n\n        [RPC_METHODS.debug_traceBlockByNumber]: async (\n            params\n        ): Promise<\n            Array<{\n                txHash: string;\n                result:\n                    | TracerReturnTypeRPC<'call'>\n                    | TracerReturnTypeRPC<'prestate'>;\n            }>\n        > => {\n            return await debugTraceBlockByNumber(thorClient, params);\n        },\n\n        [RPC_METHODS.eth_signTypedData_v4]: async (params): Promise<string> => {\n            return await ethSignTypedDataV4(thorClient, params, provider);\n        },\n\n        [RPC_METHODS.eth_maxPriorityFeePerGas]: async (\n            params\n        ): Promise<string> => {\n            return await ethMaxPriorityFeePerGas(thorClient, params, provider);\n        },\n\n        [RPC_METHODS.eth_feeHistory]: async (\n            params\n        ): Promise<FeeHistoryResponse> => {\n            return await ethFeeHistory(thorClient, params, provider);\n        }\n    };\n};\nexport { RPCMethodsMap };\n","import { HexInt } from '@vechain/sdk-core';\nimport {\n    JSONRPCMethodNotFound,\n    JSONRPCMethodNotImplemented\n} from '@vechain/sdk-errors';\nimport { EventEmitter } from 'events';\nimport { type VeChainSigner } from '../../../signer';\nimport {\n    type CompressedBlockDetail,\n    type ThorClient\n} from '../../../thor-client';\nimport { type EventPoll, Poll, vnsUtils } from '../../../utils';\nimport {\n    type EIP1193ProviderMessage,\n    type EIP1193RequestArguments\n} from '../../eip1193';\nimport { type ProviderInternalWallet } from '../../helpers';\nimport {\n    ethGetLogs,\n    POLLING_INTERVAL,\n    RPC_METHODS,\n    RPCMethodsMap\n} from '../../utils';\nimport {\n    type FilterOptions,\n    type SubscriptionEvent,\n    type SubscriptionManager\n} from './types';\n\n/**\n * Our core provider class for VeChain\n */\nclass VeChainProvider extends EventEmitter implements EIP1193ProviderMessage {\n    public readonly subscriptionManager: SubscriptionManager = {\n        logSubscriptions: new Map(),\n        currentBlockNumber: 0\n    };\n\n    /**\n     * Poll instance for subscriptions\n     *\n     * @private\n     */\n    private pollInstance?: EventPoll<SubscriptionEvent[]>;\n\n    /**\n     * Constructor for VeChainProvider\n     *\n     * @param thorClient - ThorClient instance.\n     * @param wallet - ProviderInternalWallet instance. It is optional because the majority of the methods do not require a wallet.\n     * @param enableDelegation - Enable fee delegation or not.\n     * @throws {JSONRPCInvalidParams}\n     *\n     */\n    constructor(\n        readonly thorClient: ThorClient,\n        readonly wallet?: ProviderInternalWallet,\n        readonly enableDelegation: boolean = false\n    ) {\n        super();\n    }\n\n    /**\n     * Destroys the provider by closing the thorClient and stopping the provider poll instance if present.\n     * This is because thorClient and the provider might be initialized with a polling interval.\n     */\n    public destroy(): void {\n        this.thorClient.destroy();\n        if (this.pollInstance !== undefined) {\n            this.pollInstance.stopListen();\n            this.pollInstance = undefined;\n        }\n    }\n\n    /**\n     * This method is used to send a request to the provider.\n     * Basically, it is a wrapper around the RPCMethodsMap.\n     *\n     * @param args - Method and parameters to be used for the request.\n     * @returns The result of the request.\n     * @throws {JSONRPCMethodNotFound}\n     */\n    public async request(args: EIP1193RequestArguments): Promise<unknown> {\n        // Check if the method is supported\n        if (\n            !Object.values(RPC_METHODS)\n                .map((key) => key.toString())\n                .includes(args.method)\n        ) {\n            const error = new JSONRPCMethodNotFound(\n                'VeChainProvider.request()',\n                'Method not found',\n                { code: -32601, message: 'Method not found' }\n            );\n\n            // Override the error message with our custom formatted message\n            throw error;\n        }\n\n        const methodsMap = RPCMethodsMap(this.thorClient, this);\n\n        // If method is in enum but not in map, throw \"not implemented\"\n        if (!(args.method in methodsMap)) {\n            throw new JSONRPCMethodNotImplemented(\n                args.method,\n                'Method not implemented',\n                {\n                    code: -32004,\n                    message: 'Method not supported'\n                }\n            );\n        }\n\n        // Get the method from the RPCMethodsMap and call it\n        return await methodsMap[args.method](args.params as unknown[]);\n    }\n\n    /**\n     * Initializes and starts the polling mechanism for subscription events.\n     * This method sets up an event poll that periodically checks for new events related to active\n     * subscriptions, such as 'newHeads' or log subscriptions. When new data is available, it emits\n     * these events to listeners.\n     *\n     * This method leverages the `Poll.createEventPoll` utility to create the polling mechanism,\n     * which is then started by invoking `startListen` on the poll instance.\n     */\n    public startSubscriptionsPolling(): boolean {\n        let result = false;\n        if (this.pollInstance === undefined) {\n            this.pollInstance = Poll.createEventPoll(async () => {\n                const data: SubscriptionEvent[] = [];\n\n                const currentBlock = await this.getCurrentBlock();\n\n                if (currentBlock !== null) {\n                    if (\n                        this.subscriptionManager.newHeadsSubscription !==\n                        undefined\n                    ) {\n                        data.push({\n                            method: 'eth_subscription',\n                            params: {\n                                subscription:\n                                    this.subscriptionManager\n                                        .newHeadsSubscription.subscriptionId,\n                                result: currentBlock\n                            }\n                        });\n                    }\n                    if (this.subscriptionManager.logSubscriptions.size > 0) {\n                        const logs = await this.getLogsRPC();\n                        data.push(...logs);\n                    }\n\n                    this.subscriptionManager.currentBlockNumber++;\n                }\n                return data;\n            }, POLLING_INTERVAL).onData(\n                (subscriptionEvents: SubscriptionEvent[]) => {\n                    subscriptionEvents.forEach((event) => {\n                        this.emit('message', event);\n                    });\n                }\n            );\n\n            this.pollInstance.startListen();\n            result = true;\n        }\n        return result;\n    }\n\n    /**\n     * Stops the polling mechanism for subscription events.\n     * This method stops the polling mechanism for subscription events, if it is active.\n     *\n     * @returns {boolean} A boolean indicating whether the polling mechanism was stopped.\n     */\n    public stopSubscriptionsPolling(): boolean {\n        let result = false;\n        if (this.pollInstance !== undefined) {\n            this.pollInstance.stopListen();\n            this.pollInstance = undefined;\n            result = true;\n        }\n        return result;\n    }\n\n    /**\n     * Checks if there are active subscriptions.\n     * This method checks if there are any active log subscriptions or a new heads subscription.\n     *\n     * @returns {boolean} A boolean indicating whether there are active subscriptions.\n     */\n    public isThereActiveSubscriptions(): boolean {\n        return (\n            this.subscriptionManager.logSubscriptions.size > 0 ||\n            this.subscriptionManager.newHeadsSubscription !== undefined\n        );\n    }\n\n    /**\n     * Returns the poll instance for subscriptions.\n     */\n    public getPollInstance(): EventPoll<SubscriptionEvent[]> | undefined {\n        return this.pollInstance;\n    }\n\n    /**\n     * Fetches logs for all active log subscriptions managed by `subscriptionManager`.\n     * This method iterates over each log subscription, constructs filter options based on the\n     * subscription details, and then queries for logs using these filter options.\n     *\n     * Each log query is performed asynchronously, and the method waits for all queries to complete\n     * before returning. The result for each subscription is encapsulated in a `SubscriptionEvent`\n     * object, which includes the subscription ID and the fetched logs.\n     *\n     * This function is intended to be called when there's a need to update or fetch the latest\n     * logs for all active subscriptions, typically in response to a new block being mined or\n     * at regular intervals to keep subscription data up to date.\n     *\n     * @returns {Promise<SubscriptionEvent[]>} A promise that resolves to an array of `SubscriptionEvent`\n     * objects, each containing the subscription ID and the corresponding logs fetched for that\n     * subscription. The promise resolves to an empty array if there are no active log subscriptions.\n     */\n    private async getLogsRPC(): Promise<SubscriptionEvent[]> {\n        // Convert the logSubscriptions Map to an array of promises, each promise corresponds to a log fetch operation\n        const promises = Array.from(\n            this.subscriptionManager.logSubscriptions.entries()\n        ).map(async ([subscriptionId, subscriptionDetails]) => {\n            const currentBlock = HexInt.of(\n                this.subscriptionManager.currentBlockNumber\n            ).toString();\n            // Construct filter options for the Ethereum logs query based on the subscription details\n            const filterOptions: FilterOptions = {\n                address: subscriptionDetails.options?.address, // Contract address to filter the logs by\n                fromBlock: currentBlock,\n                toBlock: currentBlock,\n                topics: subscriptionDetails.options?.topics // Topics to filter the logs by\n            };\n\n            // Fetch logs based on the filter options and construct a SubscriptionEvent object\n            return {\n                method: 'eth_subscription',\n                params: {\n                    subscription: subscriptionId, // Subscription ID\n                    result: await ethGetLogs(this.thorClient, [filterOptions]) // The actual log data fetched from Ethereum node\n                }\n            };\n        });\n\n        // Wait for all log fetch operations to complete and return an array of SubscriptionEvent objects\n        const subscriptionEvents = await Promise.all(promises);\n        // Filter out empty results\n        return subscriptionEvents.filter(\n            (event) => event.params.result.length > 0\n        );\n    }\n\n    /**\n     * Fetches the current block details from the VeChain node.\n     *\n     * @private\n     */\n    private async getCurrentBlock(): Promise<CompressedBlockDetail | null> {\n        // Initialize the result to null, indicating no block found initially\n        let result: CompressedBlockDetail | null = null;\n\n        // Proceed only if there are active log subscriptions or a new heads subscription is present\n        if (this.isThereActiveSubscriptions()) {\n            // Fetch the block details for the current block number\n            const block = await this.thorClient.blocks.getBlockCompressed(\n                this.subscriptionManager.currentBlockNumber\n            );\n\n            // If the block is successfully fetched (not undefined or null), update the result.\n            if (block !== undefined && block !== null) {\n                result = block; // Set the fetched block as the result\n            }\n        }\n\n        // Return the fetched block details or null if no block was fetched\n        return result;\n    }\n\n    /**\n     * Get a signer into the internal wallet provider\n     * for the given address.\n     *\n     * @param addressOrIndex - Address of index of the account.\n     * @returns The signer for the given address.\n     */\n    async getSigner(\n        addressOrIndex?: string | number\n    ): Promise<VeChainSigner | null> {\n        if (this.wallet === undefined) {\n            return null;\n        }\n        return await this.wallet?.getSigner(this, addressOrIndex);\n    }\n\n    /**\n     * Use vet.domains to resolve name to address\n     * @param vnsName - The name to resolve\n     * @returns the address for a name or null\n     */\n    async resolveName(vnsName: string): Promise<null | string> {\n        return await vnsUtils.resolveName(this.thorClient, vnsName);\n    }\n\n    /**\n     * Use vet.domains to look up a verified primary name for an address\n     * @param address - The address to lookup\n     * @returns the primary name for an address or null\n     */\n    async lookupAddress(address: string): Promise<null | string> {\n        return await vnsUtils.lookupAddress(this.thorClient, address);\n    }\n}\n\nexport { VeChainProvider };\n","import {\n    JSONRPCInternalError,\n    JSONRPCTransactionRevertError,\n    stringifyData,\n    VechainSDKError\n} from '@vechain/sdk-errors';\nimport { VeChainSDKLogger } from '@vechain/sdk-logging';\nimport { SimpleHttpClient } from '../../../http';\nimport { ThorClient } from '../../../thor-client';\nimport type { EIP1193RequestArguments } from '../../eip1193';\nimport { type ProviderInternalWallet } from '../../helpers';\nimport { VeChainProvider } from '../vechain-provider/vechain-provider';\nimport {\n    type BuildHardhatErrorFunction,\n    type JsonRpcRequest,\n    type JsonRpcResponse\n} from './types';\n\n/**\n * This class is a wrapper for the VeChainProvider that Hardhat uses.\n *\n * It exposes the interface that Hardhat expects, and uses the VeChainProvider as wrapped provider.\n */\nclass HardhatVeChainProvider extends VeChainProvider {\n    /**\n     * Debug mode.\n     */\n    debug: boolean;\n\n    /**\n     * The function to use to build Hardhat errors.\n     */\n    buildHardhatErrorFunctionCallback: BuildHardhatErrorFunction;\n\n    /**\n     * RPC configuration.\n     */\n    rpcConfiguration: {\n        ethGetTransactionCountMustReturn0: boolean;\n    };\n\n    /**\n     * Constructor with the network configuration.\n     *\n     * @param walletToUse - The wallet to use.\n     * @param nodeUrl - The node url to use\n     * @param buildHardhatErrorFunctionCallback - The function to use to build Hardhat errors.\n     * @param debug - Debug mode.\n     * @param enableDelegation - Enable fee delegation or not.\n     */\n    constructor(\n        walletToUse: ProviderInternalWallet,\n        nodeUrl: string,\n        buildHardhatErrorFunctionCallback: BuildHardhatErrorFunction,\n        debug: boolean = false,\n        enableDelegation: boolean = false,\n        rpcConfiguration = {\n            // By default, the eth_getTransactionCount method returns a random number.\n            ethGetTransactionCountMustReturn0: false\n        }\n    ) {\n        // Initialize the provider with the network configuration.\n        super(\n            new ThorClient(new SimpleHttpClient(nodeUrl)),\n            walletToUse,\n            enableDelegation\n        );\n\n        // Save the debug mode.\n        this.debug = debug;\n\n        // Save the RPC configuration.\n        this.rpcConfiguration = rpcConfiguration;\n\n        // Save the buildHardhatErrorFunction.\n        this.buildHardhatErrorFunctionCallback =\n            buildHardhatErrorFunctionCallback;\n    }\n\n    /**\n     * Overload of the send method\n     *\n     * @param method - The method to call.\n     * @param params - The parameters to pass to the method.\n     */\n    async send(method: string, params?: unknown[]): Promise<unknown> {\n        return await this.request({\n            method,\n            params\n        });\n    }\n\n    /**\n     * Overload of the sendAsync method.\n     * It is the same of the send method, but with a callback.\n     * Instead of returning the result, it calls the callback with the result.\n     *\n     * @param payload - The request payload (it contains method and params as 'send' method).\n     * @param callback - The callback to call with the result.\n     */\n    async sendAsync(\n        payload: JsonRpcRequest,\n        callback: (error: unknown, response: JsonRpcResponse) => void\n    ): Promise<void> {\n        try {\n            const result = await this.request({\n                method: payload.method,\n                params: payload.params\n            });\n\n            // Execute the callback with the result\n            callback(null, {\n                id: payload.id,\n                jsonrpc: '2.0',\n                result\n            });\n        } catch (e) {\n            // Execute the callback with the error\n            callback(e, {\n                id: payload.id,\n                jsonrpc: '2.0'\n            });\n        }\n    }\n\n    /**\n     * It sends the request through the VeChainProvider.\n     *\n     * @param args - The request arguments.\n     */\n    async request(args: EIP1193RequestArguments): Promise<unknown> {\n        // Must return 0 with the eth_getTransactionCount method\n        const mustReturn0 =\n            this.rpcConfiguration.ethGetTransactionCountMustReturn0 &&\n            args.method === 'eth_getTransactionCount';\n\n        try {\n            // Debug mode - get the request and the accounts\n            if (this.debug) {\n                const accounts = await (\n                    this.wallet as ProviderInternalWallet\n                ).getAddresses();\n                const gasPayer = await (\n                    this.wallet as ProviderInternalWallet\n                ).getGasPayer();\n\n                VeChainSDKLogger('log').log({\n                    title: `Sending request - ${args.method}`,\n                    messages: [\n                        `params: ${stringifyData(args.params)}`,\n                        `accounts: ${stringifyData(accounts)}`,\n                        `gasPayer: ${stringifyData(gasPayer)}`,\n                        `url: ${this.thorClient.httpClient.baseURL}`\n                    ]\n                });\n            }\n            // Send the request\n            const result = mustReturn0\n                ? '0x0'\n                : await super.request({\n                      method: args.method,\n                      params: args.params as never\n                  });\n\n            // Debug mode - get the result\n            if (this.debug) {\n                VeChainSDKLogger('log').log({\n                    title: `Get request - ${args.method} result`,\n                    messages: [`result: ${stringifyData(result)}`]\n                });\n            }\n\n            return result;\n        } catch (error) {\n            // Debug the error\n            if (this.debug) {\n                VeChainSDKLogger('error').log(\n                    new JSONRPCInternalError(\n                        args.method,\n                        `Error on request - ${args.method}`,\n                        {\n                            args\n                        }\n                    )\n                );\n            }\n\n            // eth_call transaction revert error already in correct format\n            if (error instanceof JSONRPCTransactionRevertError) {\n                throw error;\n            }\n\n            if (error instanceof VechainSDKError) {\n                throw this.buildHardhatErrorFunctionCallback(\n                    `Error on request ${args.method}: ${error.innerError}`,\n                    error\n                );\n            }\n        }\n    }\n}\n\nexport { HardhatVeChainProvider };\n"]}