CoolFace
Datasetpublic

enigmare/v2-crawler

sourceHugging Faceupdated 28d agoView on Hugging Face
1likes904downloads
docs_ethers_org.jsonl31 linesDownload Raw Back to documentation
1{"id":"doc-https_docs_ethers_org_v6_contributing-6b00bd93","source":"documentation","title":"https://docs.ethers.org/v6/contributing/","url":"https://docs.ethers.org/v6/contributing/","text":"Documentation »Contributions and Hacking Contributions and HackingPull requests are welcome, but please keep the following in changes will not be accepted; they may be considered for the next major version Security is important; adding dependencies require fairly convincing arguments as to why The library aims to be lean, so keep an eye on the dist/ethers.min.js file size before and after your changes (the build-clean target includes these stats) Keep the PR simple, readable and confined to the relevant files; see below for which files to change Add test cases for both expected and unexpected input Any new features need to be supported by me (future issues, documentation, testing, migration), so anything that is overly complicated or specific may not be accepted Everyone is working hard; be kind and respectful It is always highly recommended that you open a Ethers Discussion before beginning a PR. DocumentationThe documentation is an area which can always benefit from extra eyes, extra knowledge and extra examples.Contributing to the documentation is welcome, but when making changes to documentation, please ensure that all changes are made only /docs.wrm/**.wrm Adding links: /docs.wrm/links/*.txt Updating API jsdocs: /** ... */ comment blocks within /src.ts/ Generally changes to /docs.wrm/config.wrm should not be made, and if you feel it is necessary, please consider opening a Ethers Discussion first.Similarly, when adding a new sections, a Ethers Discussion is preferred.All changes should be in the Flatworm Markdown Dialect.Building the DocumentationCurrently, the documentation is built using an experimental v2 of the Flatworm documentation system, a system originally specifically made to maintain the Ethers documentation.The new tsdocs branch has the ability to parse jsdocs from from TypeScript source files to create an API reference.Building with the v2 Flatworm # Clone the repo /home/ricmoo> git clone https://github.com/ricmoo/flatworm.git /home/ricmoo> cd flatworm # Check out the tsdocs branch /home/ricmoo/flatworm> git checkout tsdocs # Install the necessary dependencies /home/ricmoo/flatworm> npm install # Ready to build the docs; output to a folder ./output/ /home/ricmoo/flatworm> node lib/cli-test PATH_TO_WRM_ROOT Eventually the code for the v2 branch will be cleaned up, and it will be much easier to include as a ``devDependency`` for Ethers. In the meantime, expect new changes to be made frequently to the ``tsdocs`` branch, so for stability you may wish to checkout a specific hash. Fixing BugsIn general the only files you should ever include in a PR source: /src.ts/**.ts Do not include a package.json with the updated tarballHash or version, and do not include any generated files in your PR.A bug fix must not modify anything requiring a minor version bump (see Adding Features), such as changing a method signature or altering the exports. Adding FeaturesContributing new features usually require a deeper understanding of the internal interactions with Ethers and its components, and generally requires a minor version bump.When making any of the following changes, you must first open a Ethers Discussion as the minor version will need to be bumped.any signature change (such as adding a parameter, changing a parameter type, changing the return type) adding any new export; such as a class, function or constants adding any method to any class changing any exports property within the package.json Changes of this sort should not be made without serious consideration and discussion. Building/home/ricmoo> git clone @TODO /home/ricmoo> cd ethers /home/ricmoo/ethers> npm install /home/ricmoo/ethers> npm run auto-build Previewing Documentation← Migrating from v5License and Copyright→The content of this site is licensed under the Creative Commons License. Generated on October 10, 2023,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.103Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":966}}2{"id":"doc-https_docs_ethers_org_v6-24b47bf2","source":"documentation","title":"https://docs.ethers.org/v6/","url":"https://docs.ethers.org/v6/","text":"Documentation DocumentationThe ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem.It is often used to create decentralized applications (dapps), wallets (such as MetaMask) and other tools and simple scripts that require reading and writing to the blockchain. About this documentation?These docs are still under construction, and are being expanded every day.Developers new to Ethers should be sure to read through the Getting Started section.And the Application Programming Interface is available for drilling down into more details about the entire Application Programming Interface. Older Documentationv5 documentation v4 documentation v3 documentation Getting Started→The content of this site is licensed under the Creative Commons License. Generated on August 21, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.104Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":215}}3{"id":"doc-https_docs_ethers_org_v6_cookbook-f0b0170b","source":"documentation","title":"https://docs.ethers.org/v6/cookbook/","url":"https://docs.ethers.org/v6/cookbook/","text":"Documentation »Cookbook CookbookA growing collection of code snippets for common problems and use cases when developing dapps and other blockchain tools.Signing Messages and Data React Native Performance ← Recipes→The content of this site is licensed under the Creative Commons License. Generated on September 12, 2023,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.104Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":84}}4{"id":"doc-https_docs_ethers_org_v6_api-c5e53535","source":"documentation","title":"https://docs.ethers.org/v6/api/","url":"https://docs.ethers.org/v6/api/","text":"Documentation »Application Programming Interface Application Programming InterfaceThe Application Programming Interface (API) is the collection of functions, classes and types offered by the Ethers library.CONSTANTS <src>version⇒ stringThe current version of Ethers.FUNCTIONS <src>splitBlobCells(proof: BytesLike, cellCount?: number)⇒ Array< string >Returns a BLOb proof as its cells for EIP-7594 BLOb.The default cellCount is 128. class PollingBlockTagSubscriberinherits from OnBlockSubscriber, SubscriberCREATING INSTANCES <src>new PollingBlockTagSubscriber(provider: AbstractProvider, )← Application Binary InterfacesApplication Binary Interface→The content of this site is licensed under the Creative Commons License. Generated on December 2, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.104Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":192}}5{"id":"doc-https_docs_ethers_org_v6_license-2a7b0d9d","source":"documentation","title":"https://docs.ethers.org/v6/license/","url":"https://docs.ethers.org/v6/license/","text":"Documentation »License and Copyright License and CopyrightThe ethers library (including all dependencies) are available under the MIT License, which permits a wide variety of uses. MIT LicenseCopyright © Richard Moore.Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.← Contributions and HackingThe content of this site is licensed under the Creative Commons License. Generated on December 9, 2022,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.104Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":342}}6{"id":"doc-https_docs_ethers_org_v6_migrating-068368c3","source":"documentation","title":"https://docs.ethers.org/v6/migrating/","url":"https://docs.ethers.org/v6/migrating/","text":"Documentation »Migrating from v5 Migrating from v5This guide aims to capture some of the high-level differences between v5 and v6 to help those migrating an existing app and those already familiar with v5 that just need a quick primer.The biggest difference in v6 is the use of modern ES6 features, so a lot of changes are largely internal.BigNumbers Contracts Importing Providers Signatures Transactions Utilities Removed Items Big NumbersOne of the biggest changes in v6 is that the BigNumber class has been replaced with the built-in ES2020 BigInt offered by modern JavaScript environments.There is plenty of online documentation to get you started with JavaScript ES2020 BigInt. Keep in mind, just like BigNumber, a ES2020 BigInt can only operate on integers.The FixedNumber class still exists for performing fixed-point maths.creating large numbers// Using BigNumber in v5 value = BigNumber.from(\"1000\") // Using BigInt in v6 (using literal notation). // Notice the suffix n value = 1000n // Using the BigInt function for strings value = BigInt(\"1000\") simple maths on large numbers// Adding two values in v5 sum = value1.add(value2) // Using BigInt in v6; keep in mind, both values // must be a BigInt sum = value1 + value2 simple comparison on large numbers// Checking equality in v5 isEqual = value1.eq(value2) // Using BigInt in v6 isEqual = (value1 == value2) ContractsThe Contract is an ES6 Proxy, which means it can resolve method names at run-time.Ambiguous MethodsIn v5, in the case of an ambiguous method, it was necessary to look up a method by its canonical normalized signature. In v6 the signature does not need to be normalized and the Typed API provides a cleaner way to access the desired method.In v5, duplicate definitions also injected warnings into the console, since there was no way to detect them at run-time.contracts in v5abi = [ \"function foo(address bar)\", \"function foo(uint160 bar)\", ] contract = new Contract(address, abi, provider) // In v5 it was necessary to specify the fully-qualified normalized // signature to access the desired method. For [\"foo(address)\"](addr) // These would fail, since there signature is not [\"foo(address )\"](addr) contract[\"foo(address addr)\"](addr) // This would fail, since the method is (addr) contracts in v6abi = [ \"function foo(address bar)\", \"function foo(uint160 bar)\", ] contract = new Contract(address, abi, provider) // Any of these work [\"foo(address)\"](addr) contract[\"foo(address )\"](addr) contract[\"foo(address addr)\"](addr) // This still fails, since there is no way to know which // method was intended contract.foo(addr) // However, the Typed API makes things a bit easier, since it // allows providing typing information to the (Typed.address(addr)) Other Method OperationsIn v5, contracts contained a series of method buckets, which then in turn had all signatures and non-ambiguous names attached to them to perform less-common operations.In v6, the methods each have their own less-common operations attached directly to them.other operations in v5// The default action chooses send or call base on method // type (pure, view, constant, non-payable or payable) contract.foo(addr) // This would perform the default action, but return a Result // object, instead of destructing the value contract.functions.foo(addr) // Forces using call contract.callStatic.foo(addr) // Estimate the gas contract.estimateGas.foo(addr) // Populate a transaction contract.populateTransaction.foo(addr) other operations in v6// Still behaves the same contract.foo(addr) // Perform a call, returning a Result object directly contract.foo.staticCallResult(addr) // Forces using call (even for payable and non-payable) contract.foo.staticCall(addr) // Forces sending a transaction (even for pure and view) contract.foo.send(addr) // Estimate the gas contract.foo.estimateGas(addr) // Populate a transaction contract.foo.populateTransaction(addr) ImportingIn v5, the project was maintained as a large set of sub-packages managed as a monorepo.In v6 all imports are available in the root package, and for those who wish to have finer-grained control, the pkg.exports makes certain folders available directly.importing in v5// Many things (but not all) we available on the root package import { ethers } from \"ethers\" // But some packages were grouped behind an additional property import { providers } from \"ethers\" const { InfuraProvider } = providers // For granular control, importing from the sub-package // was necessary import { InfuraProvider } from \"@ethersproject/providers\" importing in v6// Everything is available on the root package import { ethers } from \"ethers\" import { InfuraProvider } from \"ethers\" // The pkg.exports provides granular access import { InfuraProvider } from \"ethers/providers\" ProvidersIn addition to all the ethers.providers.* being moved to ethers.*, the biggest change developers need to keep in mind is that Web3Provider (which historically was used to wrap link-web3 providers) is now called BrowserProvider which is designed to wrap EIP-1193 providers, which is the standard that both modern Web3.js and injected providers offer.wrapping EIP-1193 providers// v5 provider = new ethers.providers.Web3Provider(window.ethereum) // = new ethers.BrowserProvider(window.ethereum) Also, the method for broadcasting transactions to the network has transactions// v5 provider.sendTransaction(signedTx) // v6 provider.broadcastTransaction(signedTx) The StaticJsonRpcProvider in v5 is now integrated into the v6 JsonRpcProvider directly. When connecting to a network which cannot change its network, it is much more efficient to disable the automatic safety check ethers performs.Create a Provider on a static network// v5 provider = new StaticJsonRpcProvider(url, network); // you know the network ahead of time and wish // to avoid even a single eth_chainId call provider = new JsonRpcProvider(url, network, { }); // you want the network automatically detected, // this will query eth_chainId only once provider = new JsonRpcProvider(url, undefined, { }); Since the fees for Ethereum chains has become more complicated, all Fee parameters in v6 were coalesced into a single `.getFeeData` method. While `gasPrice` is no longer widely used in modern networks, when using a legacy network, it is available using that method.Getting legacy gas price// v5 await provider.getGasPrice() // v6 (await provider.getFeeData()).gasPrice The `lastBaseFeePerGas` field has been removed from the `FeeData` object in v6. This field was commonly used in v5 to calculate target gas prices by adding it to `maxPriorityFeePerGas`. In v6, this calculation is handled automatically.Base fee handling// calculation using lastBaseFeePerGas feeData = await provider.getFeeData() targetGasPrice = feeData.maxPriorityFeePerGas.add(feeData.lastBaseFeePerGas) // maxFeePerGas (automatically calculated using EIP-1559 heuristics) feeData = await provider.getFeeData() targetGasPrice = feeData.maxFeePerGas // - get base fee from latest block if needed block = await provider.getBlock(\"latest\") baseFeePerGas = block.baseFeePerGas // i.e. lastBaseFeePerGas // calculation (if you need the old behavior) targetGasPrice = feeData.maxPriorityFeePerGas + block.baseFeePerGas SignaturesThe Signature is now a class which facilitates all the parsing and serializing.signature manipulation// v5 splitSig = splitSignature(sigBytes) sigBytes = joinSignature(splitSig) // v6 splitSig = ethers.Signature.from(sigBytes) sigBytes = ethers.Signature.from(splitSig).serialized TransactionsThe transaction helpers present in v5 were all wrapped into a Transaction class, which can handle any supported transaction format to be further processedparsing transactions// v5 tx = parseTransaction(txBytes) txBytes = serializeTransaction(tx) txBytes = serializeTransaction(tx, sig) // v6 tx = Transaction.from(txBytes) // v6 (the tx can optionally include the signature) txBytes = Transaction.from(tx).serialized UtilitiesBytes32 string helpers// In = ethers.utils.formatBytes32String(text) text = ethers.utils.parseBytes32String(bytes32) // In = ethers.encodeBytes32String(text) text = ethers.decodeBytes32String(bytes32) constants// ethers.constants.HashZero // ethers.ZeroHash data manipulation// v5 slice = ethers.utils.hexDataSlice(value, start, end) padded = ethers.utils.hexZeroPad(value, length) // v5; converting numbers to hexstrings hex = hexlify(35) // v6 slice = ethers.dataSlice(value, start, end) padded = ethers.zeroPadValue(value, length) // v6; converting numbers to hexstrings hex = toBeHex(35) defaultAbiCoder// In v5, it is a property of AbiCoder coder = AbiCoder.defaultAbiCoder // In v6, it is a static function on AbiCoder, which uses // a singleton pattern; the first time it is called, the // AbiCoder is created and on subsequent calls that initial // instance is returned. coder = AbiCoder.defaultAbiCoder() fetching content// v5, with a body and no weird things data = await ethers.utils.fetchJson(url, json, processFunc) // v5 with Connection overrides req = { url, user: \"username\", password: \"password\" // etc. properties have FetchRequest equivalents }; data = await ethers.utils.fetchJson(req, json, processFunc) // v6 req = new ethers.FetchRequest(url) // set a body; optional req.body = json // set credentials; optional req.setCredentials(\"username\", \"password\") // set a processFunc; optional req.processFunc = processFunc // send the request! resp = await req.send() // Get the response body; depending on desired format data = resp.body // Uint8Array data = resp.bodyText // Utf8String; throws if invalid data = resp.bodyJson // Object; throws if invalid hex conversion// v5 hex = ethers.utils.hexValue(value) array = ethers.utils.arrayify(value) // v6 hex = ethers.toQuantity(value) array = ethers.getBytes(value) solidity non-standard packed// v5 ethers.utils.solidityPack(types, values) ethers.utils.solidityKeccak256(types, values) ethers.utils.soliditySha256(types, values) // v6 ethers.solidityPacked(types, values) ethers.solidityPackedKeccak256(types, values) ethers.solidityPackedSha256(types, values) property manipulation// v5 ethers.utils.defineReadOnly(obj, \"name\", value) // v6 ethers.defineProperties(obj, { }); commify// v5 ethers.utils.commify(\"1234.5\") // v6; we removed some of these locale-specific utilities, // however the functionality can be easily replicated // and adjusted depending on your desired output format, // for which everyone wanted their own tweaks anyways. // // However, to mimic v5 functionality, this can be commify(value) { const match = value.match(/^(-?)([0-9]*)(\\.?)([0-9]*)$/); if (!match || (!match[2] && !match[4])) { throw new Error(`bad formatted number: ${ JSON.stringify(value) }`); } const neg = match[1]; const whole = BigInt(match[2] || 0).toLocaleString(\"en-us\"); const frac = match[4] ? match[4].match(/^(.*?)0*$/)[1]: \"0\"; return `${ neg }${ whole }.${ frac }`; } commify(\"1234.5\"); Removed Classes and functionsThe Logger class has been replaced by several Error utility functions.The checkProperties and shallowCopy have been removed in favor of using .map and Object.assign.← SigningContributions and Hacking→The content of this site is licensed under the Creative Commons License. Generated on August 20, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.105Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":2817}}7{"id":"doc-https_docs_ethers_org_v6_basics-7f0528f5","source":"documentation","title":"https://docs.ethers.org/v6/basics/","url":"https://docs.ethers.org/v6/basics/","text":"Documentation »Ethereum Basics Ethereum BasicsThis section aims to cover some of the basics for those interested in a deeper understanding of the inner-workings of Ethereum. TopicsApplication Binary Interface ← Getting StartedApplication Binary Interfaces→The content of this site is licensed under the Creative Commons License. Generated on June 1, 2023,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.105Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":93}}8{"id":"doc-https_docs_ethers_org_v6_cookbook_react_native-26c981e1","source":"documentation","title":"https://docs.ethers.org/v6/cookbook/react-native/","url":"https://docs.ethers.org/v6/cookbook/react-native/","text":"Documentation »Cookbook »React Native React NativeWhen using React Native, many of the built-in cryptographic primitives can be replaced by native, substantially faster implementations.This should be available in its own package in the future, but for now this is highly recommended, and requires installing the Quick Crypto package.import { ethers } from \"ethers\"; import crypto from \"react-native-quick-crypto\"; ethers.randomBytes.register((length) => { return new Uint8Array(crypto.randomBytes(length)); }); ethers.computeHmac.register((algo, key, data) => { return crypto.createHmac(algo, key).update(data).digest(); }); ethers.pbkdf2.register((passwd, salt, iter, keylen, algo) => { return crypto.pbkdf2Sync(passwd, salt, iter, keylen, algo); }); ethers.sha256.register((data) => { return crypto.createHash('sha256').update(data).digest(); }); ethers.sha512.register((data) => { return crypto.createHash('sha512').update(data).digest(); }); ← RecipesSigning→The content of this site is licensed under the Creative Commons License. Generated on September 12, 2023,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.106Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":271}}9{"id":"doc-https_docs_ethers_org_v6_cookbook_ens-059df914","source":"documentation","title":"https://docs.ethers.org/v6/cookbook/ens/","url":"https://docs.ethers.org/v6/cookbook/ens/","text":"Documentation »Cookbook »Cookbook: ENS Recipes RecipesHere is a collection of short, but useful examples of working with ENS entries. Get all Text recordsHere is a short recipe to get all the text records set for an ENS name.It first queries all TextChanged events on the resolver, and uses a MulticallProvider to batch all the eth_call queries for each key into a single eth_call. As such, you will need to install:/home/ricmoo> npm install @ethers-ext/provider-multicallFetching all ENS text records.import { ethers } from \"ethers\"; import { MulticallProvider } from \"@ethers-ext/provider-multicall\"; async function getTextRecords(_provider, name) { // Prepare a multicall-based provider to batch all the call operations const provider = new MulticallProvider(_provider); // Get the resolver for the given name const resolver = await provider.getResolver(name); // A contract instance; used filter and parse logs const contract = new ethers.Contract(resolver.address, [ \"event TextChanged(bytes32 indexed node, string indexed _key, string key)\" ], provider); // A filter for the given name const filter = contract.filters.TextChanged(ethers.namehash(name)); // Get the matching logs const logs = await contract.queryFilter(filter); // Filter the *unique* keys const keys = [ ...(new Set(logs.map((log) => log.args.key))) ]; // Get the values for the keys; failures are discarded const values = await Promise.all(keys.map((key) => { try { return resolver.getText(key); } catch (error) { } return null; })); // Return a Map of the key/value pairs return keys.reduce((accum, key, index) => { const value = values[index]; if (value != null) { accum.set(key, value); } return accum; }, new Map()); } // Example usage (async function() { const provider = new ethers.InfuraProvider(); console.log(await getTextRecords(provider, \"ricmoo.eth\")); })(); ← CookbookReact Native→The content of this site is licensed under the Creative Commons License. Generated on December 3, 2024,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.106Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":497}}10{"id":"doc-https_docs_ethers_org_v6_api_constants-38384de1","source":"documentation","title":"https://docs.ethers.org/v6/api/constants/","url":"https://docs.ethers.org/v6/api/constants/","text":"Documentation »API »Constants ConstantsSome common constants useful for Ethereum.CONSTANTS <src>EtherSymbol⇒ stringA constant for the ether symbol (normalized using NFKC).(i.e. \"\\u039e\") <src>MaxInt256⇒ bigintA constant for the maximum value for an int256.(i.e. 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn) <src>MaxUint256⇒ bigintA constant for the maximum value for a uint256.(i.e. 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn) <src>MessagePrefix⇒ stringA constant for the EIP-191 personal message prefix.(i.e. \"\\x19Ethereum Signed Message:\\n\") <src>MinInt256⇒ bigintA constant for the minimum value for an int256.(i.e. -8000000000000000000000000000000000000000000000000000000000000000n) <src>N⇒ bigintA constant for the order N for the secp256k1 curve.(i.e. 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n) <src>WeiPerEther⇒ bigintA constant for the number of wei in a single ether.(i.e. 1000000000000000000n) <src>ZeroAddress⇒ stringA constant for the zero address.(i.e. \"0x0000000000000000000000000000000000000000\") <src>ZeroHash⇒ stringA constant for the zero hash.(i.e. \"0x0000000000000000000000000000000000000000000000000000000000000000\")← AddressesContracts→The content of this site is licensed under the Creative Commons License. Generated on February 13, 2023,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.106Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":338}}11{"id":"doc-https_docs_ethers_org_v6_api_address-2c727b17","source":"documentation","title":"https://docs.ethers.org/v6/api/address/","url":"https://docs.ethers.org/v6/api/address/","text":"Documentation »API »Addresses AddressesAddresses are a fundamental part of interacting with Ethereum. They represent the global identity of Externally Owned Accounts (accounts backed by a private key) and contracts.The Ethereum Naming Service (ENS) provides an interconnected ecosystem of contracts, standards and libraries which enable looking up an address for an ENS name.These functions help convert between various formats, validate addresses and safely resolve ENS names.TYPES <src>AddressLike⇒ string | Promise< string > | AddressableAnything that can be used to return or resolve an address.FUNCTIONS <src>getAddress(address: string)⇒ stringReturns a normalized and checksumed address for address. This accepts non-checksum addresses, checksum addresses and getIcapAddress formats.The checksum in Ethereum uses the capitalization (upper-case vs lower-case) of the characters within an address to encode its checksum, which offers, on average, a checksum of 15-bits.If address contains both upper-case and lower-case, it is assumed to already be a checksum address and its checksum is validated, and if the address fails its expected checksum an error is thrown.If you wish the checksum of address to be ignore, it should be converted to lower-case (i.e. ) <src>getCreate2Address(from: string, , )⇒ stringReturns the address that would result from a CREATE2 operation with the given from, salt and initCodeHash.To compute the initCodeHash from a contract's init code, use the keccak256 function.For a quick overview and example of CREATE2, see Magical World of Create2.// The address of the contract from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\" // The salt salt = id(\"HelloWorld\") // The hash of the initCode initCode = \"0x6394198df16000526103ff60206004601c335afa6040516060f3\"; initCodeHash = keccak256(initCode) getCreate2Address(from, salt, initCodeHash) // '0x533ae9d683B10C02EbDb05471642F85230071FC3' <src>getCreateAddress(tx: { , })⇒ stringReturns the address that would result from a CREATE for tx.This can be used to compute the address a contract will be deployed to by an EOA when sending a deployment transaction (i.e. when the to address is null).This can also be used to compute the address a contract will be deployed to by a contract, by using the contract's address as the to and the contract's nonce.from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\"; nonce = 5; getCreateAddress({ from, nonce }); // '0x082B6aC9e47d7D83ea3FaBbD1eC7DAba9D687b36' <src>getIcapAddress(address: string)⇒ stringThe ICAP Address format format is an early checksum format which attempts to be compatible with the banking industry IBAN format for bank accounts.It is no longer common or a recommended format.getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\"); // 'XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36' getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\"); // 'XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36' // Throws an error if the ICAP checksum is wrong getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\"); // Error(\"bad icap checksum\", { // code: \"INVALID_ARGUMENT\" // argument: \"address\" // value: \"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\" // shortMessage: \"bad icap checksum\" // }) <src>isAddress(value: any)⇒ booleanReturns true if value is a valid address.// Valid address isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\") // true // Valid ICAP address isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\") // true // Invalid checksum isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\") // false // Invalid ICAP checksum isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\") // false // Not an address (an ENS name requires a provided and an // asynchronous API to access) isAddress(\"ricmoo.eth\") // false <src>isAddressable(value: any)⇒ booleanReturns true if value is an object which implements the Addressable interface.// Wallets and AbstractSigner sub-classes isAddressable(Wallet.createRandom()) // true // Contracts contract = new Contract(\"dai.tokens.ethers.eth\", [ ], provider) isAddressable(contract) // true <src>resolveAddress(target: AddressLike, resolver?: null | NameResolver)⇒ string | Promise< string >Resolves to an address for the target, which may be any supported address type, an Addressable or a Promise which resolves to an address.If an ENS name is provided, but that name has not been correctly configured a UnconfiguredNameError is thrown.addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\" // Addresses are return synchronously resolveAddress(addr, provider) // '0x6B175474E89094C44Da98b954EedeAC495271d0F' // Address promises are resolved asynchronously resolveAddress(Promise.resolve(addr)) // Promise<'0x6B175474E89094C44Da98b954EedeAC495271d0F'> // ENS names are resolved asynchronously resolveAddress(\"dai.tokens.ethers.eth\", provider) // Promise<'0x6B175474E89094C44Da98b954EedeAC495271d0F'> // Addressable objects are resolved asynchronously contract = new Contract(addr, [ ]) resolveAddress(contract, provider) // Promise<'0x6B175474E89094C44Da98b954EedeAC495271d0F'> // Unconfigured ENS names reject resolveAddress(\"nothing-here.ricmoo.eth\", provider) // Promise<Error(\"execution \", { // code: \"CALL_EXCEPTION\" // action: \"call\" // data: \"0x77209fe8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000190c6e6f7468696e672d68657265067269636d6f6f036574680000000000000000\" // reason: \"ResolverNotFound(bytes)\" // transaction: {\"to\":\"0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe\",\"data\":\"0xc285238a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000190c6e6f7468696e672d68657265067269636d6f6f036574680000000000000000\"} // invocation: {\"method\":\"requireResolver\",\"signature\":\"requireResolver(bytes)\",\"args\":[\"0x0c6e6f7468696e672d68657265067269636d6f6f0365746800\"]} // revert: {\"name\":\"ResolverNotFound\",\"signature\":\"ResolverNotFound(bytes)\",\"args\":[\"0x0c6e6f7468696e672d68657265067269636d6f6f0365746800\"]} // shortMessage: \"execution reverted (unknown custom error)\" // })> // ENS names require a NameResolver object passed in // (notice the provider was omitted) resolveAddress(\"nothing-here.ricmoo.eth\") // Error(\"ENS resolution requires a provider\", { // code: \"UNSUPPORTED_OPERATION\" // operation: \"resolveName\" // shortMessage: \"ENS resolution requires a provider\" // }) interface AddressableAn interface for objects which have an address, and can resolve it asyncronously.This allows objects such as Signer or Contract to be used most places an address can be, for example getting the balance.METHODS <src>addressable.getAddress()⇒ Promise< string >Get the object address. interface NameResolverAn interface for any object which can resolve an ENS name.METHODS <src>nameResolver.resolveName(name: string)⇒ Promise< null | string >Resolve to the address for the ENS name.Resolves to null if the name is unconfigued. Use resolveAddress (passing this object as resolver) to throw for names that are unconfigured.← ABI EncodingConstants→The content of this site is licensed under the Creative Commons License. Generated on January 14, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.107Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":1788}}12{"id":"doc-https_docs_ethers_org_v6_basics_abi-e4517aea","source":"documentation","title":"https://docs.ethers.org/v6/basics/abi/","url":"https://docs.ethers.org/v6/basics/abi/","text":"Documentation »Ethereum Basics »Application Binary Interfaces Application Binary InterfacesWhen interacting with any application, whether it is on Ethereum, over the internet or within a compiled application on a computer all information is stored and sent as binary data which is just a sequence of bytes.So every application must agree on how to encode and decode their information as a sequence of bytes.An Application Binary Interface (ABI) provides a way to describe the encoding and decoding process, in a generic way so that a variety of types and structures of types can be defined.For example, a string is often encoded as a UTF-8 sequence of bytes, which uses specific bits within sub-sequences to indicate emoji and other special characters. Every implementation of UTF-8 must understand and operate under the same rules so that strings work universally. In this way, UTF-8 standard is itself an ABI.When interacting with Ethereum, a contract received a sequence of bytes as input (provided by sending a transaction or through a call) and returns a result as a sequence of bytes. So, each Contract has its own ABI that helps specify how to encode the input and how to decode the output.It is up to the contract developer to make this ABI available. Many Contracts implement a standard (such as ERC-20), in which case the ABI for that standard can be used. Many developers choose to verify their source code on Etherscan, in which case Etherscan computes the ABI and provides it through their website (which can be fetched using the getContract method). Otherwise, beyond reverse engineering the Contract there is not a meaningful way to extract the contract ABI. Call Data RepresentationWhen calling a Contract on Ethereum, the input data must be encoded according to the ABI.The first 4 bytes of the data are the method selector, which is the keccak256 hash of the normalized method signature.Then the method parameters are encoded and concatenated to the selector.All encoded data is made up of components padded to 32 bytes, so the length of input data will always be congruent to 4 mod 32.The result of a successful call will be encoded values, whose components are padded to 32 bytes each as well, so the length of a result will always be congruent to 0 mod 32, on success.The result of a reverted call will contain the error selector as the first 4 bytes, which is the keccak256 of the normalized error signature, followed by the encoded values, whose components are padded to 32 bytes each, so the length of a revert will be congruent to 4 mod 32.The one exception to all this is that revert(false) will return a result or 0x. Event Data RepresentationWhen an Event is emitted from a contract, there are two places data is logged in a topics and the data.An additional fee is paid for each topic, but this affords a topic to be indexed in a bloom filter within the block, which allows efficient filtering.The topic hash is always the first topic in a Log, which is the keccak256 of the normalized event signature. This allows a specific event to be efficiently filtered, finding the matching events in a block.Each additional indexed parameter (i.e. parameters marked with indexed in the signautre) are placed in the topics as well, but may be filtered to find matching values.All non-indexed parameters are encoded and placed in the data. This is cheaper and more compact, but does not allow filtering on these values.For example, the event Transfer(address indexed from, address indexed to, uint value) would require 3 topics, which are the topic hash, the from address and the to address and the data would contain 32 bytes, which is the padded big-endian representation of value. This allows for efficient filtering by the event (i.e. Transfer) as well as the from address and to address. DeploymentWhen deploying a transaction, the data provided is treated as initcode, which executes the data as normal EVM bytecode, which returns a sequence of bytes, but instead of that sequence of bytes being treated as data that result is instead the bytecode to install as the bytecode of the contract.The bytecode produced by Solidity is designed to have all constructor parameters encoded normally and concatenated to the bytecode and provided as the data to a transaction with no to address.← Ethereum BasicsApplication Programming Interface→The content of this site is licensed under the Creative Commons License. Generated on May 1, 2024,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.108Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":1118}}13{"id":"doc-https_docs_ethers_org_v6_api_hashing-3fa742f9","source":"documentation","title":"https://docs.ethers.org/v6/api/hashing/","url":"https://docs.ethers.org/v6/api/hashing/","text":"Documentation »API »Hashing Utilities Hashing UtilitiesUtilities for common tasks involving hashing. Also see cryptographic hashing.FUNCTIONS <src>dnsEncode(name: string, maxLength?: number)⇒ stringReturns the DNS encoded name.This is used for various parts of ENS name resolution, such as the wildcard resolution. <src>ensNormalize(name: string)⇒ stringReturns the ENS name normalized. <src>hashAuthorization(auth: AuthorizationRequest)⇒ stringComputes the EIP-7702 authorization digest to sign. <src>hashMessage(message: Uint8Array | string)⇒ stringComputes the EIP-191 personal-sign message digest to sign.This prefixes the message with MessagePrefix and the decimal length of message and computes the keccak256 digest.If message is a string, it is converted to its UTF-8 bytes first. To compute the digest of a DataHexString, it must be converted to bytes.hashMessage(\"Hello World\") // '0xa1de988600a42c4b4ab089b619297c17d53cffae5d5120d82d8a92d0bb3b78f2' // Hashes the SIX (6) string characters, i.e. // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ] hashMessage(\"0x4243\") // '0x6d91b221f765224b256762dcba32d62209cf78e9bebb0a1b758ca26c76db3af4' // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... hashMessage(getBytes(\"0x4243\")) // '0x0d3abc18ec299cf9b42ba439ac6f7e3e6ec9f5c048943704e30fc2d9c7981438' // ...which is equal to using data hashMessage(new Uint8Array([ 0x42, 0x43 ])) // '0x0d3abc18ec299cf9b42ba439ac6f7e3e6ec9f5c048943704e30fc2d9c7981438' <src>id(value: string)⇒ stringA simple hashing function which operates on UTF-8 strings to compute an 32-byte identifier.This simply computes the UTF-8 bytes and computes the keccak256.id(\"hello world\") // '0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad' <src>isValidName(name: string)⇒ booleanReturns true if name is a valid ENS name. <src>namehash(name: string)⇒ stringReturns the namehash for name. <src>solidityPacked(types: ReadonlyArray< string >, < any >)⇒ stringComputes the Non-Standard Packed Mode representation of values respectively to their types.addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\" solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]); // '0x8ba1f109551bd432803012645ac136ddd64dba72000000000000000000000000000000000000000000000000000000000000002d' <src>solidityPackedKeccak256(types: ReadonlyArray< string >, < any >)⇒ stringComputes the Non-Standard Packed Mode keccak256 hash of values respectively to their types.addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\" solidityPackedKeccak256([ \"address\", \"uint\" ], [ addr, 45 ]); // '0x9465ddbc845149cfc7046bee85c30fd1b52b4f87d9c03ca8a0bd046868763030' <src>solidityPackedSha256(types: ReadonlyArray< string >, < any >)⇒ stringComputes the Non-Standard Packed Mode sha256 hash of values respectively to their types.addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\" solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]); // '0xb9d5d16842f6832018ea7bd1aa6aef22049eb966a5fb915470e22dfc3e2f828f' <src>verifyAuthorization(auth: AuthorizationRequest, )⇒ stringReturn the address of the private key that produced the signature sig during signing for message. <src>verifyMessage(message: Uint8Array | string, )⇒ stringReturn the address of the private key that produced the signature sig during signing for message. <src>verifyTypedData(domain: TypedDataDomain, < string, Array< TypedDataField > >, < string, any >, )⇒ stringCompute the address used to sign the typed data for the signature. interface AuthorizationRequestPROPERTIES <src>authorizationRequest.address⇒ string | Addressable <src>authorizationRequest.chainId⇒ BigNumberish <src>authorizationRequest.nonce⇒ Numeric interface TypedDataDomainThe domain for an EIP-712 payload.PROPERTIES <src>typedDataDomain.chainId⇒ null | BigNumberishThe chain ID of the signing domain. <src>typedDataDomain.name⇒ null | stringThe human-readable name of the signing domain. <src>typedDataDomain.salt⇒ null | BytesLikeA salt used for purposes decided by the specific domain. <src>typedDataDomain.verifyingContract⇒ null | stringThe the address of the contract that will verify the signature. <src>typedDataDomain.version⇒ null | stringThe major version of the signing domain. class TypedDataEncoderA TypedDataEncode prepares and encodes EIP-712 payloads for signed typed data.This is useful for those that wish to compute various components of a typed data hash, primary types, or sub-components, but generally the higher level signer.signTypedData is more useful.PROPERTIES <src>typedDataEncoder.primaryType⇒ stringread-onlyThe primary type for the structured types.This is derived automatically from the types, since no recursion is possible, once the DAG for the types is consturcted internally, the primary type must be the only remaining type with no parent nodes. <src>typedDataEncoder.types⇒ Record< string, Array< TypedDataField > >read-onlyThe types.CREATING INSTANCES <src>new TypedDataEncoder(types: Record< string, Array< TypedDataField > >)Create a new TypedDataEncoder for types.This performs all necessary checking that types are valid and do not violate the EIP-712 structural constraints as well as computes the primaryType. <src>TypedDataEncoder.from(types: Record< string, Array< TypedDataField > >)⇒ TypedDataEncoderCreate a new TypedDataEncoder for types.METHODS <src>typedDataEncoder.encode(value: Record< string, any >)⇒ stringReturn the fulled encoded value for the types. <src>typedDataEncoder.encodeData(type: string, )⇒ stringReturn the encoded value for the type. <src>typedDataEncoder.encodeType(name: string)⇒ stringReturn the full type for name. <src>typedDataEncoder.getEncoder(type: string)⇒ (value: any) => stringReturnthe encoder for the specific type. <src>typedDataEncoder.hash(value: Record< string, any >)⇒ stringReturn the hash of the fully encoded value for the types. <src>typedDataEncoder.hashStruct(name: string, < string, any >)⇒ stringReturns the hash of value for the type of name. <src>typedDataEncoder.visit(value: Record< string, any >, callback: (type: string, ) => any)⇒ anyCall calback for each value in value, passing the type and component within value.This is useful for replacing addresses or other transformation that may be desired on each component, based on its type.STATIC METHODS <src>TypedDataEncoder.encode(domain: TypedDataDomain, < string, Array< TypedDataField > >, < string, any >)⇒ stringReturn the fully encoded EIP-712 value for types with domain. <src>TypedDataEncoder.getPayload(domain: TypedDataDomain, < string, Array< TypedDataField > >, < string, any >)⇒ anyReturns the JSON-encoded payload expected by nodes which implement the JSON-RPC EIP-712 method. <src>TypedDataEncoder.getPrimaryType(types: Record< string, Array< TypedDataField > >)⇒ stringReturn the primary type for types. <src>TypedDataEncoder.hash(domain: TypedDataDomain, < string, Array< TypedDataField > >, < string, any >)⇒ stringReturn the hash of the fully encoded EIP-712 value for types with domain. <src>TypedDataEncoder.hashDomain(domain: TypedDataDomain)⇒ stringReturn the domain hash for domain. <src>TypedDataEncoder.hashStruct(name: string, < string, Array< TypedDataField > >, < string, any >)⇒ stringReturn the hashed struct for value using types and name. <src>TypedDataEncoder.resolveNames(domain: TypedDataDomain, < string, Array< TypedDataField > >, < string, any >, resolveName: (name: string) => Promise< string >)⇒ Promise< { , } >Resolves to the value from resolving all addresses in value for types and the domain. interface TypedDataFieldA specific field of a structured EIP-712 type.PROPERTIES <src>typedDataField.name⇒ stringThe field name. <src>typedDataField.type⇒ stringThe type of the field.← Cryptographic FunctionsProviders→The content of this site is licensed under the Creative Commons License. Generated on March 10, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.108Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":1948}}14{"id":"doc-https_docs_ethers_org_v6_api_crypto-d5e8516d","source":"documentation","title":"https://docs.ethers.org/v6/api/crypto/","url":"https://docs.ethers.org/v6/api/crypto/","text":"Documentation »API »Cryptographic Functions Cryptographic FunctionsA fundamental building block of Ethereum is the underlying cryptographic primitives.FUNCTIONS <src>lock()⇒ voidOnce called, prevents any future change to the underlying cryptographic primitives using the ) <src>ripemd160(data: BytesLike)⇒ DataHexstringCompute the cryptographic RIPEMD-160 hash of data.ripemd160(\"0x\") // '0x9c1185a5c5e9fc54612808977ee8f548b2258d31' ripemd160(\"0x1337\") // '0x224d2bd5251d8f9faa114eb0826e371d1236fda1' ripemd160(new Uint8Array([ 0x13, 0x37 ])) // '0x224d2bd5251d8f9faa114eb0826e371d1236fda1' <src>sha256(data: BytesLike)⇒ DataHexstringCompute the cryptographic SHA2-256 hash of data.sha256(\"0x\") // '0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' sha256(\"0x1337\") // '0x158760c856e5ea1ba97e2e2a456736c4bf30d964559afa6d748cf05694a636ff' sha256(new Uint8Array([ 0x13, 0x37 ])) // '0x158760c856e5ea1ba97e2e2a456736c4bf30d964559afa6d748cf05694a636ff' <src>sha512(data: BytesLike)⇒ DataHexstringCompute the cryptographic SHA2-512 hash of data.sha512(\"0x\") // '0xcf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e' sha512(\"0x1337\") // '0x55ccb35e52b39adac42b68304bf33ff7ecb854f09b2e761e234061482e98e45b4e68de2756bcc7b7099d7dd178f04dafa229d403b90bf8884eedea3806d4642b' sha512(new Uint8Array([ 0x13, 0x37 ])) // '0x55ccb35e52b39adac42b68304bf33ff7ecb854f09b2e761e234061482e98e45b4e68de2756bcc7b7099d7dd178f04dafa229d403b90bf8884eedea3806d4642b' HMACAn HMAC enables verification that a given key was used to authenticate a payload.See: link-wiki-hmacFUNCTIONS <src>computeHmac(algorithm: \"sha256\" | \"sha512\", , )⇒ stringReturn the HMAC for data using the key key with the underlying algo used for compression.key = id(\"some-secret\") // Compute the HMAC computeHmac(\"sha256\", key, \"0x1337\") // '0xbc985612171f71b89c7561c593f2cea20038d3f38f710b2516e405085d7c0c79' // To compute the HMAC of UTF-8 data, the data must be // converted to UTF-8 bytes computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\")) // '0xd0404ef8fae0d7f18a54a0ddfad8b81afa9e4cdab872a1dc36628c4397fd8201' PasswordsA Password-Based Key-Derivation Function is designed to create a sequence of bytes suitible as a key from a human-rememberable password.TYPES <src>ProgressCallback⇒ (percent: number) => voidA callback during long-running operations to update any UI or provide programatic access to the progress.The percent is a value between 0 and 1.FUNCTIONS <src>pbkdf2(password: BytesLike, , , , algo: \"sha256\" | \"sha512\")⇒ stringReturn the PBKDF2 for keylen bytes for password using the salt and using iterations of algo.This PBKDF is outdated and should not be used in new projects, but is required to decrypt older files.// The password must be converted to bytes, and it is generally // best practices to ensure the string has been normalized. Many // formats explicitly indicate the normalization form to use. password = \"hello\" passwordBytes = toUtf8Bytes(password, \"NFKC\") salt = id(\"some-salt\") // Compute the PBKDF2 pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\") // '0x226addf5b6d87544337e9733b99ceb9d' <src>scrypt(passwd: BytesLike, , , , , , progress?: ProgressCallback)⇒ Promise< string >The scrypt PBKDF uses a memory and cpu hard method of derivation to increase the resource cost to brute-force a password for a given key.This means this algorithm is intentionally slow, and can be tuned to become slower. As computation and memory speed improve over time, increasing the difficulty maintains the cost of an attacker.For example, if a target time of 5 seconds is used, a legitimate user which knows their password requires only 5 seconds to unlock their account. A 6 character password has 68 billion possibilities, which would require an attacker to invest over 10,000 years of CPU time. This is of course a crude example (as password generally aren't random), but demonstrates to value of imposing large costs to decryption.For this reason, if building a UI which involved decrypting or encrypting datsa using scrypt, it is recommended to use a ProgressCallback (as event short periods can seem lik an eternity if the UI freezes). Including the phrase \"decrypting\" in the UI can also help, assuring the user their waiting is for a good reason.// The password must be converted to bytes, and it is generally // best practices to ensure the string has been normalized. Many // formats explicitly indicate the normalization form to use. password = \"hello\" passwordBytes = toUtf8Bytes(password, \"NFKC\") salt = id(\"some-salt\") // Compute the scrypt scrypt(passwordBytes, salt, 1024, 8, 1, 16) // Promise<'0x3982633256a26ab2e62efa0621d1a5c0'> <src>scryptSync(passwd: BytesLike, , , , , )⇒ stringProvides a synchronous variant of scrypt.This will completely lock up and freeze the UI in a browser and will prevent any event loop from progressing. For this reason, it is preferred to use the async variant.// The password must be converted to bytes, and it is generally // best practices to ensure the string has been normalized. Many // formats explicitly indicate the normalization form to use. password = \"hello\" passwordBytes = toUtf8Bytes(password, \"NFKC\") salt = id(\"some-salt\") // Compute the scrypt scryptSync(passwordBytes, salt, 1024, 8, 1, 16) // '0x3982633256a26ab2e62efa0621d1a5c0' Random ValuesA Cryptographically Secure Random Value is one that has been generated with additional care take to prevent side-channels from allowing others to detect it and prevent others from through coincidence generate the same values.FUNCTIONS <src>randomBytes(length: number)⇒ Uint8ArrayReturn length bytes of cryptographically secure random data.randomBytes(8) // Uint8Array(8) [ // 227, 172, 30, 18, // 233, 194, 46, 196 // ] SigningAdd details about signing here.TYPES <src>SignatureLike⇒ Signature | string | { , , , yParity?: 0 | 1 , yParityAndS?: string } | { , s?: string , v?: number , yParity?: 0 | 1 , } | { , , v?: BigNumberish , | 1 , yParityAndS?: string }A SignatureLike class SignatureA Signature @TODOPROPERTIES <src>signature._s⇒ stringread-onlyReturn the s value, unchecked for EIP-2 compliance.This should generally not be used and is for situations where a non-canonical S value might be relevant, such as Frontier blocks that were mined prior to EIP-2 or invalid Authorization List signatures. <src>signature.compactSerialized⇒ stringread-onlyThe EIP-2098 compact representation. <src>signature.legacyChainId⇒ null | bigintread-onlyThe chain ID for EIP-155 legacy transactions. For non-legacy transactions, this value is null. <src>signature.networkV⇒ null | bigintread-onlyThe EIP-155 v for legacy transactions. For non-legacy transactions, this value is null. <src>signature.r⇒ stringThe r value for a signature.This represents the x coordinate of a \"reference\" or challenge point, from which the y can be computed. <src>signature.s⇒ stringThe s value for a signature. <src>signature.serialized⇒ stringread-onlyThe serialized representation. <src>signature.v⇒ 27 | 28The v value for a signature.Since a given x value for r has two possible values for its correspondin y, the v indicates which of the two y values to use.It is normalized to the values 27 or 28 for legacy purposes. <src>signature.yParity⇒ 0 | 1read-onlyThe yParity for the signature.See v for more details on how this value is used. <src>signature.yParityAndS⇒ stringread-onlyThe EIP-2098 compact representation of the yParity and s compacted into a single bytes32.CREATING INSTANCES <src>Signature.from(sig?: SignatureLike)⇒ SignatureCreates a new Signature.If no sig is provided, a new Signature is created with default values.If sig is a string, it is parsed.METHODS <src>signature.clone()⇒ SignatureReturns a new identical Signature. <src>signature.getCanonical()⇒ SignatureReturns the canonical signature.This is only necessary when dealing with legacy transaction which did not enforce canonical S values (i.e. EIP-155. Most developers should never require this. <src>signature.inspect()⇒ string <src>signature.isValid()⇒ booleanReturns true if the Signature is valid for EIP-155 signatures. <src>signature.toJSON()⇒ anyReturns a representation that is compatible with JSON.stringify. <src>signature.toString()⇒ stringSTATIC METHODS <src>Signature.getChainId(v: BigNumberish)⇒ bigintCompute the chain ID from the v in a legacy EIP-155 transactions.Signature.getChainId(45) // 5n Signature.getChainId(46) // 5n <src>Signature.getChainIdV(chainId: BigNumberish, | 28)⇒ bigintCompute the v for a chain ID for a legacy EIP-155 transactions.Legacy transactions which use EIP-155 hijack the v property to include the chain ID.Signature.getChainIdV(5, 27) // 45n Signature.getChainIdV(5, 28) // 46n <src>Signature.getNormalizedV(v: BigNumberish)⇒ 27 | 28Compute the normalized legacy transaction v from a yParirty, a legacy transaction v or a legacy EIP-155 transaction.// The values 0 and 1 imply v is actually yParity Signature.getNormalizedV(0) // 27 // Legacy non-EIP-1559 transaction (i.e. 27 or 28) Signature.getNormalizedV(27) // 27 // Legacy EIP-155 transaction (i.e. >= 35) Signature.getNormalizedV(46) // 28 // Invalid values throw Signature.getNormalizedV(5) // Error(\"invalid v\", { // code: \"INVALID_ARGUMENT\" // argument: \"v\" // // shortMessage: \"invalid v\" // }) class SigningKeyA SigningKey provides high-level access to the elliptic curve cryptography (ECC) operations and key management.PROPERTIES <src>signingKey.compressedPublicKey⇒ stringread-onlyThe compressed public key.This will always begin with either the prefix 0x02 or 0x03 and be 68 characters long (the 0x prefix and 33 hexadecimal nibbles) <src>signingKey.privateKey⇒ stringread-onlyThe private key. <src>signingKey.publicKey⇒ stringread-onlyThe uncompressed public key.This will always begin with the prefix 0x04 and be 132 characters long (the 0x prefix and 130 hexadecimal nibbles).CREATING INSTANCES <src>new SigningKey(privateKey: BytesLike)Creates a new SigningKey for privateKey.METHODS <src>signingKey.computeSharedSecret(other: BytesLike)⇒ stringReturns the ECDH shared secret between this private key and the other key.The other key may be any type of key, a raw public key, a compressed/uncompressed pubic key or aprivate key.Best practice is usually to use a cryptographic hash on the returned value before using it as a symetric secret.sign1 = new SigningKey(id(\"some-secret-1\")) sign2 = new SigningKey(id(\"some-secret-2\")) // Notice that privA.computeSharedSecret(pubB)... sign1.computeSharedSecret(sign2.publicKey) // '0x04b5bc2a5428042331a4c70da8f090d5552bdb35bc08a00ea8ed0a9b6d8737b8b7ea016b268d7cb9f02e11736b82b129ea3f37a8fdc6a7b0e9f5cdde4105ceb0de' // ...is equal to privB.computeSharedSecret(pubA). sign2.computeSharedSecret(sign1.publicKey) // '0x04b5bc2a5428042331a4c70da8f090d5552bdb35bc08a00ea8ed0a9b6d8737b8b7ea016b268d7cb9f02e11736b82b129ea3f37a8fdc6a7b0e9f5cdde4105ceb0de' <src>signingKey.sign(digest: BytesLike)⇒ SignatureReturn the signature of the signed digest.STATIC METHODS <src>SigningKey.addPoints(p0: BytesLike, , compressed?: boolean)⇒ stringReturns the point resulting from adding the ellipic curve points p0 and p1.This is not a common function most developers should require, but can be useful for certain privacy-specific techniques.For example, it is used by HDNodeWallet to compute child addresses from parent public keys and chain codes. <src>SigningKey.computePublicKey(key: BytesLike, compressed?: boolean)⇒ stringCompute the public key for key, optionally compressed.The key may be any type of key, a raw public key, a compressed/uncompressed public key or private key.sign = new SigningKey(id(\"some-secret\")); // Compute the uncompressed public key for a private key SigningKey.computePublicKey(sign.privateKey) // '0x04925bec9818e11ac806bf8b142a7965ac9231aaa9d23f256795d63b1d8d7f203f7481609b6a6964a0f5b459585e9d18a9ec9070d0baf24689138868811c974c96' // Compute the compressed public key for a private key SigningKey.computePublicKey(sign.privateKey, true) // '0x02925bec9818e11ac806bf8b142a7965ac9231aaa9d23f256795d63b1d8d7f203f' // Compute the uncompressed public key SigningKey.computePublicKey(sign.publicKey, false); // '0x04925bec9818e11ac806bf8b142a7965ac9231aaa9d23f256795d63b1d8d7f203f7481609b6a6964a0f5b459585e9d18a9ec9070d0baf24689138868811c974c96' // Compute the Compressed a public key SigningKey.computePublicKey(sign.publicKey, true); // '0x02925bec9818e11ac806bf8b142a7965ac9231aaa9d23f256795d63b1d8d7f203f' <src>SigningKey.recoverPublicKey(digest: BytesLike, )⇒ stringReturns the public key for the private key which produced the signature for the given digest.key = new SigningKey(id(\"some-secret\")) digest = id(\"hello world\") sig = key.sign(digest) // Notice the signer public key... key.publicKey // '0x04925bec9818e11ac806bf8b142a7965ac9231aaa9d23f256795d63b1d8d7f203f7481609b6a6964a0f5b459585e9d18a9ec9070d0baf24689138868811c974c96' // ...is equal to the recovered public key SigningKey.recoverPublicKey(digest, sig) // '0x04925bec9818e11ac806bf8b142a7965ac9231aaa9d23f256795d63b1d8d7f203f7481609b6a6964a0f5b459585e9d18a9ec9070d0baf24689138868811c974c96' ← ContractsHashing Utilities→The content of this site is licensed under the Creative Commons License. Generated on September 6, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.110Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":3327}}15{"id":"doc-https_docs_ethers_org_v6_api_utils-08e3d867","source":"documentation","title":"https://docs.ethers.org/v6/api/utils/","url":"https://docs.ethers.org/v6/api/utils/","text":"Documentation »API »Utilities UtilitiesThere are many simple utilities required to interact with Ethereum and to simplify the library, without increasing the library dependencies for simple functions. Base58 EncodingThe Base58 Encoding scheme allows a numeric value to be encoded as a compact string using a radix of 58 using only alpha-numeric characters. Confusingly similar characters are omitted (i.e. \"l0O\").Note that Base58 encodes a numeric value, not arbitrary bytes, since any zero-bytes on the left would get removed. To mitigate this issue most schemes that use Base58 choose specific high-order values to ensure non-zero prefixes.FUNCTIONS <src>decodeBase58(value: string)⇒ bigintDecode the Base58-encoded value. <src>encodeBase58(value: BytesLike)⇒ stringEncode value as a Base58-encoded string. Base64 EncodingBase64 encoding using 6-bit words to encode arbitrary bytes into a string using 65 printable symbols, the upper-case and lower-case alphabet, the digits 0 through 9, \"+\" and \"/\" with the \"=\" used for padding.FUNCTIONS <src>decodeBase64(value: string)⇒ Uint8ArrayDecodes the base-64 encoded value.// The decoded value is always binary data... result = decodeBase64(\"SGVsbG8gV29ybGQhIQ==\") // Uint8Array(13) [ // 72, 101, 108, 108, 111, // 32, 87, 111, 114, 108, // 100, 33, 33 // ] // ...use toUtf8String to convert it to a string. toUtf8String(result) // 'Hello World!!' // Decoding binary data decodeBase64(\"EjQ=\") // Uint8Array(2) [ 18, 52 ] <src>encodeBase64(data: BytesLike)⇒ stringEncodes data as a base-64 encoded string.// Encoding binary data as a hexstring encodeBase64(\"0x1234\") // 'EjQ=' // Encoding binary data as a Uint8Array encodeBase64(new Uint8Array([ 0x12, 0x34 ])) // 'EjQ=' // The input MUST be data... encodeBase64(\"Hello World!!\") // Error(\"invalid BytesLike value\", { // code: \"INVALID_ARGUMENT\" // argument: \"value\" // value: \"Hello World!!\" // shortMessage: \"invalid BytesLike value\" // }) // ...use toUtf8Bytes for this. encodeBase64(toUtf8Bytes(\"Hello World!!\")) // 'SGVsbG8gV29ybGQhIQ==' Data HelpersSome data helpers.TYPES <src>BytesLike⇒ DataHexString | Uint8ArrayAn object that can be used to represent binary data. <src>DataHexString⇒ stringA HexString whose length is even, which ensures it is a valid representation of binary data. <src>HexString⇒ stringA string which is prefixed with 0x and followed by any number of case-agnostic hexadecimal characters.It must match the regular expression /0x[0-9A-Fa-f]*/.FUNCTIONS <src>concat(datas: ReadonlyArray< BytesLike >)⇒ stringReturns a DataHexString by concatenating all values within data. <src>dataLength(data: BytesLike)⇒ numberReturns the length of data, in bytes. <src>dataSlice(data: BytesLike, start?: number, end?: number)⇒ stringReturns a DataHexString by slicing data from the start offset to the end offset.By default start is 0 and end is the length of data. <src>getBytes(value: BytesLike, name?: string)⇒ Uint8ArrayGet a typed Uint8Array for value. If already a Uint8Array the original value is returned; if a copy is required use getBytesCopy. <src>getBytesCopy(value: BytesLike, name?: string)⇒ Uint8ArrayGet a typed Uint8Array for value, creating a copy if necessary to prevent any modifications of the returned value from being reflected elsewhere. <src>hexlify(data: BytesLike)⇒ stringReturns a DataHexString representation of data. <src>isBytesLike(value: any)⇒ booleanReturns true if value is a valid representation of arbitrary data (i.e. a valid DataHexString or a Uint8Array). <src>isHexString(value: any, length?: number | boolean)⇒ booleanReturns true if value is a valid HexString.If length is true or a number, it also checks that value is a valid DataHexString of length (if a number) bytes of data (e.g. 0x1234 is 2 bytes). <src>stripZerosLeft(data: BytesLike)⇒ stringReturn the DataHexString result by stripping all leading * zero bytes from data. <src>zeroPadBytes(data: BytesLike, )⇒ stringReturn the DataHexString of data padded on the right to length bytes.If data already exceeds length, a BufferOverrunError is thrown.This pads data the same as bytes are in Solidity (e.g. bytes16). <src>zeroPadValue(data: BytesLike, )⇒ stringReturn the DataHexString of data padded on the left to length bytes.If data already exceeds length, a BufferOverrunError is thrown.This pads data the same as values are in Solidity (e.g. uint128). Math HelpersSome mathematic operations.TYPES <src>BigNumberish⇒ string | NumericAny type that can be used where a big number is needed. <src>Numeric⇒ number | bigintAny type that can be used where a numeric value is needed.FUNCTIONS <src>fromTwos(value: BigNumberish, )⇒ bigintConvert value from a twos-compliment representation of width bits to its value.If the highest bit is 1, the result will be negative. <src>getBigInt(value: BigNumberish, name?: string)⇒ bigintGets a BigInt from value. If it is an invalid value for a BigInt, then an ArgumentError will be thrown for name. <src>getNumber(value: BigNumberish, name?: string)⇒ numberGets a number from value. If it is an invalid value for a number, then an ArgumentError will be thrown for name. <src>getUint(value: BigNumberish, name?: string)⇒ bigintReturns value as a bigint, validating it is valid as a bigint value and that it is positive. <src>mask(value: BigNumberish, )⇒ bigintMask value with a bitmask of bits ones. <src>toBeArray(value: BigNumberish, width?: Numeric)⇒ Uint8ArrayConverts value to a Big Endian Uint8Array. <src>toBeHex(value: BigNumberish, width?: Numeric)⇒ stringConverts value to a Big Endian hexstring, optionally padded to width bytes. <src>toBigInt(value: BigNumberish | Uint8Array)⇒ bigint <src>toNumber(value: BigNumberish | Uint8Array)⇒ numberConverts value to a number. If value is a Uint8Array, it is treated as Big Endian data. Throws if the value is not safe. <src>toQuantity(value: BytesLike | BigNumberish)⇒ stringReturns a HexString for value safe to use as a Quantity.A Quantity does not have and leading 0 values unless the value is the literal value `0x0`. This is most commonly used for JSSON-RPC numeric values. <src>toTwos(value: BigNumberish, )⇒ bigintConvert value to a twos-compliment representation of width bits.The result will always be positive. PropertiesProperty helper functions.FUNCTIONS <src>defineProperties(target: T, (A4BRecord<@TODO-005: @TODO-006>), types?: TODO(A4BRecord<@TODO-005: @TODO-006>))⇒ voidAssigns the values to target as read-only values.It types is specified, the values are checked. <src>resolveProperties(value: TODO(A4BRecord<@TODO-005: @TODO-006>))⇒ Promise< T >Resolves to a new object that is a copy of value, but with all values resolved. Recursive-Length PrefixThe Recursive-Length Prefix (RLP) encoding is used throughout Ethereum to serialize nested structures of Arrays and data.TYPES <src>RlpStructuredData⇒ string | Array< RlpStructuredData >An RLP-encoded structure. <src>RlpStructuredDataish⇒ string | Uint8Array | Array< RlpStructuredDataish >An RLP-encoded structure, which allows Uint8Array.FUNCTIONS <src>decodeRlp(data: BytesLike)⇒ RlpStructuredDataDecodes data into the structured data it represents. <src>encodeRlp(object: RlpStructuredDataish)⇒ stringEncodes object as an RLP-encoded DataHexString. Strings and UTF-8Using strings in Ethereum (or any security-basd system) requires additional care. These utilities attempt to mitigate some of the safety issues as well as provide the ability to recover and analyse strings.CONSTANTS <src>Utf8ErrorFuncs⇒ Record< \"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc >A handful of popular, built-in UTF-8 error handling strategies.\"error\" - throws on ANY illegal UTF-8 sequence or non-canonical (overlong) codepoints (this is the default)\"ignore\" - silently drops any illegal UTF-8 sequence and accepts non-canonical (overlong) codepoints\"replace\" - replace any illegal UTF-8 sequence with the UTF-8 replacement character (i.e. \"\\ufffd\") and accepts non-canonical (overlong) codepointsTYPES <src>UnicodeNormalizationForm⇒ \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"The stanard normalization forms. <src>Utf8ErrorFunc⇒ (reason: Utf8ErrorReason, , , < number >, badCodepoint?: number) => numberA callback that can be used with toUtf8String to analysis or recovery from invalid UTF-8 data.Parsing UTF-8 data is done through a simple Finite-State Machine (FSM) which calls the Utf8ErrorFunc if a fault is detected.The reason indicates where in the FSM execution the fault occurred and the offset indicates where the input failed.The bytes represents the raw UTF-8 data that was provided and output is the current array of UTF-8 code-points, which may be updated by the Utf8ErrorFunc.The value of the badCodepoint depends on the reason. See Utf8ErrorReason for details.The function should return the number of bytes that should be skipped when control resumes to the FSM. <src>Utf8ErrorReason⇒ stringWhen using the UTF-8 error API the following errors can be intercepted and processed as the reason passed to the Utf8ErrorFunc.\"UNEXPECTED_CONTINUE\" - a continuation byte was present where there was nothing to continue.\"BAD_PREFIX\" - an invalid (non-continuation) byte to start a UTF-8 codepoint was found.\"OVERRUN\" - the string is too short to process the expected codepoint length.\"MISSING_CONTINUE\" - a missing continuation byte was expected but not found. The offset indicates the index the continuation byte was expected at.\"OUT_OF_RANGE\" - the computed code point is outside the range for UTF-8. The badCodepoint indicates the computed codepoint, which was outside the valid UTF-8 range.\"UTF16_SURROGATE\" - the UTF-8 strings contained a UTF-16 surrogate pair. The badCodepoint is the computed codepoint, which was inside the UTF-16 surrogate range.\"OVERLONG\" - the string is an overlong representation. The badCodepoint indicates the computed codepoint, which has already been bounds checked.FUNCTIONS <src>toUtf8Bytes(str: string, form?: UnicodeNormalizationForm)⇒ Uint8ArrayReturns the UTF-8 byte representation of str.If form is specified, the string is normalized. <src>toUtf8CodePoints(str: string, form?: UnicodeNormalizationForm)⇒ Array< number >Returns the UTF-8 code-points for str.If form is specified, the string is normalized. <src>toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc)⇒ stringReturns the string represented by the UTF-8 data bytes.When onError function is specified, it is called on UTF-8 errors allowing recovery using the Utf8ErrorFunc API. (default: error) Unit ConversionMost interactions with Ethereum requires integer values, which use the smallest magnitude unit.For example, imagine dealing with dollars and cents. Since dollars are divisible, non-integer values are possible, such as $10.77. By using the smallest indivisible unit (i.e. cents), the value can be kept as the integer 1077.When receiving decimal input from the user (as a decimal string), the value should be converted to an integer and when showing a user a value, the integer value should be converted to a decimal string.This creates a clear distinction, between values to be used by code (integers) and values used for display logic to users (decimals).The native unit in Ethereum, ether is divisible to 18 decimal places, where each individual unit is called a wei.FUNCTIONS <src>formatEther(wei: BigNumberish)⇒ stringConverts value into a decimal string using 18 decimal places. <src>formatUnits(value: BigNumberish, unit?: string | Numeric)⇒ stringConverts value into a decimal string, assuming unit decimal places. The unit may be the number of decimal places or the name of a unit (e.g. \"gwei\" for 9 decimal places). <src>parseEther(ether: string)⇒ bigintConverts the decimal string ether to a BigInt, using 18 decimal places. <src>parseUnits(value: string, unit?: string | Numeric)⇒ bigintConverts the decimal string value to a BigInt, assuming unit decimal places. The unit may the number of decimal places or the name of a unit (e.g. \"gwei\" for 9 decimal places). UUIDExplain UUID and link to RFC here.FUNCTIONS <src>uuidV4(randomBytes: BytesLike)⇒ stringReturns the version 4 UUID for the randomBytes.← TransactionsErrors→The content of this site is licensed under the Creative Commons License. Generated on September 8, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.112Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":3053}}16{"id":"doc-https_docs_ethers_org_v6_api_contract-4d7848a5","source":"documentation","title":"https://docs.ethers.org/v6/api/contract/","url":"https://docs.ethers.org/v6/api/contract/","text":"Documentation »API »Contracts ContractsA Contract object is a meta-class (a class whose definition is defined at runtime), which communicates with a deployed smart contract on the blockchain and provides a simple JavaScript interface to call methods, send transaction, query historic logs and listen for its events.TYPES <src>ContractEventName⇒ string | ContractEvent | TopicFilter | DeferredTopicFilterThe name for an event used for subscribing to Contract events.string - An event by name. The event must be non-ambiguous. The parameters will be dereferenced when passed into the listener.ContractEvent - A filter from the contract.filters, which will pass only the EventPayload as a single parameter, which includes a , runner?: null | ContractRunner)Create a new ContractFactory with abi and bytecode, optionally connected to runner.The bytecode may be the bytecode property within the standard Solidity JSON output.METHODS <src>contractFactory.attach(target: string | Addressable)⇒ BaseContract & Omit< I, keyof<BaseContract> > <src>contractFactory.connect(runner: null | ContractRunner)⇒ ContractFactory < A, I >Return a new ContractFactory with the same ABI and bytecode, but connected to runner. <src>contractFactory.deploy(args: ContractMethodArgs< A >)⇒ Promise< BaseContract & { } & Omit< I, keyof<BaseContract> > >Resolves to the Contract deployed by passing args into the constructor.This will resolve to the Contract before it has been deployed to the network, so the baseContract.waitForDeployment should be used before sending any transactions to it. <src>contractFactory.getDeployTransaction(args: ContractMethodArgs< A >)⇒ Promise< ContractDeployTransaction >Resolves to the transaction to deploy the contract, passing args into the constructor.STATIC METHODS <src>ContractFactory.fromSolidity(output: any, runner?: ContractRunner)⇒ ContractFactory < A, I >Create a new ContractFactory from the standard Solidity JSON output. interface ContractInterfaceA Contract with no method constraints. interface ContractMethodinherits from BaseContractMethodA contract method on a Contract. interface ContractTransactioninherits from PreparedTransactionRequestWhen populating a transaction this type is returned.PROPERTIES <src>contractTransaction.data⇒ stringThe transaction data. <src>contractTransaction.from⇒ stringThe from address, if any. <src>contractTransaction.to⇒ stringThe target address. class ContractTransactionReceiptinherits from TransactionReceipt, TransactionReceiptParamsA ContractTransactionReceipt includes the parsed logs from a TransactionReceipt.PROPERTIES <src>contractTransactionReceipt.logs⇒ Array< EventLog | Log >read-onlyThe parsed logs for any Log which has a matching event in the Contract ABI. class ContractTransactionResponseinherits from TransactionResponse, TransactionResponseParamsA ContractTransactionResponse will return a ContractTransactionReceipt when waited on.METHODS <src>contractTransactionResponse.wait(confirms?: number, timeout?: number)⇒ Promise< null | ContractTransactionReceipt >Resolves once this transaction has been mined and has confirms blocks including it (default: 1) with an optional timeout.This can resolve to null only if confirms is 0 and the transaction has not been mined, otherwise this will wait until enough confirmations have completed. class ContractUnknownEventPayloadinherits from EventPayloadA ContractUnknownEventPayload is included as the last parameter to Contract Events when the event does not match any events in the ABI.PROPERTIES <src>contractUnknownEventPayload.log⇒ Logread-onlyThe log with no matching events.CREATING INSTANCES <src>new ContractUnknownEventPayload(contract: BaseContract, | Listener, , )METHODS <src>contractUnknownEventPayload.getBlock()⇒ Promise< Block >Resolves to the block the event occured in. <src>contractUnknownEventPayload.getTransaction()⇒ Promise< TransactionResponse >Resolves to the transaction the event occured in. <src>contractUnknownEventPayload.getTransactionReceipt()⇒ Promise< TransactionReceipt >Resolves to the transaction receipt the event occured in. interface DeferredTopicFilterWhen creating a filter using the contract.filters, this is returned.PROPERTIES <src>deferredTopicFilter.fragment⇒ EventFragmentMETHODS <src>deferredTopicFilter.getTopicFilter()⇒ Promise< TopicFilter > class EventLoginherits from Log, LogParamsAn EventLog contains additional properties parsed from the Log.PROPERTIES <src>eventLog.args⇒ Resultread-onlyThe parsed arguments passed to the event by emit. <src>eventLog.eventName⇒ stringread-onlyThe name of the event. <src>eventLog.eventSignature⇒ stringread-onlyThe signature of the event. <src>eventLog.fragment⇒ EventFragmentread-onlyThe matching event. <src>eventLog.interface⇒ Interfaceread-onlyThe Contract Interface. interface OverridesThe overrides for a contract transaction. class UndecodedEventLoginherits from Log, LogParamsAn EventLog contains additional properties parsed from the Log.PROPERTIES <src>undecodedEventLog.error⇒ Errorread-onlyThe error encounted when trying to decode the log. interface WrappedFallbackA Fallback or Receive function on a Contract.METHODS <src>wrappedFallback.estimateGas(overrides?: Omit< TransactionRequest, \"to\" >)⇒ Promise< bigint >Estimate the gas to send a transaction to the contract fallback.For non-receive fallback, data may be overridden. <src>wrappedFallback.populateTransaction(overrides?: Omit< TransactionRequest, \"to\" >)⇒ Promise< ContractTransaction >Returns a populated transaction that can be used to perform the fallback method.For non-receive fallback, data may be overridden. <src>wrappedFallback.send(overrides?: Omit< TransactionRequest, \"to\" >)⇒ Promise< ContractTransactionResponse >Send a transaction to the contract fallback.For non-receive fallback, data may be overridden. <src>wrappedFallback.staticCall(overrides?: Omit< TransactionRequest, \"to\" >)⇒ Promise< string >Call the contract fallback and return the result.For non-receive fallback, data may be overridden.← ConstantsCryptographic Functions→The content of this site is licensed under the Creative Commons License. Generated on August 2, 2023,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.115Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":1539}}17{"id":"doc-https_docs_ethers_org_v6_api_wordlists-fa476f51","source":"documentation","title":"https://docs.ethers.org/v6/api/wordlists/","url":"https://docs.ethers.org/v6/api/wordlists/","text":"Documentation »API »Wordlists WordlistsA Wordlist is a set of 2048 words used to encode private keys (or other binary data) that is easier for humans to write down, transcribe and dictate.The BIP-39 standard includes several checksum bits, depending on the size of the mnemonic phrase.A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For most purposes 12 word mnemonics should be used, as including additional words increases the difficulty and potential for mistakes and does not offer any effective improvement on security.There are a variety of BIP-39 Wordlists for different languages, but for maximal compatibility, the English Wordlist is recommended.CONSTANTS <src>wordlists⇒ Record< string, Wordlist >The available Wordlists by their ISO 639-1 Language Code.(i.e. cz, en, es, fr, ja, ko, it, pt, zh_cn, zh_tw)The dist files (in the /dist folder) have had all languages except English stripped out, which reduces the library size by about 80kb. If required, they are available by importing the included wordlists-extra.min.js file. class LangCzinherits from WordlistOwl, WordlistThe Czech wordlist for mnemonic phrases.CREATING INSTANCES <src>LangCz.wordlist()⇒ LangCzReturns a singleton instance of a LangCz, creating it if this is the first time being called. class LangEninherits from WordlistOwl, WordlistThe English wordlist for mnemonic phrases.CREATING INSTANCES <src>LangEn.wordlist()⇒ LangEnReturns a singleton instance of a LangEn, creating it if this is the first time being called. class LangEsinherits from WordlistOwlA, WordlistOwlThe Spanish wordlist for mnemonic phrases.CREATING INSTANCES <src>LangEs.wordlist()⇒ LangEsReturns a singleton instance of a LangEs, creating it if this is the first time being called. class LangFrinherits from WordlistOwlA, WordlistOwlThe French wordlist for mnemonic phrases.CREATING INSTANCES <src>LangFr.wordlist()⇒ LangFrReturns a singleton instance of a LangFr, creating it if this is the first time being called. class LangItinherits from WordlistOwl, WordlistThe Italian wordlist for mnemonic phrases.CREATING INSTANCES <src>LangIt.wordlist()⇒ LangItReturns a singleton instance of a LangIt, creating it if this is the first time being called. class LangJainherits from WordlistThe Japanese wordlist for mnemonic phrases.CREATING INSTANCES <src>LangJa.wordlist()⇒ LangJaReturns a singleton instance of a LangJa, creating it if this is the first time being called. class LangKoinherits from WordlistThe Korean wordlist for mnemonic phrases.CREATING INSTANCES <src>LangKo.wordlist()⇒ LangKoReturns a singleton instance of a LangKo, creating it if this is the first time being called. class LangPtinherits from WordlistOwl, WordlistThe Portuguese wordlist for mnemonic phrases.CREATING INSTANCES <src>LangPt.wordlist()⇒ LangPtReturns a singleton instance of a LangPt, creating it if this is the first time being called. class LangZhinherits from WordlistThe Simplified Chinese wordlist and Tradional Chinese wordlist for mnemonic phrases.CREATING INSTANCES <src>LangZh.wordlist(dialect: string)⇒ LangZhReturns a singleton instance of a LangZh for dialect, creating it if this is the first time being called.Use the dialect \"cn\" or \"tw\" for simplified or traditional, respectively. abstract class WordlistA Wordlist represents a collection of language-specific words used to encode and devoce BIP-39 encoded data by mapping words to 11-bit values and vice versa.PROPERTIES <src>wordlist.locale⇒ stringCREATING INSTANCES <src>new Wordlist(locale: string)Creates a new Wordlist instance.Sub-classes MUST call this if they provide their own constructor, passing in the locale string of the language.Generally there is no need to create instances of a Wordlist, since each language-specific Wordlist creates an instance and there is no state kept internally, so they are safe to share.METHODS <src>wordlist.getWord(index: number)⇒ stringabstractMaps an 11-bit value into its coresponding word in the list.Sub-classes MUST override this. <src>wordlist.getWordIndex(word: string)⇒ numberabstractMaps a word to its corresponding 11-bit value.Sub-classes MUST override this. <src>wordlist.join(words: Array< string >)⇒ stringSub-classes may override this to provider a language-specific method for joining words into a phrase.By default, words are joined by a single space. <src>wordlist.split(phrase: string)⇒ Array< string >Sub-classes may override this to provide a language-specific method for spliting phrase into individual words.By default, phrase is split using any sequences of white-space as defined by regular expressions (i.e. /s+/). class WordlistOwlinherits from WordlistAn OWL format Wordlist is an encoding method that exploits the general locality of alphabetically sorted words to achieve a simple but effective means of compression.This class is generally not useful to most developers as it is used mainly internally to keep Wordlists for languages based on ASCII-7 small.If necessary, there are tools within the generation/ folder to create the necessary data.PROPERTIES <src>wordlistOwl._data⇒ stringread-onlyThe OWL-encoded data.CREATING INSTANCES <src>new WordlistOwl(locale: string, , )Creates a new Wordlist for locale using the OWL data and validated against the checksum.METHODS <src>wordlistOwl._decodeWords()⇒ Array< string >Decode all the words for the wordlist. class WordlistOwlAinherits from WordlistOwl, WordlistAn OWL-A format Wordlist extends the OWL format to add an overlay onto an OWL format Wordlist to support diacritic marks.This class is generally not useful to most developers as it is used mainly internally to keep Wordlists for languages based on latin-1 small.If necessary, there are tools within the generation/ folder to create the necessary data.PROPERTIES <src>wordlistOwlA._accent⇒ stringread-onlyThe OWLA-encoded accent data.CREATING INSTANCES <src>new WordlistOwlA(locale: string, , , )Creates a new Wordlist for locale using the OWLA data and accent data and validated against the checksum.METHODS <src>wordlistOwlA._decodeWords()⇒ Array< string >Decode all the words for the wordlist.← WalletsCookbook→The content of this site is licensed under the Creative Commons License. Generated on August 15, 2023,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.117Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":1559}}18{"id":"doc-https_docs_ethers_org_v6_api_transaction-6661c299","source":"documentation","title":"https://docs.ethers.org/v6/api/transaction/","url":"https://docs.ethers.org/v6/api/transaction/","text":"Documentation »API »Transactions TransactionsEach state-changing operation on Ethereum requires a transaction.TYPES <src>AccessList⇒ Array< AccessListEntry >An ordered collection of AccessList entries. <src>AccessListEntry⇒ { , < string > }A single AccessList entry of storage keys (slots) for an address. <src>AccessListish⇒ AccessList | Array< tuple< string, Array< string > > > | Record< string, Array< string > >Any ethers-supported access list structure. <src>AuthorizationLike⇒ { , , , } <src>BlobLike⇒ BytesLike | { , , }A BLOb object that can be passed for EIP-4844 transactions.It may have had its commitment and proof already provided or rely on an attached KzgLibrary to compute them. <src>KzgLibraryLike⇒ KzgLibrary | { blobToKZGCommitment: (blob: string) => string , computeBlobKZGProof: (blob: string, ) => string } | { blobToKzgCommitment: (blob: string) => string | Uint8Array , computeBlobProof: (blob: string, ) => string | Uint8Array }A KZG Library with any of the various API configurations. As the library is still experimental and the API is not stable, depending on the version used the method names and signatures are still in flux.This allows any of the versions to be passed into Transaction while providing a stable external API.FUNCTIONS <src>accessListify(value: AccessListish)⇒ AccessListReturns a AccessList from any ethers-supported access-list structure. <src>authorizationify(auth: AuthorizationLike)⇒ Authorization <src>computeAddress(key: string | SigningKey)⇒ stringReturns the address for the key.The key may be any standard form of public key or a private key. <src>recoverAddress(digest: BytesLike, )⇒ stringReturns the recovered address for the private key that was used to sign digest that resulted in signature. interface AuthorizationPROPERTIES <src>authorization.address⇒ string <src>authorization.chainId⇒ bigint <src>authorization.nonce⇒ bigint <src>authorization.signature⇒ Signature interface BlobA full-valid BLOb object for EIP-4844 transactions.The commitment and proof should have been computed using a KZG library.PROPERTIES <src>blob.commitment⇒ stringThe BLOb commitment. <src>blob.data⇒ stringThe blob data. <src>blob.proof⇒ stringA EIP-4844 BLOb uses a string proof, while EIP-7594 use an array of strings representing the cells of the proof. interface KzgLibraryA KZG Library with the necessary functions to compute BLOb commitments and proofs.PROPERTIES <src>kzgLibrary.blobToKzgCommitment⇒ (blob: Uint8Array) => Uint8Array <src>kzgLibrary.computeBlobKzgProof⇒ (blob: Uint8Array, ) => Uint8Array class TransactionA Transaction describes an operation to be executed on Ethereum by an Externally Owned Account (EOA). It includes who (the to address), what (the data) and how much (the value in ether) the operation should entail.tx = new Transaction() // Transaction { , data: \"0x1234\", , , , } tx.data = \"0x1234\"; // '0x1234' PROPERTIES <src>transaction.accessList⇒ null | AccessListThe access list.An access list permits discounted (but pre-paid) access to bytecode and state variable access within contract execution. <src>transaction.authorizationList⇒ null | Array< Authorization > <src>transaction.blobs⇒ null | Array< Blob >The BLObs for the Transaction, if any.If blobs is non-null, then the seriailized will return the network formatted sidecar, otherwise it will return the standard EIP-2718 payload. The unsignedSerialized is unaffected regardless.When setting blobs, either fully valid Blob objects may be specified (i.e. correctly padded, with correct committments and proofs) or a raw BytesLike may be provided.If raw BytesLike are provided, the kzg property must be already set. The blob will be correctly padded and the KzgLibrary will be used to compute the committment and proof for the blob.A BLOb is a sequence of field elements, each of which must be within the BLS field modulo, so some additional processing may be required to encode arbitrary data to ensure each 32 byte field is within the valid range.Setting this automatically populates blobVersionedHashes, overwriting any existing values. Setting this to null does not remove the blobVersionedHashes, leaving them present. <src>transaction.blobVersionedHashes⇒ null | Array< string >The BLOb versioned hashes for Cancun transactions. <src>transaction.blobWrapperVersion⇒ null | number <src>transaction.chainId⇒ bigintThe chain ID this transaction is valid on. <src>transaction.data⇒ stringThe transaction data. For init transactions this is the deployment code. <src>transaction.from⇒ null | stringread-onlyThe sending address, if signed. Otherwise, null. <src>transaction.fromPublicKey⇒ null | stringread-onlyThe public key of the sender, if signed. Otherwise, null. <src>transaction.gasLimit⇒ bigintThe gas limit. <src>transaction.gasPrice⇒ null | bigintThe gas price.On legacy networks this defines the fee that will be paid. On EIP-1559 networks, this should be null. <src>transaction.hash⇒ null | stringread-onlyThe transaction hash, if signed. Otherwise, null. <src>transaction.kzg⇒ null | KzgLibrary <src>transaction.maxFeePerBlobGas⇒ null | bigintThe max fee per blob gas for Cancun transactions. <src>transaction.maxFeePerGas⇒ null | bigintThe maximum total fee per unit of gas to pay. On legacy networks this should be null. <src>transaction.maxPriorityFeePerGas⇒ null | bigintThe maximum priority fee per unit of gas to pay. On legacy networks this should be null. <src>transaction.nonce⇒ numberThe transaction nonce. <src>transaction.serialized⇒ stringread-onlyThe serialized transaction.This throws if the transaction is unsigned. For the pre-image, use unsignedSerialized. <src>transaction.signature⇒ null | SignatureIf signed, the signature for this transaction. <src>transaction.to⇒ null | stringThe to address for the transaction or null if the transaction is an init transaction. <src>transaction.type⇒ null | numberThe transaction type.If null, the type will be automatically inferred based on explicit properties. <src>transaction.typeName⇒ null | stringread-onlyThe name of the transaction type. <src>transaction.unsignedHash⇒ stringread-onlyThe pre-image hash of this transaction.This is the digest that a Signer must sign to authorize this transaction. <src>transaction.unsignedSerialized⇒ stringread-onlyThe transaction pre-image.The hash of this is the digest which needs to be signed to authorize this transaction. <src>transaction.value⇒ bigintThe amount of ether (in wei) to send in this transactions.CREATING INSTANCES <src>new Transaction()Creates a new Transaction with default values. <src>Transaction.from(tx?: string | TransactionLike < string >)⇒ TransactionCreate a Transaction from a serialized transaction or a Transaction-like object.METHODS <src>transaction.clone()⇒ TransactionCreate a copy of this transaciton. <src>transaction.inferType()⇒ numberReturn the most \"likely\" type; currently the highest supported transaction type. <src>transaction.inferTypes()⇒ Array< number >Validates the explicit properties and returns a list of compatible transaction types. <src>transaction.inspect()⇒ string <src>transaction.isBerlin()⇒ booleanReturns true if this transaction is berlin hardform transaction (i.e. type === 1).This provides a Type Guard that the related properties are non-null. <src>transaction.isCancun()⇒ booleanReturns true if this transaction is an EIP-4844 BLOB transaction.This provides a Type Guard that the related properties are non-null. <src>transaction.isLegacy()⇒ booleanReturns true if this transaction is a legacy transaction (i.e. type === 0).This provides a Type Guard that the related properties are non-null. <src>transaction.isLondon()⇒ booleanReturns true if this transaction is london hardform transaction (i.e. type === 2).This provides a Type Guard that the related properties are non-null. <src>transaction.isSigned()⇒ booleanReturns true if signed.This provides a Type Guard that properties requiring a signed transaction are non-null. <src>transaction.isValid()⇒ boolean <src>transaction.toJSON()⇒ anyReturn a JSON-friendly object. <src>transaction.toString()⇒ string interface TransactionLikeA TransactionLike is an object which is appropriate as a loose input for many operations which will populate missing properties of a transaction.PROPERTIES <src>transactionLike.accessList⇒ null | AccessListishThe access list for berlin and london transactions. <src>transactionLike.authorizationList⇒ null | Array< Authorization >The EIP-7702 authorizations (if any). <src>transactionLike.blobs⇒ null | Array< BlobLike >The blobs (if any) attached to this transaction (see EIP-4844). <src>transactionLike.blobVersionedHashes⇒ null | Array< string >The versioned hashes (see EIP-4844). <src>transactionLike.blobWrapperVersion⇒ null | numberThe EIP-7594 BLOb Wrapper Version used for PeerDAS.For networks that use EIP-7594, this property is required to serialize the sidecar correctly. <src>transactionLike.chainId⇒ null | BigNumberishThe chain ID the transaction is valid on. <src>transactionLike.data⇒ null | stringThe data. <src>transactionLike.from⇒ null | AThe sender. <src>transactionLike.gasLimit⇒ null | BigNumberishThe maximum amount of gas that can be used. <src>transactionLike.gasPrice⇒ null | BigNumberishThe gas price for legacy and berlin transactions. <src>transactionLike.hash⇒ null | stringThe transaction hash. <src>transactionLike.kzg⇒ null | KzgLibraryLikeAn external library for computing the KZG commitments and proofs necessary for EIP-4844 transactions (see EIP-4844).This is generally null, unless you are creating BLOb transactions. <src>transactionLike.maxFeePerBlobGas⇒ null | BigNumberishThe maximum fee per blob gas (see EIP-4844). <src>transactionLike.maxFeePerGas⇒ null | BigNumberishThe maximum total fee per gas for london transactions. <src>transactionLike.maxPriorityFeePerGas⇒ null | BigNumberishThe maximum priority fee per gas for london transactions. <src>transactionLike.nonce⇒ null | numberThe nonce. <src>transactionLike.signature⇒ null | SignatureLikeThe signature provided by the sender. <src>transactionLike.to⇒ null | AThe recipient address or null for an init transaction. <src>transactionLike.type⇒ null | numberThe type. <src>transactionLike.value⇒ null | BigNumberishThe value (in wei) to send.← Community ProvidersUtilities→The content of this site is licensed under the Creative Commons License. Generated on March 10, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.119Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":2599}}19{"id":"doc-https_docs_ethers_org_v6_api_providers_fallback_-bfc7c86d","source":"documentation","title":"https://docs.ethers.org/v6/api/providers/fallback-provider/","url":"https://docs.ethers.org/v6/api/providers/fallback-provider/","text":"Documentation »API »Providers »Fallback Provider Fallback ProviderA FallbackProvider provides resilience, security and performance in a way that is customizable and configurable.TYPES <src>FallbackProviderOptions⇒ { cacheTimeout?: number , eventQuorum?: number , eventWorkers?: number , pollingInterval?: number , quorum?: number }Additional options to configure a FallbackProvider. class FallbackProviderinherits from AbstractProvider, ProviderA FallbackProvider manages several Providers providing resilience by switching between slow or misbehaving nodes, security by requiring multiple backends to aggree and performance by allowing faster backends to respond earlier.PROPERTIES <src>fallbackProvider.providerConfigs⇒ Array< FallbackProviderState >read-only <src>fallbackProvider.quorum⇒ numberread-onlyThe number of backends that must agree on a value before it is accpeted.CREATING INSTANCES <src>new FallbackProvider(providers: Array< AbstractProvider | FallbackProviderConfig >, network?: Networkish, options?: FallbackProviderOptions)Creates a new FallbackProvider with providers connected to network.If a Provider is included in providers, defaults are used for the configuration.METHODS <src>fallbackProvider._translatePerform(provider: AbstractProvider, )⇒ Promise< any >Transforms a req into the correct method call on provider. interface FallbackProviderConfigA configuration entry for how to use a Provider.PROPERTIES <src>fallbackProviderConfig.priority⇒ numberThe priority. Lower priority providers are dispatched first. <src>fallbackProviderConfig.provider⇒ AbstractProviderThe provider. <src>fallbackProviderConfig.stallTimeout⇒ numberThe amount of time to wait before kicking off the next provider.Any providers that have not responded can still respond and be counted, but this ensures new providers start. <src>fallbackProviderConfig.weight⇒ numberThe amount of weight a provider is given against the quorum. interface FallbackProviderStateThe statistics and state maintained for a Provider.PROPERTIES <src>fallbackProviderState.blockNumber⇒ numberThe most recent blockNumber this provider has reported (-2 if none). <src>fallbackProviderState.errorResponses⇒ numberThe number of responses that errored. <src>fallbackProviderState.lateResponses⇒ numberThe number of responses that occured after the result resolved. <src>fallbackProviderState.outOfSync⇒ numberHow many times syncing was required to catch up the expected block. <src>fallbackProviderState.requests⇒ numberThe number of total requests ever sent to this provider. <src>fallbackProviderState.rollingDuration⇒ numberA rolling average (5% current duration) for response time. <src>fallbackProviderState.score⇒ numberThe ratio of quorum-agreed results to total. <src>fallbackProviderState.unsupportedEvents⇒ numberThe number of requests which reported unsupported operation.← ENS ResolverFormatting→The content of this site is licensed under the Creative Commons License. Generated on April 26, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.123Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":749}}20{"id":"doc-https_docs_ethers_org_v6_api_providers_abstract_-f482c048","source":"documentation","title":"https://docs.ethers.org/v6/api/providers/abstract-provider/","url":"https://docs.ethers.org/v6/api/providers/abstract-provider/","text":"Documentation »API »Providers »Subclassing Provider Subclassing ProviderThe available providers should suffice for most developers purposes, but the AbstractProvider class has many features which enable sub-classing it for specific purposes.TYPES <src>AbstractProviderOptions⇒ { cacheTimeout?: number , pollingInterval?: number }Options for configuring some internal aspects of an AbstractProvider.cacheTimeout - how long to cache a low-level _perform for, based on input parameters. This reduces the number of calls to getChainId and getBlockNumber, but may break test chains which can perform operations (internally) synchronously. Use -1 to disable, 0 will only buffer within the same event loop and any other value is in ms. (default: 250) <src>DebugEventAbstractProvider⇒ { action: \"sendCcipReadFetchRequest\" , , , < string > } | { action: \"receiveCcipReadFetchResult\" , , } | { action: \"receiveCcipReadFetchError\" , , } | { action: \"sendCcipReadCall\" , transaction: { , } } | { action: \"receiveCcipReadCallResult\" , , transaction: { , } } | { action: \"receiveCcipReadCallError\" , , transaction: { , } }The types of additional event values that can be emitted for the \"debug\" event. <src>PerformActionFilter⇒ { address?: string | Array< string > , fromBlock?: BlockTag , toBlock?: BlockTag , topics?: Array< null | string | Array< string > > } | { address?: string | Array< string > , blockHash?: string , topics?: Array< null | string | Array< string > > }A normalized filter used for PerformActionRequest objects. <src>PerformActionRequest⇒ { method: \"broadcastTransaction\" , } | { , method: \"call\" , } | { method: \"chainId\" } | { method: \"estimateGas\" , } | { , , method: \"getBalance\" } | { , , method: \"getBlock\" } | { , , method: \"getBlock\" } | { method: \"getBlockNumber\" } | { , , method: \"getCode\" } | { method: \"getGasPrice\" } | { , method: \"getLogs\" } | { method: \"getPriorityFee\" } | { , , method: \"getStorage\" , } | { , method: \"getTransaction\" } | { , , method: \"getTransactionCount\" } | { , method: \"getTransactionReceipt\" } | { , method: \"getTransactionResult\" }The AbstractProvider methods will normalize all values and pass this type to abstractProvider._perform. <src>Subscription⇒ { , type: \"block\" | \"close\" | \"debug\" | \"error\" | \"finalized\" | \"network\" | \"pending\" | \"safe\" } | { , , type: \"transaction\" } | { , , type: \"event\" } | { , , type: \"orphan\" }The value passed to the abstractProvider._getSubscriber method.Only developers sub-classing [[AbstractProvider[[ will care about this, if they are modifying a low-level feature of how subscriptions operate.FUNCTIONS <src>getPollingSubscriber(provider: AbstractProvider, )⇒ SubscriberReturn the polling subscriber for common events. class AbstractProviderinherits from Provider, ContractRunner, EventEmitterable, NameResolverAn AbstractProvider provides a base class for other sub-classes to implement the Provider API by normalizing input arguments and formatting output results as well as tracking events for consistent behaviour on an eventually-consistent network.PROPERTIES <src>abstractProvider._requestRate⇒ null | numberLimit the number of requests per second. (default: no limit) <src>abstractProvider.destroyed⇒ booleanread-onlyIf this provider has been destroyed using the destroy method.Once destroyed, all resources are reclaimed, internal event loops and timers are cleaned up and no further requests may be sent to the provider. <src>abstractProvider.disableCcipRead⇒ booleanPrevent any CCIP-read operation, regardless of whether requested in a call using enableCcipRead. <src>abstractProvider.paused⇒ booleanWhether the provider is currently paused.A paused provider will not emit any events, and generally should not make any requests to the network, but that is up to sub-classes to manage.Setting paused = true is identical to calling .pause(false), which will buffer any events that occur while paused until the provider is unpaused. <src>abstractProvider.plugins⇒ Array< AbstractProviderPlugin >read-onlyReturns all the registered plug-ins. <src>abstractProvider.pollingInterval⇒ numberread-only <src>abstractProvider.provider⇒ thisread-onlyReturns this, to allow an AbstractProvider to implement the ContractRunner interface.CREATING INSTANCES <src>new AbstractProvider(network?: \"any\" | Networkish, options?: AbstractProviderOptions)Create a new AbstractProvider connected to network, or use the various network detection capabilities to discover the Network if necessary.METHODS <src>abstractProvider._clearTimeout(timerId: number)⇒ voidClear a timer created using the _setTimeout method. <src>abstractProvider._detectNetwork()⇒ Promise< Network >Resolves to the Network, forcing a network detection using whatever technique the sub-class requires.Sub-classes must override this. <src>abstractProvider._forEachSubscriber(func: (s: Subscriber) => void)⇒ voidPerform func on each subscriber. <src>abstractProvider._getAddress(address: AddressLike)⇒ string | Promise< string >Returns or resolves to the address for address, resolving ENS names and Addressable objects and returning if already an address. <src>abstractProvider._getBlockTag(blockTag?: BlockTag)⇒ string | Promise< string >Returns or resolves to a valid block tag for blockTag, resolving negative values and returning if already a valid block tag. <src>abstractProvider._getFilter(filter: Filter | FilterByBlockHash)⇒ PerformActionFilter | Promise< PerformActionFilter >Returns or resolves to a filter for filter, resolving any ENS names or Addressable object and returning if already a valid filter. <src>abstractProvider._getProvider(chainId: number)⇒ AbstractProvider <src>abstractProvider._getSubscriber(sub: Subscription)⇒ SubscriberSub-classes may override this to customize subscription implementations. <src>abstractProvider._getTransactionRequest(request: TransactionRequest)⇒ PerformActionTransaction | Promise< PerformActionTransaction >Returns or resolves to a transaction for request, resolving any ENS names or Addressable and returning if already a valid transaction. <src>abstractProvider._perform(req: PerformActionRequest)⇒ Promise< T >Sub-classes should use this to perform all built-in operations. All methods sanitizes and normalizes the values passed into this.Sub-classes must override this. <src>abstractProvider._recoverSubscriber(oldSub: Subscriber, )⇒ voidIf a Subscriber fails and needs to replace itself, this method may be used.For example, this is used for providers when using the eth_getFilterChanges method, which can return null if state filters are not supported by the backend, allowing the Subscriber to swap in a PollingEventSubscriber. <src>abstractProvider._setTimeout(func: () => void, timeout?: number)⇒ numberCreate a timer that will execute func after at least timeout (in ms). If timeout is unspecified, then func will execute in the next event loop.Pausing the provider will pause any associated timers. <src>abstractProvider._wrapBlock(value: BlockParams, )⇒ BlockProvides the opportunity for a sub-class to wrap a block before returning it, to add additional properties or an alternate sub-class of Block. <src>abstractProvider._wrapLog(value: LogParams, )⇒ LogProvides the opportunity for a sub-class to wrap a log before returning it, to add additional properties or an alternate sub-class of Log. <src>abstractProvider._wrapTransactionReceipt(value: TransactionReceiptParams, )⇒ TransactionReceiptProvides the opportunity for a sub-class to wrap a transaction receipt before returning it, to add additional properties or an alternate sub-class of TransactionReceipt. <src>abstractProvider._wrapTransactionResponse(tx: TransactionResponseParams, )⇒ TransactionResponseProvides the opportunity for a sub-class to wrap a transaction response before returning it, to add additional properties or an alternate sub-class of TransactionResponse. <src>abstractProvider.attachPlugin(plugin: AbstractProviderPlugin)⇒ thisAttach a new plug-in. <src>abstractProvider.ccipReadFetch(tx: PerformActionTransaction, , < string >)⇒ Promise< null | string >Resolves to the data for executing the CCIP-read operations. <src>abstractProvider.destroy()⇒ voidSub-classes may use this to shutdown any sockets or release their resources and reject any pending requests.Sub-classes must call super.destroy(). <src>abstractProvider.getAvatar(name: string)⇒ Promise< null | string > <src>abstractProvider.getPlugin(name: string)⇒ null | TGet a plugin by name. <src>abstractProvider.getResolver(name: string)⇒ Promise< null | EnsResolver > <src>abstractProvider.pause(dropWhilePaused?: boolean)⇒ voidPause the provider. If dropWhilePaused, any events that occur while paused are dropped, otherwise all events will be emitted once the provider is unpaused. <src>abstractProvider.resume()⇒ voidResume the provider. interface AbstractProviderPluginAn AbstractPlugin is used to provide additional internal services to an AbstractProvider without adding backwards-incompatible changes to method signatures or other internal and complex logic.PROPERTIES <src>abstractProviderPlugin.name⇒ stringread-onlyThe reverse domain notation of the plugin.METHODS <src>abstractProviderPlugin.connect(provider: AbstractProvider)⇒ AbstractProviderPluginCreates a new instance of the plugin, connected to provider. class FilterIdEventSubscriberinherits from FilterIdSubscriber, SubscriberA FilterIdSubscriber for receiving contract events.CREATING INSTANCES <src>new FilterIdEventSubscriber(provider: JsonRpcApiProvider, )Creates a new FilterIdEventSubscriber attached to provider listening for filter. class FilterIdPendingSubscriberinherits from FilterIdSubscriber, SubscriberA FilterIdSubscriber for receiving pending transactions events. class FilterIdSubscriberinherits from SubscriberSome backends support subscribing to events using a Filter ID.When subscribing with this technique, the node issues a unique Filter ID. At this point the node dedicates resources to the filter, so that periodic calls to follow up on the Filter ID will receive any events since the last call.CREATING INSTANCES <src>new FilterIdSubscriber(provider: JsonRpcApiProvider)Creates a new FilterIdSubscriber which will used _subscribe and _emitResults to setup the subscription and provide the event to the provider.METHODS <src>filterIdSubscriber._emitResults(provider: AbstractProvider, < any >)⇒ Promise< void >Sub-classes must override this handle the events. <src>filterIdSubscriber._recover(provider: AbstractProvider)⇒ SubscriberSub-classes must override this handle recovery on errors. <src>filterIdSubscriber._subscribe(provider: JsonRpcApiProvider)⇒ Promise< string >Sub-classes must override this to begin the subscription. class OnBlockSubscriberinherits from SubscriberAn OnBlockSubscriber can be sub-classed, with a _poll implmentation which will be called on every new block.CREATING INSTANCES <src>new OnBlockSubscriber(provider: AbstractProvider)Create a new OnBlockSubscriber attached to provider.METHODS <src>onBlockSubscriber._poll(blockNumber: number, )⇒ Promise< void >Called on every new block. interface PerformActionTransactioninherits from PreparedTransactionRequestA normalized transactions used for PerformActionRequest objects.PROPERTIES <src>performActionTransaction.from⇒ stringThe sender of the transaction. <src>performActionTransaction.to⇒ stringThe to address of the transaction. class PollingBlockSubscriberinherits from SubscriberA PollingBlockSubscriber polls at a regular interval for a change in the block number.PROPERTIES <src>pollingBlockSubscriber.pollingInterval⇒ numberThe polling interval.CREATING INSTANCES <src>new PollingBlockSubscriber(provider: AbstractProvider)Create a new PollingBlockSubscriber attached to provider. class PollingEventSubscriberinherits from SubscriberA PollingEventSubscriber will poll for a given filter for its logs.CREATING INSTANCES <src>new PollingEventSubscriber(provider: AbstractProvider, )Create a new PollingTransactionSubscriber attached to provider, listening for filter. class PollingTransactionSubscriberinherits from OnBlockSubscriber, SubscriberA PollingTransactionSubscriber will poll for a given transaction hash for its receipt.CREATING INSTANCES <src>new PollingTransactionSubscriber(provider: AbstractProvider, )Create a new PollingTransactionSubscriber attached to provider, listening for hash. interface SubscriberA Subscriber manages a subscription.Only developers sub-classing [[AbstractProvider[[ will care about this, if they are modifying a low-level feature of how subscriptions operate.PROPERTIES <src>subscriber.pollingInterval⇒ numberThe frequency (in ms) to poll for events, if polling is used by the subscriber.For non-polling subscribers, this must return undefined.METHODS <src>subscriber.pause(dropWhilePaused?: boolean)⇒ voidCalled when the subscription should pause.If dropWhilePaused, events that occur while paused should not be emitted resume. <src>subscriber.resume()⇒ voidResume a paused subscriber. <src>subscriber.start()⇒ voidCalled initially when a subscriber is added the first time. <src>subscriber.stop()⇒ voidCalled when there are no more subscribers to the event. class UnmanagedSubscriberinherits from SubscriberAn UnmanagedSubscriber is useful for events which do not require any additional management, such as \"debug\" which only requires emit in synchronous event loop triggered calls.PROPERTIES <src>unmanagedSubscriber.name⇒ stringThe name fof the event.CREATING INSTANCES <src>new UnmanagedSubscriber(name: string)Create a new UnmanagedSubscriber with name. Socket ProvidersGeneric long-lived socket provider.Sub-classing notesa sub-class MUST call the `_start()` method once connected a sub-class MUST override the `_write(string)` method a sub-class MUST call `_processMessage(string)` for each message class SocketBlockSubscriberinherits from SocketSubscriber, SubscriberA SocketBlockSubscriber listens for newHeads events and emits \"block\" events. class SocketEventSubscriberinherits from SocketSubscriber, SubscriberA SocketEventSubscriber listens for event logs.PROPERTIES <src>socketEventSubscriber.logFilter⇒ EventFilterread-onlyThe filter. class SocketPendingSubscriberinherits from SocketSubscriber, SubscriberA SocketPendingSubscriber listens for pending transacitons and emits \"pending\" events. class SocketProviderinherits from JsonRpcApiProvider, AbstractProviderA SocketProvider is backed by a long-lived connection over a socket, which can subscribe and receive real-time messages over its communication channel.CREATING INSTANCES <src>new SocketProvider(network?: Networkish, options?: JsonRpcApiProviderOptions)Creates a new SocketProvider connected to network.If unspecified, the network will be discovered.METHODS <src>socketProvider._processMessage(message: string)⇒ Promise< void >Sub-classes must call this with messages received over their transport to be processed and dispatched. <src>socketProvider._register(filterId: number | string, )⇒ voidRegister a new subscriber. This is used internalled by Subscribers and generally is unecessary unless extending capabilities. <src>socketProvider._write(message: string)⇒ Promise< void >Sub-classes must override this to send message over their transport. class SocketSubscriberinherits from SubscriberA SocketSubscriber uses a socket transport to handle events and should use _emit to manage the events.PROPERTIES <src>socketSubscriber.filter⇒ Array< any >read-onlyThe filter.CREATING INSTANCES <src>new SocketSubscriber(provider: SocketProvider, < any >)Creates a new SocketSubscriber attached to provider listening to filter.METHODS <src>socketSubscriber._emit(provider: SocketProvider, )⇒ Promise< void >Sub-classes must override this to emit the events on the provider.← ProvidersSubclassing Signer→The content of this site is licensed under the Creative Commons License. Generated on June 18, 2026,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.125Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":3967}}21{"id":"doc-https_docs_ethers_org_v6_api_providers_ens_resol-e16bcfc6","source":"documentation","title":"https://docs.ethers.org/v6/api/providers/ens-resolver/","url":"https://docs.ethers.org/v6/api/providers/ens-resolver/","text":"Documentation »API »Providers »ENS Resolver ENS ResolverENS is a service which allows easy-to-remember names to map to network addresses.TYPES <src>AvatarLinkageType⇒ \"name\" | \"avatar\" | \"!avatar\" | \"url\" | \"data\" | \"ipfs\" | \"erc721\" | \"erc1155\" | \"!erc721-caip\" | \"!erc1155-caip\" | \"!owner\" | \"owner\" | \"!balance\" | \"balance\" | \"metadata-url-base\" | \"metadata-url-expanded\" | \"metadata-url\" | \"!metadata-url\" | \"!metadata\" | \"metadata\" | \"!imageUrl\" | \"imageUrl-ipfs\" | \"imageUrl\" | \"!imageUrl-ipfs\"The type of data found during a steip during avatar resolution. interface AvatarLinkageAn individual record for each step during avatar resolution.PROPERTIES <src>avatarLinkage.type⇒ AvatarLinkageTypeThe type of linkage. <src>avatarLinkage.value⇒ stringThe linkage value. interface AvatarResultWhen resolving an avatar for an ENS name, there are many steps involved, fetching metadata, validating results, et cetera.Some applications may wish to analyse this data, or use this data to diagnose promblems, so an AvatarResult provides details of each completed step during avatar resolution.PROPERTIES <src>avatarResult.linkage⇒ Array< AvatarLinkage >How the url was arrived at, resolving the many steps required for an avatar URL. <src>avatarResult.url⇒ null | stringThe avatar URL or null if the avatar was not set, or there was an issue during validation (such as the address not owning the avatar or a metadata error). class BasicMulticoinProviderPlugininherits from MulticoinProviderPlugin, AbstractProviderPluginA BasicMulticoinProviderPlugin provides service for common coin types, which do not require additional libraries to encode or decode.CREATING INSTANCES <src>new BasicMulticoinProviderPlugin()Creates a new BasicMulticoinProviderPlugin. class EnsResolverA connected object to a resolved ENS name resolver, which can be used to query additional details.PROPERTIES <src>ensResolver.address⇒ stringThe address of the resolver. <src>ensResolver.name⇒ stringThe name this resolver was resolved against. <src>ensResolver.provider⇒ AbstractProviderThe connected provider.CREATING INSTANCES <src>new EnsResolver(provider: AbstractProvider, , , supportsWildcard?: boolean)METHODS <src>ensResolver._getAvatar()⇒ Promise< AvatarResult >When resolving an avatar, there are many steps involved, such fetching metadata and possibly validating ownership of an NFT.This method can be used to examine each step and the value it was working from. <src>ensResolver.getAddress(coinType?: BigNumberish)⇒ Promise< null | string >Resolves to the address for coinType or null if the provided coinType has not been configured. <src>ensResolver.getAvatar()⇒ Promise< null | string >Resolves to the avatar url or null if the avatar is either unconfigured or incorrectly configured (e.g. references an NFT not owned by the address).If diagnosing issues with configurations, the _getAvatar method may be useful. <src>ensResolver.getContentHash()⇒ Promise< null | string >Rsolves to the content-hash or null if unconfigured. <src>ensResolver.getName()⇒ Promise< null | string > <src>ensResolver.getText(key: string)⇒ Promise< null | string >Resolves to the EIP-634 text record for key, or null if unconfigured. <src>ensResolver.supportsWildcard()⇒ Promise< boolean >Resolves to true if the resolver supports wildcard resolution.STATIC METHODS <src>EnsResolver.fromName(provider: AbstractProvider, )⇒ Promise< null | EnsResolver >Resolve to the ENS resolver for name using provider or null if unconfigured. <src>EnsResolver.getEnsAddress(provider: Provider)⇒ Promise< string > <src>EnsResolver.getUniversalResolverAddress(provider: Provider)⇒ Promise< null | string > <src>EnsResolver.lookupAddress(provider: AbstractProvider, , coinType?: BigNumberish)⇒ Promise< null | string > abstract class MulticoinProviderPlugininherits from AbstractProviderPluginA provider plugin super-class for processing multicoin address types.PROPERTIES <src>multicoinProviderPlugin.name⇒ stringread-onlyThe name.CREATING INSTANCES <src>new MulticoinProviderPlugin(name: string)Creates a new MulticoinProviderPluing for name.METHODS <src>multicoinProviderPlugin.decodeAddress(coinType: number, )⇒ Promise< string >Resolves to the decoded data for coinType. <src>multicoinProviderPlugin.encodeAddress(coinType: number, )⇒ Promise< string >Resolves to the encoded address for coinType. <src>multicoinProviderPlugin.supportsCoinType(coinType: number)⇒ booleanReturns true if coinType is supported by this plugin.← Subclassing SignerFallback Provider→The content of this site is licensed under the Creative Commons License. Generated on June 15, 2026,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.136Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":1156}}22{"id":"doc-https_docs_ethers_org_v6_api_wallet-f49fc8df","source":"documentation","title":"https://docs.ethers.org/v6/api/wallet/","url":"https://docs.ethers.org/v6/api/wallet/","text":"Documentation »API »Wallets WalletsWhen interacting with Ethereum, it is necessary to use a private key authenticate actions by signing a payload.Wallets are the simplest way to expose the concept of an Externally Owner Account (EOA) as it wraps a private key and supports high-level methods to sign common types of interaction and send transactions.The class most developers will want to use is Wallet, which can load a private key directly or from any common wallet format.The HDNodeWallet can be used when it is necessary to access low-level details of how an HD wallets are derived, exported or imported. class BaseWalletinherits from AbstractSigner, SignerThe BaseWallet is a stream-lined implementation of a Signer that operates with a private key.It is preferred to use the Wallet class, as it offers additional functionality and simplifies loading a variety of JSON formats, Mnemonic Phrases, etc.This class may be of use for those attempting to implement a minimal Signer.PROPERTIES <src>baseWallet.address⇒ stringread-onlyThe wallet address. <src>baseWallet.privateKey⇒ stringread-onlyThe private key for this wallet. <src>baseWallet.signingKey⇒ SigningKeyread-onlyThe SigningKey used for signing payloads.CREATING INSTANCES <src>new BaseWallet(privateKey: SigningKey, provider?: null | Provider)Creates a new BaseWallet for privateKey, optionally connected to provider.If provider is not specified, only offline methods can be used.METHODS <src>baseWallet.authorize(auth: AuthorizationRequest)⇒ Promise< Authorization >Resolves to the Authorization for auth. <src>baseWallet.authorizeSync(auth: AuthorizationRequest)⇒ AuthorizationReturns the Authorization for auth. <src>baseWallet.signMessageSync(message: string | Uint8Array)⇒ stringReturns the signature for message signed with this wallet. class MnemonicA Mnemonic wraps all properties required to compute BIP-39 seeds and convert between phrases and entropy.PROPERTIES <src>mnemonic.entropy⇒ stringread-onlyThe underlying entropy which the mnemonic encodes. <src>mnemonic.password⇒ stringread-onlyThe password used for this mnemonic. If no password is used this is the empty string (i.e. \"\") as per the specification. <src>mnemonic.phrase⇒ stringread-onlyThe mnemonic phrase of 12, 15, 18, 21 or 24 words.Use the wordlist split method to get the individual words. <src>mnemonic.wordlist⇒ Wordlistread-onlyThe wordlist for this mnemonic.CREATING INSTANCES <src>Mnemonic.fromEntropy(entropy: BytesLike, password?: null | string, wordlist?: null | Wordlist)⇒ MnemonicCreate a new Mnemonic from the entropy.The default password is the empty string and the default wordlist is the English wordlists. <src>Mnemonic.fromPhrase(phrase: string, password?: null | string, wordlist?: null | Wordlist)⇒ MnemonicCreates a new Mnemonic for the phrase.The default password is the empty string and the default wordlist is the English wordlists.METHODS <src>mnemonic.computeSeed()⇒ stringReturns the seed for the mnemonic.STATIC METHODS <src>Mnemonic.entropyToPhrase(entropy: BytesLike, wordlist?: null | Wordlist)⇒ stringReturns the phrase for mnemonic. <src>Mnemonic.isValidMnemonic(phrase: string, wordlist?: null | Wordlist)⇒ booleanReturns true if phrase is a valid BIP-39 phrase.This checks all the provided words belong to the wordlist, that the length is valid and the checksum is correct. <src>Mnemonic.phraseToEntropy(phrase: string, wordlist?: null | Wordlist)⇒ stringReturns the entropy for phrase. class Walletinherits from BaseWallet, AbstractSignerA Wallet manages a single private key which is used to sign transactions, messages and other common payloads.This class is generally the main entry point for developers that wish to use a private key directly, as it can create instances from a large variety of common sources, including raw private key, BIP-39 mnemonics and encrypte JSON wallets.CREATING INSTANCES <src>new Wallet(key: string | SigningKey, provider?: null | Provider)Create a new wallet for the private key, optionally connected to provider.METHODS <src>wallet.encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback)⇒ Promise< string >Resolves to a JSON Keystore Wallet encrypted with password.If progressCallback is specified, it will receive periodic updates as the encryption process progreses. <src>wallet.encryptSync(password: Uint8Array | string)⇒ stringReturns a JSON Keystore Wallet encryped with password.It is preferred to use the async version instead, which allows a ProgressCallback to keep the user informed.This method will block the event loop (freezing all UI) until it is complete, which may be a non-trivial duration.STATIC METHODS <src>Wallet.createRandom(provider?: null | Provider)⇒ HDNodeWalletCreates a new random HDNodeWallet using the available cryptographic random source.If there is no crytographic random source, this will throw. <src>Wallet.fromEncryptedJson(json: string, | string, progress?: ProgressCallback)⇒ Promise< HDNodeWallet | Wallet >Creates (asynchronously) a Wallet by decrypting the json with password.If progress is provided, it is called periodically during decryption so that any UI can be updated. <src>Wallet.fromEncryptedJsonSync(json: string, | string)⇒ HDNodeWallet | WalletCreates a Wallet by decrypting the json with password.The fromEncryptedJson method is preferred, as this method will lock up and freeze the UI during decryption, which may take some time. <src>Wallet.fromPhrase(phrase: string, provider?: Provider)⇒ HDNodeWalletCreates a HDNodeWallet for phrase. HD WalletsExplain HD Wallets..CONSTANTS <src>defaultPath⇒ stringThe default derivation path for Ethereum HD Nodes. (i.e. \"m/44'/60'/0'/0/0\")FUNCTIONS <src>getAccountPath(index: Numeric)⇒ stringReturns the BIP-32 path for the account at index.This is the pattern used by wallets like Ledger.There is also an alternate pattern used by some software. <src>getIndexedAccountPath(index: Numeric)⇒ stringReturns the path using an alternative pattern for deriving accounts, at index.This derivation path uses the index component rather than the account component to derive sequential accounts.This is the pattern used by wallets like MetaMask. class HDNodeVoidWalletinherits from VoidSigner, AbstractSignerA HDNodeVoidWallet cannot sign, but provides access to the children nodes of a BIP-32 HD wallet addresses.The can be created by using an extended xpub key to HDNodeWallet.fromExtendedKey or by nuetering a HDNodeWallet.PROPERTIES <src>hdNodeVoidWallet.chainCode⇒ stringread-onlyThe chaincode, which is effectively a public key used to derive children. <src>hdNodeVoidWallet.depth⇒ numberread-onlyThe depth of this wallet, which is the number of components in its path. <src>hdNodeVoidWallet.extendedKey⇒ stringread-onlyThe extended key.This key will begin with the prefix xpub and can be used to reconstruct this neutered key to derive its children addresses. <src>hdNodeVoidWallet.fingerprint⇒ stringread-onlyThe fingerprint.A fingerprint allows quick qay to detect parent and child nodes, but developers should be prepared to deal with collisions as it is only 4 bytes. <src>hdNodeVoidWallet.index⇒ numberread-onlyThe child index of this wallet. Values over 2 ** 31 indicate the node is hardened. <src>hdNodeVoidWallet.parentFingerprint⇒ stringread-onlyThe parent node fingerprint. <src>hdNodeVoidWallet.path⇒ null | stringread-onlyThe derivation path of this wallet.Since extended keys do not provider full path details, this may be null, if instantiated from a source that does not enocde it. <src>hdNodeVoidWallet.publicKey⇒ stringread-onlyThe compressed public key.METHODS <src>hdNodeVoidWallet.deriveChild(index: Numeric)⇒ HDNodeVoidWalletReturn the child for index. <src>hdNodeVoidWallet.derivePath(path: string)⇒ HDNodeVoidWalletReturn the signer for path from this node. <src>hdNodeVoidWallet.hasPath()⇒ booleanReturns true if this wallet has a path, providing a Type Guard that the path is non-null. class HDNodeWalletinherits from BaseWallet, AbstractSignerAn HDNodeWallet is a Signer backed by the private key derived from an HD Node using the BIP-32 stantard.An HD Node forms a hierarchal structure with each HD Node having a private key and the ability to derive child HD Nodes, defined by a path indicating the index of each child.PROPERTIES <src>hdNodeWallet.chainCode⇒ stringread-onlyThe chaincode, which is effectively a public key used to derive children. <src>hdNodeWallet.depth⇒ numberread-onlyThe depth of this wallet, which is the number of components in its path. <src>hdNodeWallet.extendedKey⇒ stringread-onlyThe extended key.This key will begin with the prefix xpriv and can be used to reconstruct this HD Node to derive its children. <src>hdNodeWallet.fingerprint⇒ stringread-onlyThe fingerprint.A fingerprint allows quick qay to detect parent and child nodes, but developers should be prepared to deal with collisions as it is only 4 bytes. <src>hdNodeWallet.index⇒ numberread-onlyThe child index of this wallet. Values over 2 ** 31 indicate the node is hardened. <src>hdNodeWallet.mnemonic⇒ null | Mnemonicread-onlyThe mnemonic used to create this HD Node, if available.Sources such as extended keys do not encode the mnemonic, in which case this will be null. <src>hdNodeWallet.parentFingerprint⇒ stringread-onlyThe parent fingerprint. <src>hdNodeWallet.path⇒ null | stringread-onlyThe derivation path of this wallet.Since extended keys do not provide full path details, this may be null, if instantiated from a source that does not encode it. <src>hdNodeWallet.publicKey⇒ stringread-onlyThe compressed public key.CREATING INSTANCES <src>HDNodeWallet.createRandom(password?: string, path?: string, wordlist?: Wordlist)⇒ HDNodeWalletCreates a new random HDNode. <src>HDNodeWallet.fromMnemonic(mnemonic: Mnemonic, path?: string)⇒ HDNodeWalletCreate an HD Node from mnemonic. <src>HDNodeWallet.fromPhrase(phrase: string, password?: string, path?: string, wordlist?: Wordlist)⇒ HDNodeWalletCreates an HD Node from a mnemonic phrase. <src>HDNodeWallet.fromSeed(seed: BytesLike)⇒ HDNodeWalletCreates an HD Node from a seed.METHODS <src>hdNodeWallet.deriveChild(index: Numeric)⇒ HDNodeWalletReturn the child for index. <src>hdNodeWallet.derivePath(path: string)⇒ HDNodeWalletReturn the HDNode for path from this node. <src>hdNodeWallet.encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback)⇒ Promise< string >Resolves to a JSON Keystore Wallet encrypted with password.If progressCallback is specified, it will receive periodic updates as the encryption process progreses. <src>hdNodeWallet.encryptSync(password: Uint8Array | string)⇒ stringReturns a JSON Keystore Wallet encryped with password.It is preferred to use the async version instead, which allows a ProgressCallback to keep the user informed.This method will block the event loop (freezing all UI) until it is complete, which may be a non-trivial duration. <src>hdNodeWallet.hasPath()⇒ booleanReturns true if this wallet has a path, providing a Type Guard that the path is non-null. <src>hdNodeWallet.neuter()⇒ HDNodeVoidWalletReturns a neutered HD Node, which removes the private details of an HD Node.A neutered node has no private key, but can be used to derive child addresses and other public data about the HD Node.STATIC METHODS <src>HDNodeWallet.fromExtendedKey(extendedKey: string)⇒ HDNodeWallet | HDNodeVoidWalletCreates a new HD Node from extendedKey.If the extendedKey will either have a prefix or xpub or xpriv, returning a neutered HD Node (HDNodeVoidWallet) or full HD Node ([[HDNodeWallet) respectively. JSON WalletsThe JSON Wallet formats allow a simple way to store the private keys needed in Ethereum along with related information and allows for extensible forms of encryption.These utilities facilitate decrypting and encrypting the most common JSON Wallet formats.TYPES <src>CrowdsaleAccount⇒ { , }The data stored within a JSON Crowdsale wallet is fairly minimal. <src>EncryptOptions⇒ { client?: string , entropy?: BytesLike , iv?: BytesLike , progressCallback?: ProgressCallback , salt?: BytesLike , scrypt?: { N?: number , p?: number , r?: number } , uuid?: string }The parameters to use when encrypting a JSON Keystore Wallet. <src>KeystoreAccount⇒ { , mnemonic?: { , locale?: string , path?: string } , }The contents of a JSON Keystore Wallet.FUNCTIONS <src>decryptCrowdsaleJson(json: string, | Uint8Array)⇒ CrowdsaleAccountBefore Ethereum launched, it was necessary to create a wallet format for backers to use, which would be used to receive ether as a reward for contributing to the project.The Crowdsale Wallet format is now obsolete, but it is still useful to support and the additional code is fairly trivial as all the primitives required are used through core portions of the library. <src>decryptKeystoreJson(json: string, | Uint8Array, progress?: ProgressCallback)⇒ Promise< KeystoreAccount >Resolves to the decrypted JSON Keystore Wallet json using the password.If provided, progress will be called periodically during the decrpytion to provide feedback, and if the function returns false will halt decryption.The progressCallback will always receive 0 before decryption begins and 1 when complete. <src>decryptKeystoreJsonSync(json: string, | Uint8Array)⇒ KeystoreAccountReturns the account details for the JSON Keystore Wallet json using password.It is preferred to use the async version instead, which allows a ProgressCallback to keep the user informed as to the decryption status.This method will block the event loop (freezing all UI) until decryption is complete, which can take quite some time, depending on the wallet paramters and platform. <src>encryptKeystoreJson(account: KeystoreAccount, | Uint8Array, options?: EncryptOptions)⇒ Promise< string >Resolved to the JSON Keystore Wallet for account encrypted with password.The options can be used to tune the password-based key derivation function parameters, explicitly set the random values used and provide a ProgressCallback to receive periodic updates on the completion status.. <src>encryptKeystoreJsonSync(account: KeystoreAccount, | Uint8Array, options?: EncryptOptions)⇒ stringReturn the JSON Keystore Wallet for account encrypted with password.The options can be used to tune the password-based key derivation function parameters, explicitly set the random values used. Any provided ProgressCallback is ignord. <src>isCrowdsaleJson(json: string)⇒ booleanReturns true if json is a valid JSON Crowdsale wallet. <src>isKeystoreJson(json: string)⇒ booleanReturns true if json is a valid JSON Keystore Wallet.← Fixed-Point MathsWordlists→The content of this site is licensed under the Creative Commons License. Generated on May 1, 2024,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.137Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":3670}}23{"id":"doc-https_docs_ethers_org_v6_api_providers_abstract_-82a9f324","source":"documentation","title":"https://docs.ethers.org/v6/api/providers/abstract-signer/","url":"https://docs.ethers.org/v6/api/providers/abstract-signer/","text":"Documentation »API »Providers »Subclassing Signer Subclassing SignerGenerally the Wallet and JsonRpcSigner and their sub-classes are sufficient for most developers, but this is provided to fascilitate more complex Signers. abstract class AbstractSignerinherits from Signer, Addressable, ContractRunner, NameResolverAn AbstractSigner includes most of teh functionality required to get a Signer working as expected, but requires a few Signer-specific methods be overridden.PROPERTIES <src>abstractSigner.provider⇒ Pread-onlyThe provider this signer is connected to.CREATING INSTANCES <src>new AbstractSigner(provider?: P)Creates a new Signer connected to provider.METHODS <src>abstractSigner.connect(provider: null | Provider)⇒ SignerabstractReturns the signer connected to provider.This may throw, for example, a Signer connected over a Socket or to a specific instance of a node may not be transferrable. <src>abstractSigner.getAddress()⇒ Promise< string >abstractResolves to the Signer address. class VoidSignerinherits from AbstractSigner, SignerA VoidSigner is a class designed to allow an address to be used in any API which accepts a Signer, but for which there are no credentials available to perform any actual signing.This for example allow impersonating an account for the purpose of static calls or estimating gas, but does not allow sending transactions.PROPERTIES <src>voidSigner.address⇒ stringread-onlyThe signer address.CREATING INSTANCES <src>new VoidSigner(address: string, provider?: null | Provider)Creates a new VoidSigner with address attached to provider.← Subclassing ProviderENS Resolver→The content of this site is licensed under the Creative Commons License. Generated on December 2, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.138Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":433}}24{"id":"doc-https_docs_ethers_org_v6_api_abi-e8e61e18","source":"documentation","title":"https://docs.ethers.org/v6/api/abi/","url":"https://docs.ethers.org/v6/api/abi/","text":"Documentation »API »Application Binary Interface Application Binary InterfaceThe Application Binary Interface (ABI) describes how method input parameters should be encoded, their results decoded, and how to decode events and errors.See About ABIs for more details how they are used.FUNCTIONS <src>checkResultErrors(result: Result)⇒ Array< { , < string | number > } >Returns all errors found in a Result.Since certain errors encountered when creating a Result do not impact the ability to continue parsing data, they are deferred until they are actually accessed. Hence a faulty string in an Event that is never used does not impact the program flow.However, sometimes it may be useful to access, identify or validate correctness of a Result. <src>decodeBytes32String(bytes: BytesLike)⇒ stringEncodes the Bytes32-encoded bytes into a string. <src>encodeBytes32String(text: string)⇒ stringEncodes text as a Bytes32 string. class ResultA Result is a sub-class of Array, which allows accessing any of its values either positionally by its index or, if keys are provided by its name.CREATING INSTANCES <src>Result.fromItems(items: Array< any >, keys?: Array< null | string >)⇒ ResultCreates a new Result for items with each entry also accessible by its corresponding name in keys.METHODS <src>result.getValue(name: string)⇒ anyReturns the value for name.Since it is possible to have a key whose name conflicts with a method on a Result or its superclass Array, or any JavaScript keyword, this ensures all named values are still accessible by name. <src>result.toArray(deep?: boolean)⇒ Array< any >Returns the Result as a normal Array. If deep, any children which are Result objects are also converted to a normal Array.This will throw if there are any outstanding deferred errors. <src>result.toObject(deep?: boolean)⇒ Record< string, any >Returns the Result as an Object with each name-value pair. If deep, any children which are Result objects are also converted to an Object.This will throw if any value is unnamed, or if there are any outstanding deferred errors. InterfacesThe Interface class is a low-level class that accepts an ABI and provides all the necessary functionality to encode and decode paramaters to and results from methods, events and errors.It also provides several convenience methods to automatically search and find matching transactions and events to parse them.TYPES <src>InterfaceAbi⇒ string | ReadonlyArray< Fragment | JsonFragment | string >An InterfaceAbi may be any supported ABI format.A string is expected to be a JSON string, which will be parsed using JSON.parse. This means that the value must be a valid JSON string, with no stray commas, etc.An array may contain any combination fragments Parsed JSON fragment Fragment instances A Human-Readable Fragment is a string which resembles a Solidity signature and is introduced in this blog entry. For example, function balanceOf(address) view returns (uint).A Parsed JSON Fragment is a JavaScript Object desribed in the Solidity documentation. class ErrorDescriptionWhen using the interface.parseError to automatically match an error for a call result for parsing, an ErrorDescription is returned.PROPERTIES <src>errorDescription.args⇒ Resultread-onlyThe arguments passed to the Error with revert. <src>errorDescription.fragment⇒ ErrorFragmentread-onlyThe matching fragment. <src>errorDescription.name⇒ stringread-onlyThe name of the Error. <src>errorDescription.selector⇒ stringread-onlyThe selector for the Error. <src>errorDescription.signature⇒ stringread-onlyThe full Error signature. class IndexedAn Indexed is used as a value when a value that does not fit within a topic (i.e. not a fixed-length, 32-byte type). It is the keccak256 of the value, and used for types such as arrays, tuples, bytes and strings.PROPERTIES <src>indexed.hash⇒ null | stringread-onlyThe keccak256 of the value logged.STATIC METHODS <src>Indexed.isIndexed(value: any)⇒ booleanReturns true if value is an Indexed.This provides a Type Guard for property access. class InterfaceAn Interface abstracts many of the low-level details for encoding and decoding the data on the blockchain.An ABI provides information on how to encode data to send to a Contract, how to decode the results and events and how to interpret revert errors.The ABI can be specified by any supported format.PROPERTIES <src>interface.deploy⇒ ConstructorFragmentread-onlyThe Contract constructor. <src>interface.fallback⇒ null | FallbackFragmentread-onlyThe Fallback method, if any. <src>interface.fragments⇒ ReadonlyArray< Fragment >read-onlyAll the Contract ABI members (i.e. methods, events, errors, etc). <src>interface.receive⇒ booleanread-onlyIf receiving ether is supported.CREATING INSTANCES <src>new Interface(fragments: InterfaceAbi)Create a new Interface for the fragments. <src>Interface.from(value: InterfaceAbi | Interface)⇒ InterfaceCreates a new Interface from the ABI value.The value may be provided as an existing Interface object, a JSON-encoded ABI or any Human-Readable ABI format.METHODS <src>interface._decodeParams(params: ReadonlyArray< ParamType >, )⇒ Result <src>interface._encodeParams(params: ReadonlyArray< ParamType >, < any >)⇒ string <src>interface.decodeErrorResult(fragment: ErrorFragment | string, )⇒ ResultDecodes the result data (e.g. from an eth_call) for the specified error (see getError for valid values for key).Most developers should prefer the parseCallResult method instead, which will automatically detect a CALL_EXCEPTION and throw the corresponding error. <src>interface.decodeEventLog(fragment: EventFragment | string, , topics?: ReadonlyArray< string >)⇒ Result <src>interface.decodeFunctionData(fragment: FunctionFragment | string, )⇒ ResultDecodes the data from a transaction tx.data for the function specified (see getFunction for valid values for fragment).Most developers should prefer the parseTransaction method instead, which will automatically detect the fragment. <src>interface.decodeFunctionResult(fragment: FunctionFragment | string, )⇒ ResultDecodes the result data (e.g. from an eth_call) for the specified function (see getFunction for valid values for key).Most developers should prefer the parseCallResult method instead, which will automatically detect a CALL_EXCEPTION and throw the corresponding error. <src>interface.encodeDeploy(values?: ReadonlyArray< any >)⇒ stringEncodes a tx.data object for deploying the Contract with the values as the constructor arguments. <src>interface.encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray< any >)⇒ stringEncodes the transaction revert data for a call result that reverted from the the Contract with the sepcified error (see getError for valid values for fragment) with the values.This is generally not used by most developers, unless trying to mock a result from a Contract. <src>interface.encodeEventLog(fragment: EventFragment | string, < any >)⇒ { , < string > } <src>interface.encodeFilterTopics(fragment: EventFragment | string, < any >)⇒ Array< null | string | Array< string > > <src>interface.encodeFunctionData(fragment: FunctionFragment | string, values?: ReadonlyArray< any >)⇒ stringEncodes the tx.data for a transaction that calls the function specified (see getFunction for valid values for fragment) with the values. <src>interface.encodeFunctionResult(fragment: FunctionFragment | string, values?: ReadonlyArray< any >)⇒ stringEncodes the result data (e.g. from an eth_call) for the specified function (see getFunction for valid values for fragment) with values.This is generally not used by most developers, unless trying to mock a result from a Contract. <src>interface.forEachError(callback: (func: ErrorFragment, ) => void)⇒ voidIterate over all errors, calling callback, sorted by their name. <src>interface.forEachEvent(callback: (func: EventFragment, ) => void)⇒ voidIterate over all events, calling callback, sorted by their name. <src>interface.forEachFunction(callback: (func: FunctionFragment, ) => void)⇒ voidIterate over all functions, calling callback, sorted by their name. <src>interface.format(minimal?: boolean)⇒ Array< string >Returns the entire Human-Readable ABI, as an array of signatures, optionally as minimal strings, which removes parameter names and unneceesary spaces. <src>interface.formatJson()⇒ stringReturn the JSON-encoded ABI. This is the format Solidiy returns. <src>interface.getAbiCoder()⇒ AbiCoderThe ABI coder that will be used to encode and decode binary data. <src>interface.getError(key: string, values?: Array< any | Typed >)⇒ null | ErrorFragmentGet the ErrorFragment for key, which may be an error selector, error name or error signature that belongs to the ABI.If values is provided, it will use the Typed API to handle ambiguous cases where multiple errors match by name.If the key and values do not refine to a single error in the ABI, this will throw. <src>interface.getEvent(key: string, values?: Array< any | Typed >)⇒ null | EventFragmentGet the EventFragment for key, which may be a topic hash, event name or event signature that belongs to the ABI.If values is provided, it will use the Typed API to handle ambiguous cases where multiple events match by name.If the key and values do not refine to a single event in the ABI, this will throw. <src>interface.getEventName(key: string)⇒ stringGet the event name for key, which may be a topic hash, event name or event signature that belongs to the ABI. <src>interface.getFunction(key: string, values?: Array< any | Typed >)⇒ null | FunctionFragmentGet the FunctionFragment for key, which may be a function selector, function name or function signature that belongs to the ABI.If values is provided, it will use the Typed API to handle ambiguous cases where multiple functions match by name.If the key and values do not refine to a single function in the ABI, this will throw. <src>interface.getFunctionName(key: string)⇒ stringGet the function name for key, which may be a function selector, function name or function signature that belongs to the ABI. <src>interface.hasEvent(key: string)⇒ booleanReturns true if key (an event topic hash, event name or event signature) is present in the ABI.In the case of an event name, the name may be ambiguous, so accessing the EventFragment may require refinement. <src>interface.hasFunction(key: string)⇒ booleanReturns true if key (a function selector, function name or function signature) is present in the ABI.In the case of a function name, the name may be ambiguous, so accessing the FunctionFragment may require refinement. <src>interface.makeError(data: BytesLike, )⇒ CallExceptionError <src>interface.parseCallResult(data: BytesLike)⇒ Result <src>interface.parseError(data: BytesLike)⇒ null | ErrorDescriptionParses a revert data, finding the matching error and extracts the parameter values along with other useful error details.If the matching error cannot be found, returns null. <src>interface.parseLog(log: { , < string > })⇒ null | LogDescriptionParses a receipt log, finding the matching event and extracts the parameter values along with other useful event details.If the matching event cannot be found, returns null. <src>interface.parseTransaction(tx: { , value?: BigNumberish })⇒ null | TransactionDescriptionParses a transaction, finding the matching function and extracts the parameter values along with other useful function details.If the matching function cannot be found, return null. class LogDescriptionWhen using the interface.parseLog to automatically match a Log to its event for parsing, a LogDescription is returned.PROPERTIES <src>logDescription.args⇒ Resultread-onlyThe arguments passed into the Event with emit. <src>logDescription.fragment⇒ EventFragmentread-onlyThe matching fragment for the topic0. <src>logDescription.name⇒ stringread-onlyThe name of the Event. <src>logDescription.signature⇒ stringread-onlyThe full Event signature. <src>logDescription.topic⇒ stringread-onlyThe topic hash for the Event. class TransactionDescriptionWhen using the interface.parseTransaction to automatically match a transaction data to its function for parsing, a TransactionDescription is returned.PROPERTIES <src>transactionDescription.args⇒ Resultread-onlyThe arguments passed to the Function from the transaction data. <src>transactionDescription.fragment⇒ FunctionFragmentread-onlyThe matching fragment from the transaction data. <src>transactionDescription.name⇒ stringread-onlyThe name of the Function from the transaction data. <src>transactionDescription.selector⇒ stringread-onlyThe selector for the Function from the transaction data. <src>transactionDescription.signature⇒ stringread-onlyThe full Function signature from the transaction data. <src>transactionDescription.value⇒ bigintread-onlyThe value (in wei) from the transaction. Typed ValuesA Typed object allows a value to have its type explicitly specified.For example, in Solidity, the value 45 could represent a uint8 or a uint256. The value 0x1234 could represent a bytes2 or bytes.Since JavaScript has no meaningful way to explicitly inform any APIs which what the type is, this allows transparent interoperation with Soldity. class TypedThe Typed class to wrap values providing explicit type information.PROPERTIES <src>typed.arrayLength⇒ null | numberread-onlyReturns the length of the array type or -1 if it is dynamic.Throws if the type is not an array. <src>typed.tupleName⇒ null | stringread-onlyReturns the tuple name, if this is a tuple. Throws otherwise. <src>typed.type⇒ stringread-onlyThe type, as a Solidity-compatible type. <src>typed.value⇒ anyread-onlyThe actual value.CREATING INSTANCES <src>Typed.address(v: string | Addressable)⇒ TypedReturn a new address type for v. <src>Typed.array(v: Array< any | Typed >, dynamic?: null | boolean)⇒ TypedReturn a new array type for v, allowing dynamic length. <src>Typed.bool(v: any)⇒ TypedReturn a new bool type for v. <src>Typed.bytes(v: BytesLike)⇒ TypedReturn a new bytes type for v. <src>Typed.bytes1(v: BytesLike)⇒ TypedReturn a new bytes1 type for v. <src>Typed.bytes10(v: BytesLike)⇒ TypedReturn a new bytes10 type for v. <src>Typed.bytes11(v: BytesLike)⇒ TypedReturn a new bytes11 type for v. <src>Typed.bytes12(v: BytesLike)⇒ TypedReturn a new bytes12 type for v. <src>Typed.bytes13(v: BytesLike)⇒ TypedReturn a new bytes13 type for v. <src>Typed.bytes14(v: BytesLike)⇒ TypedReturn a new bytes14 type for v. <src>Typed.bytes15(v: BytesLike)⇒ TypedReturn a new bytes15 type for v. <src>Typed.bytes16(v: BytesLike)⇒ TypedReturn a new bytes16 type for v. <src>Typed.bytes17(v: BytesLike)⇒ TypedReturn a new bytes17 type for v. <src>Typed.bytes18(v: BytesLike)⇒ TypedReturn a new bytes18 type for v. <src>Typed.bytes19(v: BytesLike)⇒ TypedReturn a new bytes19 type for v. <src>Typed.bytes2(v: BytesLike)⇒ TypedReturn a new bytes2 type for v. <src>Typed.bytes20(v: BytesLike)⇒ TypedReturn a new bytes20 type for v. <src>Typed.bytes21(v: BytesLike)⇒ TypedReturn a new bytes21 type for v. <src>Typed.bytes22(v: BytesLike)⇒ TypedReturn a new bytes22 type for v. <src>Typed.bytes23(v: BytesLike)⇒ TypedReturn a new bytes23 type for v. <src>Typed.bytes24(v: BytesLike)⇒ TypedReturn a new bytes24 type for v. <src>Typed.bytes25(v: BytesLike)⇒ TypedReturn a new bytes25 type for v. <src>Typed.bytes26(v: BytesLike)⇒ TypedReturn a new bytes26 type for v. <src>Typed.bytes27(v: BytesLike)⇒ TypedReturn a new bytes27 type for v. <src>Typed.bytes28(v: BytesLike)⇒ TypedReturn a new bytes28 type for v. <src>Typed.bytes29(v: BytesLike)⇒ TypedReturn a new bytes29 type for v. <src>Typed.bytes3(v: BytesLike)⇒ TypedReturn a new bytes3 type for v. <src>Typed.bytes30(v: BytesLike)⇒ TypedReturn a new bytes30 type for v. <src>Typed.bytes31(v: BytesLike)⇒ TypedReturn a new bytes31 type for v. <src>Typed.bytes32(v: BytesLike)⇒ TypedReturn a new bytes32 type for v. <src>Typed.bytes4(v: BytesLike)⇒ TypedReturn a new bytes4 type for v. <src>Typed.bytes5(v: BytesLike)⇒ TypedReturn a new bytes5 type for v. <src>Typed.bytes6(v: BytesLike)⇒ TypedReturn a new bytes6 type for v. <src>Typed.bytes7(v: BytesLike)⇒ TypedReturn a new bytes7 type for v. <src>Typed.bytes8(v: BytesLike)⇒ TypedReturn a new bytes8 type for v. <src>Typed.bytes9(v: BytesLike)⇒ TypedReturn a new bytes9 type for v. <src>Typed.from(type: string, )⇒ TypedReturns a new Typed of type with the value. <src>Typed.int(v: BigNumberish)⇒ TypedReturn a new int256 type for v. <src>Typed.int104(v: BigNumberish)⇒ TypedReturn a new int104 type for v. <src>Typed.int112(v: BigNumberish)⇒ TypedReturn a new int112 type for v. <src>Typed.int120(v: BigNumberish)⇒ TypedReturn a new int120 type for v. <src>Typed.int128(v: BigNumberish)⇒ TypedReturn a new int128 type for v. <src>Typed.int136(v: BigNumberish)⇒ TypedReturn a new int136 type for v. <src>Typed.int144(v: BigNumberish)⇒ TypedReturn a new int144 type for v. <src>Typed.int152(v: BigNumberish)⇒ TypedReturn a new int52 type for v. <src>Typed.int16(v: BigNumberish)⇒ TypedReturn a new int16 type for v. <src>Typed.int160(v: BigNumberish)⇒ TypedReturn a new int160 type for v. <src>Typed.int168(v: BigNumberish)⇒ TypedReturn a new int168 type for v. <src>Typed.int176(v: BigNumberish)⇒ TypedReturn a new int176 type for v. <src>Typed.int184(v: BigNumberish)⇒ TypedReturn a new int184 type for v. <src>Typed.int192(v: BigNumberish)⇒ TypedReturn a new int92 type for v. <src>Typed.int200(v: BigNumberish)⇒ TypedReturn a new int200 type for v. <src>Typed.int208(v: BigNumberish)⇒ TypedReturn a new int208 type for v. <src>Typed.int216(v: BigNumberish)⇒ TypedReturn a new int216 type for v. <src>Typed.int224(v: BigNumberish)⇒ TypedReturn a new int224 type for v. <src>Typed.int232(v: BigNumberish)⇒ TypedReturn a new int232 type for v. <src>Typed.int24(v: BigNumberish)⇒ TypedReturn a new int24 type for v. <src>Typed.int240(v: BigNumberish)⇒ TypedReturn a new int240 type for v. <src>Typed.int248(v: BigNumberish)⇒ TypedReturn a new int248 type for v. <src>Typed.int256(v: BigNumberish)⇒ TypedReturn a new int256 type for v. <src>Typed.int32(v: BigNumberish)⇒ TypedReturn a new int32 type for v. <src>Typed.int40(v: BigNumberish)⇒ TypedReturn a new int40 type for v. <src>Typed.int48(v: BigNumberish)⇒ TypedReturn a new int48 type for v. <src>Typed.int56(v: BigNumberish)⇒ TypedReturn a new int56 type for v. <src>Typed.int64(v: BigNumberish)⇒ TypedReturn a new int64 type for v. <src>Typed.int72(v: BigNumberish)⇒ TypedReturn a new int72 type for v. <src>Typed.int8(v: BigNumberish)⇒ TypedReturn a new int8 type for v. <src>Typed.int80(v: BigNumberish)⇒ TypedReturn a new int80 type for v. <src>Typed.int88(v: BigNumberish)⇒ TypedReturn a new int88 type for v. <src>Typed.int96(v: BigNumberish)⇒ TypedReturn a new int96 type for v. <src>Typed.overrides(v: Record< string, any >)⇒ TypedReturn a new uint8 type for v. <src>Typed.string(v: string)⇒ TypedReturn a new string type for v. <src>Typed.tuple(v: Array< any | Typed > | Record< string, any | Typed >, name?: string)⇒ TypedReturn a new tuple type for v, with the optional name. <src>Typed.uint(v: BigNumberish)⇒ TypedReturn a new uint256 type for v. <src>Typed.uint104(v: BigNumberish)⇒ TypedReturn a new uint104 type for v. <src>Typed.uint112(v: BigNumberish)⇒ TypedReturn a new uint112 type for v. <src>Typed.uint120(v: BigNumberish)⇒ TypedReturn a new uint120 type for v. <src>Typed.uint128(v: BigNumberish)⇒ TypedReturn a new uint128 type for v. <src>Typed.uint136(v: BigNumberish)⇒ TypedReturn a new uint136 type for v. <src>Typed.uint144(v: BigNumberish)⇒ TypedReturn a new uint144 type for v. <src>Typed.uint152(v: BigNumberish)⇒ TypedReturn a new uint152 type for v. <src>Typed.uint16(v: BigNumberish)⇒ TypedReturn a new uint16 type for v. <src>Typed.uint160(v: BigNumberish)⇒ TypedReturn a new uint160 type for v. <src>Typed.uint168(v: BigNumberish)⇒ TypedReturn a new uint168 type for v. <src>Typed.uint176(v: BigNumberish)⇒ TypedReturn a new uint176 type for v. <src>Typed.uint184(v: BigNumberish)⇒ TypedReturn a new uint184 type for v. <src>Typed.uint192(v: BigNumberish)⇒ TypedReturn a new uint192 type for v. <src>Typed.uint200(v: BigNumberish)⇒ TypedReturn a new uint200 type for v. <src>Typed.uint208(v: BigNumberish)⇒ TypedReturn a new uint208 type for v. <src>Typed.uint216(v: BigNumberish)⇒ TypedReturn a new uint216 type for v. <src>Typed.uint224(v: BigNumberish)⇒ TypedReturn a new uint224 type for v. <src>Typed.uint232(v: BigNumberish)⇒ TypedReturn a new uint232 type for v. <src>Typed.uint24(v: BigNumberish)⇒ TypedReturn a new uint24 type for v. <src>Typed.uint240(v: BigNumberish)⇒ TypedReturn a new uint240 type for v. <src>Typed.uint248(v: BigNumberish)⇒ TypedReturn a new uint248 type for v. <src>Typed.uint256(v: BigNumberish)⇒ TypedReturn a new uint256 type for v. <src>Typed.uint32(v: BigNumberish)⇒ TypedReturn a new uint32 type for v. <src>Typed.uint40(v: BigNumberish)⇒ TypedReturn a new uint40 type for v. <src>Typed.uint48(v: BigNumberish)⇒ TypedReturn a new uint48 type for v. <src>Typed.uint56(v: BigNumberish)⇒ TypedReturn a new uint56 type for v. <src>Typed.uint64(v: BigNumberish)⇒ TypedReturn a new uint64 type for v. <src>Typed.uint72(v: BigNumberish)⇒ TypedReturn a new uint72 type for v. <src>Typed.uint8(v: BigNumberish)⇒ TypedReturn a new uint8 type for v. <src>Typed.uint80(v: BigNumberish)⇒ TypedReturn a new uint80 type for v. <src>Typed.uint88(v: BigNumberish)⇒ TypedReturn a new uint88 type for v. <src>Typed.uint96(v: BigNumberish)⇒ TypedReturn a new uint96 type for v.METHODS <src>typed.defaultValue()⇒ string | number | bigint | ResultThe default value returned by this type. <src>typed.format()⇒ stringFormat the type as a Human-Readable type. <src>typed.isBigInt()⇒ booleanReturns true and provides a type guard is this is a TypedBigInt. <src>typed.isData()⇒ booleanReturns true and provides a type guard is this is a TypedData. <src>typed.isString()⇒ booleanReturns true and provides a type guard is this is a TypedString. <src>typed.maxValue()⇒ string | number | bigintThe maximum value for numeric types. <src>typed.minValue()⇒ string | number | bigintThe minimum value for numeric types.STATIC METHODS <src>Typed.dereference(value: Typed | T, )⇒ TIf the value is a Typed instance, validates the underlying value and returns it, otherwise returns value directly.This is useful for functions that with to accept either a Typed object or values. <src>Typed.isTyped(value: any)⇒ booleanReturns true only if value is a Typed instance. interface TypedBigIntinherits from TypedA Typed that represents a numeric value.PROPERTIES <src>typedBigInt.value⇒ bigintThe value.METHODS <src>typedBigInt.defaultValue()⇒ bigintThe default value for all numeric types is 0. <src>typedBigInt.maxValue()⇒ bigintThe minimum value for this type, accounting for bit-width. <src>typedBigInt.minValue()⇒ bigintThe minimum value for this type, accounting for bit-width and signed-ness. interface TypedDatainherits from TypedA Typed that represents a binary sequence of data as bytes.PROPERTIES <src>typedData.value⇒ stringThe value.METHODS <src>typedData.defaultValue()⇒ stringThe default value for this type. interface TypedStringinherits from TypedA Typed that represents a UTF-8 sequence of bytes.PROPERTIES <src>typedString.value⇒ stringThe value.METHODS <src>typedString.defaultValue()⇒ stringThe default value for the string type is the empty string (i.e. \"\").← Application Programming InterfaceABI Encoding→The content of this site is licensed under the Creative Commons License. Generated on June 4, 2024,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.140Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":5874}}25{"id":"doc-https_docs_ethers_org_v6_api_providers_formattin-ad812ad7","source":"documentation","title":"https://docs.ethers.org/v6/api/providers/formatting/","url":"https://docs.ethers.org/v6/api/providers/formatting/","text":"Documentation »API »Providers »Formatting FormattingAbout provider formatting? interface BlockParamsa BlockParams encodes the minimal required properties for a formatted block.PROPERTIES <src>blockParams.baseFeePerGas⇒ null | bigintThe protocol-defined base fee per gas in an EIP-1559 block. <src>blockParams.blobGasUsed⇒ null | bigintThe total amount of BLOb gas consumed by transactions within the block. See [[link-eip4844]. <src>blockParams.difficulty⇒ bigintFor proof-of-work networks, the difficulty target is used to adjust the difficulty in mining to ensure an expected block rate. <src>blockParams.excessBlobGas⇒ null | bigintThe running total of BLOb gas consumed in excess of the target prior to the block. See EIP-4844. <src>blockParams.extraData⇒ stringAdditional data the miner choose to include. <src>blockParams.gasLimit⇒ bigintThe maximum amount of gas a block can consume. <src>blockParams.gasUsed⇒ bigintThe amount of gas a block consumed. <src>blockParams.hash⇒ null | stringThe block hash. <src>blockParams.miner⇒ stringThe miner (or author) of a block. <src>blockParams.nonce⇒ stringA random sequence provided during the mining process for proof-of-work networks. <src>blockParams.number⇒ numberThe block number. <src>blockParams.parentBeaconBlockRoot⇒ null | stringThe hash tree root of the parent beacon block for the given execution block. See EIP-4788. <src>blockParams.parentHash⇒ stringThe hash of the previous block in the blockchain. The genesis block has the parentHash of the ZeroHash. <src>blockParams.prevRandao⇒ null | stringThe latest RANDAO mix of the post beacon state of the previous block. <src>blockParams.receiptsRoot⇒ null | stringThe hash of the transaction receipts trie. <src>blockParams.stateRoot⇒ null | stringThe root hash for the global state after applying changes in this block. <src>blockParams.timestamp⇒ numberThe timestamp for this block, which is the number of seconds since epoch that this block was included. <src>blockParams.transactions⇒ ReadonlyArray< string | TransactionResponseParams >The list of transactions in the block. <src>blockParams.transactionsRoot⇒ null | stringThe hash of the transactions. interface LogParamsa LogParams encodes the minimal required properties for a formatted log.PROPERTIES <src>logParams.address⇒ stringThe address of the contract that emitted this log. <src>logParams.blockHash⇒ stringThe block hash of the block that included the transaction for this log. <src>logParams.blockNumber⇒ numberThe block number of the block that included the transaction for this log. <src>logParams.data⇒ stringThe data emitted with this log. <src>logParams.index⇒ numberThe index of this log. <src>logParams.removed⇒ booleanWhether this log was removed due to the transaction it was included in being removed dur to an orphaned block. <src>logParams.topics⇒ ReadonlyArray< string >The topics emitted with this log. <src>logParams.transactionHash⇒ stringThe transaction hash for the transaxction the log occurred in. <src>logParams.transactionIndex⇒ numberThe transaction index of this log. interface TransactionReceiptParamsa TransactionReceiptParams encodes the minimal required properties for a formatted transaction receipt.PROPERTIES <src>transactionReceiptParams.blobGasPrice⇒ null | bigintThe actual BLOb gas price that was charged. See EIP-4844. <src>transactionReceiptParams.blobGasUsed⇒ null | bigintThe amount of BLOb gas used. See EIP-4844. <src>transactionReceiptParams.blockHash⇒ stringThe block hash of the block that included this transaction. <src>transactionReceiptParams.blockNumber⇒ numberThe block number of the block that included this transaction. <src>transactionReceiptParams.contractAddress⇒ null | stringIf the transaction was directly deploying a contract, the to will be null, the data will be initcode and if successful, this will be the address of the contract deployed. <src>transactionReceiptParams.cumulativeGasUsed⇒ bigintThe total amount of gas consumed during the entire block up to and including this transaction. <src>transactionReceiptParams.effectiveGasPrice⇒ null | bigintThe actual gas price per gas charged for this transaction. <src>transactionReceiptParams.from⇒ stringThe sender of the transaction. <src>transactionReceiptParams.gasPrice⇒ null | bigintThe actual gas price per gas charged for this transaction. <src>transactionReceiptParams.gasUsed⇒ bigintThe amount of gas consumed executing this transaction. <src>transactionReceiptParams.hash⇒ stringThe transaction hash. <src>transactionReceiptParams.index⇒ numberThe transaction index. <src>transactionReceiptParams.logs⇒ ReadonlyArray< LogParams >The logs emitted during the execution of this transaction. <src>transactionReceiptParams.logsBloom⇒ stringThe bloom filter for the logs emitted during execution of this transaction. <src>transactionReceiptParams.root⇒ null | stringThe root of this transaction in a pre-bazatium block. In post-byzantium blocks this is null. <src>transactionReceiptParams.status⇒ null | numberThe status of the transaction execution. If 1 then the the transaction returned success, if 0 then the transaction was reverted. For pre-byzantium blocks, this is usually null, but some nodes may have backfilled this data. <src>transactionReceiptParams.to⇒ null | stringThe target of the transaction. If null, the transaction was trying to deploy a transaction with the data as the initi=code. <src>transactionReceiptParams.type⇒ numberThe EIP-2718 envelope type. interface TransactionResponseParamsa TransactionResponseParams encodes the minimal required properties for a formatted transaction response.PROPERTIES <src>transactionResponseParams.accessList⇒ null | AccessListThe transaction access list. <src>transactionResponseParams.authorizationList⇒ null | Array< Authorization >The EIP-7702 authorizations (if any). <src>transactionResponseParams.blobVersionedHashes⇒ null | Array< string >The EIP-4844 BLOb versioned hashes. <src>transactionResponseParams.blockHash⇒ null | stringThe block hash of the block that included this transaction. <src>transactionResponseParams.blockNumber⇒ null | numberThe block number of the block that included this transaction. <src>transactionResponseParams.chainId⇒ bigintThe chain ID this transaction is valid on. <src>transactionResponseParams.data⇒ stringThe transaction data. <src>transactionResponseParams.from⇒ stringThe sender of the transaction. <src>transactionResponseParams.gasLimit⇒ bigintThe maximum amount of gas this transaction is authorized to consume. <src>transactionResponseParams.gasPrice⇒ bigintFor legacy transactions, this is the gas price per gas to pay. <src>transactionResponseParams.hash⇒ stringThe transaction hash. <src>transactionResponseParams.index⇒ numberThe transaction index. <src>transactionResponseParams.maxFeePerBlobGas⇒ null | bigintFor EIP-4844 transactions, this is the maximum fee that will be paid per BLOb. <src>transactionResponseParams.maxFeePerGas⇒ null | bigintFor EIP-1559 transactions, this is the maximum fee that will be paid. <src>transactionResponseParams.maxPriorityFeePerGas⇒ null | bigintFor EIP-1559 transactions, this is the maximum priority fee to allow a producer to claim. <src>transactionResponseParams.nonce⇒ numberThe nonce of the transaction, used for replay protection. <src>transactionResponseParams.signature⇒ SignatureThe signature of the transaction. <src>transactionResponseParams.to⇒ null | stringThe target of the transaction. If null, the data is initcode and this transaction is a deployment transaction. <src>transactionResponseParams.type⇒ numberThe EIP-2718 transaction type. <src>transactionResponseParams.value⇒ bigintThe transaction value (in wei).← Fallback ProviderJSON-RPC Provider→The content of this site is licensed under the Creative Commons License. Generated on April 10, 2026,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.151Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":1957}}26{"id":"doc-https_docs_ethers_org_v6_api_providers_jsonrpc-1142e93c","source":"documentation","title":"https://docs.ethers.org/v6/api/providers/jsonrpc/","url":"https://docs.ethers.org/v6/api/providers/jsonrpc/","text":"Documentation »API »Providers »JSON-RPC Provider JSON-RPC ProviderOne of the most common ways to interact with the blockchain is by a node running a JSON-RPC interface which can be connected to, based on the transport, or HTTPS - JsonRpcProvider WebSocket - WebSocketProvider IPC - IpcSocketProvider TYPES <src>DebugEventJsonRpcApiProvider⇒ { action: \"sendRpcPayload\" , | Array< JsonRpcPayload > } | { action: \"receiveRpcResult\" , < JsonRpcResult | JsonRpcError > } | { action: \"receiveRpcError\" , }When subscribing to the \"debug\" event, the Listener will receive this object as the first parameter. <src>JsonRpcApiProviderOptions⇒ { batchMaxCount?: number , batchMaxSize?: number , batchStallTime?: number , cacheTimeout?: number , polling?: boolean , pollingInterval?: number , staticNetwork?: null | boolean | Network }Options for configuring a JsonRpcApiProvider. Much of this is targetted towards sub-classes, which often will not expose any of these options to their consumers.polling - use the polling strategy is used immediately for events; otherwise, attempt to use filters and fall back onto polling (default: false)staticNetwork - do not request chain ID on requests to validate the underlying chain has not changed (default: null)This should ONLY be used if it is certain that the network cannot change, such as when using INFURA (since the URL dictates the network). If the network is assumed static and it does change, this can have tragic consequences. For example, this CANNOT be used with MetaMask, since the user can select a new network from the drop-down at any time.batchStallTime - how long (ms) to aggregate requests into a single batch. 0 indicates batching will only encompass the current event loop. If batchMaxCount = 1, this is ignored. (default: 10)batchMaxSize - target maximum size (bytes) to allow per batch request (default: 1Mb)batchMaxCount - maximum number of requests to allow in a batch. If batchMaxCount = 1, then batching is disabled. (default: 100)cacheTimeout - passed as AbstractProviderOptions. <src>JsonRpcError⇒ { error: { , data?: any , message?: string } , }A JSON-RPC error, which are returned on failure from a JSON-RPC server. <src>JsonRpcPayload⇒ { , jsonrpc: \"2.0\" , , < any > | Record< string, any > }A JSON-RPC payload, which are sent to a JSON-RPC server. <src>JsonRpcResult⇒ { , }A JSON-RPC result, which are returned on success from a JSON-RPC server. abstract class JsonRpcApiProviderinherits from AbstractProvider, ProviderThe JsonRpcApiProvider is an abstract class and MUST be sub-classed.It provides the base for all JSON-RPC-based Provider interaction.Sub-classing sub-class MUST override _send a sub-class MUST call the `_start()` method once connected PROPERTIES <src>jsonRpcApiProvider._network⇒ Networkread-onlyGets the Network this provider has committed to. On each call, the network is detected, and if it has changed, the call will reject. <src>jsonRpcApiProvider.ready⇒ booleanread-onlyReturns true only if the _start has been called.CREATING INSTANCES <src>new JsonRpcApiProvider(network?: Networkish, options?: JsonRpcApiProviderOptions)METHODS <src>jsonRpcApiProvider._detectNetwork()⇒ Promise< Network >Sub-classes may override this; it detects the *actual* network that we are currently connected to.Keep in mind that send may only be used once ready, otherwise the _send primitive must be used instead. <src>jsonRpcApiProvider._getOption(key: K)⇒ TODO(A3B[object Object][[object Object]])Returns the value associated with the option key.Sub-classes can use this to inquire about configuration options. <src>jsonRpcApiProvider._getSubscriber(sub: Subscription)⇒ SubscriberReturn a Subscriber that will manage the sub.Sub-classes may override this to modify the behavior of subscription management. <src>jsonRpcApiProvider._perform(req: PerformActionRequest)⇒ Promise< any >Resolves to the non-normalized value by performing req.Sub-classes may override this to modify behavior of actions, and should generally call super._perform as a fallback. <src>jsonRpcApiProvider._send(payload: JsonRpcPayload | Array< JsonRpcPayload >)⇒ Promise< Array< JsonRpcResult | JsonRpcError > >abstractSends a JSON-RPC payload (or a batch) to the underlying channel.Sub-classes MUST override this. <src>jsonRpcApiProvider._start()⇒ voidSub-classes MUST call this. Until _start has been called, no calls will be passed to _send from send. If it is overridden, then super._start() MUST be called.Calling it multiple times is safe and has no effect. <src>jsonRpcApiProvider._waitUntilReady()⇒ Promise< void >Resolves once the _start has been called. This can be used in sub-classes to defer sending data until the connection has been established. <src>jsonRpcApiProvider.getRpcError(payload: JsonRpcPayload, )⇒ ErrorReturns an ethers-style Error for the given JSON-RPC error payload, coalescing the various strings and error shapes that different nodes return, coercing them into a machine-readable standardized error. <src>jsonRpcApiProvider.getRpcRequest(req: PerformActionRequest)⇒ null | { < any > , }Returns the request method and arguments required to perform req. <src>jsonRpcApiProvider.getRpcTransaction(tx: TransactionRequest)⇒ JsonRpcTransactionRequestReturns tx as a normalized JSON-RPC transaction request, which has all values hexlified and any numeric values converted to Quantity values. <src>jsonRpcApiProvider.getSigner(address?: number | string)⇒ Promise< JsonRpcSigner >Resolves to the Signer account for address managed by the client.If the address is a number, it is used as an index in the the accounts from listAccounts.This can only be used on clients which manage accounts (such as Geth with imported account or MetaMask).Throws if the account doesn't exist. <src>jsonRpcApiProvider.listAccounts()⇒ Promise< Array< JsonRpcSigner > > <src>jsonRpcApiProvider.send(method: string, < any > | Record< string, any >)⇒ Promise< any >Requests the method with params via the JSON-RPC protocol over the underlying channel. This can be used to call methods on the backend that do not have a high-level API within the Provider API.This method queues requests according to the batch constraints in the options, assigns the request a unique ID.Do NOT override this method in sub-classes; instead override _send or force the options values in the call to the constructor to modify this method's behavior. class JsonRpcProviderThe JsonRpcProvider is one of the most common Providers, which performs all operations over HTTP (or HTTPS) requests.Events are processed by polling the backend for the current block number; when it advances, all block-base events are then checked for updates.CREATING INSTANCES <src>new JsonRpcProvider(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions)METHODS <src>jsonRpcProvider._getConnection()⇒ FetchRequest <src>jsonRpcProvider._send(payload: JsonRpcPayload | Array< JsonRpcPayload >)⇒ Promise< Array< JsonRpcResult > > <src>jsonRpcProvider.send(method: string, < any > | Record< string, any >)⇒ Promise< any > class JsonRpcSignerinherits from AbstractSigner, SignerPROPERTIES <src>jsonRpcSigner.address⇒ stringCREATING INSTANCES <src>new JsonRpcSigner(provider: JsonRpcApiProvider, )METHODS <src>jsonRpcSigner._legacySignMessage(message: string | Uint8Array)⇒ Promise< string > <src>jsonRpcSigner.sendUncheckedTransaction(tx: TransactionRequest)⇒ Promise< string > <src>jsonRpcSigner.unlock(password: string)⇒ Promise< boolean > interface JsonRpcTransactionRequestA JsonRpcTransactionRequest is formatted as needed by the JSON-RPC Ethereum API specification.PROPERTIES <src>jsonRpcTransactionRequest.accessList⇒ Array< { , < string > } >The transaction access list. <src>jsonRpcTransactionRequest.authorizationList⇒ Array< { , , , , , } >The transaction authorization list. <src>jsonRpcTransactionRequest.chainId⇒ stringThe chain ID the transaction is valid on. <src>jsonRpcTransactionRequest.data⇒ stringThe transaction data. <src>jsonRpcTransactionRequest.from⇒ stringThe sender address to use when signing. <src>jsonRpcTransactionRequest.gas⇒ stringThe maximum amount of gas to allow a transaction to consume.In most other places in ethers, this is called gasLimit which differs from the JSON-RPC Ethereum API specification. <src>jsonRpcTransactionRequest.gasPrice⇒ stringThe gas price per wei for transactions prior to EIP-1559. <src>jsonRpcTransactionRequest.maxFeePerGas⇒ stringThe maximum fee per gas for EIP-1559 transactions. <src>jsonRpcTransactionRequest.maxPriorityFeePerGas⇒ stringThe maximum priority fee per gas for EIP-1559 transactions. <src>jsonRpcTransactionRequest.nonce⇒ stringThe nonce for the transaction. <src>jsonRpcTransactionRequest.to⇒ stringThe target address. <src>jsonRpcTransactionRequest.type⇒ stringThe EIP-2718 transaction type. <src>jsonRpcTransactionRequest.value⇒ stringThe transaction value (in wei).← FormattingCommunity Providers→The content of this site is licensed under the Creative Commons License. Generated on May 15, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.155Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":2256}}27{"id":"doc-https_docs_ethers_org_v6_api_utils_fetching-487d03c8","source":"documentation","title":"https://docs.ethers.org/v6/api/utils/fetching/","url":"https://docs.ethers.org/v6/api/utils/fetching/","text":"Documentation »API »Utilities »Fetching Web Content Fetching Web ContentFetching content from the web is environment-specific, so Ethers provides an abstraction that each environment can implement to provide this service.On Node.js, the http and https libs are used to create a request object, register event listeners and process data and populate the FetchResponse.In a browser, the DOM fetch is used, and the resulting Promise is waited on to retrieve the payload.The FetchRequest is responsible for handling many common situations, such as redirects, server throttling, authentication, etc.It also handles common gateways, such as IPFS and data URIs.TYPES <src>FetchGatewayFunc⇒ (url: string, signal?: FetchCancelSignal) => Promise< FetchRequest | FetchResponse >Called on Gateway URLs. <src>FetchGetUrlFunc⇒ (req: FetchRequest, signal?: FetchCancelSignal) => Promise< GetUrlResponse >Used to perform a fetch; use this to override the underlying network fetch layer. In NodeJS, the default uses the \"http\" and \"https\" libraries and in the browser fetch is used. If you wish to use Axios, this is how you would register it. <src>FetchPreflightFunc⇒ (req: FetchRequest) => Promise< FetchRequest >Called before any network request, allowing updated headers (e.g. Bearer tokens), etc. <src>FetchProcessFunc⇒ (req: FetchRequest, ) => Promise< FetchResponse >Called on the response, allowing client-based throttling logic or post-processing. <src>FetchRetryFunc⇒ (req: FetchRequest, , ) => Promise< boolean >Called prior to each retry; return true to retry, false to abort. <src>FetchThrottleParams⇒ { maxAttempts?: number , slotInterval?: number }This can be used to control how throttling is handled in fetchRequest.setThrottleParams. <src>GetUrlResponse⇒ { | Uint8Array , < string, string > , , }An environment's implementation of getUrl must return this type. class FetchRequestRepresents a request for a resource using a URI.By default, the supported schemes are HTTP, HTTPS, data:, and schemes can be added globally using registerGateway.req = new FetchRequest(\"https://www.ricmoo.com\") resp = await req.send() resp.body.length // 22318 PROPERTIES <src>fetchRequest.allowGzip⇒ booleanEnable and request gzip-encoded responses. The response will automatically be decompressed. (default: true) <src>fetchRequest.allowInsecureAuthentication⇒ booleanAllow Authentication credentials to be sent over insecure channels. (default: false) <src>fetchRequest.body⇒ null | Uint8ArrayThe fetch body, if any, to send as the request body. (default: null)When setting a body, the intrinsic Content-Type is automatically set and will be used if not overridden by setting a custom header.If body is null, the body is cleared (along with the intrinsic Content-Type).If body is a string, the intrinsic Content-Type is set to text/plain.If body is a Uint8Array, the intrinsic Content-Type is set to application/octet-stream.If body is any other object, the intrinsic Content-Type is set to application/json. <src>fetchRequest.credentials⇒ null | stringread-onlyThe value that will be sent for the Authorization header.To set the credentials, use the setCredentials method. <src>fetchRequest.getUrlFunc⇒ FetchGetUrlFuncThis function is called to fetch content from HTTP and HTTPS URLs and is platform specific (e.g. nodejs vs browsers).This is by default the currently registered global getUrl function, which can be changed using registerGetUrl. If this has been set, setting is to null will cause this FetchRequest (and any future clones) to revert back to using the currently registered global getUrl function.Setting this is generally not necessary, but may be useful for developers that wish to intercept requests or to configurege a proxy or other agent. <src>fetchRequest.headers⇒ Record< string, string >read-onlyThe headers that will be used when requesting the URI. All keys are lower-case.This object is a copy, so any changes will NOT be reflected in the FetchRequest.To set a header entry, use the setHeader method. <src>fetchRequest.method⇒ stringThe HTTP method to use when requesting the URI. If no method has been explicitly set, then GET is used if the body is null and POST otherwise. <src>fetchRequest.preflightFunc⇒ null | FetchPreflightFuncThis function is called prior to each request, for example during a redirection or retry in case of server throttling.This offers an opportunity to populate headers or update content before sending a request. <src>fetchRequest.processFunc⇒ null | FetchProcessFuncThis function is called after each response, offering an opportunity to provide client-level throttling or updating response data.Any error thrown in this causes the send() to throw.To schedule a retry attempt (assuming the maximum retry limit has not been reached), use [[response.throwThrottleError]]. <src>fetchRequest.retryFunc⇒ null | FetchRetryFuncThis function is called on each retry attempt. <src>fetchRequest.timeout⇒ numberThe timeout (in milliseconds) to wait for a complete response. (default: 5 minutes) <src>fetchRequest.url⇒ stringThe fetch URL to request.CREATING INSTANCES <src>new FetchRequest(url: string)Create a new FetchRequest instance with default values.Once created, each property may be set before issuing a .send() to make the request.METHODS <src>fetchRequest.cancel()⇒ voidCancels the inflight response, causing a CANCELLED error to be rejected from the send. <src>fetchRequest.clearHeaders()⇒ voidClear all headers, resetting all intrinsic headers. <src>fetchRequest.clone()⇒ FetchRequestCreate a new copy of this request. <src>fetchRequest.getHeader(key: string)⇒ stringGet the header for key, ignoring case. <src>fetchRequest.hasBody()⇒ booleanReturns true if the request has a body. <src>fetchRequest.redirect(location: string)⇒ FetchRequestReturns a new FetchRequest that represents the redirection to location. <src>fetchRequest.send()⇒ Promise< FetchResponse >Resolves to the response by sending the request. <src>fetchRequest.setCredentials(username: string, )⇒ voidSets an Authorization for username with password. <src>fetchRequest.setHeader(key: string, | number)⇒ voidSet the header for key to value. All values are coerced to a string. <src>fetchRequest.setThrottleParams(params: FetchThrottleParams)⇒ voidUpdate the throttle parameters used to determine maximum attempts and exponential-backoff properties. <src>fetchRequest.toString()⇒ stringSTATIC METHODS <src>FetchRequest.createDataGateway()⇒ FetchGatewayFuncCreates a function that can \"fetch\" data URIs.Note that this is automatically done internally to support data URIs, so it is not necessary to register it.This is not generally something that is needed, but may be useful in a wrapper to perfom custom data URI functionality. <src>FetchRequest.createGetUrlFunc(options?: Record< string, any >)⇒ FetchGetUrlFuncCreates a getUrl function that fetches content from HTTP and HTTPS URLs.The available options are dependent on the platform implementation of the default getUrl function.This is not generally something that is needed, but is useful when trying to customize simple behaviour when fetching HTTP content. <src>FetchRequest.createIpfsGatewayFunc(baseUrl: string)⇒ FetchGatewayFuncCreates a function that will fetch IPFS (unvalidated) from a custom gateway baseUrl.The default IPFS gateway used internally is \"https://gateway.ipfs.io/ipfs/\". <src>FetchRequest.getGateway(scheme: string)⇒ null | FetchGatewayFuncGet the current Gateway function for scheme. <src>FetchRequest.lockConfig()⇒ voidLocks all static configuration for gateways and FetchGetUrlFunc registration. <src>FetchRequest.registerGateway(scheme: string, )⇒ voidUse the func when fetching URIs using scheme.This method affects all requests globally.If lockConfig has been called, no change is made and this throws. <src>FetchRequest.registerGetUrl(getUrl: FetchGetUrlFunc)⇒ voidUse getUrl when fetching URIs over HTTP and HTTPS requests.This method affects all requests globally.If lockConfig has been called, no change is made and this throws. class FetchResponseThe response for a FetchRequest.PROPERTIES <src>fetchResponse.body⇒ null | Readonly< Uint8Array >read-onlyThe response body, or null if there was no body. <src>fetchResponse.bodyJson⇒ anyread-onlyThe response body, decoded as JSON.An error is thrown if the body is invalid JSON-encoded data or if there was no body. <src>fetchResponse.bodyText⇒ stringread-onlyThe response body as a UTF-8 encoded string, or the empty string (i.e. \"\") if there was no body.An error is thrown if the body is invalid UTF-8 data. <src>fetchResponse.headers⇒ Record< string, string >read-onlyThe response headers. All keys are lower-case. <src>fetchResponse.request⇒ null | FetchRequestread-onlyThe request made for this response. <src>fetchResponse.statusCode⇒ numberread-onlyThe response status code. <src>fetchResponse.statusMessage⇒ stringread-onlyThe response status message.CREATING INSTANCES <src>new FetchResponse(statusCode: number, , < Record< string, string > >, | Uint8Array, request?: FetchRequest)METHODS <src>fetchResponse.assertOk()⇒ voidThrows a SERVER_ERROR if this response is not ok. <src>fetchResponse.getHeader(key: string)⇒ stringGet the header value for key, ignoring case. <src>fetchResponse.hasBody()⇒ booleanReturns true if the response has a body. <src>fetchResponse.makeServerError(message?: string, error?: Error)⇒ FetchResponseReturn a Response with matching headers and body, but with an error status code (i.e. 599) and message with an optional error. <src>fetchResponse.ok()⇒ booleanReturns true if this response was a success statusCode. <src>fetchResponse.throwThrottleError(message?: string, stall?: number)⇒ neverIf called within a request.processFunc call, causes the request to retry as if throttled for stall milliseconds. <src>fetchResponse.toString()⇒ string← EventsFixed-Point Maths→The content of this site is licensed under the Creative Commons License. Generated on April 9, 2026,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.158Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":2492}}28{"id":"doc-https_docs_ethers_org_v6_api_utils_errors-0198ba36","source":"documentation","title":"https://docs.ethers.org/v6/api/utils/errors/","url":"https://docs.ethers.org/v6/api/utils/errors/","text":"Documentation »API »Utilities »Errors ErrorsAll errors in ethers include properties to ensure they are both human-readable (i.e. The related transaction that caused the error. <src>CodedEthersError⇒ TODO(A1Bconditional(@TODO-000))A conditional type that transforms the ErrorCode T into its EthersError type. <src>ErrorCode⇒ \"UNKNOWN_ERROR\" | \"NOT_IMPLEMENTED\" | \"UNSUPPORTED_OPERATION\" | \"NETWORK_ERROR\" | \"SERVER_ERROR\" | \"TIMEOUT\" | \"BAD_DATA\" | \"CANCELLED\" | \"BUFFER_OVERRUN\" | \"NUMERIC_FAULT\" | \"INVALID_ARGUMENT\" | \"MISSING_ARGUMENT\" | \"UNEXPECTED_ARGUMENT\" | \"VALUE_MISMATCH\" | \"CALL_EXCEPTION\" | \"INSUFFICIENT_FUNDS\" | \"NONCE_EXPIRED\" | \"REPLACEMENT_UNDERPRICED\" | \"TRANSACTION_REPLACED\" | \"UNCONFIGURED_NAME\" | \"OFFCHAIN_FAULT\" | \"ACTION_REJECTED\"All errors emitted by ethers have an ErrorCode to help identify and coalesce errors to simplify programmatic analysis.Each ErrorCode is the code proerty of a coresponding EthersError.Generic Errors\"UNKNOWN_ERROR\" - see UnknownError\"NOT_IMPLEMENTED\" - see NotImplementedError\"UNSUPPORTED_OPERATION\" - see UnsupportedOperationError\"NETWORK_ERROR\" - see NetworkError\"SERVER_ERROR\" - see ServerError\"TIMEOUT\" - see TimeoutError\"BAD_DATA\" - see BadDataError\"CANCELLED\" - see CancelledErrorOperational Errors\"BUFFER_OVERRUN\" - see BufferOverrunError\"NUMERIC_FAULT\" - see NumericFaultErrorArgument Errors\"INVALID_ARGUMENT\" - see InvalidArgumentError\"MISSING_ARGUMENT\" - see MissingArgumentError\"UNEXPECTED_ARGUMENT\" - see UnexpectedArgumentError\"VALUE_MISMATCH\" - unusedBlockchain Errors\"CALL_EXCEPTION\" - see CallExceptionError\"INSUFFICIENT_FUNDS\" - see InsufficientFundsError\"NONCE_EXPIRED\" - see NonceExpiredError\"REPLACEMENT_UNDERPRICED\" - see ReplacementUnderpricedError\"TRANSACTION_REPLACED\" - see TransactionReplacedError\"UNCONFIGURED_NAME\" - see UnconfiguredNameError\"OFFCHAIN_FAULT\" - see OffchainFaultErrorUser Interaction Errors\"ACTION_REJECTED\" - see ActionRejectedError <src>ErrorInfo⇒ Omit< T, \"code\" | \"name\" | \"message\" | \"shortMessage\" > & { shortMessage?: string }An error may contain additional properties, but those must not conflict with any implicit properties.FUNCTIONS <src>assert(check: unknown, , , info?: ErrorInfo < T >)⇒ booleanThrows an EthersError with message, code and additional error info when check is falsish.. <src>assertArgument(check: unknown, , , )⇒ booleanA simple helper to simply ensuring provided arguments match expected constraints, throwing if not.In TypeScript environments, the check has been asserted true, so any further code does not need additional compile-time checks. <src>assertArgumentCount(count: number, , message?: string)⇒ void <src>assertNormalize(form: string)⇒ voidThrows if the normalization form is not supported. <src>assertPrivate(givenGuard: any, , className?: string)⇒ voidMany classes use file-scoped values to guard the constructor, making it effectively private. This facilitates that pattern by ensuring the givenGaurd matches the file-scoped guard, throwing if not, indicating the className if provided. <src>isCallException(error: any)⇒ booleanReturns true if error is a [[CallExceptionError]. <src>isError(error: any, )⇒ booleanReturns true if the error matches an error thrown by ethers that matches the error code.In TypeScript environments, this can be used to check that error matches an EthersError type, which means the expected properties will be set.try { // code.... } catch (e) { if (isError(e, \"CALL_EXCEPTION\")) { // The Type Guard has validated this object console.log(e.data); } } <src>makeError(message: string, , info?: ErrorInfo < T >)⇒ TReturns a new Error configured to the format ethers emits errors, with the message, [[api:ErrorCode]] code and additional properties for the corresponding EthersError.Each error in ethers includes the version of ethers, a machine-readable ErrorCode, and depending on code, additional required properties. The error message will also include the message, ethers version, code and all additional properties, serialized. interface ActionRejectedErrorinherits from EthersErrorThis Error indicates a request was rejected by the user.In most clients (such as MetaMask), when an operation requires user authorization (such as signer.sendTransaction), the client presents a dialog box to the user. If the user denies the request this error is thrown.PROPERTIES <src>actionRejectedError.action⇒ \"requestAccess\" | \"sendTransaction\" | \"signMessage\" | \"signTransaction\" | \"signTypedData\" | \"unknown\"The requested action. <src>actionRejectedError.reason⇒ \"expired\" | \"rejected\" | \"pending\"The reason the action was rejected.If there is already a pending request, some clients may indicate there is already a \"pending\" action. This prevents an app from spamming the user. interface BadDataErrorinherits from EthersErrorThis Error indicates that a provided set of data cannot be correctly interpreted.PROPERTIES <src>badDataError.value⇒ anyThe data. interface BufferOverrunErrorinherits from EthersErrorThis Error indicates an attempt was made to read outside the bounds of protected data.Most operations in Ethers are protected by bounds checks, to mitigate exploits when parsing data.PROPERTIES <src>bufferOverrunError.buffer⇒ Uint8ArrayThe buffer that was overrun. <src>bufferOverrunError.length⇒ numberThe length of the buffer. <src>bufferOverrunError.offset⇒ numberThe offset that was requested. interface CallExceptionErrorinherits from EthersErrorThis Error indicates a transaction reverted.PROPERTIES <src>callExceptionError.action⇒ CallExceptionActionThe action being performed when the revert was encountered. <src>callExceptionError.data⇒ null | stringThe revert data returned. <src>callExceptionError.invocation⇒ null | { < any > , , }The contract invocation details, if available. <src>callExceptionError.reason⇒ null | stringA human-readable representation of data, if possible. <src>callExceptionError.receipt⇒ TransactionReceiptIf the error occurred in a transaction that was mined (with a status of 0), this is the receipt. <src>callExceptionError.revert⇒ null | { < any > , , }The built-in or custom revert error, if available <src>callExceptionError.transaction⇒ CallExceptionTransactionThe transaction that triggered the exception. interface CancelledErrorinherits from EthersErrorThis Error indicates that the operation was cancelled by a programmatic call, for example to cancel(). interface EthersErrorAll errors in Ethers include properties to assist in machine-readable errors.PROPERTIES <src>ethersError.code⇒ ErrorCodeThe string error code. <src>ethersError.error⇒ ErrorAny related error. <src>ethersError.info⇒ Record< string, any >Additional info regarding the error that may be useful.This is generally helpful mostly for human-based debugging. <src>ethersError.shortMessage⇒ stringA short message describing the error, with minimal additional details. interface InsufficientFundsErrorinherits from EthersErrorThe sending account has insufficient funds to cover the entire transaction cost.PROPERTIES <src>insufficientFundsError.transaction⇒ TransactionRequestThe transaction. interface InvalidArgumentErrorinherits from EthersErrorThis Error indicates an incorrect type or value was passed to a function or method.PROPERTIES <src>invalidArgumentError.argument⇒ stringThe name of the argument. <src>invalidArgumentError.info⇒ Record< string, any > <src>invalidArgumentError.value⇒ anyThe value that was provided. interface MissingArgumentErrorinherits from EthersErrorThis Error indicates there were too few arguments were provided.PROPERTIES <src>missingArgumentError.count⇒ numberThe number of arguments received. <src>missingArgumentError.expectedCount⇒ numberThe number of arguments expected. interface NetworkErrorinherits from EthersErrorThis Error indicates a problem connecting to a network.PROPERTIES <src>networkError.event⇒ stringThe network event. interface NonceExpiredErrorinherits from EthersErrorThe sending account has already used this nonce in a transaction that has been included.PROPERTIES <src>nonceExpiredError.transaction⇒ TransactionRequestThe transaction. interface NotImplementedErrorinherits from EthersErrorThis Error is mostly used as a stub for functionality that is intended for the future, but is currently not implemented.PROPERTIES <src>notImplementedError.operation⇒ stringThe attempted operation. interface NumericFaultErrorinherits from EthersErrorThis Error indicates an operation which would result in incorrect arithmetic output has occurred.For example, trying to divide by zero or using a uint8 to store a negative value.PROPERTIES <src>numericFaultError.fault⇒ stringThe fault reported. <src>numericFaultError.operation⇒ stringThe attempted operation. <src>numericFaultError.value⇒ anyThe value the operation was attempted against. interface OffchainFaultErrorinherits from EthersErrorA CCIP-read exception, which cannot be recovered from or be further processed.PROPERTIES <src>offchainFaultError.reason⇒ stringThe reason the CCIP-read failed. <src>offchainFaultError.transaction⇒ TransactionRequestThe transaction. interface ReplacementUnderpricedErrorinherits from EthersErrorAn attempt was made to replace a transaction, but with an insufficient additional fee to afford evicting the old transaction from the memory pool.PROPERTIES <src>replacementUnderpricedError.transaction⇒ TransactionRequestThe transaction. interface ServerErrorinherits from EthersErrorThis Error indicates there was a problem fetching a resource from a server.PROPERTIES <src>serverError.request⇒ FetchRequest | stringThe requested resource. <src>serverError.response⇒ FetchResponseThe response received from the server, if available. interface TimeoutErrorinherits from EthersErrorThis Error indicates that the timeout duration has expired and that the operation has been implicitly cancelled.The side-effect of the operation may still occur, as this generally means a request has been sent and there has simply been no response to indicate whether it was processed or not.PROPERTIES <src>timeoutError.operation⇒ stringThe attempted operation. <src>timeoutError.reason⇒ stringThe reason. <src>timeoutError.request⇒ FetchRequestThe resource request, if available. interface TransactionReplacedErrorinherits from EthersErrorA pending transaction was replaced by another.PROPERTIES <src>transactionReplacedError.cancelled⇒ booleanIf the transaction was cancelled, such that the original effects of the transaction cannot be assured. <src>transactionReplacedError.hash⇒ stringThe hash of the replaced transaction. <src>transactionReplacedError.reason⇒ \"repriced\" | \"cancelled\" | \"replaced\"The reason the transaction was replaced. <src>transactionReplacedError.receipt⇒ TransactionReceiptThe receipt of the transaction that replace the transaction. <src>transactionReplacedError.replacement⇒ TransactionResponseThe transaction that replaced the transaction. interface UnconfiguredNameErrorinherits from EthersErrorThis Error indicates an ENS name was used, but the name has not been configured.This could indicate an ENS name is unowned or that the current address being pointed to is the ZeroAddress.PROPERTIES <src>unconfiguredNameError.value⇒ stringThe ENS name that was requested interface UnexpectedArgumentErrorinherits from EthersErrorThis Error indicates too many arguments were provided.PROPERTIES <src>unexpectedArgumentError.count⇒ numberThe number of arguments received. <src>unexpectedArgumentError.expectedCount⇒ numberThe number of arguments expected. interface UnknownErrorinherits from EthersErrorThis Error is a catch-all for when there is no way for Ethers to know what the underlying problem is. interface UnsupportedOperationErrorinherits from EthersErrorThis Error indicates that the attempted operation is not supported.This could range from a specific JSON-RPC end-point not supporting a feature to a specific configuration of an object prohibiting the operation.For example, a Wallet with no connected Provider is unable to send a transaction.PROPERTIES <src>unsupportedOperationError.operation⇒ stringThe attempted operation.← UtilitiesEvents→The content of this site is licensed under the Creative Commons License. Generated on May 26, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.163Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":3049}}29{"id":"doc-https_docs_ethers_org_v6_api_utils_fixed_point_m-1f1b700f","source":"documentation","title":"https://docs.ethers.org/v6/api/utils/fixed-point-math/","url":"https://docs.ethers.org/v6/api/utils/fixed-point-math/","text":"Documentation »API »Utilities »Fixed-Point Maths Fixed-Point MathsThe FixedNumber class permits using values with decimal places, using fixed-pont math.Fixed-point math is still based on integers under-the-hood, but uses an internal offset to store fractional components below, and each operation corrects for this after each operation.TYPES <src>FixedFormat⇒ number | string | { decimals?: number , signed?: boolean , width?: number }A description of a fixed-point arithmetic field.When specifying the fixed format, the values override the default of a fixed128x18, which implies a signed 128-bit value with 18 decimals of precision.The alias fixed and ufixed can be used for fixed128x18 and ufixed128x18 respectively.When a fixed format string begins with a u, it indicates the field is unsigned, so any negative values will overflow. The first number indicates the bit-width and the second number indicates the decimal precision.When a number is used for a fixed format, it indicates the number of decimal places, and the default width and signed-ness will be used.The bit-width must be byte aligned and the decimals can be at most 80. class FixedNumberA FixedNumber represents a value over its FixedFormat arithmetic field.A FixedNumber can be used to perform math, losslessly, on values which have decmial places.A FixedNumber has a fixed bit-width to store values in, and stores all values internally by multiplying the value by 10 raised to the power of decimals.If operations are performed that cause a value to grow too high (close to positive infinity) or too low (close to negative infinity), the value is said to overflow.For example, an 8-bit signed value, with 0 decimals may only be within the range -128 to 127; so -128 - 1 will overflow and become 127. Likewise, 127 + 1 will overflow and become -127.Many operation have a normal and unsafe variant. The normal variant will throw a NumericFaultError on any overflow, while the unsafe variant will silently allow overflow, corrupting its value value.If operations are performed that cause a value to become too small (close to zero), the value loses precison and is said to underflow.For example, a value with 1 decimal place may store a number as small as 0.1, but the value of 0.1 / 2 is 0.05, which cannot fit into 1 decimal place, so underflow occurs which means precision is lost and the value becomes 0.Some operations have a normal and signalling variant. The normal variant will silently ignore underflow, while the signalling variant will thow a NumericFaultError on underflow.PROPERTIES <src>fixedNumber.decimals⇒ numberread-onlyThe number of decimal places in the fixed-point arithment field. <src>fixedNumber.format⇒ stringread-onlyThe specific fixed-point arithmetic field for this value. <src>fixedNumber.signed⇒ booleanread-onlyIf true, negative values are permitted, otherwise only positive values and zero are allowed. <src>fixedNumber.value⇒ bigintread-onlyThe value as an integer, based on the smallest unit the decimals allow. <src>fixedNumber.width⇒ numberread-onlyThe number of bits available to store the value.CREATING INSTANCES <src>FixedNumber.fromBytes(value: BytesLike, format?: FixedFormat)⇒ FixedNumberCreates a new FixedNumber with the big-endian representation value with format.This will throw a NumericFaultError if value cannot fit in format due to overflow. <src>FixedNumber.fromString(value: string, format?: FixedFormat)⇒ FixedNumberCreates a new FixedNumber for value with format.This will throw a NumericFaultError if value cannot fit in format, either due to overflow or underflow (precision loss). <src>FixedNumber.fromValue(value: BigNumberish, decimals?: Numeric, format?: FixedFormat)⇒ FixedNumberCreates a new FixedNumber for value divided by decimal places with format.This will throw a NumericFaultError if value (once adjusted for decimals) cannot fit in format, either due to overflow or underflow (precision loss).METHODS <src>fixedNumber.add(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of this added to other. A NumericFaultError is thrown if overflow occurs. <src>fixedNumber.addUnsafe(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of this added to other, ignoring overflow. <src>fixedNumber.ceiling()⇒ FixedNumberReturns a new FixedNumber which is the smallest integer that is greater than or equal to this.The decimal component of the result will always be 0. <src>fixedNumber.cmp(other: FixedNumber)⇒ numberReturns a comparison result between this and other.This is suitable for use in sorting, where -1 implies this is smaller, 1 implies this is larger and 0 implies both are equal. <src>fixedNumber.div(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of this divided by other, ignoring underflow (precision loss). A NumericFaultError is thrown if overflow occurs. <src>fixedNumber.divSignal(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of this divided by other. A NumericFaultError is thrown if underflow (precision loss) occurs. <src>fixedNumber.divUnsafe(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of this divided by other, ignoring underflow (precision loss). A NumericFaultError is thrown if overflow occurs. <src>fixedNumber.eq(other: FixedNumber)⇒ booleanReturns true if other is equal to this. <src>fixedNumber.floor()⇒ FixedNumberReturns a new FixedNumber which is the largest integer that is less than or equal to this.The decimal component of the result will always be 0. <src>fixedNumber.gt(other: FixedNumber)⇒ booleanReturns true if other is greater than to this. <src>fixedNumber.gte(other: FixedNumber)⇒ booleanReturns true if other is greater than or equal to this. <src>fixedNumber.isNegative()⇒ booleanReturns true if this is less than 0. <src>fixedNumber.isZero()⇒ booleanReturns true if this is equal to 0. <src>fixedNumber.lt(other: FixedNumber)⇒ booleanReturns true if other is less than to this. <src>fixedNumber.lte(other: FixedNumber)⇒ booleanReturns true if other is less than or equal to this. <src>fixedNumber.mul(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of this multiplied by other. A NumericFaultError is thrown if overflow occurs. <src>fixedNumber.mulSignal(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of this multiplied by other. A NumericFaultError is thrown if overflow occurs or if underflow (precision loss) occurs. <src>fixedNumber.mulUnsafe(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of this multiplied by other, ignoring overflow and underflow (precision loss). <src>fixedNumber.round(decimals?: number)⇒ FixedNumberReturns a new FixedNumber with the decimal component rounded up on ties at decimals places. <src>fixedNumber.sub(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of other subtracted from this. A NumericFaultError is thrown if overflow occurs. <src>fixedNumber.subUnsafe(other: FixedNumber)⇒ FixedNumberReturns a new FixedNumber with the result of other subtracted from this, ignoring overflow. <src>fixedNumber.toFormat(format: FixedFormat)⇒ FixedNumberReturn a new FixedNumber with the same value but has had its field set to format.This will throw if the value cannot fit into format. <src>fixedNumber.toString()⇒ stringReturns the string representation of this. <src>fixedNumber.toUnsafeFloat()⇒ numberReturns a float approximation.Due to IEEE 754 precission (or lack thereof), this function can only return an approximation and most values will contain rounding errors.← Fetching Web ContentWallets→The content of this site is licensed under the Creative Commons License. Generated on January 14, 2025,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.167Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":1941}}30{"id":"doc-https_docs_ethers_org_v6_api_abi_abi_coder-30afdbc2","source":"documentation","title":"https://docs.ethers.org/v6/api/abi/abi-coder/","url":"https://docs.ethers.org/v6/api/abi/abi-coder/","text":"Documentation »API »ABI »ABI Encoding ABI EncodingWhen sending values to or receiving values from a Contract, the data is generally encoded using the ABI standard.The AbiCoder provides a utility to encode values to ABI data and decode values from ABI data.Most of the time, developers should favour the Contract class, which further abstracts a lot of the finer details of ABI data. class AbiCoderThe AbiCoder is a low-level class responsible for encoding JavaScript values into binary data and decoding binary data into JavaScript values.CREATING INSTANCES <src>AbiCoder.defaultAbiCoder()⇒ AbiCoderReturns the shared singleton instance of a default AbiCoder.On the first call, the instance is created internally.METHODS <src>abiCoder.decode(types: ReadonlyArray< string | ParamType >, , loose?: boolean)⇒ ResultDecode the ABI data as the types into values.If loose decoding is enabled, then strict padding is not enforced. Some older versions of Solidity incorrectly padded event data emitted from external functions. <src>abiCoder.encode(types: ReadonlyArray< string | ParamType >, < any >)⇒ DataHexstringEncode the values as the types into ABI data. <src>abiCoder.getDefaultValue(types: ReadonlyArray< string | ParamType >)⇒ ResultGet the default values for the given types.For example, a uint is by default 0 and bool is by default false.STATIC METHODS <src>AbiCoder._setDefaultMaxInflation(value: number)⇒ void <src>AbiCoder.getBuiltinCallException(action: CallExceptionAction, tx: { data?: string , from?: null | string , to?: null | string }, | BytesLike)⇒ CallExceptionErrorReturns an ethers-compatible CallExceptionError Error for the given result data for the CallExceptionAction action against the Transaction tx. FragmentsA fragment is a single item from an ABI, which may represent any Events Constructors Custom Errors Fallback or Receive functions TYPES <src>FormatType⇒ \"sighash\" | \"minimal\" | \"full\" | \"json\"The format to serialize the output as.\"sighash\" - the bare formatting, used to compute the selector or topic hash; this format cannot be reversed (as it discards indexed) so cannot by used to export an Interface.\"minimal\" - Human-Readable ABI with minimal spacing and without names, so it is compact, but will result in Result objects that cannot be accessed by name.\"full\" - Full Human-Readable ABI, with readable spacing and names intact; this is generally the recommended format.\"json\" - The JSON ABI format. <src>FragmentType⇒ \"constructor\" | \"error\" | \"event\" | \"fallback\" | \"function\" | \"struct\"The type of a Fragment. <src>ParamTypeWalkAsyncFunc⇒ (type: string, ) => any | Promise< any >When walking asynchronously a ParamType, this is called on each component. <src>ParamTypeWalkFunc⇒ (type: string, ) => anyWhen walking a ParamType, this is called on each component. class ConstructorFragmentinherits from FragmentA Fragment which represents a constructor.PROPERTIES <src>constructorFragment.gas⇒ null | bigintread-onlyThe recommended gas limit for deployment or null. <src>constructorFragment.payable⇒ booleanread-onlyWhether the constructor can receive an endowment.CREATING INSTANCES <src>ConstructorFragment.from(obj: any)⇒ ConstructorFragmentReturns a new ConstructorFragment for obj.METHODS <src>constructorFragment.format(format?: FormatType)⇒ stringReturns a string representation of this constructor as format.STATIC METHODS <src>ConstructorFragment.isFragment(value: any)⇒ booleanReturns true and provides a type guard if value is a ConstructorFragment. class ErrorFragmentinherits from NamedFragment, FragmentA Fragment which represents a Custom Error.PROPERTIES <src>errorFragment.selector⇒ stringread-onlyThe Custom Error selector.CREATING INSTANCES <src>ErrorFragment.from(obj: any)⇒ ErrorFragmentReturns a new ErrorFragment for obj.METHODS <src>errorFragment.format(format?: FormatType)⇒ stringReturns a string representation of this fragment as format.STATIC METHODS <src>ErrorFragment.isFragment(value: any)⇒ booleanReturns true and provides a type guard if value is an ErrorFragment. class EventFragmentinherits from NamedFragment, FragmentA Fragment which represents an Event.PROPERTIES <src>eventFragment.anonymous⇒ booleanread-onlyWhether this event is anonymous. <src>eventFragment.topicHash⇒ stringread-onlyThe Event topic hash.CREATING INSTANCES <src>EventFragment.from(obj: any)⇒ EventFragmentReturns a new EventFragment for obj.METHODS <src>eventFragment.format(format?: FormatType)⇒ stringReturns a string representation of this event as format.STATIC METHODS <src>EventFragment.getTopicHash(name: string, params?: Array< any >)⇒ stringReturn the topic hash for an event with name and params. <src>EventFragment.isFragment(value: any)⇒ booleanReturns true and provides a type guard if value is an EventFragment. class FallbackFragmentinherits from FragmentA Fragment which represents a method.PROPERTIES <src>fallbackFragment.payable⇒ booleanread-onlyIf the function can be sent value during invocation.CREATING INSTANCES <src>new FallbackFragment(guard: any, < ParamType >, ) <src>FallbackFragment.from(obj: any)⇒ FallbackFragmentReturns a new FallbackFragment for obj.METHODS <src>fallbackFragment.format(format?: FormatType)⇒ stringReturns a string representation of this fallback as format.STATIC METHODS <src>FallbackFragment.isFragment(value: any)⇒ booleanReturns true and provides a type guard if value is a FallbackFragment. abstract class FragmentAn abstract class to represent An individual fragment from a parse ABI.PROPERTIES <src>fragment.inputs⇒ ReadonlyArray< ParamType >read-onlyThe inputs for the fragment. <src>fragment.type⇒ FragmentTyperead-onlyThe type of the fragment.CREATING INSTANCES <src>Fragment.from(obj: any)⇒ FragmentCreates a new Fragment for obj, wich can be any supported ABI frgament type.METHODS <src>fragment.format(format?: FormatType)⇒ stringabstractReturns a string representation of this fragment as format.STATIC METHODS <src>Fragment.isConstructor(value: any)⇒ booleanReturns true if value is a ConstructorFragment. <src>Fragment.isError(value: any)⇒ booleanReturns true if value is an ErrorFragment. <src>Fragment.isEvent(value: any)⇒ booleanReturns true if value is an EventFragment. <src>Fragment.isFunction(value: any)⇒ booleanReturns true if value is a FunctionFragment. <src>Fragment.isStruct(value: any)⇒ booleanReturns true if value is a StructFragment. class FunctionFragmentinherits from NamedFragment, FragmentA Fragment which represents a method.PROPERTIES <src>functionFragment.constant⇒ booleanread-onlyIf the function is constant (e.g. pure or view functions). <src>functionFragment.gas⇒ null | bigintread-onlyThe recommended gas limit to send when calling this function. <src>functionFragment.outputs⇒ ReadonlyArray< ParamType >read-onlyThe returned types for the result of calling this function. <src>functionFragment.payable⇒ booleanread-onlyIf the function can be sent value during invocation. <src>functionFragment.selector⇒ stringread-onlyThe Function selector. <src>functionFragment.stateMutability⇒ \"payable\" | \"nonpayable\" | \"view\" | \"pure\"read-onlyThe state mutability (e.g. payable, nonpayable, view or pure)CREATING INSTANCES <src>FunctionFragment.from(obj: any)⇒ FunctionFragmentReturns a new FunctionFragment for obj.METHODS <src>functionFragment.format(format?: FormatType)⇒ stringReturns a string representation of this function as format.STATIC METHODS <src>FunctionFragment.getSelector(name: string, params?: Array< any >)⇒ stringReturn the selector for a function with name and params. <src>FunctionFragment.isFragment(value: any)⇒ booleanReturns true and provides a type guard if value is a FunctionFragment. interface JsonFragmentA fragment for a method, event or error in a JSON ABI format.PROPERTIES <src>jsonFragment.anonymous⇒ booleanread-onlyIf the event is anonymous. <src>jsonFragment.constant⇒ booleanread-onlyIf the function is constant. <src>jsonFragment.gas⇒ stringread-onlyThe gas limit to use when sending a transaction for this function. <src>jsonFragment.inputs⇒ ReadonlyArray< JsonFragmentType >read-onlyThe input parameters. <src>jsonFragment.name⇒ stringread-onlyThe name of the error, event, function, etc. <src>jsonFragment.outputs⇒ ReadonlyArray< JsonFragmentType >read-onlyThe output parameters. <src>jsonFragment.payable⇒ booleanread-onlyIf the function is payable. <src>jsonFragment.stateMutability⇒ stringread-onlyThe mutability state of the function. <src>jsonFragment.type⇒ stringread-onlyThe type of the fragment (e.g. event, \"function\", etc.) interface JsonFragmentTypeA Type description in a JSON ABI format.PROPERTIES <src>jsonFragmentType.components⇒ ReadonlyArray< JsonFragmentType >read-onlyThe components for a tuple. <src>jsonFragmentType.indexed⇒ booleanread-onlyIf the parameter is indexed. <src>jsonFragmentType.internalType⇒ stringread-onlyThe internal Solidity type. <src>jsonFragmentType.name⇒ stringread-onlyThe parameter name. <src>jsonFragmentType.type⇒ stringread-onlyThe type of the parameter. abstract class NamedFragmentinherits from FragmentAn abstract class to represent An individual fragment which has a name from a parse ABI.PROPERTIES <src>namedFragment.name⇒ stringread-onlyThe name of the fragment. class ParamTypeEach input and output of a Fragment is an Array of ParamType.PROPERTIES <src>paramType.arrayChildren⇒ null | ParamTyperead-onlyThe type of each child in the array.For non-array types this is null. <src>paramType.arrayLength⇒ null | numberread-onlyThe array length, or -1 for dynamic-lengthed arrays.For non-array types this is null. <src>paramType.baseType⇒ stringread-onlyThe base type (e.g. \"address\", \"tuple\", \"array\") <src>paramType.components⇒ null | ReadonlyArray< ParamType >read-onlyThe components for the tuple.For non-tuple types this is null. <src>paramType.indexed⇒ null | booleanread-onlyTrue if the parameters is indexed.For non-indexable types this is null. <src>paramType.name⇒ stringread-onlyThe local name of the parameter (or \"\" if unbound) <src>paramType.type⇒ stringread-onlyThe fully qualified type (e.g. \"address\", \"tuple(address)\", \"uint256[3][]\")CREATING INSTANCES <src>ParamType.from(obj: any, allowIndexed?: boolean)⇒ ParamTypeCreates a new ParamType for obj.If allowIndexed then the indexed keyword is permitted, otherwise the indexed keyword will throw an error.METHODS <src>paramType.format(format?: FormatType)⇒ stringReturn a string representation of this type.For example,sighash\" => \"(uint256,address)\"\"minimal\" => \"tuple(uint256,address) indexed\"\"full\" => \"tuple(uint256 foo, address bar) indexed baz\" <src>paramType.isArray()⇒ booleanReturns true if this is an Array type.This provides a type gaurd ensuring that arrayChildren and arrayLength are non-null. <src>paramType.isIndexable()⇒ booleanReturns true if this is an Indexable type.This provides a type gaurd ensuring that indexed is non-null. <src>paramType.isTuple()⇒ booleanReturns true if this is a Tuple type.This provides a type gaurd ensuring that components is non-null. <src>paramType.walk(value: any, )⇒ anyWalks the ParamType with value, calling process on each type, destructing the value recursively. <src>paramType.walkAsync(value: any, )⇒ Promise< any >Walks the ParamType with value, asynchronously calling process on each type, destructing the value recursively.This can be used to resolve ENS names by walking and resolving each \"address\" type.STATIC METHODS <src>ParamType.isParamType(value: any)⇒ booleanReturns true if value is a ParamType. class StructFragmentinherits from NamedFragment, FragmentA Fragment which represents a structure.CREATING INSTANCES <src>StructFragment.from(obj: any)⇒ StructFragmentReturns a new StructFragment for obj.METHODS <src>structFragment.format()⇒ stringReturns a string representation of this struct as format.STATIC METHODS <src>StructFragment.isFragment(value: any)⇒ booleanReturns true and provides a type guard if value is a StructFragment.← Application Binary InterfaceAddresses→The content of this site is licensed under the Creative Commons License. Generated on May 16, 2024,\n\n<|endofdoc|>","metadata":{"transformedAt":"2026-08-18T15:17:00.169Z","totalSectionsIncluded":1,"totalCodeBlocksIncluded":0,"totalLines":3,"estimatedTokens":3014}}31