merged master including transaction type 0 legacy constant (#1610).

This commit is contained in:
Richard Moore 2021-06-24 00:02:50 -04:00
commit 2a7ce0e72a
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
329 changed files with 3028 additions and 1398 deletions

@ -3,6 +3,24 @@ Changelog
This change log is managed by `admin/cmds/update-versions` but may be manually updated.
ethers/v5.3.1 (2021-06-10 18:28)
--------------------------------
- Fixed replacement transaction detection for JsonRpcSigner. ([#1658](https://github.com/ethers-io/ethers.js/issues/1658); [ee82e86](https://github.com/ethers-io/ethers.js/commit/ee82e86ccc439825259d20825a00050217890ad3))
- Added Matic testnet info to networks. ([#1546](https://github.com/ethers-io/ethers.js/issues/1546); [376cf3c](https://github.com/ethers-io/ethers.js/commit/376cf3cdbf6d2281331d36c5742414a425927318))
- Match Solidity identifier regex. ([#1657](https://github.com/ethers-io/ethers.js/issues/1657); [a6e128f](https://github.com/ethers-io/ethers.js/commit/a6e128f5cc566d291b722cca1734ba41aae6c548))
ethers/v5.3.0 (2021-05-31 18:41)
--------------------------------
- Added MinInt256 and MaxInt256 constants. ([#1576](https://github.com/ethers-io/ethers.js/issues/1576); [bfcd05f](https://github.com/ethers-io/ethers.js/commit/bfcd05fcbb132d456d6f22f70c8ac9cf5b1826f7))
- Version bumps for bn.js and hash.js to match elliptic and fix some build tools. ([#1478](https://github.com/ethers-io/ethers.js/issues/1478); [819b1ac](https://github.com/ethers-io/ethers.js/commit/819b1ace5c9b16e29dc354ad80e0e5b71ac63c52))
- Removed Hangul checks in shims which crashes Android. ([#1519](https://github.com/ethers-io/ethers.js/issues/1519); [4b33114](https://github.com/ethers-io/ethers.js/commit/4b331148d980e3056ceaabdcd6e50a2aa1beb40d))
- Fixed ENS namehash with leading and trailing dots. ([#1605](https://github.com/ethers-io/ethers.js/issues/1605); [7adcf3b](https://github.com/ethers-io/ethers.js/commit/7adcf3b154669d9d1a0a66d5e15dabfbf6618180))
- Fixed broken variable in template string. ([#1624](https://github.com/ethers-io/ethers.js/issues/1624), [#1626](https://github.com/ethers-io/ethers.js/issues/1626); [630656e](https://github.com/ethers-io/ethers.js/commit/630656e949a8ffd940e4b66ec93ec07cd6ec2634))
- Fixed FixedNumber rounding for non-default formats. ([#1629](https://github.com/ethers-io/ethers.js/issues/1629); [8681cd5](https://github.com/ethers-io/ethers.js/commit/8681cd59698d02d040871aa889fc6ccc8550df98))
- Update ws dependency version to fix security. ([#1633](https://github.com/ethers-io/ethers.js/issues/1633), [#1634](https://github.com/ethers-io/ethers.js/issues/1634); [470551e](https://github.com/ethers-io/ethers.js/commit/470551e4ee3f1e343a26fc0775f9d9f7489129f8))
ethers/v5.2.0 (2021-05-17 16:18)
--------------------------------

@ -78,12 +78,9 @@ override the endowment ``value``, transaction ``nonce``, ``gasLimit`` or
_code: Deploying a Contract @lang<javascript>
// <hide>
const signer = localSigner;
const ContractFactory = ethers.ContractFactory;
const bytecode = "608060405234801561001057600080fd5b5060405161012e38038061012e8339818101604052604081101561003357600080fd5b81019080805190602001909291908051906020019092919050505081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060008190555050506088806100a66000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633fa4f24514602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000805490509056fea2646970667358221220926465385af0e8706644e1ff3db7161af699dc063beaadd55405f2ccd6478d7564736f6c63430007040033";
// </hide>
//_hide: const signer = localSigner;
//_hide: const ContractFactory = ethers.ContractFactory;
//_hide: const bytecode = "608060405234801561001057600080fd5b5060405161012e38038061012e8339818101604052604081101561003357600080fd5b81019080805190602001909291908051906020019092919050505081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060008190555050506088806100a66000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633fa4f24514602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000805490509056fea2646970667358221220926465385af0e8706644e1ff3db7161af699dc063beaadd55405f2ccd6478d7564736f6c63430007040033";
// If your contract constructor requires parameters, the ABI
// must include the constructor
@ -97,25 +94,26 @@ factory = new ContractFactory(abi, bytecode, signer)
// Deploy an instance of the contract
contract = await factory.deploy("ricmoo.eth", 42);
//<hide>
//! async contract
//</hide>
// The address is available immediately, but the contract
// is NOT deployed yet
//_result:
contract.address
//!
//_log:
// The transaction that the signer sent to deploy
//_result:
contract.deployTransaction
//!
//_log:
// Wait until the transaction is mined (i.e. contract is deployed)
// - returns the receipt
// - throws on failure (the reciept is on the error)
contract.deployTransaction.wait()
//!
//_result:
await contract.deployTransaction.wait()
//_log:
// Now the contract is safe to interact with
contract.value()
//!
//_result:
await contract.value()
//_log:

@ -5,6 +5,10 @@ to be included in the base library. The API should not be considered
stable and does not follow [[link-semver]] versioning, so applications
requiring it should specify the //exact version// needed.
These features are not available in the core ethers package, so to use them
you must install the ``@ethersproject/experimental`` package and import them
from that.
_subsection: BrainWallet @<experimental-brainwallet> @INHERIT<[[Wallet]]>
Ethers removed support for BrainWallets in v4, since they are unsafe and
@ -19,6 +23,14 @@ the generated wallet has a mnemonic.
_property: BrainWallet.generateLegacy(username, password [ , progressCallback ]) => [[experimental-brainwallet]]
Generate a brain wallet which is compatible with the ethers v3 and earlier.
_code: Importing @lang<script>
// Node
const { BrainWallet } = require("@ethersproject/experimental");
// ESM/TypeScript
import { BrainWallet } from "@ethersproject/experimental";
_subsection: EIP1193Bridge @<experimental-eip1193bridge> @INHERIT<[[link-npm-events]]>
@ -26,6 +38,14 @@ The **EIP1193Bridge** allows a normal Ethers [[Signer]] and [[Provider]] to be
exposed in as a standard [EIP-1193 Provider](link-eip-1193), which may be useful
when interacting with other libraries.
_code: Importing @lang<script>
// Node
const { Eip1193Bridge } = require("@ethersproject/experimental");
// ESM/TypeScript
import { Eip1193Bridge } from "@ethersproject/experimental";
_subsection: NonceManager @<experimental-noncemanager> @INHERIT<[[Signer]]>
@ -63,3 +83,11 @@ Bump the current transaction count (nonce) by //count//.
This may be useful in interacting with the signer outside of using
this class.
_code: Importing @lang<script>
// Node
const { NonceManager } = require("@ethersproject/experimental");
// ESM/TypeScript
import { NonceManager } from "@ethersproject/experimental";

@ -47,10 +47,8 @@ _definition: **Supported Networks**
_code: Etherscan Examples @lang<javascript>
// <hide>
const EtherscanProvider = ethers.providers.EtherscanProvider;
const apiKey = "...";
// </hide>
//_hide: const EtherscanProvider = ethers.providers.EtherscanProvider;
//_hide: const apiKey = "...";
// Connect to mainnet (homestead)
provider = new EtherscanProvider();
@ -59,12 +57,9 @@ provider = new EtherscanProvider();
provider = new EtherscanProvider("rinkeby");
provider = new EtherscanProvider(4);
const network = ethers.providers.getNetwork("rinkeby");
// <hide>
delete network._defaultProvider;
network
// </hide>
//!
network = ethers.providers.getNetwork("rinkeby");
//_hide: delete network._defaultProvider;
//_log: network
provider = new EtherscanProvider(network);
@ -119,11 +114,9 @@ _definition: **Supported Networks**
_code: INFURA Examples @lang<javascript>
// <hide>
const InfuraProvider = ethers.providers.InfuraProvider;
const projectId = "...";
const projectSecret = "...";
// </hide>
//_hide: const InfuraProvider = ethers.providers.InfuraProvider;
//_hide: const projectId = "...";
//_hide: const projectSecret = "...";
// Connect to mainnet (homestead)
provider = new InfuraProvider();
@ -144,9 +137,7 @@ provider = new InfuraProvider("homestead", {
// Connect to the INFURA WebSocket endpoints with a WebSocketProvider
provider = InfuraProvider.getWebSocketProvider()
// <hide>
provider.destroy();
// </hide>
//_hide: await provider.destroy();
_subsection: AlchemyProvider @<AlchemyProvider> @inherit<[[UrlJsonRpcProvider]]> @src<providers:class.AlchemyProvider>
@ -178,10 +169,8 @@ _definition: **Supported Networks**
_code: Alchemy Examples @lang<javascript>
// <hide>
const AlchemyProvider = ethers.providers.AlchemyProvider;
const apiKey = "...";
// </hide>
//_hide: const AlchemyProvider = ethers.providers.AlchemyProvider;
//_hide: const apiKey = "...";
// Connect to mainnet (homestead)
provider = new AlchemyProvider();
@ -196,9 +185,7 @@ provider = new AlchemyProvider("homestead", apiKey);
// Connect to the Alchemy WebSocket endpoints with a WebSocketProvider
provider = AlchemyProvider.getWebSocketProvider()
// <hide>
provider.destroy();
// </hide>
//_hide: provider.destroy();
_subsection: CloudflareProvider @<CloudflareProvider> @inherit<[[UrlJsonRpcProvider]]> @src<providers:class.CloudflareProvider>
@ -214,9 +201,7 @@ _definition: **Supported Networks**
_code: Cloudflare Examples @lang<javascript>
// <hide>
const CloudflareProvider = ethers.providers.CloudflareProvider;
// </hide>
//_hide: const CloudflareProvider = ethers.providers.CloudflareProvider;
// Connect to mainnet (homestead)
provider = new CloudflareProvider();

@ -77,9 +77,33 @@ _subsection: Networks
There are several official common Ethereum networks as well as custom
networks and other compatible projects.
Any API that accept a [[providers-Networkish]] can be passed a common name (such as
``"mainnet"`` or ``"ropsten"``) to use that network definition or may specify
custom parameters.
Any API that accept a [[providers-Networkish]] can be passed a common
name (such as ``"mainnet"`` or ``"ropsten"``) or chain ID to use that
network definition or may specify custom parameters.
_property: ethers.providers.getNetwork(aNetworkish) => [[providers-Network]]
Returns the full [[providers-Network]] for the given standard
//aNetworkish// [[providers-Networkish]].
This is useful for functions and classes which wish to accept [[providers-Networkish]]
as an input parameter.
_code: @lang<javascript>
//_hide: const getNetwork = ethers.providers.getNetwork;
// By Chain Name
//_result:
getNetwork("homestead");
//_hide: delete _._defaultProvider;
//_log:
// By Chain ID
//_result:
getNetwork(1);
//_hide: delete _._defaultProvider;
//_log:
_heading: Custom ENS Contract
@ -96,6 +120,7 @@ const network = {
ensAddress: customEnsAddress
};
_subsection: Provider Documentation
_toc:

@ -21,35 +21,41 @@ _subsection: Accounts Methods @<Provider--account-methods>
_property: provider.getBalance(address [ , blockTag = latest ]) => Promise<[[BigNumber]]> @<Provider-getBalance> @SRC<providers/base-provider>
Returns the balance of //address// as of the //blockTag// block height.
_code: @lang<javascript>
//_result:
await provider.getBalance("ricmoo.eth");
//_log:
_property: provider.getCode(address [ , blockTag = latest ]) => Promise<string<[[DataHexString]]>> @<Provider-getCode> @SRC<providers/base-provider>
Returns the contract code of //address// as of the //blockTag// block height. If there is
no contract currently deployed, the result is ``0x``.
_code: @lang<javascript>
//_result:
await provider.getCode("registrar.firefly.eth");
//_log:
_property: provider.getStorageAt(addr, pos [ , blockTag = latest ]) => Promise<string<[[DataHexString]]>> @<Provider-getStorageAt> @SRC<providers/base-provider>
Returns the ``Bytes32`` value of the position //pos// at address //addr//, as of the //blockTag//.
_code: @lang<javascript>
//_result:
await provider.getStorageAt("registrar.firefly.eth", 0)
//_log:
_property: provider.getTransactionCount(address [ , blockTag = latest ]) => Promise<number> @<Provider-getTransactionCount> @SRC<providers/base-provider>
Returns the number of transactions //address// has ever **sent**, as of //blockTag//.
This value is required to be the nonce for the next transaction from //address//
sent to the network.
_code: Account Examples @lang<javascript>
_code: @lang<javascript>
// Get the balance for an account...
provider.getBalance("ricmoo.firefly.eth");
//!
// Get the code for a contract...
provider.getCode("registrar.firefly.eth");
//!
// Get the storage value at position 0...
provider.getStorageAt("registrar.firefly.eth", 0)
//!
// Get transaction count of an account...
provider.getTransactionCount("ricmoo.firefly.eth");
//!
//_result:
await provider.getTransactionCount("ricmoo.eth");
//_log:
_subsection: Blocks Methods @<Provider--block-methods>
@ -58,17 +64,21 @@ _property: provider.getBlock(block) => Promise<[[providers-Block]]> @<Provider-
Get the //block// from the network, where the ``result.transactions`` is a list
of transaction hashes.
_code: @lang<javascript>
//_result:
await provider.getBlock(100004)
//_log:
_property: provider.getBlockWithTransactions(block) => Promise<[[providers-BlockWithTransactions]]> @<Provider-getBlockWithTransactions> @SRC<providers/base-provider>
Get the //block// from the network, where the ``result.transactions`` is
an Array of [[providers-TransactionResponse]] objects.
_code: Block Examples @lang<javascript>
_code: @lang<javascript>
provider.getBlock(100004)
//!
provider.getBlockWithTransactions(100004)
//!
//_result:
await provider.getBlockWithTransactions(100004)
//_log:
_subsection: Ethereum Naming Service (ENS) Methods @<Provider--ens-methods>
@ -90,25 +100,39 @@ _property: provider.getResolver(name) => Promise<[[EnsResolver]]>
Returns an EnsResolver instance which can be used to further inquire
about specific entries for an ENS name.
_code: @lang<javascript>
//_hide: provider = ethers.getDefaultProvider();
// See below (Resolver) for examples of using this object
const resolver = await provider.getResolver("ricmoo.eth");
//_hide: _page.resolver = resolver;
_property: provider.lookupAddress(address) => Promise<string> @<Provider-lookupAddress> @SRC<providers/base-provider>
Performs a reverse lookup of the //address// in ENS using the
//Reverse Registrar//. If the name does not exist, or the
forward lookup does not match, ``null`` is returned.
An ENS name requries additional configuration to setup a reverse
record, they are not automatically set up.
_code: @lang<javascript>
//_result:
await provider.lookupAddress("0x5555763613a12D8F3e73be831DFf8598089d3dCa");
//_log:
_property: provider.resolveName(name) => Promise<string<[Address](address)>> @<Provider-ResolveName> @SRC<providers/base-provider>
Looks up the address of //name//. If the name is not owned, or
does not have a //Resolver// configured, or the //Resolver// does
not have an address configured, ``null`` is returned.
_code: ENS Examples @lang<javascript>
_code: @lang<javascript>
// Reverse lookup of an ENS by address...
provider.lookupAddress("0x6fC21092DA55B392b045eD78F4732bff3C580e2c");
//!
// Lookup an address of an ENS name...
provider.resolveName("ricmoo.firefly.eth");
//!
//_result:
await provider.resolveName("ricmoo.eth");
//_log:
_subsection: EnsResolver @<EnsResolver>
@ -124,12 +148,51 @@ Returns a Promise which resolves to the [[link-eip-2304]] multicoin address
stored for the //coinType//. By default an Ethereum [[address]]
(``coinType = 60``) will be returned.
_code: @lang<javascript>
//_hide: const resolver = _page.resolver;
// By default, looks up the Ethereum address
// (this will match provider.resolveName)
//_result:
await resolver.getAddress();
//_log:
// Specify the coinType for other coin addresses (0 = Bitcoin)
//_result:
await resolver.getAddress(0);
//_log:
_property: resolver.getContentHash() => Promise<string>
Returns a Promise which resolves to any stored [[link-eip-1577]] content hash.
_code: @lang<javascript>
//_hide: const resolver = _page.resolver;
//_result:
await resolver.getContentHash();
//_log:
_property: resolver.getText(key) => Promise<string>
Returns a Promise which resolves to any stored [[link-eip-634]] text entry for //key//.
_code: @lang<javascript>
//_hide: const resolver = _page.resolver;
//_result:
await resolver.getText("email");
//_log:
//_result:
await resolver.getText("url");
//_log:
//_result:
await resolver.getText("com.twitter");
//_log:
_subsection: Logs Methods @<Provider--log-methods>
_property: provider.getLogs(filter) => Promise<Array<[[providers-Log]]>> @<Provider-getLogs> @SRC<providers/base-provider>
@ -145,12 +208,38 @@ _subsection: Network Status Methods @<Provider--network-methods>
_property: provider.getNetwork() => Promise<[[providers-Network]]> @<Provider-getNetwork> @SRC<providers/base-provider:method.BaseProvider.getNetwork>
Returns the [[providers-Network]] this Provider is connected to.
_code: @lang<javascript>
//_result:
await provider.getNetwork()
//_hide: _ = utils.shallowCopy(_);
//_hide: delete _._defaultProvider;
//_log:
_property: provider.getBlockNumber() => Promise<number> @<Provider-getBlockNumber> @SRC<providers/base-provider>
Returns the block number (or height) of the most recently mined block.
_code: @lang<javascript>
//_result:
await provider.getBlockNumber()
//_log:
_property: provider.getGasPrice() => Promise<[[BigNumber]]> @<Provider-getGasPrice> @SRC<providers/base-provider>
Returns a //best guess// of the [[gas-price]] to use in a transaction.
_code: @lang<javascript>
// The gas price (in wei)...
gasPrice = await provider.getGasPrice()
//_log: gasPrice
// ...often this gas price is easier to understand or
// display to the user in gwei
//_result:
utils.formatUnits(gasPrice, "gwei")
//_log:
_property: provider.ready => Promise<[[providers-Network]]> @<Provider-ready> @src<providers/base-provider>
Returns a Promise which will stall until the network has heen established,
ignoring errors due to the target node not being active yet.
@ -158,31 +247,6 @@ ignoring errors due to the target node not being active yet.
This can be used for testing or attaching scripts to wait until the node is
up and running smoothly.
_code: Network Status Examples @lang<javascript>
// The network information
provider.getNetwork()
// <hide>
//!
network = utils.shallowCopy(_)
delete network._defaultProvider
network
// </hide>
//!
// The current block number
provider.getBlockNumber()
//!
// Get the current suggested gas price (in wei)...
gasPrice = await provider.getGasPrice()
//! async gasPrice
// ...often this gas price is easier to understand or
// display to the user in gwei (giga-wei, or 1e9 wei)
utils.formatUnits(gasPrice, "gwei")
//!
_subsection: Transactions Methods @<Provider--transaction-methods>
@ -191,6 +255,18 @@ Returns the result of executing the //transaction//, using //call//. A call
does not require any ether, but cannot change any state. This is useful
for calling getters on Contracts.
_code: @lang<javascript>
//_result:
await provider.call({
// ENS public resovler address
to: "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41",
// `function addr(namehash("ricmoo.eth")) view returns (address)`
data: "0x3b3b57debf074faa138b72c65adbdcfb329847e4f2c04bde7f7dd7fcad5a52d2f395a558"
});
//_log:
_property: provider.estimateGas(transaction) => Promise<[[BigNumber]]> @<Provider-estimateGas> @SRC<providers/base-provider>
Returns an estimate of the amount of gas that would be required to submit //transaction//
to the network.
@ -199,6 +275,23 @@ An estimate may not be accurate since there could be another transaction
on the network that was not accounted for, but after being mined affected
relevant state.
_code: @lang<javascript>
//_hide: const parseEther = ethers.utils.parseEther;
//_result:
await provider.estimateGas({
// Wrapped ETH address
to: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
// `function deposit() payable`
data: "0xd0e30db0",
// 1 ether
value: parseEther("1.0")
});
//_log:
_property: provider.getTransaction(hash) => Promise<[[providers-TransactionResponse]]> @<Provider-getTransaction> @src<providers/base-provider>
Returns the transaction with //hash// or null if the transaction is unknown.
@ -207,6 +300,12 @@ pool. Various backends may have more restrictive transaction pool access (e.g.
if the gas price is too low or the transaction was only recently sent and not
yet indexed) in which case this method may also return null.
_code: @lang<javascript>
//_result:
await provider.getTransaction("0x5b73e239c55d790e3c9c3bbb84092652db01bb8dbf49ccc9e4a318470419d9a0");
//_log:
_property: provider.getTransactionReceipt(hash) => Promise<[[providers-TransactionReceipt]]> @<Provider-getTransactionReceipt> @src<providers/base-provider>
Returns the transaction receipt for //hash// or null if the transaction
has not been mined.
@ -214,11 +313,31 @@ has not been mined.
To stall until the transaction has been mined, consider the ``waitForTransaction``
method below.
_code: @lang<javascript>
//_result:
await provider.getTransactionReceipt("0x5b73e239c55d790e3c9c3bbb84092652db01bb8dbf49ccc9e4a318470419d9a0");
//_log:
_property: provider.sendTransaction(transaction) => Promise<[[providers-TransactionResponse]]> @<Provider-sendTransaction> @SRC<providers/base-provider>
Submits //transaction// to the network to be mined. The //transaction// **must** be signed,
and be valid (i.e. the nonce is correct and the account has sufficient balance to pay
for the transaction).
_code: @lang<javascript>
//_hide: const provider = localProvider;
//_hide: const wallet = new ethers.Wallet(ethers.utils.id("HelloWorld"), provider);
//_hide: const fundTx = await localSigner.sendTransaction({
//_hide: to: wallet.address,
//_hide: value: ethers.utils.parseEther("2.0")
//_hide: });
//_hide: await fundTx.wait();
//_result:
await provider.sendTransaction("0xf86e808502540be400825208948ba1f109551bd432803012645ac136ddd64dba72880de0b6b3a764000080820a96a0f0c5bcb11e5a16ab116c60a0e5837ae98ec36e7f217740076572e8183002edd2a01ed1b4411c2840b9793e8be5415a554507f1ea320069be6dcecabd7b9097dbd4");
//_log:
_property: provider.waitForTransaction(hash [ , confirms = 1 [ , timeout ] ]) => Promise<[TxReceipt](providers-TransactionReceipt)> @<Provider-waitForTransaction> @SRC<providers/base-provider>
Returns a Promise which will not resolve until //transactionHash// is mined.
@ -331,11 +450,9 @@ $Debug: each Provider may use this to emit useful debugging information
_code: Events Example @lang<javascript>
// <hide>
const txHash = utils.id("dummy-data");
const myAddress = ethers.constants.HashZero;
const myOtherAddress = ethers.constants.HashZero;
// </hide>
//_hide: const txHash = utils.id("dummy-data");
//_hide: const myAddress = ethers.constants.HashZero;
//_hide: const myOtherAddress = ethers.constants.HashZero;
provider.on("block", (blockNumber) => {
// Emitted on every block change
@ -385,10 +502,7 @@ provider.on("error", (tx) => {
// Emitted when any error occurs
});
// <hide>
// Make sure our documentation builds without waiting forever
provider.removeAllListeners()
// </hide>
//_hide: provider.removeAllListeners() /* Make sure the docs build without waiting forever */
_subsection: Inspection Methods @<Provider--inspection-methods>

@ -245,13 +245,28 @@ has been included in the chain for //confirms// blocks. If //confirms//
is 0, and the transaction has not been mined, ``null`` is returned.
If the transaction execution failed (i.e. the receipt status is ``0``),
a [CALL_EXCEPTION](errors--call-exception) Error will be rejected with
a [CALL_EXCEPTION](errors--call-exception) error will be rejected with
the following properties:
- ``error.transaction`` - the original transaction
- ``error.transactionHash`` - the hash of the transaction
- ``error.receipt`` - the actual receipt, with the status of ``0``
If the transaction is replaced by another transaction, a
[TRANSACTION_REPLACED](errors--transaction-replaced) error will be rejected
with the following properties:
- ``error.hash`` - the hash of the original transaction which was replaced
- ``error.reason`` - a string reason; one of ``"repriced"``, ``"cancelled"`` or ``"replaced"``
- ``error.cancelled`` - a boolean; a ``"repriced"`` transaction is not considered cancelled, but ``"cancelled"`` and ``"replaced"`` are
- ``error.replacement`` - the replacement transaction (a [[providers-TransactionResponse]])
- ``error.receipt`` - the receipt of the replacement transaction (a [[providers-TransactionReceipt]])
Transactions are replaced when the user uses an option in their client to
send a new transaction from the same account with the original ``nonce``.
This is usually to speed up a transaction or to cancel one, by bribing
miners with additional fees to prefer the new transaction over the original one.
_property: transactionRequest.type => null | number
The [[link-eip-2718]] type of this transaction envelope, or ``null``
@ -371,7 +386,8 @@ _code: equivalent to the AccessList example below @lang<javascript>
// Option 2:
// Array< [ Address, Array<Bytes32> ] >
[
//_hide: ;
accessList = [
[
"0x0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
[
@ -385,17 +401,11 @@ _code: equivalent to the AccessList example below @lang<javascript>
"0x0000000000000000000000000000000000000000000000000000000000000001"
]
]
]
// <hide>
;
// </hide>
];
// Option 3:
// Record<Address, Array<Bytes32>>
// <hide>
(
// </hide>
{
accessList = {
"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e": [
"0x0000000000000000000000000000000000000000000000000000000000000004",
"0x0bcad17ecf260d6506c6b97768bdc2acfb6694445d27ffd3f9c1cfbee4a9bd6d"
@ -403,10 +413,7 @@ _code: equivalent to the AccessList example below @lang<javascript>
"0x5FfC014343cd971B7eb70732021E26C35B744cc4": [
"0x0000000000000000000000000000000000000000000000000000000000000001"
]
}
// <hide>
)
// </hide>
};
_heading: AccessList @<providers-AccessList>
@ -427,7 +434,7 @@ _code: example access list
// storageKey: Array< DataHexString< 32 > >
// }
[
accessList = [
{
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
storageKeys: [
@ -441,4 +448,4 @@ _code: example access list
"0x0000000000000000000000000000000000000000000000000000000000000001"
]
}
]
];

@ -74,6 +74,12 @@ _property: signer.signMessage(message) => Promise<string<[RawSignature](signatur
This returns a Promise which resolves to the [[signature-raw]]
of //message//.
A signed message is prefixd with ``"\\x19Ethereum signed message:\\n"`` and
the length of the message, using the [hashMessage](utils-hashMessage)
method, so that it is [EIP-191](link-eip-191) compliant. If recovering
the address in Solidity, this prefix will be required to create a matching
hash.
Sub-classes **must** implement this, however they may throw if signing a
message is not supported, such as in a Contract-based Wallet or
Meta-Transaction-based Wallet.
@ -126,9 +132,7 @@ it has been used in the field a bit.
_code: Typed Data Example @lang<javascript>
// <hide>
signer = new Wallet("0x1234567890123456789012345678901234567890123456789012345678901234");
// </hide>
//_hide: signer = new Wallet("0x1234567890123456789012345678901234567890123456789012345678901234");
// All properties on a domain are optional
const domain = {
@ -164,9 +168,9 @@ const value = {
contents: 'Hello, Bob!'
};
const signature = await signer._signTypedData(domain, types, value);
//! async signature
//_result:
signature = await signer._signTypedData(domain, types, value);
//_log:
_heading: Sub-Classes @<Signer--subclassing>
@ -281,35 +285,43 @@ walletMnemonic = Wallet.fromMnemonic(mnemonic)
// ...or from a private key
walletPrivateKey = new Wallet(walletMnemonic.privateKey)
//_result:
walletMnemonic.address === walletPrivateKey.address
//!
//_log:
// The address as a Promise per the Signer API
walletMnemonic.getAddress()
//!
//_result:
await walletMnemonic.getAddress()
//_log:
// A Wallet address is also available synchronously
//_result:
walletMnemonic.address
//!
//_log:
// The internal cryptographic components
//_result:
walletMnemonic.privateKey
//!
//_log:
//_result:
walletMnemonic.publicKey
//!
//_log:
// The wallet mnemonic
//_result:
walletMnemonic.mnemonic
//!
//_log:
// Note: A wallet created with a private key does not
// have a mnemonic (the derivation prevents it)
//_result:
walletPrivateKey.mnemonic
//!
//_log:
// Signing a message
walletMnemonic.signMessage("Hello World")
//!
//_result:
await walletMnemonic.signMessage("Hello World")
//_log:
tx = {
to: "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
@ -317,24 +329,29 @@ tx = {
}
// Signing a transaction
walletMnemonic.signTransaction(tx)
//!
//_result:
await walletMnemonic.signTransaction(tx)
//_log:
// The connect method returns a new instance of the
// Wallet connected to a provider
//_result:
wallet = walletMnemonic.connect(provider)
//_null:
// Querying the network
wallet.getBalance();
//!
wallet.getTransactionCount();
//!
//_result:
await wallet.getBalance();
//_log:
//_result:
await wallet.getTransactionCount();
//_log:
// Sending ether
wallet.sendTransaction(tx)
// <hide>
//! error
// </hide>
//_hide: wallet = localSigner; /* prevent insufficient funds error from blowing up the docs */
//_result:
await wallet.sendTransaction(tx)
//_log:
@ -367,12 +384,10 @@ abi = [
]
contract = new ethers.Contract("dai.tokens.ethers.eth", abi, signer)
// <hide>
//!
// </hide>
// Get the number of tokens for this account
//_result:
tokens = await contract.balanceOf(signer.getAddress())
//! async tokens
//_log:
//
// Pre-flight (check for revert) on DAI from the signer
@ -384,12 +399,14 @@ tokens = await contract.balanceOf(signer.getAddress())
//
// This will pass since the token balance is available
contract.callStatic.transfer("donations.ethers.eth", tokens)
//!
//_result:
await contract.callStatic.transfer("donations.ethers.eth", tokens)
//_log:
// This will fail since it is greater than the token balance
contract.callStatic.transfer("donations.ethers.eth", tokens.add(1))
//! error
//_throws:
await contract.callStatic.transfer("donations.ethers.eth", tokens.add(1))
//_log:
_subsection: ExternallyOwnedAccount @<ExternallyOwnedAccount>

@ -1,11 +1,289 @@
_section: ABI Formats @<abi-formats>
@TODO: Expand this section
There are several formats available to specify an ABI for
a Smart Contract, which specifies to the under-lying library
what methods, events and errors exist so that encoding and
decoding the data from and to the network can be handled by
the library.
The supports ABI types are:
- [Human-Readable ABI](abi-formats--human-readable-abi)
- [Solidity JSON ABI](abi-formats--solidity)
- [Solidity Object ABI](abi-formats--object)
_subsection: Human-Readable ABI @<abi-formats--human-readable-abi>
See [Human-Readable Abi](link-ricmoo-humanreadableabi).
The **Human-Readable ABI** was [introduced early by ethers](link-ricmoo-humanreadableabi),
which allows for a Solidity signatures to be used to describe each
method, event and error.
It is important to note that a Solidity signature **fully describes**
all the properties the ABI requires:
- name
- type (constructor, event, function)
- inputs (types, nested structures and optionally names)
- outputs (types nested structures and optionally names)
- state mutability (for constructors and methods)
- payability (for constructors and methods)
- whether inputs are indexed (for events)
This allows for a simple format which is both machine-readalbe (since
the parser is a machine) and human-readable (at least **developer-readable**),
as well as simple for humans to type and inline into code, which improves
code readability. The Human-Readable ABI is also considerably smaller, which
helps reduce code size.
A Huamn-Readable ABI is simple an array of strings, where each string is
the Solidity signature.
Signatures may be minimally specified (i.e. names of inputs and outputs
may be omitted) or fully specified (i.e. with all property names) and
whitespace is ignored.
Several modifiers available in Solidity are dropped internally, as they
are not required for the ABI and used old by Solidity's semantic checking
system, such as input parameter data location like ``"calldata"``
and ``"memory"``. As such, they can be safely dropped in the ABI as well.
_code: Human-Readable ABI Example @lang<javascript>
const humanReadableAbi = [
// Simple types
"constructor(string symbol, string name)",
"function transferFrom(address from, address to, uint value)",
"function balanceOf(address owner) view returns (uint balance)",
"event Transfer(address indexed from, address indexed to, address value)",
"error InsufficientBalance(account owner, uint balance)",
// Some examples with the struct type, we use the tuple keyword:
// (note: the tuple keyword is optional, simply using additional
// parentheses accomplishes the same thing)
// struct Person {
// string name;
// uint16 age;
// }
"function addPerson(tuple(string name, uint16 age) person)",
"function addPeople(tuple(string name, uint16 age)[] person)",
"function getPerson(uint id) view returns (tuple(string name, uint16 age))",
"event PersonAdded(uint indexed id, tuple(string name, uint16 age) person)"
];
//_hide: _page.humanReadableAbi = humanReadableAbi;
_subsection: Solidity JSON ABI @<abi-formats--solidity>
See [Solidity compiler](link-solc-output).
The **Solidity JSON ABI** is a standard format that many tools export,
including the Solidity compiler. For the full specification, see
the [Solidity compiler documentation](link-solc-output).
Various versions include slightly different keys and values. For example,
early compilers included only a boolean ``"constant"`` to indicate mutability,
while newer versions include a string ``"mutabilityState"``, which encompasses
several older properties.
When creating an instance of a [Fragment](Fragment) using a JSON ABI, it will
automatically infer all legacy properties for new-age ABIs and for legacy
ABIs will infer the new-age properties. All properties will be populated, so
it will match the equivalent created using a Human-Readable ABI fragment.
_code: The same ABI as JSON ABI @lang<javascript>
const jsonAbi = `[
{
"type": "constructor",
"payable": false,
"inputs": [
{ "type": "string", "name": "symbol" },
{ "type": "string", "name": "name" }
]
},
{
"type": "function",
"name": "transferFrom",
"constant": false,
"payable": false,
"inputs": [
{ "type": "address", "name": "from" },
{ "type": "address", "name": "to" },
{ "type": "uint256", "name": "value" }
],
"outputs": [ ]
},
{
"type": "function",
"name": "balanceOf",
"constant":true,
"stateMutability": "view",
"payable":false, "inputs": [
{ "type": "address", "name": "owner"}
],
"outputs": [
{ "type": "uint256"}
]
},
{
"type": "event",
"anonymous": false,
"name": "Transfer",
"inputs": [
{ "type": "address", "name": "from", "indexed":true},
{ "type": "address", "name": "to", "indexed":true},
{ "type": "address", "name": "value"}
]
},
{
"type": "error",
"name": "InsufficientBalance",
"inputs": [
{ "type": "account", "name": "owner"},
{ "type": "uint256", "name": "balance"}
]
},
{
"type": "function",
"name": "addPerson",
"constant": false,
"payable": false,
"inputs": [
{
"type": "tuple",
"name": "person",
"components": [
{ "type": "string", "name": "name" },
{ "type": "uint16", "name": "age" }
]
}
],
"outputs": []
},
{
"type": "function",
"name": "addPeople",
"constant": false,
"payable": false,
"inputs": [
{
"type": "tuple[]",
"name": "person",
"components": [
{ "type": "string", "name": "name" },
{ "type": "uint16", "name": "age" }
]
}
],
"outputs": []
},
{
"type": "function",
"name": "getPerson",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [
{ "type": "uint256", "name": "id" }
],
"outputs": [
{
"type": "tuple",
"components": [
{ "type": "string", "name": "name" },
{ "type": "uint16", "name": "age" }
]
}
]
},
{
"type": "event",
"anonymous": false,
"name": "PersonAdded",
"inputs": [
{ "type": "uint256", "name": "id", "indexed": true },
{
"type": "tuple",
"name": "person",
"components": [
{ "type": "string", "name": "name", "indexed": false },
{ "type": "uint16", "name": "age", "indexed": false }
]
}
]
}
]`;
//_hide: _page.jsonAbi = jsonAbi;
_subsection: Solidity Object ABI @<abi-formats--object>
The output from parsing (using JSON.parse) a Solidity JSON ABI
is also fully compatible with the [[Interface]] class and each
method, event and error from that object are compatible with
the [[Fragment]] class.
Some developers may prefer this as it allows access to the ABI
properties as normal JavaScript objects, and closely matches the
JSON ABI that those familiar with the Solidity ABI will recognize.
_subsection: Converting Between Formats
The [[Fragment]] object makes it simple to reformat a single
method, event or error, however most developers will be interested
in converting an entire ABI.
For production code it is recommended to inline the Human-Readable
ABI as it makes it easy to see at a glance which methods, events
and errors are available. It is also highly recommend to strip out
unused parts of the ABI (such as admin methods) to further reduce
code size.
_code: Converting to Full Human-Readable ABI @lang<javascript>
//_hide: const Interface = ethers.utils.Interface;
//_hide: const FormatTypes = ethers.utils.FormatTypes;
//_hide: jsonAbi = _page.jsonAbi;
// Using the "full" format will ensure the Result objects
// have named properties, which improves code readability
const iface = new Interface(jsonAbi);
//_result:
iface.format(FormatTypes.full);
//_log:
_code: Converting to Minimal Human-Readable ABI @lang<javascript>
//_hide: const Interface = ethers.utils.Interface;
//_hide: const FormatTypes = ethers.utils.FormatTypes;
//_hide: jsonAbi = _page.jsonAbi;
// Using the "minimal" format will save a small amount of
// space, but is generally not worth it as named properties
// on Results will not be available
const iface = new Interface(jsonAbi);
//_result:
iface.format(FormatTypes.minimal);
//_log:
_code: Converting to JSON ABI @lang<javascript>
//_hide: const Interface = ethers.utils.Interface;
//_hide: const FormatTypes = ethers.utils.FormatTypes;
//_hide: humanReadableAbi = _page.humanReadableAbi;
// Sometimes you may need to export a Human-Readable ABI to
// JSON for tools that do not have Human-Readable support
// For compactness, the JSON is kept with minimal white-space
const iface = new Interface(humanReadableAbi);
//_result:
jsonAbi = iface.format(FormatTypes.json);
//_log:
// However it is easy to use JSON.parse and JSON.stringify
// with formatting parameters to assist with readability
//_result:
JSON.stringify(JSON.parse(jsonAbi), null, 2);
//_log:

@ -5,7 +5,6 @@ Explain an ABI.
_subsection: Formats
_heading: JSON String ABI (Solidity Output JSON)
The **JSON ABI Format** is the format that is
[output from the Solidity compiler](link-solc-output).
@ -15,50 +14,74 @@ of Objects, where each Object has various properties describing the [[Fragment]]
The deserialized JSON string (which is a normal JavaScript Object) may
also be passed into any function which accepts a JSON String ABI.
_heading: Humanb-Readable ABI
_heading: Humanb-Readable ABI @<human-readable-abi>
The Human-Readable ABI was introduced by ethers in [this article](link-ricmoo-humanreadableabi)
and has since gained wider adoption.
The Human-Readable ABI was @TODO
The ABI is described by using an array of strings, where each string is the
Solidity signature of the **constructor**, **function**, **event** or **error**.
[article](link-ricmoo-humanreadableabi)
When parsing a fragment, all inferred properties will be injected (e.g. a //payable//
method will have its ``constant`` proeprty set to false).
Tuples can be specified by using the ``tuple(...)`` syntax or with bare (additional)
parenthesis, ``(...)``.
_code: Example Human-Readable ABI
const ABI = [
// Constructor
"constructor(address ens)",
// Constant functions (pure or view)
"function balanceOf(address owner) view returns (uint)",
// State-mutating functions (payable or non-payable)
"function mint(uint amount) payable",
"function transfer(address to, uint amount) returns (bool)",
// Events
"event Transfer(address indexed from, address indexed to, uint amount)",
// Errors
"error InsufficientFunds(address from, uint balance)",
]
_heading: Output Formats @<fragments--output-formats> @SRC<abi/fragments:FormatTypes>
Each [[Fragment]] and [[ParamType]] may be output using its ``format``
method.
_property: ethers.utils.FragmentTypes.full => string
_property: ethers.utils.FormatTypes.full => string
This is a full human-readable string, including all parameter names, any
optional modifiers (e.g. ``indexed``, ``public``, etc) and white-space
to aid in human readability.
_property: ethers.utils.FragmentTypes.minimal => string
_property: ethers.utils.FormatTypes.minimal => string
This is similar to ``full``, except with no unnecessary whitespace or parameter
names. This is useful for storing a minimal string which can still fully
reconstruct the original Fragment using [Fragment&thinsp;.&thinsp;from](Fragment-from).
_property: ethers.utils.FragmentTypes.json => string
_property: ethers.utils.FormatTypes.json => string
This returns a JavaScript Object which is safe to call ``JSON.stringify``
on to create a JSON string.
_property: ethers.utils.FragmentTypes.sighash => string
_property: ethers.utils.FormatTypes.sighash => string
This is a minimal output format, which is used by Solidity when computing a
signature hash or an event topic hash.
_warning: Note
The ``sighash`` format is **insufficient** to re-create the original [[Fragment]],
since it discards modifiers such as indexed, anonymous, stateMutability, etc.
It is only useful for computing the selector for a Fragment, and cannot
be used to format an Interface.
_subsection: Fragment @<Fragment> @SRC<abi/fragments:class.Fragment>
An ABI is a collection of **Fragments**, where each fragment specifies:
- An [Error](ErrorFragment)
- An [Event](EventFragment)
- A [Function](FunctionFragment)
- A [Constructor](ConstructorFragment)
@ -66,12 +89,10 @@ An ABI is a collection of **Fragments**, where each fragment specifies:
_heading: Properties
_property: fragment.name => string
This is the name of the Event or Function. This will be null for
a [[ConstructorFragment]].
_property: fragment.type => string
This is a string which indicates the type of the [[Fragment]]. This
will be one of:
@ -80,19 +101,20 @@ will be one of:
- ``function``
_property: fragment.inputs => Array<[[ParamType]]>
This is an array of each [[ParamType]] for the input parameters to
the Constructor, Event of Function.
_heading: Methods
_property: ethers.utils.Fragment.from(objectOrString) => [[Fragment]] @<Fragment-from> @SRC<abi/fragments:Fragment.from>
_property: fragment.format([ format = sighash]) => string @<Fragment-format> @SRC<abi/fragments:Fragment.format>
Creates a string representation of the Fragment using the available
[output formats](fragments--output-formats).
Returns a
_property: ethers.utils.Fragment.from(objectOrString) => [[Fragment]] @<Fragment-from> @SRC<abi/fragments:Fragment.from>
Creates a new **Fragment** sub-class from any compatible //objectOrString//.
_property: ethers.utils.Fragment.isFragment(object) => boolean @<Fragment-isFragment> @SRC<abi/fragments:Fragment.isFragment>
Tra lal al
Returns true if //object// is a **Fragment**.
_subsection: ConstructorFragment @<ConstructorFragment> @INHERIT<[[Fragment]]> @SRC<abi/fragments:class.ConstructorFragment>
@ -100,17 +122,14 @@ _subsection: ConstructorFragment @<ConstructorFragment> @INHERIT<[[Fragment]]> @
_heading: Properties
_property: fragment.gas => [[BigNumber]]
This is the gas limit that should be used during deployment. It may be
null.
_property: fragment.payable => boolean
This is whether the constructor may receive ether during deployment as
an endowment (i.e. msg.value != 0).
_property: fragment.stateMutability => string
This is the state mutability of the constructor. It can be any of:
- ``nonpayable``
@ -119,12 +138,21 @@ This is the state mutability of the constructor. It can be any of:
_heading: Methods
_property: ethers.utils.ConstructorFragment.from(objectOrString) => [[ConstructorFragment]] @<ConstructorFragment-from> @SRC<abi/fragments:ConstructorFragment.from>
Tra la la...
Creates a new **ConstructorFragment** from any compatible //objectOrString//.
_property: ethers.utils.ConstructorFragment.isConstructorFragment(object) => boolean @<ConstructorFragment-isConstructorFragment> @SRC<abi/fragments:ConstructorFragment.isConstructorFragment>
Returns true if //object// is a **ConstructorFragment**.
Tra lal al
_subsection: ErrorFragment @<ErrorFragment> @INHERIT<[[Fragment]]> @SRC<abi/fragments:class.ErrorFragment>
_heading: Methods
_property: ethers.utils.ErrorFragment.from(objectOrString) => [[ErrorFragment]] @<ErrorFragment-from> @SRC<abi/fragments:ErrorFragment.from>
Creates a new **ErrorFragment** from any compatible //objectOrString//.
_property: ethers.utils.ErrorFragment.isErrorFragment(object) => boolean @<ErrorFragment-isErrorFragment> @SRC<abi/fragments:ErrorFragment.isErrorFragment>
Returns true if //object// is an **ErrorFragment**.
_subsection: EventFragment @<EventFragment> @INHERIT<[[Fragment]]> @SRC<abi/fragments:class.EventFragment>
@ -132,19 +160,16 @@ _subsection: EventFragment @<EventFragment> @INHERIT<[[Fragment]]> @SRC<abi/frag
_heading: Properties
_property: fragment.anonymous => boolean
This is whether the event is anonymous. An anonymous Event does not inject its
topic hash as topic0 when creating a log.
_heading: Methods
_property: ethers.utils.EventFragment.from(objectOrString) => [[EventFragment]] @<EventFragment-from> @SRC<abi/fragments:EventFragment.from>
Tra la la...
Creates a new **EventFragment** from any compatible //objectOrString//.
_property: ethers.utils.EventFragment.isEventFragment(object) => boolean @<EventFragment-isEventFragment> @SRC<abi/fragments:EventFragment.isEventFragment>
Tra lal al
Returns true if //object// is an **EventFragment**.
_subsection: FunctionFragment @<FunctionFragment> @INHERIT<[[ConstructorFragment]]> @SRC<abi/fragments:class.FunctionFragment>
@ -152,12 +177,10 @@ _subsection: FunctionFragment @<FunctionFragment> @INHERIT<[[ConstructorFragment
_heading: Properties
_property: fragment.constant => boolean
This is whether the function is constant (i.e. does not change state). This
is true if the state mutability is ``pure`` or ``view``.
_property: fragment.stateMutability => string
This is the state mutability of the constructor. It can be any of:
- ``nonpayable``
@ -166,22 +189,18 @@ This is the state mutability of the constructor. It can be any of:
- ``view``
_property: fragment.outputs => Array<[[ParamType]]>
A list of the Function output parameters.
_heading: Method
_heading: Methods
_property: ethers.utils.FunctionFragment.from(objectOrString) => [[FunctionFragment]] @<FunctionFragment-from> @SRC<abi/fragments:ConstructorFragment.from>
Tra la la...
Creates a new **FunctionFragment** from any compatible //objectOrString//.
_property: ethers.utils.FunctionFragment.isFunctionFragment(object) => boolean @<FunctionFragment-isFunctionFragment> @SRC<abi/fragments:FunctionFragment.isFunctionFragment>
Tra lal al
Returns true if //object// is a **FunctionFragment**.
_subsection: ParamType @<ParamType> @SRC<abi/fragments:class.ParamType>
The following examples will represent the Solidity parameter:
``string foobar``
@ -189,53 +208,42 @@ The following examples will represent the Solidity parameter:
_heading: Properties
_property: paramType.name => string @<ParamType-name>
The local parameter name. This may be null for unnamed parameters. For example,
the parameter definition ``string foobar`` would be ``foobar``.
_property: paramType.type => string @<ParamType-type>
The full type of the parameter, including tuple and array symbols. This may be null
for unnamed parameters. For the above example, this would be ``foobar``.
_property: paramType.baseType => string @<ParamType-baseType>
The base type of the parameter. For primitive types (e.g. ``address``, ``uint256``, etc)
this is equal to [type](ParamType-type). For arrays, it will be the string ``array`` and for
a tuple, it will be the string ``tuple``.
_property: paramType.indexed => boolean @<ParamType-indexed>
Whether the parameter has been marked as indexed. This **only** applies
to parameters which are part of an [[EventFragment]].
_property: paramType.arrayChildren => [[ParamType]] @<ParamType-arrayChildren>
The type of children of the array. This is null for any parameter
which is not an array.
_property: paramType.arrayLength => number @<ParamType-arrayLength>
The length of the array, or ``-1`` for dynamic-length arrays. This is
null for parameters which are not arrays.
_property: paramType.components => Array<[[ParamType]]> @<ParamType-components>
The components of a tuple. This is null for non-tuple parameters.
_heading: Methods
Tra la la...
_property: paramType.format([ outputType = sighash ])
Tra la la...
Creates a string representation of the Fragment using the available
[output formats](fragments--output-formats).
_property: ethers.utils.ParamType.from(objectOrString) => [[ParamType]] @<ParamType-from> @SRC<abi/fragments:ParamType.from>
Tra la la...
Creates a new **ParamType** from any compatible //objectOrString//.
_property: ethers.utils.ParamType.isParamType(object) => boolean @<ParamType-isParamType> @SRC<abi/fragments:ParamType.isParamType>
Tra la la...
Returns true if //object// is a **ParamType**.

@ -26,11 +26,47 @@ which is a format the Ethers created to simplify manually typing the ABI
into the source and so that a Contract ABI can also be referenced easily
within the same source file.
_code: Creating an Interface instance @lang<javascript>
//_hide: const Interface = ethers.utils.Interface;
// This interface is used for the below examples
const iface = new Interface([
// Constructor
"constructor(string symbol, string name)",
// State mutating method
"function transferFrom(address from, address to, uint amount)",
// State mutating method, which is payable
"function mint(uint amount) payable",
// Constant method (i.e. "view" or "pure")
"function balanceOf(address owner) view returns (uint)",
// An Event
"event Transfer(address indexed from, address indexed to, uint256 amount)",
// A Custom Solidity Error
"error AccountLocked(address owner, uint256 balance)",
// Examples with structured types
"function addUser(tuple(string name, address addr) user) returns (uint id)",
"function addUsers(tuple(string name, address addr)[] user) returns (uint[] id)",
"function getUser(uint id) view returns (tuple(string name, address addr) user)"
]);
//_hide: _page.iface = iface;
_subsection: Properties @<Interface--properties>
_property: interface.fragments => Array<[[Fragment]]>
All the [Fragments](Fragment) in the interface.
_property: interface.errors => Array<[[ErrorFragment]]>
All the [Error Fragments](ErrorFragment) in the interface.
_property: interface.events => Array<[[EventFragment]]>
All the [Event Fragments](EventFragment) in the interface.
@ -48,24 +84,133 @@ Return the formatted **Interface**. If the format type is ``json`` a
single string is returned, otherwise an Array of the human-readable
strings is returned.
_code: @lang<javascript>
//_hide: const iface = _page.iface;
const FormatTypes = ethers.utils.FormatTypes;
//_result:
iface.format(FormatTypes.json)
//_log:
//_result:
iface.format(FormatTypes.full)
//_log:
//_result:
iface.format(FormatTypes.minimal)
//_log:
_subsection: Fragment Access @<Interface--fragments>
_property: interface.getFunction(fragment) => [[FunctionFragment]] @SRC<abi/interface>
Returns the [[FunctionFragment]] for //fragment// (see [[Interface--specifying-fragments]]).
_code: @lang<javascript>
//_hide: const iface = _page.iface;
// By method signature, which is normalized so whitespace
// and superfluous attributes are ignored
iface.getFunction("transferFrom(address, address, uint256)");
// By name; this ONLY works if the method is non-ambiguous
iface.getFunction("transferFrom");
// By method selector
iface.getFunction("0x23b872dd");
// Throws if the method does not exist
//_throws:
iface.getFunction("doesNotExist()");
//_log:
_property: interface.getError(fragment) => [[ErrorFragment]] @SRC<abi/interface>
Returns the [[ErrorFragment]] for //fragment// (see [[Interface--specifying-fragments]]).
_code: @lang<javascript>
//_hide: const iface = _page.iface;
// By error signature, which is normalized so whitespace
// and superfluous attributes are ignored
iface.getError("AccountLocked(address, uint256)");
// By name; this ONLY works if the error is non-ambiguous
iface.getError("AccountLocked");
// By error selector
iface.getError("0xf7c3865a");
// Throws if the error does not exist
//_throws:
iface.getError("DoesNotExist()");
//_log:
_property: interface.getEvent(fragment) => [[EventFragment]] @SRC<abi/interface>
Returns the [[EventFragment]] for //fragment// (see [[Interface--specifying-fragments]]).
_code: @lang<javascript>
//_hide: const iface = _page.iface;
// By event signature, which is normalized so whitespace
// and superfluous attributes are ignored
iface.getEvent("Transfer(address, address, uint256)");
// By name; this ONLY works if the event is non-ambiguous
iface.getEvent("Transfer");
// By event topic hash
iface.getEvent("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef");
// Throws if the event does not exist
//_throws:
iface.getEvent("DoesNotExist()");
//_log:
_subsection: Signature and Topic Hashes @<Interface--selectors>
_property: interface.getSighash(fragment) => string<[[DataHexString]]<4>> @SRC<abi/interface:method.Interface.getSighash>
Return the sighash (or Function Selector) for //fragment// (see [[Interface--specifying-fragments]]).
_code: @lang<javascript>
//_hide: const iface = _page.iface;
//_result:
iface.getSighash("balanceOf");
//_log:
//_result:
iface.getSighash("balanceOf(address)");
//_log:
const fragment = iface.getFunction("balanceOf")
//_result:
iface.getSighash(fragment);
//_log:
_property: interface.getEventTopic(fragment) => string<[[DataHexString]]<32>> @SRC<abi/interface:method.Interface.getEventTopic>
Return the topic hash for //fragment// (see [[Interface--specifying-fragments]]).
_code: @lang<javascript>
//_hide: const iface = _page.iface;
//_result:
iface.getEventTopic("Transfer");
//_log:
//_result:
iface.getEventTopic("Transfer(address, address, uint)");
//_log:
const fragment = iface.getEvent("Transfer")
//_result:
iface.getEventTopic(fragment);
//_log:
_subsection: Encoding Data @<Interface--encoding>
@ -74,22 +219,103 @@ Return the encoded deployment data, which can be concatenated to the
deployment bytecode of a contract to pass //values// into the contract
constructor.
_property: interface.encodeFilterTopics(fragment [ , values ]) => Array<topic | Array<topic>> @SRC<abi/interface>
_code: @lang<javascript>
//_hide: const iface = _page.iface;
//_hide: const parseEther = ethers.utils.parseEther;
// The data that should be appended to the bytecode to pass
// parameters to the constructor during deployment
//_result:
iface.encodeDeploy([ "SYM", "Some Name" ])
//_log:
_property: interface.encodeFilterTopics(fragment, values) => Array<topic | Array<topic>> @SRC<abi/interface>
Returns the encoded topic filter, which can be passed to getLogs for //fragment//
(see [[Interface--specifying-fragments]]) for the given //values//.
Each //topic// is a 32 byte (64 nibble) [[DataHexString]].
_code: @lang<javascript>
//_hide: const iface = _page.iface;
//_hide: const parseEther = ethers.utils.parseEther;
// Filter that matches all Transfer events
//_result:
iface.encodeFilterTopics("Transfer", [])
//_log:
// Filter that matches the sender
//_result:
iface.encodeFilterTopics("Transfer", [
"0x8ba1f109551bD432803012645Ac136ddd64DBA72"
])
//_log:
// Filter that matches the receiver
//_result:
iface.encodeFilterTopics("Transfer", [
null,
"0x8ba1f109551bD432803012645Ac136ddd64DBA72"
])
//_log:
_property: interface.encodeFunctionData(fragment [ , values ]) => string<[[DataHexString]]> @SRC<abi/interface>
Returns the encoded data, which can be used as the data for a transaction for
//fragment// (see [[Interface--specifying-fragments]]) for the given //values//.
_code: @lang<javascript>
//_hide: const iface = _page.iface;
//_hide: const parseEther = ethers.utils.parseEther;
// Encoding data for the tx.data of a call or transaction
//_result:
iface.encodeFunctionData("transferFrom", [
"0x8ba1f109551bD432803012645Ac136ddd64DBA72",
"0xaB7C8803962c0f2F5BBBe3FA8bf41cd82AA1923C",
parseEther("1.0")
])
//_log:
// Encoding structured data (using positional Array)
user = [
"Richard Moore",
"0x8ba1f109551bD432803012645Ac136ddd64DBA72"
];
//_result:
iface.encodeFunctionData("addUser", [ user ]);
//_log:
// Encoding structured data, using objects. Only available
// if paramters are named.
user = {
name: "Richard Moore",
addr: "0x8ba1f109551bD432803012645Ac136ddd64DBA72"
};
//_result:
iface.encodeFunctionData("addUser", [ user ]);
//_log:
_property: interface.encodeFunctionResult(fragment [ , values ]) => string<[[DataHexString]]> @SRC<abi/interface>
Returns the encoded result, which would normally be the response from a call for
//fragment// (see [[Interface--specifying-fragments]]) for the given //values//.
Most developers will not need this method, but may be useful for authors of a mock blockchain.
_code: @lang<javascript>
//_hide: const iface = _page.iface;
//_hide: const parseEther = ethers.utils.parseEther;
// Encoding result data (like is returned by eth_call)
//_result:
iface.encodeFunctionResult("balanceOf", [
"0x8ba1f109551bD432803012645Ac136ddd64DBA72"
])
//_log:
_subsection: Decoding Data @<Interface--decoding>
@ -100,6 +326,26 @@ with the optional //topics//.
If //topics// is not specified, placeholders will be inserted into the result.
Most develoeprs will find the [parsing methods](Interface--parsing) more
convenient for decoding event data, as they will automatically detect the
matching event.
_code: @lang<javascript>
//_hide: const iface = _page.iface;
// Decoding log data and topics (the entries in a receipt)
const data = "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000";
const topics = [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000008ba1f109551bd432803012645ac136ddd64dba72",
"0x000000000000000000000000ab7c8803962c0f2f5bbbe3fa8bf41cd82aa1923c"
];
//_result:
iface.decodeEventLog("Transfer", data, topics);
//_log:
_property: interface.decodeFunctionData(fragment, data) => [[Result]] @SRC<abi/interface>
Returns the decoded values from transaction data for
//fragment// (see [[Interface--specifying-fragments]]) for the given //data//.
@ -107,11 +353,62 @@ Returns the decoded values from transaction data for
Most developers will not need this method, but may be useful for debugging
or inspecting transactions.
Most develoeprs will also find the [parsing methods](Interface--parsing) more
convenient for decoding transation data, as they will automatically detect the
matching function.
_code: @lang<javascript>
//_hide: const iface = _page.iface;
// Decoding function data (the value of tx.data)
const txData = "0x23b872dd0000000000000000000000008ba1f109551bd432803012645ac136ddd64dba72000000000000000000000000ab7c8803962c0f2f5bbbe3fa8bf41cd82aa1923c0000000000000000000000000000000000000000000000000de0b6b3a7640000";
//_result:
iface.decodeFunctionData("transferFrom", txData);
//_log:
_property: interface.decodeFunctionResult(fragment, data) => [[Result]] @SRC<abi/interface>
Returns the decoded values from the result of a call for
//fragment// (see [[Interface--specifying-fragments]]) for the given //data//.
_code: @lang<javascript>
//_hide: const iface = _page.iface;
// Decoding result data (e.g. from an eth_call)
resultData = "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000";
//_result:
iface.decodeFunctionResult("balanceOf", resultData)
//_log:
// Decoding result data which was caused by a revert
// Throws a CALL_EXCEPTION, with extra details
errorData = "0xf7c3865a0000000000000000000000008ba1f109551bd432803012645ac136ddd64dba720000000000000000000000000000000000000000000000000de0b6b3a7640000";
//_throws:
iface.decodeFunctionResult("balanceOf", errorData)
//_log:
// Decoding structured data returns a Result object, which
// will include all values positionally and if the ABI
// included names, values will additionally be available
// by their name.
resultData = "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000008ba1f109551bd432803012645ac136ddd64dba72000000000000000000000000000000000000000000000000000000000000000d52696368617264204d6f6f726500000000000000000000000000000000000000";
//_result:
result = iface.decodeFunctionResult("getUser", resultData);
//_log:
// Access positionally:
// The 0th output parameter, the 0th proerty of the structure
//_result:
result[0][0];
//_log:
// Access by name: (only avilable because parameters were named)
//_result:
result.user.name
//_log:
_subsection: Parsing @<Interface--parsing>
The functions are generally the most useful for most developers. They will
@ -122,10 +419,38 @@ _property: interface.parseLog(log) => [[LogDescription]] @SRC<abi/interface>
Search the event that matches the //log// topic hash and parse the values
the log represents.
_code: @lang<javascript>
//_hide: const iface = _page.iface;
const data = "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000";
const topics = [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000008ba1f109551bd432803012645ac136ddd64dba72",
"0x000000000000000000000000ab7c8803962c0f2f5bbbe3fa8bf41cd82aa1923c"
];
//_result:
iface.parseLog({ data, topics });
//_hide: _.eventFragment = createClass("EventFragment");
//_log:
_property: interface.parseTransaction(transaction) => [[TransactionDescription]] @SRC<abi/interface>
Search for the function that matches the //transaction// data sighash
and parse the transaction properties.
_code: @lang<javascript>
//_hide: const iface = _page.iface;
//_hide: const parseEther = ethers.utils.parseEther;
const data = "0x23b872dd0000000000000000000000008ba1f109551bd432803012645ac136ddd64dba72000000000000000000000000ab7c8803962c0f2f5bbbe3fa8bf41cd82aa1923c0000000000000000000000000000000000000000000000000de0b6b3a7640000";
const value = parseEther("1.0");
//_result:
iface.parseTransaction({ data, value });
//_hide: _.functionFragment = createClass("FunctionFragment");
//_log:
_subsection: Types @<Interface--types>

@ -18,7 +18,6 @@ of errors introduced from typing an address or cut and paste issues.
All functions that return an Address will return a Checksum Address.
_heading: ICAP Address @<address-icap>
The **ICAP Address Format** was an early attempt to introduce a checksum
@ -49,13 +48,72 @@ the checksum is invalid, an [INVALID_ARGUMENT](errors--invalid-argument) Error i
The value of //address// may be any supported address format.
_code: @lang<javascript>
//_hide: const getAddress = ethers.utils.getAddress;
// Injects the checksum (via upper-casing specific letters)
//_result:
getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72");
//_log:
// Converts and injects the checksum
//_result:
getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36");
//_log:
// Throws if a checksummed address is provided, but a
// letter is the wrong case
// ------------v (should be lower-case)
//_throws:
getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72")
//_log:
// Throws if the ICAP/IBAN checksum fails
//_throws:
getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37");
//_log:
// Throws if the address is invalid, in general
//_throws:
getIcapAddress("I like turtles!");
//_log:
_property: ethers.utils.getIcapAddress(address) => string<[IcapAddress](address-icap)> @<utils-getIcapAddress> @SRC<address>
Returns //address// as an [ICAP address](link-icap).
Supports the same restrictions as [getAddress](utils-getAddress).
_code: @lang<javascript>
//_hide: const getIcapAddress = ethers.utils.getIcapAddress;
//_result:
getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72");
//_log:
//_result:
getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36");
//_log:
_property: ethers.utils.isAddress(address) => boolean @<utils-isAddress> @SRC<address>
Returns true if //address// is valid (in any supported format).
_code: @lang<javascript>
//_hide: const isAddress = ethers.utils.isAddress;
//_result:
isAddress("0x8ba1f109551bd432803012645ac136ddd64dba72");
//_log:
//_result:
isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36");
//_log:
//_result:
isAddress("I like turtles.");
//_log:
_subsection: Derivation @<utils--address-derivation>
@ -64,10 +122,49 @@ Returns the address for //publicOrPrivateKey//. A public key may be
compressed or uncompressed, and a private key will be converted
automatically to a public key for the derivation.
_code: @lang<javascript>
//_hide: const computeAddress = ethers.utils.computeAddress;
// Private Key
//_result:
computeAddress("0xb976778317b23a1385ec2d483eda6904d9319135b89f1d8eee9f6d2593e2665d");
//_log:
// Public Key (compressed)
//_result:
computeAddress("0x0376698beebe8ee5c74d8cc50ab84ac301ee8f10af6f28d0ffd6adf4d6d3b9b762");
//_log:
// Public Key (uncompressed)
//_result:
computeAddress("0x0476698beebe8ee5c74d8cc50ab84ac301ee8f10af6f28d0ffd6adf4d6d3b9b762d46ca56d3dad2ce13213a6f42278dabbb53259f2d92681ea6a0b98197a719be3");
//_log:
_property: ethers.utils.recoverAddress(digest, signature) => string<[[address]]> @<utils-recoverAddress> @SRC<transactions>
Use [[link-wiki-ecrecover]] to determine the address that signed //digest// to
which generated //signature//.
_code: @lang<javascript>
//_hide: const recoverAddress = ethers.utils.recoverAddress;
const digest = "0x7c5ea36004851c764c44143b1dcb59679b11c9a68e5f41497f6cf3d480715331";
// Using an expanded Signature
//_result:
recoverAddress(digest, {
r: "0x528459e4aec8934dc2ee94c4f3265cf6ce00d47cf42bb106afda3642c72e25eb",
s: "0x42544137118256121502784e5a6425e6183ca964421ecd577db6c66ba9bccdcf",
v: 27
});
//_log:
// Using a flat Signature
const signature = "0x528459e4aec8934dc2ee94c4f3265cf6ce00d47cf42bb106afda3642c72e25eb42544137118256121502784e5a6425e6183ca964421ecd577db6c66ba9bccdcf1b";
//_result:
recoverAddress(digest, signature);
//_log:
_subsection: Contracts Addresses @<utils--contract-addresses>
@ -75,9 +172,33 @@ _property: ethers.utils.getContractAddress(transaction) => string<[[address]]>
Returns the contract address that would result if //transaction// was
used to deploy a contract.
_code: @lang<javascript>
//_hide: const getContractAddress = ethers.utils.getContractAddress;
const from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
const nonce = 5;
//_result:
getContractAddress({ from, nonce });
//_log:
_property: ethers.utils.getCreate2Address(from, salt, initCodeHash) => string<[[address]]> @<utils-getCreate2Address> @SRC<address>
Returns the contract address that would result from the given
[CREATE2](link-eip-1014) call.
_code: @lang<javascript>
//_hide: const getCreate2Address = ethers.utils.getCreate2Address;
//_hide: const keccak256 = ethers.utils.keccak256;
const from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
const salt = "0x7c5ea36004851c764c44143b1dcb59679b11c9a68e5f41497f6cf3d480715331";
const initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3";
const initCodeHash = keccak256(initCode);
//_result:
getCreate2Address(from, salt, initCodeHash);
//_log:

@ -1,6 +1,6 @@
_section: BigNumber @<BigNumber>
Many operations in Ethereum operation on numbers which are
Many operations in Ethereum operate on numbers which are
[outside the range of safe values](BigNumber--notes-safenumbers) to use
in JavaScript.
@ -49,43 +49,52 @@ _heading: Examples: @<>
_code: @lang<javascript>
// From a decimal string...
//_result:
BigNumber.from("42")
//!
//_log:
// From a HexString...
//_result:
BigNumber.from("0x2a")
//!
//_log:
// From a negative HexString...
//_result:
BigNumber.from("-0x2a")
//!
//_log:
// From an Array (or Uint8Array)...
//_result:
BigNumber.from([ 42 ])
//!
//_log:
// From an existing BigNumber...
let one1 = constants.One;
let one2 = BigNumber.from(one1)
//_result:
one2
//!
//_log:
// ...which returns the same instance
//_result:
one1 === one2
//!
//_log:
// From a (safe) number...
//_result:
BigNumber.from(42)
//!
//_log:
// From a ES2015 BigInt... (only on platforms with BigInt support)
//_result:
BigNumber.from(42n)
//!
//_log:
// Numbers outside the safe range fail:
//_throws:
BigNumber.from(Number.MAX_SAFE_INTEGER);
//! error
//_log:
_subsection: Methods @<BigNumber--methods>
@ -186,8 +195,9 @@ _code: @lang<javascript>
let a = BigNumber.from(42);
let b = BigNumber.from("91");
//_result:
a.mul(b);
//!
//_log:
_subsection: Notes @<BigNumber--notes>
@ -214,8 +224,9 @@ To demonstrate how this may be an issue in your code, consider:
_code: @lang<javascript>
//_result:
(Number.MAX_SAFE_INTEGER + 2 - 2) == (Number.MAX_SAFE_INTEGER)
//!
//_log:
_null:

@ -86,28 +86,34 @@ zeros.
_code: Examples @lang<javascript>
// Convert a hexstring to a Uint8Array
//_result:
arrayify("0x1234")
//!
//_log:
// Convert an Array to a hexstring
//_result:
hexlify([1, 2, 3, 4])
//!
//_log:
// Convert an Object to a hexstring
//_result:
hexlify({ length: 2, "0": 1, "1": 2 })
//!
//_log:
// Convert an Array to a hexstring
//_result:
hexlify([ 1 ])
//!
//_log:
// Convert a number to a stripped hex value
//_result:
hexValue(1)
//!
//_log:
// Convert an Array to a stripped hex value
//_result:
hexValue([ 1, 2 ])
//!
//_log:
_subsection: Array Manipulation
@ -170,15 +176,18 @@ Return a copy of //array// shuffled using [[link-wiki-shuffle]].
_code: Examples @lang<javascript>
//_result:
utils.randomBytes(8)
//!
//_log:
const data = [ 1, 2, 3, 4, 5, 6, 7 ];
// Returns a new Array
//_result:
utils.shuffled(data);
//!
//_log:
// The Original is unscathed...
//_result:
data
//!
//_log:

@ -53,6 +53,13 @@ _heading: Formatting @<display-logic--formatting>
_property: ethers.utils.commify(value) => string @<utils-commify> @SRC<units>
Returns a string with value grouped by 3 digits, separated by ``,``.
_code: @lang<javascript>
//_hide: const commify = ethers.utils.commify;
//_result:
commify("-1000.3000");
//_log:
_heading: Conversion @<unit-conversion>
@ -60,13 +67,88 @@ _property: ethers.utils.formatUnits(value [ , unit = "ether" ] ) => string @<ut
Returns a string representation of //value// formatted with //unit//
digits (if it is a number) or to the unit specified (if a string).
_code: @lang<javascript>
//_hide: const formatUnits = ethers.utils.formatUnits;
//_hide: const BigNumber = ethers.BigNumber;
const oneGwei = BigNumber.from("1000000000");
const oneEther = BigNumber.from("1000000000000000000");
//_result:
formatUnits(oneGwei, 0);
//_log:
//_result:
formatUnits(oneGwei, "gwei");
//_log:
//_result:
formatUnits(oneGwei, 9);
//_log:
//_result:
formatUnits(oneEther);
//_log:
//_result:
formatUnits(oneEther, 18);
//_log:
_property: ethers.utils.formatEther(value) => string @<utils-formatEther> @SRC<units>
The equivalent to calling ``formatUnits(value, "ether")``.
_code: @lang<javascript>
//_hide: const formatEther = ethers.utils.formatEther;
//_hide: const BigNumber = ethers.BigNumber;
const value = BigNumber.from("1000000000000000000");
//_result:
formatEther(value);
//_log:
_property: ethers.utils.parseUnits(value [ , unit = "ether" ] ) => [BigNumber](BigNumber) @<utils-parseUnits> @SRC<units>
Returns a [BigNumber](BigNumber) representation of //value//, parsed with
//unit// digits (if it is a number) or from the unit specified (if
a string).
_code: @lang<javascript>
//_hide: const parseUnits = ethers.utils.parseUnits;
//_result:
parseUnits("1.0");
//_log:
//_result:
parseUnits("1.0", "ether");
//_log:
//_result:
parseUnits("1.0", 18);
//_log:
//_result:
parseUnits("121.0", "gwei");
//_log:
//_result:
parseUnits("121.0", 9);
//_log:
_property: ethers.utils.parseEther(value) => [BigNumber](BigNumber) @<utils-parseEther> @SRC<units>
The equivalent to calling ``parseUnits(value, "ether")``.
_code: @lang<javascript>
//_hide: const parseEther = ethers.utils.parseEther;
//_result:
parseEther("1.0");
//_log:
//_result:
parseEther("-0.5");
//_log:

@ -2,23 +2,63 @@ _section: Encoding Utilities @<encoding>
_subsection: Base58 @<Bse58> @SRC<basex:Base58>
_property: ethers.utils.base58.decode(textData) => Uin8Array
_property: ethers.utils.base58.decode(textData) => Uint8Array
Return a typed Uint8Array representation of //textData// decoded using
base-58 encoding.
_code: @lang<javascript>
//_hide: const base58 = ethers.utils.base58;
//_result:
base58.decode("TzMhH");
//_log:
_property: ethers.utils.base58.encode(aBytesLike) => string
Return //aBytesLike// encoded as a string using the base-58 encoding.
_code: @lang<javascript>
//_hide: const base58 = ethers.utils.base58;
//_result:
base58.encode("0x12345678");
//_log:
//_result:
base58.encode([ 0x12, 0x34, 0x56, 0x78 ]);
//_log:
_subsection: Base64 @<Base64>
_property: ethers.utils.base64.decode(textData) => Uin8Array @SRC<base64>
_property: ethers.utils.base64.decode(textData) => Uint8Array @SRC<base64>
Return a typed Uint8Array representation of //textData// decoded using
base-64 encoding.
_code: @lang<javascript>
//_hide: const base64 = ethers.utils.base64;
//_result:
base64.decode("EjQ=");
//_log:
_property: ethers.utils.base64.encode(aBytesLike) => string @SRC<base64>
Return //aBytesLike// encoded as a string using the base-64 encoding.
_code: @lang<javascript>
//_hide: const base64 = ethers.utils.base64;
//_result:
base64.encode("0x1234");
//_log:
//_result:
base64.encode([ 0x12, 0x34 ]);
//_log:
_subsection: Recursive-Length Prefix @<rlp--methods>
@ -26,15 +66,53 @@ The [[link-rlp]] encoding is used throughout Ethereum to serialize nested
structures of Arrays and data.
_property: ethers.utils.RLP.encode(dataObject) => string<[[DataHexString]]> @<utils-rlpEncode> @SRC<rlp>
Encode a structured Data Object into its RLP-encoded representation.
Encode a structured [Data Object](rlp--dataobject) into its RLP-encoded representation.
Each Data component may be a valid [[BytesLike]].
_code: @lang<javascript>
//_hide: const RLP = ethers.utils.RLP;
//_result:
RLP.encode("0x12345678");
//_log:
//_result:
RLP.encode([ "0x12345678" ]);
//_log:
//_result:
RLP.encode([ new Uint8Array([ 0x12, 0x34, 0x56, 0x78 ]) ]);
//_log:
//_result:
RLP.encode([ [ "0x42", [ "0x43" ] ], "0x12345678", [ ] ]);
//_log:
//_result:
RLP.encode([ ]);
//_log:
_property: ethers.utils.RLP.decode(aBytesLike) => [DataObject](rlp--dataobject) @<utils.rlpDecode> @SRC<rlp>
Decode an RLP-encoded //aBytesLike// into its structured Data Object.
Decode an RLP-encoded //aBytesLike// into its structured [Data Object](rlp--dataobject).
All Data components will be returned as a [[DataHexString]].
_code: @lang<javascript>
//_hide: const RLP = ethers.utils.RLP;
//_result:
RLP.decode("0x8412345678");
//_log:
//_result:
RLP.decode("0xcac342c1438412345678c0");
//_log:
//_result:
RLP.decode("0xc0");
//_log:
_heading: Data Object @<rlp--dataobject>
A **Data Object** is a recursive structure which is used to serialize many

@ -27,14 +27,17 @@ Returns the [SHA2-512](link-wiki-sha2) digest of //aBytesLike//.
_code: KECCAK256 @lang<javascript>
//_result:
utils.keccak256([ 0x12, 0x34 ])
//!
//_log:
//_result:
utils.keccak256("0x")
//!
//_log:
//_result:
utils.keccak256("0x1234")
//!
//_log:
// The value MUST be data, such as:
// - an Array of numbers
@ -42,16 +45,19 @@ utils.keccak256("0x1234")
// - a Uint8Array
// Do NOT use UTF-8 strings that are not a DataHexstring
//_throws:
utils.keccak256("hello world")
//! error
//_log:
// If needed, convert strings to bytes first:
//_result:
utils.keccak256(utils.toUtf8Bytes("hello world"))
//!
//_log:
// Or equivalently use the identity function:
//_result:
utils.id("hello world")
//!
//_log:
// Keep in mind that the string "0x1234" represents TWO
// bytes (i.e. [ 0x12, 0x34 ]. If you wish to compute the
@ -61,48 +67,56 @@ utils.id("hello world")
// Consider the following examples:
// Hash of TWO (2) bytes:
//_result:
utils.keccak256("0x1234")
//!
//_log:
// Hash of TWO (2) bytes: (same result)
//_result:
utils.keccak256([ 0x12, 0x34 ])
//!
//_log:
const bytes = utils.toUtf8Bytes("0x1234")
// <hide>
bytes
// </hide>
//!
//_result:
bytes = utils.toUtf8Bytes("0x1234")
//_log:
// Hash of SIX (6) characters (different than above)
//_result:
utils.keccak256(bytes)
//!
//_log:
// Hash of SIX (6) characters (same result)
//_result:
utils.id("0x1234")
//!
//_log:
_code: RIPEMD160 @lang<javascript>
//_result:
utils.ripemd160("0x")
//!
//_log:
//_result:
utils.ripemd160("0x1234")
//!
//_log:
_code: SHA-2 @lang<javascript>
//_result:
utils.sha256("0x")
//!
//_log:
//_result:
utils.sha256("0x1234")
//!
//_log:
//_result:
utils.sha512("0x")
//!
//_log:
//_result:
utils.sha512("0x1234")
//!
//_log:
_subsection: HMAC @<utils--hmac>
@ -123,8 +137,9 @@ _code: HMAC @lang<javascript>
const key = "0x0102"
const data = "0x1234"
//_result:
utils.computeHmac("sha256", key, data)
//!
//_log:
_subsection: Hashing Helpers @<utils--hashing-helpers>
@ -137,12 +152,14 @@ and the length of //message//.
_code: Hashing Messages @lang<javascript>
// Hashing a string message
//_result:
utils.hashMessage("Hello World")
//!
//_log:
// Hashing binary data (also "Hello World", but as bytes)
//_result:
utils.hashMessage( [ 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100 ])
//!
//_log:
// NOTE: It is important to understand how strings and binary
// data is handled differently. A string is ALWAYS processed
@ -151,18 +168,21 @@ utils.hashMessage( [ 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100 ])
// Hashing a hex string is the same as hashing a STRING
// Note: this is the hash of the 4 characters [ '0', 'x', '4', '2' ]
//_result:
utils.hashMessage("0x42")
//!
//_log:
// Hashing the binary data
// Note: this is the hash of the 1 byte [ 0x42 ]
//_result:
utils.hashMessage([ 0x42 ])
//!
//_log:
// Hashing the binary data
// Note: similarly, this is the hash of the 1 byte [ 0x42 ]
//_result:
utils.hashMessage(utils.arrayify("0x42"))
//!
//_log:
_property: ethers.utils.namehash(name) => string<[[DataHexString]]<32>> @<utils-namehash> @SRC<hash>
@ -170,17 +190,21 @@ Returns the [ENS Namehash](link-namehash) of //name//.
_code: Namehash @lang<javascript>
//_result:
utils.namehash("")
//!
//_log:
//_result:
utils.namehash("eth")
//!
//_log:
//_result:
utils.namehash("ricmoo.firefly.eth")
//!
//_log:
//_result:
utils.namehash("ricmoo.xyz")
//!
//_log:
_heading: Typed Data Encoder @<TypedDataEncoder> @SRC<hash:class.TypedDataEncoder>
@ -244,19 +268,17 @@ been recursively replacedwith the value of calling //resolveName// with that val
_code: Typed Data Example @lang<javascript>
// <hide>
TypedDataEncoder = ethers.utils._TypedDataEncoder
// </hide>
//_hide: TypedDataEncoder = ethers.utils._TypedDataEncoder
const domain = {
domain = {
name: 'Ether Mail',
version: '1',
chainId: 1,
verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC'
}
};
// The named list of all type definitions
const types = {
types = {
Person: [
{ name: 'name', type: 'string' },
{ name: 'wallet', type: 'address' }
@ -266,10 +288,10 @@ const types = {
{ name: 'to', type: 'Person' },
{ name: 'contents', type: 'string' }
]
}
};
// The data to sign
const value = {
value = {
from: {
name: 'Cow',
wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826'
@ -279,23 +301,27 @@ const value = {
wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB'
},
contents: 'Hello, Bob!'
}
};
//_result:
TypedDataEncoder.encode(domain, types, value)
//!
//_log:
//_result:
TypedDataEncoder.getPayload(domain, types, value)
//!
//_log:
//_result:
TypedDataEncoder.getPrimaryType(types)
//!
//_log:
//_result:
TypedDataEncoder.hash(domain, types, value)
//!
//_log:
//_result:
TypedDataEncoder.hashDomain(domain)
//!
//_log:
_subsection: Solidity Hashing Algorithms @<utils--solidity-hashing>
@ -318,17 +344,21 @@ according to their respective type in //types//.
_code: Solidity Hashing @lang<javascript>
//_result:
utils.solidityPack([ "int16", "uint48" ], [ -1, 12 ])
//!
//_log:
//_result:
utils.solidityPack([ "string", "uint8" ], [ "Hello", 3 ])
//!
//_log:
//_result:
utils.solidityKeccak256([ "int16", "uint48" ], [ -1, 12 ])
//!
//_log:
//_result:
utils.soliditySha256([ "int16", "uint48" ], [ -1, 12 ])
//!
//_log:
// As a short example of the non-distinguished nature of
// Solidity tight-packing (which is why it is inappropriate
@ -336,14 +366,18 @@ utils.soliditySha256([ "int16", "uint48" ], [ -1, 12 ])
// the following examples are all equal, despite representing
// very different values and layouts.
//_result:
utils.solidityPack([ "string", "string" ], [ "hello", "world01" ])
//!
//_log:
//_result:
utils.solidityPack([ "string", "string" ], [ "helloworld", "01" ])
//!
//_log:
//_result:
utils.solidityPack([ "string", "string", "uint16" ], [ "hell", "oworld", 0x3031 ])
//!
//_log:
//_result:
utils.solidityPack([ "uint96" ], [ "32309054545061485574011236401" ])
//!
//_log:

@ -216,6 +216,22 @@ it deals with unmined transactions, and can be configured by each node, however
to ensure a transaction is propagated to a miner it is best practice to follow
the defaults most nodes have enabled.
_property: Logger.errors.TRANSACTION_REPLACED @<errors--transaction-replaced>
When a transaction has been replaced by the user, by broadcasting a new transaction
with the same nonce as an existing in-flight (unmined) transaction in the mempool,
this error will occur while waiting if the transaction being waited for has become
invalidated by that other transaction.
This can happen for several reasons, but most commonly because the user has increased
the gas price (which changes the transaction hash) to "speed up" a transaction or if
a user has "cancelled" the transaction in their client. In either case this is
usually accomplished by bribing the miners with a higher gas priced transaction.
This error will have the additional properties, ``cancelled``, ``hash``, ``reason``,
``receipt`` and ``replacement``.
See the [[providers-TransactionResponse]] for the ``wait`` method for more details.
_property: Logger.errors.UNPREDICTABLE_GAS_LIMIT @<errors--unpredicatable-gas-limit>
When estimating the required amount of gas for a transaction, a node is queried for
its best guess.

@ -57,13 +57,11 @@ $TopicABaCD: **[** (topic[0] = A) **OR** (topic[0] = B) **]** **AND**
_code: ERC-20 Transfer Filter Examples @lang<javascript>
// <hide>
const tokenAddress = ethers.constants.AddressZero;
const myAddress = ethers.constants.AddressZero;
const myOtherAddress = ethers.constants.AddressZero;
const id = ethers.utils.id;
const hexZeroPad = ethers.utils.hexZeroPad;
// </hide>
//_hide: const tokenAddress = ethers.constants.AddressZero;
//_hide: const myAddress = ethers.constants.AddressZero;
//_hide: const myOtherAddress = ethers.constants.AddressZero;
//_hide: const id = ethers.utils.id;
//_hide: const hexZeroPad = ethers.utils.hexZeroPad;
// Short example of manually creating filters for an ERC-20
// Transfer event.
@ -96,7 +94,7 @@ filter = {
id("Transfer(address,address,uint256)"),
hexZeroPad(myAddress, 32)
]
}
};
// List all token transfers *to* myAddress:
filter = {
@ -106,7 +104,7 @@ filter = {
null,
hexZeroPad(myAddress, 32)
]
}
};
// List all token transfers *to* myAddress or myOtherAddress:
filter = {
@ -119,7 +117,7 @@ filter = {
hexZeroPad(myOtherAddress, 32),
]
]
}
};
_null:
@ -128,35 +126,37 @@ To simplify life, ..., explain here, the contract API
_code: ERC-20 Contract Filter Examples @lang<javascript>
// <hide>
const tokenAddress = "0x6B175474E89094C44Da98b954EedeAC495271d0F"; // DAI
const myAddress = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
const otherAddress = "0xEA517D5a070e6705Cc5467858681Ed953d285Eb9";
const provider = ethers.getDefaultProvider();
const Contract = ethers.Contract;
// </hide>
//_hide: const tokenAddress = "0x6B175474E89094C44Da98b954EedeAC495271d0F"; /* DAI */
//_hide: const myAddress = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
//_hide: const otherAddress = "0xEA517D5a070e6705Cc5467858681Ed953d285Eb9";
//_hide: const provider = ethers.getDefaultProvider();
//_hide: const Contract = ethers.Contract;
const abi = [
abi = [
"event Transfer(address indexed src, address indexed dst, uint val)"
];
const contract = new Contract(tokenAddress, abi, provider);
contract = new Contract(tokenAddress, abi, provider);
// List all token transfers *from* myAddress
//_result:
contract.filters.Transfer(myAddress)
//!
//_log:
// List all token transfers *to* myAddress:
//_result:
contract.filters.Transfer(null, myAddress)
//!
//_log:
// List all token transfers *from* myAddress *to* otherAddress:
//_result:
contract.filters.Transfer(myAddress, otherAddress)
//!
//_log:
// List all token transfers *to* myAddress OR otherAddress:
//_result:
contract.filters.Transfer(null, [ myAddress, otherAddress ])
//!
//_log:
_subsection: Solidity Topics @<events-solidity>

@ -1,5 +1,82 @@
_section: Security @<security>
While security should be a concern for all developers, in the
blockchain space developers must be additionally conscious of
many areas which can be exploited.
Once a problem has an economic incentives to exploit it, there
is a much larger risk and with blockchain apps it can become
quite valuable to attack.
In addition to many of the other security issues app developers
may have to worry about, there are a few additional vectors
that JavaScript developers should be aware of.
_subsection: Side-Channel Attacks
A [Side-Channel Attack](link-wiki-side-channel-attack) occurs
when something orthogonal to the implementation of the algorithm
used can be exploited to learn more about secure or private
information.
_heading: Released Data (Strings, Uint8Arrays, Buffers)
In JavaScript, memory may not be securely allocated, or more
importantly securely released.
[Historically](https://github.com/nodejs/node/issues/4660),
``new Buffer(16)`` would re-use old memory that had been
released. This would mean that code runnint later, may have
access to data that was discarded.
As an example of the dangers, imagine if you had used a Buffer
to store a private key, signed data and then returned from the
function, allowing the Buffer to be de-allocated. A future
function may be able to request a new Buffer, which would still
have that left-over private key, which it could then use to
steal the funds from that account.
There are also many debugging tools and systems designed to
assist develoeprs inspect the memory contents of JavaScript
programs. In these cases, any //private key// or //mnemonic//
siiting in memory may be visible to other users on the system,
or malicious scripts.
_heading: Timing Attack
Timing attacks allow a malicious user or script to determine
private data through analysing how long an operation requires
to execute.
In JavaScript, //Garbage Collection// occurs periodically when the
system determines it is required. Each JavaScript implementation
is different, with a variety of strategies and and abilities.
Most Garbage Collection requires "stopping the world", or pausing
all code being executed while it runs. This adds a large delay
to any code that was currently running.
This can be exploited by attackers to "condition cause a delay".
They will set up a scenario where the system is on the edge of
needing to garbage collect, and call your code with two paths,
a simple path and complex path. The simple path won't stir things
up enough to cause a garbage collection, while the complex one
will. By timing how long the code took to execute, they now know
whether garbage collection occured and therefore whether the simple
or complex path was taken.
Advancced timing attacks are very difficult to mitigate in any
garbage-collection-based language. Most libraries where this
matters will hopefully mitigated this for you as much as possible,
but it is still good to be aware of.
_heading: General Concerns
- [Cross-Site Scripting](link-wiki-xss)
- [Cross-Site Request Forgery](link-wiki-csrf)
- [Phishing](link-wiki-phishing)
_subsection: Key Derivation Functions @<security--pbkdf>
This is not specific to Ethereum, but is a useful technique

@ -142,12 +142,35 @@ function codeContextify(context) {
return `{ BigNumber: ${JSON.stringify(this.toString()) } }`;
}
context.createClass = function(name) {
let C = class{ }
Object.defineProperty(C, "name", { value: name })
return C;
}
context._inspect = function(value, depth) {
if (toString.call(value) === '[object Error]') {
// Not an error from ethers...
if (ethers.utils.Logger.errors[value.code] == null) {
return `Error: ${ value.message }`;
}
// Trim the ethers errors down on their verbosity for the docs...
if (value.message) {
value.message = value.message.split(" (")[0];
}
value.stack = undefined;
}
if (value && value.constructor && value.constructor.name === "Uint8Array") {
return `Uint8Array [ ${ Array.prototype.join.call(value, ", ") } ]`;
}
if (typeof(value) === "string" && value.indexOf("\n") >= 0) {
return "`" + value + "`";
}
//return JSON.stringify(value);
return inspect(value, {
compact: false,
@ -156,12 +179,20 @@ function codeContextify(context) {
sorted: true,
});
}
context._startup = function() {
console.log("Startup");
}
context._shutdown = function() {
console.log("Shutdown");
}
}
module.exports = {
title: "ethers",
subtitle: "v5.2",
subtitle: "v5.3",
description: "Documentation for ethers, a complete, tiny and simple Ethereum library.",
logo: "logo.svg",
@ -292,12 +323,14 @@ module.exports = {
"link-wiki-bloomfilter": { name: "Bloom Filter", url: "https:/\/en.wikipedia.org/wiki/Bloom_filter" },
"link-wiki-bruteforce": "https:/\/en.wikipedia.org/wiki/Brute-force_attack",
"link-wiki-cryptographichash": "https:/\/en.wikipedia.org/wiki/Cryptographic_hash_function",
"link-wiki-csrf": "https:/\/en.wikipedia.org/wiki/Cross-site_request_forgery",
"link-wiki-ecrecover": { name: "ECDSA Public Key Recovery", url: "https:/\/en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm#Public_key_recovery" },
"link-wiki-homoglyph": "https:/\/en.wikipedia.org/wiki/IDN_homograph_attack",
"link-wiki-hmac": "https:/\/en.wikipedia.org/wiki/HMAC",
"link-wiki-iban": "https:/\/en.wikipedia.org/wiki/International_Bank_Account_Number",
"link-wiki-ieee754": "https:/\/en.wikipedia.org/wiki/Double-precision_floating-point_format",
"link-wiki-observer-pattern": { name: "Obeserver Pattern", url: "https:/\/en.wikipedia.org/wiki/Observer_pattern" },
"link-wiki-phishing": "https:/\/en.wikipedia.org/wiki/Phishing",
"link-wiki-ripemd": "https:/\/en.m.wikipedia.org/wiki/RIPEMD",
"link-wiki-sha2": "https:/\/en.wikipedia.org/wiki/SHA-2",
"link-wiki-twoscomplement": "https:/\/en.wikipedia.org/wiki/Two%27s_complement",
@ -305,9 +338,11 @@ module.exports = {
"link-wiki-utf8-overlong": "https:/\/en.wikipedia.org/wiki/UTF-8#Overlong_encodings",
"link-wiki-utf8-replacement": "https:/\/en.wikipedia.org/wiki/Specials_%28Unicode_block%29#Replacement_character",
"link-wiki-scrypt": "https:/\/en.wikipedia.org/wiki/Scrypt",
"link-wiki-side-channel-attack": "https:/\/en.wikipedia.org/wiki/Side-channel_attack",
"link-wiki-sha3": "https:/\/en.wikipedia.org/wiki/SHA-3",
"link-wiki-shuffle": { name: "Fisher-Yates Shuffle", url: "https:/\/en.wikipedia.org/wiki/Fisher-Yates_shuffle" },
"link-wiki-overflow": { name: "overflow", url: "https:/\/en.wikipedia.org/wiki/Integer_overflow" },
"link-wiki-underflow": { name: "arithmetic underflow", url: "https:/\/en.wikipedia.org/wiki/Arithmetic_underflow" },
"link-wiki-xss": "https:/\/en.wikipedia.org/wiki/Cross-site_scripting",
},
};

@ -219,58 +219,64 @@ for displaying code samples.
_heading: JavaScript Evaluation @<flatworm--code-eval>
For JavaScript files, the file is executed with some simple substitution.
For JavaScript files, the file is transpiled and executed in a VM,
allowiung output (or exceptions) of blocks to be included in the
fragment output.
A bare ``\/\/!`` on a line is replaced with the result of the last
statement. Building will fail if an error is thrown.
The entire **code fragment** source is included in an async IIFE,
whick means ``await`` is allowed, and several special comment
directives are allowed.
A bare ``\/\/!error`` is replaced with the throw error. Building will
fail if an error is not thrown.
A ``/\/_hide:`` will include any following code directly into the
output, but will not include it in the generated output for the fragment.
Also any code included between the lines **``\/\/ <hide>``** and
**``\/\/ </hide>``** will be omitted from the output, which can be used
to setup variables.
A ``/\/_log:`` will include the value of any following expression in the
output, prefixed with a ``/\/ ``. Renderers will mark output in different
style if possible.
A ``/\/_result:`` will begin a block, assigning the contents to ``_``. The
block can be ended with a ``/\/_log:`` or ``/\/_null:``, if no value is given
to log, then ``_`` is assumed. If an error occurs, generation fails.
A ``/\/_throws:`` will begin a block, which is expected to throw assigning
the error to ``_``. The block can be ended with a ``/\/_log:`` or ``/\/_null:``,
if no value is given to log, then ``_`` is assumed. If an error do not occur,
generation fails.
_code: Code Evaluation Example @lang<text>
\_code: Result of Code Example @lang<javascript>
// <hide>
const url = require("url");
// </hide>
//_hide: const url = require("url");
//_result:
url.parse("https://www.ricmoo.com/").protocol
//!
//_log:
//_throws:
url.parse(45)
//! error
//_log:
// You want to assign (doesn't emit eval) AND display the value
const foo = 4 + 5;
// <hide>
foo
// </hide>
//!
//_log: foo
_code: Result of Code Example @lang<javascript>
// <hide>
const url = require("url");
// </hide>
//_hide: const url = require("url");
//_result:
url.parse("https://www.ricmoo.com/").protocol
//!
//_log:
//_throws:
url.parse(45)
//! error
//_log:
// You want to assign (doesn't emit eval) AND display the value
const foo = 4 + 5;
// <hide>
foo
// </hide>
//!
//_log: foo
_heading: Languages

@ -39,14 +39,14 @@ Web Applications from our CDN.
_code: ES6 in the Browser @lang<html>
<script type="module">
import { ethers } from "https://cdn.ethers.io/lib/ethers-5.0.esm.min.js";
import { ethers } from "https://cdn.ethers.io/lib/ethers-5.2.esm.min.js";
// Your code here...
</script>
_code: ES3 (UMD) in the Browser @lang<html>
<script src="https://cdn.ethers.io/lib/ethers-5.0.umd.min.js"
<script src="https://cdn.ethers.io/lib/ethers-5.2.umd.min.js"
type="application/javascript"></script>
@ -123,22 +123,26 @@ logs, look up deployed code and so on.
_code: Basic Queries @lang<javascript>
// Look up the current block number
provider.getBlockNumber()
//!
//_result:
await provider.getBlockNumber()
//_log:
// Get the balance of an account (by address or ENS name, if supported by network)
//_result:
balance = await provider.getBalance("ethers.eth")
//! async balance
//_log:
// Often you need to format the output to something more user-friendly,
// such as in ether (instead of wei)
//_result:
ethers.utils.formatEther(balance)
//!
//_log:
// If a user enters a string in an input field, you may need
// to convert it from ether (as a string) to wei (as a BigNumber)
//_result:
ethers.utils.parseEther("1.0")
//!
//_log:
_heading: Writing to the Blockchain @<getting-started--sending>
@ -204,38 +208,33 @@ const daiAbi = [
// The Contract object
const daiContract = new ethers.Contract(daiAddress, daiAbi, provider);
//_hide: _page.daiAbi = daiAbi;
//_hide: _page.daiContract = daiContract;
_heading: Read-Only Methods @<getting-started--reading>
_code: Querying the DAI Contract @lang<javascript>
// <hide>
const daiAbi = [
// Some simple details about the token
"function name() view returns (string)",
"function symbol() view returns (string)",
// Get the account balance
"function balanceOf(address) view returns (uint)",
];
const daiContract = new ethers.Contract("dai.tokens.ethers.eth", daiAbi, provider);
// </hide>
//_hide: const daiContract = _page.daiContract;
// Get the ERC-20 token name
daiContract.name()
//!
//_result:
await daiContract.name()
//_log:
// Get the ERC-20 token symbol (for tickers and UIs)
daiContract.symbol()
//!
//_result:
await daiContract.symbol()
//_log:
// Get the balance of an address
balance = await daiContract.balanceOf("ricmoo.firefly.eth")
//! async balance
//_log: balance
// Format the DAI for displaying to the user
//_result:
ethers.utils.formatUnits(balance, 18)
//!
//_log:
_heading: State Changing Methods @<getting-started--writing>
@ -258,13 +257,8 @@ _heading: Listening to Events @<getting-started--events>
_code: Listening to Events @lang<javascript>
// <hide>
const daiAbi = [
"event Transfer(address indexed, address indexed, uint256)"
];
const daiContract = new ethers.Contract("dai.tokens.ethers.eth", daiAbi, provider);
const formatEther = ethers.utils.formatEther;
// </hide>
//_hide: const daiContract = _page.daiContract;
//_hide: const formatEther = ethers.utils.formatEther;
// Receive an event when ANY transfer occurs
daiContract.on("Transfer", (from, to, amount, event) => {
@ -277,10 +271,7 @@ daiContract.on("Transfer", (from, to, amount, event) => {
// A filter for when a specific address receives tokens
myAddress = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
filter = daiContract.filters.Transfer(null, myAddress)
// <hide>
filter
// </hide>
//!
//_log: filter
// Receive an event when that filter occurs
daiContract.on(filter, (from, to, amount, event) => {
@ -288,46 +279,32 @@ daiContract.on(filter, (from, to, amount, event) => {
console.log(`I got ${ formatEther(amount) } from ${ from }.`);
});
// <hide>
// Don't want to block the docs from compiling...
daiContract.removeAllListeners();
// </hide>
//_hide: daiContract.removeAllListeners(); /* Don't want to block the docs from compiling... */
_heading: Query Historic Events @<getting-started--history>
_code: Filtering Historic Events @lang<javascript>
// <hide>
const signer = new ethers.VoidSigner("0x8ba1f109551bD432803012645Ac136ddd64DBA72");
const daiAbi = [
"event Transfer(address indexed, address indexed, uint256)"
];
const daiContract = new ethers.Contract("dai.tokens.ethers.eth", daiAbi, provider);
//!
// </hide>
//_hide: const signer = new ethers.VoidSigner("0x8ba1f109551bD432803012645Ac136ddd64DBA72");
//_hide: const daiContract = _page.daiContract;
// Get the address of the Signer
myAddress = await signer.getAddress()
//! async myAddress
//_log: myAddress
// Filter for all token transfers from me
filterFrom = daiContract.filters.Transfer(myAddress, null);
// <hide>
filterFrom
// </hide>
//!
//_log: filterFrom
// Filter for all token transfers to me
filterTo = daiContract.filters.Transfer(null, myAddress);
// <hide>
filterTo
// </hide>
//!
//_log: filterTo
// List all transfers sent from me a specific block range
daiContract.queryFilter(filterFrom, 9843470, 9843480)
//!
//_result:
await daiContract.queryFilter(filterFrom, 9843470, 9843480)
//_log:
//
// The following have had the results omitted due to the
@ -335,26 +312,22 @@ daiContract.queryFilter(filterFrom, 9843470, 9843480)
//
// List all transfers sent in the last 10,000 blocks
daiContract.queryFilter(filterFrom, -10000)
await daiContract.queryFilter(filterFrom, -10000)
// List all transfers ever sent to me
daiContract.queryFilter(filterTo)
await daiContract.queryFilter(filterTo)
_subsection: Signing Messages @<getting-started--signing>
_code: Signing Messages @lang<javascript>
// <hide>
const signer = ethers.Wallet.createRandom();
//!
// </hide>
//_hide: const signer = ethers.Wallet.createRandom();
// To sign a simple string, which are used for
// logging into a service, such as CryptoKitties,
// pass the string in.
signature = await signer.signMessage("Hello World");
//! async signature
//_log: signature
//
// A common case is also signing a hash, which is 32
@ -367,8 +340,8 @@ message = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
// This array representation is 32 bytes long
messageBytes = ethers.utils.arrayify(message);
//!
//_log: messageBytes
// To sign a hash, you most often want to sign the bytes
signature = await signer.signMessage(messageBytes)
//! async signature
//_log: signature

@ -75,7 +75,7 @@ apikey asc endblock startblock
alchemyapi Cloudflare Etherscan INFURA IPFS MetaMask Nodesmith
Trezor ledgerhq axic bitcoinjs browserify easyseed ethereumjs
goerli homestead kotti kovan mainnet morden mordor rinkeby
ropsten testnet lb
ropsten testnet lb maticmum
// Demo words
args foo eth foo foobar ll localhost passwd ricmoo tx xxx yna

@ -73,7 +73,7 @@ function _getUrl(href, options) {
options = {};
}
// @TODO: Once we drop support for node 8, we can pass the href
// firectly into request and skip adding the components
// directly into request and skip adding the components
// to this request object
const url = url_1.parse(href);
const request = {

@ -66,7 +66,7 @@ apikey asc endblock startblock
alchemyapi Cloudflare Etherscan INFURA IPFS MetaMask Nodesmith
Trezor ledgerhq axic bitcoinjs browserify easyseed ethereumjs
goerli homestead kotti kovan mainnet morden mordor rinkeby
ropsten testnet lb
ropsten testnet lb maticmum
// Demo words
args foo eth foo foobar ll localhost passwd ricmoo tx xxx yna

@ -79,7 +79,7 @@ async function _getUrl(href: string, options?: Options): Promise<GetUrlResponse>
if (options == null) { options = { }; }
// @TODO: Once we drop support for node 8, we can pass the href
// firectly into request and skip adding the components
// directly into request and skip adding the components
// to this request object
const url = parse(href);

533
package-lock.json generated

@ -4,35 +4,35 @@
"lockfileVersion": 1,
"dependencies": {
"@babel/code-frame": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
"integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz",
"integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==",
"dev": true,
"requires": {
"@babel/highlight": "^7.12.13"
"@babel/highlight": "^7.14.5"
}
},
"@babel/compat-data": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz",
"integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.5.tgz",
"integrity": "sha512-kixrYn4JwfAVPa0f2yfzc2AWti6WRRyO3XjWW5PJAvtE11qhSayrrcrEnee05KAtNaPC+EwehE8Qt1UedEVB8w==",
"dev": true
},
"@babel/core": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.3.tgz",
"integrity": "sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.5.tgz",
"integrity": "sha512-RN/AwP2DJmQTZSfiDaD+JQQ/J99KsIpOCfBE5pL+5jJSt7nI3nYGoAXZu+ffYSQ029NLs2DstZb+eR81uuARgg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.12.13",
"@babel/generator": "^7.14.3",
"@babel/helper-compilation-targets": "^7.13.16",
"@babel/helper-module-transforms": "^7.14.2",
"@babel/helpers": "^7.14.0",
"@babel/parser": "^7.14.3",
"@babel/template": "^7.12.13",
"@babel/traverse": "^7.14.2",
"@babel/types": "^7.14.2",
"@babel/code-frame": "^7.14.5",
"@babel/generator": "^7.14.5",
"@babel/helper-compilation-targets": "^7.14.5",
"@babel/helper-module-transforms": "^7.14.5",
"@babel/helpers": "^7.14.5",
"@babel/parser": "^7.14.5",
"@babel/template": "^7.14.5",
"@babel/traverse": "^7.14.5",
"@babel/types": "^7.14.5",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
@ -42,18 +42,18 @@
},
"dependencies": {
"@babel/parser": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz",
"integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.5.tgz",
"integrity": "sha512-TM8C+xtH/9n1qzX+JNHi7AN2zHMTiPUtspO0ZdHflW8KaskkALhMmuMHb4bCmNdv9VAPzJX3/bXqkVLnAvsPfg==",
"dev": true
},
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
},
@ -87,23 +87,23 @@
}
},
"@babel/generator": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz",
"integrity": "sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.5.tgz",
"integrity": "sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA==",
"dev": true,
"requires": {
"@babel/types": "^7.14.2",
"@babel/types": "^7.14.5",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
},
@ -116,14 +116,14 @@
}
},
"@babel/helper-compilation-targets": {
"version": "7.13.16",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz",
"integrity": "sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.5.tgz",
"integrity": "sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.13.15",
"@babel/helper-validator-option": "^7.12.17",
"browserslist": "^4.14.5",
"@babel/compat-data": "^7.14.5",
"@babel/helper-validator-option": "^7.14.5",
"browserslist": "^4.16.6",
"semver": "^6.3.0"
},
"dependencies": {
@ -136,248 +136,269 @@
}
},
"@babel/helper-function-name": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz",
"integrity": "sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz",
"integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==",
"dev": true,
"requires": {
"@babel/helper-get-function-arity": "^7.12.13",
"@babel/template": "^7.12.13",
"@babel/types": "^7.14.2"
"@babel/helper-get-function-arity": "^7.14.5",
"@babel/template": "^7.14.5",
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-get-function-arity": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz",
"integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz",
"integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==",
"dev": true,
"requires": {
"@babel/types": "^7.12.13"
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-hoist-variables": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz",
"integrity": "sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==",
"dev": true,
"requires": {
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-member-expression-to-functions": {
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz",
"integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.5.tgz",
"integrity": "sha512-UxUeEYPrqH1Q/k0yRku1JE7dyfyehNwT6SVkMHvYvPDv4+uu627VXBckVj891BO8ruKBkiDoGnZf4qPDD8abDQ==",
"dev": true,
"requires": {
"@babel/types": "^7.13.12"
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-module-imports": {
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz",
"integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz",
"integrity": "sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ==",
"dev": true,
"requires": {
"@babel/types": "^7.13.12"
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-module-transforms": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz",
"integrity": "sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz",
"integrity": "sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA==",
"dev": true,
"requires": {
"@babel/helper-module-imports": "^7.13.12",
"@babel/helper-replace-supers": "^7.13.12",
"@babel/helper-simple-access": "^7.13.12",
"@babel/helper-split-export-declaration": "^7.12.13",
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/template": "^7.12.13",
"@babel/traverse": "^7.14.2",
"@babel/types": "^7.14.2"
"@babel/helper-module-imports": "^7.14.5",
"@babel/helper-replace-supers": "^7.14.5",
"@babel/helper-simple-access": "^7.14.5",
"@babel/helper-split-export-declaration": "^7.14.5",
"@babel/helper-validator-identifier": "^7.14.5",
"@babel/template": "^7.14.5",
"@babel/traverse": "^7.14.5",
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-optimise-call-expression": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz",
"integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz",
"integrity": "sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA==",
"dev": true,
"requires": {
"@babel/types": "^7.12.13"
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-replace-supers": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.3.tgz",
"integrity": "sha512-Rlh8qEWZSTfdz+tgNV/N4gz1a0TMNwCUcENhMjHTHKp3LseYH5Jha0NSlyTQWMnjbYcwFt+bqAMqSLHVXkQ6UA==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz",
"integrity": "sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow==",
"dev": true,
"requires": {
"@babel/helper-member-expression-to-functions": "^7.13.12",
"@babel/helper-optimise-call-expression": "^7.12.13",
"@babel/traverse": "^7.14.2",
"@babel/types": "^7.14.2"
"@babel/helper-member-expression-to-functions": "^7.14.5",
"@babel/helper-optimise-call-expression": "^7.14.5",
"@babel/traverse": "^7.14.5",
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-simple-access": {
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz",
"integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz",
"integrity": "sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw==",
"dev": true,
"requires": {
"@babel/types": "^7.13.12"
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-split-export-declaration": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz",
"integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz",
"integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==",
"dev": true,
"requires": {
"@babel/types": "^7.12.13"
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-validator-identifier": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
"integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz",
"integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==",
"dev": true
},
"@babel/helper-validator-option": {
"version": "7.12.17",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz",
"integrity": "sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz",
"integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==",
"dev": true
},
"@babel/helpers": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz",
"integrity": "sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.5.tgz",
"integrity": "sha512-xtcWOuN9VL6nApgVHtq3PPcQv5qFBJzoSZzJ/2c0QK/IP/gxVcoWSNQwFEGvmbQsuS9rhYqjILDGGXcTkA705Q==",
"dev": true,
"requires": {
"@babel/template": "^7.12.13",
"@babel/traverse": "^7.14.0",
"@babel/types": "^7.14.0"
"@babel/template": "^7.14.5",
"@babel/traverse": "^7.14.5",
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/highlight": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz",
"integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz",
"integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
}
@ -388,63 +409,64 @@
"integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw=="
},
"@babel/template": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz",
"integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz",
"integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.12.13",
"@babel/parser": "^7.12.13",
"@babel/types": "^7.12.13"
"@babel/code-frame": "^7.14.5",
"@babel/parser": "^7.14.5",
"@babel/types": "^7.14.5"
},
"dependencies": {
"@babel/parser": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz",
"integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.5.tgz",
"integrity": "sha512-TM8C+xtH/9n1qzX+JNHi7AN2zHMTiPUtspO0ZdHflW8KaskkALhMmuMHb4bCmNdv9VAPzJX3/bXqkVLnAvsPfg==",
"dev": true
},
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/traverse": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz",
"integrity": "sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.5.tgz",
"integrity": "sha512-G3BiS15vevepdmFqmUc9X+64y0viZYygubAMO8SvBmKARuF6CPSZtH4Ng9vi/lrWlZFGe3FWdXNy835akH8Glg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.12.13",
"@babel/generator": "^7.14.2",
"@babel/helper-function-name": "^7.14.2",
"@babel/helper-split-export-declaration": "^7.12.13",
"@babel/parser": "^7.14.2",
"@babel/types": "^7.14.2",
"@babel/code-frame": "^7.14.5",
"@babel/generator": "^7.14.5",
"@babel/helper-function-name": "^7.14.5",
"@babel/helper-hoist-variables": "^7.14.5",
"@babel/helper-split-export-declaration": "^7.14.5",
"@babel/parser": "^7.14.5",
"@babel/types": "^7.14.5",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
"dependencies": {
"@babel/parser": {
"version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz",
"integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.5.tgz",
"integrity": "sha512-TM8C+xtH/9n1qzX+JNHi7AN2zHMTiPUtspO0ZdHflW8KaskkALhMmuMHb4bCmNdv9VAPzJX3/bXqkVLnAvsPfg==",
"dev": true
},
"@babel/types": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
"integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz",
"integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
"@babel/helper-validator-identifier": "^7.14.5",
"to-fast-properties": "^2.0.0"
}
},
@ -531,9 +553,9 @@
"dev": true
},
"@ledgerhq/cryptoassets": {
"version": "5.51.0",
"resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-5.51.0.tgz",
"integrity": "sha512-62GLlkQfbdxS9nqY64YuLq2udDZX4T+xpxH1b8JKAhc4Wocr2CfU4Jbb/W85ZTbYV/phNUQ0tel3dhW885WUpQ==",
"version": "5.53.0",
"resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-5.53.0.tgz",
"integrity": "sha512-M3ibc3LRuHid5UtL7FI3IC6nMEppvly98QHFoSa7lJU0HDzQxY6zHec/SPM4uuJUC8sXoGVAiRJDkgny54damw==",
"requires": {
"invariant": "2"
}
@ -812,9 +834,9 @@
"integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ=="
},
"@types/node": {
"version": "12.20.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.13.tgz",
"integrity": "sha512-1x8W5OpxPq+T85OUsHRP6BqXeosKmeXRtjoF39STcdf/UWLqUsoehstZKOi0CunhVqHG17AyZgpj20eRVooK6A==",
"version": "12.20.15",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.15.tgz",
"integrity": "sha512-F6S4Chv4JicJmyrwlDkxUdGNSplsQdGwp1A0AJloEVDirWdZOAiRHhovDlsFkKUrquUXhz1imJhXHsf59auyAg==",
"dev": true
},
"@types/resolve": {
@ -1227,9 +1249,9 @@
"dev": true
},
"cacache": {
"version": "15.0.6",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-15.0.6.tgz",
"integrity": "sha512-g1WYDMct/jzW+JdWEyjaX2zoBkZ6ZT9VpOyp2I/VMtDsNLffNat3kqPFfi1eDRSK9/SuKGyORDHcQMcPF8sQ/w==",
"version": "15.2.0",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-15.2.0.tgz",
"integrity": "sha512-uKoJSHmnrqXgthDFx/IU6ED/5xd+NNGe+Bb+kLZy7Ku4P+BaiWEUflAKPZ7eAzsYGcsAGASJZsybXp+quEcHTw==",
"dev": true,
"requires": {
"@npmcli/move-file": "^1.0.1",
@ -1291,9 +1313,9 @@
"dev": true
},
"caniuse-lite": {
"version": "1.0.30001228",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz",
"integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==",
"version": "1.0.30001236",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001236.tgz",
"integrity": "sha512-o0PRQSrSCGJKCPZcgMzl5fUaj5xHe8qA2m4QRvnyY4e1lITqoNkr7q/Oh1NcpGSy0Th97UZ35yoKcINPoq7YOQ==",
"dev": true
},
"caseless": {
@ -1679,9 +1701,9 @@
"dev": true
},
"electron-to-chromium": {
"version": "1.3.731",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.731.tgz",
"integrity": "sha512-dn1Nyd0DuFa3xhqZJr6/L9phyk+YXJpvrz6Vcu6mFxFqr5TQ9r/F3yvOYFUrEwY4Tbb1YBjN19TDKnSVCQvalA==",
"version": "1.3.752",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.752.tgz",
"integrity": "sha512-2Tg+7jSl3oPxgsBsWKh5H83QazTkmWG/cnNwJplmyZc7KcN61+I10oUgaXSVk/NwfvN3BdkKDR4FYuRBQQ2v0A==",
"dev": true
},
"elliptic": {
@ -1721,9 +1743,9 @@
},
"dependencies": {
"iconv-lite": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz",
"integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==",
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"dev": true,
"optional": true,
"requires": {
@ -1761,12 +1783,6 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
},
"ws": {
"version": "7.4.5",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz",
"integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==",
"dev": true
}
}
},
@ -1798,9 +1814,9 @@
"dev": true
},
"es-abstract": {
"version": "1.18.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz",
"integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==",
"version": "1.18.3",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz",
"integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
@ -1811,14 +1827,14 @@
"has-symbols": "^1.0.2",
"is-callable": "^1.2.3",
"is-negative-zero": "^2.0.1",
"is-regex": "^1.1.2",
"is-string": "^1.0.5",
"object-inspect": "^1.9.0",
"is-regex": "^1.1.3",
"is-string": "^1.0.6",
"object-inspect": "^1.10.3",
"object-keys": "^1.1.1",
"object.assign": "^4.1.2",
"string.prototype.trimend": "^1.0.4",
"string.prototype.trimstart": "^1.0.4",
"unbox-primitive": "^1.0.0"
"unbox-primitive": "^1.0.1"
},
"dependencies": {
"object.assign": {
@ -2270,12 +2286,12 @@
"dev": true
},
"hash.js": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz",
"integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==",
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
"integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
"requires": {
"inherits": "^2.0.3",
"minimalistic-assert": "^1.0.0"
"minimalistic-assert": "^1.0.1"
}
},
"hasha": {
@ -3210,13 +3226,13 @@
}
},
"make-fetch-happen": {
"version": "8.0.14",
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz",
"integrity": "sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ==",
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.0.2.tgz",
"integrity": "sha512-UkAWAuXPXSSlVviTjH2We20mtj1NnZW2Qq/oTY2dyMbRQ5CR3Xed3akCDMnM7j6axrMY80lhgM7loNE132PfAw==",
"dev": true,
"requires": {
"agentkeepalive": "^4.1.3",
"cacache": "^15.0.5",
"cacache": "^15.2.0",
"http-cache-semantics": "^4.1.0",
"http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0",
@ -3227,6 +3243,7 @@
"minipass-fetch": "^1.3.2",
"minipass-flush": "^1.0.5",
"minipass-pipeline": "^1.2.4",
"negotiator": "^0.6.2",
"promise-retry": "^2.0.1",
"socks-proxy-agent": "^5.0.0",
"ssri": "^8.0.0"
@ -3250,18 +3267,18 @@
"dev": true
},
"mime-db": {
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
"version": "1.48.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz",
"integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==",
"dev": true
},
"mime-types": {
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"version": "2.1.31",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz",
"integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==",
"dev": true,
"requires": {
"mime-db": "1.47.0"
"mime-db": "1.48.0"
}
},
"minimalistic-assert": {
@ -3678,9 +3695,9 @@
}
},
"node-releases": {
"version": "1.1.72",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.72.tgz",
"integrity": "sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==",
"version": "1.1.73",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz",
"integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==",
"dev": true
},
"nomnom": {
@ -3764,9 +3781,9 @@
"dev": true
},
"npm-package-arg": {
"version": "8.1.2",
"resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.2.tgz",
"integrity": "sha512-6Eem455JsSMJY6Kpd3EyWE+n5hC+g9bSyHr9K9U2zqZb7+02+hObQ2c0+8iDk/mNF+8r1MhY44WypKJAkySIYA==",
"version": "8.1.4",
"resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.4.tgz",
"integrity": "sha512-xLokoCFqj/rPdr3LvcdDL6Kj6ipXGEDHD/QGpzwU6/pibYUOXmp5DBmg76yukFyx4ZDbrXNOTn+BPyd8TD4Jlw==",
"dev": true,
"requires": {
"hosted-git-info": "^4.0.1",
@ -3834,6 +3851,31 @@
"minipass-json-stream": "^1.0.1",
"minizlib": "^2.0.0",
"npm-package-arg": "^8.0.0"
},
"dependencies": {
"make-fetch-happen": {
"version": "8.0.14",
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz",
"integrity": "sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ==",
"dev": true,
"requires": {
"agentkeepalive": "^4.1.3",
"cacache": "^15.0.5",
"http-cache-semantics": "^4.1.0",
"http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0",
"is-lambda": "^1.0.1",
"lru-cache": "^6.0.0",
"minipass": "^3.1.3",
"minipass-collect": "^1.0.2",
"minipass-fetch": "^1.3.2",
"minipass-flush": "^1.0.5",
"minipass-pipeline": "^1.2.4",
"promise-retry": "^2.0.1",
"socks-proxy-agent": "^5.0.0",
"ssri": "^8.0.0"
}
}
}
},
"npmlog": {
@ -4115,9 +4157,9 @@
}
},
"pacote": {
"version": "11.3.3",
"resolved": "https://registry.npmjs.org/pacote/-/pacote-11.3.3.tgz",
"integrity": "sha512-GQxBX+UcVZrrJRYMK2HoG+gPeSUX/rQhnbPkkGrCYa4n2F/bgClFPaMm0nsdnYrxnmUy85uMHoFXZ0jTD0drew==",
"version": "11.3.4",
"resolved": "https://registry.npmjs.org/pacote/-/pacote-11.3.4.tgz",
"integrity": "sha512-RfahPCunM9GI7ryJV/zY0bWQiokZyLqaSNHXtbNSoLb7bwTvBbJBEyCJ01KWs4j1Gj7GmX8crYXQ1sNX6P2VKA==",
"dev": true,
"requires": {
"@npmcli/git": "^2.0.1",
@ -4133,7 +4175,7 @@
"npm-package-arg": "^8.0.1",
"npm-packlist": "^2.1.4",
"npm-pick-manifest": "^6.0.0",
"npm-registry-fetch": "^10.0.0",
"npm-registry-fetch": "^11.0.0",
"promise-retry": "^2.0.1",
"read-package-json-fast": "^2.0.1",
"rimraf": "^3.0.2",
@ -4142,13 +4184,12 @@
},
"dependencies": {
"npm-registry-fetch": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-10.1.1.tgz",
"integrity": "sha512-F6a3l+ffCQ7hvvN16YG5bpm1rPZntCg66PLHDQ1apWJPOCUVHoKnL2w5fqEaTVhp42dmossTyXeR7hTGirfXrg==",
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz",
"integrity": "sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0",
"make-fetch-happen": "^8.0.9",
"make-fetch-happen": "^9.0.1",
"minipass": "^3.1.3",
"minipass-fetch": "^1.3.0",
"minipass-json-stream": "^1.0.1",
@ -4191,9 +4232,9 @@
"dev": true
},
"path-parse": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
"performance-now": {
@ -4203,9 +4244,9 @@
"dev": true
},
"picomatch": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz",
"integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"dev": true
},
"pkg-dir": {
@ -4848,9 +4889,9 @@
}
},
"spdx-license-ids": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.8.tgz",
"integrity": "sha512-NDgA96EnaLSvtbM7trJj+t1LUR3pirkDCcz9nOUlPb5DMBGsH7oES6C3hs3j7R9oHEa1EMvReS/BUAIT5Tcr0g==",
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz",
"integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==",
"dev": true
},
"sprintf-js": {
@ -5411,9 +5452,9 @@
}
},
"ws": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz",
"integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ=="
"version": "7.4.6",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A=="
},
"xml2js": {
"version": "0.4.17",

@ -67,7 +67,7 @@
"aes-js": "3.0.0",
"aws-sdk": "2.137.0",
"diff": "4.0.1",
"flatworm": "0.0.2-beta.5",
"flatworm": "0.0.2-beta.6",
"jison": "0.4.18",
"karma": "6.3.2",
"karma-chrome-launcher": "3.1.0",
@ -92,13 +92,13 @@
"@types/mocha": "^5.2.0",
"aes-js": "3.0.0",
"bech32": "1.1.4",
"bn.js": "^4.4.0",
"bn.js": "^4.11.9",
"elliptic": "6.5.4",
"hash.js": "1.1.3",
"hash.js": "1.1.7",
"js-sha3": "0.5.7",
"scrypt-js": "3.0.1",
"solc": "0.7.1",
"tiny-inflate": "1.0.3",
"ws": "7.2.3"
"ws": "7.4.6"
}
}

@ -1,2 +1,2 @@
export declare const version = "abi/5.2.0";
export declare const version = "abi/5.3.1";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "abi/5.2.0";
export const version = "abi/5.3.1";
//# sourceMappingURL=_version.js.map

@ -814,7 +814,8 @@ function verifyType(type) {
// @TODO: more verification
return type;
}
const regexIdentifier = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
// See: https://github.com/ethereum/solidity/blob/1f8f1a3db93a548d0555e3e14cfc55a10e25b60e/docs/grammar/SolidityLexer.g4#L234
const regexIdentifier = new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");
function verifyIdentifier(value) {
if (!value || !value.match(regexIdentifier)) {
logger.throwArgumentError(`invalid identifier "${value}"`, "value", value);

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
export declare const version = "abi/5.2.0";
export declare const version = "abi/5.3.1";
//# sourceMappingURL=_version.d.ts.map

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "abi/5.2.0";
exports.version = "abi/5.3.1";
//# sourceMappingURL=_version.js.map

@ -859,7 +859,8 @@ function verifyType(type) {
// @TODO: more verification
return type;
}
var regexIdentifier = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
// See: https://github.com/ethereum/solidity/blob/1f8f1a3db93a548d0555e3e14cfc55a10e25b60e/docs/grammar/SolidityLexer.g4#L234
var regexIdentifier = new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");
function verifyIdentifier(value) {
if (!value || !value.match(regexIdentifier)) {
logger.throwArgumentError("invalid identifier \"" + value + "\"", "value", value);

File diff suppressed because one or more lines are too long

@ -1,15 +1,15 @@
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"@ethersproject/address": "^5.2.0",
"@ethersproject/bignumber": "^5.2.0",
"@ethersproject/bytes": "^5.2.0",
"@ethersproject/constants": "^5.2.0",
"@ethersproject/hash": "^5.2.0",
"@ethersproject/keccak256": "^5.2.0",
"@ethersproject/logger": "^5.2.0",
"@ethersproject/properties": "^5.2.0",
"@ethersproject/strings": "^5.2.0"
"@ethersproject/address": "^5.3.0",
"@ethersproject/bignumber": "^5.3.0",
"@ethersproject/bytes": "^5.3.0",
"@ethersproject/constants": "^5.3.0",
"@ethersproject/hash": "^5.3.0",
"@ethersproject/keccak256": "^5.3.0",
"@ethersproject/logger": "^5.3.0",
"@ethersproject/properties": "^5.3.0",
"@ethersproject/strings": "^5.3.0"
},
"description": "Utilities and Classes for parsing, formatting and managing Ethereum ABIs.",
"ethereum": "donations.ethers.eth",
@ -43,7 +43,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"sideEffects": false,
"tarballHash": "0xe6a078fafe9b871044b84c2f528321d6f35a175220d2d0cd29b5f7b75b7c3752",
"tarballHash": "0x2e024e140e942ced3e6c1540c7126c30520037c7fff8fb874791eb405ca401b1",
"types": "./lib/index.d.ts",
"version": "5.2.0"
"version": "5.3.1"
}

@ -1 +1 @@
export const version = "abi/5.2.0";
export const version = "abi/5.3.1";

@ -11,6 +11,7 @@ export interface JsonFragmentType {
readonly name?: string;
readonly indexed?: boolean;
readonly type?: string;
readonly internalType?: any; // @TODO: in v6 reduce type
readonly components?: ReadonlyArray<JsonFragmentType>;
}
@ -30,7 +31,6 @@ export interface JsonFragment {
readonly gas?: string;
};
const _constructorGuard = { };
// AST Node parser state
@ -1029,7 +1029,8 @@ function verifyType(type: string): string {
return type;
}
const regexIdentifier = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
// See: https://github.com/ethereum/solidity/blob/1f8f1a3db93a548d0555e3e14cfc55a10e25b60e/docs/grammar/SolidityLexer.g4#L234
const regexIdentifier = new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");
function verifyIdentifier(value: string): string {
if (!value || !value.match(regexIdentifier)) {
logger.throwArgumentError(`invalid identifier "${ value }"`, "value", value);

@ -1,2 +1,2 @@
export declare const version = "abstract-provider/5.2.0";
export declare const version = "abstract-provider/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "abstract-provider/5.2.0";
export const version = "abstract-provider/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,2 +1,2 @@
export declare const version = "abstract-provider/5.2.0";
export declare const version = "abstract-provider/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "abstract-provider/5.2.0";
exports.version = "abstract-provider/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,13 +1,13 @@
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"@ethersproject/bignumber": "^5.2.0",
"@ethersproject/bytes": "^5.2.0",
"@ethersproject/logger": "^5.2.0",
"@ethersproject/networks": "^5.2.0",
"@ethersproject/properties": "^5.2.0",
"@ethersproject/transactions": "^5.2.0",
"@ethersproject/web": "^5.2.0"
"@ethersproject/bignumber": "^5.3.0",
"@ethersproject/bytes": "^5.3.0",
"@ethersproject/logger": "^5.3.0",
"@ethersproject/networks": "^5.3.0",
"@ethersproject/properties": "^5.3.0",
"@ethersproject/transactions": "^5.3.0",
"@ethersproject/web": "^5.3.0"
},
"description": "An Abstract Class for describing an Ethereum Provider for ethers.",
"ethereum": "donations.ethers.eth",
@ -41,7 +41,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"sideEffects": false,
"tarballHash": "0x7b9f83b84726a18491bd1665ff4d856364aba22521e78572353d1d9995ac1c4e",
"tarballHash": "0xbe087cfc8ee43f3154f8006b382424ca7394b04d34fc089372ade08ba9cb65b6",
"types": "./lib/index.d.ts",
"version": "5.2.0"
"version": "5.3.0"
}

@ -1 +1 @@
export const version = "abstract-provider/5.2.0";
export const version = "abstract-provider/5.3.0";

@ -114,6 +114,7 @@ export interface TransactionReceipt {
confirmations: number,
cumulativeGasUsed: BigNumber,
byzantium: boolean,
type: number;
status?: number
};

@ -1,2 +1,2 @@
export declare const version = "abstract-signer/5.2.0";
export declare const version = "abstract-signer/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "abstract-signer/5.2.0";
export const version = "abstract-signer/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,2 +1,2 @@
export declare const version = "abstract-signer/5.2.0";
export declare const version = "abstract-signer/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "abstract-signer/5.2.0";
exports.version = "abstract-signer/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,11 +1,11 @@
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"@ethersproject/abstract-provider": "^5.2.0",
"@ethersproject/bignumber": "^5.2.0",
"@ethersproject/bytes": "^5.2.0",
"@ethersproject/logger": "^5.2.0",
"@ethersproject/properties": "^5.2.0"
"@ethersproject/abstract-provider": "^5.3.0",
"@ethersproject/bignumber": "^5.3.0",
"@ethersproject/bytes": "^5.3.0",
"@ethersproject/logger": "^5.3.0",
"@ethersproject/properties": "^5.3.0"
},
"description": "An Abstract Class for desribing an Ethereum Signer for ethers.",
"ethereum": "donations.ethers.eth",
@ -39,7 +39,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"sideEffects": false,
"tarballHash": "0x6a009bacd601b395a4cf53b290b3f3eb6e624fdaabf4b24940ecb1cf0836d096",
"tarballHash": "0x2123b325684a93493b8ba0e346cd2e9c4bc8aa2137c217ab428e6069b86d8885",
"types": "./lib/index.d.ts",
"version": "5.2.0"
"version": "5.3.0"
}

@ -1 +1 @@
export const version = "abstract-signer/5.2.0";
export const version = "abstract-signer/5.3.0";

@ -215,7 +215,7 @@ export abstract class Signer {
const hasEip1559 = (tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null);
if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {
logger.throwArgumentError("eip-1559 transaction do not support gasPrice", "transaction", transaction);
} else if ((tx.type === -1 || tx.type === 1) && hasEip1559) {
} else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {
logger.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "transaction", transaction);
}
@ -223,7 +223,7 @@ export abstract class Signer {
// Fully-formed EIP-1559 transaction (skip getFeeData)
tx.type = 2;
} else if (tx.type === -1 || tx.type === 1) {
} else if (tx.type === 0 || tx.type === 1) {
// Explicit Legacy or EIP-2930 transaction
// Populate missing gasPrice
@ -271,7 +271,7 @@ export abstract class Signer {
if (tx.gasPrice == null) { tx.gasPrice = feeData.gasPrice; }
// Explicitly set untyped transaction to legacy
tx.type = -1;
tx.type = 0;
} else {
// getFeeData has failed us.

@ -1,2 +1,2 @@
export declare const version = "address/5.2.0";
export declare const version = "address/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "address/5.2.0";
export const version = "address/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,2 +1,2 @@
export declare const version = "address/5.2.0";
export declare const version = "address/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "address/5.2.0";
exports.version = "address/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,11 +1,11 @@
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"@ethersproject/bignumber": "^5.2.0",
"@ethersproject/bytes": "^5.2.0",
"@ethersproject/keccak256": "^5.2.0",
"@ethersproject/logger": "^5.2.0",
"@ethersproject/rlp": "^5.2.0"
"@ethersproject/bignumber": "^5.3.0",
"@ethersproject/bytes": "^5.3.0",
"@ethersproject/keccak256": "^5.3.0",
"@ethersproject/logger": "^5.3.0",
"@ethersproject/rlp": "^5.3.0"
},
"description": "Utilities for handling Ethereum Addresses for ethers.",
"ethereum": "donations.ethers.eth",
@ -39,7 +39,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"sideEffects": false,
"tarballHash": "0x6396accbb490919f6a66877226d5e82ed911aa84c4041464b0d1e0237da69a2e",
"tarballHash": "0xa82e0a824c8508389be5bde68ac614fa98c1c867708e80c406b050ea75d12ad3",
"types": "./lib/index.d.ts",
"version": "5.2.0"
"version": "5.3.0"
}

@ -1 +1 @@
export const version = "address/5.2.0";
export const version = "address/5.3.0";

@ -1,2 +1,2 @@
export declare const version = "asm/5.2.0";
export declare const version = "asm/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "asm/5.2.0";
export const version = "asm/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,2 +1,2 @@
export declare const version = "asm/5.2.0";
export declare const version = "asm/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "asm/5.2.0";
exports.version = "asm/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,7 +1,7 @@
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"ethers": "^5.2.0"
"ethers": "^5.3.0"
},
"description": "ASM libraries and tools for the Ethereum EVM.",
"ethereum": "donations.ethers.eth",
@ -36,7 +36,7 @@
"generate": "node ./generate.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0xf903345c132095391c2259543c97dcac983d1ba94f75c60adb9e0026ce031086",
"tarballHash": "0xc19d11fdfbed4b581cab4b18a2f9c6e1b14e961fc6b80862b6b2eb48565ea394",
"types": "./lib/index.d.ts",
"version": "5.2.0"
"version": "5.3.0"
}

@ -1 +1 @@
export const version = "asm/5.2.0";
export const version = "asm/5.3.0";

@ -1,2 +1,2 @@
export declare const version = "base64/5.2.0";
export declare const version = "base64/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "base64/5.2.0";
export const version = "base64/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,2 +1,2 @@
export declare const version = "base64/5.2.0";
export declare const version = "base64/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "base64/5.2.0";
exports.version = "base64/5.3.0";
//# sourceMappingURL=_version.js.map

@ -7,7 +7,7 @@
"./lib/base64": "./lib/browser-base64.js"
},
"dependencies": {
"@ethersproject/bytes": "^5.2.0"
"@ethersproject/bytes": "^5.3.0"
},
"description": "Base64 coder.",
"ethereum": "donations.ethers.eth",
@ -41,7 +41,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"sideEffects": false,
"tarballHash": "0x74c5fce00eedf475f74d4890e6e1a83c281898964b9055d5645d1f3074dc87bf",
"tarballHash": "0x821a2974aa7e21005ac390712a7c3be0f412dd614c9d73cf8fc92c61acdfd868",
"types": "./lib/index.d.ts",
"version": "5.2.0"
"version": "5.3.0"
}

@ -1 +1 @@
export const version = "base64/5.2.0";
export const version = "base64/5.3.0";

@ -1,2 +1,2 @@
export declare const version = "basex/5.2.0";
export declare const version = "basex/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "basex/5.2.0";
export const version = "basex/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,2 +1,2 @@
export declare const version = "basex/5.2.0";
export declare const version = "basex/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "basex/5.2.0";
exports.version = "basex/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,8 +1,8 @@
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"@ethersproject/bytes": "^5.2.0",
"@ethersproject/properties": "^5.2.0"
"@ethersproject/bytes": "^5.3.0",
"@ethersproject/properties": "^5.3.0"
},
"description": "Base-X without Buffer.",
"ethereum": "donations.ethers.eth",
@ -36,7 +36,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"sideEffects": false,
"tarballHash": "0x13fff325a30baa5b8ba04f9fb8e9d1964843c445831d13a3d6e4eba849353900",
"tarballHash": "0x1757601373adf9bc3152479e9aca168ad2e9f55253923e45f46516fb60a5993d",
"types": "./lib/index.d.ts",
"version": "5.2.0"
"version": "5.3.0"
}

@ -1 +1 @@
export const version = "basex/5.2.0";
export const version = "basex/5.3.0";

@ -1,2 +1,2 @@
export declare const version = "bignumber/5.2.0";
export declare const version = "bignumber/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "bignumber/5.2.0";
export const version = "bignumber/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1 +1 @@
{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../src.ts/fixednumber.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,SAAS,EAAuB,MAAM,sBAAsB,CAAC;AAMhF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAiCtE,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CA0BzF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,CA6C5E;AAED,qBAAa,WAAW;IACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAkBnF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW;CA8CvC;AAED,qBAAa,WAAW;IACpB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;gBAErB,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW;IAkBnF,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAMtC,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,KAAK,IAAI,WAAW;IAcpB,OAAO,IAAI,WAAW;IAetB,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW;IAiBrC,MAAM,IAAI,OAAO;IAIjB,UAAU,IAAI,OAAO;IAIrB,QAAQ,IAAI,MAAM;IAElB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;IAOnC,aAAa,IAAI,MAAM;IAEvB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW;IAKnD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAchH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAwBrF,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAkBvF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM;IAqB9D,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW;CAGzD"}
{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../src.ts/fixednumber.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,SAAS,EAAuB,MAAM,sBAAsB,CAAC;AAMhF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAiCtE,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CA0BzF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,CA6C5E;AAED,qBAAa,WAAW;IACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAkBnF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW;CA8CvC;AAED,qBAAa,WAAW;IACpB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;gBAErB,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW;IAkBnF,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAMtC,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,KAAK,IAAI,WAAW;IAcpB,OAAO,IAAI,WAAW;IAetB,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW;IAmBrC,MAAM,IAAI,OAAO;IAIjB,UAAU,IAAI,OAAO;IAIrB,QAAQ,IAAI,MAAM;IAElB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;IAOnC,aAAa,IAAI,MAAM;IAEvB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW;IAKnD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAchH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAwBrF,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAkBvF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM;IAqB9D,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW;CAGzD"}

@ -255,8 +255,9 @@ export class FixedNumber {
if (comps[1].length <= decimals) {
return this;
}
const factor = FixedNumber.from("1" + zeros.substring(0, decimals));
return this.mulUnsafe(factor).addUnsafe(BUMP).floor().divUnsafe(factor);
const factor = FixedNumber.from("1" + zeros.substring(0, decimals), this.format);
const bump = BUMP.toFormat(this.format);
return this.mulUnsafe(factor).addUnsafe(bump).floor().divUnsafe(factor);
}
isZero() {
return (this._value === "0.0" || this._value === "0");

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
export declare const version = "bignumber/5.2.0";
export declare const version = "bignumber/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "bignumber/5.2.0";
exports.version = "bignumber/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1 +1 @@
{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../src.ts/fixednumber.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,SAAS,EAAuB,MAAM,sBAAsB,CAAC;AAMhF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAiCtE,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CA0BzF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,CA6C5E;AAED,qBAAa,WAAW;IACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAkBnF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW;CA8CvC;AAED,qBAAa,WAAW;IACpB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;gBAErB,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW;IAkBnF,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAMtC,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,KAAK,IAAI,WAAW;IAcpB,OAAO,IAAI,WAAW;IAetB,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW;IAiBrC,MAAM,IAAI,OAAO;IAIjB,UAAU,IAAI,OAAO;IAIrB,QAAQ,IAAI,MAAM;IAElB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;IAOnC,aAAa,IAAI,MAAM;IAEvB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW;IAKnD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAchH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAwBrF,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAkBvF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM;IAqB9D,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW;CAGzD"}
{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../src.ts/fixednumber.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,SAAS,EAAuB,MAAM,sBAAsB,CAAC;AAMhF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAiCtE,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CA0BzF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,CA6C5E;AAED,qBAAa,WAAW;IACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAkBnF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW;CA8CvC;AAED,qBAAa,WAAW;IACpB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;gBAErB,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW;IAkBnF,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAMtC,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAO1C,KAAK,IAAI,WAAW;IAcpB,OAAO,IAAI,WAAW;IAetB,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW;IAmBrC,MAAM,IAAI,OAAO;IAIjB,UAAU,IAAI,OAAO;IAIrB,QAAQ,IAAI,MAAM;IAElB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;IAOnC,aAAa,IAAI,MAAM;IAEvB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW;IAKnD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAchH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAwBrF,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW;IAkBvF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM;IAqB9D,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW;CAGzD"}

@ -262,8 +262,9 @@ var FixedNumber = /** @class */ (function () {
if (comps[1].length <= decimals) {
return this;
}
var factor = FixedNumber.from("1" + zeros.substring(0, decimals));
return this.mulUnsafe(factor).addUnsafe(BUMP).floor().divUnsafe(factor);
var factor = FixedNumber.from("1" + zeros.substring(0, decimals), this.format);
var bump = BUMP.toFormat(this.format);
return this.mulUnsafe(factor).addUnsafe(bump).floor().divUnsafe(factor);
};
FixedNumber.prototype.isZero = function () {
return (this._value === "0.0" || this._value === "0");

File diff suppressed because one or more lines are too long

@ -1,9 +1,9 @@
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"@ethersproject/bytes": "^5.2.0",
"@ethersproject/logger": "^5.2.0",
"bn.js": "^4.4.0"
"@ethersproject/bytes": "^5.3.0",
"@ethersproject/logger": "^5.3.0",
"bn.js": "^4.11.9"
},
"description": "BigNumber library used in ethers.js.",
"ethereum": "donations.ethers.eth",
@ -38,7 +38,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"sideEffects": false,
"tarballHash": "0xf541fda3d586d4a9bef45fda1cffa2ef3be324945925e16d0dc04470b59dce11",
"tarballHash": "0xc336fdf23f021191c1bd468144f8abca13027b0a1579c45cee6750faf3b607cb",
"types": "./lib/index.d.ts",
"version": "5.2.0"
"version": "5.3.0"
}

@ -1 +1 @@
export const version = "bignumber/5.2.0";
export const version = "bignumber/5.3.0";

@ -288,8 +288,10 @@ export class FixedNumber {
if (comps[1].length <= decimals) { return this; }
const factor = FixedNumber.from("1" + zeros.substring(0, decimals));
return this.mulUnsafe(factor).addUnsafe(BUMP).floor().divUnsafe(factor);
const factor = FixedNumber.from("1" + zeros.substring(0, decimals), this.format);
const bump = BUMP.toFormat(this.format);
return this.mulUnsafe(factor).addUnsafe(bump).floor().divUnsafe(factor);
}
isZero(): boolean {

@ -1,2 +1,2 @@
export declare const version = "bytes/5.2.0";
export declare const version = "bytes/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "bytes/5.2.0";
export const version = "bytes/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,2 +1,2 @@
export declare const version = "bytes/5.2.0";
export declare const version = "bytes/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "bytes/5.2.0";
exports.version = "bytes/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,7 +1,7 @@
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"@ethersproject/logger": "^5.2.0"
"@ethersproject/logger": "^5.3.0"
},
"description": "Bytes utility functions for ethers.",
"ethereum": "donations.ethers.eth",
@ -37,7 +37,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"sideEffects": false,
"tarballHash": "0xf5c9822d7ad93e85a836d07774c105a2c8a70c1e6e111b1dcaf49d6e00bd375d",
"tarballHash": "0xa7b4b67ea3e558b3a66e704cc9663f2cdf51f9c74c0cfd1e8db78482cc4ecf3b",
"types": "./lib/index.d.ts",
"version": "5.2.0"
"version": "5.3.0"
}

@ -1 +1 @@
export const version = "bytes/5.2.0";
export const version = "bytes/5.3.0";

@ -1,2 +1,2 @@
export declare const version = "cli/5.2.0";
export declare const version = "cli/5.3.0";
//# sourceMappingURL=_version.d.ts.map

@ -1,2 +1,2 @@
export const version = "cli/5.2.0";
export const version = "cli/5.3.0";
//# sourceMappingURL=_version.js.map

@ -1,2 +1,2 @@
export declare const version = "cli/5.2.0";
export declare const version = "cli/5.3.0";
//# sourceMappingURL=_version.d.ts.map

Some files were not shown because too many files have changed in this diff Show More