Updated generated documentaiton.
This commit is contained in:
parent
067d96062a
commit
2fdf995e8a
@ -11,7 +11,7 @@ What is ethers?
|
||||
|
||||
The ethers.js library aims to be a complete and compact library for
|
||||
interacting with the Ethereum Blockchain and its ecosystem. It was
|
||||
originally designed for use with [ethers.io](https://ethers.io/) and
|
||||
originally designed for use with [ethers.io](Users/ricmoo/Development/ethers/ethers.js-v5/https:/ethers.io) and
|
||||
has since expanded into a much more general-purpose library.
|
||||
|
||||
|
||||
@ -25,11 +25,11 @@ Features
|
||||
* Import and export **JSON wallets** (Geth, Parity and crowdsale)
|
||||
* Import and export BIP 39 **mnemonic phrases** (12 word backup phrases) and HD Wallets (English, Italian, Japanese, Korean, Simplified Chinese, Traditional Chinese; more coming soon)
|
||||
* Meta-classes create JavaScript objects from any contract ABI, including **ABIv2** and **Human-Readable ABI**
|
||||
* Connect to Ethereum nodes over [JSON-RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC), [INFURA](https://infura.io/), [Etherscan](https://etherscan.io/), [Nodesmith](https://nodesmith.io), [Alchemy](https://alchemyapi.io), or [MetaMask](https://metamask.io/).
|
||||
* Connect to Ethereum nodes over [JSON-RPC](Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/ethereum/wiki/wiki/JSON-RPC), [INFURA](Users/ricmoo/Development/ethers/ethers.js-v5/https:/infura.io), [Etherscan](Users/ricmoo/Development/ethers/ethers.js-v5/https:/etherscan.io), [Alchemy](Users/ricmoo/Development/ethers/ethers.js-v5/https:/alchemyapi.io), [Cloudflare](Users/ricmoo/Development/ethers/ethers.js-v5/https:/developers.cloudflare.com/distributed-web/ethereum-gateway) or [MetaMask](Users/ricmoo/Development/ethers/ethers.js-v5/https:/metamask.io).
|
||||
* **ENS names** are first-class citizens; they can be used anywhere an Ethereum addresses can be used
|
||||
* **Tiny** (~88kb compressed; 284kb uncompressed)
|
||||
* **Complete** functionality for all your Ethereum needs
|
||||
* Extensive [documentation](https://docs.ethers.io/)
|
||||
* Extensive [documentation](Users/ricmoo/Development/ethers/ethers.js-v5/https:/docs.ethers.io)
|
||||
* Large collection of **test cases** which are maintained and added to
|
||||
* Fully **TypeScript** ready, with definition files and full TypeScript source
|
||||
* **MIT License** (including *ALL* dependencies); completely open source to do with as you please
|
||||
@ -86,16 +86,17 @@ Developer Documentation
|
||||
* [Events and Logs](api/providers/types)
|
||||
* [Transactions](api/providers/types)
|
||||
* [Utilities](api/utils)
|
||||
* [Addresses](api/utils/address)
|
||||
* [Address Formats](api/utils/address)
|
||||
* [Functions](api/utils/address)
|
||||
* [Application Binary Interface](api/utils/abi)
|
||||
* [Formats](api/utils/abi)
|
||||
* [Interface](api/utils/abi)
|
||||
* [Fragment](api/utils/abi)
|
||||
* [ConstructorFragment](api/utils/abi)
|
||||
* [EventFragment](api/utils/abi)
|
||||
* [FunctionFragment](api/utils/abi)
|
||||
* [ParamType](api/utils/abi)
|
||||
* [Addresses](api/utils/address)
|
||||
* [Address Formats](api/utils/address)
|
||||
* [Functions](api/utils/address)
|
||||
* [BigNumber](api/utils/bignumber)
|
||||
* [Types](api/utils/bignumber)
|
||||
* [Creating Instances](api/utils/bignumber)
|
||||
@ -108,6 +109,7 @@ Developer Documentation
|
||||
* [Array Manipulation](api/utils/bytes)
|
||||
* [Hexstring Manipulation](api/utils/bytes)
|
||||
* [Signature Conversion](api/utils/bytes)
|
||||
* [Random Bytes](api/utils/bytes)
|
||||
* [Constants](api/utils/constants)
|
||||
* [Bytes](api/utils/constants)
|
||||
* [Strings](api/utils/constants)
|
||||
@ -115,15 +117,29 @@ Developer Documentation
|
||||
* [Display Logic and Input](api/utils/display-logic)
|
||||
* [Units](api/utils/display-logic)
|
||||
* [Functions](api/utils/display-logic)
|
||||
* [Encoding Utilities](api/utils/encoding)
|
||||
* [Base58](api/utils/encoding)
|
||||
* [Base64](api/utils/encoding)
|
||||
* [Recursive-Length Prefix](api/utils/encoding)
|
||||
* [FixedNumber](api/utils/fixednumber)
|
||||
* [FixedFormat](api/utils/fixednumber)
|
||||
* [Creating Instances](api/utils/fixednumber)
|
||||
* [Properties](api/utils/fixednumber)
|
||||
* [Methods](api/utils/fixednumber)
|
||||
* [FixedFormat](api/utils/fixednumber)
|
||||
* [Hashing Algorithms](api/utils/hashing)
|
||||
* [Cryptographic Hashing](api/utils/hashing)
|
||||
* [Common Hashing Helpers](api/utils/hashing)
|
||||
* [Solidity Hashing Algorithms](api/utils/hashing)
|
||||
* [HD Wallet](api/utils/hdnode)
|
||||
* [Types](api/utils/hdnode)
|
||||
* [HDNode](api/utils/hdnode)
|
||||
* [Other Functions](api/utils/hdnode)
|
||||
* [Logger](api/utils/logger)
|
||||
* [Errors](api/utils/logger)
|
||||
* [Creating instances](api/utils/logger)
|
||||
* [Property Utilities](api/utils/properties)
|
||||
* [Signing Key](api/utils/signing-key)
|
||||
* [Other Functions](api/utils/signing-key)
|
||||
* [Strings](api/utils/strings)
|
||||
* [Bytes32String](api/utils/strings)
|
||||
* [UTF-8 Strings](api/utils/strings)
|
||||
@ -132,7 +148,29 @@ Developer Documentation
|
||||
* [Transactions](api/utils/transactions)
|
||||
* [Types](api/utils/transactions)
|
||||
* [Functions](api/utils/transactions)
|
||||
* [Web Utilities](api/utils/web)
|
||||
* [Wordlists](api/utils/wordlists)
|
||||
* [Wordlist](api/utils/wordlists)
|
||||
* [Languages](api/utils/wordlists)
|
||||
* [Other Libraries](api/other)
|
||||
* [Assembly](api/other/assembly)
|
||||
* [Ethers ASM Dialect](api/other/assembly/dialect)
|
||||
* [Opcodes](api/other/assembly/dialect)
|
||||
* [Labels](api/other/assembly/dialect)
|
||||
* [Literals](api/other/assembly/dialect)
|
||||
* [Comments](api/other/assembly/dialect)
|
||||
* [Scopes](api/other/assembly/dialect)
|
||||
* [Data Segment](api/other/assembly/dialect)
|
||||
* [Links](api/other/assembly/dialect)
|
||||
* [Stack Placeholders](api/other/assembly/dialect)
|
||||
* [Evaluation and Excution](api/other/assembly/dialect)
|
||||
* [Utilities](api/other/assembly/api)
|
||||
* [Assembler](api/other/assembly/api)
|
||||
* [Disassembler](api/other/assembly/api)
|
||||
* [Opcode](api/other/assembly/api)
|
||||
* [Abstract Syntax Tree](api/other/assembly/ast)
|
||||
* [Types](api/other/assembly/ast)
|
||||
* [Nodes](api/other/assembly/ast)
|
||||
* [Hardware Wallets](api/other/hardware)
|
||||
* [LedgerSigner](api/other/hardware)
|
||||
* [Command Line Interfaces](cli)
|
||||
@ -141,7 +179,9 @@ Developer Documentation
|
||||
* [Examples](cli/ethers)
|
||||
* [Assembler](cli/asm)
|
||||
* [Help](cli/asm)
|
||||
* [Examples](cli/asm)
|
||||
* [Example Input Files](cli/asm)
|
||||
* [Assembler Examples](cli/asm)
|
||||
* [Disassembler Examples](cli/asm)
|
||||
* [ENS](cli/ens)
|
||||
* [Help](cli/ens)
|
||||
* [Examples](cli/ens)
|
||||
@ -154,8 +194,18 @@ Developer Documentation
|
||||
* [ArgParser](cli/plugin)
|
||||
* [Cookbook](cookbook)
|
||||
* [Migration Guide](migration)
|
||||
* [From Web3](migration)
|
||||
* [From ethers v4](migration)
|
||||
* [Migration: From Web3.js](migration/web3)
|
||||
* [Contracts](migration/web3)
|
||||
* [Providers](migration/web3)
|
||||
* [Numbers](migration/web3)
|
||||
* [Utilities](migration/web3)
|
||||
* [Migration: From Ethers v4](migration/ethers-v4)
|
||||
* [BigNumber](migration/ethers-v4)
|
||||
* [Contracts](migration/ethers-v4)
|
||||
* [Errors](migration/ethers-v4)
|
||||
* [Interface](migration/ethers-v4)
|
||||
* [Utilities](migration/ethers-v4)
|
||||
* [Wallet](migration/ethers-v4)
|
||||
* [Testing](testing)
|
||||
* [Contributing and Hacking](contributing)
|
||||
* [Building](contributing)
|
||||
@ -176,10 +226,10 @@ older versions of the library.
|
||||
|
||||
|
||||
|
||||
* [version 4.0](https://docs.ethers.io/ethers.js)
|
||||
* [version 3.0](https://docs.ethers.io/ethers.js/v3.0/html/)
|
||||
* [version 4.0](Users/ricmoo/Development/ethers/ethers.js-v5/https:/docs.ethers.io/ethers.js)
|
||||
* [version 3.0](Users/ricmoo/Development/ethers/ethers.js-v5/https:/docs.ethers.io/ethers.js/v3.0/html)
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** bf4f628855f6f4c54ceca8c845e7ec93498135aa2d045f582d7c98e3a05294d7
|
||||
**Content Hash:** e47c57b222edf98628be3e6d682eba93201d2163e7e059d2a963004f8ee81059
|
@ -48,16 +48,17 @@ Here...
|
||||
* [Events and Logs](providers/types)
|
||||
* [Transactions](providers/types)
|
||||
* [Utilities](utils)
|
||||
* [Addresses](utils/address)
|
||||
* [Address Formats](utils/address)
|
||||
* [Functions](utils/address)
|
||||
* [Application Binary Interface](utils/abi)
|
||||
* [Formats](utils/abi)
|
||||
* [Interface](utils/abi)
|
||||
* [Fragment](utils/abi)
|
||||
* [ConstructorFragment](utils/abi)
|
||||
* [EventFragment](utils/abi)
|
||||
* [FunctionFragment](utils/abi)
|
||||
* [ParamType](utils/abi)
|
||||
* [Addresses](utils/address)
|
||||
* [Address Formats](utils/address)
|
||||
* [Functions](utils/address)
|
||||
* [BigNumber](utils/bignumber)
|
||||
* [Types](utils/bignumber)
|
||||
* [Creating Instances](utils/bignumber)
|
||||
@ -70,6 +71,7 @@ Here...
|
||||
* [Array Manipulation](utils/bytes)
|
||||
* [Hexstring Manipulation](utils/bytes)
|
||||
* [Signature Conversion](utils/bytes)
|
||||
* [Random Bytes](utils/bytes)
|
||||
* [Constants](utils/constants)
|
||||
* [Bytes](utils/constants)
|
||||
* [Strings](utils/constants)
|
||||
@ -77,15 +79,29 @@ Here...
|
||||
* [Display Logic and Input](utils/display-logic)
|
||||
* [Units](utils/display-logic)
|
||||
* [Functions](utils/display-logic)
|
||||
* [Encoding Utilities](utils/encoding)
|
||||
* [Base58](utils/encoding)
|
||||
* [Base64](utils/encoding)
|
||||
* [Recursive-Length Prefix](utils/encoding)
|
||||
* [FixedNumber](utils/fixednumber)
|
||||
* [FixedFormat](utils/fixednumber)
|
||||
* [Creating Instances](utils/fixednumber)
|
||||
* [Properties](utils/fixednumber)
|
||||
* [Methods](utils/fixednumber)
|
||||
* [FixedFormat](utils/fixednumber)
|
||||
* [Hashing Algorithms](utils/hashing)
|
||||
* [Cryptographic Hashing](utils/hashing)
|
||||
* [Common Hashing Helpers](utils/hashing)
|
||||
* [Solidity Hashing Algorithms](utils/hashing)
|
||||
* [HD Wallet](utils/hdnode)
|
||||
* [Types](utils/hdnode)
|
||||
* [HDNode](utils/hdnode)
|
||||
* [Other Functions](utils/hdnode)
|
||||
* [Logger](utils/logger)
|
||||
* [Errors](utils/logger)
|
||||
* [Creating instances](utils/logger)
|
||||
* [Property Utilities](utils/properties)
|
||||
* [Signing Key](utils/signing-key)
|
||||
* [Other Functions](utils/signing-key)
|
||||
* [Strings](utils/strings)
|
||||
* [Bytes32String](utils/strings)
|
||||
* [UTF-8 Strings](utils/strings)
|
||||
@ -94,11 +110,33 @@ Here...
|
||||
* [Transactions](utils/transactions)
|
||||
* [Types](utils/transactions)
|
||||
* [Functions](utils/transactions)
|
||||
* [Web Utilities](utils/web)
|
||||
* [Wordlists](utils/wordlists)
|
||||
* [Wordlist](utils/wordlists)
|
||||
* [Languages](utils/wordlists)
|
||||
* [Other Libraries](other)
|
||||
* [Assembly](other/assembly)
|
||||
* [Ethers ASM Dialect](other/assembly/dialect)
|
||||
* [Opcodes](other/assembly/dialect)
|
||||
* [Labels](other/assembly/dialect)
|
||||
* [Literals](other/assembly/dialect)
|
||||
* [Comments](other/assembly/dialect)
|
||||
* [Scopes](other/assembly/dialect)
|
||||
* [Data Segment](other/assembly/dialect)
|
||||
* [Links](other/assembly/dialect)
|
||||
* [Stack Placeholders](other/assembly/dialect)
|
||||
* [Evaluation and Excution](other/assembly/dialect)
|
||||
* [Utilities](other/assembly/api)
|
||||
* [Assembler](other/assembly/api)
|
||||
* [Disassembler](other/assembly/api)
|
||||
* [Opcode](other/assembly/api)
|
||||
* [Abstract Syntax Tree](other/assembly/ast)
|
||||
* [Types](other/assembly/ast)
|
||||
* [Nodes](other/assembly/ast)
|
||||
* [Hardware Wallets](other/hardware)
|
||||
* [LedgerSigner](other/hardware)
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 9efeac06691d2415dcc248d1567676602f7df029abd5f844480b12bb844588a7
|
||||
**Content Hash:** be5b26283f92ba2629be4efa3939fb71d8b7d3531bd335a1bd7b5b8386eaf876
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -14,10 +14,28 @@ ancillary packages, which are not part of the core but optionally
|
||||
add functionality only needed in certain situations.
|
||||
|
||||
|
||||
* [Assembly](assembly)
|
||||
* [Ethers ASM Dialect](assembly/dialect)
|
||||
* [Opcodes](assembly/dialect)
|
||||
* [Labels](assembly/dialect)
|
||||
* [Literals](assembly/dialect)
|
||||
* [Comments](assembly/dialect)
|
||||
* [Scopes](assembly/dialect)
|
||||
* [Data Segment](assembly/dialect)
|
||||
* [Links](assembly/dialect)
|
||||
* [Stack Placeholders](assembly/dialect)
|
||||
* [Evaluation and Excution](assembly/dialect)
|
||||
* [Utilities](assembly/api)
|
||||
* [Assembler](assembly/api)
|
||||
* [Disassembler](assembly/api)
|
||||
* [Opcode](assembly/api)
|
||||
* [Abstract Syntax Tree](assembly/ast)
|
||||
* [Types](assembly/ast)
|
||||
* [Nodes](assembly/ast)
|
||||
* [Hardware Wallets](hardware)
|
||||
* [LedgerSigner](hardware)
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** bafa126f115321049791ba83b99acf79f82f222eb246124c601983ad8cb4b73a
|
||||
**Content Hash:** d29ef5cbebb1685588a99b27e7fd65a813eed036f47e893be17b8e02b70bd798
|
34
docs/api/other/assembly/README.md
Normal file
34
docs/api/other/assembly/README.md
Normal file
@ -0,0 +1,34 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Assembly
|
||||
========
|
||||
|
||||
|
||||
|
||||
* [Ethers ASM Dialect](dialect)
|
||||
* [Opcodes](dialect)
|
||||
* [Labels](dialect)
|
||||
* [Literals](dialect)
|
||||
* [Comments](dialect)
|
||||
* [Scopes](dialect)
|
||||
* [Data Segment](dialect)
|
||||
* [Links](dialect)
|
||||
* [Stack Placeholders](dialect)
|
||||
* [Evaluation and Excution](dialect)
|
||||
* [Utilities](api)
|
||||
* [Assembler](api)
|
||||
* [Disassembler](api)
|
||||
* [Opcode](api)
|
||||
* [Abstract Syntax Tree](ast)
|
||||
* [Types](ast)
|
||||
* [Nodes](ast)
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 788fa8cbceed019d051941c427df5e77f74cc536d125f33b680f16d2e4aa508a
|
185
docs/api/other/assembly/api/README.md
Normal file
185
docs/api/other/assembly/api/README.md
Normal file
@ -0,0 +1,185 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Utilities
|
||||
=========
|
||||
|
||||
|
||||
|
||||
Assembler
|
||||
---------
|
||||
|
||||
|
||||
The assembler utilities allow parsing and assembling an
|
||||
[Ethers ASM Dialect](../dialect) source file.
|
||||
|
||||
|
||||
#### *asm* . **parse** ( code ) **=>** *[Node](../ast)*
|
||||
|
||||
Parse an ethers-format assembly file and return the [Abstract Syntax Tree](../ast).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *asm* . **assemble** ( node ) **=>** *string< [DataHexstring](../../../utils/bytes) >*
|
||||
|
||||
Performs assembly of the [Abstract Syntax Tree](../ast) *node* and return the
|
||||
resulting bytecode representation.
|
||||
|
||||
|
||||
|
||||
|
||||
Disassembler
|
||||
------------
|
||||
|
||||
|
||||
The **Disassembler** utilities make it easy to convert bytecode
|
||||
into an object which can easily be examined for program structure.
|
||||
|
||||
|
||||
#### *asm* . **disassemble** ( bytecode ) **=>** *[Bytecode](./)*
|
||||
|
||||
Returns an array of Operations given *bytecode*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *asm* . **formatBytecode** ( operations ) **=>** *string*
|
||||
|
||||
Create a formatted output of an array of [Operation](./).
|
||||
|
||||
|
||||
|
||||
|
||||
### Bytecode
|
||||
|
||||
|
||||
Each arary index represents an operation, collapsing multi-byte operations
|
||||
(i.e. `PUSH`) into a single operation.
|
||||
|
||||
|
||||
#### *bytecode* . **getOperation** ( offset ) **=>** *[Operation](./)*
|
||||
|
||||
Get the operation at a given *offset* into the bytecode. This ensures that
|
||||
the byte at *offset* is an operation and not data contained within a `PUSH`,
|
||||
in which case null it returned.
|
||||
|
||||
|
||||
|
||||
|
||||
### Operation
|
||||
|
||||
|
||||
An **Operation** is a single command from a disassembled bytecode
|
||||
stream.
|
||||
|
||||
|
||||
#### *operation* . **opcode** **=>** *[Opcode](./)*
|
||||
|
||||
The opcode for this Operation.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *operation* . **offset** **=>** *number*
|
||||
|
||||
The offset into the bytecode for this Operation.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *operation* . **pushValue** **=>** *string< [DataHexstring](../../../utils/bytes) >*
|
||||
|
||||
If the opcode is a `PUSH`, this is the value of that push
|
||||
|
||||
|
||||
|
||||
|
||||
Opcode
|
||||
------
|
||||
|
||||
|
||||
|
||||
#### *asm* . *Opcode* . **from** ( valueOrMnemonic ) **=>** *[Opcode](./)*
|
||||
|
||||
Create a new instnace of an Opcode for a given numeric value
|
||||
(e.g. 0x60 is PUSH1) or mnemonic string (e.g. "PUSH1").
|
||||
|
||||
|
||||
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
|
||||
#### *opcode* . **value** **=>** *number*
|
||||
|
||||
The value (bytecode as a number) of this opcode.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *opcode* . **mnemonic** **=>** *string*
|
||||
|
||||
The mnemonic string of this opcode.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *opcode* . **delta** **=>** *number*
|
||||
|
||||
The number of items this opcode will consume from the stack.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *opcode* . **alpha** **=>** *number*
|
||||
|
||||
The number of items this opcode will push onto the stack.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *opcode* . **doc** **=>** *string*
|
||||
|
||||
A short description of what this opcode does.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *opcode* . **isMemory** ( ) **=>** *"read"|"write"|"full"*
|
||||
|
||||
Returns true if the opcode accesses memory.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *opcode* . **isStatic** ( ) **=>** *boolean*
|
||||
|
||||
Returns true if the opcode cannot change state.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *opcode* . **isJump** ( ) **=>** *boolean*
|
||||
|
||||
Returns true if the opcode is a jumper operation.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *opcode* . **isPush** ( ) **=>** *number*
|
||||
|
||||
Returns 0 if the opcode is not a `PUSH*`, or the number
|
||||
of bytes this opcode will push if it is.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 1c170b94b22fa807a3906f95d76719a78fba6627996b108356643ef72b21f940
|
33
docs/api/other/assembly/api/index.html
Normal file
33
docs/api/other/assembly/api/index.html
Normal file
File diff suppressed because one or more lines are too long
252
docs/api/other/assembly/ast/README.md
Normal file
252
docs/api/other/assembly/ast/README.md
Normal file
@ -0,0 +1,252 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Abstract Syntax Tree
|
||||
====================
|
||||
|
||||
|
||||
Parsing a file using the [Ethers ASM Dialect](../dialect) will
|
||||
generate an Abstract Syntax Tree. The root node will always
|
||||
be a [ScopeNode](./) whose name is `_`.
|
||||
|
||||
To parse a file into an Abstract Syntax tree, use the [parse](../api)
|
||||
function.
|
||||
|
||||
|
||||
Types
|
||||
-----
|
||||
|
||||
|
||||
|
||||
### Location
|
||||
|
||||
|
||||
|
||||
#### **offset** **=>** *number*
|
||||
|
||||
The offset into the source code to the start of this node.
|
||||
|
||||
|
||||
|
||||
|
||||
#### **length** **=>** *number*
|
||||
|
||||
The length of characters in the source code to the end of this node.
|
||||
|
||||
|
||||
|
||||
|
||||
#### **source** **=>** *string*
|
||||
|
||||
The source code of this node.
|
||||
|
||||
|
||||
|
||||
|
||||
Nodes
|
||||
-----
|
||||
|
||||
|
||||
@TODO: Place a diagram here showing the hierarchy
|
||||
|
||||
|
||||
### Node
|
||||
|
||||
|
||||
|
||||
#### *node* . **tag** **=>** *string*
|
||||
|
||||
A unique tag for this node for the lifetime of the process.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *node* . **location** **=>** *[Location](./)*
|
||||
|
||||
The source code and location within the source code that this
|
||||
node represents.
|
||||
|
||||
|
||||
|
||||
|
||||
### ValueNode
|
||||
|
||||
|
||||
A **ValueNode** is a node which may manipulate the stack.
|
||||
|
||||
|
||||
### LiteralNode
|
||||
|
||||
|
||||
|
||||
#### *literalNode* . **value** **=>** *string*
|
||||
|
||||
The literal value of this node, which may be a [DataHexstring](../../../utils/bytes) or
|
||||
string of a decimal number.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *literalNode* . **verbatim** **=>** *boolean*
|
||||
|
||||
This is true in a [DataNode](./) context, since in that case the
|
||||
value should be taken verbatim and no `PUSH` operation shoud be
|
||||
added, otherwise false.
|
||||
|
||||
|
||||
|
||||
|
||||
### PopNode
|
||||
|
||||
|
||||
A **PopNode** is used to store a place-holder for an implicit pop from the
|
||||
stack. It represents the code for an implicit place-holder (i.e. `$$`) or an
|
||||
explicit place-holder (e.g. `$1`), which indicates the expect stack position
|
||||
to consume.
|
||||
|
||||
|
||||
#### *literalNode* . **index** **=>** *number*
|
||||
|
||||
The index this **PopNode** is representing. For an implicit place-holder
|
||||
this is `0`.
|
||||
|
||||
|
||||
|
||||
|
||||
### LinkNode
|
||||
|
||||
|
||||
A **LinkNode** represents a link to another [Node](./)'s data,
|
||||
for example `$foo` or `#bar`.
|
||||
|
||||
|
||||
#### *linkNode* . **label** **=>** *string*
|
||||
|
||||
Te name of the target node.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *linkNode* . **type** **=>** *"offset"|"length"*
|
||||
|
||||
Whether this node is for an offset or a length value of the
|
||||
target node.
|
||||
|
||||
|
||||
|
||||
|
||||
### OpcodeNode
|
||||
|
||||
|
||||
|
||||
#### *opcodeNode* . **opcode** **=>** *[Opcode](../api)*
|
||||
|
||||
The opcode for this Node.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *opcodeNode* . **operands** **=>** *Array< [ValueNode](./) >*
|
||||
|
||||
A list of all operands passed into this Node.
|
||||
|
||||
|
||||
|
||||
|
||||
### EvaluationNode
|
||||
|
||||
|
||||
An **EvaluationNode** is used to execute code and insert the results
|
||||
but does not generate
|
||||
any output assembly, using the `{{! code here }}` syntax.
|
||||
|
||||
|
||||
#### *literalNode* . **verbatim** **=>** *boolean*
|
||||
|
||||
This is true in a [DataNode](./) context, since in that case the
|
||||
value should be taken verbatim and no `PUSH` operation shoud be
|
||||
added, otherwise false.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *evaluationNode* . **script** **=>** *string*
|
||||
|
||||
The code to evaluate and produce the result to use as a literal.
|
||||
|
||||
|
||||
|
||||
|
||||
### ExecutionNode
|
||||
|
||||
|
||||
An **ExecutionNode** is used to execute code but does not generate
|
||||
any output assembly, using the `{{! code here }}` syntax.
|
||||
|
||||
|
||||
#### *evaluationNode* . **script** **=>** *string*
|
||||
|
||||
The code to execute. Any result is ignored.
|
||||
|
||||
|
||||
|
||||
|
||||
### LabelledNode
|
||||
|
||||
|
||||
A **LabelledNode** is used for any Node that has a name, and can therefore
|
||||
be targetted by a [LinkNode](./).
|
||||
|
||||
|
||||
#### *labelledNode* . **name** **=>** *string*
|
||||
|
||||
The name of this node.
|
||||
|
||||
|
||||
|
||||
|
||||
### LabelNode
|
||||
|
||||
|
||||
A **LabelNode** is used as a place to `JUMP` to by referencing it
|
||||
name, using `@myLabel:`. A `JUMPDEST` is automatically inserted
|
||||
at the bytecode offset.
|
||||
|
||||
|
||||
### DataNode
|
||||
|
||||
|
||||
A **DataNode** allows for data to be inserted directly into the output
|
||||
assembly, using `@myData[ ... ]`. The data is padded if needed to ensure
|
||||
values that would otherwise be regarded as a `PUSH` value does not impact
|
||||
anything past the data.
|
||||
|
||||
|
||||
#### *dataNode* . **data** **=>** *Array< [ValueNode](./) >*
|
||||
|
||||
The child nodes, which each represent a verbatim piece of data in insert.
|
||||
|
||||
|
||||
|
||||
|
||||
### ScopeNode
|
||||
|
||||
|
||||
A **ScopeNode** allows a new frame of reference that all [LinkNode](./)'s
|
||||
will use when resolving offset locations, using `@myScope{ ... }`.
|
||||
|
||||
|
||||
#### *scopeNode* . **statements** **=>** *Array< [Node](./) >*
|
||||
|
||||
The list of child nodes for this scope.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** ee220fb350a143a9868feecd1513ad6a66dbb033b8c108852cfe86fe8dcd871a
|
51
docs/api/other/assembly/ast/index.html
Normal file
51
docs/api/other/assembly/ast/index.html
Normal file
File diff suppressed because one or more lines are too long
146
docs/api/other/assembly/dialect/README.md
Normal file
146
docs/api/other/assembly/dialect/README.md
Normal file
@ -0,0 +1,146 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Ethers ASM Dialect
|
||||
==================
|
||||
|
||||
|
||||
This provides a quick, high-level overcview of the **Ethers ASM Dialect**
|
||||
for EVM, which is defined by the [Ethers ASM Dialect Grammar](../../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/asm/grammar.jison)
|
||||
|
||||
Once a program is compiled by a higher level langauge into ASM (assembly),
|
||||
or hand-coded directly in ASM, it needs to be assembled into bytecode.
|
||||
|
||||
The assembly process performs a very small set of operations and is
|
||||
intentionally simple and closely related to the underlying EVM bytecode.
|
||||
|
||||
Operations include embedding programs within programs (for example the
|
||||
deployment bootstrap has the runtime embedded in it) and computing the
|
||||
necessary offsets for jump operations.
|
||||
|
||||
The [Command-Line Assembler](../../../../cli/asm) can be used to assemble an
|
||||
*Ethers ASM Dialect* file or to disassemble bytecode into its
|
||||
human-readable (ish) opcodes and literals.
|
||||
|
||||
|
||||
Opcodes
|
||||
-------
|
||||
|
||||
|
||||
An **Opcode** may be provided in either a *functional* or
|
||||
*instructional* syntax. For Opcodes that require parameters,
|
||||
the *functional* syntax is recommended and the *instructional*
|
||||
syntax will raise a warning.
|
||||
|
||||
@TODO: Examples
|
||||
|
||||
|
||||
Labels
|
||||
------
|
||||
|
||||
|
||||
A **Label** is a position in the program which can be jumped to. A
|
||||
`JUMPDEST` is automatically added to this point in the assembled
|
||||
output.
|
||||
|
||||
@TODO: Exmaples
|
||||
|
||||
|
||||
Literals
|
||||
--------
|
||||
|
||||
|
||||
A **Literal** puts data on the stack when executed using a `PUSH`
|
||||
operation.
|
||||
|
||||
A **Literal** can be provided using a [DataHexstring](../../../utils/bytes) or a decimal
|
||||
byte value.
|
||||
|
||||
@TODO: exmples
|
||||
|
||||
|
||||
Comments
|
||||
--------
|
||||
|
||||
|
||||
To enter a comment in the **Ethers ASM Dialect**, any text following
|
||||
a semi-colon (i.e. `;`) is ignored by the assembler.
|
||||
|
||||
|
||||
Scopes
|
||||
------
|
||||
|
||||
|
||||
A common case in Ethereum is to have one program embedded in another.
|
||||
|
||||
The most common use of this is embedding a Contract **runtime bytecode**
|
||||
within a **deployment bytecode**, which can be used as **init code**.
|
||||
|
||||
When deploying a program to Ethereum, an **init transaction** is used. An
|
||||
*init transaction* has a null `to` address and contains bytecode in
|
||||
the `data`. This `data` bytecode is a program, that when executed
|
||||
returns some other bytecode as a result, this restul is the bytecode
|
||||
to be installed.
|
||||
|
||||
Therefore it is important that embedded code uses jumps relative to itself,
|
||||
not the entire program it is embedded in, which also means that a jump
|
||||
can **only** target its own scope, no parent or child scopes. This is
|
||||
enforced by the assembler.
|
||||
|
||||
A scope may access the offset of any child [Data Segment](./) or
|
||||
child [Scopes](./) (with respect to itself) and may access the length
|
||||
of any [Data Segment](./) or [Scopes](./) anywhere in the program.
|
||||
|
||||
Every program in the **Ethers ASM Dialect** has a top-leve scope named `_`.
|
||||
|
||||
|
||||
Data Segment
|
||||
------------
|
||||
|
||||
|
||||
A **Data Segment** allows arbitrary data to be embedded into a program,
|
||||
which can be useful for lookup tables or deploy-time constants.
|
||||
|
||||
An emtpty **Data Segment** can also be used when a labelled location is
|
||||
required, but without the `JUMPDEST` which a [Labels](./) adds.
|
||||
|
||||
@TODO: Example
|
||||
|
||||
|
||||
Links
|
||||
-----
|
||||
|
||||
|
||||
A **Link** allows access to a [Scopes](./), [Data Segment](./) or [Labels](./).
|
||||
|
||||
To access the byte offset of a labelled item, use `$foobar`.
|
||||
|
||||
For a [Labels](./), the target must be directly reachable within this scope. For
|
||||
a [Data Segment](./) or a [Scopes](./), it can be inside the same scope or any
|
||||
child scope.
|
||||
|
||||
For a [Data Segment](./) or a [Labels](./), there is an additional type of
|
||||
**Link**, which provides the length of the data or bytecode respectively. A
|
||||
**Length Link** is accessed by `#foobar` and is pushed on the stack as a
|
||||
literal.
|
||||
|
||||
|
||||
Stack Placeholders
|
||||
------------------
|
||||
|
||||
|
||||
@TODO: exampl
|
||||
|
||||
|
||||
Evaluation and Excution
|
||||
-----------------------
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 71e165b7b78bd1080c3c1cabf9e19ddc21f1fdd440f945e8225d263f00cc4789
|
21
docs/api/other/assembly/dialect/index.html
Normal file
21
docs/api/other/assembly/dialect/index.html
Normal file
File diff suppressed because one or more lines are too long
4
docs/api/other/assembly/index.html
Normal file
4
docs/api/other/assembly/index.html
Normal file
File diff suppressed because one or more lines are too long
@ -14,7 +14,7 @@ LedgerSigner
|
||||
------------
|
||||
|
||||
|
||||
The [Ledger Hardware Wallets](https://www.ledger.com) are a fairly
|
||||
The [Ledger Hardware Wallets](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/www.ledger.com) are a fairly
|
||||
popular brand.
|
||||
|
||||
TODO: importing
|
||||
@ -35,4 +35,4 @@ determined by the environment; in node the default is "hid" and in the browser
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 240366cd9757f396d08ed65ebfceafa51f82bfc44c04695ab68e3560e7a0016b
|
||||
**Content Hash:** c6b6d4f14f0e973a30c3cff935960a15715712830e38cece0edfb864ba921a6c
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -25,7 +25,7 @@ EtherscanProvider
|
||||
|
||||
|
||||
The **EtherscanProvider** is backed by a combination of the various
|
||||
[Etherscan APIs](https://etherscan.io/apis).
|
||||
[Etherscan APIs](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/etherscan.io/apis).
|
||||
|
||||
|
||||
#### *provider* . **getHistory** ( address ) **=>** *Array< History >*
|
||||
@ -41,7 +41,7 @@ The **EtherscanProvider** is backed by a combination of the various
|
||||
|
||||
* Homestead (Mainnet)
|
||||
* Ropsten (proof-of-work testnet)
|
||||
* Rinkeby (proof-of-Authority testnet)
|
||||
* Rinkeby (proof-of-authority testnet)
|
||||
* Görli (clique testnet)
|
||||
* Kovan (proof-of-authority testnet)
|
||||
|
||||
@ -52,7 +52,7 @@ InfuraProvider
|
||||
--------------
|
||||
|
||||
|
||||
The **InfuraProvider** is backed by the popular [INFURA](https://infura.io)
|
||||
The **InfuraProvider** is backed by the popular [INFURA](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/infura.io)
|
||||
Ethereum service.
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ Ethereum service.
|
||||
|
||||
* Homestead (Mainnet)
|
||||
* Ropsten (proof-of-work testnet)
|
||||
* Rinkeby (proof-of-Authority testnet)
|
||||
* Rinkeby (proof-of-authority testnet)
|
||||
* Görli (clique testnet)
|
||||
* Kovan (proof-of-authority testnet)
|
||||
|
||||
@ -73,7 +73,7 @@ AlchemyProvider
|
||||
---------------
|
||||
|
||||
|
||||
The **AlchemtProvider** is backed by [Alchemy](https://alchemyapi.io).
|
||||
The **AlchemtProvider** is backed by [Alchemy](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/alchemyapi.io).
|
||||
|
||||
|
||||
#### **Supported Networks**
|
||||
@ -82,7 +82,7 @@ The **AlchemtProvider** is backed by [Alchemy](https://alchemyapi.io).
|
||||
|
||||
* Homestead (Mainnet)
|
||||
* Ropsten (proof-of-work testnet)
|
||||
* Rinkeby (proof-of-Authority testnet)
|
||||
* Rinkeby (proof-of-authority testnet)
|
||||
* Görli (clique testnet)
|
||||
* Kovan (proof-of-authority testnet)
|
||||
|
||||
@ -93,8 +93,7 @@ CloudfrontProvider
|
||||
------------------
|
||||
|
||||
|
||||
The CloudfrontProvider is backed by the
|
||||
[Cloudflare Ethereum Gateway](https://developers.cloudflare.com/distributed-web/ethereum-gateway/).
|
||||
The CloudfrontProvider is backed by the [Cloudflare Ethereum Gateway](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/developers.cloudflare.com/distributed-web/ethereum-gateway).
|
||||
|
||||
|
||||
#### **Supported Networks**
|
||||
@ -108,4 +107,4 @@ The CloudfrontProvider is backed by the
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 516111e087ee3f12588ba555c0719f7170ea532e269590586c95ddc1d7eb7e7b
|
||||
**Content Hash:** 8a464bf5a272f32a697857e4e5813b1569ee9293156f77dcfa8f4bd71a8e5c9f
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,11 +9,11 @@ JsonRpcProvider
|
||||
===============
|
||||
|
||||
|
||||
The [JSON-RPC API](https://github.com/ethereum/wiki/wiki/JSON-RPC) is a
|
||||
The [JSON-RPC API](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/ethereum/wiki/wiki/JSON-RPC) is a
|
||||
very popular method for interacting with Ethereum and is available in all
|
||||
major Ethereum node implementations (e.g. [Geth](https://geth.ethereum.org)
|
||||
and [Parity](https://www.parity.io)) as well as many third-party web
|
||||
services (e.g. [INFURA](https://infura.io))
|
||||
major Ethereum node implementations (e.g. [Geth](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/geth.ethereum.org)
|
||||
and [Parity](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/www.parity.io)) as well as many third-party web
|
||||
services (e.g. [INFURA](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/infura.io))
|
||||
|
||||
|
||||
#### **new** *ethers* . *providers* . **JsonRpcProvider** ( [ url [ , aNetworkish ] ] )
|
||||
@ -131,4 +131,4 @@ transaction hash quickly, if that is all that is required.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 4d82738b8e1db6b6421b7234b0d302c35aa25aed707ab2cfb0798e2613e41abd
|
||||
**Content Hash:** d05797dcbeabc9dbd764aad98f3c9346b4350e955a4a6210d6d0a6ea17d3a50b
|
File diff suppressed because one or more lines are too long
@ -161,13 +161,11 @@ Web3Provider
|
||||
------------
|
||||
|
||||
|
||||
The Web3Provider is meant to ease moving from a [web3.js based](https://github.com/ethereum/web3.js)
|
||||
The Web3Provider is meant to ease moving from a [web3.js based](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/ethereum/web3.js)
|
||||
application to ethers by wraping an existing Web3-compatible (such as a
|
||||
[Web3HttpProvider](https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-http)
|
||||
[Web3IpcProvider](https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ipc) or
|
||||
[Web3WsProvider](https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ws))
|
||||
and exposing it as an ethers.js [Provider](../provider) which can then be used with the rest of
|
||||
the library.
|
||||
[Web3HttpProvider](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-http)[Web3IpcProvider](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ipc) or
|
||||
[Web3WsProvider](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ws)) and exposing it as an ethers.js [Provider](../provider)
|
||||
which can then be used with the rest of the library.
|
||||
|
||||
|
||||
#### **new** *ethers* . *providers* . **Web3Provider** ( web3Provider [ , network ] )
|
||||
@ -187,4 +185,4 @@ The provider used to create this instance.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 95791f5b36e1becb2e1222424eb25b0b14743670c827dea2041b048e686d2118
|
||||
**Content Hash:** 38479cce7fbf5192e1085bce407362ec5169b3a56f42f27e515a623ffeab670b
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -380,7 +380,7 @@ The amount (in wei) this transaction is sending.
|
||||
#### *transactionRequest* . **chainId** **=>** *number|Promise< number >*
|
||||
|
||||
The chain ID this transaction is authorized on, as specified by
|
||||
[EIP-155](https://eips.ethereum.org/EIPS/eip-155).
|
||||
[EIP-155](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-155).
|
||||
|
||||
If the chain ID is 0 will disable EIP-155 and the transaction will be valid
|
||||
on any network. This can be **dangerous** and care should be taken, since it
|
||||
@ -488,7 +488,7 @@ the block this transaction was mined in.
|
||||
|
||||
The intermediate state root of a receipt.
|
||||
|
||||
Only transactions included in blocks **before** the [Byzantium Hard Fork](https://eips.ethereum.org/EIPS/eip-609)
|
||||
Only transactions included in blocks **before** the [Byzantium Hard Fork](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-609)
|
||||
have this property, as it was replaced by the `status` property.
|
||||
|
||||
The property is generally of little use to developers. At the time
|
||||
@ -508,7 +508,7 @@ The amount of gas actually used by this transaction.
|
||||
|
||||
#### *receipt* . **logsBloom** **=>** *string< [DataHexstring](../../utils/bytes) >*
|
||||
|
||||
A [bloom-filter](https://en.wikipedia.org/wiki/Bloom_filter), which
|
||||
A [bloom-filter](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Bloom_filter), which
|
||||
incldues all the addresses and topics included in any log in this
|
||||
transaction.
|
||||
|
||||
@ -565,7 +565,7 @@ This is generally of little interest to developers.
|
||||
|
||||
#### *receipt* . **byzantium** **=>** *boolean*
|
||||
|
||||
This is true if the block is in a [post-Byzantium Hard Fork](https://eips.ethereum.org/EIPS/eip-609)
|
||||
This is true if the block is in a [post-Byzantium Hard Fork](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-609)
|
||||
block.
|
||||
|
||||
|
||||
@ -574,7 +574,7 @@ block.
|
||||
#### *receipt* . **status** **=>** *boolean*
|
||||
|
||||
The status of a transaction is 1 is successful or 0 if it was
|
||||
reverted. Only transactions included in blocks [post-Byzantium Hard Fork](https://eips.ethereum.org/EIPS/eip-609)
|
||||
reverted. Only transactions included in blocks [post-Byzantium Hard Fork](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-609)
|
||||
have this property.
|
||||
|
||||
|
||||
@ -582,4 +582,4 @@ have this property.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** ef41b33439a40aa374a5af245d4320705c3a647c86f90d9bb8c127503e2477c9
|
||||
**Content Hash:** 8e36229154dd0afe40cd45ca1043bde05c78a54779aa56728d8ba585ba288978
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -13,16 +13,17 @@ These utilities are used extensively within the library, but
|
||||
are also quite useful for application developers.
|
||||
|
||||
|
||||
* [Addresses](address)
|
||||
* [Address Formats](address)
|
||||
* [Functions](address)
|
||||
* [Application Binary Interface](abi)
|
||||
* [Formats](abi)
|
||||
* [Interface](abi)
|
||||
* [Fragment](abi)
|
||||
* [ConstructorFragment](abi)
|
||||
* [EventFragment](abi)
|
||||
* [FunctionFragment](abi)
|
||||
* [ParamType](abi)
|
||||
* [Addresses](address)
|
||||
* [Address Formats](address)
|
||||
* [Functions](address)
|
||||
* [BigNumber](bignumber)
|
||||
* [Types](bignumber)
|
||||
* [Creating Instances](bignumber)
|
||||
@ -35,6 +36,7 @@ are also quite useful for application developers.
|
||||
* [Array Manipulation](bytes)
|
||||
* [Hexstring Manipulation](bytes)
|
||||
* [Signature Conversion](bytes)
|
||||
* [Random Bytes](bytes)
|
||||
* [Constants](constants)
|
||||
* [Bytes](constants)
|
||||
* [Strings](constants)
|
||||
@ -42,15 +44,29 @@ are also quite useful for application developers.
|
||||
* [Display Logic and Input](display-logic)
|
||||
* [Units](display-logic)
|
||||
* [Functions](display-logic)
|
||||
* [Encoding Utilities](encoding)
|
||||
* [Base58](encoding)
|
||||
* [Base64](encoding)
|
||||
* [Recursive-Length Prefix](encoding)
|
||||
* [FixedNumber](fixednumber)
|
||||
* [FixedFormat](fixednumber)
|
||||
* [Creating Instances](fixednumber)
|
||||
* [Properties](fixednumber)
|
||||
* [Methods](fixednumber)
|
||||
* [FixedFormat](fixednumber)
|
||||
* [Hashing Algorithms](hashing)
|
||||
* [Cryptographic Hashing](hashing)
|
||||
* [Common Hashing Helpers](hashing)
|
||||
* [Solidity Hashing Algorithms](hashing)
|
||||
* [HD Wallet](hdnode)
|
||||
* [Types](hdnode)
|
||||
* [HDNode](hdnode)
|
||||
* [Other Functions](hdnode)
|
||||
* [Logger](logger)
|
||||
* [Errors](logger)
|
||||
* [Creating instances](logger)
|
||||
* [Property Utilities](properties)
|
||||
* [Signing Key](signing-key)
|
||||
* [Other Functions](signing-key)
|
||||
* [Strings](strings)
|
||||
* [Bytes32String](strings)
|
||||
* [UTF-8 Strings](strings)
|
||||
@ -59,8 +75,12 @@ are also quite useful for application developers.
|
||||
* [Transactions](transactions)
|
||||
* [Types](transactions)
|
||||
* [Functions](transactions)
|
||||
* [Web Utilities](web)
|
||||
* [Wordlists](wordlists)
|
||||
* [Wordlist](wordlists)
|
||||
* [Languages](wordlists)
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 87e3535244311d1d85bda676c07cc903e6e0fe7d4c7207943dcf2e72bc33e3d9
|
||||
**Content Hash:** 96bd0d92678b30c766203c98bbadbee19c546aa9d34a50ee6bab3b869b704e6e
|
@ -21,7 +21,7 @@ Formats
|
||||
|
||||
|
||||
The **JSON ABI Format** is the format that is
|
||||
[output from the Solidity compiler](https://solidity.readthedocs.io/en/v0.6.0/using-the-compiler.html#output-description).
|
||||
[output from the Solidity compiler](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/solidity.readthedocs.io/en/v0.6.0/using-the-compiler.html).
|
||||
|
||||
A JSON serialized object is always a string, which represents an Array
|
||||
of Objects, where each Object has various properties describing the [Fragment](./) of the ABI.
|
||||
@ -35,7 +35,7 @@ also be passed into any function which accepts a JSON String ABI.
|
||||
|
||||
The Human-Readable ABI was
|
||||
|
||||
[article](https://blog.ricmoo.com/human-readable-contract-abis-in-ethers-js-141902f4d917)
|
||||
[article](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/blog.ricmoo.com/human-readable-contract-abis-in-ethers-js-141902f4d917)
|
||||
|
||||
|
||||
### Output Formats
|
||||
@ -87,6 +87,13 @@ since it discards modifiers such as indexed, anonymous, stateMutability, etc.
|
||||
|
||||
|
||||
|
||||
Interface
|
||||
---------
|
||||
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
Fragment
|
||||
--------
|
||||
|
||||
@ -396,4 +403,4 @@ Tra la la...
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** cae7aa26d26d5f02ebe0f227e25759db5d2437b4104d2950b364ced87e7c83f6
|
||||
**Content Hash:** 139ec4826ff24c5f5ca9c964bc0432e3b3065f90a5b012744b2ff43be0eb7121
|
File diff suppressed because one or more lines are too long
@ -37,7 +37,7 @@ All functions that return an Address will return a Checksum Address.
|
||||
|
||||
The **ICAP Address Format** was an early attempt to introduce a checksum
|
||||
into Ethereum addresses using the popular banking industry's
|
||||
[IBAN](https://en.wikipedia.org/wiki/International_Bank_Account_Number)
|
||||
[IBAN](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/International_Bank_Account_Number)
|
||||
format with the country code specified as **XE**.
|
||||
|
||||
Due to the way IBAN encodes address, only addresses that fit into 30 base-36
|
||||
@ -79,7 +79,7 @@ Returns true if *address* is valid (in any supported format).
|
||||
|
||||
#### *utils* . **getIcapAddress** ( address ) **=>** *string< [IcapAddress](./) >*
|
||||
|
||||
Returns *address* as an [ICAP address](https://github.com/ethereum/wiki/wiki/Inter-exchange-Client-Address-Protocol-%28ICAP%29).
|
||||
Returns *address* as an [ICAP address](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/ethereum/wiki/wiki/Inter-exchange-Client-Address-Protocol-%28ICAP%29).
|
||||
Supports the same restrictions as [utils.getAddress](./).
|
||||
|
||||
|
||||
@ -96,11 +96,11 @@ used to deploy a contract.
|
||||
#### *utils* . **getCreate2Address** ( from , salt , initCodeHash ) **=>** *string< [Address](./) >*
|
||||
|
||||
Returns the contract address that would result from the given
|
||||
[CREATE2](https://eips.ethereum.org/EIPS/eip-1014) call.
|
||||
[CREATE2](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-1014) call.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 7835c97c8afbbdf59c39d32a9d79d86c4e446a2ed6acd6eae1f21c0b190b73c1
|
||||
**Content Hash:** 9c4842c79e4a9f307ba1de2c84f1d996b2dbcb53af5b8dd153508f6c2f7b7f1d
|
File diff suppressed because one or more lines are too long
@ -9,7 +9,15 @@ BigNumber
|
||||
=========
|
||||
|
||||
|
||||
Explain about BigNumber here...
|
||||
Many operations in Ethereum operation on numbers which are
|
||||
[outside the range of safe values](./) to use
|
||||
in JavaScript.
|
||||
|
||||
A **BigNumber** is an object which safely allows mathematic operations
|
||||
on numbers of any magnitude.
|
||||
|
||||
Most operations which need to return a value will return a **BigNumber**
|
||||
and parameters which accept values will generally accept them.
|
||||
|
||||
|
||||
### Importing
|
||||
@ -69,21 +77,21 @@ A [BytesLike](../bytes) Object, such as an Array or Uint8Array.
|
||||
|
||||
#### ***BigNumber***
|
||||
|
||||
An existing BigNumber instance.
|
||||
An existing [BigNumber](./) instance.
|
||||
|
||||
|
||||
|
||||
|
||||
#### ***number***
|
||||
|
||||
A number that is within the safe range for JavaScript numbers.
|
||||
A number that is within the [safe range](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) for JavaScript numbers.
|
||||
|
||||
|
||||
|
||||
|
||||
#### ***BigInt***
|
||||
|
||||
A JavaScript [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)
|
||||
A JavaScript [BigInt](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)
|
||||
object, on environments that support BigInt.
|
||||
|
||||
|
||||
@ -108,44 +116,7 @@ Returns an instance of a **BigNumber** for *aBigNumberish*.
|
||||
|
||||
|
||||
```javascript
|
||||
// From a decimal string...
|
||||
BigNumber.from("42")
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// From a hexstring...
|
||||
BigNumber.from("0x2a")
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// From a negative hexstring...
|
||||
BigNumber.from("-0x2a")
|
||||
// { BigNumber: "-42" }
|
||||
|
||||
// From an Array (or Uint8Array)...
|
||||
BigNumber.from([ 42 ])
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// From an existing BigNumber...
|
||||
let one1 = constants.One;
|
||||
let one2 = BigNumber.from(one1)
|
||||
|
||||
one2
|
||||
// { BigNumber: "1" }
|
||||
|
||||
// ...which returns the same instance
|
||||
one1 === one2
|
||||
// true
|
||||
|
||||
// From a (safe) number...
|
||||
BigNumber.from(42)
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// From a ES2015 BigInt... (only on platforms with BigInt support)
|
||||
BigNumber.from(42n)
|
||||
// { BigNumber: "42" }
|
||||
|
||||
// Numbers outside the safe range fail:
|
||||
BigNumber.from(Number.MAX_SAFE_INTEGER);
|
||||
// Error: overflow (fault="overflow", operation="BigNumber.from", value=9007199254740991, version=bignumber/5.0.0-beta.135)
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -222,7 +193,7 @@ the *bitcount* least significant bits set to zero.
|
||||
### Two's Compliment
|
||||
|
||||
|
||||
[Two's Complicment](https://en.wikipedia.org/wiki/Two%27s_complement)
|
||||
[Two's Complicment](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Two%27s_complement)
|
||||
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.
|
||||
@ -312,7 +283,7 @@ Returns the value of *bignumber* as a base-10 string.
|
||||
|
||||
#### *bignumber* . **toHexString** ( ) **=>** *string< [DataHexstring](../bytes) >*
|
||||
|
||||
Returns the value of *bignumber* as a base-16, `0x`-prefixed [hexstring](../bytes).
|
||||
Returns the value of *bignumber* as a base-16, `0x`-prefixed [DataHexstring](../bytes).
|
||||
|
||||
|
||||
|
||||
@ -333,11 +304,7 @@ Returns true if and only if the *object* is a BigNumber object.
|
||||
|
||||
|
||||
```javascript
|
||||
let a = BigNumber.from(42);
|
||||
let b = BigNumber.from("91");
|
||||
|
||||
a.mul(b);
|
||||
// { BigNumber: "3822" }
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -346,7 +313,7 @@ Notes
|
||||
-----
|
||||
|
||||
|
||||
A few short notes on numbers...
|
||||
This section is a for a couple of questions that come up frequently.
|
||||
|
||||
|
||||
### Why can't I just use numbers?
|
||||
@ -358,7 +325,7 @@ with very little granularity. For example, there are only 100
|
||||
cents in a single dollar. However, there are 10^18 **wei** in a
|
||||
single **ether**.
|
||||
|
||||
JavaScript uses [IEEE 754 double-precision binary floating point](https://en.wikipedia.org/wiki/Double-precision_floating-point_format)
|
||||
JavaScript uses [IEEE 754 double-precision binary floating point](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Double-precision_floating-point_format)
|
||||
numbers to represent numeric values. As a result, there are *holes*
|
||||
in the integer set after 9,007,199,254,740,991; which is
|
||||
problematic for *Ethereum* because that is only around 0.009
|
||||
@ -369,8 +336,7 @@ To demonstrate how this may be an issue in your code, consider:
|
||||
|
||||
|
||||
```javascript
|
||||
(Number.MAX_SAFE_INTEGER + 2 - 2) == (Number.MAX_SAFE_INTEGER)
|
||||
// false
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -384,6 +350,67 @@ by the user and Big Number representations which can have
|
||||
mathematical operations handled safely.
|
||||
|
||||
|
||||
### Why not BigNumber.js, BN.js, BigDecimal, etc?
|
||||
|
||||
|
||||
Everyone has their own favourite Big Number library, and once someone
|
||||
has choosen one, it becomes part of their identity, like their editor,
|
||||
vi vs emacs. There are over 100 Big Number libraries on [npm](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/www.npmjs.com/search?q=bignumber).
|
||||
|
||||
One of the biggest differences between the Ethers [BigNumber](./) object and
|
||||
other libraries is that it is immutable, which is very important when
|
||||
dealing with the asynchronous nature of the blockchain.
|
||||
|
||||
Capturing the value is not safe in async functions, so immutability
|
||||
protects us from easy to make mistakes, which is not possible on the
|
||||
low-level library's objects which supports myriad in-place operations.
|
||||
|
||||
Second, the Ethers [BigNumber](./) provides all the functionality required
|
||||
internally and should generally be sufficient for most developers while
|
||||
not exposing some of the more advanced and rare functionality. So it will
|
||||
be eaiser to swap out the underlying library without impacting consumers.
|
||||
|
||||
For example, if [BN.js](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/www.npmjs.com/package/bn.js) was exposed, someone may use the
|
||||
greatest-common-denominator functions, which would then be functionality
|
||||
the replacing library should also provide to ensure anyone depending on
|
||||
that functionality is not broken.
|
||||
|
||||
|
||||
### Why BN.js??
|
||||
|
||||
|
||||
The reason why [BN.js](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/www.npmjs.com/package/bn.js) is used internally as the big
|
||||
number is because that is the library used by [elliptic](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/www.npmjs.com/package/elliptic).
|
||||
|
||||
Therefore it **must** be included regardless, so we leverage that
|
||||
library rather than adding another Big Number library, which would
|
||||
mean two different libraries offering the same functionality.
|
||||
|
||||
This has saved about 85kb (80% of this library size) of library size
|
||||
over other libraries which include separate Big Number libraries for
|
||||
various purposes.
|
||||
|
||||
|
||||
### Why not allow us to set a global Big Number library?
|
||||
|
||||
|
||||
Another comment that comes up frequently is tha desire to specify a
|
||||
global user-defined Big Number library, which all functions would
|
||||
return.
|
||||
|
||||
This becomes problematic since your code may live along side other
|
||||
libraries or code that use Ethers. In fact, even Ethers uses a lot
|
||||
of the public functions internally.
|
||||
|
||||
If you, for example, used a library that used `a.plus(b)` instead
|
||||
of `a.add(b)`, this would break Ethers when it tries to compute
|
||||
fees internally, and other libraries likely have similar logic.
|
||||
|
||||
But, the [BigNumber](./) prototype is exposed, so you can always add a
|
||||
`toMyCustomBigNumber()` method to all [BigNumber](./)'s globally
|
||||
which is safe.
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 8aa8cbe047d299ae822c3d322def66e29bbbd395d1c9bad59c61c97432d83ffa
|
||||
**Content Hash:** 87481a6a9d99504396f1d013094f713846f9d4d51891778928744cee04bd85bb
|
File diff suppressed because one or more lines are too long
@ -21,8 +21,7 @@ Types
|
||||
|
||||
|
||||
A **Bytes** is any object which is an
|
||||
[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) or
|
||||
[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) with
|
||||
[Array](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) or [TypedArray](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) with
|
||||
each value in the valid byte range (i.e. between 0 and 255 inclusive),
|
||||
or is an Object with a `length` property where each indexed property
|
||||
is in the valid byte range.
|
||||
@ -56,7 +55,7 @@ number of nibbles (i.e. case-insensitive hexidecumal characters, `0-9` and `a-f`
|
||||
|
||||
* **r** and **s** --- The x co-ordinate of **r** and the **s** value of the signature
|
||||
* **v** --- The parity of the y co-ordinate of **r**
|
||||
* **_vs** --- The [compact representation](https://eips.ethereum.org/EIPS/eip-2098) of the **s** and **v**
|
||||
* **_vs** --- The [compact representation](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-2098) of the **s** and **v**
|
||||
* **recoveryParam** --- The normalized (i.e. 0 or 1) value of **v**
|
||||
|
||||
|
||||
@ -139,29 +138,7 @@ zeros.
|
||||
|
||||
|
||||
```javascript
|
||||
// Convert a hexstring to a Uint8Array
|
||||
arrayify("0x1234")
|
||||
// [ 18, 52 ]
|
||||
|
||||
// Convert an Array to a hexstring
|
||||
hexlify([1, 2, 3, 4])
|
||||
// 0x01020304
|
||||
|
||||
// Convert an Object to a hexstring
|
||||
hexlify({ length: 2, "0": 1, "1": 2 })
|
||||
// 0x0102
|
||||
|
||||
// Convert an Array to a hexstring
|
||||
hexlify([ 1 ])
|
||||
// 0x01
|
||||
|
||||
// Convert a number to a stripped hex value
|
||||
hexValue(1)
|
||||
// 0x1
|
||||
|
||||
// Convert an Array to a stripped hex value
|
||||
hexValue([ 1, 2 ])
|
||||
// 0x102
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -263,6 +240,18 @@ Any missing properties will be computed.
|
||||
|
||||
|
||||
|
||||
Random Bytes
|
||||
------------
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **randomBytes** ( length ) **=>** *Uint8Array*
|
||||
|
||||
Return a new Uint8Array of *length* random bytes.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** ef5d3728657f7c650f7531071145048e55ee632bd0fe4ee01b6d11a1e9b1c39b
|
||||
**Content Hash:** 36831e9bb9c02d184b22e8b4b8700572a545c366ced4d9811a92c560dafaf035
|
File diff suppressed because one or more lines are too long
@ -17,8 +17,7 @@ The **ethers.contants** Object contains commonly used values.
|
||||
|
||||
|
||||
```javascript
|
||||
//const { constants } = require("ethers");
|
||||
// const { constants } = require("@ethersproject/constants");
|
||||
Skipping JavaScript Evaluation.
|
||||
```
|
||||
|
||||
|
||||
@ -28,14 +27,14 @@ Bytes
|
||||
|
||||
|
||||
|
||||
#### *constants* . **AddressZero** **=>** *string< [Address](../address) >*
|
||||
#### *ethers* . *constants* . **AddressZero** **=>** *string< [Address](../address) >*
|
||||
|
||||
The Address Zero, which is 20 bytes (40 nibbles) of zero.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **HashZero** **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
#### *ethers* . *constants* . **HashZero** **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
The Hash Zero, which is 32 bytes (64 nibbles) of zero.
|
||||
|
||||
@ -47,7 +46,7 @@ Strings
|
||||
|
||||
|
||||
|
||||
#### *constants* . **EtherSymbol** **=>** *string*
|
||||
#### *ethers* . *constants* . **EtherSymbol** **=>** *string*
|
||||
|
||||
The Ether symbol, **Ξ**.
|
||||
|
||||
@ -59,35 +58,35 @@ BigNumber
|
||||
|
||||
|
||||
|
||||
#### *constants* . **NegativeOne** **=>** *[BigNumber](../bignumber)*
|
||||
#### *ethers* . *constants* . **NegativeOne** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"-1"`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **Zero** **=>** *[BigNumber](../bignumber)*
|
||||
#### *ethers* . *constants* . **Zero** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"0"`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **One** **=>** *[BigNumber](../bignumber)*
|
||||
#### *ethers* . *constants* . **One** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"1"`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **Two** **=>** *[BigNumber](../bignumber)*
|
||||
#### *ethers* . *constants* . **Two** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"2"`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *constants* . **WeiPerEther** **=>** *[BigNumber](../bignumber)*
|
||||
#### *ethers* . *constants* . **WeiPerEther** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing `"1000000000000000000"`, which is the
|
||||
number of Wei per Ether.
|
||||
@ -95,7 +94,7 @@ number of Wei per Ether.
|
||||
|
||||
|
||||
|
||||
#### *constants* . **MaxUint256** **=>** *[BigNumber](../bignumber)*
|
||||
#### *ethers* . *constants* . **MaxUint256** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
The BigNumber value representing the maximum `uint256` value.
|
||||
|
||||
@ -104,4 +103,4 @@ The BigNumber value representing the maximum `uint256` value.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 622800454a6a66b0fc5bbd1aa149f58e00727d81f05a8d32f3eb7be9e1abbf8d
|
||||
**Content Hash:** ec1f26d84f380998ccbfc88ad451d14ba9395d94bfd9b7366af2e0b8ec1b183f
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -10,7 +10,12 @@ Encoding Utilities
|
||||
|
||||
|
||||
|
||||
#### *utils* . *base58* . **decode** ( textData ) **=>** *Uin8Array*
|
||||
Base58
|
||||
------
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . *base58* . **decode** ( textData ) **=>** *Uin8Array*
|
||||
|
||||
Return a typed Uint8Array representation of *textData* decoded using
|
||||
base-58 encoding.
|
||||
@ -18,14 +23,19 @@ base-58 encoding.
|
||||
|
||||
|
||||
|
||||
#### *utils* . *base58* . **encode** ( aBytesLike ) **=>** *string*
|
||||
#### *ethers* . *utils* . *base58* . **encode** ( aBytesLike ) **=>** *string*
|
||||
|
||||
Return *aBytesLike* encoded as a string using the base-58 encoding.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *utils* . *base64* . **decode** ( textData ) **=>** *Uin8Array*
|
||||
Base64
|
||||
------
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . *base64* . **decode** ( textData ) **=>** *Uin8Array*
|
||||
|
||||
Return a typed Uint8Array representation of *textData* decoded using
|
||||
base-64 encoding.
|
||||
@ -33,13 +43,61 @@ base-64 encoding.
|
||||
|
||||
|
||||
|
||||
#### *utils* . *base64* . **encode** ( aBytesLike ) **=>** *string*
|
||||
#### *ethers* . *utils* . *base64* . **encode** ( aBytesLike ) **=>** *string*
|
||||
|
||||
Return *aBytesLike* encoded as a string using the base-64 encoding.
|
||||
|
||||
|
||||
|
||||
|
||||
Recursive-Length Prefix
|
||||
-----------------------
|
||||
|
||||
|
||||
The [Recursive Length Prefix](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/ethereum/wiki/wiki/RLP) encoding is used throughout Ethereum to serialize nested
|
||||
structures of Arrays and data.
|
||||
|
||||
|
||||
#### *ethers* . *utils* . *RLP* . **encode** ( dataObject ) **=>** *string< [DataHexstring](../bytes) >*
|
||||
|
||||
Encode a structured Data Object into its RLP-encoded representation.
|
||||
|
||||
Each Data component may be an valid [BytesLike](../bytes).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . *RLP* . **decode** ( aBytesLike ) **=>** *[DataObject](./)*
|
||||
|
||||
Decode an RLP-encoded *aBytesLike* into its structured Data Object.
|
||||
|
||||
All Data components will be returned as a [DataHexstring](../bytes).
|
||||
|
||||
|
||||
|
||||
|
||||
### Data Object
|
||||
|
||||
|
||||
A **Data Object** is a recursive structure which is used to serialize many
|
||||
internal structures in Ethereum. Each **Data Object** can either be:
|
||||
|
||||
|
||||
|
||||
* Binary Data
|
||||
* An Array of **Data Objects** (i.e. this recursively includes Nesting)
|
||||
|
||||
|
||||
#### **Examples**
|
||||
|
||||
|
||||
|
||||
* `"0x1234"`
|
||||
* `[ "0x1234", [ "0xdead", "0xbeef" ], [ ] ]`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** a4f4ef6d28d4fde749cce30bb537f6ad3d6d0ae6070623757c75091441523f4e
|
||||
**Content Hash:** e91a94dca2969f6acf544fb285df0faebedf4cf04b09056fe5c6cf8d2d013097
|
File diff suppressed because one or more lines are too long
@ -9,91 +9,9 @@ FixedNumber
|
||||
===========
|
||||
|
||||
|
||||
|
||||
FixedFormat
|
||||
-----------
|
||||
|
||||
|
||||
A **FixedFormat** is a simple object which represents a decimal
|
||||
(base-10) Fixed-Point data representation. Usually using this
|
||||
class directly is uneccessary, as passing in a [Format Strings](./)
|
||||
directly into the [FixedNumber](./) will automatically create this.
|
||||
|
||||
|
||||
### Format Strings
|
||||
|
||||
|
||||
A format string is composed of three components, including signed-ness,
|
||||
bit-width and number of decimals.
|
||||
|
||||
A signed format string begins with `fixed`, which an unsigned format
|
||||
string begins with `ufixed`, followed by the width (in bits) and the
|
||||
number of decimals.
|
||||
|
||||
The width must be conguent to 0 mod 8 (i.e. `(width % 8) == 0`) and no
|
||||
larger than 256 bits and the number of decimals must be no larger than 80.
|
||||
|
||||
For example:
|
||||
|
||||
|
||||
|
||||
* **fixed128x18** is signed, 128 bits wide and has 18 decimals; this is useful for most purposes
|
||||
* **fixed32x0** is signed, 32 bits wide and has 0 decimals; this would be the same as a ``int32_t` in C
|
||||
* **ufixed32x0** is unsigned, 32 bits wide and has 0 decimals; this would be the same as a ``uint32_t` in C
|
||||
* **fixed** is shorthand for ``fixed128x18`
|
||||
* **ufixed** is shorthand for ``ufixed128x18`
|
||||
|
||||
|
||||
### Creating Instances
|
||||
|
||||
|
||||
|
||||
#### *FixedFormat* . **from** ( value="fixed128x18" ) **=>** *[FixedFormat](./)*
|
||||
|
||||
Returns a new instance of a **FixedFormat** defined by *value*. Any valid [Format Strings](./)
|
||||
may be passed in as well as any object which has any of `signed`, `width` and `decimals`
|
||||
defined, including a [FixedFormat](./) object.
|
||||
|
||||
|
||||
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
|
||||
#### *fixedFormat* . **signed** **=>** *boolean*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### *fixedFormat* . **width** **=>** *number*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### *fixedFormat* . **decimals** **=>** *number*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### *fixedFormat* . **name** **=>** *string*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### ***"fixed"***
|
||||
|
||||
A shorthand for `fixed128x80`.
|
||||
|
||||
|
||||
A **FixedNumber** is a fixed-width (in bits) number with an internal
|
||||
base-10 divisor, which allows it to represent a decimal fractional
|
||||
component.
|
||||
|
||||
|
||||
Creating Instances
|
||||
@ -233,6 +151,93 @@ Returns true if and only if *value* is a **FixedNumber**.
|
||||
|
||||
|
||||
|
||||
FixedFormat
|
||||
-----------
|
||||
|
||||
|
||||
A **FixedFormat** is a simple object which represents a decimal
|
||||
(base-10) Fixed-Point data representation. Usually using this
|
||||
class directly is uneccessary, as passing in a [Format Strings](./)
|
||||
directly into the [FixedNumber](./) will automatically create this.
|
||||
|
||||
|
||||
### Format Strings
|
||||
|
||||
|
||||
A format string is composed of three components, including signed-ness,
|
||||
bit-width and number of decimals.
|
||||
|
||||
A signed format string begins with `fixed`, which an unsigned format
|
||||
string begins with `ufixed`, followed by the width (in bits) and the
|
||||
number of decimals.
|
||||
|
||||
The width must be conguent to 0 mod 8 (i.e. `(width % 8) == 0`) and no
|
||||
larger than 256 bits and the number of decimals must be no larger than 80.
|
||||
|
||||
For example:
|
||||
|
||||
|
||||
|
||||
* **fixed128x18** is signed, 128 bits wide and has 18 decimals; this is useful for most purposes
|
||||
* **fixed32x0** is signed, 32 bits wide and has 0 decimals; this would be the same as a ``int32_t` in C
|
||||
* **ufixed32x0** is unsigned, 32 bits wide and has 0 decimals; this would be the same as a ``uint32_t` in C
|
||||
* **fixed** is shorthand for ``fixed128x18`
|
||||
* **ufixed** is shorthand for ``ufixed128x18`
|
||||
|
||||
|
||||
### Creating Instances
|
||||
|
||||
|
||||
|
||||
#### *FixedFormat* . **from** ( value="fixed128x18" ) **=>** *[FixedFormat](./)*
|
||||
|
||||
Returns a new instance of a **FixedFormat** defined by *value*. Any valid [Format Strings](./)
|
||||
may be passed in as well as any object which has any of `signed`, `width` and `decimals`
|
||||
defined, including a [FixedFormat](./) object.
|
||||
|
||||
|
||||
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
|
||||
#### *fixedFormat* . **signed** **=>** *boolean*
|
||||
|
||||
The signed-ness of *fixedFormat*, true if negative values are supported.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *fixedFormat* . **width** **=>** *number*
|
||||
|
||||
The width (in bits) of *fixedFormat*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *fixedFormat* . **decimals** **=>** *number*
|
||||
|
||||
The number of decimal points of *fixedFormat*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *fixedFormat* . **name** **=>** *string*
|
||||
|
||||
The name of the *fixedFormat*, which can be used to recreate the format
|
||||
and is the string that the Solidity language uses to represent this format.
|
||||
|
||||
|
||||
|
||||
|
||||
#### ***"fixed"***
|
||||
|
||||
A shorthand for `fixed128x80`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** bb1362f52031bfae2d988bdc25d31a560da087c2eba5988d70fa40e659766960
|
||||
**Content Hash:** 722ae303e23974bf47d77cc0fede7fd8fe534421d7c8f39189898e0592b7ef8d
|
File diff suppressed because one or more lines are too long
@ -16,41 +16,41 @@ Cryptographic Hashing
|
||||
---------------------
|
||||
|
||||
|
||||
The [Cryptographic Hash Functions](https://en.wikipedia.org/wiki/Cryptographic_hash_function)
|
||||
The [Cryptographic Hash Functions](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Cryptographic_hash_function)
|
||||
are a specific family of hash functions.
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **keccak256** ( aBytesLike ) **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
Returns the [KECCAK256](https://en.wikipedia.org/wiki/SHA-3) digest *aBytesLike*.
|
||||
Returns the [KECCAK256](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/SHA-3) digest *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **ripemd160** ( aBytesLike ) **=>** *string< [DataHexstring](../bytes)< 20 > >*
|
||||
|
||||
Returns the [RIPEMD-160](https://en.m.wikipedia.org/wiki/RIPEMD) digest of *aBytesLike*.
|
||||
Returns the [RIPEMD-160](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.m.wikipedia.org/wiki/RIPEMD) digest of *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **sha256** ( aBytesLike ) **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
Returns the [SHA2-256](https://en.wikipedia.org/wiki/SHA-2) digest of *aBytesLike*.
|
||||
Returns the [SHA2-256](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/SHA-2) digest of *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **sha512** ( aBytesLike ) **=>** *string< [DataHexstring](../bytes)< 64 > >*
|
||||
|
||||
Returns the [SHA2-512](https://en.wikipedia.org/wiki/SHA-2) digest of *aBytesLike*.
|
||||
Returns the [SHA2-512](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/SHA-2) digest of *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **computeHmac** ( algorithm , key , data ) **=>** *string< [DataHexstring](../bytes) >*
|
||||
|
||||
Returns the [HMAC](https://en.wikipedia.org/wiki/HMAC) of *data* with *key*
|
||||
Returns the [HMAC](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/HMAC) of *data* with *key*
|
||||
using the [Algorithm](./) *algorithm*.
|
||||
|
||||
|
||||
@ -62,14 +62,14 @@ using the [Algorithm](./) *algorithm*.
|
||||
|
||||
#### *ethers* . *utils* . *SupportedAlgorithm* . **sha256** **=>** *string*
|
||||
|
||||
Use the [SHA2-256](https://en.wikipedia.org/wiki/SHA-2) hash algorithm.
|
||||
Use the [SHA2-256](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/SHA-2) hash algorithm.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . *SupportedAlgorithm* . **sha512** **=>** *string*
|
||||
|
||||
Use the [SHA2-512](https://en.wikipedia.org/wiki/SHA-2) hash algorithm.
|
||||
Use the [SHA2-512](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/SHA-2) hash algorithm.
|
||||
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ The Ethereum Identity function computs the keccak256 hash of the *text* bytes.
|
||||
|
||||
#### *ethers* . *utils* . **namehash** ( name ) **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
Returns the [ENS Namehash](https://docs.ens.domains/contract-api-reference/name-processing#hashing-names) of *name*.
|
||||
Returns the [ENS Namehash](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/docs.ens.domains/contract-api-reference/name-processing) of *name*.
|
||||
|
||||
|
||||
|
||||
@ -137,4 +137,4 @@ according to their respective type in *arrayOfTypes*.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 2fd8814fdbe671ecc9c4aa5a9e248528f076bc34c0a1c26caef769d704d24b8b
|
||||
**Content Hash:** 45555de5a99896ceb416df9f1c5da990ab6d1decc0ecbfba38eea5a476772fba
|
File diff suppressed because one or more lines are too long
244
docs/api/utils/hdnode/README.md
Normal file
244
docs/api/utils/hdnode/README.md
Normal file
@ -0,0 +1,244 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
HD Wallet
|
||||
=========
|
||||
|
||||
|
||||
TODO: Explain [BIP32](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) [BIP-39](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.bitcoin.it/wiki/BIP_0039) and whatnot here...
|
||||
|
||||
|
||||
Types
|
||||
-----
|
||||
|
||||
|
||||
|
||||
### Constants
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **defaultPath** **=>** *"m/44'/60'/0'/0/0"*
|
||||
|
||||
The default path for Ethereum in an HD Wallet
|
||||
|
||||
|
||||
|
||||
|
||||
### Mnemonic
|
||||
|
||||
|
||||
|
||||
#### *mnemonic* . **phrase** **=>** *string*
|
||||
|
||||
The mnemonic phrase for this mnemonic. It is 12, 15, 18, 21 or 24 words long
|
||||
and separated by the whitespace specified by the `locale`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *mnemonic* . **path** **=>** *string*
|
||||
|
||||
The HD path for this mnemonic.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *mnemonic* . **locale** **=>** *string*
|
||||
|
||||
The language of the wordlist this mnemonic is using.
|
||||
|
||||
|
||||
|
||||
|
||||
HDNode
|
||||
------
|
||||
|
||||
|
||||
|
||||
### Creating Instances
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *HDNode* . **fromMnemonic** ( phrase [ , password [ , wordlist ] ] ) **=>** *[HDNode](./)*
|
||||
|
||||
Return the [HDNode](./) for *phrase* with the optional *password*
|
||||
and *wordlist*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *HDNode* . **fromSeed** ( aBytesLike ) **=>** *[HDNode](./)*
|
||||
|
||||
Return the [HDNode](./) for the seed *aBytesLike*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *HDNode* . **fromExtendedKey** ( extendedKey ) **=>** *[HDNode](./)*
|
||||
|
||||
Return the [HDNode](./) for the *extendedKey*. If *extendedKey* was
|
||||
neutered, the **HDNode** will only be able to compute addresses and not
|
||||
private keys.
|
||||
|
||||
|
||||
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **privateKey** **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
The private key for this HDNode.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **publicKey** **=>** *string< [DataHexstring](../bytes)< 33 > >*
|
||||
|
||||
The (compresses) public key for this HDNode.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **fingerprint** **=>** *string< [DataHexstring](../bytes)< 4 > >*
|
||||
|
||||
The fingerprint is meant as an index to quickly match parent and
|
||||
children nodes together, however collisions may occur and software
|
||||
should verify matching nodes.
|
||||
|
||||
Most developers will not need to use this.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **parentFingerprint** **=>** *string< [DataHexstring](../bytes)< 4 > >*
|
||||
|
||||
The fingerprint of the parent node. See *fingerprint* for more
|
||||
details.
|
||||
|
||||
Most developers will not need to use this.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **address** **=>** *string< [Address](../address) >*
|
||||
|
||||
The address of this HDNode.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **mnemonic** **=>** *[Mnemonic](./)*
|
||||
|
||||
The mnemonic of this HDNode, if known.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **path** **=>** *string*
|
||||
|
||||
The path of this HDNode, if known. If the *mnemonic* is also known,
|
||||
this will match `mnemonic.path`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **chainCode** **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
The chain code is used as a non-secret private key which is then used
|
||||
with EC-multiply to provide the ability to derive addresses without
|
||||
the private key of child non-hardened nodes.
|
||||
|
||||
Most developers will not need to use this.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **index** **=>** *number*
|
||||
|
||||
The index of this HDNode. This will match the last component of
|
||||
the *path*.
|
||||
|
||||
Most developers will not need to use this.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **depth** **=>** *number*
|
||||
|
||||
The depth of this HDNode. This will match the number of components
|
||||
(less one, the `m/`) of the *path*.
|
||||
|
||||
Most developers will not need to use this.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **extendedKey** **=>** *string*
|
||||
|
||||
A serialized string representation of this HDNode. Not all properties
|
||||
are included in the serialization, such as the mnemonic and path, so
|
||||
serializing and deserializing (using the `fromExtendedKey` class
|
||||
method) will result in reduced information.
|
||||
|
||||
|
||||
|
||||
|
||||
### Methods
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **neuter** ( ) **=>** *[HDNode](./)*
|
||||
|
||||
Return a new instance of *hdNode* with its private key removed
|
||||
but all otehr properties preserved. This ensures that the key
|
||||
can not leak the private key of itself or any derived children,
|
||||
but may still be used to compute the addresses of itself and
|
||||
any non-hardened children.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *hdNode* . **derivePath** ( path ) **=>** *[HDNode](./)*
|
||||
|
||||
Return a new [HDNode](./) which is the child of *hdNode* found
|
||||
by deriving *path*.
|
||||
|
||||
|
||||
|
||||
|
||||
Other Functions
|
||||
---------------
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **mnemonicToSeed** ( phrase [ , password ] ) **=>** *string< [DataHexstring](../bytes)< 64 > >*
|
||||
|
||||
Convert a mnemonic phrase to a seed, according to [BIP-39](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.bitcoin.it/wiki/BIP_0039).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **mnemonicToEntropy** ( phrase [ , wordlist ] ) **=>** *string< [DataHexstring](../bytes) >*
|
||||
|
||||
Convert a mnemonic phrase to its entropy, according to [BIP-39](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.bitcoin.it/wiki/BIP_0039).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **isValidMnemonic** ( phrase [ , wordlist ] ) **=>** *boolean*
|
||||
|
||||
Returns true if *phrase* is a valid mnemonic phrase, by
|
||||
testing the checksum.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** c33ab4f669006710c2364a857d2d69c24a8676fb3d1dfc7e66a8d07bc12ee1a2
|
42
docs/api/utils/hdnode/index.html
Normal file
42
docs/api/utils/hdnode/index.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
180
docs/api/utils/logger/README.md
Normal file
180
docs/api/utils/logger/README.md
Normal file
@ -0,0 +1,180 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Logger
|
||||
======
|
||||
|
||||
|
||||
|
||||
Errors
|
||||
------
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **UNKNOWN_ERROR**
|
||||
|
||||
A generic unknown error.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **NOT_IMPLEMENTED**
|
||||
|
||||
The operation is not implemented.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **UNSUPPORTED_OPERATION**
|
||||
|
||||
The operation is not supported.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **NETWORK_ERROR**
|
||||
|
||||
An Ethereum network validation error, such as an invalid chain ID.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **SERVER_ERROR**
|
||||
|
||||
There was an error communicating with a server.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **TIMEOUT**
|
||||
|
||||
A timeout occurred.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **BUFFER_OVERRUN**
|
||||
|
||||
The amount of data needed is more than the amount of data required,
|
||||
which would cause the data buffer to read past its end.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **NUMERIC_FAULT**
|
||||
|
||||
There was an invalid operation done on numeric values.
|
||||
|
||||
Common cases of this occur when there is [overflow](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Integer_overflow),
|
||||
[arithmetic underflow](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Arithmetic_underflow) in fixed numeric types or division by zero.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **MISSING_NEW**
|
||||
|
||||
An object is a Class, but is now being called with `new`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **INVALID_ARGUMENT**
|
||||
|
||||
The type or value of an argument is invalid. This will generally also
|
||||
include the `name` and `value` of the argument. Any function which
|
||||
accepts sensitive data (such as a private key) will include the string
|
||||
`[REDACTED]]` instead of the value passed in.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **MISSING_ARGUMENT**
|
||||
|
||||
An expected parameter was not specified.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **UNEXPECTED_ARGUMENT**
|
||||
|
||||
Too many parameters we passed into a function.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **CALL_EXCEPTION**
|
||||
|
||||
An attempt to call a blockchain contract (getter) resulted in a
|
||||
revert or other error.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **INSUFFICIENT_FUNDS**
|
||||
|
||||
The account is attempting to make a transaction which costs more than is
|
||||
available.
|
||||
|
||||
A sending account must have enough ether to pay for the value, the gas limit
|
||||
(at the gas price) as well as the intrinsic cost of data. The intrinsic cost
|
||||
of data is 4 gas for each zero byte and 68 gas for each non-zero byte.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **NONCE_EXPIRED**
|
||||
|
||||
The nonce being specified has already been used in a mined transaction.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **REPLACEMENT_UNDERPRICED**
|
||||
|
||||
When replacing a transaction, by using a nonce which has already been sent to
|
||||
the network, but which has not been mined yet the new transaction must specify
|
||||
a higher gas price.
|
||||
|
||||
This error occurs when the gas price is insufficient to *bribe* the transaction
|
||||
pool to prefer the new transaction over the old one. Generally, the new gas price
|
||||
should be about 50% + 1 wei more, so if a gas price of 10 gwei was used, the
|
||||
replacement should be 15.000000001 gwei.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Logger* . *errors* . **UNPREDICTABLE_GAS_LIMIT**
|
||||
|
||||
When estimating the required amount of gas for a transaction, a node is queried for
|
||||
its best guess.
|
||||
|
||||
If a node is unable (or unwilling) to predict the cost, this error occurs.
|
||||
|
||||
The best remedy for this situation is to specify a gas limit in the transaction
|
||||
manually.
|
||||
|
||||
This error can also indicate that the transaction is expected to fail regardless,
|
||||
if for example an account with no tokens is attempting to send a token.
|
||||
|
||||
|
||||
|
||||
|
||||
Creating instances
|
||||
------------------
|
||||
|
||||
|
||||
|
||||
#### **new** *ethers* . *utils* . **Logger** ( version )
|
||||
|
||||
Create a new logger which will include *version* in all errors thrown.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 8e9a442738b535dee543efeb8207f15f887a9ed3fbc984567c751c73c6ad541a
|
25
docs/api/utils/logger/index.html
Normal file
25
docs/api/utils/logger/index.html
Normal file
File diff suppressed because one or more lines are too long
@ -10,7 +10,42 @@ Property Utilities
|
||||
|
||||
|
||||
|
||||
#### *utils* . **resolveProperties** ( anObject ) **=>** *Promise< any >*
|
||||
#### *ethers* . *utils* . **checkPropertoes** ( ) **=>** *void*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **deepCopy** ( anObject ) **=>** *any*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **defineReadOnly** ( anObject , name , value ) **=>** *void*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **getStatic** ( aConstructor , key ) **=>** *any*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **resolveProperties** ( anObject ) **=>** *Promise< any >*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **shallowCopy** ( anObject ) **=>** *any*
|
||||
|
||||
|
||||
|
||||
@ -19,4 +54,4 @@ Property Utilities
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 6966c4808403140c68bb04e1fa15591474d5dd336cc882150ae390b0b80257f9
|
||||
**Content Hash:** 99b9fc544118eb4db3df1bea0d761c04e9d051353aa6b21386b6b497d5c0e93d
|
File diff suppressed because one or more lines are too long
@ -10,18 +10,95 @@ Signing Key
|
||||
|
||||
|
||||
|
||||
#### **new** *ethers* . *utils* . **SigningKey** ( privateKey )
|
||||
|
||||
Create a new SigningKey for *privateKey*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *signingKey* . **privateKey** **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
The private key for this Signing Key.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *signingKey* . **publicKey** **=>** *string< [DataHexstring](../bytes)< 65 > >*
|
||||
|
||||
The uncompressed public key for this Signing Key. It will always be
|
||||
65 bytes (130 nibbles) and begine with `0x04`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *signingKey* . **compressedPublicKey** **=>** *string< [DataHexstring](../bytes)< 33 > >*
|
||||
|
||||
The compressed public key for this Signing Key. It will always be
|
||||
33 bytes (66 nibbles) and begine with either `0x02` or `0x03`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *signingKey* . **signDisgest** ( digest ) **=>** *[Signature](../bytes)*
|
||||
|
||||
Sign the *digest* and return the signature.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *signingKey* . **computeSharedSecret** ( otherKey ) **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
Compute the ECDH shared secret with *otherKey*. The *otherKey* may be
|
||||
either a public key or a private key, but generally will be a public key from
|
||||
another party.
|
||||
|
||||
It is best practice that each party computes the hash of this before using it
|
||||
as a symmetric key.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *SigningKey* . **isSigningKey** ( anObject ) **=>** *boolean*
|
||||
|
||||
Returns true if *anObject* is a SigningKey.
|
||||
|
||||
|
||||
|
||||
|
||||
Other Functions
|
||||
---------------
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **verifyMessage** ( message , signature ) **=>** *string< [Address](../address) >*
|
||||
|
||||
Returns the address that signed *message* producing *signature*. The
|
||||
signature may have a non-canonical v (i.e. does not need to be 27 or 28),
|
||||
in which case it will be normalized to compute the `recoveryParam` which
|
||||
will then be used to compute the address; this allows systems which use
|
||||
the v to encode additional data (such as [EIP-155](https://eips.ethereum.org/EIPS/eip-155))
|
||||
the v to encode additional data (such as [EIP-155](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-155))
|
||||
to be used since the v parameter is still completely non-ambiguous.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **recocverPublicKey** ( digest , signature ) **=>** *string< [DataHexstring](../bytes)< 65 > >*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **computePublicKey** ( key [ , compressed=false ] ) **=>** *string< [DataHexstring](../bytes) >*
|
||||
|
||||
Computes the public key of *key*, optionally compressing it. The *key*
|
||||
can be any form of public key (compressed or uncompressed) or a private
|
||||
key.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 91ee024442e5991be731bab1bf05310b3540825acc1c1c7dffa608eff450430b
|
||||
**Content Hash:** 2e1925ed3fec464657162ec80f6014719080dfcfc56f23fa6a1d02c24ce9a198
|
File diff suppressed because one or more lines are too long
@ -96,7 +96,7 @@ UnicodeNormalizationForm
|
||||
------------------------
|
||||
|
||||
|
||||
There are several [commonly used forms](https://en.wikipedia.org/wiki/Unicode_equivalence)
|
||||
There are several [commonly used forms](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Unicode_equivalence)
|
||||
when normalizing UTF-8 data, which allow strings to be compared or hashed in a stable
|
||||
way.
|
||||
|
||||
@ -155,7 +155,7 @@ See NFKC for more an example.
|
||||
|
||||
Only certain specified characters are folded in Canonical Equivalence, and thus
|
||||
it should **not** be considered a method to acheive *any* level of security from
|
||||
[homoglyph attacks](https://en.wikipedia.org/wiki/IDN_homograph_attack).
|
||||
[homoglyph attacks](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/IDN_homograph_attack).
|
||||
|
||||
|
||||
|
||||
@ -220,7 +220,7 @@ the custom error function.
|
||||
Due to the way UTF-8 allows variable length byte sequences
|
||||
to be used, it is possible to have multiple representations
|
||||
of the same character, which means
|
||||
[overlong sequences](https://en.wikipedia.org/wiki/UTF-8#Overlong_encodings)
|
||||
[overlong sequences](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/UTF-8)
|
||||
allow for a non-distinguished string to be formed, which can
|
||||
impact security as multiple strings that are otherwise
|
||||
equal can have different hashes.
|
||||
@ -293,7 +293,7 @@ overlong sequences to be converted to their equivalent string.
|
||||
|
||||
This will replace all invalid sequences (by consuming invalid prefix bytes and
|
||||
any following continuation bytes) with the
|
||||
[UTF-8 Replacement Character](https://en.wikipedia.org/wiki/Specials_%28Unicode_block%29#Replacement_character),
|
||||
[UTF-8 Replacement Character](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Specials_%28Unicode_block%29),
|
||||
(i.e. U+FFFD).
|
||||
|
||||
|
||||
@ -301,4 +301,4 @@ any following continuation bytes) with the
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** c3856e40d58241c0a7f5bc29928731971ede8e8e8c75e6eda97778c9b952e1f0
|
||||
**Content Hash:** 8654a53455522a9b4187d77e56c47fb9a908574b594aed3ce1a8a7d445c8fe75
|
File diff suppressed because one or more lines are too long
@ -18,54 +18,57 @@ Types
|
||||
### UnsignedTransaction
|
||||
|
||||
|
||||
An unsigned transaction represents a transaction that has not been signed.
|
||||
An unsigned transaction represents a transaction that has not been
|
||||
signed and its values are flexible as long as they are not ambiguous.
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **to** **=>** *string< [Address](../address) >*
|
||||
|
||||
|
||||
The addres this transaction is to.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **nonce** **=>** *number*
|
||||
|
||||
The nonce of this transaction.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **gasLimit** **=>** *[BigNumberish](../bignumber)*
|
||||
|
||||
#### *unsignedTransaction* . **gasLimit** **=>** *[BigNumber](../bignumber)*
|
||||
The gas limit for this transaction.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **gasPrice** **=>** *[BigNumberish](../bignumber)*
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **gasPrice** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
|
||||
The gas price for this transaction.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **data** **=>** *[BytesLike](../bytes)*
|
||||
|
||||
The data for this transaction.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **value** **=>** *[BigNumberish](../bignumber)*
|
||||
|
||||
#### *unsignedTransaction* . **value** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
|
||||
The value (in wei) for this transaction.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **chainId** **=>** *number*
|
||||
|
||||
|
||||
The chain ID for this transaction. If the chain ID is 0 or null,
|
||||
then [EIP-155](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-155) is disabled and legacy signing is
|
||||
used, unless overridden in a signature.
|
||||
|
||||
|
||||
|
||||
@ -76,86 +79,111 @@ An unsigned transaction represents a transaction that has not been signed.
|
||||
A generic object to represent a transaction.
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **hash** **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
#### *transaction* . **hash** **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
The transaction hash, which can be used as an identifier for
|
||||
*transaction*. This is the keccak256 of the serialized RLP encoded
|
||||
representation of *transaction*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **to** **=>** *string< [Address](../address) >*
|
||||
|
||||
The address *transaction* is to.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **from** **=>** *string< [Address](../address) >*
|
||||
|
||||
#### *unsignedTransaction* . **from** **=>** *string< [Address](../address) >*
|
||||
The address *transaction* is from.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **nonce** **=>** *number*
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **nonce** **=>** *number*
|
||||
The nonce for *transaction*. Each transaction sent to the network
|
||||
from an account includes this, which ensures the order and
|
||||
non-replayability of a transaction. This must be equal to the current
|
||||
number of transactions ever sent to the network by the **from** address.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **gasLimit** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **gasLimit** **=>** *[BigNumber](../bignumber)*
|
||||
The gas limit for *transaction*. An account must have enough ether to
|
||||
cover the gas (at the specified **gasPrice**). Any unused gas is
|
||||
refunded at the end of the transaction, and if there is insufficient gas
|
||||
to complete execution, the effects of the trasaction are reverted, but
|
||||
the gas is **fully consumed** and an out-of-gas error occurs.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **gasPrice** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **gasPrice** **=>** *[BigNumber](../bignumber)*
|
||||
The price (in wei) per unit of gas for *transaction*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **data** **=>** *[BytesLike](../bytes)*
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **data** **=>** *[BytesLike](../bytes)*
|
||||
The data for *transaction*. In a contract this is the call data.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **value** **=>** *[BigNumber](../bignumber)*
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **value** **=>** *[BigNumber](../bignumber)*
|
||||
The value (in wei) for *transaction*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **chainId** **=>** *number*
|
||||
|
||||
The chain ID for *transaction*. This is used as part of
|
||||
[EIP-155](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-155) to prevent replay attacks on different
|
||||
networks.
|
||||
|
||||
#### *unsignedTransaction* . **chainId** **=>** *number*
|
||||
For example, if a transaction was made on ropsten with an account
|
||||
also used on homestead, it would be possible for a transaction
|
||||
signed on ropsten to be executed on homestead, which is likely
|
||||
unintended.
|
||||
|
||||
There are situations where replay may be desired, however these
|
||||
are very rare and it is almost always recommended to specify the
|
||||
chain ID.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **r** **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **r** **=>** *[BytesLike](../bytes)*
|
||||
The r portion of the elliptic curve signatures for *transaction*.
|
||||
This is more accurately, the x coordinate of the point r (from
|
||||
which the y can be computed, along with v).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **s** **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **s** **=>** *[BytesLike](../bytes)*
|
||||
The s portion of the elliptic curve signatures for *transaction*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *transaction* . **v** **=>** *number*
|
||||
|
||||
|
||||
#### *unsignedTransaction* . **v** **=>** *number*
|
||||
|
||||
|
||||
The v portion of the elliptic curve signatures for *transaction*.
|
||||
This is used to refine which of the two possible points a given
|
||||
x-coordinate can have, and in [EIP-155](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-155) is additionally
|
||||
used to encode the chain ID into the serialized transaction.
|
||||
|
||||
|
||||
|
||||
@ -190,16 +218,25 @@ ecrecover algorithm.
|
||||
|
||||
#### *ethers* . *utils* . **serialize** ( transaction [ , signature ] ) **=>** *string< [DataHexstring](../bytes) >*
|
||||
|
||||
Computes the serialized *transaction/, optionally signed with *signature//. If
|
||||
signature is not presented, the unsigned serialized transaction is returned, which can
|
||||
be used to compute the hash necessary to sign.
|
||||
Computes the serialized *transaction*, optionally serialized with
|
||||
the a *signature*. If *signature* is not present, the unsigned
|
||||
serialized transaction is returned, which can be used to compute the
|
||||
hash necessary to sign.
|
||||
|
||||
This function uses EIP-155 if a chainId is provided, otherwise legacy serialization is
|
||||
used. It is **highly** recommended to always specify a *chainId*.
|
||||
This function uses [EIP-155](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-155) if a chainId is provided,
|
||||
otherwise legacy serialization is used. It is **highly** recommended
|
||||
to always specify a *chainId*.
|
||||
|
||||
If *signature* includes a chain ID (explicitly or implicitly by using an
|
||||
[EIP-155](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/eips.ethereum.org/EIPS/eip-155) `v` or `_vs`) it will be used to compute the
|
||||
chain ID.
|
||||
|
||||
If there is a mismatch between the chain ID of *transaction* and *signature*
|
||||
an error is thrown.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 51f4a8594ba122a2c43d7b2cffdb2bf461f3212cea828e715a76c76ef8dd1ae1
|
||||
**Content Hash:** dcb483a7138f06449bb0303ac2d04a10f83c9498eaa23b615a3404316870b0ff
|
File diff suppressed because one or more lines are too long
135
docs/api/utils/web/README.md
Normal file
135
docs/api/utils/web/README.md
Normal file
@ -0,0 +1,135 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Web Utilities
|
||||
=============
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **fetchJson** ( urlOrConnectionInfo [ , json [ , processFunc ] ] ) **=>** *Promise< any >*
|
||||
|
||||
Fetch and parse the JSON content from *urlOrConnectionInfo*, with the
|
||||
optiona body *json* and optionally processing the result with *processFun*
|
||||
before returning it.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *utils* . **poll** ( pollFunc [ , options ] ) **=>** *Promise< any >*
|
||||
|
||||
Repeatedly call pollFunc using the [Poll Options](./) until it returns a
|
||||
value other than undefined.
|
||||
|
||||
|
||||
|
||||
|
||||
### Connection Info
|
||||
|
||||
|
||||
|
||||
#### *connection* . **url** **=>** *string*
|
||||
|
||||
The URL to connect to.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *connection* . **user** **=>** *string*
|
||||
|
||||
The username to use for [Basic Authentication](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Basic_access_authentication).
|
||||
The default is null (i.e. do not use basic authentication)
|
||||
|
||||
|
||||
|
||||
|
||||
#### *connection* . **password** **=>** *string*
|
||||
|
||||
The password to use for [Basic Authentication](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Basic_access_authentication).
|
||||
The default is null (i.e. do not use basic authentication)
|
||||
|
||||
|
||||
|
||||
|
||||
#### *connection* . **allowInsecureAuthentication** **=>** *boolean*
|
||||
|
||||
Allow [Basic Authentication](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Basic_access_authentication) over non-secure HTTP. The default is false.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *connection* . **timeout** **=>** *number*
|
||||
|
||||
How long to wait before rejecting with a *timeout* error.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *connection* . **headers** **=>** *{[key:string]:string}*
|
||||
|
||||
Additional headers to include in the connection.
|
||||
|
||||
|
||||
|
||||
|
||||
### Poll Options
|
||||
|
||||
|
||||
|
||||
#### *options* . **timeout** **=>** *number*
|
||||
|
||||
The amount of time allowed to ellapse before triggering a timeout
|
||||
error.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *options* . **floor** **=>** *number*
|
||||
|
||||
The minimum time limit to allow for [Exponential Backoff](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Exponential_backoff).
|
||||
|
||||
The default is 0s.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *options* . **ceiling** **=>** *number*
|
||||
|
||||
The maximum time limit to allow for [Exponential Backoff](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Exponential_backoff).
|
||||
|
||||
The default is 10s.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *options* . **interval** **=>** *number*
|
||||
|
||||
The interval used during [Exponential Backoff](../../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Exponential_backoff) calculation.
|
||||
|
||||
The default is 250ms.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *options* . **retryLimit** **=>** *number*
|
||||
|
||||
The number of times to retry in the event of an error or *undefined* is
|
||||
returned.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *options* . **onceBlock** **=>** *[Provider](../../providers/provider)*
|
||||
|
||||
If this is specified, the polling will wait on new blocks from
|
||||
*provider* before attempting the *pollFunc* again.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** b7c1a3182a84ac1c136e7e90d5e2ba18269f0a9a91ce8523ee4e77d87a83d0b0
|
21
docs/api/utils/web/index.html
Normal file
21
docs/api/utils/web/index.html
Normal file
File diff suppressed because one or more lines are too long
142
docs/api/utils/wordlists/README.md
Normal file
142
docs/api/utils/wordlists/README.md
Normal file
@ -0,0 +1,142 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Wordlists
|
||||
=========
|
||||
|
||||
|
||||
|
||||
Wordlist
|
||||
--------
|
||||
|
||||
|
||||
|
||||
#### *wordlist* . **locale** **=>** *string*
|
||||
|
||||
The locale for this wordlist.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *wordlist* . **getWord** ( index ) **=>** *string*
|
||||
|
||||
Returns the word at *index*.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *wordlist* . **getWordIndex** ( word ) **=>** *number*
|
||||
|
||||
Returns the index of *word* within the wordlist.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *wordlist* . **split** ( mnemonic ) **=>** *Array< string >*
|
||||
|
||||
Returns the mnemonic split into each individual word, according to a
|
||||
locale's valid whitespace character set.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *wordlist* . **join** ( words ) **=>** *string*
|
||||
|
||||
Returns the mnemonic by joining *words* together using the
|
||||
whitespace that is standard for the locale.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Wordlist* . **check** ( wordlists ) **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
Checks that all words map both directions correctly and return the
|
||||
hash of the lists. Sub-classes should use this to validate the wordlist
|
||||
is correct against the official wordlist hash.
|
||||
|
||||
|
||||
|
||||
|
||||
#### *Wordlist* . **register** ( wordlist [ , name ] ) **=>** *string< [DataHexstring](../bytes)< 32 > >*
|
||||
|
||||
Register a wordlist with the list of wordlists, optionally overriding
|
||||
the registered *name*.
|
||||
|
||||
|
||||
|
||||
|
||||
Languages
|
||||
---------
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *wordlists* . **cz** **=>** *Wordlist*
|
||||
|
||||
The Czech [Wordlist](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *wordlists* . **en** **=>** *Wordlist*
|
||||
|
||||
The English [Wordlist](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *wordlists* . **es** **=>** *Wordlist*
|
||||
|
||||
The Spanish [Wordlist](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *wordlists* . **fr** **=>** *Wordlist*
|
||||
|
||||
The French [Wordlist](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *wordlists* . **it** **=>** *Wordlist*
|
||||
|
||||
The Italian [Wordlist](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *wordlists* . **js** **=>** *Wordlist*
|
||||
|
||||
The Japanese [Wordlist](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *wordlists* . **ko** **=>** *Wordlist*
|
||||
|
||||
The Korean [Wordlist](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *wordlists* . **zh_cn** **=>** *Wordlist*
|
||||
|
||||
The Simplified Chinese [Wordlist](./).
|
||||
|
||||
|
||||
|
||||
|
||||
#### *ethers* . *wordlists* . **zh_tw** **=>** *Wordlist*
|
||||
|
||||
The Traditional Chinese [Wordlist](./).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** de4a1b1a39943d23744fb0cdc9b489e08eb83a52f94da8bec0cbc3b91aae5a17
|
23
docs/api/utils/wordlists/index.html
Normal file
23
docs/api/utils/wordlists/index.html
Normal file
File diff suppressed because one or more lines are too long
@ -15,7 +15,9 @@ Command Line Interfaces
|
||||
* [Examples](ethers)
|
||||
* [Assembler](asm)
|
||||
* [Help](asm)
|
||||
* [Examples](asm)
|
||||
* [Example Input Files](asm)
|
||||
* [Assembler Examples](asm)
|
||||
* [Disassembler Examples](asm)
|
||||
* [ENS](ens)
|
||||
* [Help](ens)
|
||||
* [Examples](ens)
|
||||
@ -30,4 +32,4 @@ Command Line Interfaces
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 0ab5c6b4f0873f77215595622f14d5908f56d0215b385c9642af8a0fa4d1a90c
|
||||
**Content Hash:** b023e99fb51eed2e58e7b39edbec13fa0f6136000680da4b8f7b64eaf6f6dc1e
|
@ -9,9 +9,9 @@ Assembler
|
||||
=========
|
||||
|
||||
|
||||
The assembler Command-Line utility allows you to assemble EVM asm files
|
||||
into deployable bytecode and disassemle EVM bytecode into human-readable
|
||||
mnemonics.
|
||||
The assembler Command-Line utility allows you to assemble the
|
||||
[Ethers ASM Dialect](../../api/other/assembly/dialect) into deployable EVM bytecode
|
||||
and disassemle EVM bytecode into human-readable mnemonics.
|
||||
|
||||
|
||||
Help
|
||||
@ -24,8 +24,11 @@ Usage:
|
||||
ethers-asm [ FILENAME ] [ OPTIONS ]
|
||||
|
||||
OPTIONS
|
||||
--disassemble Disassemble input bytecode
|
||||
--define KEY=VALUE provide assembler defines
|
||||
--disassemble Disassemble input bytecode
|
||||
--ignore-warnings Ignore warnings
|
||||
--pic generate position independent code
|
||||
--target LABEL output LABEL bytecode (default: _)
|
||||
|
||||
OTHER OPTIONS
|
||||
--debug Show stack traces for errors
|
||||
@ -35,13 +38,246 @@ OTHER OPTIONS
|
||||
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
Example Input Files
|
||||
-------------------
|
||||
|
||||
|
||||
TODO examples
|
||||
|
||||
#### **SimpleStore.asm**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
; SimpleStore (uint)
|
||||
|
||||
; Set the inital value of 42
|
||||
sstore(0, 42)
|
||||
|
||||
; Init code to deploy myContract
|
||||
codecopy(0, $myContract, #myContract)
|
||||
return(0, #myContract)
|
||||
|
||||
@myContract {
|
||||
; Non-payable
|
||||
jumpi($error, callvalue)
|
||||
|
||||
; Get the Sighash
|
||||
shr({{= 256 - 32 }}, calldataload(0))
|
||||
|
||||
; getValue()
|
||||
dup1
|
||||
{{= sighash("getValue()") }}
|
||||
jumpi($getValue, eq)
|
||||
|
||||
; setValue(uint)
|
||||
dup1
|
||||
{{= sighash("setValue(uint)") }}
|
||||
jumpi($setValue, eq)
|
||||
|
||||
; No matching signature
|
||||
@error:
|
||||
revert(0, 0)
|
||||
|
||||
@getValue:
|
||||
mstore(0, sload(0))
|
||||
return (0, 32)
|
||||
|
||||
@setValue:
|
||||
; Make sure we have exactly a uint
|
||||
jumpi($error, iszero(eq(calldatasize, 36)))
|
||||
|
||||
; Store the value
|
||||
sstore(0, calldataload(4))
|
||||
return (0, 0)
|
||||
|
||||
; There is no *need* for the PUSH32, it just makes
|
||||
; decompiled code look nicer
|
||||
@checksum[
|
||||
{{= (defines.checksum ? concat([ Opcode.from("PUSH32"), id(myContract.source) ]): "0x") }}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### **SimpleStore.bin**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
0x602a6000556044601160003960446000f334601e5760003560e01c8063209652
|
||||
0x5514602457806355241077146030575b60006000fd5b60005460005260206000
|
||||
0xf35b6024361415601e5760043560005560006000f3
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Note: Bytecode File Syntax
|
||||
|
||||
A bin file may be made up of multiple blocks of bytecode, each may
|
||||
optionally begin with a `0x` prefix, all of which **must** be of
|
||||
even length (since bytes are required, with 2 nibbles per byte)
|
||||
|
||||
All whitespace is ignored.
|
||||
|
||||
|
||||
|
||||
|
||||
Assembler Examples
|
||||
------------------
|
||||
|
||||
|
||||
The assembler converts an [Ethers ASM Dialect](../../api/other/assembly/dialect) into
|
||||
bytecode by running multiple passes of an assemble stage, each pass
|
||||
more closely approximating the final result.
|
||||
|
||||
This allows small portions of the bytecode to be massaged and tweaked
|
||||
until the bytecode stablizes. This allows for more compact jump
|
||||
destinations and for code to be include more advanced meta-programming
|
||||
techniques.
|
||||
|
||||
|
||||
```
|
||||
/home/ethers> ethers-asm SimpleStore.asm
|
||||
0x602a6000556044601160003960446000f334601e5760003560e01c80632096525514602457806355241077146030575b60006000fd5b60005460005260206000f35b6024361415601e5760043560005560006000f3
|
||||
|
||||
# Piping in ASM source code
|
||||
/home/ethers> cat SimpleStore.asm | ethers-asm
|
||||
# Same as above
|
||||
|
||||
# Setting a define which the ASM file checks and adds a checksum
|
||||
/home/ethers> ethers-asm --define checksum SimpleStore.asm
|
||||
0x602a6000556065601160003960656000f334601e5760003560e01c80632096525514602457806355241077146030575b60006000fd5b60005460005260206000f35b6024361415601e5760043560005560006000f37f10358310d664c9aeb4bf4ce7a10a6a03176bd23194c8ccbd3160a6dac90774d6
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Options
|
||||
|
||||
|
||||
|
||||
#### **--define KEY=VALUE** *or* **--define FLAG**
|
||||
|
||||
This allows key/value pairs (where the value is a string) and
|
||||
flags (which the value is `true`) to be passed along to the
|
||||
assembler, which can be accessed in
|
||||
[Scripting Blocks](../../api/other/assembly/dialect), such as `{{= defined.someKey }}`.
|
||||
|
||||
|
||||
|
||||
|
||||
#### **--ignore-warnings**
|
||||
|
||||
By default any warning will be treated like an error. This enabled
|
||||
by-passing warnings.
|
||||
|
||||
|
||||
|
||||
|
||||
#### **--pic**
|
||||
|
||||
When a program is assembled, the labels are usually given as an
|
||||
absolute byte position, which can be jumped to for loops and
|
||||
control flow. This means that a program must be installed at a specific
|
||||
location.
|
||||
|
||||
Byt specifying the **Position Independent Code** flag, code
|
||||
will be generated in a way such that all offsets are relative, allowing
|
||||
the program to be moved without any impact to its logic.
|
||||
|
||||
This does incur an additional gsas cost of 8 gas per offset access though.
|
||||
|
||||
|
||||
|
||||
|
||||
#### **--target LABEL**
|
||||
|
||||
All programs have a root scope named `_` which is by default
|
||||
assembled. This option allows another labelled target (either a
|
||||
[Scopes](../../api/other/assembly/dialect) or a [Data Segment](../../api/other/assembly/dialect) to be
|
||||
assembled instead. The entire program is still assembled per usual,
|
||||
so this only impacts which part of the program is output.
|
||||
|
||||
|
||||
|
||||
|
||||
Disassembler Examples
|
||||
---------------------
|
||||
|
||||
|
||||
A disassembled program shows offsets and mnemonics for the given
|
||||
bytecode. This format may change in the future to be more
|
||||
human-readable.
|
||||
|
||||
|
||||
```
|
||||
/home/ethers> ethers-asm --disassemble SimpleStore.bin
|
||||
0000 : 0x2a ; #1
|
||||
0002 : 0x00 ; #1
|
||||
0004 : SSTORE
|
||||
0005 : 0x44 ; #1
|
||||
0007 : 0x11 ; #1
|
||||
0009 : 0x00 ; #1
|
||||
000b : CODECOPY
|
||||
000c : 0x44 ; #1
|
||||
000e : 0x00 ; #1
|
||||
0010 : RETURN
|
||||
0011 : CALLVALUE
|
||||
0012 : 0x1e ; #1
|
||||
0014 : JUMPI
|
||||
0015 : 0x00 ; #1
|
||||
0017 : CALLDATALOAD
|
||||
0018 : 0xe0 ; #1
|
||||
001a : SHR
|
||||
001b : DUP1
|
||||
001c : 0x20965255 ; #4
|
||||
0021 : EQ
|
||||
0022 : 0x24 ; #1
|
||||
0024 : JUMPI
|
||||
0025 : DUP1
|
||||
0026 : 0x55241077 ; #4
|
||||
002b : EQ
|
||||
002c : 0x30 ; #1
|
||||
002e : JUMPI
|
||||
002f*: JUMPDEST
|
||||
0030 : 0x00 ; #1
|
||||
0032 : 0x00 ; #1
|
||||
0034 : REVERT
|
||||
0035*: JUMPDEST
|
||||
0036 : 0x00 ; #1
|
||||
0038 : SLOAD
|
||||
0039 : 0x00 ; #1
|
||||
003b : MSTORE
|
||||
003c : 0x20 ; #1
|
||||
003e : 0x00 ; #1
|
||||
0040 : RETURN
|
||||
0041*: JUMPDEST
|
||||
0042 : 0x24 ; #1
|
||||
0044 : CALLDATASIZE
|
||||
0045 : EQ
|
||||
0046 : ISZERO
|
||||
0047 : 0x1e ; #1
|
||||
0049 : JUMPI
|
||||
004a : 0x04 ; #1
|
||||
004c : CALLDATALOAD
|
||||
004d : 0x00 ; #1
|
||||
004f : SSTORE
|
||||
0050 : 0x00 ; #1
|
||||
0052 : 0x00 ; #1
|
||||
0054 : RETURN
|
||||
|
||||
/home/ethers> cat SimpleStore.bin | ethers-asm --disassemble
|
||||
# Same as above
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** d5cc366b4a6de2f4f257de4e23d31c9d523e7c1c4bc9bdd28cfd256ee257c754
|
||||
**Content Hash:** 72c24560588bdf16e1bb96c2a1f3b367692b5e97c81f89d5d55396c1ccff834b
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -253,7 +253,7 @@ homestead>
|
||||
|
||||
The `--xxx-mnemonic-password` is similar to the `--mnemonic-password` options,
|
||||
which uses a password to decrypt the account for a mnemonic, however it passes
|
||||
the password through the [scrypt](https://en.wikipedia.org/wiki/Scrypt)
|
||||
the password through the [scrypt](../../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.wikipedia.org/wiki/Scrypt)
|
||||
*password-based key derivation function* first, which is intentionally slow and makes
|
||||
a brute-force attack far more difficult.
|
||||
|
||||
@ -280,4 +280,4 @@ This is still an experimental feature (hence the `xxx`).
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 92cdbc324ec6a29cc4cd55bf1cb14de1ef8a4512dbd2ab03d7304238269caed5
|
||||
**Content Hash:** 4d6fa6e3c4141e4890f32fb4c2e080b5218713f231fe21962d60e27dc0ee2542
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -13,8 +13,8 @@ The *Flatworm Docs* rendering script is designed to be **very**
|
||||
simple, but provide enough formatting necessary for documenting
|
||||
JavaScript libraries.
|
||||
|
||||
A lot of its inspiration came from [Read the Docs](https://github.com/readthedocs/sphinx_rtd_theme) and
|
||||
the [Sphinx](https://www.sphinx-doc.org/) project.
|
||||
A lot of its inspiration came from [Read the Docs](../Users/ricmoo/Development/ethers/ethers.js-v5/https:/github.com/readthedocs/sphinx_rtd_theme) and
|
||||
the [Sphinx](../Users/ricmoo/Development/ethers/ethers.js-v5/https:/www.sphinx-doc.org) project.
|
||||
|
||||
|
||||
Fragments
|
||||
@ -266,4 +266,4 @@ This extended directive function is available for:
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 25456ca845a1572440a2c7a6658ef736782f92a39815df78455832aa8e13e5f4
|
||||
**Content Hash:** 2fbf0adb4f6ef934152ddd2d9b321be74cb28610a04f34a62b6eff9cf3667993
|
File diff suppressed because one or more lines are too long
@ -15,8 +15,7 @@ Installing
|
||||
|
||||
|
||||
The various Classes and Functions are available to be imported
|
||||
manually from sub-packages under the
|
||||
[@ethersproject](https://www.npmjs.com/search?q=%40ethersproject%2F)
|
||||
manually from sub-packages under the [@ethersproject](../Users/ricmoo/Development/ethers/ethers.js-v5/https:/www.npmjs.com/search?q=%40ethersproject%2F)
|
||||
but for most projects, the umbrella package is the easiest way to
|
||||
get started.
|
||||
|
||||
@ -50,8 +49,8 @@ const { ethers } = require("ethers");
|
||||
|
||||
|
||||
It is generally better practice (for security reasons) to copy the
|
||||
[ethers library](https://cdn.ethers.io/lib/ethers-5.0.esm.min.js) to
|
||||
your own webserver and serve it yourself.
|
||||
[ethers library](../Users/ricmoo/Development/ethers/ethers.js-v5/https:/cdn.ethers.io/lib/ethers-5.0.esm.min.js) to your own webserver and serve it
|
||||
yourself.
|
||||
|
||||
For quick demos or prototyping though, it can be loaded in your
|
||||
Web Applications from our CDN.
|
||||
@ -66,4 +65,4 @@ Web Applications from our CDN.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** a78889cf0b1215b8268f76e5cef5869b2b592e56a5ce062d58dfcc4f5b93159d
|
||||
**Content Hash:** 56c46ac0fa7f1a71d4de04e0f6615f10073f21fa7a5294f71c29bbb3ee842c31
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -10,8 +10,8 @@ License and Copyright
|
||||
|
||||
|
||||
The ethers library (including all dependencies) are available
|
||||
under the [MIT License](https://en.m.wikipedia.org/wiki/MIT_License),
|
||||
which permits a wide variety of uses.
|
||||
under the [MIT License](../Users/ricmoo/Development/ethers/ethers.js-v5/https:/en.m.wikipedia.org/wiki/MIT_License), which permits a wide variety
|
||||
of uses.
|
||||
|
||||
|
||||
### MIT License
|
||||
@ -40,4 +40,4 @@ SOFTWARE.
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 91addf1f9680c79e0db3ee454bc36cf3ba11b14221c075f21d8faf4d94146c65
|
||||
**Content Hash:** db370fbc48a417a5ddf3ab42646642bf6e87afc445b56a6d4b24c3b3a3c407d8
|
File diff suppressed because one or more lines are too long
@ -9,23 +9,24 @@ Migration Guide
|
||||
===============
|
||||
|
||||
|
||||
Migratimg...
|
||||
Here are some migration guides when upgrading from older versions
|
||||
of Ethers or other libraries.
|
||||
|
||||
|
||||
From Web3
|
||||
---------
|
||||
|
||||
|
||||
test
|
||||
|
||||
|
||||
From ethers v4
|
||||
--------------
|
||||
|
||||
|
||||
test
|
||||
* [Migration: From Web3.js](web3)
|
||||
* [Contracts](web3)
|
||||
* [Providers](web3)
|
||||
* [Numbers](web3)
|
||||
* [Utilities](web3)
|
||||
* [Migration: From Ethers v4](ethers-v4)
|
||||
* [BigNumber](ethers-v4)
|
||||
* [Contracts](ethers-v4)
|
||||
* [Errors](ethers-v4)
|
||||
* [Interface](ethers-v4)
|
||||
* [Utilities](ethers-v4)
|
||||
* [Wallet](ethers-v4)
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** dc44071344e2a1a26a1638594b7403e8ab4722d4964a8ae5b9b94411eaa36f3c
|
||||
**Content Hash:** 740fa7ef44cdf2de76bd3b7e6564144cac3e389786cc5f3c19382bbba20dc90b
|
266
docs/migration/ethers-v4/README.md
Normal file
266
docs/migration/ethers-v4/README.md
Normal file
@ -0,0 +1,266 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Migration: From Ethers v4
|
||||
=========================
|
||||
|
||||
|
||||
|
||||
BigNumber
|
||||
---------
|
||||
|
||||
|
||||
|
||||
### Namespace
|
||||
|
||||
|
||||
Since [BigNumber](../../api/utils/bignumber) is used quite frequently, it has been moved to
|
||||
the top level of the umbrella package.
|
||||
|
||||
|
||||
```
|
||||
// v4
|
||||
ethers.utils.BigNumber
|
||||
ethers.utils.BigNumberish
|
||||
|
||||
// v5
|
||||
ethers.BigNumber
|
||||
ethers.BigNumberish
|
||||
```
|
||||
|
||||
|
||||
|
||||
### 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
|
||||
`from` class method.
|
||||
|
||||
|
||||
```
|
||||
// v4
|
||||
new ethers.utils.BigNumber(someValue)
|
||||
ethers.utils.bigNumberify(someValue);
|
||||
|
||||
// v5
|
||||
// - Constructor is private
|
||||
// - Removed `bigNumberify`
|
||||
ethers.BigNumber.from(someValue)
|
||||
```
|
||||
|
||||
|
||||
|
||||
Contracts
|
||||
---------
|
||||
|
||||
|
||||
```
|
||||
TODO
|
||||
```
|
||||
|
||||
|
||||
|
||||
Errors
|
||||
------
|
||||
|
||||
|
||||
|
||||
### Namespace
|
||||
|
||||
|
||||
All errors now belong to the [Logger](../../api/utils/logger) class and the related functions
|
||||
have been moved to [Logger](../../api/utils/logger) instances, which can include a per-package
|
||||
version string.
|
||||
|
||||
Global error fucntions have been moved [Logger](../../api/utils/logger) class methods.
|
||||
|
||||
|
||||
```
|
||||
// v4
|
||||
ethers.errors.UNKNOWN_ERROR
|
||||
ethers.errors.*
|
||||
|
||||
errors.setCensorship(censorship, permanent)
|
||||
errors.setLogLevel(logLevel)
|
||||
|
||||
errors.checkArgumentCount(count, expectedCount, suffix)
|
||||
errors.checkNew(self, kind)
|
||||
errors.checkNormalize()
|
||||
errors.throwError(message, code, params)
|
||||
errors.warn(...)
|
||||
errors.info(...)
|
||||
|
||||
// v5
|
||||
ethers.utils.Logger.errors.UNKNOWN_ERROR
|
||||
ethers.utils.Logger.errors.*
|
||||
|
||||
Logger.setCensorship(censorship, permanent)
|
||||
Logger.setLogLevel(logLevel)
|
||||
|
||||
const logger = new ethers.utils.Logger(version);
|
||||
logger.checkArgumentCount(count, expectedCount, suffix)
|
||||
logger.checkNew(self, kind)
|
||||
logger.checkNormalize()
|
||||
logger.throwError(message, code, params)
|
||||
logger.warn(...)
|
||||
logger.info(...)
|
||||
```
|
||||
|
||||
|
||||
|
||||
Interface
|
||||
---------
|
||||
|
||||
|
||||
The [Interface](../../api/utils/abi) object has undergone the most dramatic changes.
|
||||
|
||||
It is no longer a meta-class and now has methods that simplify handling
|
||||
contract interface operations without the need for object inspection and
|
||||
special edge cases.
|
||||
|
||||
|
||||
### Functions
|
||||
|
||||
|
||||
```
|
||||
// v4 (example: "transfer(address to, uint amount)")
|
||||
interface.functions.transfer.encode(to, amount)
|
||||
interface.functions.transfer.decode(callData)
|
||||
|
||||
// v5
|
||||
interface.encodeData("transfer", [ to, amount ])
|
||||
interface.decodeResult("transfer", data)
|
||||
|
||||
// Or you can use any compatible signature or Fragment objects.
|
||||
// Notice that signature normalization is performed for you,
|
||||
// e.g. "uint" and "uint256" will be automatically converted
|
||||
interface.encodeData("transfer(address,uint)", [ to, amount ])
|
||||
interface.decodeResult("transfer(address to, uint256 amount)", data)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Events
|
||||
|
||||
|
||||
```
|
||||
// v4 (example: Transfer(address indexed, address indexed, uint256)
|
||||
interface.events.Transfer.encodeTopics(values)
|
||||
interface.events.Transfer.decode(data, topics)
|
||||
|
||||
// v5
|
||||
interface.encodeFilterTopics("Transfer", values)
|
||||
interface.encodeEventLog("Transfer", data, topics)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Inspection
|
||||
|
||||
|
||||
Interrogating properties about a function or event can now (mostly) be
|
||||
done directly on the [Fragment](../../api/utils/abi) object.
|
||||
|
||||
|
||||
```
|
||||
// v4
|
||||
interface.functions.transfer.name
|
||||
interface.functions.transfer.inputs
|
||||
interface.functions.transfer.outputs
|
||||
interface.functions.transfer.payable
|
||||
interface.functions.transfer.gas
|
||||
|
||||
// v5
|
||||
const functionFragment = interface.getFunction("transfer")
|
||||
functionFragment.name
|
||||
functionFragment.inputs
|
||||
functionFragment.outputs
|
||||
functionFragment.payable
|
||||
functionFragment.gas
|
||||
|
||||
|
||||
// v4; type is "call" or "transaction"
|
||||
interface.functions.transfer.type
|
||||
|
||||
// v5; constant is true (i.e. "call") or false (i.e. "transaction")
|
||||
functionFragment.constant
|
||||
|
||||
|
||||
// v4
|
||||
interface.events.Transfer.anonymous
|
||||
interface.events.Transfer.inputs
|
||||
interface.events.Transfer.name
|
||||
|
||||
// v5
|
||||
const eventFragment = interface.getEvent("Transfer");
|
||||
eventFragment.anonymous
|
||||
eventFragment.inputs
|
||||
eventFragment.name
|
||||
|
||||
|
||||
// v4
|
||||
const functionSig = interface.functions.transfer.signature
|
||||
const sighash = interface.functions.transfer.sighash
|
||||
|
||||
const eventSig = interface.events.Transfer.signature
|
||||
const topic = interface.events.Transfer.topic
|
||||
|
||||
// v5
|
||||
const functionSig = functionFragment.format()
|
||||
const sighash = interface.getSighash(functionFragment)
|
||||
|
||||
const eventSig = eventFragment.format()
|
||||
const topic = interface.getTopic(eventFragment)
|
||||
```
|
||||
|
||||
|
||||
|
||||
Utilities
|
||||
---------
|
||||
|
||||
|
||||
|
||||
### Renaming
|
||||
|
||||
|
||||
```
|
||||
TODO
|
||||
```
|
||||
|
||||
|
||||
|
||||
Wallet
|
||||
------
|
||||
|
||||
|
||||
|
||||
### Mnemonic Phrases
|
||||
|
||||
|
||||
The **mnemonic** phrase and related properties have been merged into
|
||||
a single `mnemonic` object, which also now includes the `locale`.
|
||||
|
||||
|
||||
```
|
||||
// v4
|
||||
wallet.mnemonic
|
||||
wallet.path
|
||||
|
||||
// v5
|
||||
// - Mnemonic phrase and path are a Mnemonic object
|
||||
// - Note: wallet.mnemonic is null if there is no mnemonic
|
||||
wallet.mnemonic.phrase
|
||||
wallet.mnemonic.path
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** 575f41bfdadff38c736a0bb8d7cad7f9f605f3d2667264dea0ce40a904acb479
|
45
docs/migration/ethers-v4/index.html
Normal file
45
docs/migration/ethers-v4/index.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
37
docs/migration/web3/README.md
Normal file
37
docs/migration/web3/README.md
Normal file
@ -0,0 +1,37 @@
|
||||
-----
|
||||
|
||||
Documentation: [html](https://docs-beta.ethers.io/)
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Migration: From Web3.js
|
||||
=======================
|
||||
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
Contracts
|
||||
---------
|
||||
|
||||
|
||||
|
||||
Providers
|
||||
---------
|
||||
|
||||
|
||||
|
||||
Numbers
|
||||
-------
|
||||
|
||||
|
||||
|
||||
Utilities
|
||||
---------
|
||||
|
||||
|
||||
|
||||
|
||||
-----
|
||||
**Content Hash:** b33d91f3f6d1d4bde7cb12ec26a2fb0adbf37ef5ee5ff2f95894a62f3d108e14
|
11
docs/migration/web3/index.html
Normal file
11
docs/migration/web3/index.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user