Comparing version 0.0.1-alpha.21 to 0.0.1-alpha.22
@@ -1,4 +0,4 @@ | ||
import { R as RpcBlock, e as Block, x as Transaction, b as Hex, o as RpcTransaction, p as RpcTransactionReceipt, T as TransactionReceipt, S as TransactionType, s as TransactionRequest, q as RpcTransactionRequest } from './chain-32f56cfa.js'; | ||
export { J as Chain } from './chain-32f56cfa.js'; | ||
export { d as defineChain } from './chain-f12cdc7f.js'; | ||
import { R as RpcBlock, e as Block, x as Transaction, H as Hex, o as RpcTransaction, p as RpcTransactionReceipt, T as TransactionReceipt, S as TransactionType, s as TransactionRequest, q as RpcTransactionRequest } from './chain-4b39613a.js'; | ||
export { C as Chain } from './chain-4b39613a.js'; | ||
export { d as defineChain } from './chain-aa4898d0.js'; | ||
import '@wagmi/chains'; | ||
@@ -5,0 +5,0 @@ |
@@ -7,3 +7,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } | ||
var _chunkO2GYLJVDjs = require('./chunk-O2GYLJVD.js'); | ||
var _chunkV5U5S7PQjs = require('./chunk-V5U5S7PQ.js'); | ||
@@ -13,3 +13,3 @@ // src/chains.ts | ||
var celoFormatters = { | ||
block: _chunkO2GYLJVDjs.defineBlock.call(void 0, { | ||
block: _chunkV5U5S7PQjs.defineBlock.call(void 0, { | ||
exclude: ["difficulty", "gasLimit", "mixHash", "nonce", "uncles"], | ||
@@ -20,3 +20,3 @@ format: (block) => ({ | ||
}), | ||
transaction: _chunkO2GYLJVDjs.defineTransaction.call(void 0, { | ||
transaction: _chunkV5U5S7PQjs.defineTransaction.call(void 0, { | ||
format: (transaction) => ({ | ||
@@ -28,3 +28,3 @@ feeCurrency: transaction.feeCurrency, | ||
}), | ||
transactionReceipt: _chunkO2GYLJVDjs.defineTransactionReceipt.call(void 0, { | ||
transactionReceipt: _chunkV5U5S7PQjs.defineTransactionReceipt.call(void 0, { | ||
format: (transaction) => ({ | ||
@@ -36,3 +36,3 @@ feeCurrency: transaction.feeCurrency, | ||
}), | ||
transactionRequest: _chunkO2GYLJVDjs.defineTransactionRequest.call(void 0, { | ||
transactionRequest: _chunkV5U5S7PQjs.defineTransactionRequest.call(void 0, { | ||
format: (transactionRequest) => ({ | ||
@@ -45,48 +45,48 @@ feeCurrency: transactionRequest.feeCurrency, | ||
}; | ||
var arbitrum2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.arbitrum); | ||
var arbitrumGoerli2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.arbitrumGoerli); | ||
var aurora2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.aurora); | ||
var auroraGoerli = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.auroraTestnet); | ||
var avalanche2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.avalanche); | ||
var avalancheFuji2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.avalancheFuji); | ||
var bronos2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.bronos); | ||
var bronosTestnet2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.bronosTestnet); | ||
var bsc2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.bsc); | ||
var bscTestnet2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.bscTestnet); | ||
var canto2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.canto); | ||
var celo2 = _chunkO2GYLJVDjs.defineChain.call(void 0, { | ||
var arbitrum2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.arbitrum); | ||
var arbitrumGoerli2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.arbitrumGoerli); | ||
var aurora2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.aurora); | ||
var auroraGoerli = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.auroraTestnet); | ||
var avalanche2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.avalanche); | ||
var avalancheFuji2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.avalancheFuji); | ||
var bronos2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.bronos); | ||
var bronosTestnet2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.bronosTestnet); | ||
var bsc2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.bsc); | ||
var bscTestnet2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.bscTestnet); | ||
var canto2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.canto); | ||
var celo2 = _chunkV5U5S7PQjs.defineChain.call(void 0, { | ||
...chains.celo, | ||
formatters: celoFormatters | ||
}); | ||
var celoAlfajores2 = _chunkO2GYLJVDjs.defineChain.call(void 0, { | ||
var celoAlfajores2 = _chunkV5U5S7PQjs.defineChain.call(void 0, { | ||
...chains.celoAlfajores, | ||
formatters: celoFormatters | ||
}); | ||
var crossbell2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.crossbell); | ||
var evmos2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.evmos); | ||
var evmosTestnet2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.evmosTestnet); | ||
var fantom2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.fantom); | ||
var fantomTestnet2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.fantomTestnet); | ||
var filecoin2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.filecoin); | ||
var filecoinTestnet = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.filecoinHyperspace); | ||
var foundry2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.foundry); | ||
var goerli2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.goerli); | ||
var gnosis2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.gnosis); | ||
var gnosisChiado2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.gnosisChiado); | ||
var hardhat2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.hardhat); | ||
var iotex2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.iotex); | ||
var iotexTestnet2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.iotexTestnet); | ||
var localhost2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.localhost); | ||
var mainnet2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.mainnet); | ||
var metis2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.metis); | ||
var metisGoerli2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.metisGoerli); | ||
var optimism2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.optimism); | ||
var optimismGoerli2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.optimismGoerli); | ||
var polygon2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.polygon); | ||
var polygonMumbai2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.polygonMumbai); | ||
var sepolia2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.sepolia); | ||
var taraxa2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.taraxa); | ||
var taraxaTestnet2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.taraxaTestnet); | ||
var zkSync2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.zkSync); | ||
var zkSyncTestnet2 = _chunkO2GYLJVDjs.defineChain.call(void 0, chains.zkSyncTestnet); | ||
var crossbell2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.crossbell); | ||
var evmos2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.evmos); | ||
var evmosTestnet2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.evmosTestnet); | ||
var fantom2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.fantom); | ||
var fantomTestnet2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.fantomTestnet); | ||
var filecoin2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.filecoin); | ||
var filecoinTestnet = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.filecoinHyperspace); | ||
var foundry2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.foundry); | ||
var goerli2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.goerli); | ||
var gnosis2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.gnosis); | ||
var gnosisChiado2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.gnosisChiado); | ||
var hardhat2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.hardhat); | ||
var iotex2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.iotex); | ||
var iotexTestnet2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.iotexTestnet); | ||
var localhost2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.localhost); | ||
var mainnet2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.mainnet); | ||
var metis2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.metis); | ||
var metisGoerli2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.metisGoerli); | ||
var optimism2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.optimism); | ||
var optimismGoerli2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.optimismGoerli); | ||
var polygon2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.polygon); | ||
var polygonMumbai2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.polygonMumbai); | ||
var sepolia2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.sepolia); | ||
var taraxa2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.taraxa); | ||
var taraxaTestnet2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.taraxaTestnet); | ||
var zkSync2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.zkSync); | ||
var zkSyncTestnet2 = _chunkV5U5S7PQjs.defineChain.call(void 0, chains.zkSyncTestnet); | ||
@@ -134,3 +134,3 @@ | ||
exports.arbitrum = arbitrum2; exports.arbitrumGoerli = arbitrumGoerli2; exports.aurora = aurora2; exports.auroraGoerli = auroraGoerli; exports.avalanche = avalanche2; exports.avalancheFuji = avalancheFuji2; exports.bronos = bronos2; exports.bronosTestnet = bronosTestnet2; exports.bsc = bsc2; exports.bscTestnet = bscTestnet2; exports.canto = canto2; exports.celo = celo2; exports.celoAlfajores = celoAlfajores2; exports.crossbell = crossbell2; exports.defineChain = _chunkO2GYLJVDjs.defineChain; exports.evmos = evmos2; exports.evmosTestnet = evmosTestnet2; exports.fantom = fantom2; exports.fantomTestnet = fantomTestnet2; exports.filecoin = filecoin2; exports.filecoinTestnet = filecoinTestnet; exports.foundry = foundry2; exports.gnosis = gnosis2; exports.gnosisChiado = gnosisChiado2; exports.goerli = goerli2; exports.hardhat = hardhat2; exports.iotex = iotex2; exports.iotexTestnet = iotexTestnet2; exports.localhost = localhost2; exports.mainnet = mainnet2; exports.metis = metis2; exports.metisGoerli = metisGoerli2; exports.optimism = optimism2; exports.optimismGoerli = optimismGoerli2; exports.polygon = polygon2; exports.polygonMumbai = polygonMumbai2; exports.sepolia = sepolia2; exports.taraxa = taraxa2; exports.taraxaTestnet = taraxaTestnet2; exports.zkSync = zkSync2; exports.zkSyncTestnet = zkSyncTestnet2; | ||
exports.arbitrum = arbitrum2; exports.arbitrumGoerli = arbitrumGoerli2; exports.aurora = aurora2; exports.auroraGoerli = auroraGoerli; exports.avalanche = avalanche2; exports.avalancheFuji = avalancheFuji2; exports.bronos = bronos2; exports.bronosTestnet = bronosTestnet2; exports.bsc = bsc2; exports.bscTestnet = bscTestnet2; exports.canto = canto2; exports.celo = celo2; exports.celoAlfajores = celoAlfajores2; exports.crossbell = crossbell2; exports.defineChain = _chunkV5U5S7PQjs.defineChain; exports.evmos = evmos2; exports.evmosTestnet = evmosTestnet2; exports.fantom = fantom2; exports.fantomTestnet = fantomTestnet2; exports.filecoin = filecoin2; exports.filecoinTestnet = filecoinTestnet; exports.foundry = foundry2; exports.gnosis = gnosis2; exports.gnosisChiado = gnosisChiado2; exports.goerli = goerli2; exports.hardhat = hardhat2; exports.iotex = iotex2; exports.iotexTestnet = iotexTestnet2; exports.localhost = localhost2; exports.mainnet = mainnet2; exports.metis = metis2; exports.metisGoerli = metisGoerli2; exports.optimism = optimism2; exports.optimismGoerli = optimismGoerli2; exports.polygon = polygon2; exports.polygonMumbai = polygonMumbai2; exports.sepolia = sepolia2; exports.taraxa = taraxa2; exports.taraxaTestnet = taraxaTestnet2; exports.zkSync = zkSync2; exports.zkSyncTestnet = zkSyncTestnet2; | ||
//# sourceMappingURL=chains.js.map |
@@ -1,9 +0,9 @@ | ||
export { C as Client, a as ClientConfig, T as Transport, b as TransportConfig, c as createClient, d as createTransport } from '../createClient-5d316c7e.js'; | ||
export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from '../webSocket-b180e679.js'; | ||
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from '../createPublicClient-9d2b42e1.js'; | ||
export { T as TestClient, a as TestClientConfig, c as createTestClient } from '../createTestClient-79498dab.js'; | ||
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from '../createWalletClient-f69a5230.js'; | ||
import '../chain-32f56cfa.js'; | ||
export { C as Client, a as ClientConfig, T as Transport, b as TransportConfig, c as createClient, d as createTransport } from '../createClient-55a04188.js'; | ||
export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from '../webSocket-d2e7bd0e.js'; | ||
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from '../createPublicClient-3b27b282.js'; | ||
export { T as TestClient, a as TestClientConfig, c as createTestClient } from '../createTestClient-93f9eac6.js'; | ||
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from '../createWalletClient-c10df94d.js'; | ||
import '../chain-4b39613a.js'; | ||
import '@wagmi/chains'; | ||
import '../eip1193-6c485d63.js'; | ||
import '../eip1193-4c24765a.js'; | ||
import '../rpc-26932bae.js'; |
@@ -11,4 +11,4 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkKEHGSYDOjs = require('../chunk-KEHGSYDO.js'); | ||
require('../chunk-O2GYLJVD.js'); | ||
var _chunkPMPJGAHYjs = require('../chunk-PMPJGAHY.js'); | ||
require('../chunk-V5U5S7PQ.js'); | ||
@@ -24,3 +24,3 @@ | ||
exports.createClient = _chunkKEHGSYDOjs.createClient; exports.createPublicClient = _chunkKEHGSYDOjs.createPublicClient; exports.createTestClient = _chunkKEHGSYDOjs.createTestClient; exports.createTransport = _chunkKEHGSYDOjs.createTransport; exports.createWalletClient = _chunkKEHGSYDOjs.createWalletClient; exports.custom = _chunkKEHGSYDOjs.custom; exports.fallback = _chunkKEHGSYDOjs.fallback; exports.http = _chunkKEHGSYDOjs.http; exports.webSocket = _chunkKEHGSYDOjs.webSocket; | ||
exports.createClient = _chunkPMPJGAHYjs.createClient; exports.createPublicClient = _chunkPMPJGAHYjs.createPublicClient; exports.createTestClient = _chunkPMPJGAHYjs.createTestClient; exports.createTransport = _chunkPMPJGAHYjs.createTransport; exports.createWalletClient = _chunkPMPJGAHYjs.createWalletClient; exports.custom = _chunkPMPJGAHYjs.custom; exports.fallback = _chunkPMPJGAHYjs.fallback; exports.http = _chunkPMPJGAHYjs.http; exports.webSocket = _chunkPMPJGAHYjs.webSocket; | ||
//# sourceMappingURL=index.js.map |
@@ -1,113 +0,25 @@ | ||
import { F as Filter, C as CallArgs } from './watchPendingTransactions-3b722547.js'; | ||
export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DeployContractArgs, e as DeployContractResponse, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, f as GetBalanceResponse, g as GetBlockArgs, h as GetBlockNumberArgs, i as GetBlockNumberResponse, j as GetBlockResponse, k as GetBlockTransactionCountArgs, l as GetBlockTransactionCountResponse, m as GetBytecodeArgs, n as GetBytecodeResponse, o as GetFeeHistoryArgs, p as GetFeeHistoryResponse, q as GetFilterChangesArgs, r as GetFilterChangesResponse, s as GetFilterLogsArgs, t as GetFilterLogsResponse, u as GetGasPriceResponse, v as GetTransactionArgs, w as GetTransactionConfirmationsArgs, x as GetTransactionConfirmationsResponse, y as GetTransactionCountArgs, z as GetTransactionCountResponse, B as GetTransactionReceiptArgs, H as GetTransactionReceiptResponse, A as GetTransactionResponse, O as OnBlock, I as OnBlockNumber, J as OnBlockNumberResponse, K as OnBlockResponse, L as OnTransactions, M as OnTransactionsResponse, S as SimulateContractArgs, N as SimulateContractResponse, U as UninstallFilterArgs, P as UninstallFilterResponse, W as WaitForTransactionReceiptArgs, Q as WaitForTransactionReceiptResponse, R as WatchBlockNumberArgs, T as WatchBlocksArgs, V as WatchPendingTransactionsArgs, X as WriteContractArgs, Y as WriteContractResponse, Z as call, _ as createBlockFilter, $ as createPendingTransactionFilter, a0 as deployContract, a1 as estimateGas, a2 as getBalance, a3 as getBlock, a4 as getBlockNumber, a5 as getBlockTransactionCount, a6 as getBytecode, a7 as getChainId, a8 as getFeeHistory, a9 as getFilterChanges, aa as getFilterLogs, ab as getGasPrice, ac as getTransaction, ad as getTransactionConfirmations, ae as getTransactionCount, af as getTransactionReceipt, ag as simulateContract, ah as uninstallFilter, ai as waitForTransactionReceipt, aj as watchBlockNumber, ak as watchBlocks, al as watchPendingTransactions, am as writeContract } from './watchPendingTransactions-3b722547.js'; | ||
import { A as Address, B as BlockNumber, a as BlockTag, H as Hash, L as Log, b as Hex, c as ByteArray } from './chain-32f56cfa.js'; | ||
export { d as AccessList, A as Address, e as Block, f as BlockIdentifier, B as BlockNumber, a as BlockTag, c as ByteArray, F as FeeHistory, g as FeeValues, h as FeeValuesEIP1559, i as FeeValuesLegacy, E as FormattedTransaction, H as Hash, b as Hex, L as Log, R as RpcBlock, j as RpcBlockIdentifier, k as RpcBlockNumber, l as RpcFeeHistory, m as RpcFeeValues, n as RpcLog, o as RpcTransaction, p as RpcTransactionReceipt, q as RpcTransactionRequest, r as RpcUncle, x as Transaction, y as TransactionBase, z as TransactionEIP1559, C as TransactionEIP2930, D as TransactionLegacy, T as TransactionReceipt, s as TransactionRequest, t as TransactionRequestBase, u as TransactionRequestEIP1559, v as TransactionRequestEIP2930, w as TransactionRequestLegacy, U as Uncle, G as formatTransaction, I as transactionType } from './chain-32f56cfa.js'; | ||
import { E as EventDefinition, a as ExtractArgsFromEventDefinition, b as ExtractEventNameFromAbi, c as ExtractEventArgsFromAbi, d as ExtractFunctionNameFromAbi, e as ExtractArgsFromAbi, f as ExtractResultFromAbi } from './contract-9af4608b.js'; | ||
export { A as AbiItem, F as FormattedBlock, g as formatBlock } from './contract-9af4608b.js'; | ||
import { P as PublicClient } from './createPublicClient-9d2b42e1.js'; | ||
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from './createPublicClient-9d2b42e1.js'; | ||
import { F as Filter, C as CallArgs } from './watchPendingTransactions-a8688b26.js'; | ||
export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DeployContractArgs, e as DeployContractResponse, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, f as GetBalanceResponse, g as GetBlockArgs, h as GetBlockNumberArgs, i as GetBlockNumberResponse, j as GetBlockResponse, k as GetBlockTransactionCountArgs, l as GetBlockTransactionCountResponse, m as GetBytecodeArgs, n as GetBytecodeResponse, o as GetFeeHistoryArgs, p as GetFeeHistoryResponse, q as GetFilterChangesArgs, r as GetFilterChangesResponse, s as GetFilterLogsArgs, t as GetFilterLogsResponse, u as GetGasPriceResponse, v as GetTransactionArgs, w as GetTransactionConfirmationsArgs, x as GetTransactionConfirmationsResponse, y as GetTransactionCountArgs, z as GetTransactionCountResponse, B as GetTransactionReceiptArgs, H as GetTransactionReceiptResponse, A as GetTransactionResponse, O as OnBlock, I as OnBlockNumber, J as OnBlockNumberResponse, K as OnBlockResponse, L as OnTransactions, M as OnTransactionsResponse, S as SimulateContractArgs, N as SimulateContractResponse, U as UninstallFilterArgs, P as UninstallFilterResponse, W as WaitForTransactionReceiptArgs, Q as WaitForTransactionReceiptResponse, R as WatchBlockNumberArgs, T as WatchBlocksArgs, V as WatchPendingTransactionsArgs, X as WriteContractArgs, Y as WriteContractResponse, Z as call, _ as createBlockFilter, $ as createPendingTransactionFilter, a0 as deployContract, a1 as estimateGas, a2 as getBalance, a3 as getBlock, a4 as getBlockNumber, a5 as getBlockTransactionCount, a6 as getBytecode, a7 as getChainId, a8 as getFeeHistory, a9 as getFilterChanges, aa as getFilterLogs, ab as getGasPrice, ac as getTransaction, ad as getTransactionConfirmations, ae as getTransactionCount, af as getTransactionReceipt, ag as simulateContract, ah as uninstallFilter, ai as waitForTransactionReceipt, aj as watchBlockNumber, ak as watchBlocks, al as watchPendingTransactions, am as writeContract } from './watchPendingTransactions-a8688b26.js'; | ||
import { H as Hex, A as Address, a as Hash, B as ByteArray, b as BlockTag, c as BlockNumber, L as Log } from './chain-4b39613a.js'; | ||
export { d as AccessList, A as Address, e as Block, f as BlockIdentifier, c as BlockNumber, b as BlockTag, B as ByteArray, C as Chain, F as FeeHistory, g as FeeValues, h as FeeValuesEIP1559, i as FeeValuesLegacy, G as FormattedTransaction, a as Hash, H as Hex, L as Log, R as RpcBlock, j as RpcBlockIdentifier, k as RpcBlockNumber, l as RpcFeeHistory, m as RpcFeeValues, n as RpcLog, o as RpcTransaction, p as RpcTransactionReceipt, q as RpcTransactionRequest, r as RpcUncle, x as Transaction, y as TransactionBase, z as TransactionEIP1559, D as TransactionEIP2930, E as TransactionLegacy, T as TransactionReceipt, s as TransactionRequest, t as TransactionRequestBase, u as TransactionRequestEIP1559, v as TransactionRequestEIP2930, w as TransactionRequestLegacy, U as Uncle, I as formatTransaction, J as transactionType } from './chain-4b39613a.js'; | ||
import { E as EventDefinition, a as ExtractArgsFromEventDefinition, b as ExtractEventNameFromAbi, c as ExtractEventArgsFromAbi, C as ContractConfig, d as ExtractResultFromAbi } from './contract-74f34ac9.js'; | ||
export { A as AbiItem, C as ContractConfig, F as FormattedBlock, f as formatBlock } from './contract-74f34ac9.js'; | ||
import { P as PublicClient } from './createPublicClient-3b27b282.js'; | ||
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from './createPublicClient-3b27b282.js'; | ||
import { Abi } from 'abitype'; | ||
export { C as Client, a as ClientConfig, T as Transport, b as TransportConfig, c as createClient, d as createTransport } from './createClient-5d316c7e.js'; | ||
export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from './webSocket-b180e679.js'; | ||
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './createTestClient-79498dab.js'; | ||
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from './createWalletClient-f69a5230.js'; | ||
export { D as DropTransactionArgs, I as ImpersonateAccountArgs, a as IncreaseTimeArgs, M as MineArgs, R as ResetArgs, b as RevertArgs, S as SendUnsignedTransactionArgs, c as SendUnsignedTransactionResponse, d as SetBalanceArgs, e as SetBlockGasLimitArgs, j as SetBlockTimestampIntervalArgs, f as SetCodeArgs, g as SetCoinbaseArgs, h as SetIntervalMiningArgs, i as SetMinGasPriceArgs, l as SetNextBlockBaseFeePerGasArgs, k as SetNextBlockTimestampArgs, m as SetNonceArgs, n as SetStorageAtArgs, o as StopImpersonatingAccountArgs, p as dropTransaction, q as getAutomine, r as getTxpoolContent, s as getTxpoolStatus, t as impersonateAccount, u as increaseTime, v as inspectTxpool, w as mine, x as removeBlockTimestampInterval, y as reset, z as revert, A as sendUnsignedTransaction, B as setAutomine, C as setBalance, E as setBlockGasLimit, F as setBlockTimestampInterval, G as setCode, H as setCoinbase, J as setIntervalMining, K as setLoggingEnabled, L as setMinGasPrice, N as setNextBlockBaseFeePerGas, O as setNextBlockTimestamp, P as setNonce, Q as setStorageAt, T as snapshot, U as stopImpersonatingAccount } from './stopImpersonatingAccount-7781842a.js'; | ||
export { G as GetPermissionsResponse, R as RequestPermissionsResponse, S as SignMessageArgs, a as SignMessageResponse, b as SwitchChainArgs, W as WatchAssetArgs, c as WatchAssetResponse, d as addChain, g as getAccounts, e as getPermissions, r as requestAccounts, f as requestPermissions, s as signMessage, h as switchChain, w as watchAsset } from './watchAsset-afaad3c7.js'; | ||
export { S as SendTransactionArgs, a as SendTransactionResponse, s as sendTransaction } from './sendTransaction-1c8290a9.js'; | ||
export { D as DecodeAbiArgs, a as DecodeErrorResultArgs, b as DecodeFunctionDataArgs, c as DecodeFunctionResultArgs, d as DecodeFunctionResultResponse, E as EncodeAbiArgs, e as EncodeDeployDataArgs, f as EncodeErrorResultArgs, g as EncodeEventTopicsArgs, h as EncodeFunctionDataArgs, i as EncodeFunctionResultArgs, l as EncodeRlpResponse, G as GetContractAddressOptions, k as GetCreate2AddressOptions, j as GetCreateAddressOptions, o as boolToBytes, p as boolToHex, q as bytesToBigint, r as bytesToBool, m as bytesToHex, s as bytesToNumber, n as bytesToString, t as decodeAbi, u as decodeBytes, v as decodeErrorResult, w as decodeFunctionData, x as decodeFunctionResult, y as decodeHex, z as decodeRlp, A as encodeAbi, B as encodeBytes, C as encodeDeployData, F as encodeErrorResult, H as encodeEventTopics, I as encodeFunctionData, J as encodeFunctionResult, K as encodeHex, L as encodeRlp, M as etherUnits, U as formatEther, a9 as formatGwei, aa as formatUnit, N as getAddress, O as getContractAddress, Q as getCreate2Address, P as getCreateAddress, R as getEventSignature, S as getFunctionSignature, T as gweiUnits, Z as hexToBigInt, _ as hexToBool, $ as hexToBytes, ab as hexToNumber, a0 as hexToString, V as isAddress, W as isAddressEqual, X as isBytes, Y as isHex, a1 as keccak256, a2 as numberToBytes, ac as numberToHex, a3 as pad, a4 as padBytes, a5 as padHex, a6 as parseEther, a7 as parseGwei, a8 as parseUnit, ad as size, ae as slice, af as sliceBytes, ag as sliceHex, ah as stringToBytes, ai as stringToHex, aj as trim, ak as weiUnits } from './parseGwei-4308ad80.js'; | ||
export { F as FormattedTransactionRequest, f as formatTransactionRequest } from './transactionRequest-341b6ed2.js'; | ||
export { C as Client, a as ClientConfig, T as Transport, b as TransportConfig, c as createClient, d as createTransport } from './createClient-55a04188.js'; | ||
export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from './webSocket-d2e7bd0e.js'; | ||
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './createTestClient-93f9eac6.js'; | ||
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from './createWalletClient-c10df94d.js'; | ||
export { D as DropTransactionArgs, I as ImpersonateAccountArgs, a as IncreaseTimeArgs, M as MineArgs, R as ResetArgs, b as RevertArgs, S as SendUnsignedTransactionArgs, c as SendUnsignedTransactionResponse, d as SetBalanceArgs, e as SetBlockGasLimitArgs, j as SetBlockTimestampIntervalArgs, f as SetCodeArgs, g as SetCoinbaseArgs, h as SetIntervalMiningArgs, i as SetMinGasPriceArgs, l as SetNextBlockBaseFeePerGasArgs, k as SetNextBlockTimestampArgs, m as SetNonceArgs, n as SetStorageAtArgs, o as StopImpersonatingAccountArgs, p as dropTransaction, q as getAutomine, r as getTxpoolContent, s as getTxpoolStatus, t as impersonateAccount, u as increaseTime, v as inspectTxpool, w as mine, x as removeBlockTimestampInterval, y as reset, z as revert, A as sendUnsignedTransaction, B as setAutomine, C as setBalance, E as setBlockGasLimit, F as setBlockTimestampInterval, G as setCode, H as setCoinbase, J as setIntervalMining, K as setLoggingEnabled, L as setMinGasPrice, N as setNextBlockBaseFeePerGas, O as setNextBlockTimestamp, P as setNonce, Q as setStorageAt, T as snapshot, U as stopImpersonatingAccount } from './stopImpersonatingAccount-afb26486.js'; | ||
export { G as GetPermissionsResponse, R as RequestPermissionsResponse, S as SignMessageArgs, a as SignMessageResponse, b as SwitchChainArgs, W as WatchAssetArgs, c as WatchAssetResponse, d as addChain, g as getAccounts, e as getPermissions, r as requestAccounts, f as requestPermissions, s as signMessage, h as switchChain, w as watchAsset } from './watchAsset-efd3dd05.js'; | ||
export { S as SendTransactionArgs, a as SendTransactionResponse, s as sendTransaction } from './sendTransaction-f17a2389.js'; | ||
import { B as BaseError } from './parseGwei-b323fb0a.js'; | ||
export { B as BaseError, C as ContractFunctionExecutionError, a as ContractFunctionRevertedError, b as ContractFunctionZeroDataError, D as DecodeAbiArgs, c as DecodeErrorResultArgs, d as DecodeFunctionDataArgs, e as DecodeFunctionResultArgs, f as DecodeFunctionResultResponse, E as EncodeAbiArgs, g as EncodeDeployDataArgs, h as EncodeErrorResultArgs, i as EncodeEventTopicsArgs, j as EncodeFunctionDataArgs, k as EncodeFunctionResultArgs, o as EncodeRlpResponse, n as GetAbiItemArgs, G as GetContractAddressOptions, m as GetCreate2AddressOptions, l as GetCreateAddressOptions, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, p as bytesToHex, v as bytesToNumber, q as bytesToString, w as decodeAbi, x as decodeBytes, y as decodeErrorResult, z as decodeFunctionData, A as decodeFunctionResult, F as decodeHex, H as decodeRlp, I as encodeAbi, J as encodeBytes, K as encodeDeployData, L as encodeErrorResult, M as encodeEventTopics, N as encodeFunctionData, O as encodeFunctionResult, P as encodeHex, Q as encodeRlp, R as etherUnits, Z as formatEther, ae as formatGwei, af as formatUnit, S as getAddress, T as getContractAddress, V as getCreate2Address, U as getCreateAddress, W as getEventSignature, X as getFunctionSignature, Y as gweiUnits, a2 as hexToBigInt, a3 as hexToBool, a4 as hexToBytes, ag as hexToNumber, a5 as hexToString, _ as isAddress, $ as isAddressEqual, a0 as isBytes, a1 as isHex, a6 as keccak256, a7 as numberToBytes, ah as numberToHex, a8 as pad, a9 as padBytes, aa as padHex, ab as parseEther, ac as parseGwei, ad as parseUnit, ai as size, aj as slice, ak as sliceBytes, al as sliceHex, am as stringToBytes, an as stringToHex, ao as trim, ap as weiUnits } from './parseGwei-b323fb0a.js'; | ||
export { F as FormattedTransactionRequest, f as formatTransactionRequest } from './transactionRequest-93e9f001.js'; | ||
import '@wagmi/chains'; | ||
import './eip1193-6c485d63.js'; | ||
import './eip1193-4c24765a.js'; | ||
import './rpc-26932bae.js'; | ||
import 'abitype/dist/abi-78346466'; | ||
type EventFilterArgs<TEventDefinition extends EventDefinition> = ExtractArgsFromEventDefinition<TEventDefinition>; | ||
type CreateEventFilterArgs<TEventDefinition extends EventDefinition> = { | ||
address?: Address | Address[]; | ||
fromBlock?: BlockNumber | BlockTag; | ||
toBlock?: BlockNumber | BlockTag; | ||
} & ({ | ||
event: TEventDefinition; | ||
args?: EventFilterArgs<TEventDefinition>; | ||
} | { | ||
event?: never; | ||
args?: never; | ||
}); | ||
type CreateEventFilterResponse = Filter<'event'>; | ||
declare function createEventFilter<TEventDefinition extends EventDefinition>(client: PublicClient, { address, event, args, fromBlock, toBlock, }?: CreateEventFilterArgs<TEventDefinition>): Promise<CreateEventFilterResponse>; | ||
type CreateContractEventFilterArgs<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = any> = { | ||
address?: Address | Address[]; | ||
abi: TAbi; | ||
eventName: ExtractEventNameFromAbi<TAbi, TEventName>; | ||
fromBlock?: BlockNumber | BlockTag; | ||
toBlock?: BlockNumber | BlockTag; | ||
} & ExtractEventArgsFromAbi<TAbi, TEventName>; | ||
type CreateContractEventFilterResponse = Filter<'event'>; | ||
declare function createContractEventFilter<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = any>(client: PublicClient, { address, abi, args, eventName, fromBlock, toBlock, }: CreateContractEventFilterArgs<TAbi, TEventName>): Promise<CreateContractEventFilterResponse>; | ||
type GetLogsArgs<TEventDefinition extends EventDefinition> = { | ||
/** Address or list of addresses from which logs originated */ | ||
address?: Address | Address[]; | ||
} & ({ | ||
event: TEventDefinition; | ||
args?: EventFilterArgs<TEventDefinition>; | ||
} | { | ||
event?: never; | ||
args?: never; | ||
}) & ({ | ||
/** Block number or tag after which to include logs */ | ||
fromBlock?: BlockNumber<bigint> | BlockTag; | ||
/** Block number or tag before which to include logs */ | ||
toBlock?: BlockNumber<bigint> | BlockTag; | ||
blockHash?: never; | ||
} | { | ||
fromBlock?: never; | ||
toBlock?: never; | ||
/** Hash of block to include logs from */ | ||
blockHash?: Hash; | ||
}); | ||
type GetLogsResponse = Log[]; | ||
/** | ||
* @description Returns a collection of event logs. | ||
*/ | ||
declare function getLogs<TEventDefinition extends EventDefinition>(client: PublicClient, { address, blockHash, fromBlock, toBlock, event, args, }?: GetLogsArgs<TEventDefinition>): Promise<GetLogsResponse>; | ||
type GetStorageAtArgs = { | ||
address: Address; | ||
slot: Hex; | ||
} & ({ | ||
blockNumber?: never; | ||
blockTag?: BlockTag; | ||
} | { | ||
blockNumber?: bigint; | ||
blockTag?: never; | ||
}); | ||
type GetStorageAtResponse = Hex | undefined; | ||
declare function getStorageAt(client: PublicClient, { address, blockNumber, blockTag, slot }: GetStorageAtArgs): Promise<GetStorageAtResponse>; | ||
type ReadContractArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = Omit<CallArgs, 'accessList' | 'chain' | 'from' | 'gas' | 'gasPrice' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'nonce' | 'to' | 'data' | 'value'> & { | ||
address: Address; | ||
abi: TAbi; | ||
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName, 'pure' | 'view'>; | ||
} & ExtractArgsFromAbi<TAbi, TFunctionName>; | ||
type ReadContractResponse<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ExtractResultFromAbi<TAbi, TFunctionName>; | ||
declare function readContract<TAbi extends Abi = Abi, TFunctionName extends string = any>(client: PublicClient, { abi, address, args, functionName, ...callRequest }: ReadContractArgs<TAbi, TFunctionName>): Promise<ReadContractResponse<TAbi, TFunctionName>>; | ||
type BaseErrorArgs = { | ||
docsPath?: string; | ||
} & ({ | ||
cause?: never; | ||
details?: string; | ||
} | { | ||
cause: BaseError | Error; | ||
details?: never; | ||
}); | ||
declare class BaseError extends Error { | ||
humanMessage: string; | ||
details: string; | ||
docsPath?: string; | ||
name: string; | ||
constructor(humanMessage: string, args?: BaseErrorArgs); | ||
} | ||
declare class AbiConstructorNotFoundError extends BaseError { | ||
@@ -317,5 +229,5 @@ name: string; | ||
declare class RequestError extends BaseError { | ||
constructor(err: Error, { docsPath, humanMessage }: { | ||
constructor(err: Error, { docsPath, shortMessage }: { | ||
docsPath?: string; | ||
humanMessage: string; | ||
shortMessage: string; | ||
}); | ||
@@ -325,5 +237,5 @@ } | ||
code: number; | ||
constructor(err: RpcError, { docsPath, humanMessage }: { | ||
constructor(err: RpcError, { docsPath, shortMessage }: { | ||
docsPath?: string; | ||
humanMessage: string; | ||
shortMessage: string; | ||
}); | ||
@@ -427,2 +339,102 @@ } | ||
export { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, AbiDecodingDataSizeInvalidError, AbiEncodingArrayLengthMismatchError, AbiEncodingLengthMismatchError, AbiErrorInputsNotFoundError, AbiErrorNotFoundError, AbiErrorSignatureNotFoundError, AbiEventNotFoundError, AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, AbiFunctionSignatureNotFoundError, BaseError, BlockNotFoundError, CreateContractEventFilterArgs, CreateContractEventFilterResponse, CreateEventFilterArgs, CreateEventFilterResponse, DataLengthTooLongError, DataLengthTooShortError, FilterTypeNotSupportedError, GetLogsArgs, GetLogsResponse, GetStorageAtArgs, GetStorageAtResponse, HttpRequestError, InternalRpcError, InvalidAbiDecodingTypeError, InvalidAbiEncodingTypeError, InvalidAddressError, InvalidArrayError, InvalidBytesBooleanError, InvalidDefinitionTypeError, InvalidGasArgumentsError, InvalidHexBooleanError, InvalidHexValueError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, OffsetOutOfBoundsError, ParseRpcError, ReadContractArgs, ReadContractResponse, RequestError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, RpcError, RpcRequestError, SizeExceedsPaddingSizeError, TimeoutError, TransactionNotFoundError, TransactionReceiptNotFoundError, TransactionRejectedRpcError, UnknownRpcError, UrlRequiredError, WaitForTransactionReceiptTimeoutError, WebSocketRequestError, createContractEventFilter, createEventFilter, getLogs, getStorageAt, readContract }; | ||
type EventFilterArgs<TEventDefinition extends EventDefinition> = ExtractArgsFromEventDefinition<TEventDefinition>; | ||
type CreateEventFilterArgs<TEventDefinition extends EventDefinition> = { | ||
address?: Address | Address[]; | ||
fromBlock?: BlockNumber | BlockTag; | ||
toBlock?: BlockNumber | BlockTag; | ||
} & ({ | ||
event: TEventDefinition; | ||
args?: EventFilterArgs<TEventDefinition>; | ||
} | { | ||
event?: never; | ||
args?: never; | ||
}); | ||
type CreateEventFilterResponse = Filter<'event'>; | ||
declare function createEventFilter<TEventDefinition extends EventDefinition>(client: PublicClient, { address, event, args, fromBlock, toBlock, }?: CreateEventFilterArgs<TEventDefinition>): Promise<CreateEventFilterResponse>; | ||
type CreateContractEventFilterArgs<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = any> = { | ||
address?: Address | Address[]; | ||
abi: TAbi; | ||
eventName: ExtractEventNameFromAbi<TAbi, TEventName>; | ||
fromBlock?: BlockNumber | BlockTag; | ||
toBlock?: BlockNumber | BlockTag; | ||
} & ExtractEventArgsFromAbi<TAbi, TEventName>; | ||
type CreateContractEventFilterResponse = Filter<'event'>; | ||
declare function createContractEventFilter<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = any>(client: PublicClient, { address, abi, args, eventName, fromBlock, toBlock, }: CreateContractEventFilterArgs<TAbi, TEventName>): Promise<CreateContractEventFilterResponse>; | ||
type GetLogsArgs<TEventDefinition extends EventDefinition> = { | ||
/** Address or list of addresses from which logs originated */ | ||
address?: Address | Address[]; | ||
} & ({ | ||
event: TEventDefinition; | ||
args?: EventFilterArgs<TEventDefinition>; | ||
} | { | ||
event?: never; | ||
args?: never; | ||
}) & ({ | ||
/** Block number or tag after which to include logs */ | ||
fromBlock?: BlockNumber<bigint> | BlockTag; | ||
/** Block number or tag before which to include logs */ | ||
toBlock?: BlockNumber<bigint> | BlockTag; | ||
blockHash?: never; | ||
} | { | ||
fromBlock?: never; | ||
toBlock?: never; | ||
/** Hash of block to include logs from */ | ||
blockHash?: Hash; | ||
}); | ||
type GetLogsResponse = Log[]; | ||
/** | ||
* @description Returns a collection of event logs. | ||
*/ | ||
declare function getLogs<TEventDefinition extends EventDefinition>(client: PublicClient, { address, blockHash, fromBlock, toBlock, event, args, }?: GetLogsArgs<TEventDefinition>): Promise<GetLogsResponse>; | ||
type GetStorageAtArgs = { | ||
address: Address; | ||
slot: Hex; | ||
} & ({ | ||
blockNumber?: never; | ||
blockTag?: BlockTag; | ||
} | { | ||
blockNumber?: bigint; | ||
blockTag?: never; | ||
}); | ||
type GetStorageAtResponse = Hex | undefined; | ||
declare function getStorageAt(client: PublicClient, { address, blockNumber, blockTag, slot }: GetStorageAtArgs): Promise<GetStorageAtResponse>; | ||
type ReadContractArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Pick<CallArgs, 'blockNumber' | 'blockTag'> & ContractConfig<TAbi, TFunctionName, 'view' | 'pure'>; | ||
type ReadContractResponse<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ExtractResultFromAbi<TAbi, TFunctionName>; | ||
declare function readContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: PublicClient, { abi, address, args, functionName, ...callRequest }: ReadContractArgs<TAbi, TFunctionName>): Promise<ReadContractResponse<TAbi, TFunctionName>>; | ||
declare const multicall3Abi: readonly [{ | ||
readonly inputs: readonly [{ | ||
readonly components: readonly [{ | ||
readonly name: "target"; | ||
readonly type: "address"; | ||
}, { | ||
readonly name: "allowFailure"; | ||
readonly type: "bool"; | ||
}, { | ||
readonly name: "callData"; | ||
readonly type: "bytes"; | ||
}]; | ||
readonly name: "calls"; | ||
readonly type: "tuple[]"; | ||
}]; | ||
readonly name: "aggregate3"; | ||
readonly outputs: readonly [{ | ||
readonly components: readonly [{ | ||
readonly name: "success"; | ||
readonly type: "bool"; | ||
}, { | ||
readonly name: "returnData"; | ||
readonly type: "bytes"; | ||
}]; | ||
readonly name: "returnData"; | ||
readonly type: "tuple[]"; | ||
}]; | ||
readonly stateMutability: "view"; | ||
readonly type: "function"; | ||
}]; | ||
export { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, AbiDecodingDataSizeInvalidError, AbiEncodingArrayLengthMismatchError, AbiEncodingLengthMismatchError, AbiErrorInputsNotFoundError, AbiErrorNotFoundError, AbiErrorSignatureNotFoundError, AbiEventNotFoundError, AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, AbiFunctionSignatureNotFoundError, BlockNotFoundError, CreateContractEventFilterArgs, CreateContractEventFilterResponse, CreateEventFilterArgs, CreateEventFilterResponse, DataLengthTooLongError, DataLengthTooShortError, FilterTypeNotSupportedError, GetLogsArgs, GetLogsResponse, GetStorageAtArgs, GetStorageAtResponse, HttpRequestError, InternalRpcError, InvalidAbiDecodingTypeError, InvalidAbiEncodingTypeError, InvalidAddressError, InvalidArrayError, InvalidBytesBooleanError, InvalidDefinitionTypeError, InvalidGasArgumentsError, InvalidHexBooleanError, InvalidHexValueError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, OffsetOutOfBoundsError, ParseRpcError, ReadContractArgs, ReadContractResponse, RequestError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, RpcError, RpcRequestError, SizeExceedsPaddingSizeError, TimeoutError, TransactionNotFoundError, TransactionReceiptNotFoundError, TransactionRejectedRpcError, UnknownRpcError, UrlRequiredError, WaitForTransactionReceiptTimeoutError, WebSocketRequestError, createContractEventFilter, createEventFilter, getLogs, getStorageAt, multicall3Abi, readContract }; |
@@ -11,3 +11,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkKEHGSYDOjs = require('./chunk-KEHGSYDO.js'); | ||
var _chunkPMPJGAHYjs = require('./chunk-PMPJGAHY.js'); | ||
@@ -44,3 +44,3 @@ | ||
var _chunkKZMJR27Bjs = require('./chunk-KZMJR27B.js'); | ||
var _chunkMVD4Y3AEjs = require('./chunk-MVD4Y3AE.js'); | ||
@@ -74,3 +74,3 @@ | ||
var _chunkW7BWWAC4js = require('./chunk-W7BWWAC4.js'); | ||
var _chunkQA3IE5DUjs = require('./chunk-QA3IE5DU.js'); | ||
@@ -87,3 +87,3 @@ | ||
var _chunkEC3NUIJEjs = require('./chunk-EC3NUIJE.js'); | ||
var _chunkS77NLWHOjs = require('./chunk-S77NLWHO.js'); | ||
@@ -205,3 +205,2 @@ | ||
var _chunkO2GYLJVDjs = require('./chunk-O2GYLJVD.js'); | ||
@@ -211,2 +210,3 @@ | ||
var _chunkV5U5S7PQjs = require('./chunk-V5U5S7PQ.js'); | ||
@@ -400,3 +400,11 @@ | ||
exports.AbiConstructorNotFoundError = _chunkO2GYLJVDjs.AbiConstructorNotFoundError; exports.AbiConstructorParamsNotFoundError = _chunkO2GYLJVDjs.AbiConstructorParamsNotFoundError; exports.AbiDecodingDataSizeInvalidError = _chunkO2GYLJVDjs.AbiDecodingDataSizeInvalidError; exports.AbiEncodingArrayLengthMismatchError = _chunkO2GYLJVDjs.AbiEncodingArrayLengthMismatchError; exports.AbiEncodingLengthMismatchError = _chunkO2GYLJVDjs.AbiEncodingLengthMismatchError; exports.AbiErrorInputsNotFoundError = _chunkO2GYLJVDjs.AbiErrorInputsNotFoundError; exports.AbiErrorNotFoundError = _chunkO2GYLJVDjs.AbiErrorNotFoundError; exports.AbiErrorSignatureNotFoundError = _chunkO2GYLJVDjs.AbiErrorSignatureNotFoundError; exports.AbiEventNotFoundError = _chunkO2GYLJVDjs.AbiEventNotFoundError; exports.AbiFunctionNotFoundError = _chunkO2GYLJVDjs.AbiFunctionNotFoundError; exports.AbiFunctionOutputsNotFoundError = _chunkO2GYLJVDjs.AbiFunctionOutputsNotFoundError; exports.AbiFunctionSignatureNotFoundError = _chunkO2GYLJVDjs.AbiFunctionSignatureNotFoundError; exports.BaseError = _chunkO2GYLJVDjs.BaseError; exports.BlockNotFoundError = _chunkO2GYLJVDjs.BlockNotFoundError; exports.DataLengthTooLongError = _chunkO2GYLJVDjs.DataLengthTooLongError; exports.DataLengthTooShortError = _chunkO2GYLJVDjs.DataLengthTooShortError; exports.FilterTypeNotSupportedError = _chunkO2GYLJVDjs.FilterTypeNotSupportedError; exports.HttpRequestError = _chunkO2GYLJVDjs.HttpRequestError; exports.InternalRpcError = _chunkO2GYLJVDjs.InternalRpcError; exports.InvalidAbiDecodingTypeError = _chunkO2GYLJVDjs.InvalidAbiDecodingTypeError; exports.InvalidAbiEncodingTypeError = _chunkO2GYLJVDjs.InvalidAbiEncodingTypeError; exports.InvalidAddressError = _chunkO2GYLJVDjs.InvalidAddressError; exports.InvalidArrayError = _chunkO2GYLJVDjs.InvalidArrayError; exports.InvalidBytesBooleanError = _chunkO2GYLJVDjs.InvalidBytesBooleanError; exports.InvalidDefinitionTypeError = _chunkO2GYLJVDjs.InvalidDefinitionTypeError; exports.InvalidGasArgumentsError = _chunkO2GYLJVDjs.InvalidGasArgumentsError; exports.InvalidHexBooleanError = _chunkO2GYLJVDjs.InvalidHexBooleanError; exports.InvalidHexValueError = _chunkO2GYLJVDjs.InvalidHexValueError; exports.InvalidInputRpcError = _chunkO2GYLJVDjs.InvalidInputRpcError; exports.InvalidParamsRpcError = _chunkO2GYLJVDjs.InvalidParamsRpcError; exports.InvalidRequestRpcError = _chunkO2GYLJVDjs.InvalidRequestRpcError; exports.JsonRpcVersionUnsupportedError = _chunkO2GYLJVDjs.JsonRpcVersionUnsupportedError; exports.LimitExceededRpcError = _chunkO2GYLJVDjs.LimitExceededRpcError; exports.MethodNotFoundRpcError = _chunkO2GYLJVDjs.MethodNotFoundRpcError; exports.MethodNotSupportedRpcError = _chunkO2GYLJVDjs.MethodNotSupportedRpcError; exports.OffsetOutOfBoundsError = _chunkO2GYLJVDjs.OffsetOutOfBoundsError; exports.ParseRpcError = _chunkO2GYLJVDjs.ParseRpcError; exports.RequestError = _chunkO2GYLJVDjs.RequestError; exports.ResourceNotFoundRpcError = _chunkO2GYLJVDjs.ResourceNotFoundRpcError; exports.ResourceUnavailableRpcError = _chunkO2GYLJVDjs.ResourceUnavailableRpcError; exports.RpcError = _chunkO2GYLJVDjs.RpcError; exports.RpcRequestError = _chunkO2GYLJVDjs.RpcRequestError; exports.SizeExceedsPaddingSizeError = _chunkO2GYLJVDjs.SizeExceedsPaddingSizeError; exports.TimeoutError = _chunkO2GYLJVDjs.TimeoutError; exports.TransactionNotFoundError = _chunkO2GYLJVDjs.TransactionNotFoundError; exports.TransactionReceiptNotFoundError = _chunkO2GYLJVDjs.TransactionReceiptNotFoundError; exports.TransactionRejectedRpcError = _chunkO2GYLJVDjs.TransactionRejectedRpcError; exports.UnknownRpcError = _chunkO2GYLJVDjs.UnknownRpcError; exports.UrlRequiredError = _chunkO2GYLJVDjs.UrlRequiredError; exports.WaitForTransactionReceiptTimeoutError = _chunkO2GYLJVDjs.WaitForTransactionReceiptTimeoutError; exports.WebSocketRequestError = _chunkO2GYLJVDjs.WebSocketRequestError; exports.addChain = _chunkEC3NUIJEjs.addChain; exports.boolToBytes = _chunkO2GYLJVDjs.boolToBytes; exports.boolToHex = _chunkO2GYLJVDjs.boolToHex; exports.bytesToBigint = _chunkO2GYLJVDjs.bytesToBigint; exports.bytesToBool = _chunkO2GYLJVDjs.bytesToBool; exports.bytesToHex = _chunkO2GYLJVDjs.bytesToHex; exports.bytesToNumber = _chunkO2GYLJVDjs.bytesToNumber; exports.bytesToString = _chunkO2GYLJVDjs.bytesToString; exports.call = _chunkKZMJR27Bjs.call; exports.createBlockFilter = _chunkKZMJR27Bjs.createBlockFilter; exports.createClient = _chunkKEHGSYDOjs.createClient; exports.createContractEventFilter = _chunkKZMJR27Bjs.createContractEventFilter; exports.createEventFilter = _chunkKZMJR27Bjs.createEventFilter; exports.createPendingTransactionFilter = _chunkKZMJR27Bjs.createPendingTransactionFilter; exports.createPublicClient = _chunkKEHGSYDOjs.createPublicClient; exports.createTestClient = _chunkKEHGSYDOjs.createTestClient; exports.createTransport = _chunkKEHGSYDOjs.createTransport; exports.createWalletClient = _chunkKEHGSYDOjs.createWalletClient; exports.custom = _chunkKEHGSYDOjs.custom; exports.decodeAbi = _chunkO2GYLJVDjs.decodeAbi; exports.decodeBytes = _chunkO2GYLJVDjs.decodeBytes; exports.decodeErrorResult = _chunkO2GYLJVDjs.decodeErrorResult; exports.decodeFunctionData = _chunkO2GYLJVDjs.decodeFunctionData; exports.decodeFunctionResult = _chunkO2GYLJVDjs.decodeFunctionResult; exports.decodeHex = _chunkO2GYLJVDjs.decodeHex; exports.decodeRlp = _chunkO2GYLJVDjs.decodeRlp; exports.deployContract = _chunkKZMJR27Bjs.deployContract; exports.dropTransaction = _chunkW7BWWAC4js.dropTransaction; exports.encodeAbi = _chunkO2GYLJVDjs.encodeAbi; exports.encodeBytes = _chunkO2GYLJVDjs.encodeBytes; exports.encodeDeployData = _chunkO2GYLJVDjs.encodeDeployData; exports.encodeErrorResult = _chunkO2GYLJVDjs.encodeErrorResult; exports.encodeEventTopics = _chunkO2GYLJVDjs.encodeEventTopics; exports.encodeFunctionData = _chunkO2GYLJVDjs.encodeFunctionData; exports.encodeFunctionResult = _chunkO2GYLJVDjs.encodeFunctionResult; exports.encodeHex = _chunkO2GYLJVDjs.encodeHex; exports.encodeRlp = _chunkO2GYLJVDjs.encodeRlp; exports.estimateGas = _chunkKZMJR27Bjs.estimateGas; exports.etherUnits = _chunkO2GYLJVDjs.etherUnits; exports.fallback = _chunkKEHGSYDOjs.fallback; exports.formatBlock = _chunkO2GYLJVDjs.formatBlock; exports.formatEther = _chunkO2GYLJVDjs.formatEther; exports.formatGwei = _chunkO2GYLJVDjs.formatGwei; exports.formatTransaction = _chunkO2GYLJVDjs.formatTransaction; exports.formatTransactionRequest = _chunkO2GYLJVDjs.formatTransactionRequest; exports.formatUnit = _chunkO2GYLJVDjs.formatUnit; exports.getAccounts = _chunkEC3NUIJEjs.getAccounts; exports.getAddress = _chunkO2GYLJVDjs.getAddress; exports.getAutomine = _chunkW7BWWAC4js.getAutomine; exports.getBalance = _chunkKZMJR27Bjs.getBalance; exports.getBlock = _chunkKZMJR27Bjs.getBlock; exports.getBlockNumber = _chunkKZMJR27Bjs.getBlockNumber; exports.getBlockTransactionCount = _chunkKZMJR27Bjs.getBlockTransactionCount; exports.getBytecode = _chunkKZMJR27Bjs.getBytecode; exports.getChainId = _chunkKZMJR27Bjs.getChainId; exports.getContractAddress = _chunkO2GYLJVDjs.getContractAddress; exports.getCreate2Address = _chunkO2GYLJVDjs.getCreate2Address; exports.getCreateAddress = _chunkO2GYLJVDjs.getCreateAddress; exports.getEventSignature = _chunkO2GYLJVDjs.getEventSignature; exports.getFeeHistory = _chunkKZMJR27Bjs.getFeeHistory; exports.getFilterChanges = _chunkKZMJR27Bjs.getFilterChanges; exports.getFilterLogs = _chunkKZMJR27Bjs.getFilterLogs; exports.getFunctionSignature = _chunkO2GYLJVDjs.getFunctionSignature; exports.getGasPrice = _chunkKZMJR27Bjs.getGasPrice; exports.getLogs = _chunkKZMJR27Bjs.getLogs; exports.getPermissions = _chunkEC3NUIJEjs.getPermissions; exports.getStorageAt = _chunkKZMJR27Bjs.getStorageAt; exports.getTransaction = _chunkKZMJR27Bjs.getTransaction; exports.getTransactionConfirmations = _chunkKZMJR27Bjs.getTransactionConfirmations; exports.getTransactionCount = _chunkKZMJR27Bjs.getTransactionCount; exports.getTransactionReceipt = _chunkKZMJR27Bjs.getTransactionReceipt; exports.getTxpoolContent = _chunkW7BWWAC4js.getTxpoolContent; exports.getTxpoolStatus = _chunkW7BWWAC4js.getTxpoolStatus; exports.gweiUnits = _chunkO2GYLJVDjs.gweiUnits; exports.hexToBigInt = _chunkO2GYLJVDjs.hexToBigInt; exports.hexToBool = _chunkO2GYLJVDjs.hexToBool; exports.hexToBytes = _chunkO2GYLJVDjs.hexToBytes; exports.hexToNumber = _chunkO2GYLJVDjs.hexToNumber; exports.hexToString = _chunkO2GYLJVDjs.hexToString; exports.http = _chunkKEHGSYDOjs.http; exports.impersonateAccount = _chunkW7BWWAC4js.impersonateAccount; exports.increaseTime = _chunkW7BWWAC4js.increaseTime; exports.inspectTxpool = _chunkW7BWWAC4js.inspectTxpool; exports.isAddress = _chunkO2GYLJVDjs.isAddress; exports.isAddressEqual = _chunkO2GYLJVDjs.isAddressEqual; exports.isBytes = _chunkO2GYLJVDjs.isBytes; exports.isHex = _chunkO2GYLJVDjs.isHex; exports.keccak256 = _chunkO2GYLJVDjs.keccak256; exports.mine = _chunkW7BWWAC4js.mine; exports.numberToBytes = _chunkO2GYLJVDjs.numberToBytes; exports.numberToHex = _chunkO2GYLJVDjs.numberToHex; exports.pad = _chunkO2GYLJVDjs.pad; exports.padBytes = _chunkO2GYLJVDjs.padBytes; exports.padHex = _chunkO2GYLJVDjs.padHex; exports.parseEther = _chunkO2GYLJVDjs.parseEther; exports.parseGwei = _chunkO2GYLJVDjs.parseGwei; exports.parseUnit = _chunkO2GYLJVDjs.parseUnit; exports.readContract = _chunkKZMJR27Bjs.readContract; exports.removeBlockTimestampInterval = _chunkW7BWWAC4js.removeBlockTimestampInterval; exports.requestAccounts = _chunkEC3NUIJEjs.requestAccounts; exports.requestPermissions = _chunkEC3NUIJEjs.requestPermissions; exports.reset = _chunkW7BWWAC4js.reset; exports.revert = _chunkW7BWWAC4js.revert; exports.sendTransaction = _chunkEC3NUIJEjs.sendTransaction; exports.sendUnsignedTransaction = _chunkW7BWWAC4js.sendUnsignedTransaction; exports.setAutomine = _chunkW7BWWAC4js.setAutomine; exports.setBalance = _chunkW7BWWAC4js.setBalance; exports.setBlockGasLimit = _chunkW7BWWAC4js.setBlockGasLimit; exports.setBlockTimestampInterval = _chunkW7BWWAC4js.setBlockTimestampInterval; exports.setCode = _chunkW7BWWAC4js.setCode; exports.setCoinbase = _chunkW7BWWAC4js.setCoinbase; exports.setIntervalMining = _chunkW7BWWAC4js.setIntervalMining; exports.setLoggingEnabled = _chunkW7BWWAC4js.setLoggingEnabled; exports.setMinGasPrice = _chunkW7BWWAC4js.setMinGasPrice; exports.setNextBlockBaseFeePerGas = _chunkW7BWWAC4js.setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = _chunkW7BWWAC4js.setNextBlockTimestamp; exports.setNonce = _chunkW7BWWAC4js.setNonce; exports.setStorageAt = _chunkW7BWWAC4js.setStorageAt; exports.signMessage = _chunkEC3NUIJEjs.signMessage; exports.simulateContract = _chunkKZMJR27Bjs.simulateContract; exports.size = _chunkO2GYLJVDjs.size; exports.slice = _chunkO2GYLJVDjs.slice; exports.sliceBytes = _chunkO2GYLJVDjs.sliceBytes; exports.sliceHex = _chunkO2GYLJVDjs.sliceHex; exports.snapshot = _chunkW7BWWAC4js.snapshot; exports.stopImpersonatingAccount = _chunkW7BWWAC4js.stopImpersonatingAccount; exports.stringToBytes = _chunkO2GYLJVDjs.stringToBytes; exports.stringToHex = _chunkO2GYLJVDjs.stringToHex; exports.switchChain = _chunkEC3NUIJEjs.switchChain; exports.transactionType = _chunkO2GYLJVDjs.transactionType; exports.trim = _chunkO2GYLJVDjs.trim; exports.uninstallFilter = _chunkKZMJR27Bjs.uninstallFilter; exports.waitForTransactionReceipt = _chunkKZMJR27Bjs.waitForTransactionReceipt; exports.watchAsset = _chunkEC3NUIJEjs.watchAsset; exports.watchBlockNumber = _chunkKZMJR27Bjs.watchBlockNumber; exports.watchBlocks = _chunkKZMJR27Bjs.watchBlocks; exports.watchPendingTransactions = _chunkKZMJR27Bjs.watchPendingTransactions; exports.webSocket = _chunkKEHGSYDOjs.webSocket; exports.weiUnits = _chunkO2GYLJVDjs.weiUnits; exports.writeContract = _chunkEC3NUIJEjs.writeContract; | ||
exports.AbiConstructorNotFoundError = _chunkV5U5S7PQjs.AbiConstructorNotFoundError; exports.AbiConstructorParamsNotFoundError = _chunkV5U5S7PQjs.AbiConstructorParamsNotFoundError; exports.AbiDecodingDataSizeInvalidError = _chunkV5U5S7PQjs.AbiDecodingDataSizeInvalidError; exports.AbiEncodingArrayLengthMismatchError = _chunkV5U5S7PQjs.AbiEncodingArrayLengthMismatchError; exports.AbiEncodingLengthMismatchError = _chunkV5U5S7PQjs.AbiEncodingLengthMismatchError; exports.AbiErrorInputsNotFoundError = _chunkV5U5S7PQjs.AbiErrorInputsNotFoundError; exports.AbiErrorNotFoundError = _chunkV5U5S7PQjs.AbiErrorNotFoundError; exports.AbiErrorSignatureNotFoundError = _chunkV5U5S7PQjs.AbiErrorSignatureNotFoundError; exports.AbiEventNotFoundError = _chunkV5U5S7PQjs.AbiEventNotFoundError; exports.AbiFunctionNotFoundError = _chunkV5U5S7PQjs.AbiFunctionNotFoundError; exports.AbiFunctionOutputsNotFoundError = _chunkV5U5S7PQjs.AbiFunctionOutputsNotFoundError; exports.AbiFunctionSignatureNotFoundError = _chunkV5U5S7PQjs.AbiFunctionSignatureNotFoundError; exports.BaseError = _chunkV5U5S7PQjs.BaseError; exports.BlockNotFoundError = _chunkV5U5S7PQjs.BlockNotFoundError; exports.ContractFunctionExecutionError = _chunkV5U5S7PQjs.ContractFunctionExecutionError; exports.ContractFunctionRevertedError = _chunkV5U5S7PQjs.ContractFunctionRevertedError; exports.ContractFunctionZeroDataError = _chunkV5U5S7PQjs.ContractFunctionZeroDataError; exports.DataLengthTooLongError = _chunkV5U5S7PQjs.DataLengthTooLongError; exports.DataLengthTooShortError = _chunkV5U5S7PQjs.DataLengthTooShortError; exports.FilterTypeNotSupportedError = _chunkV5U5S7PQjs.FilterTypeNotSupportedError; exports.HttpRequestError = _chunkV5U5S7PQjs.HttpRequestError; exports.InternalRpcError = _chunkV5U5S7PQjs.InternalRpcError; exports.InvalidAbiDecodingTypeError = _chunkV5U5S7PQjs.InvalidAbiDecodingTypeError; exports.InvalidAbiEncodingTypeError = _chunkV5U5S7PQjs.InvalidAbiEncodingTypeError; exports.InvalidAddressError = _chunkV5U5S7PQjs.InvalidAddressError; exports.InvalidArrayError = _chunkV5U5S7PQjs.InvalidArrayError; exports.InvalidBytesBooleanError = _chunkV5U5S7PQjs.InvalidBytesBooleanError; exports.InvalidDefinitionTypeError = _chunkV5U5S7PQjs.InvalidDefinitionTypeError; exports.InvalidGasArgumentsError = _chunkV5U5S7PQjs.InvalidGasArgumentsError; exports.InvalidHexBooleanError = _chunkV5U5S7PQjs.InvalidHexBooleanError; exports.InvalidHexValueError = _chunkV5U5S7PQjs.InvalidHexValueError; exports.InvalidInputRpcError = _chunkV5U5S7PQjs.InvalidInputRpcError; exports.InvalidParamsRpcError = _chunkV5U5S7PQjs.InvalidParamsRpcError; exports.InvalidRequestRpcError = _chunkV5U5S7PQjs.InvalidRequestRpcError; exports.JsonRpcVersionUnsupportedError = _chunkV5U5S7PQjs.JsonRpcVersionUnsupportedError; exports.LimitExceededRpcError = _chunkV5U5S7PQjs.LimitExceededRpcError; exports.MethodNotFoundRpcError = _chunkV5U5S7PQjs.MethodNotFoundRpcError; exports.MethodNotSupportedRpcError = _chunkV5U5S7PQjs.MethodNotSupportedRpcError; exports.OffsetOutOfBoundsError = _chunkV5U5S7PQjs.OffsetOutOfBoundsError; exports.ParseRpcError = _chunkV5U5S7PQjs.ParseRpcError; exports.RequestError = _chunkV5U5S7PQjs.RequestError; exports.ResourceNotFoundRpcError = _chunkV5U5S7PQjs.ResourceNotFoundRpcError; exports.ResourceUnavailableRpcError = _chunkV5U5S7PQjs.ResourceUnavailableRpcError; exports.RpcError = _chunkV5U5S7PQjs.RpcError; exports.RpcRequestError = _chunkV5U5S7PQjs.RpcRequestError; exports.SizeExceedsPaddingSizeError = _chunkV5U5S7PQjs.SizeExceedsPaddingSizeError; exports.TimeoutError = _chunkV5U5S7PQjs.TimeoutError; exports.TransactionNotFoundError = _chunkV5U5S7PQjs.TransactionNotFoundError; exports.TransactionReceiptNotFoundError = _chunkV5U5S7PQjs.TransactionReceiptNotFoundError; exports.TransactionRejectedRpcError = _chunkV5U5S7PQjs.TransactionRejectedRpcError; exports.UnknownRpcError = _chunkV5U5S7PQjs.UnknownRpcError; exports.UrlRequiredError = _chunkV5U5S7PQjs.UrlRequiredError; exports.WaitForTransactionReceiptTimeoutError = _chunkV5U5S7PQjs.WaitForTransactionReceiptTimeoutError; exports.WebSocketRequestError = _chunkV5U5S7PQjs.WebSocketRequestError; exports.addChain = _chunkS77NLWHOjs.addChain; exports.boolToBytes = _chunkV5U5S7PQjs.boolToBytes; exports.boolToHex = _chunkV5U5S7PQjs.boolToHex; exports.bytesToBigint = _chunkV5U5S7PQjs.bytesToBigint; exports.bytesToBool = _chunkV5U5S7PQjs.bytesToBool; exports.bytesToHex = _chunkV5U5S7PQjs.bytesToHex; exports.bytesToNumber = _chunkV5U5S7PQjs.bytesToNumber; exports.bytesToString = _chunkV5U5S7PQjs.bytesToString; exports.call = _chunkMVD4Y3AEjs.call; exports.createBlockFilter = _chunkMVD4Y3AEjs.createBlockFilter; exports.createClient = _chunkPMPJGAHYjs.createClient; exports.createContractEventFilter = _chunkMVD4Y3AEjs.createContractEventFilter; exports.createEventFilter = _chunkMVD4Y3AEjs.createEventFilter; exports.createPendingTransactionFilter = _chunkMVD4Y3AEjs.createPendingTransactionFilter; exports.createPublicClient = _chunkPMPJGAHYjs.createPublicClient; exports.createTestClient = _chunkPMPJGAHYjs.createTestClient; exports.createTransport = _chunkPMPJGAHYjs.createTransport; exports.createWalletClient = _chunkPMPJGAHYjs.createWalletClient; exports.custom = _chunkPMPJGAHYjs.custom; exports.decodeAbi = _chunkV5U5S7PQjs.decodeAbi; exports.decodeBytes = _chunkV5U5S7PQjs.decodeBytes; exports.decodeErrorResult = _chunkV5U5S7PQjs.decodeErrorResult; exports.decodeFunctionData = _chunkV5U5S7PQjs.decodeFunctionData; exports.decodeFunctionResult = _chunkV5U5S7PQjs.decodeFunctionResult; exports.decodeHex = _chunkV5U5S7PQjs.decodeHex; exports.decodeRlp = _chunkV5U5S7PQjs.decodeRlp; exports.deployContract = _chunkMVD4Y3AEjs.deployContract; exports.dropTransaction = _chunkQA3IE5DUjs.dropTransaction; exports.encodeAbi = _chunkV5U5S7PQjs.encodeAbi; exports.encodeBytes = _chunkV5U5S7PQjs.encodeBytes; exports.encodeDeployData = _chunkV5U5S7PQjs.encodeDeployData; exports.encodeErrorResult = _chunkV5U5S7PQjs.encodeErrorResult; exports.encodeEventTopics = _chunkV5U5S7PQjs.encodeEventTopics; exports.encodeFunctionData = _chunkV5U5S7PQjs.encodeFunctionData; exports.encodeFunctionResult = _chunkV5U5S7PQjs.encodeFunctionResult; exports.encodeHex = _chunkV5U5S7PQjs.encodeHex; exports.encodeRlp = _chunkV5U5S7PQjs.encodeRlp; exports.estimateGas = _chunkMVD4Y3AEjs.estimateGas; exports.etherUnits = _chunkV5U5S7PQjs.etherUnits; exports.fallback = _chunkPMPJGAHYjs.fallback; exports.formatBlock = _chunkV5U5S7PQjs.formatBlock; exports.formatEther = _chunkV5U5S7PQjs.formatEther; exports.formatGwei = _chunkV5U5S7PQjs.formatGwei; exports.formatTransaction = _chunkV5U5S7PQjs.formatTransaction; exports.formatTransactionRequest = _chunkV5U5S7PQjs.formatTransactionRequest; exports.formatUnit = _chunkV5U5S7PQjs.formatUnit; exports.getAccounts = _chunkS77NLWHOjs.getAccounts; exports.getAddress = _chunkV5U5S7PQjs.getAddress; exports.getAutomine = _chunkQA3IE5DUjs.getAutomine; exports.getBalance = _chunkMVD4Y3AEjs.getBalance; exports.getBlock = _chunkMVD4Y3AEjs.getBlock; exports.getBlockNumber = _chunkMVD4Y3AEjs.getBlockNumber; exports.getBlockTransactionCount = _chunkMVD4Y3AEjs.getBlockTransactionCount; exports.getBytecode = _chunkMVD4Y3AEjs.getBytecode; exports.getChainId = _chunkMVD4Y3AEjs.getChainId; exports.getContractAddress = _chunkV5U5S7PQjs.getContractAddress; exports.getCreate2Address = _chunkV5U5S7PQjs.getCreate2Address; exports.getCreateAddress = _chunkV5U5S7PQjs.getCreateAddress; exports.getEventSignature = _chunkV5U5S7PQjs.getEventSignature; exports.getFeeHistory = _chunkMVD4Y3AEjs.getFeeHistory; exports.getFilterChanges = _chunkMVD4Y3AEjs.getFilterChanges; exports.getFilterLogs = _chunkMVD4Y3AEjs.getFilterLogs; exports.getFunctionSignature = _chunkV5U5S7PQjs.getFunctionSignature; exports.getGasPrice = _chunkMVD4Y3AEjs.getGasPrice; exports.getLogs = _chunkMVD4Y3AEjs.getLogs; exports.getPermissions = _chunkS77NLWHOjs.getPermissions; exports.getStorageAt = _chunkMVD4Y3AEjs.getStorageAt; exports.getTransaction = _chunkMVD4Y3AEjs.getTransaction; exports.getTransactionConfirmations = _chunkMVD4Y3AEjs.getTransactionConfirmations; exports.getTransactionCount = _chunkMVD4Y3AEjs.getTransactionCount; exports.getTransactionReceipt = _chunkMVD4Y3AEjs.getTransactionReceipt; exports.getTxpoolContent = _chunkQA3IE5DUjs.getTxpoolContent; exports.getTxpoolStatus = _chunkQA3IE5DUjs.getTxpoolStatus; exports.gweiUnits = _chunkV5U5S7PQjs.gweiUnits; exports.hexToBigInt = _chunkV5U5S7PQjs.hexToBigInt; exports.hexToBool = _chunkV5U5S7PQjs.hexToBool; exports.hexToBytes = _chunkV5U5S7PQjs.hexToBytes; exports.hexToNumber = _chunkV5U5S7PQjs.hexToNumber; exports.hexToString = _chunkV5U5S7PQjs.hexToString; exports.http = _chunkPMPJGAHYjs.http; exports.impersonateAccount = _chunkQA3IE5DUjs.impersonateAccount; exports.increaseTime = _chunkQA3IE5DUjs.increaseTime; exports.inspectTxpool = _chunkQA3IE5DUjs.inspectTxpool; exports.isAddress = _chunkV5U5S7PQjs.isAddress; exports.isAddressEqual = _chunkV5U5S7PQjs.isAddressEqual; exports.isBytes = _chunkV5U5S7PQjs.isBytes; exports.isHex = _chunkV5U5S7PQjs.isHex; exports.keccak256 = _chunkV5U5S7PQjs.keccak256; exports.mine = _chunkQA3IE5DUjs.mine; exports.multicall3Abi = _chunkV5U5S7PQjs.multicall3Abi; exports.numberToBytes = _chunkV5U5S7PQjs.numberToBytes; exports.numberToHex = _chunkV5U5S7PQjs.numberToHex; exports.pad = _chunkV5U5S7PQjs.pad; exports.padBytes = _chunkV5U5S7PQjs.padBytes; exports.padHex = _chunkV5U5S7PQjs.padHex; exports.parseEther = _chunkV5U5S7PQjs.parseEther; exports.parseGwei = _chunkV5U5S7PQjs.parseGwei; exports.parseUnit = _chunkV5U5S7PQjs.parseUnit; exports.readContract = _chunkMVD4Y3AEjs.readContract; exports.removeBlockTimestampInterval = _chunkQA3IE5DUjs.removeBlockTimestampInterval; exports.requestAccounts = _chunkS77NLWHOjs.requestAccounts; exports.requestPermissions = _chunkS77NLWHOjs.requestPermissions; exports.reset = _chunkQA3IE5DUjs.reset; exports.revert = _chunkQA3IE5DUjs.revert; exports.sendTransaction = _chunkS77NLWHOjs.sendTransaction; exports.sendUnsignedTransaction = _chunkQA3IE5DUjs.sendUnsignedTransaction; exports.setAutomine = _chunkQA3IE5DUjs.setAutomine; exports.setBalance = _chunkQA3IE5DUjs.setBalance; exports.setBlockGasLimit = _chunkQA3IE5DUjs.setBlockGasLimit; exports.setBlockTimestampInterval = _chunkQA3IE5DUjs.setBlockTimestampInterval; exports.setCode = _chunkQA3IE5DUjs.setCode; exports.setCoinbase = _chunkQA3IE5DUjs.setCoinbase; exports.setIntervalMining = _chunkQA3IE5DUjs.setIntervalMining; exports.setLoggingEnabled = _chunkQA3IE5DUjs.setLoggingEnabled; exports.setMinGasPrice = _chunkQA3IE5DUjs.setMinGasPrice; exports.setNextBlockBaseFeePerGas = _chunkQA3IE5DUjs.setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = _chunkQA3IE5DUjs.setNextBlockTimestamp; exports.setNonce = _chunkQA3IE5DUjs.setNonce; exports.setStorageAt = _chunkQA3IE5DUjs.setStorageAt; exports.signMessage = _chunkS77NLWHOjs.signMessage; exports.simulateContract = _chunkMVD4Y3AEjs.simulateContract; exports.size = _chunkV5U5S7PQjs.size; exports.slice = _chunkV5U5S7PQjs.slice; exports.sliceBytes = _chunkV5U5S7PQjs.sliceBytes; exports.sliceHex = _chunkV5U5S7PQjs.sliceHex; exports.snapshot = _chunkQA3IE5DUjs.snapshot; exports.stopImpersonatingAccount = _chunkQA3IE5DUjs.stopImpersonatingAccount; exports.stringToBytes = _chunkV5U5S7PQjs.stringToBytes; exports.stringToHex = _chunkV5U5S7PQjs.stringToHex; exports.switchChain = _chunkS77NLWHOjs.switchChain; exports.transactionType = _chunkV5U5S7PQjs.transactionType; exports.trim = _chunkV5U5S7PQjs.trim; exports.uninstallFilter = _chunkMVD4Y3AEjs.uninstallFilter; exports.waitForTransactionReceipt = _chunkMVD4Y3AEjs.waitForTransactionReceipt; exports.watchAsset = _chunkS77NLWHOjs.watchAsset; exports.watchBlockNumber = _chunkMVD4Y3AEjs.watchBlockNumber; exports.watchBlocks = _chunkMVD4Y3AEjs.watchBlocks; exports.watchPendingTransactions = _chunkMVD4Y3AEjs.watchPendingTransactions; exports.webSocket = _chunkPMPJGAHYjs.webSocket; exports.weiUnits = _chunkV5U5S7PQjs.weiUnits; exports.writeContract = _chunkS77NLWHOjs.writeContract; | ||
//# sourceMappingURL=index.js.map |
@@ -1,11 +0,11 @@ | ||
export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DeployContractArgs, e as DeployContractResponse, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, f as GetBalanceResponse, g as GetBlockArgs, h as GetBlockNumberArgs, i as GetBlockNumberResponse, j as GetBlockResponse, k as GetBlockTransactionCountArgs, l as GetBlockTransactionCountResponse, m as GetBytecodeArgs, n as GetBytecodeResponse, o as GetFeeHistoryArgs, p as GetFeeHistoryResponse, q as GetFilterChangesArgs, r as GetFilterChangesResponse, s as GetFilterLogsArgs, t as GetFilterLogsResponse, u as GetGasPriceResponse, v as GetTransactionArgs, w as GetTransactionConfirmationsArgs, x as GetTransactionConfirmationsResponse, y as GetTransactionCountArgs, z as GetTransactionCountResponse, B as GetTransactionReceiptArgs, H as GetTransactionReceiptResponse, A as GetTransactionResponse, O as OnBlock, I as OnBlockNumber, J as OnBlockNumberResponse, K as OnBlockResponse, L as OnTransactions, M as OnTransactionsResponse, ao as ReplacementReason, ap as ReplacementResponse, S as SimulateContractArgs, N as SimulateContractResponse, U as UninstallFilterArgs, P as UninstallFilterResponse, W as WaitForTransactionReceiptArgs, Q as WaitForTransactionReceiptResponse, R as WatchBlockNumberArgs, T as WatchBlocksArgs, V as WatchPendingTransactionsArgs, Z as call, _ as createBlockFilter, $ as createPendingTransactionFilter, a0 as deployContract, a1 as estimateGas, a2 as getBalance, a3 as getBlock, a4 as getBlockNumber, an as getBlockNumberCache, a5 as getBlockTransactionCount, a6 as getBytecode, a7 as getChainId, a8 as getFeeHistory, a9 as getFilterChanges, aa as getFilterLogs, ab as getGasPrice, ac as getTransaction, ad as getTransactionConfirmations, ae as getTransactionCount, af as getTransactionReceipt, ag as simulateContract, ah as uninstallFilter, ai as waitForTransactionReceipt, aj as watchBlockNumber, ak as watchBlocks, al as watchPendingTransactions } from './watchPendingTransactions-3b722547.js'; | ||
export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DeployContractArgs, e as DeployContractResponse, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, f as GetBalanceResponse, g as GetBlockArgs, h as GetBlockNumberArgs, i as GetBlockNumberResponse, j as GetBlockResponse, k as GetBlockTransactionCountArgs, l as GetBlockTransactionCountResponse, m as GetBytecodeArgs, n as GetBytecodeResponse, o as GetFeeHistoryArgs, p as GetFeeHistoryResponse, q as GetFilterChangesArgs, r as GetFilterChangesResponse, s as GetFilterLogsArgs, t as GetFilterLogsResponse, u as GetGasPriceResponse, v as GetTransactionArgs, w as GetTransactionConfirmationsArgs, x as GetTransactionConfirmationsResponse, y as GetTransactionCountArgs, z as GetTransactionCountResponse, B as GetTransactionReceiptArgs, H as GetTransactionReceiptResponse, A as GetTransactionResponse, O as OnBlock, I as OnBlockNumber, J as OnBlockNumberResponse, K as OnBlockResponse, L as OnTransactions, M as OnTransactionsResponse, ao as ReplacementReason, ap as ReplacementResponse, S as SimulateContractArgs, N as SimulateContractResponse, U as UninstallFilterArgs, P as UninstallFilterResponse, W as WaitForTransactionReceiptArgs, Q as WaitForTransactionReceiptResponse, R as WatchBlockNumberArgs, T as WatchBlocksArgs, V as WatchPendingTransactionsArgs, Z as call, _ as createBlockFilter, $ as createPendingTransactionFilter, a0 as deployContract, a1 as estimateGas, a2 as getBalance, a3 as getBlock, a4 as getBlockNumber, an as getBlockNumberCache, a5 as getBlockTransactionCount, a6 as getBytecode, a7 as getChainId, a8 as getFeeHistory, a9 as getFilterChanges, aa as getFilterLogs, ab as getGasPrice, ac as getTransaction, ad as getTransactionConfirmations, ae as getTransactionCount, af as getTransactionReceipt, ag as simulateContract, ah as uninstallFilter, ai as waitForTransactionReceipt, aj as watchBlockNumber, ak as watchBlocks, al as watchPendingTransactions } from './watchPendingTransactions-a8688b26.js'; | ||
import 'abitype'; | ||
import './chain-32f56cfa.js'; | ||
import './chain-4b39613a.js'; | ||
import '@wagmi/chains'; | ||
import './contract-9af4608b.js'; | ||
import './createPublicClient-9d2b42e1.js'; | ||
import './eip1193-6c485d63.js'; | ||
import './createClient-5d316c7e.js'; | ||
import './createWalletClient-f69a5230.js'; | ||
import './sendTransaction-1c8290a9.js'; | ||
import './transactionRequest-341b6ed2.js'; | ||
import './contract-74f34ac9.js'; | ||
import './createPublicClient-3b27b282.js'; | ||
import './eip1193-4c24765a.js'; | ||
import './createClient-55a04188.js'; | ||
import './createWalletClient-c10df94d.js'; | ||
import './sendTransaction-f17a2389.js'; | ||
import './transactionRequest-93e9f001.js'; |
@@ -28,5 +28,5 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkKZMJR27Bjs = require('./chunk-KZMJR27B.js'); | ||
require('./chunk-EC3NUIJE.js'); | ||
require('./chunk-O2GYLJVD.js'); | ||
var _chunkMVD4Y3AEjs = require('./chunk-MVD4Y3AE.js'); | ||
require('./chunk-S77NLWHO.js'); | ||
require('./chunk-V5U5S7PQ.js'); | ||
@@ -59,3 +59,3 @@ | ||
exports.call = _chunkKZMJR27Bjs.call; exports.createBlockFilter = _chunkKZMJR27Bjs.createBlockFilter; exports.createPendingTransactionFilter = _chunkKZMJR27Bjs.createPendingTransactionFilter; exports.deployContract = _chunkKZMJR27Bjs.deployContract; exports.estimateGas = _chunkKZMJR27Bjs.estimateGas; exports.getBalance = _chunkKZMJR27Bjs.getBalance; exports.getBlock = _chunkKZMJR27Bjs.getBlock; exports.getBlockNumber = _chunkKZMJR27Bjs.getBlockNumber; exports.getBlockNumberCache = _chunkKZMJR27Bjs.getBlockNumberCache; exports.getBlockTransactionCount = _chunkKZMJR27Bjs.getBlockTransactionCount; exports.getBytecode = _chunkKZMJR27Bjs.getBytecode; exports.getChainId = _chunkKZMJR27Bjs.getChainId; exports.getFeeHistory = _chunkKZMJR27Bjs.getFeeHistory; exports.getFilterChanges = _chunkKZMJR27Bjs.getFilterChanges; exports.getFilterLogs = _chunkKZMJR27Bjs.getFilterLogs; exports.getGasPrice = _chunkKZMJR27Bjs.getGasPrice; exports.getTransaction = _chunkKZMJR27Bjs.getTransaction; exports.getTransactionConfirmations = _chunkKZMJR27Bjs.getTransactionConfirmations; exports.getTransactionCount = _chunkKZMJR27Bjs.getTransactionCount; exports.getTransactionReceipt = _chunkKZMJR27Bjs.getTransactionReceipt; exports.simulateContract = _chunkKZMJR27Bjs.simulateContract; exports.uninstallFilter = _chunkKZMJR27Bjs.uninstallFilter; exports.waitForTransactionReceipt = _chunkKZMJR27Bjs.waitForTransactionReceipt; exports.watchBlockNumber = _chunkKZMJR27Bjs.watchBlockNumber; exports.watchBlocks = _chunkKZMJR27Bjs.watchBlocks; exports.watchPendingTransactions = _chunkKZMJR27Bjs.watchPendingTransactions; | ||
exports.call = _chunkMVD4Y3AEjs.call; exports.createBlockFilter = _chunkMVD4Y3AEjs.createBlockFilter; exports.createPendingTransactionFilter = _chunkMVD4Y3AEjs.createPendingTransactionFilter; exports.deployContract = _chunkMVD4Y3AEjs.deployContract; exports.estimateGas = _chunkMVD4Y3AEjs.estimateGas; exports.getBalance = _chunkMVD4Y3AEjs.getBalance; exports.getBlock = _chunkMVD4Y3AEjs.getBlock; exports.getBlockNumber = _chunkMVD4Y3AEjs.getBlockNumber; exports.getBlockNumberCache = _chunkMVD4Y3AEjs.getBlockNumberCache; exports.getBlockTransactionCount = _chunkMVD4Y3AEjs.getBlockTransactionCount; exports.getBytecode = _chunkMVD4Y3AEjs.getBytecode; exports.getChainId = _chunkMVD4Y3AEjs.getChainId; exports.getFeeHistory = _chunkMVD4Y3AEjs.getFeeHistory; exports.getFilterChanges = _chunkMVD4Y3AEjs.getFilterChanges; exports.getFilterLogs = _chunkMVD4Y3AEjs.getFilterLogs; exports.getGasPrice = _chunkMVD4Y3AEjs.getGasPrice; exports.getTransaction = _chunkMVD4Y3AEjs.getTransaction; exports.getTransactionConfirmations = _chunkMVD4Y3AEjs.getTransactionConfirmations; exports.getTransactionCount = _chunkMVD4Y3AEjs.getTransactionCount; exports.getTransactionReceipt = _chunkMVD4Y3AEjs.getTransactionReceipt; exports.simulateContract = _chunkMVD4Y3AEjs.simulateContract; exports.uninstallFilter = _chunkMVD4Y3AEjs.uninstallFilter; exports.waitForTransactionReceipt = _chunkMVD4Y3AEjs.waitForTransactionReceipt; exports.watchBlockNumber = _chunkMVD4Y3AEjs.watchBlockNumber; exports.watchBlocks = _chunkMVD4Y3AEjs.watchBlocks; exports.watchPendingTransactions = _chunkMVD4Y3AEjs.watchPendingTransactions; | ||
//# sourceMappingURL=public.js.map |
@@ -1,6 +0,6 @@ | ||
export { D as DropTransactionArgs, I as ImpersonateAccountArgs, a as IncreaseTimeArgs, M as MineArgs, R as ResetArgs, b as RevertArgs, S as SendUnsignedTransactionArgs, c as SendUnsignedTransactionResponse, d as SetBalanceArgs, e as SetBlockGasLimitArgs, j as SetBlockTimestampIntervalArgs, f as SetCodeArgs, g as SetCoinbaseArgs, h as SetIntervalMiningArgs, i as SetMinGasPriceArgs, l as SetNextBlockBaseFeePerGasArgs, k as SetNextBlockTimestampArgs, m as SetNonceArgs, n as SetStorageAtArgs, o as StopImpersonatingAccountArgs, p as dropTransaction, q as getAutomine, r as getTxpoolContent, s as getTxpoolStatus, t as impersonateAccount, u as increaseTime, v as inspectTxpool, w as mine, x as removeBlockTimestampInterval, y as reset, z as revert, A as sendUnsignedTransaction, B as setAutomine, C as setBalance, E as setBlockGasLimit, F as setBlockTimestampInterval, G as setCode, H as setCoinbase, J as setIntervalMining, K as setLoggingEnabled, L as setMinGasPrice, N as setNextBlockBaseFeePerGas, O as setNextBlockTimestamp, P as setNonce, Q as setStorageAt, T as snapshot, U as stopImpersonatingAccount } from './stopImpersonatingAccount-7781842a.js'; | ||
import './chain-32f56cfa.js'; | ||
export { D as DropTransactionArgs, I as ImpersonateAccountArgs, a as IncreaseTimeArgs, M as MineArgs, R as ResetArgs, b as RevertArgs, S as SendUnsignedTransactionArgs, c as SendUnsignedTransactionResponse, d as SetBalanceArgs, e as SetBlockGasLimitArgs, j as SetBlockTimestampIntervalArgs, f as SetCodeArgs, g as SetCoinbaseArgs, h as SetIntervalMiningArgs, i as SetMinGasPriceArgs, l as SetNextBlockBaseFeePerGasArgs, k as SetNextBlockTimestampArgs, m as SetNonceArgs, n as SetStorageAtArgs, o as StopImpersonatingAccountArgs, p as dropTransaction, q as getAutomine, r as getTxpoolContent, s as getTxpoolStatus, t as impersonateAccount, u as increaseTime, v as inspectTxpool, w as mine, x as removeBlockTimestampInterval, y as reset, z as revert, A as sendUnsignedTransaction, B as setAutomine, C as setBalance, E as setBlockGasLimit, F as setBlockTimestampInterval, G as setCode, H as setCoinbase, J as setIntervalMining, K as setLoggingEnabled, L as setMinGasPrice, N as setNextBlockBaseFeePerGas, O as setNextBlockTimestamp, P as setNonce, Q as setStorageAt, T as snapshot, U as stopImpersonatingAccount } from './stopImpersonatingAccount-afb26486.js'; | ||
import './chain-4b39613a.js'; | ||
import '@wagmi/chains'; | ||
import './createTestClient-79498dab.js'; | ||
import './eip1193-6c485d63.js'; | ||
import './createClient-5d316c7e.js'; | ||
import './createTestClient-93f9eac6.js'; | ||
import './eip1193-4c24765a.js'; | ||
import './createClient-55a04188.js'; |
@@ -29,4 +29,4 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkW7BWWAC4js = require('./chunk-W7BWWAC4.js'); | ||
require('./chunk-O2GYLJVD.js'); | ||
var _chunkQA3IE5DUjs = require('./chunk-QA3IE5DU.js'); | ||
require('./chunk-V5U5S7PQ.js'); | ||
@@ -60,3 +60,3 @@ | ||
exports.dropTransaction = _chunkW7BWWAC4js.dropTransaction; exports.getAutomine = _chunkW7BWWAC4js.getAutomine; exports.getTxpoolContent = _chunkW7BWWAC4js.getTxpoolContent; exports.getTxpoolStatus = _chunkW7BWWAC4js.getTxpoolStatus; exports.impersonateAccount = _chunkW7BWWAC4js.impersonateAccount; exports.increaseTime = _chunkW7BWWAC4js.increaseTime; exports.inspectTxpool = _chunkW7BWWAC4js.inspectTxpool; exports.mine = _chunkW7BWWAC4js.mine; exports.removeBlockTimestampInterval = _chunkW7BWWAC4js.removeBlockTimestampInterval; exports.reset = _chunkW7BWWAC4js.reset; exports.revert = _chunkW7BWWAC4js.revert; exports.sendUnsignedTransaction = _chunkW7BWWAC4js.sendUnsignedTransaction; exports.setAutomine = _chunkW7BWWAC4js.setAutomine; exports.setBalance = _chunkW7BWWAC4js.setBalance; exports.setBlockGasLimit = _chunkW7BWWAC4js.setBlockGasLimit; exports.setBlockTimestampInterval = _chunkW7BWWAC4js.setBlockTimestampInterval; exports.setCode = _chunkW7BWWAC4js.setCode; exports.setCoinbase = _chunkW7BWWAC4js.setCoinbase; exports.setIntervalMining = _chunkW7BWWAC4js.setIntervalMining; exports.setLoggingEnabled = _chunkW7BWWAC4js.setLoggingEnabled; exports.setMinGasPrice = _chunkW7BWWAC4js.setMinGasPrice; exports.setNextBlockBaseFeePerGas = _chunkW7BWWAC4js.setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = _chunkW7BWWAC4js.setNextBlockTimestamp; exports.setNonce = _chunkW7BWWAC4js.setNonce; exports.setStorageAt = _chunkW7BWWAC4js.setStorageAt; exports.snapshot = _chunkW7BWWAC4js.snapshot; exports.stopImpersonatingAccount = _chunkW7BWWAC4js.stopImpersonatingAccount; | ||
exports.dropTransaction = _chunkQA3IE5DUjs.dropTransaction; exports.getAutomine = _chunkQA3IE5DUjs.getAutomine; exports.getTxpoolContent = _chunkQA3IE5DUjs.getTxpoolContent; exports.getTxpoolStatus = _chunkQA3IE5DUjs.getTxpoolStatus; exports.impersonateAccount = _chunkQA3IE5DUjs.impersonateAccount; exports.increaseTime = _chunkQA3IE5DUjs.increaseTime; exports.inspectTxpool = _chunkQA3IE5DUjs.inspectTxpool; exports.mine = _chunkQA3IE5DUjs.mine; exports.removeBlockTimestampInterval = _chunkQA3IE5DUjs.removeBlockTimestampInterval; exports.reset = _chunkQA3IE5DUjs.reset; exports.revert = _chunkQA3IE5DUjs.revert; exports.sendUnsignedTransaction = _chunkQA3IE5DUjs.sendUnsignedTransaction; exports.setAutomine = _chunkQA3IE5DUjs.setAutomine; exports.setBalance = _chunkQA3IE5DUjs.setBalance; exports.setBlockGasLimit = _chunkQA3IE5DUjs.setBlockGasLimit; exports.setBlockTimestampInterval = _chunkQA3IE5DUjs.setBlockTimestampInterval; exports.setCode = _chunkQA3IE5DUjs.setCode; exports.setCoinbase = _chunkQA3IE5DUjs.setCoinbase; exports.setIntervalMining = _chunkQA3IE5DUjs.setIntervalMining; exports.setLoggingEnabled = _chunkQA3IE5DUjs.setLoggingEnabled; exports.setMinGasPrice = _chunkQA3IE5DUjs.setMinGasPrice; exports.setNextBlockBaseFeePerGas = _chunkQA3IE5DUjs.setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = _chunkQA3IE5DUjs.setNextBlockTimestamp; exports.setNonce = _chunkQA3IE5DUjs.setNonce; exports.setStorageAt = _chunkQA3IE5DUjs.setStorageAt; exports.snapshot = _chunkQA3IE5DUjs.snapshot; exports.stopImpersonatingAccount = _chunkQA3IE5DUjs.stopImpersonatingAccount; | ||
//# sourceMappingURL=test.js.map |
@@ -1,11 +0,13 @@ | ||
export { D as DecodeAbiArgs, a as DecodeErrorResultArgs, b as DecodeFunctionDataArgs, c as DecodeFunctionResultArgs, d as DecodeFunctionResultResponse, E as EncodeAbiArgs, e as EncodeDeployDataArgs, f as EncodeErrorResultArgs, g as EncodeEventTopicsArgs, h as EncodeFunctionDataArgs, i as EncodeFunctionResultArgs, l as EncodeRlpResponse, G as GetContractAddressOptions, k as GetCreate2AddressOptions, j as GetCreateAddressOptions, o as boolToBytes, p as boolToHex, q as bytesToBigint, r as bytesToBool, m as bytesToHex, s as bytesToNumber, n as bytesToString, t as decodeAbi, u as decodeBytes, v as decodeErrorResult, w as decodeFunctionData, x as decodeFunctionResult, y as decodeHex, z as decodeRlp, A as encodeAbi, B as encodeBytes, C as encodeDeployData, F as encodeErrorResult, H as encodeEventTopics, I as encodeFunctionData, J as encodeFunctionResult, K as encodeHex, L as encodeRlp, M as etherUnits, U as formatEther, a9 as formatGwei, aa as formatUnit, N as getAddress, O as getContractAddress, Q as getCreate2Address, P as getCreateAddress, R as getEventSignature, S as getFunctionSignature, T as gweiUnits, Z as hexToBigInt, _ as hexToBool, $ as hexToBytes, ab as hexToNumber, a0 as hexToString, V as isAddress, W as isAddressEqual, X as isBytes, Y as isHex, a1 as keccak256, a2 as numberToBytes, ac as numberToHex, a3 as pad, a4 as padBytes, a5 as padHex, a6 as parseEther, a7 as parseGwei, a8 as parseUnit, ad as size, ae as slice, af as sliceBytes, ag as sliceHex, ah as stringToBytes, ai as stringToHex, aj as trim, ak as weiUnits } from '../parseGwei-4308ad80.js'; | ||
import { A as AbiItem } from '../contract-9af4608b.js'; | ||
export { B as BlockFormatter, F as FormattedBlock, i as FormattedTransactionReceipt, T as TransactionReceiptFormatter, k as defineBlock, l as defineTransactionReceipt, g as formatBlock } from '../contract-9af4608b.js'; | ||
import * as abitype_dist_abi_b1bae27f from 'abitype/dist/abi-b1bae27f'; | ||
import { B as BaseError, C as ContractFunctionExecutionError } from '../parseGwei-b323fb0a.js'; | ||
export { D as DecodeAbiArgs, c as DecodeErrorResultArgs, aq as DecodeErrorResultResponse, d as DecodeFunctionDataArgs, e as DecodeFunctionResultArgs, f as DecodeFunctionResultResponse, E as EncodeAbiArgs, g as EncodeDeployDataArgs, h as EncodeErrorResultArgs, i as EncodeEventTopicsArgs, j as EncodeFunctionDataArgs, k as EncodeFunctionResultArgs, o as EncodeRlpResponse, n as GetAbiItemArgs, G as GetContractAddressOptions, m as GetCreate2AddressOptions, l as GetCreateAddressOptions, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, p as bytesToHex, v as bytesToNumber, q as bytesToString, w as decodeAbi, x as decodeBytes, y as decodeErrorResult, z as decodeFunctionData, A as decodeFunctionResult, F as decodeHex, H as decodeRlp, I as encodeAbi, J as encodeBytes, K as encodeDeployData, L as encodeErrorResult, M as encodeEventTopics, N as encodeFunctionData, O as encodeFunctionResult, P as encodeHex, Q as encodeRlp, R as etherUnits, Z as formatEther, ae as formatGwei, af as formatUnit, ar as getAbiItem, S as getAddress, T as getContractAddress, V as getCreate2Address, U as getCreateAddress, W as getEventSignature, X as getFunctionSignature, Y as gweiUnits, a2 as hexToBigInt, a3 as hexToBool, a4 as hexToBytes, ag as hexToNumber, a5 as hexToString, _ as isAddress, $ as isAddressEqual, a0 as isBytes, a1 as isHex, a6 as keccak256, a7 as numberToBytes, ah as numberToHex, a8 as pad, a9 as padBytes, aa as padHex, ab as parseEther, ac as parseGwei, ad as parseUnit, ai as size, aj as slice, ak as sliceBytes, al as sliceHex, am as stringToBytes, an as stringToHex, ao as trim, ap as weiUnits } from '../parseGwei-b323fb0a.js'; | ||
import { A as AbiItem } from '../contract-74f34ac9.js'; | ||
export { B as BlockFormatter, F as FormattedBlock, g as FormattedTransactionReceipt, T as TransactionReceiptFormatter, m as defineBlock, n as defineTransactionReceipt, f as formatBlock } from '../contract-74f34ac9.js'; | ||
export { d as defineChain } from '../chain-aa4898d0.js'; | ||
import { Abi } from 'abitype'; | ||
export { d as defineChain } from '../chain-f12cdc7f.js'; | ||
import { A as Address, K as Formatter } from '../chain-32f56cfa.js'; | ||
export { Q as ExtractFormatter, N as Formatted, E as FormattedTransaction, P as TransactionFormatter, _ as defineFormatter, $ as defineTransaction, a0 as format, G as formatTransaction, I as transactionType } from '../chain-32f56cfa.js'; | ||
export { F as FormattedTransactionRequest, T as TransactionRequestFormatter, d as defineTransactionRequest, f as formatTransactionRequest } from '../transactionRequest-341b6ed2.js'; | ||
import { A as Address, K as Formatter } from '../chain-4b39613a.js'; | ||
export { Q as ExtractFormatter, N as Formatted, G as FormattedTransaction, P as TransactionFormatter, _ as defineFormatter, $ as defineTransaction, a0 as format, I as formatTransaction, J as transactionType } from '../chain-4b39613a.js'; | ||
export { l as labelhash, n as namehash, a as normalize } from '../normalize-ef9240c0.js'; | ||
export { F as FormattedTransactionRequest, T as TransactionRequestFormatter, d as defineTransactionRequest, f as formatTransactionRequest } from '../transactionRequest-93e9f001.js'; | ||
export { r as rpc } from '../rpc-26932bae.js'; | ||
import 'abitype/dist/abi-78346466'; | ||
import '@wagmi/chains'; | ||
@@ -24,7 +26,2 @@ | ||
declare function getAbiItem({ abi, name }: { | ||
abi: Abi; | ||
name: string; | ||
}): abitype_dist_abi_b1bae27f.q | abitype_dist_abi_b1bae27f.p | abitype_dist_abi_b1bae27f.o | undefined; | ||
declare function buildRequest<TRequest extends (args: any) => Promise<any>>(request: TRequest): TRequest; | ||
@@ -45,9 +42,10 @@ | ||
declare function getContractError(err: unknown, { abi, address, args, functionName, sender, }: { | ||
declare function getContractError(err: BaseError, { abi, address, args, docsPath, functionName, sender, }: { | ||
abi: Abi; | ||
args: any; | ||
address?: Address; | ||
docsPath?: string; | ||
functionName: string; | ||
sender?: Address; | ||
}): unknown; | ||
}): ContractFunctionExecutionError; | ||
@@ -63,2 +61,2 @@ /** | ||
export { buildRequest, extract, extractFunctionName, extractFunctionParams, extractFunctionParts, extractFunctionType, formatAbiItem, formatAbiItemWithArgs, getAbiItem, getContractError, stringify }; | ||
export { buildRequest, extract, extractFunctionName, extractFunctionParams, extractFunctionParts, extractFunctionType, formatAbiItem, formatAbiItemWithArgs, getContractError, stringify }; |
@@ -85,6 +85,6 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkO2GYLJVDjs = require('../chunk-O2GYLJVD.js'); | ||
var _chunkV5U5S7PQjs = require('../chunk-V5U5S7PQ.js'); | ||
@@ -171,3 +171,9 @@ | ||
exports.boolToBytes = _chunkO2GYLJVDjs.boolToBytes; exports.boolToHex = _chunkO2GYLJVDjs.boolToHex; exports.buildRequest = _chunkO2GYLJVDjs.buildRequest; exports.bytesToBigint = _chunkO2GYLJVDjs.bytesToBigint; exports.bytesToBool = _chunkO2GYLJVDjs.bytesToBool; exports.bytesToHex = _chunkO2GYLJVDjs.bytesToHex; exports.bytesToNumber = _chunkO2GYLJVDjs.bytesToNumber; exports.bytesToString = _chunkO2GYLJVDjs.bytesToString; exports.decodeAbi = _chunkO2GYLJVDjs.decodeAbi; exports.decodeBytes = _chunkO2GYLJVDjs.decodeBytes; exports.decodeErrorResult = _chunkO2GYLJVDjs.decodeErrorResult; exports.decodeFunctionData = _chunkO2GYLJVDjs.decodeFunctionData; exports.decodeFunctionResult = _chunkO2GYLJVDjs.decodeFunctionResult; exports.decodeHex = _chunkO2GYLJVDjs.decodeHex; exports.decodeRlp = _chunkO2GYLJVDjs.decodeRlp; exports.defineBlock = _chunkO2GYLJVDjs.defineBlock; exports.defineChain = _chunkO2GYLJVDjs.defineChain; exports.defineFormatter = _chunkO2GYLJVDjs.defineFormatter; exports.defineTransaction = _chunkO2GYLJVDjs.defineTransaction; exports.defineTransactionReceipt = _chunkO2GYLJVDjs.defineTransactionReceipt; exports.defineTransactionRequest = _chunkO2GYLJVDjs.defineTransactionRequest; exports.encodeAbi = _chunkO2GYLJVDjs.encodeAbi; exports.encodeBytes = _chunkO2GYLJVDjs.encodeBytes; exports.encodeDeployData = _chunkO2GYLJVDjs.encodeDeployData; exports.encodeErrorResult = _chunkO2GYLJVDjs.encodeErrorResult; exports.encodeEventTopics = _chunkO2GYLJVDjs.encodeEventTopics; exports.encodeFunctionData = _chunkO2GYLJVDjs.encodeFunctionData; exports.encodeFunctionResult = _chunkO2GYLJVDjs.encodeFunctionResult; exports.encodeHex = _chunkO2GYLJVDjs.encodeHex; exports.encodeRlp = _chunkO2GYLJVDjs.encodeRlp; exports.etherUnits = _chunkO2GYLJVDjs.etherUnits; exports.extract = _chunkO2GYLJVDjs.extract; exports.extractFunctionName = _chunkO2GYLJVDjs.extractFunctionName; exports.extractFunctionParams = _chunkO2GYLJVDjs.extractFunctionParams; exports.extractFunctionParts = _chunkO2GYLJVDjs.extractFunctionParts; exports.extractFunctionType = _chunkO2GYLJVDjs.extractFunctionType; exports.format = _chunkO2GYLJVDjs.format; exports.formatAbiItem = _chunkO2GYLJVDjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkO2GYLJVDjs.formatAbiItemWithArgs; exports.formatBlock = _chunkO2GYLJVDjs.formatBlock; exports.formatEther = _chunkO2GYLJVDjs.formatEther; exports.formatGwei = _chunkO2GYLJVDjs.formatGwei; exports.formatTransaction = _chunkO2GYLJVDjs.formatTransaction; exports.formatTransactionRequest = _chunkO2GYLJVDjs.formatTransactionRequest; exports.formatUnit = _chunkO2GYLJVDjs.formatUnit; exports.getAbiItem = _chunkO2GYLJVDjs.getAbiItem; exports.getAddress = _chunkO2GYLJVDjs.getAddress; exports.getContractAddress = _chunkO2GYLJVDjs.getContractAddress; exports.getContractError = _chunkO2GYLJVDjs.getContractError; exports.getCreate2Address = _chunkO2GYLJVDjs.getCreate2Address; exports.getCreateAddress = _chunkO2GYLJVDjs.getCreateAddress; exports.getEventSignature = _chunkO2GYLJVDjs.getEventSignature; exports.getFunctionSignature = _chunkO2GYLJVDjs.getFunctionSignature; exports.gweiUnits = _chunkO2GYLJVDjs.gweiUnits; exports.hexToBigInt = _chunkO2GYLJVDjs.hexToBigInt; exports.hexToBool = _chunkO2GYLJVDjs.hexToBool; exports.hexToBytes = _chunkO2GYLJVDjs.hexToBytes; exports.hexToNumber = _chunkO2GYLJVDjs.hexToNumber; exports.hexToString = _chunkO2GYLJVDjs.hexToString; exports.isAddress = _chunkO2GYLJVDjs.isAddress; exports.isAddressEqual = _chunkO2GYLJVDjs.isAddressEqual; exports.isBytes = _chunkO2GYLJVDjs.isBytes; exports.isHex = _chunkO2GYLJVDjs.isHex; exports.keccak256 = _chunkO2GYLJVDjs.keccak256; exports.numberToBytes = _chunkO2GYLJVDjs.numberToBytes; exports.numberToHex = _chunkO2GYLJVDjs.numberToHex; exports.pad = _chunkO2GYLJVDjs.pad; exports.padBytes = _chunkO2GYLJVDjs.padBytes; exports.padHex = _chunkO2GYLJVDjs.padHex; exports.parseEther = _chunkO2GYLJVDjs.parseEther; exports.parseGwei = _chunkO2GYLJVDjs.parseGwei; exports.parseUnit = _chunkO2GYLJVDjs.parseUnit; exports.rpc = _chunkO2GYLJVDjs.rpc; exports.size = _chunkO2GYLJVDjs.size; exports.slice = _chunkO2GYLJVDjs.slice; exports.sliceBytes = _chunkO2GYLJVDjs.sliceBytes; exports.sliceHex = _chunkO2GYLJVDjs.sliceHex; exports.stringToBytes = _chunkO2GYLJVDjs.stringToBytes; exports.stringToHex = _chunkO2GYLJVDjs.stringToHex; exports.stringify = _chunkO2GYLJVDjs.stringify; exports.transactionType = _chunkO2GYLJVDjs.transactionType; exports.trim = _chunkO2GYLJVDjs.trim; exports.weiUnits = _chunkO2GYLJVDjs.weiUnits; | ||
exports.boolToBytes = _chunkV5U5S7PQjs.boolToBytes; exports.boolToHex = _chunkV5U5S7PQjs.boolToHex; exports.buildRequest = _chunkV5U5S7PQjs.buildRequest; exports.bytesToBigint = _chunkV5U5S7PQjs.bytesToBigint; exports.bytesToBool = _chunkV5U5S7PQjs.bytesToBool; exports.bytesToHex = _chunkV5U5S7PQjs.bytesToHex; exports.bytesToNumber = _chunkV5U5S7PQjs.bytesToNumber; exports.bytesToString = _chunkV5U5S7PQjs.bytesToString; exports.decodeAbi = _chunkV5U5S7PQjs.decodeAbi; exports.decodeBytes = _chunkV5U5S7PQjs.decodeBytes; exports.decodeErrorResult = _chunkV5U5S7PQjs.decodeErrorResult; exports.decodeFunctionData = _chunkV5U5S7PQjs.decodeFunctionData; exports.decodeFunctionResult = _chunkV5U5S7PQjs.decodeFunctionResult; exports.decodeHex = _chunkV5U5S7PQjs.decodeHex; exports.decodeRlp = _chunkV5U5S7PQjs.decodeRlp; exports.defineBlock = _chunkV5U5S7PQjs.defineBlock; exports.defineChain = _chunkV5U5S7PQjs.defineChain; exports.defineFormatter = _chunkV5U5S7PQjs.defineFormatter; exports.defineTransaction = _chunkV5U5S7PQjs.defineTransaction; exports.defineTransactionReceipt = _chunkV5U5S7PQjs.defineTransactionReceipt; exports.defineTransactionRequest = _chunkV5U5S7PQjs.defineTransactionRequest; exports.encodeAbi = _chunkV5U5S7PQjs.encodeAbi; exports.encodeBytes = _chunkV5U5S7PQjs.encodeBytes; exports.encodeDeployData = _chunkV5U5S7PQjs.encodeDeployData; exports.encodeErrorResult = _chunkV5U5S7PQjs.encodeErrorResult; exports.encodeEventTopics = _chunkV5U5S7PQjs.encodeEventTopics; exports.encodeFunctionData = _chunkV5U5S7PQjs.encodeFunctionData; exports.encodeFunctionResult = _chunkV5U5S7PQjs.encodeFunctionResult; exports.encodeHex = _chunkV5U5S7PQjs.encodeHex; exports.encodeRlp = _chunkV5U5S7PQjs.encodeRlp; exports.etherUnits = _chunkV5U5S7PQjs.etherUnits; exports.extract = _chunkV5U5S7PQjs.extract; exports.extractFunctionName = _chunkV5U5S7PQjs.extractFunctionName; exports.extractFunctionParams = _chunkV5U5S7PQjs.extractFunctionParams; exports.extractFunctionParts = _chunkV5U5S7PQjs.extractFunctionParts; exports.extractFunctionType = _chunkV5U5S7PQjs.extractFunctionType; exports.format = _chunkV5U5S7PQjs.format; exports.formatAbiItem = _chunkV5U5S7PQjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkV5U5S7PQjs.formatAbiItemWithArgs; exports.formatBlock = _chunkV5U5S7PQjs.formatBlock; exports.formatEther = _chunkV5U5S7PQjs.formatEther; exports.formatGwei = _chunkV5U5S7PQjs.formatGwei; exports.formatTransaction = _chunkV5U5S7PQjs.formatTransaction; exports.formatTransactionRequest = _chunkV5U5S7PQjs.formatTransactionRequest; exports.formatUnit = _chunkV5U5S7PQjs.formatUnit; exports.getAbiItem = _chunkV5U5S7PQjs.getAbiItem; exports.getAddress = _chunkV5U5S7PQjs.getAddress; exports.getContractAddress = _chunkV5U5S7PQjs.getContractAddress; exports.getContractError = _chunkV5U5S7PQjs.getContractError; exports.getCreate2Address = _chunkV5U5S7PQjs.getCreate2Address; exports.getCreateAddress = _chunkV5U5S7PQjs.getCreateAddress; exports.getEventSignature = _chunkV5U5S7PQjs.getEventSignature; exports.getFunctionSignature = _chunkV5U5S7PQjs.getFunctionSignature; exports.gweiUnits = _chunkV5U5S7PQjs.gweiUnits; exports.hexToBigInt = _chunkV5U5S7PQjs.hexToBigInt; exports.hexToBool = _chunkV5U5S7PQjs.hexToBool; exports.hexToBytes = _chunkV5U5S7PQjs.hexToBytes; exports.hexToNumber = _chunkV5U5S7PQjs.hexToNumber; exports.hexToString = _chunkV5U5S7PQjs.hexToString; exports.isAddress = _chunkV5U5S7PQjs.isAddress; exports.isAddressEqual = _chunkV5U5S7PQjs.isAddressEqual; exports.isBytes = _chunkV5U5S7PQjs.isBytes; exports.isHex = _chunkV5U5S7PQjs.isHex; exports.keccak256 = _chunkV5U5S7PQjs.keccak256; exports.labelhash = _chunkV5U5S7PQjs.labelhash; exports.namehash = _chunkV5U5S7PQjs.namehash; exports.normalize = _chunkV5U5S7PQjs.normalize; exports.numberToBytes = _chunkV5U5S7PQjs.numberToBytes; exports.numberToHex = _chunkV5U5S7PQjs.numberToHex; exports.pad = _chunkV5U5S7PQjs.pad; exports.padBytes = _chunkV5U5S7PQjs.padBytes; exports.padHex = _chunkV5U5S7PQjs.padHex; exports.parseEther = _chunkV5U5S7PQjs.parseEther; exports.parseGwei = _chunkV5U5S7PQjs.parseGwei; exports.parseUnit = _chunkV5U5S7PQjs.parseUnit; exports.rpc = _chunkV5U5S7PQjs.rpc; exports.size = _chunkV5U5S7PQjs.size; exports.slice = _chunkV5U5S7PQjs.slice; exports.sliceBytes = _chunkV5U5S7PQjs.sliceBytes; exports.sliceHex = _chunkV5U5S7PQjs.sliceHex; exports.stringToBytes = _chunkV5U5S7PQjs.stringToBytes; exports.stringToHex = _chunkV5U5S7PQjs.stringToHex; exports.stringify = _chunkV5U5S7PQjs.stringify; exports.transactionType = _chunkV5U5S7PQjs.transactionType; exports.trim = _chunkV5U5S7PQjs.trim; exports.weiUnits = _chunkV5U5S7PQjs.weiUnits; | ||
//# sourceMappingURL=index.js.map |
@@ -1,8 +0,8 @@ | ||
export { G as GetPermissionsResponse, R as RequestPermissionsResponse, S as SignMessageArgs, a as SignMessageResponse, b as SwitchChainArgs, W as WatchAssetArgs, c as WatchAssetResponse, d as addChain, g as getAccounts, e as getPermissions, r as requestAccounts, f as requestPermissions, s as signMessage, h as switchChain, w as watchAsset } from './watchAsset-afaad3c7.js'; | ||
export { F as FormattedTransactionRequest, S as SendTransactionArgs, a as SendTransactionResponse, s as sendTransaction } from './sendTransaction-1c8290a9.js'; | ||
import './chain-32f56cfa.js'; | ||
export { G as GetPermissionsResponse, R as RequestPermissionsResponse, S as SignMessageArgs, a as SignMessageResponse, b as SwitchChainArgs, W as WatchAssetArgs, c as WatchAssetResponse, d as addChain, g as getAccounts, e as getPermissions, r as requestAccounts, f as requestPermissions, s as signMessage, h as switchChain, w as watchAsset } from './watchAsset-efd3dd05.js'; | ||
export { F as FormattedTransactionRequest, S as SendTransactionArgs, a as SendTransactionResponse, s as sendTransaction } from './sendTransaction-f17a2389.js'; | ||
import './chain-4b39613a.js'; | ||
import '@wagmi/chains'; | ||
import './createWalletClient-f69a5230.js'; | ||
import './eip1193-6c485d63.js'; | ||
import './createClient-5d316c7e.js'; | ||
import './transactionRequest-341b6ed2.js'; | ||
import './createWalletClient-c10df94d.js'; | ||
import './eip1193-4c24765a.js'; | ||
import './createClient-55a04188.js'; | ||
import './transactionRequest-93e9f001.js'; |
@@ -11,4 +11,4 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkEC3NUIJEjs = require('./chunk-EC3NUIJE.js'); | ||
require('./chunk-O2GYLJVD.js'); | ||
var _chunkS77NLWHOjs = require('./chunk-S77NLWHO.js'); | ||
require('./chunk-V5U5S7PQ.js'); | ||
@@ -24,3 +24,3 @@ | ||
exports.addChain = _chunkEC3NUIJEjs.addChain; exports.getAccounts = _chunkEC3NUIJEjs.getAccounts; exports.getPermissions = _chunkEC3NUIJEjs.getPermissions; exports.requestAccounts = _chunkEC3NUIJEjs.requestAccounts; exports.requestPermissions = _chunkEC3NUIJEjs.requestPermissions; exports.sendTransaction = _chunkEC3NUIJEjs.sendTransaction; exports.signMessage = _chunkEC3NUIJEjs.signMessage; exports.switchChain = _chunkEC3NUIJEjs.switchChain; exports.watchAsset = _chunkEC3NUIJEjs.watchAsset; | ||
exports.addChain = _chunkS77NLWHOjs.addChain; exports.getAccounts = _chunkS77NLWHOjs.getAccounts; exports.getPermissions = _chunkS77NLWHOjs.getPermissions; exports.requestAccounts = _chunkS77NLWHOjs.requestAccounts; exports.requestPermissions = _chunkS77NLWHOjs.requestPermissions; exports.sendTransaction = _chunkS77NLWHOjs.sendTransaction; exports.signMessage = _chunkS77NLWHOjs.signMessage; exports.switchChain = _chunkS77NLWHOjs.switchChain; exports.watchAsset = _chunkS77NLWHOjs.watchAsset; | ||
//# sourceMappingURL=wallet.js.map |
@@ -1,3 +0,3 @@ | ||
import { R as Requests, E as Events } from './eip1193-6c485d63.js'; | ||
import './chain-32f56cfa.js'; | ||
import { R as Requests, E as Events } from './eip1193-4c24765a.js'; | ||
import './chain-4b39613a.js'; | ||
import '@wagmi/chains'; | ||
@@ -4,0 +4,0 @@ |
@@ -7,5 +7,6 @@ { | ||
"@wagmi/chains": "~0.2.6", | ||
"abitype": "~0.2.5" | ||
"abitype": "~0.3.0", | ||
"idna-uts46-hx": "^4.1.2" | ||
}, | ||
"version": "0.0.1-alpha.21", | ||
"version": "0.0.1-alpha.22", | ||
"files": [ | ||
@@ -37,2 +38,7 @@ "/actions", | ||
}, | ||
"./ens": { | ||
"types": "./dist/ens.d.ts", | ||
"module": "./dist/ens.mjs", | ||
"default": "./dist/ens.js" | ||
}, | ||
"./public": { | ||
@@ -39,0 +45,0 @@ "types": "./dist/public.d.ts", |
import { providers } from 'ethers' | ||
import { JsonRpcProvider } from 'ethers@6' | ||
import Web3 from 'web3' | ||
import { JsonRpcProvider } from 'essential-eth' | ||
@@ -11,6 +11,6 @@ import { localhost } from '../chains' | ||
export const web3Provider = new Web3(localhost.rpcUrls.default.http[0]) | ||
export const essentialProvider = new JsonRpcProvider( | ||
export const ethersV6Provider = new JsonRpcProvider( | ||
localhost.rpcUrls.default.http[0], | ||
) | ||
export const web3Provider = new Web3(localhost.rpcUrls.default.http[0]) |
@@ -7,3 +7,3 @@ export { | ||
export { essentialProvider, ethersProvider, web3Provider } from './bench' | ||
export { ethersProvider, ethersV6Provider, web3Provider } from './bench' | ||
@@ -21,2 +21,4 @@ export { | ||
createHttpServer, | ||
deploy, | ||
deployBAYC, | ||
publicClient, | ||
@@ -23,0 +25,0 @@ testClient, |
/* c8 ignore start */ | ||
import { localhost } from '../chains' | ||
import { Abi } from 'abitype' | ||
import errorsExample from '../../contracts/out/ErrorsExample.sol/ErrorsExample.json' | ||
import { | ||
deployContract, | ||
DeployContractArgs, | ||
getTransactionReceipt, | ||
mine, | ||
} from '../actions' | ||
import { Chain, localhost } from '../chains' | ||
import { | ||
createPublicClient, | ||
@@ -14,2 +22,3 @@ createTestClient, | ||
import { accounts, localWsUrl } from './constants' | ||
import { errorsExampleABI } from './generated' | ||
@@ -19,2 +28,4 @@ import type { RequestListener } from 'http' | ||
import type { AddressInfo } from 'net' | ||
import { baycContractConfig } from './abis' | ||
import { Hex } from '../types' | ||
@@ -114,2 +125,29 @@ export const publicClient = | ||
} | ||
export async function deploy<TAbi extends Abi = Abi>( | ||
args: DeployContractArgs<Chain, TAbi>, | ||
) { | ||
const hash = await deployContract(walletClient, args) | ||
await mine(testClient, { blocks: 1 }) | ||
const { contractAddress } = await getTransactionReceipt(publicClient, { | ||
hash, | ||
}) | ||
return { contractAddress } | ||
} | ||
export async function deployBAYC() { | ||
return deploy({ | ||
...baycContractConfig, | ||
args: ['Bored Ape Wagmi Club', 'BAYC', 69420n, 0n], | ||
from: accounts[0].address, | ||
}) | ||
} | ||
export async function deployErrorExample() { | ||
return deploy({ | ||
abi: errorsExampleABI, | ||
bytecode: errorsExample.bytecode.object as Hex, | ||
from: accounts[0].address, | ||
}) | ||
} | ||
/* c8 ignore stop */ |
@@ -5,4 +5,4 @@ import { bench, describe } from 'vitest' | ||
accounts, | ||
essentialProvider, | ||
ethersProvider, | ||
ethersV6Provider, | ||
publicClient, | ||
@@ -34,4 +34,4 @@ web3Provider, | ||
bench('web3.js: `call`', async () => { | ||
await web3Provider.eth.call({ | ||
bench('ethers@6: `call`', async () => { | ||
await ethersV6Provider.call({ | ||
data: name4bytes, | ||
@@ -43,4 +43,4 @@ from: accounts[0].address, | ||
bench('essential-eth: `call`', async () => { | ||
await essentialProvider.call({ | ||
bench('web3.js: `call`', async () => { | ||
await web3Provider.eth.call({ | ||
data: name4bytes, | ||
@@ -47,0 +47,0 @@ from: accounts[0].address, |
@@ -1,2 +0,2 @@ | ||
import { Abi } from 'abitype' | ||
import { Abi, Narrow } from 'abitype' | ||
import { WalletClient } from '../../clients' | ||
@@ -14,3 +14,3 @@ | ||
TChain extends Chain = Chain, | ||
TAbi extends Abi = Abi, | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
> = Omit< | ||
@@ -20,3 +20,3 @@ SendTransactionArgs<TChain>, | ||
> & { | ||
abi: TAbi | ||
abi: Narrow<TAbi> | ||
bytecode: Hex | ||
@@ -27,3 +27,3 @@ } & ExtractConstructorArgsFromAbi<TAbi> | ||
export function deployContract<TChain extends Chain, TAbi extends Abi = Abi>( | ||
export function deployContract<TChain extends Chain, TAbi extends Abi>( | ||
walletClient: WalletClient, | ||
@@ -30,0 +30,0 @@ { abi, args, bytecode, ...request }: DeployContractArgs<TChain, TAbi>, |
@@ -5,4 +5,4 @@ import { bench, describe } from 'vitest' | ||
accounts, | ||
essentialProvider, | ||
ethersProvider, | ||
ethersV6Provider, | ||
publicClient, | ||
@@ -32,12 +32,12 @@ web3Provider, | ||
bench('web3.js: `estimateGas`', async () => { | ||
await web3Provider.eth.estimateGas({ | ||
bench('ethers@6: `estimateGas`', async () => { | ||
await ethersV6Provider.estimateGas({ | ||
from: accounts[0].address, | ||
to: accounts[1].address, | ||
value: '1000000000000', | ||
value: parseEther('1'), | ||
}) | ||
}) | ||
bench('essential-eth: `call`', async () => { | ||
await essentialProvider.estimateGas({ | ||
bench('web3.js: `estimateGas`', async () => { | ||
await web3Provider.eth.estimateGas({ | ||
from: accounts[0].address, | ||
@@ -44,0 +44,0 @@ to: accounts[1].address, |
import { bench, describe } from 'vitest' | ||
import { | ||
essentialProvider, | ||
ethersProvider, | ||
ethersV6Provider, | ||
publicClient, | ||
@@ -21,9 +21,9 @@ web3Provider, | ||
bench('ethers@6: `getBlock`', async () => { | ||
await ethersV6Provider.getBlock('latest') | ||
}) | ||
bench('web3.js: `getBlock`', async () => { | ||
await web3Provider.eth.getBlock('latest') | ||
}) | ||
bench('essential-eth: `getBlock`', async () => { | ||
await essentialProvider.getBlock('latest') | ||
}) | ||
}) |
import { bench, describe } from 'vitest' | ||
import { | ||
essentialProvider, | ||
ethersProvider, | ||
ethersV6Provider, | ||
publicClient, | ||
@@ -21,9 +21,9 @@ web3Provider, | ||
bench('ethers@6: `getBlockNumber`', async () => { | ||
await ethersV6Provider.getBlockNumber() | ||
}) | ||
bench('web3.js: `getBlockNumber`', async () => { | ||
await web3Provider.eth.getBlockNumber() | ||
}) | ||
bench('essential-eth: `getBlockNumber`', async () => { | ||
await essentialProvider.getBlockNumber() | ||
}) | ||
}) |
import { bench, describe } from 'vitest' | ||
import { | ||
essentialProvider, | ||
ethersProvider, | ||
publicClient, | ||
web3Provider, | ||
} from '../../_test' | ||
import { ethersProvider, publicClient, web3Provider } from '../../_test' | ||
@@ -24,6 +19,2 @@ import { getGasPrice } from './getGasPrice' | ||
}) | ||
bench('essential-eth: `getGasPrice`', async () => { | ||
await essentialProvider.getGasPrice() | ||
}) | ||
}) |
import { bench, describe } from 'vitest' | ||
import { | ||
essentialProvider, | ||
ethersProvider, | ||
ethersV6Provider, | ||
publicClient, | ||
@@ -26,9 +26,9 @@ web3Provider, | ||
bench('ethers@6: `getTransaction`', async () => { | ||
await ethersV6Provider.getTransaction(hash) | ||
}) | ||
bench('web3.js: `getTransaction`', async () => { | ||
await web3Provider.eth.getTransaction(hash) | ||
}) | ||
bench('essential-eth: `getTransaction`', async () => { | ||
await essentialProvider.getTransaction(hash) | ||
}) | ||
}) |
import { bench, describe } from 'vitest' | ||
import { | ||
essentialProvider, | ||
ethersProvider, | ||
ethersV6Provider, | ||
publicClient, | ||
@@ -26,9 +26,9 @@ web3Provider, | ||
bench('ethers@6: `getTransactionReceipt`', async () => { | ||
await ethersV6Provider.getTransactionReceipt(hash) | ||
}) | ||
bench('web3.js: `getTransactionReceipt`', async () => { | ||
await web3Provider.eth.getTransactionReceipt(hash) | ||
}) | ||
bench('essential-eth: `getTransactionReceipt`', async () => { | ||
await essentialProvider.getTransactionReceipt(hash) | ||
}) | ||
}) |
@@ -10,15 +10,11 @@ /** | ||
import { | ||
accounts, | ||
initialBlockNumber, | ||
publicClient, | ||
testClient, | ||
vitalikAddress, | ||
wagmiContractConfig, | ||
walletClient, | ||
} from '../../_test' | ||
import { baycContractConfig } from '../../_test/abis' | ||
import { encodeFunctionData } from '../../utils' | ||
import { mine } from '../test' | ||
import { sendTransaction } from '../wallet' | ||
import { errorsExampleABI } from '../../_test/generated' | ||
import { deployErrorExample } from '../../_test/utils' | ||
import { deployContract } from './deployContract' | ||
import { getTransactionReceipt } from './getTransactionReceipt' | ||
import { readContract } from './readContract' | ||
@@ -90,2 +86,3 @@ | ||
...wagmiContractConfig, | ||
blockNumber: initialBlockNumber, | ||
functionName: 'totalSupply', | ||
@@ -95,4 +92,219 @@ }), | ||
}) | ||
test('overloaded function', async () => { | ||
expect( | ||
await readContract(publicClient, { | ||
...wagmiContractConfig, | ||
abi: [ | ||
{ | ||
inputs: [{ type: 'uint256', name: 'x' }], | ||
name: 'balanceOf', | ||
outputs: [{ type: 'address', name: 'x' }], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
...wagmiContractConfig.abi, | ||
], | ||
functionName: 'balanceOf', | ||
args: ['0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC'], | ||
}), | ||
).toEqual(3n) | ||
}) | ||
}) | ||
describe('bayc', () => { | ||
test('revert', async () => { | ||
await expect(() => | ||
readContract(publicClient, { | ||
...baycContractConfig, | ||
functionName: 'tokenOfOwnerByIndex', | ||
args: [vitalikAddress, 5n], | ||
}), | ||
).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
"The contract function \\"tokenOfOwnerByIndex\\" reverted with the following reason: | ||
EnumerableSet: index out of bounds | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: tokenOfOwnerByIndex(address owner, uint256 index) | ||
Arguments: (0xd8da6bf26964af9d7eed9e03e53415d37aa96045, 5) | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2" | ||
`) | ||
}) | ||
test('revert', async () => { | ||
await expect(() => | ||
readContract(publicClient, { | ||
...baycContractConfig, | ||
functionName: 'ownerOf', | ||
args: [420213123123n], | ||
}), | ||
).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
"The contract function \\"ownerOf\\" reverted with the following reason: | ||
ERC721: owner query for nonexistent token | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: ownerOf(uint256 tokenId) | ||
Arguments: (420213123123) | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2" | ||
`) | ||
}) | ||
}) | ||
describe('contract errors', () => { | ||
test('revert', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
readContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'revertRead', | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "revertRead" reverted with the following reason: | ||
This is a revert message | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: revertRead() | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('assert', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
readContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'assertRead', | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "assertRead" reverted with the following reason: | ||
An \`assert\` condition failed. | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: assertRead() | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('overflow', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
readContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'overflowRead', | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "overflowRead" reverted with the following reason: | ||
Arithmic operation resulted in underflow or overflow. | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: overflowRead() | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('divide by zero', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
readContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'divideByZeroRead', | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "divideByZeroRead" reverted with the following reason: | ||
Division or modulo by zero (e.g. \`5 / 0\` or \`23 % 0\`). | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: divideByZeroRead() | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('require', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
readContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'requireRead', | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "requireRead" reverted with the following reason: | ||
execution reverted | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: requireRead() | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('custom error: simple', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
readContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'simpleCustomRead', | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "simpleCustomRead" reverted. | ||
Error: SimpleError(string message) | ||
Arguments: (bugger) | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: simpleCustomRead() | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('custom error: complex', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
readContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'complexCustomRead', | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "complexCustomRead" reverted. | ||
Error: ComplexError((address sender, uint256 bar), string message, uint256 number) | ||
Arguments: ({"sender":"0x0000000000000000000000000000000000000000","bar":"69"}, bugger, 69) | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: complexCustomRead() | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
}) | ||
test('fake contract address', async () => { | ||
@@ -106,3 +318,5 @@ await expect(() => | ||
).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
"The contract method \\"totalSupply\\" returned no data (\\"0x\\"). This could be due to any of the following: | ||
"The contract function \\"totalSupply\\" returned no data (\\"0x\\"). | ||
This could be due to any of the following: | ||
- The contract does not have the function \\"totalSupply\\", | ||
@@ -112,22 +326,8 @@ - The parameters passed to the contract function may be invalid, or | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: totalSupply() | ||
> \\"0x\\" | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: totalSupply() | ||
Docs: https://viem.sh/docs/contract/readContract | ||
Version: viem@1.0.2" | ||
`) | ||
}) | ||
// Deploy BAYC Contract | ||
async function deployBAYC() { | ||
const hash = await deployContract(walletClient, { | ||
...baycContractConfig, | ||
args: ['Bored Ape Wagmi Club', 'BAYC', 69420n, 0n], | ||
from: accounts[0].address, | ||
}) | ||
await mine(testClient, { blocks: 1 }) | ||
const { contractAddress } = await getTransactionReceipt(publicClient, { | ||
hash, | ||
}) | ||
return { contractAddress } | ||
} |
import { Abi } from 'abitype' | ||
import type { PublicClient } from '../../clients' | ||
import { BaseError } from '../../errors' | ||
import type { | ||
Address, | ||
ExtractArgsFromAbi, | ||
ContractConfig, | ||
ExtractResultFromAbi, | ||
ExtractFunctionNameFromAbi, | ||
Formatter, | ||
@@ -16,2 +15,3 @@ } from '../../types' | ||
getContractError, | ||
DecodeFunctionResultArgs, | ||
} from '../../utils' | ||
@@ -26,21 +26,5 @@ import { call, CallArgs, FormattedCall } from './call' | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TFunctionName extends string = any, | ||
> = Omit< | ||
CallArgs, | ||
| 'accessList' | ||
| 'chain' | ||
| 'from' | ||
| 'gas' | ||
| 'gasPrice' | ||
| 'maxFeePerGas' | ||
| 'maxPriorityFeePerGas' | ||
| 'nonce' | ||
| 'to' | ||
| 'data' | ||
| 'value' | ||
> & { | ||
address: Address | ||
abi: TAbi | ||
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName, 'pure' | 'view'> | ||
} & ExtractArgsFromAbi<TAbi, TFunctionName> | ||
TFunctionName extends string = string, | ||
> = Pick<CallArgs, 'blockNumber' | 'blockTag'> & | ||
ContractConfig<TAbi, TFunctionName, 'view' | 'pure'> | ||
@@ -53,4 +37,4 @@ export type ReadContractResponse< | ||
export async function readContract< | ||
TAbi extends Abi = Abi, | ||
TFunctionName extends string = any, | ||
TAbi extends Abi | readonly unknown[], | ||
TFunctionName extends string, | ||
>( | ||
@@ -79,10 +63,12 @@ client: PublicClient, | ||
abi, | ||
args, | ||
functionName, | ||
data: data || '0x', | ||
}) | ||
} as DecodeFunctionResultArgs<TAbi, TFunctionName>) | ||
} catch (err) { | ||
throw getContractError(err, { | ||
abi, | ||
throw getContractError(err as BaseError, { | ||
abi: abi as Abi, | ||
address, | ||
args, | ||
docsPath: '/docs/contract/readContract', | ||
functionName, | ||
@@ -89,0 +75,0 @@ }) |
import { Contract } from 'ethers' | ||
import { Contract as ContractV6 } from 'ethers@6' | ||
import { bench, describe } from 'vitest' | ||
@@ -31,2 +32,11 @@ | ||
}) | ||
bench('ethers@6: `callStatic`', async () => { | ||
const wagmi = new ContractV6( | ||
wagmiContractConfig.address, | ||
wagmiContractConfig.abi, | ||
ethersProvider, | ||
) | ||
await wagmi.mint.staticCall(1) | ||
}) | ||
}) |
@@ -14,2 +14,3 @@ /** | ||
accounts, | ||
deployBAYC, | ||
publicClient, | ||
@@ -25,5 +26,5 @@ testClient, | ||
import { deployContract } from './deployContract' | ||
import { getTransactionReceipt } from './getTransactionReceipt' | ||
import { simulateContract } from './simulateContract' | ||
import { deployErrorExample } from '../../_test/utils' | ||
import { errorsExampleABI } from '../../_test/generated' | ||
@@ -58,2 +59,14 @@ describe('wagmi', () => { | ||
test('overloaded function', async () => { | ||
expect( | ||
( | ||
await simulateContract(publicClient, { | ||
...wagmiContractConfig, | ||
from: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC', | ||
functionName: 'mint', | ||
}) | ||
).result, | ||
).toEqual(undefined) | ||
}) | ||
test('revert', async () => { | ||
@@ -68,10 +81,11 @@ await expect(() => | ||
).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
"ERC721: approval to current owner | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
"The contract function \\"approve\\" reverted with the following reason: | ||
ERC721: approval to current owner | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: approve(address to, uint256 tokenId) | ||
Arguments: (0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC, 420) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Details: execution reverted: ERC721: approval to current owner | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2" | ||
@@ -87,10 +101,11 @@ `) | ||
).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
"Token ID is taken | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
"The contract function \\"mint\\" reverted with the following reason: | ||
Token ID is taken | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: mint(uint256 tokenId) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Details: execution reverted: Token ID is taken | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2" | ||
@@ -110,10 +125,11 @@ `) | ||
).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
"ERC721: transfer caller is not owner nor approved | ||
Sender: 0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC | ||
"The contract function \\"safeTransferFrom\\" reverted with the following reason: | ||
ERC721: transfer caller is not owner nor approved | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: safeTransferFrom(address from, address to, uint256 tokenId) | ||
Arguments: (0x1a1E021A302C237453D3D45c7B82B19cEEB7E2e6, 0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC, 1) | ||
Sender: 0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC | ||
Details: execution reverted: ERC721: transfer caller is not owner nor approved | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2" | ||
@@ -187,10 +203,11 @@ `) | ||
).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
"Sale must be active to mint Ape | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
"The contract function \\"mintApe\\" reverted with the following reason: | ||
Sale must be active to mint Ape | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Details: execution reverted: Sale must be active to mint Ape | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2" | ||
@@ -202,2 +219,169 @@ `) | ||
describe('contract errors', () => { | ||
test('revert', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
simulateContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'revertWrite', | ||
from: accounts[0].address, | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "revertWrite" reverted with the following reason: | ||
This is a revert message | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: revertWrite() | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('assert', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
simulateContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'assertWrite', | ||
from: accounts[0].address, | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "assertWrite" reverted with the following reason: | ||
An \`assert\` condition failed. | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: assertWrite() | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('overflow', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
simulateContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'overflowWrite', | ||
from: accounts[0].address, | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "overflowWrite" reverted with the following reason: | ||
Arithmic operation resulted in underflow or overflow. | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: overflowWrite() | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('divide by zero', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
simulateContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'divideByZeroWrite', | ||
from: accounts[0].address, | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "divideByZeroWrite" reverted with the following reason: | ||
Division or modulo by zero (e.g. \`5 / 0\` or \`23 % 0\`). | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: divideByZeroWrite() | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('require', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
simulateContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'requireWrite', | ||
from: accounts[0].address, | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "requireWrite" reverted with the following reason: | ||
execution reverted | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: requireWrite() | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('custom error: simple', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
simulateContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'simpleCustomWrite', | ||
from: accounts[0].address, | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "simpleCustomWrite" reverted. | ||
Error: SimpleError(string message) | ||
Arguments: (bugger) | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: simpleCustomWrite() | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('custom error: complex', async () => { | ||
const { contractAddress } = await deployErrorExample() | ||
await expect(() => | ||
simulateContract(publicClient, { | ||
abi: errorsExampleABI, | ||
address: contractAddress!, | ||
functionName: 'complexCustomWrite', | ||
from: accounts[0].address, | ||
}), | ||
).rejects.toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "complexCustomWrite" reverted. | ||
Error: ComplexError((address sender, uint256 bar), string message, uint256 number) | ||
Arguments: ({"sender":"0x0000000000000000000000000000000000000000","bar":"69"}, bugger, 69) | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: complexCustomWrite() | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
}) | ||
test('fake contract address', async () => { | ||
@@ -218,6 +402,7 @@ await expect(() => | ||
from: accounts[0].address, | ||
args: [], | ||
}), | ||
).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
"The contract method \\"mint\\" returned no data (\\"0x\\"). This could be due to any of the following: | ||
"The contract function \\"mint\\" returned no data (\\"0x\\"). | ||
This could be due to any of the following: | ||
- The contract does not have the function \\"mint\\", | ||
@@ -227,22 +412,9 @@ - The parameters passed to the contract function may be invalid, or | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: mint() | ||
> \\"0x\\" | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: mint() | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2" | ||
`) | ||
}) | ||
// Deploy BAYC Contract | ||
async function deployBAYC() { | ||
const hash = await deployContract(walletClient, { | ||
...baycContractConfig, | ||
args: ['Bored Ape Wagmi Club', 'BAYC', 69420n, 0n], | ||
from: accounts[0].address, | ||
}) | ||
await mine(testClient, { blocks: 1 }) | ||
const { contractAddress } = await getTransactionReceipt(publicClient, { | ||
hash, | ||
}) | ||
return { contractAddress } | ||
} |
@@ -1,7 +0,9 @@ | ||
import { Abi } from 'abitype' | ||
import { Abi, Narrow } from 'abitype' | ||
import type { PublicClient } from '../../clients' | ||
import { BaseError } from '../../errors' | ||
import type { | ||
Address, | ||
Chain, | ||
ContractConfig, | ||
ExtractArgsFromAbi, | ||
@@ -17,2 +19,3 @@ ExtractResultFromAbi, | ||
getContractError, | ||
DecodeFunctionResultArgs, | ||
} from '../../utils' | ||
@@ -26,12 +29,6 @@ import { WriteContractArgs } from '../wallet' | ||
TFunctionName extends string = any, | ||
> = Omit<CallArgs<TChain>, 'to' | 'data' | 'value'> & { | ||
address: Address | ||
abi: TAbi | ||
functionName: ExtractFunctionNameFromAbi< | ||
TAbi, | ||
TFunctionName, | ||
'payable' | 'nonpayable' | ||
> | ||
value?: GetValue<TAbi, TFunctionName, CallArgs<TChain>['value']> | ||
} & ExtractArgsFromAbi<TAbi, TFunctionName> | ||
> = Omit<CallArgs<TChain>, 'to' | 'data' | 'value'> & | ||
ContractConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> & { | ||
value?: GetValue<TAbi, TFunctionName, CallArgs<TChain>['value']> | ||
} | ||
@@ -44,7 +41,4 @@ export type SimulateContractResponse< | ||
result: ExtractResultFromAbi<TAbi, TFunctionName> | ||
request: WriteContractArgs<TChain, TAbi, TFunctionName> & { | ||
address: Address | ||
abi: TAbi | ||
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName> | ||
} & ExtractArgsFromAbi<TAbi, TFunctionName> | ||
request: WriteContractArgs<TChain, TAbi, TFunctionName> & | ||
ContractConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> | ||
} | ||
@@ -54,4 +48,4 @@ | ||
TChain extends Chain, | ||
TAbi extends Abi = Abi, | ||
TFunctionName extends string = any, | ||
TAbi extends Abi | readonly unknown[], | ||
TFunctionName extends string, | ||
>( | ||
@@ -80,5 +74,6 @@ client: PublicClient, | ||
abi, | ||
args, | ||
functionName, | ||
data: data || '0x', | ||
}) | ||
} as DecodeFunctionResultArgs) | ||
return { | ||
@@ -95,6 +90,7 @@ result, | ||
} catch (err) { | ||
throw getContractError(err, { | ||
abi, | ||
throw getContractError(err as BaseError, { | ||
abi: abi as Abi, | ||
address, | ||
args, | ||
docsPath: '/docs/contract/simulateContract', | ||
functionName, | ||
@@ -101,0 +97,0 @@ sender: callRequest.from, |
@@ -35,37 +35,41 @@ import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest' | ||
test('default', async () => { | ||
let logs: OnLogsResponse[] = [] | ||
test( | ||
'default', | ||
async () => { | ||
let logs: OnLogsResponse[] = [] | ||
const unwatch = watchContractEvent(publicClient, { | ||
...usdcContractConfig, | ||
onLogs: (logs_) => logs.push(logs_), | ||
}) | ||
const unwatch = watchContractEvent(publicClient, { | ||
...usdcContractConfig, | ||
onLogs: (logs_) => logs.push(logs_), | ||
}) | ||
await writeContract(walletClient, { | ||
...usdcContractConfig, | ||
from: vitalikAddress, | ||
functionName: 'transfer', | ||
args: [vitalikAddress, 1n], | ||
}) | ||
await writeContract(walletClient, { | ||
...usdcContractConfig, | ||
from: vitalikAddress, | ||
functionName: 'transfer', | ||
args: [vitalikAddress, 1n], | ||
}) | ||
await wait(1000) | ||
await writeContract(walletClient, { | ||
...usdcContractConfig, | ||
from: vitalikAddress, | ||
functionName: 'approve', | ||
args: [vitalikAddress, 1n], | ||
}) | ||
await writeContract(walletClient, { | ||
...usdcContractConfig, | ||
from: vitalikAddress, | ||
functionName: 'transfer', | ||
args: [vitalikAddress, 1n], | ||
}) | ||
await writeContract(walletClient, { | ||
...usdcContractConfig, | ||
from: vitalikAddress, | ||
functionName: 'transfer', | ||
args: [vitalikAddress, 1n], | ||
}) | ||
await wait(1000) | ||
await writeContract(walletClient, { | ||
...usdcContractConfig, | ||
from: vitalikAddress, | ||
functionName: 'approve', | ||
args: [vitalikAddress, 1n], | ||
}) | ||
await wait(2000) | ||
unwatch() | ||
await wait(2000) | ||
unwatch() | ||
expect(logs.length).toBe(2) | ||
expect(logs[0].length).toBe(2) | ||
expect(logs[1].length).toBe(1) | ||
}) | ||
expect(logs.length).toBe(2) | ||
expect(logs[0].length).toBe(2) | ||
expect(logs[1].length).toBe(1) | ||
}, | ||
{ retry: 3 }, | ||
) | ||
@@ -72,0 +76,0 @@ test('args: batch', async () => { |
@@ -12,3 +12,3 @@ import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest' | ||
} from '../../_test' | ||
import { impersonateAccount, stopImpersonatingAccount } from '../test' | ||
import { impersonateAccount, mine, stopImpersonatingAccount } from '../test' | ||
import { sendTransaction } from '../wallet' | ||
@@ -23,2 +23,3 @@ import * as createEventFilter from './createEventFilter' | ||
}) | ||
await mine(testClient, { blocks: 1 }) | ||
}) | ||
@@ -32,33 +33,37 @@ | ||
test('default', async () => { | ||
let logs: OnLogsResponse[] = [] | ||
test( | ||
'default', | ||
async () => { | ||
let logs: OnLogsResponse[] = [] | ||
const unwatch = watchEvent(publicClient, { | ||
onLogs: (logs_) => logs.push(logs_), | ||
}) | ||
const unwatch = watchEvent(publicClient, { | ||
onLogs: (logs_) => logs.push(logs_), | ||
}) | ||
await wait(1000) | ||
await sendTransaction(walletClient, { | ||
from: vitalikAddress, | ||
to: usdcContractConfig.address, | ||
data: transfer1Data(accounts[0].address), | ||
}) | ||
await sendTransaction(walletClient, { | ||
from: vitalikAddress, | ||
to: usdcContractConfig.address, | ||
data: transfer1Data(accounts[0].address), | ||
}) | ||
await wait(1000) | ||
await sendTransaction(walletClient, { | ||
from: vitalikAddress, | ||
to: usdcContractConfig.address, | ||
data: transfer1Data(accounts[1].address), | ||
}) | ||
await wait(2000) | ||
unwatch() | ||
await wait(1000) | ||
await sendTransaction(walletClient, { | ||
from: vitalikAddress, | ||
to: usdcContractConfig.address, | ||
data: transfer1Data(accounts[0].address), | ||
}) | ||
await sendTransaction(walletClient, { | ||
from: vitalikAddress, | ||
to: usdcContractConfig.address, | ||
data: transfer1Data(accounts[0].address), | ||
}) | ||
await wait(1000) | ||
await sendTransaction(walletClient, { | ||
from: vitalikAddress, | ||
to: usdcContractConfig.address, | ||
data: transfer1Data(accounts[1].address), | ||
}) | ||
await wait(2000) | ||
unwatch() | ||
expect(logs.length).toBe(2) | ||
expect(logs[0].length).toBe(2) | ||
expect(logs[1].length).toBe(1) | ||
}) | ||
expect(logs.length).toBe(2) | ||
expect(logs[0].length).toBe(2) | ||
expect(logs[1].length).toBe(1) | ||
}, | ||
{ retry: 3 }, | ||
) | ||
@@ -65,0 +70,0 @@ test('args: batch', async () => { |
@@ -38,3 +38,2 @@ import { expect, test } from 'vitest' | ||
Docs: https://viem.sh/TODO | ||
Version: viem@1.0.2" | ||
@@ -41,0 +40,0 @@ `, |
@@ -19,5 +19,4 @@ import { expect, test } from 'vitest' | ||
Details: Unrecognized chain. | ||
Version: viem@1.0.2 | ||
Internal Error: {"code":-4902,"details":"Unrecognized chain."}] | ||
Version: viem@1.0.2] | ||
`) | ||
}) |
@@ -38,5 +38,4 @@ import { expect, test } from 'vitest' | ||
Details: Token type ERC721 not supported. | ||
Version: viem@1.0.2 | ||
Internal Error: {\\"code\\":-32602,\\"details\\":\\"Token type ERC721 not supported.\\"}" | ||
Version: viem@1.0.2" | ||
`) | ||
}) |
@@ -20,2 +20,12 @@ import { expect, test } from 'vitest' | ||
functionName: 'mint', | ||
}), | ||
).toBeDefined() | ||
}) | ||
test('overloaded function', async () => { | ||
expect( | ||
await writeContract(walletClient, { | ||
...wagmiContractConfig, | ||
from: accounts[0].address, | ||
functionName: 'mint', | ||
args: [69420n], | ||
@@ -31,3 +41,2 @@ }), | ||
functionName: 'mint', | ||
args: [69420n], | ||
}) | ||
@@ -38,2 +47,22 @@ expect(await writeContract(walletClient, request)).toBeDefined() | ||
expect( | ||
await simulateContract(publicClient, { | ||
...wagmiContractConfig, | ||
from: accounts[0].address, | ||
functionName: 'mint', | ||
}), | ||
).toBeDefined() | ||
}) | ||
test('w/ simulateContract (overloaded)', async () => { | ||
const { request } = await simulateContract(publicClient, { | ||
...wagmiContractConfig, | ||
from: accounts[0].address, | ||
functionName: 'mint', | ||
args: [69421n], | ||
}) | ||
expect(await writeContract(walletClient, request)).toBeDefined() | ||
await mine(testClient, { blocks: 1 }) | ||
await expect(() => | ||
@@ -44,15 +73,16 @@ simulateContract(publicClient, { | ||
functionName: 'mint', | ||
args: [69420n], | ||
args: [69421n], | ||
}), | ||
).rejects.toThrowErrorMatchingInlineSnapshot(` | ||
"Token ID is taken | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
"The contract function \\"mint\\" reverted with the following reason: | ||
Token ID is taken | ||
Contract: 0x0000000000000000000000000000000000000000 | ||
Function: mint(uint256 tokenId) | ||
Arguments: (69420) | ||
Arguments: (69421) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Details: execution reverted: Token ID is taken | ||
Docs: https://viem.sh/docs/contract/simulateContract | ||
Version: viem@1.0.2" | ||
`) | ||
}) |
import { Abi } from 'abitype' | ||
import type { WalletClient } from '../../clients' | ||
import type { | ||
Address, | ||
Chain, | ||
ExtractArgsFromAbi, | ||
ExtractFunctionNameFromAbi, | ||
GetValue, | ||
} from '../../types' | ||
import type { Chain, ContractConfig, GetValue } from '../../types' | ||
import { EncodeFunctionDataArgs, encodeFunctionData } from '../../utils' | ||
@@ -21,9 +15,6 @@ import { | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TFunctionName extends string = any, | ||
TFunctionName extends string = string, | ||
> = Omit<SendTransactionArgs<TChain>, 'to' | 'data' | 'value'> & { | ||
address: Address | ||
abi: TAbi | ||
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName> | ||
value?: GetValue<TAbi, TFunctionName, SendTransactionArgs<TChain>['value']> | ||
} & ExtractArgsFromAbi<TAbi, TFunctionName> | ||
} & ContractConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> | ||
@@ -34,4 +25,4 @@ export type WriteContractResponse = SendTransactionResponse | ||
TChain extends Chain, | ||
TAbi extends Abi = Abi, | ||
TFunctionName extends string = any, | ||
TAbi extends Abi | readonly unknown[], | ||
TFunctionName extends string, | ||
>( | ||
@@ -38,0 +29,0 @@ client: WalletClient, |
@@ -129,2 +129,36 @@ import { assertType, describe, expect, test } from 'vitest' | ||
}) | ||
test('error (rpc)', async () => { | ||
let count = 0 | ||
const server1 = await createHttpServer((req, res) => { | ||
count++ | ||
res.writeHead(200, { | ||
'Content-Type': 'application/json', | ||
}) | ||
res.end(JSON.stringify({ error: 'ngmi' })) | ||
}) | ||
const server2 = await createHttpServer((req, res) => { | ||
count++ | ||
res.writeHead(500) | ||
res.end() | ||
}) | ||
const server3 = await createHttpServer((req, res) => { | ||
count++ | ||
res.writeHead(200, { | ||
'Content-Type': 'application/json', | ||
}) | ||
res.end(JSON.stringify({ result: '0x1' })) | ||
}) | ||
let transport = fallback([ | ||
http(server1.url), | ||
http(server2.url), | ||
http(server3.url), | ||
])({ | ||
chain: localhost, | ||
}) | ||
await expect(() => | ||
transport.config.request({ method: 'eth_blockNumber' }), | ||
).rejects.toThrowError() | ||
}) | ||
}) | ||
@@ -131,0 +165,0 @@ |
@@ -0,1 +1,2 @@ | ||
import { HttpRequestError, RpcError } from '../../errors' | ||
import type { Transport, TransportConfig } from './createTransport' | ||
@@ -34,3 +35,4 @@ import { createTransport } from './createTransport' | ||
} catch (err) { | ||
if (i < transports.length - 1) return fetch(i + 1) | ||
if (!(err instanceof RpcError) && i < transports.length - 1) | ||
return fetch(i + 1) | ||
throw err | ||
@@ -37,0 +39,0 @@ } |
@@ -106,3 +106,2 @@ import { assertType, describe, expect, test } from 'vitest' | ||
Docs: https://viem.sh/docs/clients/intro | ||
Version: viem@1.0.2" | ||
@@ -109,0 +108,0 @@ `, |
@@ -161,5 +161,4 @@ import { assertType, describe, expect, test } from 'vitest' | ||
Docs: https://viem.sh/docs/clients/intro | ||
Version: viem@1.0.2" | ||
`) | ||
}) |
@@ -28,3 +28,2 @@ import { expect, test } from 'vitest' | ||
Docs: https://viem.sh/lol | ||
Version: viem@1.0.2] | ||
@@ -73,3 +72,2 @@ `) | ||
Docs: https://viem.sh/lol | ||
Version: viem@1.0.2] | ||
@@ -76,0 +74,0 @@ `) |
@@ -20,2 +20,9 @@ import { expect, test } from 'vitest' | ||
`) | ||
expect(new BaseError('', { details: 'details' })).toMatchInlineSnapshot(` | ||
[ViemError: An error occurred. | ||
Details: details | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
@@ -33,3 +40,40 @@ | ||
Docs: https://viem.sh/lol | ||
Details: details | ||
Version: viem@1.0.2] | ||
`) | ||
expect( | ||
new BaseError('An error occurred.', { | ||
cause: new BaseError('error', { docsPath: '/docs' }), | ||
}), | ||
).toMatchInlineSnapshot(` | ||
[ViemError: An error occurred. | ||
Docs: https://viem.sh/docs | ||
Version: viem@1.0.2] | ||
`) | ||
expect( | ||
new BaseError('An error occurred.', { | ||
cause: new BaseError('error'), | ||
docsPath: '/lol', | ||
}), | ||
).toMatchInlineSnapshot(` | ||
[ViemError: An error occurred. | ||
Docs: https://viem.sh/lol | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('BaseError (w/ metaMessages)', () => { | ||
expect( | ||
new BaseError('An error occurred.', { | ||
details: 'details', | ||
metaMessages: ['Reason: idk', 'Cause: lol'], | ||
}), | ||
).toMatchInlineSnapshot(` | ||
[ViemError: An error occurred. | ||
Reason: idk | ||
Cause: lol | ||
Details: details | ||
@@ -53,3 +97,2 @@ Version: viem@1.0.2] | ||
Docs: https://viem.sh/lol | ||
Details: details | ||
@@ -71,3 +114,2 @@ Version: viem@1.0.2] | ||
Docs: https://viem.sh/lol | ||
Details: details | ||
@@ -74,0 +116,0 @@ Version: viem@1.0.2] |
// @ts-ignore | ||
import pkg from '../../package.json' | ||
import { stringify } from '../utils/stringify' | ||
@@ -8,3 +7,6 @@ /* c8 ignore next */ | ||
type BaseErrorArgs = { docsPath?: string } & ( | ||
type BaseErrorArgs = { | ||
docsPath?: string | ||
metaMessages?: string[] | ||
} & ( | ||
| { | ||
@@ -21,9 +23,10 @@ cause?: never | ||
export class BaseError extends Error { | ||
humanMessage: string | ||
details: string | ||
docsPath?: string | ||
metaMessages?: string[] | ||
shortMessage: string | ||
name = 'ViemError' | ||
constructor(humanMessage: string, args: BaseErrorArgs = {}) { | ||
constructor(shortMessage: string, args: BaseErrorArgs = {}) { | ||
const details = | ||
@@ -40,12 +43,8 @@ args.cause instanceof BaseError | ||
const message = [ | ||
humanMessage, | ||
...(docsPath ? ['', `Docs: https://viem.sh${docsPath}`] : []), | ||
shortMessage || 'An error occurred.', | ||
'', | ||
...(args.metaMessages ? [...args.metaMessages, ''] : []), | ||
...(docsPath ? [`Docs: https://viem.sh${docsPath}`] : []), | ||
...(details ? [`Details: ${details}`] : []), | ||
`Version: viem@${version}`, | ||
...(args.cause && | ||
!(args.cause instanceof BaseError) && | ||
Object.keys(args.cause).length > 0 | ||
? [`Internal Error: ${stringify(args.cause)}`] | ||
: []), | ||
].join('\n') | ||
@@ -58,4 +57,5 @@ | ||
this.docsPath = docsPath | ||
this.humanMessage = humanMessage | ||
this.metaMessages = args.metaMessages | ||
this.shortMessage = shortMessage | ||
} | ||
} |
@@ -8,13 +8,13 @@ import { expect, test } from 'vitest' | ||
).toMatchInlineSnapshot(` | ||
[BlockNotFoundError: Block at number "69420" could not be found. | ||
[BlockNotFoundError: Block at number "69420" could not be found. | ||
Version: viem@1.0.2] | ||
`) | ||
Version: viem@1.0.2] | ||
`) | ||
expect( | ||
new BlockNotFoundError({ blockHash: '0x69420' }), | ||
).toMatchInlineSnapshot(` | ||
[BlockNotFoundError: Block at hash "0x69420" could not be found. | ||
[BlockNotFoundError: Block at hash "0x69420" could not be found. | ||
Version: viem@1.0.2] | ||
`) | ||
Version: viem@1.0.2] | ||
`) | ||
expect(new BlockNotFoundError({})).toMatchInlineSnapshot(` | ||
@@ -21,0 +21,0 @@ [BlockNotFoundError: Block could not be found. |
import { Abi } from 'abitype' | ||
import { Address } from '../types' | ||
import { panicReasons } from '../constants' | ||
import { Address, Hex } from '../types' | ||
import { | ||
DecodeErrorResultResponse, | ||
decodeErrorResult, | ||
getAbiItem, | ||
formatAbiItemWithArgs, | ||
formatAbiItem, | ||
} from '../utils' | ||
import { BaseError } from './base' | ||
export class ContractMethodExecutionError extends BaseError { | ||
abi?: Abi | ||
export class ContractFunctionExecutionError extends BaseError { | ||
abi: Abi | ||
args?: unknown[] | ||
cause: BaseError | ||
contractAddress?: Address | ||
formattedArgs?: string | ||
functionName?: string | ||
reason?: string | ||
functionName: string | ||
sender?: Address | ||
name = 'ContractMethodExecutionError' | ||
name = 'ContractFunctionExecutionError' | ||
constructor( | ||
message?: string, | ||
cause: BaseError, | ||
{ | ||
abi, | ||
args, | ||
cause, | ||
contractAddress, | ||
formattedArgs, | ||
docsPath, | ||
functionName, | ||
functionWithParams, | ||
sender, | ||
}: { | ||
abi?: Abi | ||
abi: Abi | ||
args?: any | ||
cause?: Error | ||
contractAddress?: Address | ||
formattedArgs?: string | ||
functionName?: string | ||
functionWithParams?: string | ||
docsPath?: string | ||
functionName: string | ||
sender?: Address | ||
} = {}, | ||
}, | ||
) { | ||
const abiItem = getAbiItem({ abi, args, name: functionName }) | ||
const formattedArgs = abiItem | ||
? formatAbiItemWithArgs({ | ||
abiItem, | ||
args, | ||
includeFunctionName: false, | ||
includeName: false, | ||
}) | ||
: undefined | ||
const functionWithParams = abiItem | ||
? formatAbiItem(abiItem, { includeName: true }) | ||
: undefined | ||
super( | ||
[ | ||
message, | ||
' ', | ||
sender && `Sender: ${sender}`, | ||
contractAddress && | ||
`Contract: ${ | ||
/* c8 ignore start */ | ||
process.env.TEST | ||
? '0x0000000000000000000000000000000000000000' | ||
: contractAddress | ||
/* c8 ignore end */ | ||
}`, | ||
functionWithParams && `Function: ${functionWithParams}`, | ||
formattedArgs && | ||
`Arguments: ${[...Array(functionName?.length ?? 0).keys()] | ||
.map(() => ' ') | ||
.join('')}${formattedArgs}`, | ||
] | ||
.filter(Boolean) | ||
.join('\n'), | ||
cause.shortMessage || | ||
`An unknown error occurred while executing the contract function "${functionName}".`, | ||
{ | ||
cause, | ||
docsPath, | ||
metaMessages: [ | ||
...(cause.metaMessages ? [...cause.metaMessages, ' '] : []), | ||
contractAddress && | ||
`Contract: ${ | ||
/* c8 ignore start */ | ||
process.env.TEST | ||
? '0x0000000000000000000000000000000000000000' | ||
: contractAddress | ||
/* c8 ignore end */ | ||
}`, | ||
functionWithParams && `Function: ${functionWithParams}`, | ||
formattedArgs && | ||
formattedArgs !== '()' && | ||
`Arguments: ${[...Array(functionName?.length ?? 0).keys()] | ||
.map(() => ' ') | ||
.join('')}${formattedArgs}`, | ||
sender && `Sender: ${sender}`, | ||
].filter(Boolean) as string[], | ||
}, | ||
) | ||
if (message) this.reason = message | ||
this.abi = abi | ||
this.args = args | ||
this.cause = cause | ||
this.contractAddress = contractAddress | ||
@@ -72,55 +90,90 @@ this.functionName = functionName | ||
export class ContractMethodZeroDataError extends BaseError { | ||
abi?: Abi | ||
args?: unknown[] | ||
contractAddress?: Address | ||
functionName?: string | ||
functionWithParams?: string | ||
export class ContractFunctionRevertedError extends BaseError { | ||
name = 'ContractFunctionRevertedError' | ||
name = 'ContractMethodZeroDataError' | ||
data?: DecodeErrorResultResponse | ||
reason?: string | ||
constructor({ | ||
abi, | ||
args, | ||
cause, | ||
contractAddress, | ||
data, | ||
functionName, | ||
functionWithParams, | ||
}: { | ||
abi?: Abi | ||
args?: any | ||
cause?: Error | ||
contractAddress?: Address | ||
functionName?: string | ||
functionWithParams?: string | ||
} = {}) { | ||
message, | ||
}: { abi: Abi; data?: Hex; functionName: string; message?: string }) { | ||
let decodedData: DecodeErrorResultResponse | undefined = undefined | ||
let metaMessages | ||
let reason | ||
if (data && data !== '0x') { | ||
decodedData = decodeErrorResult({ abi, data }) | ||
const { abiItem, errorName, args: errorArgs } = decodedData | ||
if (errorName === 'Error') { | ||
reason = (errorArgs as [string])[0] | ||
} else if (errorName === 'Panic') { | ||
const [firstArg] = errorArgs as [number] | ||
reason = panicReasons[firstArg as keyof typeof panicReasons] | ||
} else if (errorArgs) { | ||
const errorWithParams = abiItem | ||
? formatAbiItem(abiItem, { includeName: true }) | ||
: undefined | ||
const formattedArgs = abiItem | ||
? formatAbiItemWithArgs({ | ||
abiItem, | ||
args: errorArgs, | ||
includeFunctionName: false, | ||
includeName: false, | ||
}) | ||
: undefined | ||
metaMessages = [ | ||
errorWithParams ? `Error: ${errorWithParams}` : '', | ||
formattedArgs && formattedArgs !== '()' | ||
? `Arguments: ${[...Array(errorName?.length ?? 0).keys()] | ||
.map(() => ' ') | ||
.join('')}${formattedArgs}` | ||
: '', | ||
] | ||
} | ||
} else if (message) reason = message | ||
super( | ||
[ | ||
`The contract method "${functionName}" returned no data ("0x"). This could be due to any of the following:`, | ||
`- The contract does not have the function "${functionName}",`, | ||
'- The parameters passed to the contract function may be invalid, or', | ||
'- The address is not a contract.', | ||
' ', | ||
contractAddress && | ||
`Contract: ${ | ||
/* c8 ignore start */ | ||
process.env.TEST | ||
? '0x0000000000000000000000000000000000000000' | ||
: contractAddress | ||
/* c8 ignore end */ | ||
}`, | ||
functionWithParams && `Function: ${functionWithParams}`, | ||
functionWithParams && ` > "0x"`, | ||
] | ||
.filter(Boolean) | ||
.join('\n'), | ||
reason | ||
? [ | ||
`The contract function "${functionName}" reverted with the following reason:`, | ||
reason, | ||
].join('\n') | ||
: `The contract function "${functionName}" reverted.`, | ||
{ | ||
cause, | ||
metaMessages, | ||
}, | ||
) | ||
this.abi = abi | ||
this.args = args | ||
this.contractAddress = contractAddress | ||
this.functionName = functionName | ||
this.reason = reason | ||
this.data = decodedData | ||
} | ||
} | ||
export class ContractFunctionZeroDataError extends BaseError { | ||
name = 'ContractFunctionZeroDataError' | ||
constructor({ functionName }: { functionName: string }) { | ||
super(`The contract function "${functionName}" returned no data ("0x").`, { | ||
metaMessages: [ | ||
'This could be due to any of the following:', | ||
`- The contract does not have the function "${functionName}",`, | ||
'- The parameters passed to the contract function may be invalid, or', | ||
'- The address is not a contract.', | ||
], | ||
}) | ||
} | ||
} | ||
export class RawContractError extends BaseError { | ||
code = 3 | ||
name = 'RawContractError' | ||
data?: Hex | ||
constructor({ data, message }: { data?: Hex; message?: string }) { | ||
super(message || '') | ||
this.data = data | ||
} | ||
} |
@@ -28,4 +28,6 @@ export { | ||
export { | ||
ContractMethodExecutionError, | ||
ContractMethodZeroDataError, | ||
ContractFunctionExecutionError, | ||
ContractFunctionRevertedError, | ||
ContractFunctionZeroDataError, | ||
RawContractError, | ||
} from './contract' | ||
@@ -32,0 +34,0 @@ |
@@ -30,3 +30,3 @@ import { expect, test } from 'vitest' | ||
{ | ||
humanMessage: 'An internal error was received.', | ||
shortMessage: 'An internal error was received.', | ||
}, | ||
@@ -50,3 +50,3 @@ ), | ||
}), | ||
{ humanMessage: 'An internal error was received.' }, | ||
{ shortMessage: 'An internal error was received.' }, | ||
), | ||
@@ -70,3 +70,3 @@ ).toMatchInlineSnapshot(` | ||
{ | ||
humanMessage: 'An internal error was received.', | ||
shortMessage: 'An internal error was received.', | ||
docsPath: '/lol', | ||
@@ -79,3 +79,2 @@ }, | ||
Docs: https://viem.sh/lol | ||
Details: error details | ||
@@ -82,0 +81,0 @@ Version: viem@1.0.2] |
@@ -7,5 +7,5 @@ import { BaseError } from './base' | ||
err: Error, | ||
{ docsPath, humanMessage }: { docsPath?: string; humanMessage: string }, | ||
{ docsPath, shortMessage }: { docsPath?: string; shortMessage: string }, | ||
) { | ||
super(humanMessage, { | ||
super(shortMessage, { | ||
cause: err, | ||
@@ -23,5 +23,5 @@ docsPath, | ||
err: RpcError, | ||
{ docsPath, humanMessage }: { docsPath?: string; humanMessage: string }, | ||
{ docsPath, shortMessage }: { docsPath?: string; shortMessage: string }, | ||
) { | ||
super(err, { docsPath, humanMessage }) | ||
super(err, { docsPath, shortMessage }) | ||
this.code = err.code | ||
@@ -38,3 +38,3 @@ this.name = err.name | ||
super(err, { | ||
humanMessage: | ||
shortMessage: | ||
'Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.', | ||
@@ -50,3 +50,3 @@ }) | ||
constructor(err: RpcError) { | ||
super(err, { humanMessage: 'JSON is not a valid request object.' }) | ||
super(err, { shortMessage: 'JSON is not a valid request object.' }) | ||
} | ||
@@ -61,3 +61,3 @@ } | ||
super(err, { | ||
humanMessage: 'The method does not exist / is not available.', | ||
shortMessage: 'The method does not exist / is not available.', | ||
}) | ||
@@ -73,3 +73,3 @@ } | ||
super(err, { | ||
humanMessage: [ | ||
shortMessage: [ | ||
'Invalid parameters were provided to the RPC method.', | ||
@@ -87,3 +87,3 @@ 'Double check you have provided the correct parameters.', | ||
constructor(err: RpcError) { | ||
super(err, { humanMessage: 'An internal error was received.' }) | ||
super(err, { shortMessage: 'An internal error was received.' }) | ||
} | ||
@@ -98,3 +98,3 @@ } | ||
super(err, { | ||
humanMessage: [ | ||
shortMessage: [ | ||
'Missing or invalid parameters.', | ||
@@ -112,3 +112,3 @@ 'Double check you have provided the correct parameters.', | ||
constructor(err: RpcError) { | ||
super(err, { humanMessage: 'Requested resource not found.' }) | ||
super(err, { shortMessage: 'Requested resource not found.' }) | ||
} | ||
@@ -122,3 +122,3 @@ } | ||
constructor(err: RpcError) { | ||
super(err, { humanMessage: 'Requested resource not available.' }) | ||
super(err, { shortMessage: 'Requested resource not available.' }) | ||
} | ||
@@ -132,3 +132,3 @@ } | ||
constructor(err: RpcError) { | ||
super(err, { humanMessage: 'Transaction creation failed.' }) | ||
super(err, { shortMessage: 'Transaction creation failed.' }) | ||
} | ||
@@ -142,3 +142,3 @@ } | ||
constructor(err: RpcError) { | ||
super(err, { humanMessage: 'Method is not implemented.' }) | ||
super(err, { shortMessage: 'Method is not implemented.' }) | ||
} | ||
@@ -152,3 +152,3 @@ } | ||
constructor(err: RpcError) { | ||
super(err, { humanMessage: 'Request exceeds defined limit.' }) | ||
super(err, { shortMessage: 'Request exceeds defined limit.' }) | ||
} | ||
@@ -163,3 +163,3 @@ } | ||
super(err, { | ||
humanMessage: 'Version of JSON-RPC protocol is not supported.', | ||
shortMessage: 'Version of JSON-RPC protocol is not supported.', | ||
}) | ||
@@ -174,5 +174,5 @@ } | ||
super(err, { | ||
humanMessage: 'An unknown RPC error occurred.', | ||
shortMessage: 'An unknown RPC error occurred.', | ||
}) | ||
} | ||
} |
@@ -24,4 +24,3 @@ import { expect, test } from 'vitest' | ||
Details: Error | ||
Version: viem@1.0.2 | ||
Internal Error: {"code":420,"message":"Error"}] | ||
Version: viem@1.0.2] | ||
`) | ||
@@ -28,0 +27,0 @@ }) |
@@ -22,6 +22,6 @@ import { describe, expect, test } from 'vitest' | ||
).toMatchInlineSnapshot(` | ||
[TransactionNotFoundError: Transaction at block hash "0x123" at index "420" could not be found. | ||
[TransactionNotFoundError: Transaction at block hash "0x123" at index "420" could not be found. | ||
Version: viem@1.0.2] | ||
`) | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
@@ -33,6 +33,6 @@ | ||
).toMatchInlineSnapshot(` | ||
[TransactionNotFoundError: Transaction at block time "latest" at index "420" could not be found. | ||
[TransactionNotFoundError: Transaction at block time "latest" at index "420" could not be found. | ||
Version: viem@1.0.2] | ||
`) | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
@@ -44,6 +44,6 @@ | ||
).toMatchInlineSnapshot(` | ||
[TransactionNotFoundError: Transaction at block number "42069" at index "420" could not be found. | ||
[TransactionNotFoundError: Transaction at block number "42069" at index "420" could not be found. | ||
Version: viem@1.0.2] | ||
`) | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
@@ -55,6 +55,6 @@ | ||
).toMatchInlineSnapshot(` | ||
[TransactionNotFoundError: Transaction with hash "0x123" could not be found. | ||
[TransactionNotFoundError: Transaction with hash "0x123" could not be found. | ||
Version: viem@1.0.2] | ||
`) | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
@@ -61,0 +61,0 @@ }) |
@@ -9,5 +9,4 @@ import { expect, test } from 'vitest' | ||
Docs: https://viem.sh/docs/clients/intro | ||
Version: viem@1.0.2] | ||
`) | ||
}) |
@@ -22,2 +22,5 @@ import { expect, test } from 'vitest' | ||
"BlockNotFoundError": [Function], | ||
"ContractFunctionExecutionError": [Function], | ||
"ContractFunctionRevertedError": [Function], | ||
"ContractFunctionZeroDataError": [Function], | ||
"DataLengthTooLongError": [Function], | ||
@@ -155,2 +158,45 @@ "DataLengthTooShortError": [Function], | ||
"mine": [Function], | ||
"multicall3Abi": [ | ||
{ | ||
"inputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"name": "target", | ||
"type": "address", | ||
}, | ||
{ | ||
"name": "allowFailure", | ||
"type": "bool", | ||
}, | ||
{ | ||
"name": "callData", | ||
"type": "bytes", | ||
}, | ||
], | ||
"name": "calls", | ||
"type": "tuple[]", | ||
}, | ||
], | ||
"name": "aggregate3", | ||
"outputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"name": "success", | ||
"type": "bool", | ||
}, | ||
{ | ||
"name": "returnData", | ||
"type": "bytes", | ||
}, | ||
], | ||
"name": "returnData", | ||
"type": "tuple[]", | ||
}, | ||
], | ||
"stateMutability": "view", | ||
"type": "function", | ||
}, | ||
], | ||
"numberToBytes": [Function], | ||
@@ -157,0 +203,0 @@ "numberToHex": [Function], |
@@ -194,2 +194,4 @@ export type { | ||
export { multicall3Abi } from './constants' | ||
export { | ||
@@ -210,2 +212,5 @@ AbiConstructorNotFoundError, | ||
BlockNotFoundError, | ||
ContractFunctionExecutionError, | ||
ContractFunctionRevertedError, | ||
ContractFunctionZeroDataError, | ||
DataLengthTooLongError, | ||
@@ -259,2 +264,4 @@ DataLengthTooShortError, | ||
ByteArray, | ||
Chain, | ||
ContractConfig, | ||
Hex, | ||
@@ -306,2 +313,3 @@ FeeHistory, | ||
GetCreate2AddressOptions, | ||
GetAbiItemArgs, | ||
EncodeRlpResponse, | ||
@@ -308,0 +316,0 @@ FormattedBlock, |
@@ -11,2 +11,3 @@ import type { | ||
AbiParametersToPrimitiveTypes, | ||
AbiStateMutability, | ||
ExtractAbiFunction, | ||
@@ -16,7 +17,8 @@ ExtractAbiEvent, | ||
ExtractAbiError, | ||
AbiStateMutability, | ||
ExtractAbiErrorNames, | ||
ExtractAbiFunctionNames, | ||
Narrow, | ||
} from 'abitype' | ||
import { TransactionRequest } from './transaction' | ||
import type { Address } from './misc' | ||
import type { TransactionRequest } from './transaction' | ||
import type { Trim } from './utils' | ||
@@ -168,2 +170,14 @@ | ||
export type ExtractErrorNameFromAbi< | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TErrorName extends string = string, | ||
> = TAbi extends Abi | ||
? ExtractAbiErrorNames<TAbi> extends infer AbiErrorNames | ||
? | ||
| AbiErrorNames | ||
| (TErrorName extends AbiErrorNames ? TErrorName : never) | ||
| (Abi extends TAbi ? string : never) | ||
: never | ||
: TErrorName | ||
export type ExtractEventNameFromAbi< | ||
@@ -197,2 +211,19 @@ TAbi extends Abi | readonly unknown[] = Abi, | ||
type ExtractNames<TAbi extends Abi> = | ||
| ExtractAbiFunctionNames<TAbi> | ||
| ExtractAbiEventNames<TAbi> | ||
| ExtractAbiErrorNames<TAbi> | ||
export type ExtractNameFromAbi< | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TName extends string = string, | ||
> = TAbi extends Abi | ||
? ExtractNames<TAbi> extends infer AbiNames | ||
? | ||
| AbiNames | ||
| (TName extends AbiNames ? TName : never) | ||
| (Abi extends TAbi ? string : never) | ||
: never | ||
: TName | ||
export type ExtractResultFromAbi< | ||
@@ -221,2 +252,5 @@ TAbi extends Abi | readonly unknown[] = Abi, | ||
// REFACTOR: Remove below once we implement `ParseAbi`. | ||
// https://github.com/wagmi-dev/viem/issues/29 | ||
export type EventDefinition = `${string}(${string})` | ||
@@ -334,4 +368,21 @@ | ||
////////////////////////////////////////////////////////////////////// | ||
// Call Args | ||
// Args | ||
export type ContractConfig< | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TFunctionName extends string = string, | ||
TAbiStateMutability extends AbiStateMutability = AbiStateMutability, | ||
> = { | ||
/** Contract ABI */ | ||
abi: Narrow<TAbi> | ||
/** Contract address */ | ||
address: Address | ||
/** Function to invoke on the contract */ | ||
functionName: ExtractFunctionNameFromAbi< | ||
TAbi, | ||
TFunctionName, | ||
TAbiStateMutability | ||
> | ||
} & ExtractArgsFromAbi<TAbi, TFunctionName> | ||
export type GetValue< | ||
@@ -338,0 +389,0 @@ TAbi extends Abi | readonly unknown[], |
@@ -14,2 +14,3 @@ export type { | ||
AbiEventParametersToPrimitiveTypes, | ||
ContractConfig, | ||
EventDefinition, | ||
@@ -21,5 +22,7 @@ ExtractArgsFromAbi, | ||
ExtractErrorArgsFromAbi, | ||
ExtractErrorNameFromAbi, | ||
ExtractEventArgsFromAbi, | ||
ExtractEventNameFromAbi, | ||
ExtractFunctionNameFromAbi, | ||
ExtractNameFromAbi, | ||
ExtractResultFromAbi, | ||
@@ -45,2 +48,4 @@ GetValue, | ||
export type { MulticallContracts } from './multicall' | ||
export type { | ||
@@ -47,0 +52,0 @@ Index, |
@@ -5,2 +5,3 @@ import { | ||
AbiParameterToPrimitiveType, | ||
Narrow, | ||
} from 'abitype' | ||
@@ -19,11 +20,14 @@ | ||
export type DecodeAbiArgs<TParams extends readonly AbiParameter[]> = { | ||
export type DecodeAbiArgs< | ||
TParams extends | ||
| readonly AbiParameter[] | ||
| readonly unknown[] = readonly AbiParameter[], | ||
> = { | ||
data: Hex | ||
params: TParams | ||
params: Narrow<TParams> | ||
} | ||
export function decodeAbi<TParams extends readonly AbiParameter[]>({ | ||
data, | ||
params, | ||
}: DecodeAbiArgs<TParams>) { | ||
export function decodeAbi< | ||
TParams extends readonly AbiParameter[] | readonly unknown[], | ||
>({ data, params }: DecodeAbiArgs<TParams>) { | ||
if (data === '0x' && params.length > 0) throw new AbiDecodingZeroDataError() | ||
@@ -34,3 +38,3 @@ if (size(data) % 32 !== 0) | ||
data, | ||
params, | ||
params: params as readonly AbiParameter[], | ||
}) | ||
@@ -37,0 +41,0 @@ if (values.length === 0) return undefined |
@@ -14,3 +14,3 @@ import { expect, test } from 'vitest' | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -26,3 +26,2 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
decodeDeployData({ | ||
// @ts-expect-error | ||
abi: [ | ||
@@ -33,3 +32,3 @@ { | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -60,3 +59,3 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -76,4 +75,3 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
decodeDeployData({ | ||
// @ts-expect-error | ||
abi: [{}] as const, | ||
abi: [{}], | ||
bytecode: | ||
@@ -88,3 +86,2 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
Docs: https://viem.sh/docs/contract/decodeDeployData | ||
Version: viem@1.0.2" | ||
@@ -97,3 +94,2 @@ `) | ||
decodeDeployData({ | ||
// @ts-expect-error | ||
abi: [ | ||
@@ -104,3 +100,3 @@ { | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -116,3 +112,2 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
Docs: https://viem.sh/docs/contract/decodeDeployData | ||
Version: viem@1.0.2" | ||
@@ -129,3 +124,3 @@ `, | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -141,3 +136,2 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
Docs: https://viem.sh/docs/contract/decodeDeployData | ||
Version: viem@1.0.2" | ||
@@ -148,3 +142,2 @@ `, | ||
decodeDeployData({ | ||
// @ts-expect-error | ||
abi: [ | ||
@@ -156,3 +149,3 @@ { | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -168,3 +161,2 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
Docs: https://viem.sh/docs/contract/decodeDeployData | ||
Version: viem@1.0.2" | ||
@@ -171,0 +163,0 @@ `, |
@@ -12,7 +12,8 @@ import { Abi } from 'abitype' | ||
export type DecodeDeployDataArgs<TAbi extends Abi = Abi> = { | ||
abi: TAbi | ||
bytecode: Hex | ||
data: Hex | ||
} | ||
export type DecodeDeployDataArgs<TAbi extends Abi | readonly unknown[] = Abi> = | ||
{ | ||
abi: TAbi | ||
bytecode: Hex | ||
data: Hex | ||
} | ||
export type DecodeDeployDataResponse = { | ||
@@ -23,3 +24,3 @@ args?: readonly unknown[] | undefined | ||
export function decodeDeployData<TAbi extends Abi = Abi>({ | ||
export function decodeDeployData<TAbi extends Abi | readonly unknown[]>({ | ||
abi, | ||
@@ -31,3 +32,5 @@ bytecode, | ||
const description = abi.find((x) => 'type' in x && x.type === 'constructor') | ||
const description = (abi as Abi).find( | ||
(x) => 'type' in x && x.type === 'constructor', | ||
) | ||
if (!description) throw new AbiConstructorNotFoundError({ docsPath }) | ||
@@ -34,0 +37,0 @@ if (!('inputs' in description)) |
@@ -17,3 +17,11 @@ import { expect, test } from 'vitest' | ||
}), | ||
).toEqual({ errorName: 'SoldOutError', args: undefined }) | ||
).toEqual({ | ||
abiItem: { | ||
inputs: [], | ||
name: 'SoldOutError', | ||
type: 'error', | ||
}, | ||
errorName: 'SoldOutError', | ||
args: undefined, | ||
}) | ||
expect( | ||
@@ -30,3 +38,10 @@ decodeErrorResult({ | ||
}), | ||
).toEqual({ errorName: 'SoldOutError', args: undefined }) | ||
).toEqual({ | ||
abiItem: { | ||
name: 'SoldOutError', | ||
type: 'error', | ||
}, | ||
errorName: 'SoldOutError', | ||
args: undefined, | ||
}) | ||
}) | ||
@@ -53,2 +68,13 @@ | ||
).toEqual({ | ||
abiItem: { | ||
inputs: [ | ||
{ | ||
internalType: 'string', | ||
name: 'a', | ||
type: 'string', | ||
}, | ||
], | ||
name: 'AccessDeniedError', | ||
type: 'error', | ||
}, | ||
errorName: 'AccessDeniedError', | ||
@@ -100,2 +126,35 @@ args: ['you do not have access ser'], | ||
).toEqual({ | ||
abiItem: { | ||
inputs: [ | ||
{ | ||
components: [ | ||
{ | ||
internalType: 'uint256', | ||
name: 'weight', | ||
type: 'uint256', | ||
}, | ||
{ | ||
internalType: 'bool', | ||
name: 'voted', | ||
type: 'bool', | ||
}, | ||
{ | ||
internalType: 'address', | ||
name: 'delegate', | ||
type: 'address', | ||
}, | ||
{ | ||
internalType: 'uint256', | ||
name: 'vote', | ||
type: 'uint256', | ||
}, | ||
], | ||
internalType: 'struct Ballot.Voter', | ||
name: 'voter', | ||
type: 'tuple', | ||
}, | ||
], | ||
name: 'AccessDeniedError', | ||
type: 'error', | ||
}, | ||
errorName: 'AccessDeniedError', | ||
@@ -113,2 +172,44 @@ args: [ | ||
test('Error(string)', () => { | ||
expect( | ||
decodeErrorResult({ | ||
data: '0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000047465737400000000000000000000000000000000000000000000000000000000', | ||
}), | ||
).toEqual({ | ||
abiItem: { | ||
inputs: [ | ||
{ | ||
name: 'message', | ||
type: 'string', | ||
}, | ||
], | ||
name: 'Error', | ||
type: 'error', | ||
}, | ||
errorName: 'Error', | ||
args: ['test'], | ||
}) | ||
}) | ||
test.todo('Panic(uint256)') | ||
test('zero data', () => { | ||
expect(() => | ||
decodeErrorResult({ | ||
abi: [ | ||
{ | ||
inputs: [], | ||
name: 'SoldOutError', | ||
type: 'error', | ||
}, | ||
], | ||
data: '0x', | ||
}), | ||
).toThrowErrorMatchingInlineSnapshot(` | ||
"Cannot decode zero data (\\"0x\\") with ABI parameters. | ||
Version: viem@1.0.2" | ||
`) | ||
}) | ||
test("errors: error doesn't exist", () => { | ||
@@ -132,5 +233,4 @@ expect(() => | ||
Docs: https://viem.sh/docs/contract/decodeErrorResult | ||
Version: viem@1.0.2" | ||
`) | ||
}) |
@@ -1,4 +0,8 @@ | ||
import { Abi } from 'abitype' | ||
import { AbiErrorSignatureNotFoundError } from '../../errors' | ||
import { Hex } from '../../types' | ||
import { Abi, AbiError } from 'abitype' | ||
import { solidityError, solidityPanic } from '../../constants' | ||
import { | ||
AbiDecodingZeroDataError, | ||
AbiErrorSignatureNotFoundError, | ||
} from '../../errors' | ||
import { AbiItem, Hex } from '../../types' | ||
import { slice } from '../data' | ||
@@ -9,10 +13,24 @@ import { getFunctionSignature } from '../hash' | ||
export type DecodeErrorResultArgs = { abi: Abi; data: Hex } | ||
export type DecodeErrorResultArgs = { abi?: Abi; data: Hex } | ||
export function decodeErrorResult({ abi, data }: DecodeErrorResultArgs) { | ||
export type DecodeErrorResultResponse = { | ||
abiItem: AbiItem | ||
errorName: string | ||
args?: readonly unknown[] | ||
} | ||
export function decodeErrorResult({ | ||
abi, | ||
data, | ||
}: DecodeErrorResultArgs): DecodeErrorResultResponse { | ||
const signature = slice(data, 0, 4) | ||
const description = abi.find( | ||
(x) => signature === getFunctionSignature(formatAbiItem(x)), | ||
if (signature === '0x') throw new AbiDecodingZeroDataError() | ||
const abi_ = [...(abi || []), solidityError, solidityPanic] | ||
const abiItem = abi_.find( | ||
(x) => | ||
x.type === 'error' && | ||
signature === getFunctionSignature(formatAbiItem(x)), | ||
) | ||
if (!description) | ||
if (!abiItem) | ||
throw new AbiErrorSignatureNotFoundError(signature, { | ||
@@ -22,9 +40,8 @@ docsPath: '/docs/contract/decodeErrorResult', | ||
return { | ||
errorName: (description as { name: string }).name, | ||
args: ('inputs' in description && | ||
description.inputs && | ||
description.inputs.length > 0 | ||
? decodeAbi({ data: slice(data, 4), params: description.inputs }) | ||
abiItem, | ||
args: ('inputs' in abiItem && abiItem.inputs && abiItem.inputs.length > 0 | ||
? decodeAbi({ data: slice(data, 4), params: abiItem.inputs }) | ||
: undefined) as readonly unknown[] | undefined, | ||
errorName: (abiItem as { name: string }).name, | ||
} | ||
} |
@@ -137,5 +137,4 @@ import { expect, test } from 'vitest' | ||
Docs: https://viem.sh/docs/contract/decodeFunctionData | ||
Version: viem@1.0.2" | ||
`) | ||
}) |
@@ -16,3 +16,3 @@ import { expect, test } from 'vitest' | ||
}, | ||
] as const, | ||
], | ||
functionName: 'foo', | ||
@@ -32,3 +32,3 @@ data: '0x', | ||
}, | ||
] as const, | ||
], | ||
functionName: 'foo', | ||
@@ -58,3 +58,3 @@ // @ts-expect-error | ||
}, | ||
] as const, | ||
], | ||
functionName: 'foo', | ||
@@ -117,3 +117,3 @@ data: '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac', | ||
}, | ||
] as const, | ||
], | ||
functionName: 'bar', | ||
@@ -189,3 +189,3 @@ data: '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac0000000000000000000000000000000000000000000000000000000000010f2c0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac0000000000000000000000000000000000000000000000000000000000000045', | ||
}, | ||
] as const, | ||
], | ||
functionName: 'baz', | ||
@@ -208,2 +208,75 @@ data: '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac0000000000000000000000000000000000000000000000000000000000010f2c0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac000000000000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000057761676d69000000000000000000000000000000000000000000000000000000', | ||
test('overloads', () => { | ||
expect( | ||
decodeFunctionResult({ | ||
abi: [ | ||
{ | ||
inputs: [{ internalType: 'uint256', name: 'x', type: 'uint256' }], | ||
name: 'foo', | ||
outputs: [ | ||
{ | ||
internalType: 'uint256', | ||
name: 'x', | ||
type: 'uint256', | ||
}, | ||
], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'foo', | ||
outputs: [ | ||
{ | ||
internalType: 'address', | ||
name: 'sender', | ||
type: 'address', | ||
}, | ||
], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
], | ||
functionName: 'foo', | ||
data: '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac', | ||
}), | ||
).toEqual('0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC') | ||
expect( | ||
decodeFunctionResult({ | ||
abi: [ | ||
{ | ||
inputs: [{ internalType: 'uint256', name: 'x', type: 'uint256' }], | ||
name: 'foo', | ||
outputs: [ | ||
{ | ||
internalType: 'uint256', | ||
name: 'x', | ||
type: 'uint256', | ||
}, | ||
], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'foo', | ||
outputs: [ | ||
{ | ||
internalType: 'address', | ||
name: 'sender', | ||
type: 'address', | ||
}, | ||
], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
], | ||
functionName: 'foo', | ||
data: '0x0000000000000000000000000000000000000000000000000000000000000069', | ||
args: [10n], | ||
}), | ||
).toEqual(105n) | ||
}) | ||
test("error: function doesn't exist", () => { | ||
@@ -226,3 +299,3 @@ expect(() => | ||
}, | ||
] as const, | ||
], | ||
// @ts-expect-error | ||
@@ -238,3 +311,2 @@ functionName: 'baz', | ||
Docs: https://viem.sh/docs/contract/decodeFunctionResult | ||
Version: viem@1.0.2" | ||
@@ -255,3 +327,3 @@ `, | ||
}, | ||
] as const, | ||
], | ||
functionName: 'foo', | ||
@@ -267,3 +339,2 @@ data: '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac', | ||
Docs: https://viem.sh/docs/contract/decodeFunctionResult | ||
Version: viem@1.0.2" | ||
@@ -270,0 +341,0 @@ `, |
@@ -1,2 +0,2 @@ | ||
import { Abi, ExtractAbiFunctionNames } from 'abitype' | ||
import { Abi, Narrow } from 'abitype' | ||
import { | ||
@@ -6,4 +6,4 @@ AbiFunctionNotFoundError, | ||
} from '../../errors' | ||
import { | ||
ExtractArgsFromAbi, | ||
ExtractFunctionNameFromAbi, | ||
@@ -14,2 +14,3 @@ ExtractResultFromAbi, | ||
import { decodeAbi } from './decodeAbi' | ||
import { getAbiItem, GetAbiItemArgs } from './getAbiItem' | ||
@@ -20,19 +21,20 @@ const docsPath = '/docs/contract/decodeFunctionResult' | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TFunctionName extends string = any, | ||
TFunctionName extends string = string, | ||
> = { | ||
abi: TAbi | ||
abi: Narrow<TAbi> | ||
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName> | ||
data: Hex | ||
} | ||
} & Partial<ExtractArgsFromAbi<TAbi, TFunctionName>> | ||
export type DecodeFunctionResultResponse< | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TFunctionName extends string = any, | ||
TFunctionName extends string = string, | ||
> = ExtractResultFromAbi<TAbi, TFunctionName> | ||
export function decodeFunctionResult< | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TFunctionName extends string = any, | ||
TAbi extends Abi | readonly unknown[], | ||
TFunctionName extends string, | ||
>({ | ||
abi, | ||
args, | ||
functionName, | ||
@@ -44,5 +46,7 @@ data, | ||
> { | ||
const description = (abi as Abi).find( | ||
(x) => 'name' in x && x.name === functionName, | ||
) | ||
const description = getAbiItem({ | ||
abi, | ||
args, | ||
name: functionName, | ||
} as GetAbiItemArgs) | ||
if (!description) | ||
@@ -49,0 +53,0 @@ throw new AbiFunctionNotFoundError(functionName, { docsPath }) |
@@ -748,3 +748,3 @@ import { describe, expect, test } from 'vitest' | ||
{ internalType: 'string[3]', name: 'zOut', type: 'string[3]' }, | ||
] as any, | ||
], | ||
values: [[420n, 69n], true, ['wagmi', 'viem', 'lol']], | ||
@@ -889,3 +889,3 @@ }), | ||
}, | ||
] as const, | ||
], | ||
values: [[420n, 69n], true, 'wagmi'], | ||
@@ -1207,3 +1207,3 @@ }), | ||
}, | ||
] as const, | ||
], | ||
values: [ | ||
@@ -1396,3 +1396,2 @@ { | ||
Docs: https://viem.sh/docs/contract/encodeAbi | ||
Version: viem@1.0.2" | ||
@@ -1399,0 +1398,0 @@ `) |
@@ -5,2 +5,3 @@ import { | ||
AbiParameterToPrimitiveType, | ||
Narrow, | ||
} from 'abitype' | ||
@@ -18,5 +19,11 @@ | ||
export type EncodeAbiArgs<TParams extends readonly AbiParameter[]> = { | ||
params: TParams | ||
values: AbiParametersToPrimitiveTypes<TParams> | ||
export type EncodeAbiArgs< | ||
TParams extends | ||
| readonly AbiParameter[] | ||
| readonly unknown[] = readonly AbiParameter[], | ||
> = { | ||
params: Narrow<TParams> | ||
values: TParams extends readonly AbiParameter[] | ||
? AbiParametersToPrimitiveTypes<TParams> | ||
: never | ||
} | ||
@@ -27,13 +34,15 @@ | ||
*/ | ||
export function encodeAbi<TParams extends readonly AbiParameter[]>({ | ||
params, | ||
values, | ||
}: EncodeAbiArgs<TParams>) { | ||
export function encodeAbi< | ||
TParams extends readonly AbiParameter[] | readonly unknown[], | ||
>({ params, values }: EncodeAbiArgs<TParams>) { | ||
if (params.length !== values.length) | ||
throw new AbiEncodingLengthMismatchError({ | ||
expectedLength: params.length, | ||
expectedLength: params.length as number, | ||
givenLength: values.length, | ||
}) | ||
// Prepare the parameters to determine dynamic types to encode. | ||
const preparedParams = prepareParams({ params, values }) | ||
const preparedParams = prepareParams({ | ||
params: params as readonly AbiParameter[], | ||
values, | ||
}) | ||
const data = encodeParams(preparedParams) | ||
@@ -55,3 +64,3 @@ if (data.length === 0) return '0x' | ||
}: { | ||
params: TParams | ||
params: Narrow<TParams> | ||
values: AbiParametersToPrimitiveTypes<TParams> | ||
@@ -58,0 +67,0 @@ }) { |
@@ -14,3 +14,3 @@ import { expect, test } from 'vitest' | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -24,3 +24,2 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
encodeDeployData({ | ||
// @ts-expect-error | ||
abi: [ | ||
@@ -31,3 +30,3 @@ { | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -56,3 +55,3 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -70,4 +69,3 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
encodeDeployData({ | ||
// @ts-expect-error | ||
abi: [{}] as const, | ||
abi: [{}], | ||
bytecode: | ||
@@ -82,3 +80,2 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
Docs: https://viem.sh/docs/contract/encodeDeployData | ||
Version: viem@1.0.2" | ||
@@ -91,3 +88,2 @@ `) | ||
encodeDeployData({ | ||
// @ts-expect-error | ||
abi: [ | ||
@@ -98,3 +94,3 @@ { | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -110,3 +106,2 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
Docs: https://viem.sh/docs/contract/encodeDeployData | ||
Version: viem@1.0.2" | ||
@@ -118,3 +113,2 @@ `, | ||
encodeDeployData({ | ||
// @ts-expect-error | ||
abi: [ | ||
@@ -126,3 +120,3 @@ { | ||
}, | ||
] as const, | ||
], | ||
bytecode: | ||
@@ -138,3 +132,2 @@ '0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220116554d4ba29ee08da9e97dc54ff9a2a65d67a648140d616fc225a25ff08c86364736f6c63430008070033', | ||
Docs: https://viem.sh/docs/contract/encodeDeployData | ||
Version: viem@1.0.2" | ||
@@ -141,0 +134,0 @@ `, |
@@ -1,2 +0,2 @@ | ||
import { Abi } from 'abitype' | ||
import { Abi, Narrow } from 'abitype' | ||
@@ -13,8 +13,9 @@ import { | ||
export type EncodeDeployDataArgs<TAbi extends Abi = Abi> = { | ||
abi: TAbi | ||
bytecode: Hex | ||
} & ExtractConstructorArgsFromAbi<TAbi> | ||
export type EncodeDeployDataArgs<TAbi extends Abi | readonly unknown[] = Abi> = | ||
{ | ||
abi: Narrow<TAbi> | ||
bytecode: Hex | ||
} & ExtractConstructorArgsFromAbi<TAbi> | ||
export function encodeDeployData<TAbi extends Abi = Abi>({ | ||
export function encodeDeployData<TAbi extends Abi | readonly unknown[]>({ | ||
abi, | ||
@@ -26,3 +27,5 @@ args, | ||
const description = abi.find((x) => 'type' in x && x.type === 'constructor') | ||
const description = (abi as Abi).find( | ||
(x) => 'type' in x && x.type === 'constructor', | ||
) | ||
if (!description) throw new AbiConstructorNotFoundError({ docsPath }) | ||
@@ -29,0 +32,0 @@ if (!('inputs' in description)) |
@@ -21,3 +21,2 @@ import { expect, test } from 'vitest' | ||
abi: [ | ||
// @ts-expect-error | ||
{ | ||
@@ -48,3 +47,3 @@ name: 'SoldOutError', | ||
}, | ||
] as const, | ||
], | ||
errorName: 'AccessDeniedError', | ||
@@ -121,2 +120,3 @@ args: ['you do not have access ser'], | ||
], | ||
// @ts-expect-error | ||
errorName: 'AccessDeniedError', | ||
@@ -137,3 +137,2 @@ args: [ | ||
Docs: https://viem.sh/docs/contract/encodeErrorResult | ||
Version: viem@1.0.2" | ||
@@ -147,3 +146,2 @@ `) | ||
abi: [ | ||
// @ts-expect-error | ||
{ | ||
@@ -170,3 +168,2 @@ name: 'AccessDeniedError', | ||
Docs: https://viem.sh/docs/contract/encodeErrorResult | ||
Version: viem@1.0.2" | ||
@@ -178,3 +175,2 @@ `) | ||
{ | ||
// @ts-expect-error | ||
inputs: undefined, | ||
@@ -201,5 +197,4 @@ name: 'AccessDeniedError', | ||
Docs: https://viem.sh/docs/contract/encodeErrorResult | ||
Version: viem@1.0.2" | ||
`) | ||
}) |
@@ -1,2 +0,2 @@ | ||
import { Abi, ExtractAbiErrorNames } from 'abitype' | ||
import { Abi, Narrow } from 'abitype' | ||
import { | ||
@@ -6,4 +6,7 @@ AbiErrorInputsNotFoundError, | ||
} from '../../errors' | ||
import { ExtractErrorArgsFromAbi, Hex } from '../../types' | ||
import { | ||
ExtractErrorArgsFromAbi, | ||
ExtractErrorNameFromAbi, | ||
Hex, | ||
} from '../../types' | ||
import { concatHex } from '../data' | ||
@@ -13,3 +16,3 @@ import { getFunctionSignature } from '../hash' | ||
import { formatAbiItem } from './formatAbiItem' | ||
import { getAbiItem } from './getAbiItem' | ||
import { getAbiItem, GetAbiItemArgs } from './getAbiItem' | ||
@@ -19,14 +22,18 @@ const docsPath = '/docs/contract/encodeErrorResult' | ||
export type EncodeErrorResultArgs< | ||
TAbi extends Abi = Abi, | ||
TErrorName extends ExtractAbiErrorNames<TAbi> = any, | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TErrorName extends string = string, | ||
> = { | ||
abi: TAbi | ||
errorName: TErrorName | ||
abi: Narrow<TAbi> | ||
errorName: ExtractErrorNameFromAbi<TAbi, TErrorName> | ||
} & ExtractErrorArgsFromAbi<TAbi, TErrorName> | ||
export function encodeErrorResult< | ||
TAbi extends Abi = Abi, | ||
TErrorName extends ExtractAbiErrorNames<TAbi> = any, | ||
TAbi extends Abi | readonly unknown[], | ||
TErrorName extends string, | ||
>({ abi, errorName, args }: EncodeErrorResultArgs<TAbi, TErrorName>) { | ||
const description = getAbiItem({ abi, name: errorName }) | ||
const description = getAbiItem({ | ||
abi, | ||
args, | ||
name: errorName, | ||
} as GetAbiItemArgs) | ||
if (!description) throw new AbiErrorNotFoundError(errorName, { docsPath }) | ||
@@ -33,0 +40,0 @@ const definition = formatAbiItem(description) |
@@ -14,3 +14,3 @@ import { expect, test } from 'vitest' | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Transfer', | ||
@@ -23,3 +23,2 @@ }), | ||
encodeEventTopics({ | ||
// @ts-expect-error | ||
abi: [ | ||
@@ -30,3 +29,3 @@ { | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Transfer', | ||
@@ -64,3 +63,3 @@ }), | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Transfer', | ||
@@ -98,3 +97,3 @@ }), | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Transfer', | ||
@@ -138,3 +137,3 @@ args: { | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Transfer', | ||
@@ -181,3 +180,3 @@ args: { | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Transfer', | ||
@@ -215,3 +214,3 @@ args: [null, '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC'], | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Transfer', | ||
@@ -251,3 +250,3 @@ args: [ | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Foo', | ||
@@ -292,3 +291,3 @@ args: { | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Bar', | ||
@@ -324,3 +323,3 @@ args: { | ||
}, | ||
] as const, | ||
], | ||
// @ts-expect-error | ||
@@ -334,3 +333,2 @@ eventName: 'Bar', | ||
Docs: https://viem.sh/docs/contract/encodeEventTopics | ||
Version: viem@1.0.2" | ||
@@ -343,3 +341,2 @@ `) | ||
encodeEventTopics({ | ||
// @ts-expect-error | ||
abi: [ | ||
@@ -351,3 +348,3 @@ { | ||
}, | ||
] as const, | ||
], | ||
eventName: 'Foo', | ||
@@ -354,0 +351,0 @@ // @ts-expect-error |
@@ -6,2 +6,3 @@ import { | ||
ExtractAbiEventNames, | ||
Narrow, | ||
} from 'abitype' | ||
@@ -13,3 +14,8 @@ | ||
} from '../../errors' | ||
import { EventDefinition, ExtractEventArgsFromAbi, Hex } from '../../types' | ||
import { | ||
EventDefinition, | ||
ExtractEventArgsFromAbi, | ||
ExtractEventNameFromAbi, | ||
Hex, | ||
} from '../../types' | ||
import { encodeBytes } from '../encoding' | ||
@@ -19,17 +25,17 @@ import { keccak256, getEventSignature } from '../hash' | ||
import { formatAbiItem } from './formatAbiItem' | ||
import { getAbiItem } from './getAbiItem' | ||
import { getAbiItem, GetAbiItemArgs } from './getAbiItem' | ||
export type EncodeEventTopicsArgs< | ||
TAbi extends Abi = Abi, | ||
TEventName extends ExtractAbiEventNames<TAbi> = any, | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TEventName extends string = string, | ||
> = { | ||
abi: TAbi | ||
eventName: TEventName | ||
abi: Narrow<TAbi> | ||
eventName: ExtractEventNameFromAbi<TAbi, TEventName> | ||
} & ExtractEventArgsFromAbi<TAbi, TEventName> | ||
export function encodeEventTopics< | ||
TAbi extends Abi = Abi, | ||
TEventName extends ExtractAbiEventNames<TAbi> = any, | ||
TAbi extends Abi | readonly unknown[], | ||
TEventName extends string, | ||
>({ abi, eventName, args }: EncodeEventTopicsArgs<TAbi, TEventName>) { | ||
const abiItem = getAbiItem({ abi, name: eventName }) | ||
const abiItem = getAbiItem({ abi, args, name: eventName } as GetAbiItemArgs) | ||
if (!abiItem) | ||
@@ -36,0 +42,0 @@ throw new AbiEventNotFoundError(eventName, { |
@@ -16,3 +16,3 @@ import { expect, test } from 'vitest' | ||
}, | ||
] as const, | ||
], | ||
functionName: 'foo', | ||
@@ -23,3 +23,2 @@ }), | ||
encodeFunctionData({ | ||
// @ts-expect-error | ||
abi: [ | ||
@@ -32,3 +31,3 @@ { | ||
}, | ||
] as const, | ||
], | ||
functionName: 'foo', | ||
@@ -56,3 +55,3 @@ }), | ||
}, | ||
] as const, | ||
], | ||
functionName: 'bar', | ||
@@ -105,3 +104,3 @@ args: [1n], | ||
}, | ||
] as const, | ||
], | ||
functionName: 'getVoter', | ||
@@ -133,3 +132,3 @@ args: [ | ||
}, | ||
] as const, | ||
], | ||
// @ts-expect-error | ||
@@ -143,5 +142,4 @@ functionName: 'bar', | ||
Docs: https://viem.sh/docs/contract/encodeFunctionData | ||
Version: viem@1.0.2" | ||
`) | ||
}) |
@@ -1,4 +0,7 @@ | ||
import { Abi, ExtractAbiFunctionNames } from 'abitype' | ||
import { Abi, Narrow } from 'abitype' | ||
import { AbiFunctionNotFoundError } from '../../errors' | ||
import { | ||
AbiEncodingLengthMismatchError, | ||
AbiFunctionNotFoundError, | ||
} from '../../errors' | ||
import { ExtractArgsFromAbi, ExtractFunctionNameFromAbi } from '../../types' | ||
@@ -9,9 +12,9 @@ import { concatHex } from '../data' | ||
import { formatAbiItem } from './formatAbiItem' | ||
import { getAbiItem } from './getAbiItem' | ||
import { getAbiItem, GetAbiItemArgs } from './getAbiItem' | ||
export type EncodeFunctionDataArgs< | ||
TAbi extends Abi = Abi, | ||
TFunctionName extends string = any, | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TFunctionName extends string = string, | ||
> = { | ||
abi: TAbi | ||
abi: Narrow<TAbi> | ||
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName> | ||
@@ -21,6 +24,10 @@ } & ExtractArgsFromAbi<TAbi, TFunctionName> | ||
export function encodeFunctionData< | ||
TAbi extends Abi = Abi, | ||
TFunctionName extends string = any, | ||
TAbi extends Abi | readonly unknown[], | ||
TFunctionName extends string, | ||
>({ abi, args, functionName }: EncodeFunctionDataArgs<TAbi, TFunctionName>) { | ||
const description = getAbiItem({ abi, name: functionName }) | ||
const description = getAbiItem({ | ||
abi, | ||
args, | ||
name: functionName, | ||
} as GetAbiItemArgs) | ||
if (!description) | ||
@@ -27,0 +34,0 @@ throw new AbiFunctionNotFoundError(functionName, { |
@@ -33,3 +33,3 @@ import { expect, test } from 'vitest' | ||
functionName: 'foo', | ||
result: [undefined], | ||
result: undefined, | ||
}), | ||
@@ -49,3 +49,2 @@ ).toEqual('0x') | ||
functionName: 'foo', | ||
result: [], | ||
}), | ||
@@ -72,3 +71,3 @@ ).toEqual('0x') | ||
}, | ||
] as const, | ||
], | ||
functionName: 'foo', | ||
@@ -135,13 +134,11 @@ result: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC', | ||
functionName: 'bar', | ||
result: [ | ||
{ | ||
foo: { | ||
sender: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC', | ||
x: 69420n, | ||
y: true, | ||
}, | ||
result: { | ||
foo: { | ||
sender: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC', | ||
z: 69, | ||
x: 69420n, | ||
y: true, | ||
}, | ||
], | ||
sender: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC', | ||
z: 69, | ||
}, | ||
}), | ||
@@ -247,2 +244,3 @@ ).toEqual( | ||
], | ||
// @ts-expect-error | ||
functionName: 'baz', | ||
@@ -257,3 +255,2 @@ result: ['0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC'], | ||
Docs: https://viem.sh/docs/contract/encodeFunctionResult | ||
Version: viem@1.0.2" | ||
@@ -268,3 +265,2 @@ `, | ||
abi: [ | ||
// @ts-expect-error | ||
{ | ||
@@ -287,3 +283,2 @@ inputs: [], | ||
Docs: https://viem.sh/docs/contract/encodeFunctionResult | ||
Version: viem@1.0.2" | ||
@@ -290,0 +285,0 @@ `, |
@@ -1,2 +0,2 @@ | ||
import { Abi, ExtractAbiFunctionNames } from 'abitype' | ||
import { Abi, ExtractAbiFunctionNames, Narrow } from 'abitype' | ||
import { | ||
@@ -13,6 +13,6 @@ AbiFunctionNotFoundError, | ||
export type EncodeFunctionResultArgs< | ||
TAbi extends Abi = Abi, | ||
TFunctionName extends string = any, | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TFunctionName extends string = string, | ||
> = { | ||
abi: TAbi | ||
abi: Narrow<TAbi> | ||
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName> | ||
@@ -23,4 +23,4 @@ result?: ExtractResultFromAbi<TAbi, TFunctionName> | ||
export function encodeFunctionResult< | ||
TAbi extends Abi = Abi, | ||
TFunctionName extends string = any, | ||
TAbi extends Abi | readonly unknown[], | ||
TFunctionName extends string, | ||
>({ | ||
@@ -31,3 +31,5 @@ abi, | ||
}: EncodeFunctionResultArgs<TAbi, TFunctionName>) { | ||
const description = abi.find((x) => 'name' in x && x.name === functionName) | ||
const description = (abi as Abi).find( | ||
(x) => 'name' in x && x.name === functionName, | ||
) | ||
if (!description) | ||
@@ -34,0 +36,0 @@ throw new AbiFunctionNotFoundError(functionName, { docsPath }) |
@@ -1,5 +0,95 @@ | ||
import { Abi } from 'abitype' | ||
import type { Abi, AbiParameter, Address, Narrow } from 'abitype' | ||
import type { ExtractArgsFromAbi, ExtractNameFromAbi } from '../../types' | ||
import { isAddress } from '../address' | ||
export function getAbiItem({ abi, name }: { abi: Abi; name: string }) { | ||
return abi.find((x) => 'name' in x && x.name === name) | ||
export type GetAbiItemArgs< | ||
TAbi extends Abi | readonly unknown[] = Abi, | ||
TFunctionName extends string = any, | ||
> = { | ||
abi: Narrow<TAbi> | ||
name: ExtractNameFromAbi<TAbi, TFunctionName> | ||
} & Partial<ExtractArgsFromAbi<TAbi, TFunctionName>> | ||
export function getAbiItem< | ||
TAbi extends Abi | readonly unknown[], | ||
TFunctionName extends string, | ||
>({ abi, args = [], name }: GetAbiItemArgs<TAbi, TFunctionName>) { | ||
const abiItems = (abi as Abi).filter((x) => 'name' in x && x.name === name) | ||
if (abiItems.length === 0) return undefined | ||
if (abiItems.length === 1) return abiItems[0] | ||
for (const abiItem of abiItems) { | ||
if (!('inputs' in abiItem)) continue | ||
if (!args || args.length === 0) { | ||
if (!abiItem.inputs || abiItem.inputs.length === 0) return abiItem | ||
continue | ||
} | ||
if (!abiItem.inputs) continue | ||
if (abiItem.inputs.length === 0) continue | ||
const matched = (args as readonly unknown[]).every((arg, index) => { | ||
const abiParameter = 'inputs' in abiItem && abiItem.inputs![index] | ||
if (!abiParameter) return false | ||
return isArgOfType(arg, abiParameter as AbiParameter) | ||
}) | ||
if (matched) return abiItem | ||
} | ||
return abiItems[0] | ||
} | ||
export function isArgOfType(arg: unknown, abiParameter: AbiParameter): boolean { | ||
const argType = typeof arg | ||
const abiParameterType = abiParameter.type | ||
switch (abiParameterType) { | ||
case 'address': | ||
return isAddress(arg as Address) | ||
case 'bool': | ||
return argType === 'boolean' | ||
case 'function': | ||
return argType === 'string' | ||
case 'string': | ||
return argType === 'string' | ||
default: { | ||
if (abiParameterType === 'tuple' && 'components' in abiParameter) | ||
return Object.values(abiParameter.components).every( | ||
(component, index) => { | ||
return isArgOfType( | ||
Object.values(arg as unknown[] | Record<string, unknown>)[index], | ||
component as AbiParameter, | ||
) | ||
}, | ||
) | ||
// `(u)int<M>`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0` | ||
// https://regexr.com/6v8hp | ||
if ( | ||
/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test( | ||
abiParameterType, | ||
) | ||
) | ||
return argType === 'number' || argType === 'bigint' | ||
// `bytes<M>`: binary type of `M` bytes, `0 < M <= 32` | ||
// https://regexr.com/6va55 | ||
if (/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(abiParameterType)) | ||
return argType === 'string' || arg instanceof Uint8Array | ||
// fixed-length (`<type>[M]`) and dynamic (`<type>[]`) arrays | ||
// https://regexr.com/6va6i | ||
if (/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(abiParameterType)) { | ||
return ( | ||
Array.isArray(arg) && | ||
arg.every((x: unknown) => | ||
isArgOfType(x, { | ||
...abiParameter, | ||
// Pop off `[]` or `[M]` from end of type | ||
type: abiParameterType.replace(/(\[[0-9]{0,}\])$/, ''), | ||
} as AbiParameter), | ||
) | ||
) | ||
} | ||
return false | ||
} | ||
} | ||
} |
export type { DecodeAbiArgs } from './decodeAbi' | ||
export { decodeAbi } from './decodeAbi' | ||
export type { DecodeErrorResultArgs } from './decodeErrorResult' | ||
export type { | ||
DecodeErrorResultArgs, | ||
DecodeErrorResultResponse, | ||
} from './decodeErrorResult' | ||
export { decodeErrorResult } from './decodeErrorResult' | ||
@@ -38,2 +41,3 @@ | ||
export type { GetAbiItemArgs } from './getAbiItem' | ||
export { getAbiItem } from './getAbiItem' |
@@ -34,14 +34,14 @@ import { describe, expect, test } from 'vitest' | ||
).toThrowErrorMatchingInlineSnapshot(` | ||
"Address \\"0xa5cc3c03994db5b0d9a5eEdD10Cabab0813678az\\" is invalid. | ||
"Address \\"0xa5cc3c03994db5b0d9a5eEdD10Cabab0813678az\\" is invalid. | ||
Version: viem@1.0.2" | ||
`) | ||
Version: viem@1.0.2" | ||
`) | ||
expect(() => | ||
getAddress('0xa5cc3c03994db5b0d9a5eEdD10Cabab0813678aff'), | ||
).toThrowErrorMatchingInlineSnapshot(` | ||
"Address \\"0xa5cc3c03994db5b0d9a5eEdD10Cabab0813678aff\\" is invalid. | ||
"Address \\"0xa5cc3c03994db5b0d9a5eEdD10Cabab0813678aff\\" is invalid. | ||
Version: viem@1.0.2" | ||
`) | ||
Version: viem@1.0.2" | ||
`) | ||
}) | ||
}) |
@@ -5,3 +5,7 @@ import { describe, expect, test } from 'vitest' | ||
import { baycContractConfig } from '../../_test/abis' | ||
import { BaseError } from '../../errors' | ||
import { | ||
AbiDecodingZeroDataError, | ||
BaseError, | ||
RawContractError, | ||
} from '../../errors' | ||
import { getContractError } from './getContractError' | ||
@@ -11,89 +15,270 @@ | ||
test('default', () => { | ||
expect( | ||
getContractError( | ||
new BaseError('An RPC error occurred', { | ||
cause: { | ||
code: 3, | ||
message: 'execution reverted: Sale must be active to mint Ape', | ||
data: '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001f53616c65206d7573742062652061637469766520746f206d696e742041706500', | ||
} as unknown as Error, | ||
}), | ||
{ | ||
abi: baycContractConfig.abi, | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}, | ||
), | ||
).toMatchInlineSnapshot(` | ||
[ContractMethodExecutionError: Sale must be active to mint Ape | ||
const error = getContractError( | ||
new RawContractError({ | ||
message: 'execution reverted: Sale must be active to mint Ape', | ||
data: '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001f53616c65206d7573742062652061637469766520746f206d696e742041706500', | ||
}), | ||
{ | ||
abi: baycContractConfig.abi, | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}, | ||
) | ||
expect(error).toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "mintApe" reverted with the following reason: | ||
Sale must be active to mint Ape | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Version: viem@1.0.2] | ||
`) | ||
expect(error.cause).toMatchInlineSnapshot(` | ||
[ContractFunctionRevertedError: The contract function "mintApe" reverted with the following reason: | ||
Sale must be active to mint Ape | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('default: rpc', () => { | ||
const error = getContractError( | ||
new BaseError('An RPC error occurred', { | ||
cause: { | ||
code: 3, | ||
message: 'execution reverted: Sale must be active to mint Ape', | ||
data: '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001f53616c65206d7573742062652061637469766520746f206d696e742041706500', | ||
} as unknown as Error, | ||
}), | ||
{ | ||
abi: baycContractConfig.abi, | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}, | ||
) | ||
expect(error).toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "mintApe" reverted with the following reason: | ||
Sale must be active to mint Ape | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Details: execution reverted: Sale must be active to mint Ape | ||
Version: viem@1.0.2] | ||
`) | ||
expect(error.cause).toMatchInlineSnapshot(` | ||
[ContractFunctionRevertedError: The contract function "mintApe" reverted with the following reason: | ||
Sale must be active to mint Ape | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('default', () => { | ||
expect( | ||
getContractError( | ||
new BaseError('An RPC error occurred', { | ||
cause: { | ||
code: 3, | ||
message: 'execution reverted: Sale must be active to mint Ape', | ||
data: '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001f53616c65206d7573742062652061637469766520746f206d696e742041706500', | ||
} as unknown as Error, | ||
}), | ||
{ | ||
abi: baycContractConfig.abi, | ||
functionName: 'foo', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}, | ||
), | ||
).toMatchInlineSnapshot(` | ||
[ContractMethodExecutionError: Sale must be active to mint Ape | ||
test('no data', () => { | ||
const error = getContractError( | ||
new BaseError('An RPC error occurred', { | ||
cause: { | ||
code: 3, | ||
message: 'ah no', | ||
} as unknown as Error, | ||
}), | ||
{ | ||
abi: baycContractConfig.abi, | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}, | ||
) | ||
expect(error).toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "mintApe" reverted with the following reason: | ||
ah no | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Details: execution reverted: Sale must be active to mint Ape | ||
Version: viem@1.0.2] | ||
`) | ||
expect(error.cause).toMatchInlineSnapshot(` | ||
[ContractFunctionRevertedError: The contract function "mintApe" reverted with the following reason: | ||
ah no | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('unknown error', () => { | ||
expect( | ||
getContractError( | ||
new BaseError('An RPC error occurred', { | ||
cause: new Error('rarararar i am an error lmaoaoo'), | ||
}), | ||
{ | ||
abi: baycContractConfig.abi, | ||
functionName: 'foo', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}, | ||
), | ||
).toMatchInlineSnapshot(` | ||
[ViemError: An RPC error occurred | ||
test('no message', () => { | ||
const error = getContractError( | ||
new BaseError('An RPC error occurred', { | ||
cause: { | ||
code: 3, | ||
data: '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001f53616c65206d7573742062652061637469766520746f206d696e742041706500', | ||
} as unknown as Error, | ||
}), | ||
{ | ||
abi: baycContractConfig.abi, | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}, | ||
) | ||
expect(error).toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "mintApe" reverted with the following reason: | ||
Sale must be active to mint Ape | ||
Details: rarararar i am an error lmaoaoo | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Version: viem@1.0.2] | ||
`) | ||
expect( | ||
getContractError(new BaseError('An RPC error occurred'), { | ||
expect(error.cause).toMatchInlineSnapshot(` | ||
[ContractFunctionRevertedError: The contract function "mintApe" reverted with the following reason: | ||
Sale must be active to mint Ape | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('unknown function', () => { | ||
const error = getContractError( | ||
new BaseError('An RPC error occurred', { | ||
cause: { | ||
code: 3, | ||
message: 'execution reverted: Sale must be active to mint Ape', | ||
data: '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001f53616c65206d7573742062652061637469766520746f206d696e742041706500', | ||
} as unknown as Error, | ||
}), | ||
{ | ||
abi: baycContractConfig.abi, | ||
functionName: 'foo', | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}, | ||
) | ||
expect(error).toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "mintApe" reverted with the following reason: | ||
Sale must be active to mint Ape | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Version: viem@1.0.2] | ||
`) | ||
expect(error.cause).toMatchInlineSnapshot(` | ||
[ContractFunctionRevertedError: The contract function "mintApe" reverted with the following reason: | ||
Sale must be active to mint Ape | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('unknown error', () => { | ||
const error = getContractError( | ||
new BaseError('An RPC error occurred', { | ||
cause: new Error('rarararar i am an error lmaoaoo'), | ||
}), | ||
).toMatchInlineSnapshot(` | ||
{ | ||
abi: baycContractConfig.abi, | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}, | ||
) | ||
expect(error).toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: An RPC error occurred | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Details: rarararar i am an error lmaoaoo | ||
Version: viem@1.0.2] | ||
`) | ||
expect(error.cause).toMatchInlineSnapshot(` | ||
[ViemError: An RPC error occurred | ||
Details: rarararar i am an error lmaoaoo | ||
Version: viem@1.0.2] | ||
`) | ||
const error2 = getContractError(new BaseError('An RPC error occurred'), { | ||
abi: baycContractConfig.abi, | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}) | ||
expect(error2).toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: An RPC error occurred | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Version: viem@1.0.2] | ||
`) | ||
expect(error2.cause).toMatchInlineSnapshot(` | ||
[ViemError: An RPC error occurred | ||
Version: viem@1.0.2] | ||
`) | ||
const error3 = getContractError(new BaseError(''), { | ||
abi: baycContractConfig.abi, | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}) | ||
expect(error3).toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: An unknown error occurred while executing the contract function "mintApe". | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Version: viem@1.0.2] | ||
`) | ||
expect(error3.cause).toMatchInlineSnapshot(` | ||
[ViemError: An error occurred. | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
test('zero data', () => { | ||
const error = getContractError(new AbiDecodingZeroDataError(), { | ||
abi: baycContractConfig.abi, | ||
functionName: 'mintApe', | ||
args: [1n], | ||
sender: accounts[0].address, | ||
}) | ||
expect(error).toMatchInlineSnapshot(` | ||
[ContractFunctionExecutionError: The contract function "mintApe" returned no data ("0x"). | ||
This could be due to any of the following: | ||
- The contract does not have the function "mintApe", | ||
- The parameters passed to the contract function may be invalid, or | ||
- The address is not a contract. | ||
Function: mintApe(uint256 numberOfTokens) | ||
Arguments: (1) | ||
Sender: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 | ||
Version: viem@1.0.2] | ||
`) | ||
expect(error.cause).toMatchInlineSnapshot(` | ||
[ContractFunctionZeroDataError: The contract function "mintApe" returned no data ("0x"). | ||
This could be due to any of the following: | ||
- The contract does not have the function "mintApe", | ||
- The parameters passed to the contract function may be invalid, or | ||
- The address is not a contract. | ||
Version: viem@1.0.2] | ||
`) | ||
}) | ||
}) |
import { Abi } from 'abitype' | ||
import { | ||
AbiDecodingZeroDataError, | ||
ContractMethodExecutionError, | ||
ContractMethodZeroDataError, | ||
BaseError, | ||
ContractFunctionExecutionError, | ||
RawContractError, | ||
} from '../../errors' | ||
import { | ||
ContractFunctionRevertedError, | ||
ContractFunctionZeroDataError, | ||
} from '../../errors/contract' | ||
import { Address } from '../../types' | ||
import { formatAbiItemWithArgs, formatAbiItem, getAbiItem } from '../abi' | ||
const EXECUTION_REVERTED_ERROR_CODE = 3 | ||
export function getContractError( | ||
err: unknown, | ||
err: BaseError, | ||
{ | ||
@@ -16,2 +22,3 @@ abi, | ||
args, | ||
docsPath, | ||
functionName, | ||
@@ -23,2 +30,3 @@ sender, | ||
address?: Address | ||
docsPath?: string | ||
functionName: string | ||
@@ -28,42 +36,26 @@ sender?: Address | ||
) { | ||
const { code, message } = | ||
((err as Error).cause as { code?: number; message?: string }) || {} | ||
const { code, data, message } = ( | ||
err instanceof RawContractError ? err : err.cause || {} | ||
) as RawContractError | ||
const abiItem = getAbiItem({ abi, name: functionName }) | ||
const formattedArgs = abiItem | ||
? formatAbiItemWithArgs({ | ||
abiItem, | ||
args, | ||
includeFunctionName: false, | ||
includeName: false, | ||
}) | ||
: undefined | ||
const functionWithParams = abiItem | ||
? formatAbiItem(abiItem, { includeName: true }) | ||
: undefined | ||
let cause = err | ||
if (err instanceof AbiDecodingZeroDataError) { | ||
return new ContractMethodZeroDataError({ | ||
cause = new ContractFunctionZeroDataError({ functionName }) | ||
} else if (code === EXECUTION_REVERTED_ERROR_CODE && (data || message)) { | ||
cause = new ContractFunctionRevertedError({ | ||
abi, | ||
args, | ||
cause: err as Error, | ||
contractAddress: address, | ||
data, | ||
functionName, | ||
functionWithParams, | ||
message, | ||
}) | ||
} | ||
if (code === 3 || message?.includes('execution reverted')) { | ||
const message_ = message?.replace('execution reverted: ', '') | ||
return new ContractMethodExecutionError(message_, { | ||
abi, | ||
args, | ||
cause: err as Error, | ||
contractAddress: address, | ||
formattedArgs, | ||
functionName, | ||
functionWithParams, | ||
sender, | ||
}) | ||
} | ||
return err | ||
return new ContractFunctionExecutionError(cause, { | ||
abi, | ||
args, | ||
contractAddress: address, | ||
docsPath, | ||
functionName, | ||
sender, | ||
}) | ||
} |
import { hexZeroPad, zeroPad } from 'ethers/lib/utils' | ||
import { hexZeroPad as hexZeroPad2, zeroPad as zeroPad2 } from 'essential-eth' | ||
@@ -21,6 +20,2 @@ import { bench, describe } from 'vitest' | ||
}) | ||
bench('essential-eth: `hexZeroPad`', () => { | ||
hexZeroPad2('0xa4e12a45', 32) | ||
}) | ||
}) | ||
@@ -36,6 +31,2 @@ | ||
}) | ||
bench('essential-eth: `zeroPad`', () => { | ||
zeroPad2(new Uint8Array([1, 122, 51, 123]), 32) | ||
}) | ||
}) |
import { hexStripZeros, stripZeros } from 'ethers/lib/utils' | ||
import { | ||
hexStripZeros as hexStripZeros2, | ||
stripZeros as stripZeros2, | ||
} from 'essential-eth' | ||
@@ -19,6 +15,2 @@ import { bench, describe } from 'vitest' | ||
}) | ||
bench('essential-eth: `hexStripZeros`', () => { | ||
hexStripZeros2('0x00000000000000000000000a4e12a45') | ||
}) | ||
}) | ||
@@ -43,10 +35,2 @@ | ||
}) | ||
bench('essential-eth: `stripZeros`', () => { | ||
stripZeros2( | ||
new Uint8Array([ | ||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 122, 51, 123, | ||
]), | ||
) | ||
}) | ||
}) |
import { arrayify, toUtf8Bytes } from 'ethers/lib/utils' | ||
import { | ||
arrayify as arrayify2, | ||
toUtf8Bytes as toUtf8Bytes2, | ||
} from 'essential-eth' | ||
import { bench, describe } from 'vitest' | ||
@@ -23,6 +19,2 @@ import Web3 from 'web3' | ||
}) | ||
bench('essential-eth: `arrayify`', () => { | ||
arrayify2('0x48656c6c6f20576f726c6421') | ||
}) | ||
}) | ||
@@ -38,6 +30,2 @@ | ||
}) | ||
bench('essential-eth: `toUtf8Bytes`', () => { | ||
toUtf8Bytes2('Hello world') | ||
}) | ||
}) |
import { hexlify } from 'ethers/lib/utils' | ||
import { hexlify as hexlify2 } from 'essential-eth' | ||
import { bench, describe } from 'vitest' | ||
@@ -20,6 +19,2 @@ import Web3 from 'web3' | ||
}) | ||
bench('essential-eth: `hexlify`', () => { | ||
hexlify2(52) | ||
}) | ||
}) | ||
@@ -55,8 +50,2 @@ | ||
}) | ||
bench('essential-eth: `hexlify`', () => { | ||
hexlify2( | ||
new Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]), | ||
) | ||
}) | ||
}) |
@@ -9,7 +9,5 @@ import { keccak_256 } from '@noble/hashes/sha3' | ||
export type Keccak256Hash<TTo extends To> = TTo extends 'bytes' | ||
? ByteArray | ||
: TTo extends 'hex' | ||
? Hex | ||
: never | ||
export type Keccak256Hash<TTo extends To> = | ||
| (TTo extends 'bytes' ? ByteArray : never) | ||
| (TTo extends 'hex' ? Hex : never) | ||
@@ -16,0 +14,0 @@ export function keccak256<TTo extends To = 'hex'>( |
@@ -78,2 +78,5 @@ import { expect, test } from 'vitest' | ||
"keccak256": [Function], | ||
"labelhash": [Function], | ||
"namehash": [Function], | ||
"normalize": [Function], | ||
"numberToBytes": [Function], | ||
@@ -80,0 +83,0 @@ "numberToHex": [Function], |
export type { | ||
DecodeAbiArgs, | ||
DecodeErrorResultArgs, | ||
DecodeErrorResultResponse, | ||
DecodeFunctionDataArgs, | ||
@@ -13,2 +14,3 @@ DecodeFunctionResultArgs, | ||
EncodeFunctionResultArgs, | ||
GetAbiItemArgs, | ||
} from './abi' | ||
@@ -70,2 +72,4 @@ export { | ||
export { labelhash, namehash, normalize } from './ens' | ||
export type { | ||
@@ -72,0 +76,0 @@ BlockFormatter, |
@@ -73,4 +73,3 @@ import { describe, expect, test } from 'vitest' | ||
Details: Method not found | ||
Version: viem@1.0.2 | ||
Internal Error: {\\"code\\":-32601,\\"message\\":\\"Method not found\\"}" | ||
Version: viem@1.0.2" | ||
`) | ||
@@ -710,4 +709,3 @@ }) | ||
Details: data did not match any variant of untagged enum EthRpcCall | ||
Version: viem@1.0.2 | ||
Internal Error: {"code":-32602,"message":"data did not match any variant of untagged enum EthRpcCall"}] | ||
Version: viem@1.0.2] | ||
`) | ||
@@ -966,4 +964,3 @@ }) | ||
Details: data did not match any variant of untagged enum EthRpcCall | ||
Version: viem@1.0.2 | ||
Internal Error: {\\"code\\":-32602,\\"message\\":\\"data did not match any variant of untagged enum EthRpcCall\\"}" | ||
Version: viem@1.0.2" | ||
`, | ||
@@ -970,0 +967,0 @@ ) |
import { bench, describe } from 'vitest' | ||
import { utils } from 'ethers' | ||
import Web3 from 'web3' | ||
import { weiToEther } from 'essential-eth' | ||
@@ -22,6 +21,2 @@ import { formatUnit } from './formatUnit' | ||
}) | ||
bench('essential-eth: `etherToWei`', () => { | ||
weiToEther('40000000000000000000') | ||
}) | ||
}) |
import { bench, describe } from 'vitest' | ||
import { utils } from 'ethers' | ||
import Web3 from 'web3' | ||
import { etherToWei } from 'essential-eth' | ||
@@ -22,6 +21,2 @@ import { parseUnit } from './parseUnit' | ||
}) | ||
bench('essential-eth: `etherToWei`', () => { | ||
etherToWei('40') | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2520974
506
51293
5
4
+ Addedidna-uts46-hx@^4.1.2
+ Addedabitype@0.3.0(transitive)
+ Addedidna-uts46-hx@4.1.2(transitive)
+ Addedpunycode@2.3.1(transitive)
- Removedabitype@0.2.5(transitive)
Updatedabitype@~0.3.0