Compare commits

..

45 Commits

Author SHA1 Message Date
Richard Moore
c414a45825 Updated dist files. 2020-07-30 17:04:53 -04:00
Richard Moore
e2d6f281d5 Abstract fetchJson for data. 2020-07-30 17:03:36 -04:00
Richard Moore
ba404ffb0b Updated dist files. 2020-07-20 02:27:26 -04:00
Richard Moore
af10705632 Add testcases for setLogLevel (#947). 2020-07-20 01:43:47 -04:00
Richard Moore
5443363de4 Fix Logger setLogLevel with enum case mismatch (#947). 2020-07-20 01:43:02 -04:00
Richard Moore
e3f7426af4 Removed UUID dependency from json-wallets (#966). 2020-07-20 01:33:15 -04:00
Richard Moore
8b907d5f5f Added link to Chrome CLI switches for Karma Browser Tests. 2020-07-19 01:19:38 -04:00
Richard Moore
771190202f Fixed typo in DAI docs example (#958). 2020-07-18 06:08:45 -04:00
Richard Moore
5a4e3ede2a Updated browser tests to lie about User-Agent to fix Etherscan tests. 2020-07-18 03:58:19 -04:00
Richard Moore
78b350bbc5 Removed unnecessary dependency from BigNumber (#951). 2020-07-16 05:47:58 -04:00
Richard Moore
fe2f0f7489 Updated dist files. 2020-07-16 05:35:32 -04:00
Richard Moore
9f20258d5d Longer Etherscan throttle slot interval. 2020-07-16 05:29:33 -04:00
Richard Moore
63dd3d4682 Fixed ENS overrides for the default provider (#959). 2020-07-16 05:27:36 -04:00
Richard Moore
b1166211e2 Updated dist files. 2020-07-15 14:00:36 -04:00
Richard Moore
7d43545303 Added Retry-After support and adjustable slot interval to fetchJson. 2020-07-14 22:50:05 -04:00
Richard Moore
6fa853b309 Updated dist files. 2020-07-14 02:33:30 -04:00
Richard Moore
88c7eaed06 Added initial throttling support (#139, #904, #926). 2020-07-14 02:26:45 -04:00
Richard Moore
c730cbc629 docs: Added Provider api-keys page. 2020-07-14 02:12:59 -04:00
Richard Moore
4ef3fc501b docs: Updated code samples to use WebSocketProvider destroy. 2020-07-14 02:11:57 -04:00
Richard Moore
c22fd3e73d Fixed CI fail-fast and continue-on-error 2020-07-13 19:48:31 -04:00
Richard Moore
78eb9d6176 Updated dist files. 2020-07-13 09:34:20 -04:00
Richard Moore
00f4ba0eeb Prevent a CI job failure from killing the workflow. 2020-07-13 09:28:08 -04:00
Richard Moore
588f64c760 Use status code 1000 on WebSocket hangup for compatibility. 2020-07-13 09:27:08 -04:00
Richard Moore
6039464342 Updated dist files. 2020-07-13 08:50:41 -04:00
Richard Moore
866ab30400 Removing node v14 from CI (temporary). 2020-07-13 08:42:40 -04:00
Richard Moore
57fd6f0604 Updated WebSocketProvider to use web-style event listener API. 2020-07-13 08:41:54 -04:00
Richard Moore
49e83b0c4d Updated dist files. 2020-07-13 08:03:56 -04:00
Richard Moore
1cfe4962aa Added tests to help fill out coverage tests. 2020-07-13 07:30:49 -04:00
Richard Moore
79b1da130b Normalize formatUnits to simplified decimals. 2020-07-13 07:28:56 -04:00
Richard Moore
e128bfcd10 Prevent zero-padding on Solidity type lengths. 2020-07-13 07:28:05 -04:00
Richard Moore
e3d3e604f2 Set sensible defaults for INFURA and AlchemyAPI getWebSocketProvider methods. 2020-07-13 07:26:40 -04:00
Richard Moore
619a8888eb Added logger assert methods. 2020-07-13 07:24:57 -04:00
Richard Moore
c304d37cbd Added coverage keep-alive reporter. 2020-07-13 07:23:41 -04:00
Richard Moore
149e0839b1 Added TypeScript map generation and files. 2020-07-13 06:50:29 -04:00
Richard Moore
0c1d55b6dc Added initial code coverage testing. 2020-07-13 06:48:33 -04:00
Richard Moore
d0a79c6a13 Added destroy to WebSocketProvider. 2020-07-12 05:02:08 -04:00
Richard Moore
c6601769ad Updated packages (security updates). 2020-07-08 12:33:55 -04:00
Richard Moore
a78ca7eb8d Updated docs. 2020-07-07 23:20:32 -04:00
Richard Moore
59239d2f61 Updated dist files. 2020-07-07 23:19:00 -04:00
Richard Moore
bf65ddbff0 Fixed splitSignature when recoveryParam is encoded directly (#893, #933). 2020-07-07 22:54:35 -04:00
Richard Moore
7e56f3d392 Fixed BigNumber string validation (#935). 2020-07-07 22:18:02 -04:00
Richard Moore
4124a568fd Adding @yuetloo web3 migration docs. 2020-07-06 18:26:11 -04:00
Yuet Loo Wong
db7202578d migration from web3 2020-07-06 17:47:51 -04:00
Richard Moore
e38fa1cdd4 Updated spell check script. 2020-07-05 00:03:50 -04:00
Richard Moore
a1b2a62e6b Updated docs build. 2020-07-05 00:02:47 -04:00
997 changed files with 14658 additions and 2424 deletions

View File

@@ -6,13 +6,15 @@ on:
- master
jobs:
test-node:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [8.x, 10.x, 12.x, 13.x]
node-version: [8.x, 10.x, 12.x, 13.x ]
steps:
- name: Use Node.js ${{ matrix.node-version }}
@@ -22,13 +24,16 @@ jobs:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run bootstrap
- run: npm run build-all
- run: npm run test-node
test-browser:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module: [ 'esm', 'umd' ]
@@ -39,5 +44,24 @@ jobs:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run bootstrap
- run: npm run build-all
- run: npm run test-browser-${{ matrix.module }}
coverage:
name: Coverage
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: actions/checkout@v2
- run: npm ci
- run: npm run bootstrap
- run: npm run build-all
- run: npm run test-coverage

2
.gitignore vendored
View File

@@ -18,3 +18,5 @@ lerna-debug.log
packages/*/tsconfig.tsbuildinfo
packages/testcases/input/nameprep/**
.nyc_output/**

View File

@@ -3,6 +3,37 @@ Changelog
This change log is managed by `scripts/cmds/update-versions` but may be manually updated.
ethers/v5.0.7 (2020-07-20 02:22)
--------------------------------
- Fix Logger setLogLevel with enum case mismatch. ([#947](https://github.com/ethers-io/ethers.js/issues/947); [5443363](https://github.com/ethers-io/ethers.js/commit/5443363de43e92de712e72d55165c3f4d7f652e9), [af10705](https://github.com/ethers-io/ethers.js/commit/af10705632bc1f8203ea50ea7ed3120b01c67122))
- Removed UUID dependency from json-wallets. ([#966](https://github.com/ethers-io/ethers.js/issues/966); [e3f7426](https://github.com/ethers-io/ethers.js/commit/e3f7426af4d6d7e43db322700d768216b06433e0))
- Removed unnecessary dependency from BigNumber. ([#951](https://github.com/ethers-io/ethers.js/issues/951); [78b350b](https://github.com/ethers-io/ethers.js/commit/78b350bbc5ea73561bf47038743b9e51049496f7))
ethers/v5.0.6 (2020-07-16 05:54)
--------------------------------
- Removed unnecessary dependency from BigNumber. ([#951](https://github.com/ethers-io/ethers.js/issues/951); [78b350b](https://github.com/ethers-io/ethers.js/commit/78b350bbc5ea73561bf47038743b9e51049496f7))
- Longer Etherscan throttle slot interval. ([9f20258](https://github.com/ethers-io/ethers.js/commit/9f20258d5d39cd901d2078275323071eb0f3505b))
- Fixed ENS overrides for the default provider. ([#959](https://github.com/ethers-io/ethers.js/issues/959); [63dd3d4](https://github.com/ethers-io/ethers.js/commit/63dd3d4682b564445948988243fa9139c598587b))
- Added Retry-After support and adjustable slot interval to fetchJson. ([7d43545](https://github.com/ethers-io/ethers.js/commit/7d435453039f009b339d835ddee47e35a843711b))
- Added initial throttling support. ([#139](https://github.com/ethers-io/ethers.js/issues/139), [#904](https://github.com/ethers-io/ethers.js/issues/904), [#926](https://github.com/ethers-io/ethers.js/issues/926); [88c7eae](https://github.com/ethers-io/ethers.js/commit/88c7eaed061ae9a6798733a97e4e87011d36b8e7))
- Use status code 1000 on WebSocket hangup for compatibility. ([588f64c](https://github.com/ethers-io/ethers.js/commit/588f64c760ee49bfb5109bfbaafb4beafe41c52a))
- Updated WebSocketProvider to use web-style event listener API. ([57fd6f0](https://github.com/ethers-io/ethers.js/commit/57fd6f06047a1a2a3a46fe8b23ff585293a40062))
- Normalize formatUnits to simplified decimals. ([79b1da1](https://github.com/ethers-io/ethers.js/commit/79b1da130be50df80c7e5aeb221edc5669fc211e))
- Prevent zero-padding on Solidity type lengths. ([e128bfc](https://github.com/ethers-io/ethers.js/commit/e128bfcd10e006c920532151598700ca33a2127e))
- Set sensible defaults for INFURA and AlchemyAPI getWebSocketProvider methods. ([e3d3e60](https://github.com/ethers-io/ethers.js/commit/e3d3e604f299edbafe7d0721c0a3eff5f67c83f4))
- Added logger assert methods. ([619a888](https://github.com/ethers-io/ethers.js/commit/619a8888ebe08de9956f60c16703fb3543aeacc4))
- Added initial code coverage testing. ([0c1d55b](https://github.com/ethers-io/ethers.js/commit/0c1d55b6dc9c725c86e849d13b911c8bace9821d))
- Added destroy to WebSocketProvider. ([d0a79c6](https://github.com/ethers-io/ethers.js/commit/d0a79c6a1362e12f6f102e4af99adfef930092db))
- Updated packages (security updates). ([c660176](https://github.com/ethers-io/ethers.js/commit/c6601769ada64832b1ce392680a30cb145c3cab9))
ethers/v5.0.5 (2020-07-07 23:18)
--------------------------------
- Fixed splitSignature when recoveryParam is encoded directly. ([#893](https://github.com/ethers-io/ethers.js/issues/893), [#933](https://github.com/ethers-io/ethers.js/issues/933); [bf65ddb](https://github.com/ethers-io/ethers.js/commit/bf65ddbff0036f6eb8e99c145f30edff157687f5))
- Fixed BigNumber string validation. ([#935](https://github.com/ethers-io/ethers.js/issues/935); [7e56f3d](https://github.com/ethers-io/ethers.js/commit/7e56f3d392e52815c5c859772b99660e0fc38ef5))
ethers/v5.0.4 (2020-07-04 23:46)
--------------------------------

View File

@@ -66,7 +66,7 @@ Browse the [documentation](https://docs.ethers.io/v5/) online:
- [Full API Documentation](https://docs.ethers.io/v5/api/)
- [Various Ethereum Articles](https://blog.ricmoo.com/)
Or browse the entire documentation as a [single page](https://docs.ethers.io/single-page/) to make searching easier.
Or browse the entire documentation as a [single page](https://docs.ethers.io/v5/single-page/) to make searching easier.
Ancillary Packages

View File

@@ -16,8 +16,8 @@ decrypt decrypted decrypting deployed deploying deprecated detected
discontinued earliest email enabled encoded encoding encrypt
encrypted encrypting entries euro exceeded existing expected
expired failed fetches formatted formatting funding generated
has ignoring implemented implementer imported including instantiate
keyword labelled larger lookup matches mined modified modifies multi
hardened has ignoring implemented implementer imported including instantiate
joined keyword labelled larger lookup matches mined modified modifies multi
named needed nested neutered numeric offline optimizer overriding owned packed
padded parsed parsing passed placeholder processing properties reached
recommended recovered redacted remaining replaced required
@@ -43,14 +43,14 @@ ABIEncoder testcase numberish Wordlist
// Common Code Strings
abi addr api app arg arrayify asm basex bigint bignumber bn byte
bytecode callback calldata checksum ciphertext cli codepoint config
bytecode callback calldata checksum ciphertext cli codepoint commify config
contenthash ctr ctrl debug dd dklen eexist encseed eof ethaddr
ethseed ethers eval exec filename func gz hid http https hw iv
info init ipc json kdf kdfparams labelhash lang lib mm multihash nfc
nfkc nfd nfkd nodehash nullish oob opcode pbkdf pc plugin pragma pre prf
repl rpc sighash topichash solc stdin stdout subclasses subnode
timeout todo txt ufixed utc utf util url uuid vm vs websocket
wikipedia wx xe yyyy zlib
wikipedia wx xe xpriv xpub xx yyyy zlib
// AbiV2
abiv
@@ -58,9 +58,10 @@ abiv
// Query parameters
apikey asc endblock startblock
Cloudflare Etherscan INFURA IPFS MetaMask Nodesmith Trezor ledgerhq
axic bitcoinjs browserify easyseed ethereumjs
goerli homestead kotti kovan mainnet morden mordor rinkeby ropsten testnet
alchemyapi Cloudflare Etherscan INFURA IPFS MetaMask Nodesmith
Trezor ledgerhq axic bitcoinjs browserify easyseed ethereumjs
goerli homestead kotti kovan mainnet morden mordor rinkeby
ropsten testnet
// Demo words
args foo eth foo foobar ll localhost passwd ricmoo tx xxx yna

103
docs.wrm/api-keys.wrm Normal file
View File

@@ -0,0 +1,103 @@
_section: Provider API Keys @<api-keys>
//( **TL; DR** &ndash; sign up for your own API keys with the links below to improve your application performance )//
When using a [[Provider]] backed by an API service (such as [[link-alchemy]],
[[link-etherscan]] or [[link-infura]]), the service requires an API key,
which allows each service to track individual projects and their usage and
permissions.
The ethers library offers default API keys for each service, so that each
[[Provider]] works out-of-the-box.
These API keys are a provided as a community resource by the backend services
for low-traffic projects and for early prototyping.
Since these API keys are shared by all users (that have not acquired their
own API key), they are aggressively throttled which means reties occur more
frequently and the responses are slower.
It is **highly recommended** that you sign up for a free API key from each service for their
free tier, which (depending on the service) includes many advantages:
- a much **higher request rate** and concurrent request limit
- **faster** responses with fewer retries and timeouts
- useful **metric tracking** for performance tuning and to analyze your customer behaviour
- more **advanced APIs**, such as archive data or advanced log queries
_subsection: Etherscan @<api-keys--etherscan>
Etherscan is an Ethereum block explorer, which is possibly the most useful
developer tool for building and debugging Ethereum applications.
They offer an extensive collection of API endpoints which provide all the
operations required to interact with the Ethereum Blockchain.
[Sign up for a free API key on Etherscan](link-etherscan-signup)
**Benefits:**
- higher rate limit (since you are not using the [shared rate limit](link-etherscan-ratelimit))
- customer usage metrics
_subsection: INFURA @<api-keys--infura>
The INFURA service has been around for quite some time and is very robust
and reliable and highly recommend.
They offer a standard JSON-RPC interface and a WebSocket interface, which makes
interaction with standard tools versatile, simple and straight forward.
[Sign up for a free Project ID on INFURA](link-infura-signup)
**Benefits:**
- higher rate limit
- customer usage metrics
- access to archive data (requires paid upgrade)
_subsection: Alchemy @<api-keys--alchemy>
The Alchemy service has been around a few years and is also very robust
and reliable.
They offer a standard JSON-RPC interface and a WebSocket interface, as well
as a collection of advanced APIs for interacting with tokens and to assist
with debugging.
[Sign up for a free API key on Alchemy](link-alchemy-signup)
**Benefits:**
- higher rate limit
- customer usage metrics
- access to advanced token balance and metadata APIs
- access to advanced debugging trace and revert reason APIs
_subsection: Creating a Default Provider @<api-keys--getDefaultProvider>
The [default provider](providers-getDefaultProvider) connects to multiple
backends and verifies their results internally, making it simple to have
a high level of trust in third-party services.
A second optional parameter allows API keys to be specified to each
Provider created internally and any API key omitted will fallback onto
using the default API key for that service.
It is **highly recommended** that you provide an API for each service, to
maximize your applications performance.
_code: Passing API Keys into getDefaultProvider @lang<script>
// Use the mainnet
const network = "homestead";
// Specify your own API keys
// Each is optional, and if you omit it the default
// API key for that service will be used.
const provider = ethers.getDefaultProvider(network, {
etherscan: YOUR_ETHERSCAN_API_KEY,
infura: YOUR_INFURA_PROJECT_ID,
alchemy: YOUR_ALCHEMY_API_KEY
});

View File

@@ -4,9 +4,9 @@ An Application Programming Interface (API) is the formal
specification of the library.
_toc:
contract
signer
providers
signer
contract
utils
other
experimental

View File

@@ -145,9 +145,7 @@ provider = new InfuraProvider("homestead", {
// Connect to the INFURA WebSocket endpoints with a WebSocketProvider
provider = InfuraProvider.getWebSocketProvider()
// <hide>
provider._websocket.onopen = function(){
provider._websocket.close();
};
provider.destroy();
// </hide>
@@ -196,6 +194,12 @@ provider = new AlchemyProvider("ropsten");
provider = new AlchemyProvider(null, apiKey);
provider = new AlchemyProvider("homestead", apiKey);
// Connect to the Alchemy WebSocket endpoints with a WebSocketProvider
provider = AlchemyProvider.getWebSocketProvider()
// <hide>
provider.destroy();
// </hide>
_subsection: CloudflareProvider @<CloudflareProvider> @inherit<[[UrlJsonRpcProvider]]> @src<providers:class.CloudflareProvider>

View File

@@ -282,7 +282,7 @@ provider.once(txHash, (transaction) => {
filter = {
address: "dai.tokens.ethers.eth",
topics: [
utils.id("Transfer(address,address,uint256")
utils.id("Transfer(address,address,uint256)")
]
}
provider.on(filter, (log, event) => {
@@ -293,7 +293,7 @@ provider.on(filter, (log, event) => {
// Notice this is an array of topic-sets and is identical to
// using a filter with no address (i.e. match any address)
topicSets = [
utils.id("Transfer(address,address,uint256"),
utils.id("Transfer(address,address,uint256)"),
null,
[
myAddress,

View File

@@ -181,12 +181,18 @@ module.exports = {
"link-infura": { name: "INFURA", url: "https:/\/infura.io" },
"link-ledger": "https:/\/www.ledger.com",
"link-metamask": { name: "Metamask", url: "https:/\/metamask.io/" },
"link-otto": "https:/\/github.com/robertkrimen/otto",
"link-parity": { name: "Parity", url: "https:/\/www.parity.io" },
"link-rtd": "https:/\/github.com/readthedocs/sphinx_rtd_theme",
"link-semver": { name: "semver", url: "https:/\/semver.org" },
"link-solidity": { name: "Solidity" , url: "https:/\/solidity.readthedocs.io/en/v0.6.2/" },
"link-sphinx": { name: "Sphinx", url: "https:/\/www.sphinx-doc.org/" },
"link-alchemy-signup": "https:/\/alchemyapi.io/signup",
"link-etherscan-signup": "https:/\/etherscan.io/apis",
"link-etherscan-ratelimit": "https:/\/info.etherscan.com/api-return-errors/",
"link-infura-signup": "https:/\/infura.io/register",
"link-json-rpc": "https:/\/github.com/ethereum/wiki/wiki/JSON-RPC",
"link-web3-send": "https:/\/github.com/ethereum/web3.js/blob/1.x/packages/web3-providers-http/types/index.d.ts#L57",
"link-parity-trace": "https:/\/openethereum.github.io/wiki/JSONRPC-trace-module",
@@ -197,6 +203,11 @@ module.exports = {
"link-legacy-docs3": "https:/\/docs.ethers.io/v3/",
"link-legacy-docs4": "https:/\/docs.ethers.io/v4/",
"link-github-ci": "https:/\/github.com/ethers-io/ethers.js/actions/runs/158006903",
"link-github-issues": "https:/\/github.com/ethers-io/ethers.js/issues",
"link-issue-407": "https:/\/github.com/ethers-io/ethers.js/issues/407",
"link-infura-secret": "https:/\/infura.io/docs/gettingStarted/authentication",
"link-web3": "https:/\/github.com/ethereum/web3.js",
@@ -237,6 +248,7 @@ module.exports = {
"link-js-bigint": "https:/\/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt",
"link-js-normalize": { name: "String.normalize", url: "https:/\/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize" },
"link-js-maxsafe": "https:/\/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER#Description",
"link-js-proxy": "https:/\/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
"link-js-typedarray": "https:/\/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray",
"link-ricmoo-humanreadableabi": "https:/\/blog.ricmoo.com/human-readable-contract-abis-in-ethers-js-141902f4d917",

View File

@@ -38,6 +38,7 @@ _toc:
getting-started
concepts
api-keys
api
cli
cookbook

View File

@@ -1,5 +1,16 @@
_section: Migration: From Ethers v4 @<migration-v4>
This document only covers the features present in v4 which have changed
in some important way in v5.
It does not cover all the new additional featuers that have been added and
mainly aims to help those updating their older scripts and applications to
retain functional parity.
If you encounter any missing changes, please let me know and I'll update this
guide.
_subsection: BigNumber
_heading: Namespace
@@ -18,6 +29,7 @@ ethers.BigNumberish
_heading: Creating Instances
The ``bigNumberify`` method was always preferred over the constructor
since it could short-circuit an object instantiation for [[BigNumber]
objects (since they are immutable). This has been moved to a static
@@ -37,9 +49,99 @@ ethers.BigNumber.from(someValue)
_subsection: Contracts
_code: @lang<script>
_heading: ENS Name Resolution
// @TODO
The name of the resolved address has changed. If the address passed into the
constructor was an ENS name, the address will be resovled before any calls
are made to the contract.
The name of the property where the resolved address has changed from ``addressPromise``
to ``resolvedAddress``.
_code: Resolved ENS Names @lang<script>
// v4
contract.addressPromise
// v5
contract.resolvedAddress
_heading: Gas Estimation
The only difference in gas estimation is that the bucket has changed
its name from ``estimate`` to ``estimateGas``.
_code: Gas Estimation @lang<script>
// v4
contract.estimate.transfer(toAddress, amount)
// v5
contract.estimateGas.transfer(toAddress, amount)
_heading: Functions
In a contract in ethers, there is a ``functions`` bucket, which exposes
all the methods of a contract.
All these functions are available on the root contract itself as well
and historically there was no difference between ``contact.foo`` and
``contract.functions.foo``. The original reason for the ``functions`` bucket
was to help when there were method names that collided with other buckets,
which is rare.
In v5, the ``functions`` bucket is now intended to help with frameworks and
for the new error recovery API, so most users should use the methods on the
root contract.
The main difference will occur when a contract method only returns a single
item. The root method will dereference this automatically while the ``functions``
bucket will preserve it as an [[Result]].
If a method returns multiple items, there is no difference.
This helps when creating a framework, since the result will always be known to
have the same number of components as the [[Fragment]] outputs, without having
to handle the special case of a single return value.
_code: Functions Bucket @lang<script>
const abi = [
// Returns a single value
"function single() view returns (uint8)",
// Returns two values
"function double() view returns (uint8, uint8)",
];
// v4
await contract.single()
// 123
await contract.functions.single()
// 123
// v5 (notice the change in the .function variant)
await contract.single()
// 123
await contract.functions.single()
// [ 123 ]
// v4
await contract.double()
// [ 123, 5 ]
await contract.functions.double()
// [ 123, 5 ]
// v5 (no difference from v4)
await contract.double()
// [ 123, 5 ]
await contract.functions.double()
// [ 123, 5 ]
_subsection: Errors
@@ -84,6 +186,7 @@ logger.info(...)
_subsection: Interface
The [[Interface]] object has undergone the most dramatic changes.
It is no longer a meta-class and now has methods that simplify handling
@@ -178,14 +281,6 @@ const eventSig = eventFragment.format()
const topic = interface.getTopic(eventFragment)
_subsection: Utilities
_heading: Renaming
_code: @lang<script>
// @TODO
_subsection: Wallet
_heading: Mnemonic Phrases

View File

@@ -1,13 +1,198 @@
_section: Migration: From Web3.js
TODO
_subsection: Contracts
This migration guide focuses on migrating web3.js version 1.2.9 to ethers.js v5.
_subsection: Providers
In ethers, a provider provides an abstraction for a connection to the Ethereum Network. It can be used to issue read only queries and send signed state changing transactions to the Ethereum Network.
_heading: Connecting to Ethereum
_code: @lang<script>
// web3
var Web3 = require('web3');
var web3 = new Web3('http://localhost:8545');
// ethers
var ethers = require('ethers');
const url = "http://127.0.0.1:8545";
const provider = new ethers.providers.JsonRpcProvider(url);
_heading: Connecting to Ethereum: Metamask
_code: @lang<script>
// web3
const web3 = new Web3(Web3.givenProvider);
// ethers
const provider = new ethers.providers.Web3Provider(window.ethereum);
_subsection: Signers
In ethers, a **signer** is an abstraction of an Ethereum Account. It can be used to sign messages and transactions and send signed transactions to the Ethereum Network.
In web3, an account can be used to sign messages and transactions.
_heading: Creating signer
_code: @lang<script>
// web3
const account = web3.eth.accounts.create();
// ethers (create random new account)
const signer = ethers.Wallet.createRandom();
// ethers (connect to JSON-RPC accounts)
const signer = provider.getSigner();
_heading: Signing a message
_code: @lang<script>
// web3 (using a private key)
signature = web3.eth.accounts.sign('Some data', privateKey)
// web3 (using a JSON-RPC account)
// @TODO
// ethers
signature = await signer.signMessage('Some data')
_subsection: Contracts
A contract object is an abstraction of a smart contract on the Ethereum Network. It allows for easy interaction with the smart contact.
_heading: Deploying a Contract
_code: @lang<script>
// web3
const contract = new web3.eth.Contract(abi);
contract.deploy({
data: bytecode,
arguments: ["my string"]
})
.send({
from: "0x12598d2Fd88B420ED571beFDA8dD112624B5E730",
gas: 150000,
gasPrice: "30000000000000"
}), function(error, transactionHash){ ... })
.then(function(newContract){
console.log('new contract', newContract.options.address)
});
// ethers
const signer = provider.getSigner();
const factory = new ethers.ContractFactory(abi, bytecode, signer);
const contract = await factory.deploy("hello world");
console.log('contract address', contract.address);
// wait for contract creation transaction to be mined
await contract.deployTransaction.wait();
_heading: Interacting with a Contract
_code: @lang<script>
// web3
const contract = new web3.eth.Contract(abi, contractAddress);
// read only query
contract.methods.getValue().call();
// state changing operation
contract.methods.changeValue(42).send({from: ....})
.on('receipt', function(){
...
});
// ethers
// pass a provider when initiating a contract for read only queries
const contract = new ethers.Contract(contractAddress, abi, provider);
const value = await contract.getValue();
// pass a signer to create a contract instance for state changing operations
const contract = new ethers.Contract(contractAddress, abi, signer);
const tx = await contract.changeValue(33);
// wait for the transaction to be mined
const receipt = await tx.wait();
_heading: Overloaded Functions
Overloaded functions are functions that have the same name but different parameter
types.
In ethers, the syntax to call an overloaded contract function is different
from the non-overloaded function. This section shows the differences between web3
and ethers when calling overloaded functions.
See [issue #407](link-issue-407) for more details.
_code: @lang<script>
// web3
message = await contract.methods.getMessage('nice').call();
// ethers
const abi = [
"function getMessage(string) public view returns (string)",
"function getMessage() public view returns (string)"
]
const contract = new ethers.Contract(address, abi, signer);
// for ambiguous functions (two functions with the same
// name), the signature must also be specified
message = await contract['getMessage(string)']('nice');
_subsection: Numbers
_heading: BigNumber
Convert to BigNumber:
_code: @lang<script>
// web3
web3.utils.toBN('123456');
// ethers (from a number; must be within safe range)
ethers.BigNumber.from(123456)
// ethers (from base-10 string)
ethers.BigNumber.from("123456")
// ethers (from hex string)
ethers.BigNumber.from("0x1e240")
_subsection: Utilities
_heading: Hash
Computing Keccak256 hash of a UTF-8 string in web3 and ethers:
_code: @lang<script>
// web3
web3.utils.sha3('hello world');
web3.utils.keccak256('hello world');
// ethers (hash of a string)
ethers.utils.id('hello world')
// ethers (hash of binary data)
ethers.utils.keccak256('0x4242')

View File

@@ -1,3 +1,385 @@
_section: Testing
Here goes info about testing
Testing is a critcial part of any library which wishes to remain secure, safe
and reliable.
Ethers currently has **over 23k tests** among its test suites, which are all
made available for other projects to use as simple exported GZIP-JSON files.
The tests are run on every check-in and the results can been seen on the
[GitHub CI Action](link-github-ci).
We also strive to constantly add new test cases, especially when issues
arise to ensure the issue is present prior to the fix, corrected after the
fix and included to prevent future changes from causing a regression.
A large number of the test cases were created procedurally by using
known correct implementations from various sources (such as Geth) and
written in different languages and verifyied with multiple libraries.
For example, the ABI test suites were generated by procedurally generating
a list of types, for each type choosing a random (valid) value, which then
was converted into a Solidity source file, compiled using ``solc`` and
deployed to a running Parity node and executed, with its outputs being
captured. Similar to the how many of the hashing, event and selector test
cases were created.
_subsection: Supported Platforms @<testing-supported>
While web technologies move quite fast, especially in the Web3 universe, we try
to keep ethers as accessible as possible.
Currently ethers should work on almost any ES3 or better environment and tests
are run against:
- node.js 8.x
- node.js 10.x
- node.js 12.x
- node.js 13.x
- Web Browsers (using UMD)
- Web Browsers (using ES modules)
If there is an environment you feel has been overlooked or have suggestions, please feel
free to reach out by opening an [issue on Github](link-github-issues).
We would like to add a test build for Expo and React as those developers often seem
to encounter pain points when using ethers, so if you have experience or ideas on this,
[bug us](link-github-issues).
The next Major version (probably summer 2021) will likely drop support for node 8.x
and will require ES2015 for [Proxy](link-js-proxy).
Certain features in JavaScript are also avoided, such as look-behind tokens in regular
expressions, since these have caused conflicts (at import time) with certain JavaScript
environmants such as [Otto](link-otto).
Basically, the moral of the story is "be inclusive and don't drop people needlessly".
_subsection: Test Suites @<testing-suites>
The test suites are avaialble a gzipped JSON files in the
``@ethersproject/testcases``, which makes it easy to install and import
(both GZIP and JSON are quite easy to consume from most langauges). Each
test suite also has its schema available in this package.
_table: Test Suites @style<full>
$Account: Private Keys and addresses in checksum and ICAP formats
$ContractEvents: Compiled Solidity, ABI interfaces, input types/values with the
output types/values for emitted events; all tests were
executed against real Ethereum nodes
$ContractAbi: Compiled Solidity, ABI interfaces, input types/values with the
output types/values, encoded and decoded binrary data and normalized
values for function calls executed against real Ethereum nodes.
$ContractAbi2: Identical to ``contract-interface``, except with emphasis on
the ABIv2 coder which supports nested dynami types and strutured
data
$ContractSignatures: Contract signatures and matching selectors
$Hashes: Data and respective hashes against a variety of hash functions
$HDNode: HDNodes (BIP-32) with mnemonics, entropy, seed and computed nodes
with pathes and addresses
$Namehash: ENS names along with computed [namehashes](link-namehash
$Nameprep: IDNA and Nameprep representations including official vectors
$RLP: Recursive-Length Prefix (RLP) data and encodings
$SoliditiyHashes: Hashes based on the Solidity non-standard packed form
$Transactions: Signed and unsigned transactions with their serialized formats
including both with and without EIP-155 replay protection
$Units: Values converted between various units
$Wallet: Keystore JSON format wallets, passwords and decrypted values
$Wordlist: Fully decompressed BIP-39 offcial wordlists
| **Filename** | **Test Cases** <|
| accounts.json.gz | $Account <|
| contract-events.json.gz | $ContractEvents <|
| contract-interface.json.gz | $ContractAbi <|
| contract-interface-abi2.json.gz | $ContractAbi2 <|
| contract-signatures.json.gz | $ContractSignatures <|
| hashes.json.gz | $Hashes <|
| hdnode.json.gz | $HDNode <|
| namehash.json.gz | $Namehash <|
| nameprep.json.gz | $Nameprep <|
| rlp-coder.json.gz | $RLP <|
| solidity-hashes.json.gz | $SoliditiyHashes <|
| transactions.json.gz | $Transactions <|
| units.json.gz | $Units <|
| wallets.json.gz | $Wallet <|
| wordlists.json.gz | $Wordlist <|
_subsection: Test Suite API @<testing-api>
There are also convenience functions for those developing directly in TypeScript.
_property: testcases.loadTests(tag) => Array<TestCase>
Load all the given testcases for the //tag//.
A tag is the string in the above list of test case names not including
any extenstion (e.g. ``"solidity-hashes"``)
_property: testcases.TestCase.TEST_NAME
Most testcases have its schema available as a TypeScript type to make testing
each property easier.
_heading: Deterministic Random Numbers (DRNG)
When creating test cases, often we want want random data from the perspective
we do not case what values are used, however we want the values to be consistent
accross runs. Otherwise it becomes difficult to reproduce an issue.
In each of the following the seed is used to control the random value returned. Be
sure to tweak the seed properly, for eaxmple on each iteration change the value and
in recursive functions, concatentate to the seed.
_property: testcases.randomBytes(seed, lower [, upper ]) => Uint8Array
Return at least //lower// random bytes, up to //upper// (exclusive) if specified,
given //seed//. If //upper// is omitted, exactly ///lower// bytes are returned.
_property: testcases.randomHexString(seed, lower [, upper ]) => string<[[DataHexString]]>
Identical to randomBytes, except returns the value as a [[DataHexString]] instead of a
Uint8Array.
_property: testcases.randomNumber(seed, lower, upper) => number
Returns a random number of at least //lower// and less than //upper//
given //seed//.
_subsection: Schemas @<testing-schemas>
This section is still a work in progress, but will outline some of the more nuanced
aspects of the test cases and their values.
There will likely be an overhaul of the test cases in the next major version, to
make code coverage testing more straight forward and to collapse some of the redundancy.
For example, there is no longer a need to separate the ABI and ABIv2 test case and the
accounts and transactions suites can be merged into one large collection.
_heading: Accounts
Basic account information using a private key and computing various addrss forms.
Tests were verfified against [EthereumJS](https:/\/github.com/ethereumjs) and custom
scripts created to directly interact with Geth and cpp implementations.
//See: ``accounts.json.gz``//
_table: Properties
| **Property** | **Meaning** |
| name | The testcase name |
| privateKey | The private key |
| address | The address (lowercase) |
| checksumAddress | The address with checksum-adjusted case |
| icapAddress | The ICAP address |
_code: Example @lang<script>
{
"name": "random-1023",
"address": "0x53bff74b9af2e3853f758a8d2bd61cd115d27782",
"privateKey": "0x8ab0e165c2ea461b01cdd49aec882d179dccdbdb5c85c3f9c94c448aa65c5ace",
"checksumAddress": "0x53bFf74b9Af2E3853f758A8D2Bd61CD115d27782",
"icapAddress": "XE709S6NUSJR6SXQERCMYENAYYOZ2Y91M6A"
}
_heading: Contract Interface
Procedurally generated test cases to test ABI coding.
_code: Example @lang<script>
{
"name": "random-1999",
"source": "contract Test {\n function test() constant returns (address, bool, bytes14[1]) {\n address a = address(0x061C7F399Ee738c97C7b7cD840892B281bf772B5);\n bool b = bool(true);\n bytes14[1] memory c;\n c[0] = bytes14(0x327621c4abe12d4f21804ed40455);\n return (a, b, c);\n }\n}\n",
"types": "[\"address\",\"bool\",\"bytes14[1]\"]",
"interface": "[{\"constant\":true,\"inputs\":[],\"name\":\"test\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"bool\"},{\"name\":\"\",\"type\":\"bytes14[1]\"}],\"type\":\"function\"}]\n",
"bytecode": "0x6060604052610175806100126000396000f360606040526000357c010000000000000000000000000000000000000000000000000000000090048063f8a8fd6d1461003957610037565b005b610046600480505061009d565b604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018315158152602001826001602002808383829060006004602084601f0104600f02600301f150905001935050505060405180910390f35b600060006020604051908101604052806001905b60008152602001906001900390816100b157905050600060006020604051908101604052806001905b60008152602001906001900390816100da5790505073061c7f399ee738c97c7b7cd840892b281bf772b59250600191506d327621c4abe12d4f21804ed404557201000000000000000000000000000000000000028160006001811015610002579090602002019071ffffffffffffffffffffffffffffffffffff191690818152602001505082828295509550955061016d565b50505090919256",
"result": "0x000000000000000000000000061c7f399ee738c97c7b7cd840892b281bf772b50000000000000000000000000000000000000000000000000000000000000001327621c4abe12d4f21804ed40455000000000000000000000000000000000000",
"values": "[{\"type\":\"string\",\"value\":\"0x061C7F399Ee738c97C7b7cD840892B281bf772B5\"},{\"type\":\"boolean\",\"value\":true},[{\"type\":\"buffer\",\"value\":\"0x327621c4abe12d4f21804ed40455\"}]]",
"normalizedValues": "[{\"type\":\"string\",\"value\":\"0x061C7F399Ee738c97C7b7cD840892B281bf772B5\"},{\"type\":\"boolean\",\"value\":true},[{\"type\":\"buffer\",\"value\":\"0x327621c4abe12d4f21804ed40455\"}]]",
"runtimeBytecode": "0x60606040526000357c010000000000000000000000000000000000000000000000000000000090048063f8a8fd6d1461003957610037565b005b610046600480505061009d565b604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018315158152602001826001602002808383829060006004602084601f0104600f02600301f150905001935050505060405180910390f35b600060006020604051908101604052806001905b60008152602001906001900390816100b157905050600060006020604051908101604052806001905b60008152602001906001900390816100da5790505073061c7f399ee738c97c7b7cd840892b281bf772b59250600191506d327621c4abe12d4f21804ed404557201000000000000000000000000000000000000028160006001811015610002579090602002019071ffffffffffffffffffffffffffffffffffff191690818152602001505082828295509550955061016d565b50505090919256"
}
_heading: Contract Signatures
Computed ABI signatures and the selector hash.
_code: Example @lang<script>
{
"name": "random-1999",
"sigHash": "0xf51e9244",
"abi": "[{\"constant\":false,\"inputs\":[{\"name\":\"r0\",\"type\":\"string[2]\"},{\"name\":\"r1\",\"type\":\"uint128\"},{\"components\":[{\"name\":\"a\",\"type\":\"bytes\"},{\"name\":\"b\",\"type\":\"bytes\"},{\"name\":\"c\",\"type\":\"bytes\"}],\"name\":\"r2\",\"type\":\"tuple\"},{\"name\":\"r3\",\"type\":\"bytes\"}],\"name\":\"testSig\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"test\",\"outputs\":[{\"name\":\"r0\",\"type\":\"string[2]\"},{\"name\":\"r1\",\"type\":\"uint128\"},{\"components\":[{\"name\":\"a\",\"type\":\"bytes\"},{\"name\":\"b\",\"type\":\"bytes\"},{\"name\":\"c\",\"type\":\"bytes\"}],\"name\":\"r2\",\"type\":\"tuple\"},{\"name\":\"r3\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}]",
"signature": "testSig(string[2],uint128,(bytes,bytes,bytes),bytes)"
}
_heading: Hashes
_code: Examples @lang<script>
{
"data": "0x3718a88ceb214c1480c32a9d",
"keccak256": "0x82d7d2dc3d384ddb289f41917b8280675bb1283f4fe2b601ac7c8f0a2c2824fa",
"sha512": "0xe93462bb1de62ba3e6a980c3cb0b61728d3f771cea9680b0fa947b6f8fb2198a2690a3a837495c753b57f936401258dfe333a819e85f958b7d786fb9ab2b066c",
"sha256": "0xe761d897e667aa72141dd729264c393c4ddda5c62312bbd21b0f4d954eba1a8d"
}
_heading: Hierarchal Deterministic Node (BIP-32)
Tests for [BIP-32](link-bip-32) HD Wallets.
_code: Example @lang<script>
{
"name": "trezor-23",
"entropy": "0xf585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f",
"mnemonic": "void come effort suffer camp survey warrior heavy shoot primary clutch crush open amazing screen patrol group space point ten exist slush involve unfold",
"locale": "en",
"password": "TREZOR",
"hdnodes": [
{
"path": "m",
"address": "0xfd8eb95169ce57eab52fb69bc6922e9b6454d9aa",
"privateKey": "0x679bf92c04cf16307053cbed33784f3c4266b362bf5f3d7ee13bed6f2719743c"
},
{
"address": "0xada964e9f10c4fc9787f9e17f00c63fe188722b0",
"privateKey": "0xdcbcb48a2b11eef0aab93a8f88d83f60a3aaabb34f9ffdbe939b8f059b30f2b7",
"path": "m/8'/8'/2/3/4"
},
{
"privateKey": "0x10fd3776145dbeccb3d6925e4fdc0d58b452fce40cb8760b12f8b4223fafdfa6",
"address": "0xf3f6b1ef343d5f5f231a2287e801a46add43eb06",
"path": "m/1'/3'"
},
{
"address": "0xb7b0fdb6e0f79f0529e95400903321e8a601b411",
"privateKey": "0x093a8ff506c95a2b79d397aed59703f6212ff3084731c2f03089b069ae76e69d",
"path": "m/8'/4'/7'"
},
{
"path": "m/7'/5'/11",
"privateKey": "0x6bd79da4dfa7dd0abf566a011bdb7cba0d28bba9ca249ba25880d5dabf861b42",
"address": "0x1b3ad5fa50ae32875748107f4b2160829cc10536"
},
{
"path": "m/9'/6'/2'/7'/3'",
"address": "0x42eb4bed59f3291d02387cf0fb23098c55d82611",
"privateKey": "0xfc173acba7bc8bb2c434965d9e99f5a221f81add421bae96a891d08d60be11dd"
}
],
"seed": "0x01f5bced59dec48e362f2c45b5de68b9fd6c92c6634f44d6d40aab69056506f0e35524a518034ddc1192e1dacd32c1ed3eaa3c3b131c88ed8e7e54c49a5d0998"
}
_heading: ENS Namehash
Test cases for the [ENS Namehash Algorithm](link-namehash).
_code: Examples
{
"expected": "0x33868cc5c3fd3a9cd3adbc1e868ea133d2218f60dc2660c3bc48d8b1f4961384",
"name": "ViTalIk.WALlet.Eth",
"test": "mixed case"
}
_heading: RLP Coder
_code: Examples @lang<script>
{
"name": "arrayWithNullString3",
"encoded": "0xc3808080",
"decoded": [ "0x", "0x", "0x" ]
}
_heading: Solidity Hashes
Tests for the non-standard packed form of the Solidity hash functions.
These tests were created by procedurally generating random signatures and
values that match those signatures, constructing the equivalent Soldity,
compiling it and deploying it to a Parity node then evaluating the response.
_code: Example @lang<script>
{
"name": "random-1999",
"keccak256": "0x7d98f1144a0cd689f720aa2f11f0a73bd52a2da1117175bc4bacd93c130966a1",
"ripemd160": "0x59384617f8a06efd57ab106c9e0c20c3e64137ac000000000000000000000000",
"sha256": "0xf9aeea729ff39f8d372d8552bca81eb2a3c5d433dc8f98140040a03b7d81ac92",
"values": [
"0xcdffcb5242e6",
"0xc1e101b60ebe4688",
"0x5819f0ef5537796e43bdcd48309f717d6f7ccffa",
"0xec3f3f9f",
false,
true
],
"types": [
"int184",
"int176",
"address",
"int64",
"bool",
"bool"
]
}
_heading: Transactions
Serialized signed and unsigned transactions with both EIP-155 enabled and
disabled.
_code: Examples @lang<script>
{
"name": "random-998",
"privateKey": "0xd16c8076a15f7fb583f05dc12686fe526bc59d298f1eb7b9a237b458133d1dec",
"signedTransactionChainId5": "0xf8708391d450848517cfba8736fcf36da03ee4949577303fd4e0acbe72c6c116acab5bf63f0b1e9c8365fdc7827dc82ea059891894eb180cb7c6c45a52f62d2103420d3ad0bc3ba518d0a25ed910842522a0155c0ea2aee2ea82e75843aab297420bad907d46809d046b13d692928f4d78aa",
"gasLimit": "0x36fcf36da03ee4",
"to": "0x9577303fd4e0acbe72c6c116acab5bf63f0b1e9c",
"data": "0x7dc8",
"accountAddress": "0x6d4a6aff30ca5ca4b8422eea0ebcb669c7d79859",
"unsignedTransaction": "0xed8391d450848517cfba8736fcf36da03ee4949577303fd4e0acbe72c6c116acab5bf63f0b1e9c8365fdc7827dc8",
"nonce": "0x91d450",
"gasPrice": "0x8517cfba",
"signedTransaction": "0xf8708391d450848517cfba8736fcf36da03ee4949577303fd4e0acbe72c6c116acab5bf63f0b1e9c8365fdc7827dc81ba05030832331e6be48c95e1569a1ca9505c495486f72d6009b3a30fadfa05d9686a05cd3116b416d2362da1e9b0ca7fb1856c4e591cc22e63b395bd881ce2d3735e6",
"unsignedTransactionChainId5": "0xf08391d450848517cfba8736fcf36da03ee4949577303fd4e0acbe72c6c116acab5bf63f0b1e9c8365fdc7827dc8058080",
"value": "0x65fdc7"
}
_heading: Units
Unit conversion.
_code: Example @lang<script>
{
"name": "one-two-three-3",
"gwei_format": "-1234567890123456.789012345",
"ether_format": "-1234567.890123456789012345",
"gwei": "-1234567890123456.789012345",
"ether": "-1234567.890123456789012345",
"finney": "-1234567890.123456789012345",
"wei": "-1234567890123456789012345",
"finney_format": "-1234567890.123456789012345"
}
_heading: Wallets
Tests for the JSON keystore format.
_code: Example @lang<script>
{
"mnemonic": null,
"name": "secretstorage_password",
"type": "secret-storage",
"password": "foo",
"privateKey": "0xf03e581353c794928373fb0893bc731aefc4c4e234e643f3a46998b03cd4d7c5",
"hasAddress": true,
"json": "{\"address\":\"88a5c2d9919e46f883eb62f7b8dd9d0cc45bc290\",\"Crypto\":{\"cipher\":\"aes-128-ctr\",\"ciphertext\":\"10adcc8bcaf49474c6710460e0dc974331f71ee4c7baa7314b4a23d25fd6c406\",\"cipherparams\":{\"iv\":\"1dcdf13e49cea706994ed38804f6d171\"},\"kdf\":\"scrypt\",\"kdfparams\":{\"dklen\":32,\"n\":262144,\"p\":1,\"r\":8,\"salt\":\"bbfa53547e3e3bfcc9786a2cbef8504a5031d82734ecef02153e29daeed658fd\"},\"mac\":\"1cf53b5ae8d75f8c037b453e7c3c61b010225d916768a6b145adf5cf9cb3a703\"},\"id\":\"fb1280c0-d646-4e40-9550-7026b1be504a\",\"version\":3}\n",
"address": "0x88a5c2d9919e46f883eb62f7b8dd9d0cc45bc290"
}

View File

@@ -71,7 +71,7 @@ contract.value()
<div class="nav previous"><a href="/v5/api/contract/contract/"><span class="arrow">&larr;</span>Contract</a></div>
<div class="nav next"><a href="/v5/api/contract/example/">Example: ERC-20 Contract<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -109,7 +109,7 @@
<div class="nav previous"><a href="/v5/api/contract/"><span class="arrow">&larr;</span>Contract Interaction</a></div>
<div class="nav next"><a href="/v5/api/contract/contract-factory/">ContractFactory<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -127,7 +127,7 @@
<div class="nav previous"><a href="/v5/api/contract/contract-factory/"><span class="arrow">&larr;</span>ContractFactory</a></div>
<div class="nav next"><a href="/v5/api/signer/">Signers<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -26,7 +26,7 @@
<div class="nav previous"><a href="/v5/api/"><span class="arrow">&larr;</span>Application Programming Interface</a></div>
<div class="nav next"><a href="/v5/api/contract/contract/">Contract<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -54,7 +54,7 @@
<div class="nav previous"><a href="/v5/api/other/hardware/"><span class="arrow">&larr;</span>Hardware Wallets</a></div>
<div class="nav next"><a href="/v5/cli/">Command Line Interfaces<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -24,7 +24,7 @@
<div class="nav previous"><a href="/v5/concepts/security/"><span class="arrow">&larr;</span>Security</a></div>
<div class="nav next"><a href="/v5/api/contract/">Contract Interaction<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -69,7 +69,7 @@
<div class="nav previous"><a href="/v5/api/other/assembly/dialect/"><span class="arrow">&larr;</span>Ethers ASM Dialect</a></div>
<div class="nav next"><a href="/v5/api/other/assembly/ast/">Abstract Syntax Tree<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -87,7 +87,7 @@
<div class="nav previous"><a href="/v5/api/other/assembly/api/"><span class="arrow">&larr;</span>Utilities</a></div>
<div class="nav next"><a href="/v5/api/other/hardware/">Hardware Wallets<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -77,7 +77,7 @@
<div class="nav previous"><a href="/v5/api/other/assembly/"><span class="arrow">&larr;</span>Assembly</a></div>
<div class="nav next"><a href="/v5/api/other/assembly/api/">Utilities<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -24,7 +24,7 @@
<div class="nav previous"><a href="/v5/api/other/"><span class="arrow">&larr;</span>Other Libraries</a></div>
<div class="nav next"><a href="/v5/api/other/assembly/dialect/">Ethers ASM Dialect<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -29,7 +29,7 @@
<div class="nav previous"><a href="/v5/api/other/assembly/ast/"><span class="arrow">&larr;</span>Abstract Syntax Tree</a></div>
<div class="nav next"><a href="/v5/api/experimental/">Experimental<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -24,7 +24,7 @@
<div class="nav previous"><a href="/v5/api/utils/wordlists/"><span class="arrow">&larr;</span>Wordlists</a></div>
<div class="nav next"><a href="/v5/api/other/assembly/">Assembly<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -128,7 +128,7 @@ provider = new AlchemyProvider("homestead", apiKey);
<div class="nav previous"><a href="/v5/api/providers/jsonrpc-provider/"><span class="arrow">&larr;</span>JsonRpcProvider</a></div>
<div class="nav next"><a href="/v5/api/providers/other/">Other Providers<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -47,7 +47,7 @@
<div class="nav previous"><a href="/v5/api/signer/"><span class="arrow">&larr;</span>Signers</a></div>
<div class="nav next"><a href="/v5/api/providers/provider/">Provider<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -61,7 +61,7 @@
<div class="nav previous"><a href="/v5/api/providers/provider/"><span class="arrow">&larr;</span>Provider</a></div>
<div class="nav next"><a href="/v5/api/providers/api-providers/">API Providers<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -51,7 +51,7 @@
<div class="property show-anchors"><div class="signature"><span class="path">ipcProvider</span><span class="symbol">.</span><span class="method">path</span> <span class="arrow">&rArr;</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>The path this <a href="/v5/api/providers/provider/">Provider</a> is connected to.</p>
</div></div><a name="UrlJsonRpcProvider"></a><a name="other-providers--UrlJsonRpcProvider"></a><h2 class="show-anchors"><div>UrlJsonRpcProvider<span class="inherits"> inherits <a href="/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a></span><div class="anchors"><a class="self" href="/v5/api/providers/other/#UrlJsonRpcProvider"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/url-json-rpc-provider.ts#L35">source</a></div></div></h2><p>This class is intended to be sub-classed and not used directly. It simplifies creating a <a href="/v5/api/providers/provider/">Provider</a> where a normal <a href="/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a> would suffice, with a little extra effort needed to generate the JSON-RPC URL.</p>
</div></div><a name="UrlJsonRpcProvider"></a><a name="other-providers--UrlJsonRpcProvider"></a><h2 class="show-anchors"><div>UrlJsonRpcProvider<span class="inherits"> inherits <a href="/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a></span><div class="anchors"><a class="self" href="/v5/api/providers/other/#UrlJsonRpcProvider"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/url-json-rpc-provider.ts#L49">source</a></div></div></h2><p>This class is intended to be sub-classed and not used directly. It simplifies creating a <a href="/v5/api/providers/provider/">Provider</a> where a normal <a href="/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a> would suffice, with a little extra effort needed to generate the JSON-RPC URL.</p>
<div class="property show-anchors"><div class="signature"><span class="modifier">new </span><span class="path">ethers</span><span class="symbol">.</span><span class="path">providers</span><span class="symbol">.</span><span class="method">UrlJsonRpcProvider</span><span class="symbol">(</span> <span class="symbol">[</span> <span class="param">network</span> <span class="symbol">[</span> <span class="symbol">,</span> <span class="param">apiKey</span> <span class="symbol">]</span> <span class="symbol">]</span> <span class="symbol">)</span><div class="anchors"></div></div><div class="body"><p>Sub-classes do not need to override this. Instead they should override the static method <code class="inline">getUrl</code> and optionally <code class="inline">getApiKey</code>.</p>
@@ -101,7 +101,7 @@
<div class="nav previous"><a href="/v5/api/providers/api-providers/"><span class="arrow">&larr;</span>API Providers</a></div>
<div class="nav next"><a href="/v5/api/providers/types/">Types<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -33,7 +33,7 @@ Returns the number of transactions *address* has ever **sent**, as of *blockTag*
```javascript
// Get the balance for an account...
provider.getBalance("ricmoo.firefly.eth");
// { Promise: { BigNumber: "1585454034436018765" } }
// { Promise: { BigNumber: "1578527309436018765" } }
// Get the code for a contract...
provider.getCode("registrar.firefly.eth");
@@ -45,7 +45,7 @@ provider.getStorageAt("registrar.firefly.eth", 0)
// Get transaction count of an account...
provider.getTransactionCount("ricmoo.firefly.eth");
// { Promise: 670 }
// { Promise: 673 }
```
Blocks Methods
@@ -96,7 +96,7 @@ provider.getBlockWithTransactions(100004)
// blockHash: '0xf93283571ae16dcecbe1816adc126954a739350cd1523a1559eabeae155fbb63',
// blockNumber: 100004,
// chainId: 0,
// confirmations: 10284646,
// confirmations: 10297123,
// creates: null,
// data: '0x',
// from: '0xcf00A85f3826941e7A25BFcF9Aac575d40410852',
@@ -177,16 +177,16 @@ provider.getNetwork()
// The current block number
provider.getBlockNumber()
// { Promise: 10384649 }
// { Promise: 10397126 }
// Get the current suggested gas price (in wei)...
gasPrice = await provider.getGasPrice()
// { BigNumber: "41000000000" }
// { BigNumber: "19000001123" }
// ...often this gas price is easier to understand or
// display to the user in gwei (giga-wei, or 1e9 wei)
utils.formatUnits(gasPrice, "gwei")
// '41.0'
// '19.000001123'
```
Transactions Methods

View File

@@ -29,7 +29,7 @@
</div></div><div class="code-title"><div>Account Examples</div></div><div class="code"><span class="comment">// Get the balance for an account...
</span>provider.getBalance("ricmoo.firefly.eth");
<span class="result ok">// { Promise: { BigNumber: "1585454034436018765" } }
<span class="result ok">// { Promise: { BigNumber: "1578527309436018765" } }
</span>
<span class="comment">// Get the code for a contract...
</span>provider.getCode("registrar.firefly.eth");
@@ -41,7 +41,7 @@
</span>
<span class="comment">// Get transaction count of an account...
</span>provider.getTransactionCount("ricmoo.firefly.eth");
<span class="result ok">// { Promise: 670 }
<span class="result ok">// { Promise: 673 }
</span></div><a name="Provider--block-methods"></a><a name="Provider--Provider--block-methods"></a><h2 class="show-anchors"><div>Blocks Methods<div class="anchors"><a class="self" href="/v5/api/providers/provider/#Provider--block-methods"></a></div></div></h2>
<a name="Provider-getBlock"></a><div class="property show-anchors"><div class="signature"><span class="path">provider</span><span class="symbol">.</span><span class="method">getBlock</span><span class="symbol">(</span> <span class="param">block</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">Promise&lt; <a href="/v5/api/providers/types/#providers-Block">Block</a> &gt;</span><div class="anchors"><a class="self" href="/v5/api/providers/provider/#Provider-getBlock"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/base-provider.ts#L936">source</a></div></div><div class="body"><p>Get the <i>block</i> from the network, where the <code class="inline">result.transactions</code> is a list of transaction hashes.</p>
@@ -81,7 +81,7 @@ provider.getBlockWithTransactions(100004)
</span><span class="result ok">// blockHash: '0xf93283571ae16dcecbe1816adc126954a739350cd1523a1559eabeae155fbb63',
</span><span class="result ok">// blockNumber: 100004,
</span><span class="result ok">// chainId: 0,
</span><span class="result ok">// confirmations: 10284646,
</span><span class="result ok">// confirmations: 10297123,
</span><span class="result ok">// creates: null,
</span><span class="result ok">// data: '0x',
</span><span class="result ok">// from: '0xcf00A85f3826941e7A25BFcF9Aac575d40410852',
@@ -139,16 +139,16 @@ provider.getBlockWithTransactions(100004)
</span>
<span class="comment">// The current block number
</span>provider.getBlockNumber()
<span class="result ok">// { Promise: 10384649 }
<span class="result ok">// { Promise: 10397126 }
</span>
<span class="comment">// Get the current suggested gas price (in wei)...
</span>gasPrice = await provider.getGasPrice()
<span class="result ok">// { BigNumber: "41000000000" }
<span class="result ok">// { BigNumber: "19000001123" }
</span>
<span class="comment">// ...often this gas price is easier to understand or
</span><span class="comment">// display to the user in gwei (giga-wei, or 1e9 wei)
</span>utils.formatUnits(gasPrice, "gwei")
<span class="result ok">// '41.0'
<span class="result ok">// '19.000001123'
</span></div><a name="Provider--transaction-methods"></a><a name="Provider--Provider--transaction-methods"></a><h2 class="show-anchors"><div>Transactions Methods<div class="anchors"><a class="self" href="/v5/api/providers/provider/#Provider--transaction-methods"></a></div></div></h2>
<a name="Provider-call"></a><div class="property show-anchors"><div class="signature"><span class="path">provider</span><span class="symbol">.</span><span class="method">call</span><span class="symbol">(</span> <span class="param">transaction</span> <span class="symbol">[</span> <span class="symbol">,</span> <span class="param">blockTag</span> = <span class="param">latest</span> <span class="symbol">]</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">Promise&lt; string&lt; <a href="/v5/api/utils/bytes/#DataHexString">DataHexString</a> &gt; &gt;</span><div class="anchors"><a class="self" href="/v5/api/providers/provider/#Provider-call"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/base-provider.ts#L836">source</a></div></div><div class="body"><p>Returns the result of executing the <i>transaction</i>, using <i>call</i>. A call does not require any ether, but cannot change any state. This is useful for calling gettings on Contracts.</p>
@@ -250,7 +250,7 @@ provider.on("error", (tx) =&gt; {
<div class="nav previous"><a href="/v5/api/providers/"><span class="arrow">&larr;</span>Providers</a></div>
<div class="nav next"><a href="/v5/api/providers/jsonrpc-provider/">JsonRpcProvider<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -187,7 +187,7 @@
<div class="nav previous"><a href="/v5/api/providers/other/"><span class="arrow">&larr;</span>Other Providers</a></div>
<div class="nav next"><a href="/v5/api/utils/">Utilities<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -285,7 +285,7 @@ contract = new ethers.Contract("dai.tokens.ethers.eth", abi, signer)
// Get the number of tokens for this account
tokens = await contract.balanceOf(signer.getAddress())
// { BigNumber: "8814410125722568213383" }
// { BigNumber: "9709905125722568213383" }
//
// Pre-flight (check for revert) on DAI from the signer

View File

@@ -215,7 +215,7 @@ contract = new ethers.Contract("dai.tokens.ethers.eth", abi, signer)
<span class="comment">// Get the number of tokens for this account
</span>tokens = await contract.balanceOf(signer.getAddress())
<span class="result ok">// { BigNumber: "8814410125722568213383" }
<span class="result ok">// { BigNumber: "9709905125722568213383" }
</span>
//
<span class="comment">// Pre-flight (check for revert) on DAI from the signer
@@ -247,7 +247,7 @@ contract = new ethers.Contract("dai.tokens.ethers.eth", abi, signer)
<div class="nav previous"><a href="/v5/api/contract/example/"><span class="arrow">&larr;</span>Example: ERC-20 Contract</a></div>
<div class="nav next"><a href="/v5/api/providers/">Providers<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -43,7 +43,7 @@
<div class="nav previous"><a href="/v5/api/utils/abi/"><span class="arrow">&larr;</span>Application Binary Interface</a></div>
<div class="nav next"><a href="/v5/api/utils/abi/formats/">ABI Formats<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -28,7 +28,7 @@
<div class="nav previous"><a href="/v5/api/utils/abi/coder/"><span class="arrow">&larr;</span>AbiCoder</a></div>
<div class="nav next"><a href="/v5/api/utils/abi/fragments/">Fragments<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -131,7 +131,7 @@
<div class="nav previous"><a href="/v5/api/utils/abi/formats/"><span class="arrow">&larr;</span>ABI Formats</a></div>
<div class="nav next"><a href="/v5/api/utils/abi/interface/">Interface<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -28,7 +28,7 @@
<div class="nav previous"><a href="/v5/api/utils/"><span class="arrow">&larr;</span>Utilities</a></div>
<div class="nav next"><a href="/v5/api/utils/abi/coder/">AbiCoder<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -122,7 +122,7 @@
<div class="nav previous"><a href="/v5/api/utils/abi/fragments/"><span class="arrow">&larr;</span>Fragments</a></div>
<div class="nav next"><a href="/v5/api/utils/address/">Addresses<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -62,7 +62,7 @@
<div class="nav previous"><a href="/v5/api/utils/abi/interface/"><span class="arrow">&larr;</span>Interface</a></div>
<div class="nav next"><a href="/v5/api/utils/bignumber/">BigNumber<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -85,7 +85,7 @@ BigNumber.from(42n)
// Numbers outside the safe range fail:
BigNumber.from(Number.MAX_SAFE_INTEGER);
// Error: overflow (fault="overflow", operation="BigNumber.from", value=9007199254740991, code=NUMERIC_FAULT, version=bignumber/5.0.2)
// Error: overflow (fault="overflow", operation="BigNumber.from", value=9007199254740991, code=NUMERIC_FAULT, version=bignumber/5.0.3)
```
Methods

View File

@@ -77,7 +77,7 @@ one2
</span>
<span class="comment">// Numbers outside the safe range fail:
</span>BigNumber.from(Number.MAX_SAFE_INTEGER);
<span class="result error">// Error: overflow (fault="overflow", operation="BigNumber.from", value=9007199254740991, code=NUMERIC_FAULT, version=bignumber/5.0.2)
<span class="result error">// Error: overflow (fault="overflow", operation="BigNumber.from", value=9007199254740991, code=NUMERIC_FAULT, version=bignumber/5.0.3)
</span></div><a name="BigNumber--methods"></a><a name="BigNumber--BigNumber--methods"></a><h2 class="show-anchors"><div>Methods<div class="anchors"><a class="self" href="/v5/api/utils/bignumber/#BigNumber--methods"></a></div></div></h2><p>The BigNumber class is immutable, so no operations can change the value it represents.</p>
<a name="BigNumber--BigNumber--methods--math-operations"></a><h3 class="show-anchors"><div>Math Operations<div class="anchors"><a class="self" href="/v5/api/utils/bignumber/#BigNumber--BigNumber--methods--math-operations"></a></div></div></h3>
@@ -95,7 +95,7 @@ one2
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">abs</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns"><a href="/v5/api/utils/bignumber/">BigNumber</a></span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L64">source</a></div></div><div class="body"><p>Returns a BigNumber with the absolute value of <i>BigNumber</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">mask</span><span class="symbol">(</span> <span class="param">bitcount</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns"><a href="/v5/api/utils/bignumber/">BigNumber</a></span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L127">source</a></div></div><div class="body"><p>Returns a BigNumber with the value of <i>BigNumber</i> with bits beyond the <i>bitcount</i> least significant bits set to zero.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">mask</span><span class="symbol">(</span> <span class="param">bitcount</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns"><a href="/v5/api/utils/bignumber/">BigNumber</a></span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L131">source</a></div></div><div class="body"><p>Returns a BigNumber with the value of <i>BigNumber</i> with bits beyond the <i>bitcount</i> least significant bits set to zero.</p>
</div></div><a name="BigNumber--BigNumber--methods--two-s-compliment"></a><h3 class="show-anchors"><div>Two's Compliment<div class="anchors"><a class="self" href="/v5/api/utils/bignumber/#BigNumber--BigNumber--methods--two-s-compliment"></a></div></div></h3><p><a href="https://en.wikipedia.org/wiki/Two%27s_complement">Two's Complicment</a> is an elegant method used to encode and decode fixed-width signed values while efficiently preserving mathematic operations. Most users will not need to interact with these.</p>
@@ -104,29 +104,29 @@ one2
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toTwos</span><span class="symbol">(</span> <span class="param">bitwidth</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns"><a href="/v5/api/utils/bignumber/">BigNumber</a></span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L60">source</a></div></div><div class="body"><p>Returns a BigNumber with the value of <i>BigNumber</i> converted to twos-compliment with <i>bitwidth</i>.</p>
</div></div><a name="BigNumber--BigNumber--methods--comparison-and-equivalence"></a><h3 class="show-anchors"><div>Comparison and Equivalence<div class="anchors"><a class="self" href="/v5/api/utils/bignumber/#BigNumber--BigNumber--methods--comparison-and-equivalence"></a></div></div></h3>
<div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">eq</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L148">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> is equal to <i>otherValue</i>.</p>
<div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">eq</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L152">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> is equal to <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">lt</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L152">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&lt;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">lt</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L156">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&lt;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">lte</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L156">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&le;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">lte</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L160">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&le;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">gt</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L160">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&gt;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">gt</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L164">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&gt;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">gte</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L164">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&ge;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">gte</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L168">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&ge;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">isZero</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L172">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> is zero.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">isZero</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L176">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> is zero.</p>
</div></div><a name="BigNumber--BigNumber--methods--conversion"></a><h3 class="show-anchors"><div>Conversion<div class="anchors"><a class="self" href="/v5/api/utils/bignumber/#BigNumber--BigNumber--methods--conversion"></a></div></div></h3>
<div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toNumber</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">number</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L176">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a JavaScript value.</p>
<div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toNumber</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">number</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L180">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a JavaScript value.</p>
<p>This will <b>throw an error</b> if the value is greater than or equal to <i>Number.MAX_SAFE_INTEGER</i> or less than or equal to <i>Number.MIN_SAFE_INTEGER</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toString</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">string</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L185">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a base-10 string.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toString</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">string</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L189">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a base-10 string.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toHexString</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">string&lt; <a href="/v5/api/utils/bytes/#DataHexString">DataHexString</a> &gt;</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L193">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a base-16, <code class="inline">0x</code>-prefixed <a href="/v5/api/utils/bytes/#DataHexString">DataHexString</a>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toHexString</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">string&lt; <a href="/v5/api/utils/bytes/#DataHexString">DataHexString</a> &gt;</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L197">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a base-16, <code class="inline">0x</code>-prefixed <a href="/v5/api/utils/bytes/#DataHexString">DataHexString</a>.</p>
</div></div><a name="BigNumber--BigNumber--methods--inspection"></a><h3 class="show-anchors"><div>Inspection<div class="anchors"><a class="self" href="/v5/api/utils/bignumber/#BigNumber--BigNumber--methods--inspection"></a></div></div></h3>
<div class="property show-anchors"><div class="signature"><span class="path">ethers</span><span class="symbol">.</span><span class="path">BigNumnber</span><span class="symbol">.</span><span class="method">isBigNumber</span><span class="symbol">(</span> <span class="param">object</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L246">source</a></div></div><div class="body"><p>Returns true if and only if the <i>object</i> is a BigNumber object.</p>
<div class="property show-anchors"><div class="signature"><span class="path">ethers</span><span class="symbol">.</span><span class="path">BigNumnber</span><span class="symbol">.</span><span class="method">isBigNumber</span><span class="symbol">(</span> <span class="param">object</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L250">source</a></div></div><div class="body"><p>Returns true if and only if the <i>object</i> is a BigNumber object.</p>
</div></div><a name="BigNumber--BigNumber--methods--examples"></a><h3 class="show-anchors"><div>Examples<div class="anchors"><a class="self" href="/v5/api/utils/bignumber/#BigNumber--BigNumber--methods--examples"></a></div></div></h3>
<div class="code">let a = BigNumber.from(42);
@@ -178,7 +178,7 @@ a.mul(b);
<div class="nav previous"><a href="/v5/api/utils/address/"><span class="arrow">&larr;</span>Addresses</a></div>
<div class="nav next"><a href="/v5/api/utils/bytes/">Byte Manipulation<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -164,20 +164,20 @@ Return a copy of *array* shuffled using [Fisher-Yates Shuffle](https://en.wikipe
```javascript
utils.randomBytes(8)
// Uint8Array [ 95, 9, 0, 81, 176, 49, 211, 225 ]
// Uint8Array [ 158, 14, 185, 6, 8, 37, 214, 172 ]
const data = [ 1, 2, 3, 4, 5, 6, 7 ];
// Returns a new Array
utils.shuffled(data);
// [
// 6,
// 7,
// 4,
// 3,
// 5,
// 1,
// 2
// 3,
// 4,
// 7,
// 2,
// 5,
// 6
// ]
// The Original is unscathed...

View File

@@ -105,20 +105,20 @@
</div></div><a name="utils-shuffled"></a><div class="property show-anchors"><div class="signature"><span class="path">ethers</span><span class="symbol">.</span><span class="path">utils</span><span class="symbol">.</span><span class="method">shuffled</span><span class="symbol">(</span> <span class="param">array</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">Array&lt; any &gt;</span><div class="anchors"><a class="self" href="/v5/api/utils/bytes/#utils-shuffled"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/random/src.ts/shuffle.ts#L3">source</a></div></div><div class="body"><p>Return a copy of <i>array</i> shuffled using <a href="https://en.wikipedia.org/wiki/Fisher-Yates_shuffle">Fisher-Yates Shuffle</a>.</p>
</div></div><div class="code-title"><div>Examples</div></div><div class="code">utils.randomBytes(8)
<span class="result ok">// Uint8Array [ 95, 9, 0, 81, 176, 49, 211, 225 ]
<span class="result ok">// Uint8Array [ 158, 14, 185, 6, 8, 37, 214, 172 ]
</span>
const data = [ 1, 2, 3, 4, 5, 6, 7 ];
<span class="comment">// Returns a new Array
</span>utils.shuffled(data);
<span class="result ok">// [
</span><span class="result ok">// 6,
</span><span class="result ok">// 7,
</span><span class="result ok">// 4,
</span><span class="result ok">// 3,
</span><span class="result ok">// 5,
</span><span class="result ok">// 1,
</span><span class="result ok">// 2
</span><span class="result ok">// 3,
</span><span class="result ok">// 4,
</span><span class="result ok">// 7,
</span><span class="result ok">// 2,
</span><span class="result ok">// 5,
</span><span class="result ok">// 6
</span><span class="result ok">// ]
</span>
<span class="comment">// The Original is unscathed...
@@ -138,7 +138,7 @@ const data = [ 1, 2, 3, 4, 5, 6, 7 ];
<div class="nav previous"><a href="/v5/api/utils/bignumber/"><span class="arrow">&larr;</span>BigNumber</a></div>
<div class="nav next"><a href="/v5/api/utils/constants/">Constants<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -45,7 +45,7 @@
<div class="nav previous"><a href="/v5/api/utils/bytes/"><span class="arrow">&larr;</span>Byte Manipulation</a></div>
<div class="nav next"><a href="/v5/api/utils/display-logic/">Display Logic and Input<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -52,7 +52,7 @@
<div class="nav previous"><a href="/v5/api/utils/constants/"><span class="arrow">&larr;</span>Constants</a></div>
<div class="nav next"><a href="/v5/api/utils/encoding/">Encoding Utilities<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -49,7 +49,7 @@
<div class="nav previous"><a href="/v5/api/utils/display-logic/"><span class="arrow">&larr;</span>Display Logic and Input</a></div>
<div class="nav next"><a href="/v5/api/utils/fixednumber/">FixedNumber<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -90,7 +90,7 @@
<div class="nav previous"><a href="/v5/api/utils/encoding/"><span class="arrow">&larr;</span>Encoding Utilities</a></div>
<div class="nav next"><a href="/v5/api/utils/hashing/">Hashing Algorithms<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -151,7 +151,7 @@ utils.soliditySha256([ "int16", "uint48" ], [ -1, 12 ])
<div class="nav previous"><a href="/v5/api/utils/fixednumber/"><span class="arrow">&larr;</span>FixedNumber</a></div>
<div class="nav next"><a href="/v5/api/utils/hdnode/">HD Wallet<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -88,7 +88,7 @@
<div class="nav previous"><a href="/v5/api/utils/hashing/"><span class="arrow">&larr;</span>Hashing Algorithms</a></div>
<div class="nav next"><a href="/v5/api/utils/logger/">Logging<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -24,7 +24,7 @@
<div class="nav previous"><a href="/v5/api/providers/types/"><span class="arrow">&larr;</span>Types</a></div>
<div class="nav next"><a href="/v5/api/utils/abi/">Application Binary Interface<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -132,7 +132,7 @@
<div class="nav previous"><a href="/v5/api/utils/hdnode/"><span class="arrow">&larr;</span>HD Wallet</a></div>
<div class="nav next"><a href="/v5/api/utils/properties/">Property Utilities<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -29,7 +29,7 @@
<div class="nav previous"><a href="/v5/api/utils/logger/"><span class="arrow">&larr;</span>Logging</a></div>
<div class="nav next"><a href="/v5/api/utils/signing-key/">Signing Key<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -45,7 +45,7 @@
<div class="nav previous"><a href="/v5/api/utils/properties/"><span class="arrow">&larr;</span>Property Utilities</a></div>
<div class="nav next"><a href="/v5/api/utils/strings/">Strings<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -98,7 +98,7 @@
<div class="nav previous"><a href="/v5/api/utils/signing-key/"><span class="arrow">&larr;</span>Signing Key</a></div>
<div class="nav next"><a href="/v5/api/utils/transactions/">Transactions<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -81,7 +81,7 @@
<div class="nav previous"><a href="/v5/api/utils/strings/"><span class="arrow">&larr;</span>Strings</a></div>
<div class="nav next"><a href="/v5/api/utils/web/">Web Utilities<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -61,7 +61,7 @@
<div class="nav previous"><a href="/v5/api/utils/transactions/"><span class="arrow">&larr;</span>Transactions</a></div>
<div class="nav next"><a href="/v5/api/utils/wordlists/">Wordlists<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -58,7 +58,7 @@
<div class="nav previous"><a href="/v5/api/utils/web/"><span class="arrow">&larr;</span>Web Utilities</a></div>
<div class="nav next"><a href="/v5/api/other/">Other Libraries<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -180,7 +180,7 @@ return(0, #myContract)
<div class="nav previous"><a href="/v5/cli/ethers/"><span class="arrow">&larr;</span>Sandbox Utility</a></div>
<div class="nav next"><a href="/v5/cli/ens/">Ethereum Naming Service<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -94,7 +94,7 @@ OTHER OPTIONS
<div class="nav previous"><a href="/v5/cli/asm/"><span class="arrow">&larr;</span>Assembler</a></div>
<div class="nav next"><a href="/v5/cli/typescript/">TypeScript<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -209,7 +209,7 @@ homestead&gt;</div><div class="definition container-box warning"><div class="ter
<div class="nav previous"><a href="/v5/cli/"><span class="arrow">&larr;</span>Command Line Interfaces</a></div>
<div class="nav next"><a href="/v5/cli/asm/">Assembler<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -23,7 +23,7 @@
<div class="nav previous"><a href="/v5/api/experimental/"><span class="arrow">&larr;</span>Experimental</a></div>
<div class="nav next"><a href="/v5/cli/ethers/">Sandbox Utility<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -102,7 +102,7 @@
<div class="nav previous"><a href="/v5/cli/typescript/"><span class="arrow">&larr;</span>TypeScript</a></div>
<div class="nav next"><a href="/v5/cookbook/">Cookbook<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -42,7 +42,7 @@ OTHER OPTIONS
<div class="nav previous"><a href="/v5/cli/ens/"><span class="arrow">&larr;</span>Ethereum Naming Service</a></div>
<div class="nav next"><a href="/v5/cli/plugin/">Making Your Own<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -46,7 +46,7 @@
<div class="nav previous"><!--PREV_LINK--></div>
<div class="nav next"><!--NEXT_LINK--></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -150,7 +150,7 @@ const contract = new Contract(tokenAddress, abi, provider);
<div class="nav previous"><a href="/v5/concepts/"><span class="arrow">&larr;</span>Ethereum Basics</a></div>
<div class="nav next"><a href="/v5/concepts/gas/">Gas<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -27,7 +27,7 @@
<div class="nav previous"><a href="/v5/concepts/events/"><span class="arrow">&larr;</span>Events</a></div>
<div class="nav next"><a href="/v5/concepts/security/">Security<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -26,7 +26,7 @@
<div class="nav previous"><a href="/v5/getting-started/"><span class="arrow">&larr;</span>Getting Started</a></div>
<div class="nav next"><a href="/v5/concepts/events/">Events<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -62,7 +62,7 @@
<div class="nav previous"><a href="/v5/concepts/gas/"><span class="arrow">&larr;</span>Gas</a></div>
<div class="nav next"><a href="/v5/api/">Application Programming Interface<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -81,7 +81,7 @@
<div class="nav previous"><a href="/v5/testing/"><span class="arrow">&larr;</span>Testing</a></div>
<div class="nav next"><a href="/v5/documentation/">Flatworm Docs<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -24,7 +24,7 @@
<div class="nav previous"><a href="/v5/cli/plugin/"><span class="arrow">&larr;</span>Making Your Own</a></div>
<div class="nav next"><a href="/v5/migration/">Migration Guide<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -282,7 +282,7 @@ $bottom: This just represents an example of
<div class="nav previous"><a href="/v5/contributing/"><span class="arrow">&larr;</span>Contributing and Hacking</a></div>
<div class="nav next"><a href="/v5/license/">License and Copyright<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -30,8 +30,10 @@ import { ethers } from "ethers";
### Web Browser
```
<script src="https://cdn.ethers.io/lib/ethers-5.0.esm.min.js"
type="application/javascipt"></script>
<script type="module">
import { ethers } from "https://cdn.ethers.io/lib/ethers-5.0.esm.min.js";
// Your code here...
</script>
```
```
@@ -65,7 +67,7 @@ const signer = provider.getSigner()
```javascript
// Look up the current block number
provider.getBlockNumber()
// { Promise: 10384649 }
// { Promise: 10397126 }
// Get the balance of an account (by address or ENS name)
balance = await provider.getBalance("ethers.eth")
@@ -133,11 +135,11 @@ daiContract.symbol()
// Get the balance of an address
balance = await daiContract.balanceOf("ricmoo.firefly.eth")
// { BigNumber: "8814410125722568213383" }
// { BigNumber: "9709905125722568213383" }
// Format the DAI for displaying to the user
ethers.utils.formatUnits(balance, 18)
// '8814.410125722568213383'
// '9709.905125722568213383'
```
### State Changing Methods
@@ -292,7 +294,7 @@ Signing Messages
// logging into a service, such as CryptoKitties simply
// pass the string in.
signature = await signer.signMessage("Hello World");
// '0x9671c8b89473038593fddda5875debcb517dbfe79bd25119f6b0878bcd6c5e9d497e5d7f08cb7314da5d2a04b49bee0918d0b9e11744ee5a738b94e38986575f1c'
// '0x7b8d663c680b165bb7b0601a65d730f532fa6427b2e30f1d91ff1d929712b3a50b427a672b90c1dc48a4e5fbde292fbded51f670ab57d15d5794b6ff015649611c'
//
// A common case is also signing a hash, which is 32
@@ -309,6 +311,6 @@ messageBytes = ethers.utils.arrayify(message);
// To sign a hash, you most often want to sign the bytes
signature = await signer.signMessage(messageBytes)
// '0xfff17b9972cf8466bcde13dfc52afe6cbe39b86b1c9028d0fe4de6ab565ce01a48b7eba3663a24588e87798d924e8178f3c7c84d9363f57a9bee519f7cac50b31b'
// '0xc791b3d29aa1754f9e392784273f076ef39ca5d81f2729c92af61f89db724a604074acbd725d9d95e1d3c9630211c8eee8e34f6d948d537dd82c11be4bcf676e1c'
```

View File

@@ -27,8 +27,10 @@
<p>For quick demos or prototyping though, it can be loaded in your Web Applications from our CDN.</p>
<div class="code-title"><div>ES6 in the Browser</div></div><div class="code">&lt;script src="https://cdn.ethers.io/lib/ethers-5.0.esm.min.js"
type="application/javascipt"&gt;&lt;/script&gt;</div><div class="code-title"><div>ES3 (UMD) in the Browser</div></div><div class="code">&lt;script src="https://cdn.ethers.io/lib/ethers-5.0.umd.min.js"
<div class="code-title"><div>ES6 in the Browser</div></div><div class="code">&lt;script type="module"&gt;
import { ethers } from "https://cdn.ethers.io/lib/ethers-5.0.esm.min.js";
// Your code here...
&lt;/script&gt;</div><div class="code-title"><div>ES3 (UMD) in the Browser</div></div><div class="code">&lt;script src="https://cdn.ethers.io/lib/ethers-5.0.umd.min.js"
type="application/javascipt"&gt;&lt;/script&gt;</div><a name="getting-started--glossary"></a><a name="getting-started--getting-started--glossary"></a><h2 class="show-anchors"><div>Common Terminology<div class="anchors"><a class="self" href="/v5/getting-started/#getting-started--glossary"></a></div></div></h2><p>This section needs work...</p>
<table class="table minimal"><tr><td align="left"><b>Provider</b></td><td align="left">A Provider (in ethers) is a class which provides an abstraction for a connection to the Ethereum Network. It provides read-only access to the Blockchain and its status.</td><td class="fix">&nbsp;</td></tr><tr><td align="left"><b>Signer</b></td><td align="left">A Signer is a class which (usually) in some way directly or indirectly has access to a private key, which can sign messages and transactions to authorize the network to charge your account ether to perform operations.</td><td class="fix">&nbsp;</td></tr><tr><td align="left"><b>Contract</b></td><td align="left">A Contract is an abstraction which represents a connection to a specific contract on the Ethereum Network, so that it can be used like a normal JavaScipt object.</td><td class="fix">&nbsp;</td></tr><tr><td class="table-title" colspan="2">Common Terms</td><td class="fix">&nbsp;</td></tr></table><a name="getting-started--connecting"></a><a name="getting-started--getting-started--connecting"></a><h2 class="show-anchors"><div>Connecting to Ethereum: Metamask<div class="anchors"><a class="self" href="/v5/getting-started/#getting-started--connecting"></a></div></div></h2><p>The quickest and easiest way to experiment and begin developing on Ethereum is to use <a href="https://metamask.io/">Metamask</a>, which is a browser extension that provides:</p>
@@ -47,7 +49,7 @@
<div class="code-title"><div>Basic Queries</div></div><div class="code"><span class="comment">// Look up the current block number
</span>provider.getBlockNumber()
<span class="result ok">// { Promise: 10384649 }
<span class="result ok">// { Promise: 10397126 }
</span>
<span class="comment">// Get the balance of an account (by address or ENS name)
</span>balance = await provider.getBalance("ethers.eth")
@@ -115,11 +117,11 @@
</span>
<span class="comment">// Get the balance of an address
</span>balance = await daiContract.balanceOf("ricmoo.firefly.eth")
<span class="result ok">// { BigNumber: "8814410125722568213383" }
<span class="result ok">// { BigNumber: "9709905125722568213383" }
</span>
<span class="comment">// Format the DAI for displaying to the user
</span>ethers.utils.formatUnits(balance, 18)
<span class="result ok">// '8814.410125722568213383'
<span class="result ok">// '9709.905125722568213383'
</span></div><a name="getting-started--writing"></a><a name="getting-started--getting-started--contracts--getting-started--writing"></a><h3 class="show-anchors"><div>State Changing Methods<div class="anchors"><a class="self" href="/v5/getting-started/#getting-started--writing"></a></div></div></h3>
<div class="code-title"><div>Sending DAI</div></div><div class="code"><span class="comment">// The DAI Contract is currently connected to the Provider,
</span><span class="comment">// which is read-only. We need to connect to a Signer, so
@@ -257,7 +259,7 @@ filter = daiContract.filters.Transfer(null, myAddress)
</span><span class="comment">// logging into a service, such as CryptoKitties simply
</span><span class="comment">// pass the string in.
</span>signature = await signer.signMessage("Hello World");
<span class="result ok">// '0x9671c8b89473038593fddda5875debcb517dbfe79bd25119f6b0878bcd6c5e9d497e5d7f08cb7314da5d2a04b49bee0918d0b9e11744ee5a738b94e38986575f1c'
<span class="result ok">// '0x7b8d663c680b165bb7b0601a65d730f532fa6427b2e30f1d91ff1d929712b3a50b427a672b90c1dc48a4e5fbde292fbded51f670ab57d15d5794b6ff015649611c'
</span>
//
<span class="comment">// A common case is also signing a hash, which is 32
@@ -274,14 +276,14 @@ filter = daiContract.filters.Transfer(null, myAddress)
</span>
<span class="comment">// To sign a hash, you most often want to sign the bytes
</span>signature = await signer.signMessage(messageBytes)
<span class="result ok">// '0xfff17b9972cf8466bcde13dfc52afe6cbe39b86b1c9028d0fe4de6ab565ce01a48b7eba3663a24588e87798d924e8178f3c7c84d9363f57a9bee519f7cac50b31b'
<span class="result ok">// '0xc791b3d29aa1754f9e392784273f076ef39ca5d81f2729c92af61f89db724a604074acbd725d9d95e1d3c9630211c8eee8e34f6d948d537dd82c11be4bcf676e1c'
</span></div>
<div class="footer">
<div class="nav previous"><a href="/v5/"><span class="arrow">&larr;</span>Documentation</a></div>
<div class="nav next"><a href="/v5/concepts/">Ethereum Basics<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -46,7 +46,7 @@
<div class="nav previous"><!--PREV_LINK--></div>
<div class="nav next"><!--NEXT_LINK--></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -32,7 +32,7 @@
<div class="nav previous"><!--PREV_LINK--></div>
<div class="nav next"><a href="/v5/getting-started/">Getting Started<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -32,7 +32,7 @@
<div class="nav previous"><a href="/v5/documentation/"><span class="arrow">&larr;</span>Flatworm Docs</a></div>
<div class="nav next"><!--NEXT_LINK--></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -108,7 +108,7 @@ interface.events.Transfer.decode(data, topics)
// v5
interface.encodeFilterTopics("Transfer", values)
interface.encodeEventLog("Transfer", data, topics)
interface.decodeEventLog("Transfer", data, topics)
```
### Inspection

View File

@@ -97,7 +97,7 @@ interface.events.Transfer.decode(data, topics)
<span class="comment">// v5
</span>interface.encodeFilterTopics("Transfer", values)
interface.encodeEventLog("Transfer", data, topics)
interface.decodeEventLog("Transfer", data, topics)
</div><a name="migration-v4--interface--inspection"></a><h3 class="show-anchors"><div>Inspection<div class="anchors"><a class="self" href="/v5/migration/ethers-v4/#migration-v4--interface--inspection"></a></div></div></h3><p>Interrogating properties about a function or event can now (mostly) be done directly on the <a href="/v5/api/utils/abi/fragments/#Fragment">Fragment</a> object.</p>
<div class="code">// v4
@@ -168,7 +168,7 @@ wallet.mnemonic.path
<div class="nav previous"><a href="/v5/migration/web3/"><span class="arrow">&larr;</span>Migration: From Web3.js</a></div>
<div class="nav next"><a href="/v5/testing/">Testing<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -24,7 +24,7 @@
<div class="nav previous"><a href="/v5/cookbook/"><span class="arrow">&larr;</span>Cookbook</a></div>
<div class="nav next"><a href="/v5/migration/web3/">Migration: From Web3.js<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -28,7 +28,7 @@
<div class="nav previous"><a href="/v5/migration/"><span class="arrow">&larr;</span>Migration Guide</a></div>
<div class="nav next"><a href="/v5/migration/ethers-v4/">Migration: From Ethers v4<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -36,8 +36,10 @@
<p>For quick demos or prototyping though, it can be loaded in your Web Applications from our CDN.</p>
<div class="code-title"><div>ES6 in the Browser</div></div><div class="code">&lt;script src="https://cdn.ethers.io/lib/ethers-5.0.esm.min.js"
type="application/javascipt"&gt;&lt;/script&gt;</div><div class="code-title"><div>ES3 (UMD) in the Browser</div></div><div class="code">&lt;script src="https://cdn.ethers.io/lib/ethers-5.0.umd.min.js"
<div class="code-title"><div>ES6 in the Browser</div></div><div class="code">&lt;script type="module"&gt;
import { ethers } from "https://cdn.ethers.io/lib/ethers-5.0.esm.min.js";
// Your code here...
&lt;/script&gt;</div><div class="code-title"><div>ES3 (UMD) in the Browser</div></div><div class="code">&lt;script src="https://cdn.ethers.io/lib/ethers-5.0.umd.min.js"
type="application/javascipt"&gt;&lt;/script&gt;</div><a name="/v5/getting-started/-%23-getting-started--glossary"></a><a name="/v5/getting-started/-%23-getting-started--getting-started--glossary"></a><a name="/v5/getting-started/"></a><h2 class="show-anchors"><div>Common Terminology<div class="anchors"><a class="self" href="#/v5/getting-started/-%23-getting-started--glossary"></a></div></div></h2><p>This section needs work...</p>
<table class="table minimal"><tr><td align="left"><b>Provider</b></td><td align="left">A Provider (in ethers) is a class which provides an abstraction for a connection to the Ethereum Network. It provides read-only access to the Blockchain and its status.</td><td class="fix">&nbsp;</td></tr><tr><td align="left"><b>Signer</b></td><td align="left">A Signer is a class which (usually) in some way directly or indirectly has access to a private key, which can sign messages and transactions to authorize the network to charge your account ether to perform operations.</td><td class="fix">&nbsp;</td></tr><tr><td align="left"><b>Contract</b></td><td align="left">A Contract is an abstraction which represents a connection to a specific contract on the Ethereum Network, so that it can be used like a normal JavaScipt object.</td><td class="fix">&nbsp;</td></tr><tr><td class="table-title" colspan="2">Common Terms</td><td class="fix">&nbsp;</td></tr></table><a name="/v5/getting-started/-%23-getting-started--connecting"></a><a name="/v5/getting-started/-%23-getting-started--getting-started--connecting"></a><a name="/v5/getting-started/"></a><h2 class="show-anchors"><div>Connecting to Ethereum: Metamask<div class="anchors"><a class="self" href="#/v5/getting-started/-%23-getting-started--connecting"></a></div></div></h2><p>The quickest and easiest way to experiment and begin developing on Ethereum is to use <a href="https://metamask.io/">Metamask</a>, which is a browser extension that provides:</p>
@@ -56,7 +58,7 @@
<div class="code-title"><div>Basic Queries</div></div><div class="code"><span class="comment">// Look up the current block number
</span>provider.getBlockNumber()
<span class="result ok">// { Promise: 10384649 }
<span class="result ok">// { Promise: 10397126 }
</span>
<span class="comment">// Get the balance of an account (by address or ENS name)
</span>balance = await provider.getBalance("ethers.eth")
@@ -124,11 +126,11 @@
</span>
<span class="comment">// Get the balance of an address
</span>balance = await daiContract.balanceOf("ricmoo.firefly.eth")
<span class="result ok">// { BigNumber: "8814410125722568213383" }
<span class="result ok">// { BigNumber: "9709905125722568213383" }
</span>
<span class="comment">// Format the DAI for displaying to the user
</span>ethers.utils.formatUnits(balance, 18)
<span class="result ok">// '8814.410125722568213383'
<span class="result ok">// '9709.905125722568213383'
</span></div><a name="/v5/getting-started/-%23-getting-started--writing"></a><a name="/v5/getting-started/-%23-getting-started--getting-started--contracts--getting-started--writing"></a><a name="/v5/getting-started/"></a><h3 class="show-anchors"><div>State Changing Methods<div class="anchors"><a class="self" href="#/v5/getting-started/-%23-getting-started--writing"></a></div></div></h3>
<div class="code-title"><div>Sending DAI</div></div><div class="code"><span class="comment">// The DAI Contract is currently connected to the Provider,
</span><span class="comment">// which is read-only. We need to connect to a Signer, so
@@ -266,7 +268,7 @@ filter = daiContract.filters.Transfer(null, myAddress)
</span><span class="comment">// logging into a service, such as CryptoKitties simply
</span><span class="comment">// pass the string in.
</span>signature = await signer.signMessage("Hello World");
<span class="result ok">// '0x9671c8b89473038593fddda5875debcb517dbfe79bd25119f6b0878bcd6c5e9d497e5d7f08cb7314da5d2a04b49bee0918d0b9e11744ee5a738b94e38986575f1c'
<span class="result ok">// '0x7b8d663c680b165bb7b0601a65d730f532fa6427b2e30f1d91ff1d929712b3a50b427a672b90c1dc48a4e5fbde292fbded51f670ab57d15d5794b6ff015649611c'
</span>
//
<span class="comment">// A common case is also signing a hash, which is 32
@@ -283,7 +285,7 @@ filter = daiContract.filters.Transfer(null, myAddress)
</span>
<span class="comment">// To sign a hash, you most often want to sign the bytes
</span>signature = await signer.signMessage(messageBytes)
<span class="result ok">// '0xfff17b9972cf8466bcde13dfc52afe6cbe39b86b1c9028d0fe4de6ab565ce01a48b7eba3663a24588e87798d924e8178f3c7c84d9363f57a9bee519f7cac50b31b'
<span class="result ok">// '0xc791b3d29aa1754f9e392784273f076ef39ca5d81f2729c92af61f89db724a604074acbd725d9d95e1d3c9630211c8eee8e34f6d948d537dd82c11be4bcf676e1c'
</span></div><div class="page-separator"></div><a name="/v5/concepts/-%23-ethereum-basics"></a><a name="/v5/concepts/"></a><h1 class="show-anchors"><div>Ethereum Basics<div class="anchors"><a class="self" href="#/v5/concepts/-%23-ethereum-basics"></a></div></div></h1><p>This is a very breif overview of some aspects of <i>Ethereum</i> and blockchains which developers can make use of or should be aware of.</p>
<p>This section is fairly sparse at the moment, but will be expanded as time goes on.</p>
@@ -907,7 +909,7 @@ contract = new ethers.Contract("dai.tokens.ethers.eth", abi, signer)
<span class="comment">// Get the number of tokens for this account
</span>tokens = await contract.balanceOf(signer.getAddress())
<span class="result ok">// { BigNumber: "8814410125722568213383" }
<span class="result ok">// { BigNumber: "9709905125722568213383" }
</span>
//
<span class="comment">// Pre-flight (check for revert) on DAI from the signer
@@ -971,7 +973,7 @@ contract = new ethers.Contract("dai.tokens.ethers.eth", abi, signer)
</div></div><div class="code-title"><div>Account Examples</div></div><div class="code"><span class="comment">// Get the balance for an account...
</span>provider.getBalance("ricmoo.firefly.eth");
<span class="result ok">// { Promise: { BigNumber: "1585454034436018765" } }
<span class="result ok">// { Promise: { BigNumber: "1578527309436018765" } }
</span>
<span class="comment">// Get the code for a contract...
</span>provider.getCode("registrar.firefly.eth");
@@ -983,7 +985,7 @@ contract = new ethers.Contract("dai.tokens.ethers.eth", abi, signer)
</span>
<span class="comment">// Get transaction count of an account...
</span>provider.getTransactionCount("ricmoo.firefly.eth");
<span class="result ok">// { Promise: 670 }
<span class="result ok">// { Promise: 673 }
</span></div><a name="/v5/api/providers/provider/-%23-Provider--block-methods"></a><a name="/v5/api/providers/provider/-%23-Provider--Provider--block-methods"></a><a name="/v5/api/providers/provider/"></a><h2 class="show-anchors"><div>Blocks Methods<div class="anchors"><a class="self" href="#/v5/api/providers/provider/-%23-Provider--block-methods"></a></div></div></h2>
<a name="/v5/api/providers/provider/-%23-Provider-getBlock"></a><div class="property show-anchors"><div class="signature"><span class="path">provider</span><span class="symbol">.</span><span class="method">getBlock</span><span class="symbol">(</span> <span class="param">block</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">Promise&lt; <a href="#/v5/api/providers/types/-%23-providers-Block">Block</a> &gt;</span><div class="anchors"><a class="self" href="#/v5/api/providers/provider/-%23-Provider-getBlock"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/base-provider.ts#L936">source</a></div></div><div class="body"><p>Get the <i>block</i> from the network, where the <code class="inline">result.transactions</code> is a list of transaction hashes.</p>
@@ -1023,7 +1025,7 @@ provider.getBlockWithTransactions(100004)
</span><span class="result ok">// blockHash: '0xf93283571ae16dcecbe1816adc126954a739350cd1523a1559eabeae155fbb63',
</span><span class="result ok">// blockNumber: 100004,
</span><span class="result ok">// chainId: 0,
</span><span class="result ok">// confirmations: 10284646,
</span><span class="result ok">// confirmations: 10297123,
</span><span class="result ok">// creates: null,
</span><span class="result ok">// data: '0x',
</span><span class="result ok">// from: '0xcf00A85f3826941e7A25BFcF9Aac575d40410852',
@@ -1081,16 +1083,16 @@ provider.getBlockWithTransactions(100004)
</span>
<span class="comment">// The current block number
</span>provider.getBlockNumber()
<span class="result ok">// { Promise: 10384649 }
<span class="result ok">// { Promise: 10397126 }
</span>
<span class="comment">// Get the current suggested gas price (in wei)...
</span>gasPrice = await provider.getGasPrice()
<span class="result ok">// { BigNumber: "41000000000" }
<span class="result ok">// { BigNumber: "19000001123" }
</span>
<span class="comment">// ...often this gas price is easier to understand or
</span><span class="comment">// display to the user in gwei (giga-wei, or 1e9 wei)
</span>utils.formatUnits(gasPrice, "gwei")
<span class="result ok">// '41.0'
<span class="result ok">// '19.000001123'
</span></div><a name="/v5/api/providers/provider/-%23-Provider--transaction-methods"></a><a name="/v5/api/providers/provider/-%23-Provider--Provider--transaction-methods"></a><a name="/v5/api/providers/provider/"></a><h2 class="show-anchors"><div>Transactions Methods<div class="anchors"><a class="self" href="#/v5/api/providers/provider/-%23-Provider--transaction-methods"></a></div></div></h2>
<a name="/v5/api/providers/provider/-%23-Provider-call"></a><div class="property show-anchors"><div class="signature"><span class="path">provider</span><span class="symbol">.</span><span class="method">call</span><span class="symbol">(</span> <span class="param">transaction</span> <span class="symbol">[</span> <span class="symbol">,</span> <span class="param">blockTag</span> = <span class="param">latest</span> <span class="symbol">]</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">Promise&lt; string&lt; <a href="#/v5/api/utils/bytes/-%23-DataHexString">DataHexString</a> &gt; &gt;</span><div class="anchors"><a class="self" href="#/v5/api/providers/provider/-%23-Provider-call"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/base-provider.ts#L836">source</a></div></div><div class="body"><p>Returns the result of executing the <i>transaction</i>, using <i>call</i>. A call does not require any ether, but cannot change any state. This is useful for calling gettings on Contracts.</p>
@@ -1366,7 +1368,7 @@ provider = new AlchemyProvider("homestead", apiKey);
<div class="property show-anchors"><div class="signature"><span class="path">ipcProvider</span><span class="symbol">.</span><span class="method">path</span> <span class="arrow">&rArr;</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>The path this <a href="#/v5/api/providers/provider/">Provider</a> is connected to.</p>
</div></div><a name="/v5/api/providers/other/-%23-UrlJsonRpcProvider"></a><a name="/v5/api/providers/other/-%23-other-providers--UrlJsonRpcProvider"></a><a name="/v5/api/providers/other/"></a><h2 class="show-anchors"><div>UrlJsonRpcProvider<span class="inherits"> inherits <a href="#/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a></span><div class="anchors"><a class="self" href="#/v5/api/providers/other/-%23-UrlJsonRpcProvider"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/url-json-rpc-provider.ts#L35">source</a></div></div></h2><p>This class is intended to be sub-classed and not used directly. It simplifies creating a <a href="#/v5/api/providers/provider/">Provider</a> where a normal <a href="#/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a> would suffice, with a little extra effort needed to generate the JSON-RPC URL.</p>
</div></div><a name="/v5/api/providers/other/-%23-UrlJsonRpcProvider"></a><a name="/v5/api/providers/other/-%23-other-providers--UrlJsonRpcProvider"></a><a name="/v5/api/providers/other/"></a><h2 class="show-anchors"><div>UrlJsonRpcProvider<span class="inherits"> inherits <a href="#/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a></span><div class="anchors"><a class="self" href="#/v5/api/providers/other/-%23-UrlJsonRpcProvider"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/url-json-rpc-provider.ts#L49">source</a></div></div></h2><p>This class is intended to be sub-classed and not used directly. It simplifies creating a <a href="#/v5/api/providers/provider/">Provider</a> where a normal <a href="#/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a> would suffice, with a little extra effort needed to generate the JSON-RPC URL.</p>
<div class="property show-anchors"><div class="signature"><span class="modifier">new </span><span class="path">ethers</span><span class="symbol">.</span><span class="path">providers</span><span class="symbol">.</span><span class="method">UrlJsonRpcProvider</span><span class="symbol">(</span> <span class="symbol">[</span> <span class="param">network</span> <span class="symbol">[</span> <span class="symbol">,</span> <span class="param">apiKey</span> <span class="symbol">]</span> <span class="symbol">]</span> <span class="symbol">)</span><div class="anchors"></div></div><div class="body"><p>Sub-classes do not need to override this. Instead they should override the static method <code class="inline">getUrl</code> and optionally <code class="inline">getApiKey</code>.</p>
@@ -1920,7 +1922,7 @@ one2
</span>
<span class="comment">// Numbers outside the safe range fail:
</span>BigNumber.from(Number.MAX_SAFE_INTEGER);
<span class="result error">// Error: overflow (fault="overflow", operation="BigNumber.from", value=9007199254740991, code=NUMERIC_FAULT, version=bignumber/5.0.2)
<span class="result error">// Error: overflow (fault="overflow", operation="BigNumber.from", value=9007199254740991, code=NUMERIC_FAULT, version=bignumber/5.0.3)
</span></div><a name="/v5/api/utils/bignumber/-%23-BigNumber--methods"></a><a name="/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods"></a><a name="/v5/api/utils/bignumber/"></a><h2 class="show-anchors"><div>Methods<div class="anchors"><a class="self" href="#/v5/api/utils/bignumber/-%23-BigNumber--methods"></a></div></div></h2><p>The BigNumber class is immutable, so no operations can change the value it represents.</p>
<a name="/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--math-operations"></a><a name="/v5/api/utils/bignumber/"></a><h3 class="show-anchors"><div>Math Operations<div class="anchors"><a class="self" href="#/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--math-operations"></a></div></div></h3>
@@ -1938,7 +1940,7 @@ one2
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">abs</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns"><a href="#/v5/api/utils/bignumber/">BigNumber</a></span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L64">source</a></div></div><div class="body"><p>Returns a BigNumber with the absolute value of <i>BigNumber</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">mask</span><span class="symbol">(</span> <span class="param">bitcount</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns"><a href="#/v5/api/utils/bignumber/">BigNumber</a></span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L127">source</a></div></div><div class="body"><p>Returns a BigNumber with the value of <i>BigNumber</i> with bits beyond the <i>bitcount</i> least significant bits set to zero.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">mask</span><span class="symbol">(</span> <span class="param">bitcount</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns"><a href="#/v5/api/utils/bignumber/">BigNumber</a></span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L131">source</a></div></div><div class="body"><p>Returns a BigNumber with the value of <i>BigNumber</i> with bits beyond the <i>bitcount</i> least significant bits set to zero.</p>
</div></div><a name="/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--two-s-compliment"></a><a name="/v5/api/utils/bignumber/"></a><h3 class="show-anchors"><div>Two's Compliment<div class="anchors"><a class="self" href="#/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--two-s-compliment"></a></div></div></h3><p><a href="https://en.wikipedia.org/wiki/Two%27s_complement">Two's Complicment</a> is an elegant method used to encode and decode fixed-width signed values while efficiently preserving mathematic operations. Most users will not need to interact with these.</p>
@@ -1947,29 +1949,29 @@ one2
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toTwos</span><span class="symbol">(</span> <span class="param">bitwidth</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns"><a href="#/v5/api/utils/bignumber/">BigNumber</a></span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L60">source</a></div></div><div class="body"><p>Returns a BigNumber with the value of <i>BigNumber</i> converted to twos-compliment with <i>bitwidth</i>.</p>
</div></div><a name="/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--comparison-and-equivalence"></a><a name="/v5/api/utils/bignumber/"></a><h3 class="show-anchors"><div>Comparison and Equivalence<div class="anchors"><a class="self" href="#/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--comparison-and-equivalence"></a></div></div></h3>
<div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">eq</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L148">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> is equal to <i>otherValue</i>.</p>
<div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">eq</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L152">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> is equal to <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">lt</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L152">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&lt;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">lt</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L156">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&lt;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">lte</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L156">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&le;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">lte</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L160">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&le;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">gt</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L160">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&gt;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">gt</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L164">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&gt;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">gte</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L164">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&ge;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">gte</span><span class="symbol">(</span> <span class="param">otherValue</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L168">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> <b>&ge;</b> <i>otherValue</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">isZero</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L172">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> is zero.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">isZero</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L176">source</a></div></div><div class="body"><p>Returns true if and only if the value of <i>BigNumber</i> is zero.</p>
</div></div><a name="/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--conversion"></a><a name="/v5/api/utils/bignumber/"></a><h3 class="show-anchors"><div>Conversion<div class="anchors"><a class="self" href="#/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--conversion"></a></div></div></h3>
<div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toNumber</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">number</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L176">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a JavaScript value.</p>
<div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toNumber</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">number</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L180">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a JavaScript value.</p>
<p>This will <b>throw an error</b> if the value is greater than or equal to <i>Number.MAX_SAFE_INTEGER</i> or less than or equal to <i>Number.MIN_SAFE_INTEGER</i>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toString</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">string</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L185">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a base-10 string.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toString</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">string</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L189">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a base-10 string.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toHexString</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">string&lt; <a href="#/v5/api/utils/bytes/-%23-DataHexString">DataHexString</a> &gt;</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L193">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a base-16, <code class="inline">0x</code>-prefixed <a href="#/v5/api/utils/bytes/-%23-DataHexString">DataHexString</a>.</p>
</div></div><div class="property show-anchors"><div class="signature"><span class="path">BigNumber</span><span class="symbol">.</span><span class="method">toHexString</span><span class="symbol">(</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">string&lt; <a href="#/v5/api/utils/bytes/-%23-DataHexString">DataHexString</a> &gt;</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L197">source</a></div></div><div class="body"><p>Returns the value of <i>BigNumber</i> as a base-16, <code class="inline">0x</code>-prefixed <a href="#/v5/api/utils/bytes/-%23-DataHexString">DataHexString</a>.</p>
</div></div><a name="/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--inspection"></a><a name="/v5/api/utils/bignumber/"></a><h3 class="show-anchors"><div>Inspection<div class="anchors"><a class="self" href="#/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--inspection"></a></div></div></h3>
<div class="property show-anchors"><div class="signature"><span class="path">ethers</span><span class="symbol">.</span><span class="path">BigNumnber</span><span class="symbol">.</span><span class="method">isBigNumber</span><span class="symbol">(</span> <span class="param">object</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L246">source</a></div></div><div class="body"><p>Returns true if and only if the <i>object</i> is a BigNumber object.</p>
<div class="property show-anchors"><div class="signature"><span class="path">ethers</span><span class="symbol">.</span><span class="path">BigNumnber</span><span class="symbol">.</span><span class="method">isBigNumber</span><span class="symbol">(</span> <span class="param">object</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">boolean</span><div class="anchors"><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/bignumber/src.ts/bignumber.ts#L250">source</a></div></div><div class="body"><p>Returns true if and only if the <i>object</i> is a BigNumber object.</p>
</div></div><a name="/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--examples"></a><a name="/v5/api/utils/bignumber/"></a><h3 class="show-anchors"><div>Examples<div class="anchors"><a class="self" href="#/v5/api/utils/bignumber/-%23-BigNumber--BigNumber--methods--examples"></a></div></div></h3>
<div class="code">let a = BigNumber.from(42);
@@ -2104,20 +2106,20 @@ a.mul(b);
</div></div><a name="/v5/api/utils/bytes/-%23-utils-shuffled"></a><div class="property show-anchors"><div class="signature"><span class="path">ethers</span><span class="symbol">.</span><span class="path">utils</span><span class="symbol">.</span><span class="method">shuffled</span><span class="symbol">(</span> <span class="param">array</span> <span class="symbol">)</span> <span class="arrow">&rArr;</span> <span class="returns">Array&lt; any &gt;</span><div class="anchors"><a class="self" href="#/v5/api/utils/bytes/-%23-utils-shuffled"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/master/packages/random/src.ts/shuffle.ts#L3">source</a></div></div><div class="body"><p>Return a copy of <i>array</i> shuffled using <a href="https://en.wikipedia.org/wiki/Fisher-Yates_shuffle">Fisher-Yates Shuffle</a>.</p>
</div></div><div class="code-title"><div>Examples</div></div><div class="code">utils.randomBytes(8)
<span class="result ok">// Uint8Array [ 95, 9, 0, 81, 176, 49, 211, 225 ]
<span class="result ok">// Uint8Array [ 158, 14, 185, 6, 8, 37, 214, 172 ]
</span>
const data = [ 1, 2, 3, 4, 5, 6, 7 ];
<span class="comment">// Returns a new Array
</span>utils.shuffled(data);
<span class="result ok">// [
</span><span class="result ok">// 6,
</span><span class="result ok">// 7,
</span><span class="result ok">// 4,
</span><span class="result ok">// 3,
</span><span class="result ok">// 5,
</span><span class="result ok">// 1,
</span><span class="result ok">// 2
</span><span class="result ok">// 3,
</span><span class="result ok">// 4,
</span><span class="result ok">// 7,
</span><span class="result ok">// 2,
</span><span class="result ok">// 5,
</span><span class="result ok">// 6
</span><span class="result ok">// ]
</span>
<span class="comment">// The Original is unscathed...
@@ -3643,7 +3645,7 @@ interface.events.Transfer.decode(data, topics)
<span class="comment">// v5
</span>interface.encodeFilterTopics("Transfer", values)
interface.encodeEventLog("Transfer", data, topics)
interface.decodeEventLog("Transfer", data, topics)
</div><a name="/v5/migration/ethers-v4/-%23-migration-v4--interface--inspection"></a><a name="/v5/migration/ethers-v4/"></a><h3 class="show-anchors"><div>Inspection<div class="anchors"><a class="self" href="#/v5/migration/ethers-v4/-%23-migration-v4--interface--inspection"></a></div></div></h3><p>Interrogating properties about a function or event can now (mostly) be done directly on the <a href="#/v5/api/utils/abi/fragments/-%23-Fragment">Fragment</a> object.</p>
<div class="code">// v4
@@ -4044,7 +4046,7 @@ $bottom: This just represents an example of
<div class="nav previous"><!--PREV_LINK--></div>
<div class="nav next"><!--NEXT_LINK--></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -24,7 +24,7 @@
<div class="nav previous"><a href="/v5/migration/ethers-v4/"><span class="arrow">&larr;</span>Migration: From Ethers v4</a></div>
<div class="nav next"><a href="/v5/contributing/">Contributing and Hacking<span class="arrow">&rarr;</span></a></div>
</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 3, 2020, 1:44am.</div>
<div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>
</div>
<script src="/v5/static/script.js" type="text/javascript"></script>
</body>

View File

@@ -15,10 +15,28 @@ module.exports = function(config) {
],
port: 9876,
logLevel: config.LOG_INFO,
browsers: [ 'ChromeHeadless' ],
browsers: [ 'ChromeHeadless', "HeadlessLittleLiar" ],
autoWatch: false,
singleRun: true,
browserNoActivityTimeout: 60000
browserNoActivityTimeout: 60000,
customLaunchers: {
HeadlessLittleLiar: {
base: 'ChromeHeadless',
// https://peter.sh/experiments/chromium-command-line-switches/
flags: [
'--disable-extensions',
// Enable this to help debug CORS issues (otherwise fetch throws a useless TypeError)
//'--disable-web-security',
'--enable-automation',
// Cloudflare will block (on the testnet endpoints) any traffic
// from a headless chome (based on the user agent), so we lie
// This was take from Safari, because that is what I had on-hand
'--user-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15']
}
},
/*
client: {
mocha: {

View File

@@ -15,14 +15,33 @@ module.exports = function(config) {
],
port: 9876,
logLevel: config.LOG_INFO,
browsers: [ 'ChromeHeadless' ],
browsers: [ 'ChromeHeadless', "HeadlessLittleLiar" ],
autoWatch: false,
singleRun: true,
browserNoActivityTimeout: 600000
browserNoActivityTimeout: 600000,
customLaunchers: {
HeadlessLittleLiar: {
base: 'ChromeHeadless',
// https://peter.sh/experiments/chromium-command-line-switches/
flags: [
'--disable-extensions',
// Enable this to help debug CORS issues (otherwise fetch throws a useless TypeError)
//'--disable-web-security',
'--enable-automation',
// Cloudflare will block (on the testnet endpoints) any traffic
// from a headless chome (based on the user agent), so we lie
// This was take from Safari, because that is what I had on-hand
'--user-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15']
}
},
/*
client: {
mocha: {
grep: 'utf',
grep: 'Etherscan',
}
}
*/

2160
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -20,13 +20,13 @@
"clean": "node ./admin/cmds/reset-build.js && tsc --build --clean ./tsconfig.project.json",
"_dist-test-esm": "rollup -c rollup-tests.config.js --configModule",
"_dist-test-umd": "rollup -c rollup-tests.config.js",
"_test-browser-umd": "karma start --single-run --browsers ChromeHeadless karma-umd.conf.js",
"_test-browser-esm": "karma start --single-run --browsers ChromeHeadless karma-esm.conf.js",
"_test-node": "mocha --no-colors --reporter ./packages/tests/reporter ./packages/tests/lib/test-*.js",
"test-browser-umd": "npm run build-all && npm run _dist-test-umd && npm run _test-browser-umd",
"test-browser-esm": "npm run build-all && npm run _dist-test-esm && npm run _test-browser-esm",
"test-node": "npm run build-all && npm run _test-node",
"_test-browser-umd": "karma start --single-run --browsers HeadlessLittleLiar karma-umd.conf.js",
"_test-browser-esm": "karma start --single-run --browsers HeadlessLittleLiar karma-esm.conf.js",
"test-browser-umd": "npm run _dist-test-umd && npm run _test-browser-umd",
"test-browser-esm": "npm run _dist-test-esm && npm run _test-browser-esm",
"test-node": "mocha --no-colors --reporter ./packages/tests/reporter ./packages/tests/lib/test-*.js",
"test": "if [ \"$TEST\" == \"\" ]; then npm run test-node; else npm run \"test-$TEST\"; fi",
"test-coverage": "nyc mocha --reporter ./packages/tests/reporter-keepalive ./packages/tests/lib/test-*.js",
"lock-versions": "node ./admin/cmds/lock-versions",
"build-docs": "flatworm docs.wrm docs",
"serve-docs": "node ./admin/cmds/serve-docs.js",
@@ -39,6 +39,7 @@
"sync-github": "node ./admin/cmds/cache-github"
},
"devDependencies": {
"@erquhart/rollup-plugin-node-builtins": "2.1.5",
"@types/assert": "^1.4.1",
"@types/mocha": "^5.2.0",
"@types/node": "^12.7.4",
@@ -46,17 +47,17 @@
"aws-sdk": "2.137.0",
"diff": "4.0.1",
"flatworm": "0.0.2-beta.4",
"karma": "5.0.2",
"karma": "5.1.0",
"karma-chrome-launcher": "3.1.0",
"karma-mocha": "2.0.0",
"karma-mocha": "2.0.1",
"lerna": "^3.20.2",
"libnpmpublish": "1.1.3",
"mocha": "^7.1.1",
"npm-packlist": "1.4.1",
"nyc": "15.1.0",
"rollup": "1.20.1",
"rollup-plugin-commonjs": "10.0.2",
"rollup-plugin-json": "4.0.0",
"@erquhart/rollup-plugin-node-builtins": "2.1.5",
"rollup-plugin-node-globals": "1.4.0",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-terser": "^5.2.0",

View File

@@ -1 +1 @@
export declare const version = "abi/5.0.1";
export declare const version = "abi/5.0.2";

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"_version.js","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC"}

View File

@@ -89,3 +89,4 @@ export class AbiCoder {
}
}
export const defaultAbiCoder = new AbiCoder();
//# sourceMappingURL=abi-coder.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"abi-coder.js","sourceRoot":"","sources":["../src.ts/abi-coder.ts"],"names":[],"mappings":"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"}

View File

@@ -129,3 +129,4 @@ export class Reader {
return BigNumber.from(this.readBytes(this.wordSize));
}
}
//# sourceMappingURL=abstract-coder.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"abstract-coder.js","sourceRoot":"","sources":["../../src.ts/coders/abstract-coder.ts"],"names":[],"mappings":"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"}

View File

@@ -19,3 +19,4 @@ export class AddressCoder extends Coder {
return getAddress(hexZeroPad(reader.readValue().toHexString(), 20));
}
}
//# sourceMappingURL=address.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/coders/address.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAkB,MAAM,kBAAkB,CAAC;AAEzD,MAAM,OAAO,YAAa,SAAQ,KAAK;IAEnC,YAAY,SAAiB;QACzB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAa;QAChC,IAAI;YACA,UAAU,CAAC,KAAK,CAAC,CAAC;SACrB;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SAC1C;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;CACJ"}

View File

@@ -13,3 +13,4 @@ export class AnonymousCoder extends Coder {
return this.coder.decode(reader);
}
}
//# sourceMappingURL=anonymous.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"anonymous.js","sourceRoot":"","sources":["../../src.ts/coders/anonymous.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,KAAK,EAAkB,MAAM,kBAAkB,CAAC;AAEzD,yEAAyE;AACzE,MAAM,OAAO,cAAe,SAAQ,KAAK;IAGrC,YAAY,KAAY;QACpB,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CACJ"}

View File

@@ -190,3 +190,4 @@ export class ArrayCoder extends Coder {
return reader.coerce(this.name, unpack(reader, coders));
}
}
//# sourceMappingURL=array.js.map

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