Compare commits

...

58 Commits

Author SHA1 Message Date
Richard Moore
0578a88efa Updated dist files. 2022-01-06 03:53:52 -05:00
Richard Moore
3f5bc6ddc1 Fixed case-folding in schemes for ENS avatars (#2500). 2022-01-06 03:46:02 -05:00
Richard Moore
ab13887cda Added Kintsugi network (#2434). 2022-01-06 03:37:13 -05:00
Richard Moore
28f383300c admin: updated dist files 2021-12-24 03:09:45 -05:00
Richard Moore
4ba63acc10 Fix browser random in WebWorkers (#2405). 2021-12-24 02:05:10 -05:00
Richard Moore
3d6a7ec020 Add support for IPFS metadata imageUrl in getAvatar (#2426). 2021-12-24 01:41:41 -05:00
Richard Moore
2f57c6a4ab Do not swallow ENS not supported errors (#2387). 2021-12-24 01:08:54 -05:00
Richard Moore
d3d2953e8d docs: fixed and expanded explanation of fees (#2321) 2021-12-01 13:09:14 -05:00
Richard Moore
0403314023 docs: added note about pure/view for constant methods. 2021-12-01 12:56:21 -05:00
Richard Moore
eb432aa1f4 admin: updated dist files 2021-11-30 19:16:49 -05:00
Richard Moore
617714d196 Fixed test case for getAvatar; url has moved 2021-11-30 19:11:44 -05:00
Richard Moore
42784b8d38 Added basic redirect support. 2021-11-30 19:11:03 -05:00
Richard Moore
50d712d6af admin: updated dist files 2021-11-30 11:19:37 -05:00
Richard Moore
c7e9715758 docs: Fixed ContractFactory.connect return type (#2224, #2257) 2021-11-30 10:24:06 -05:00
Richard Moore
0844de4eb4 Added arbitrum and optimism to networks and providers (#2335). 2021-11-30 10:20:26 -05:00
Richard Moore
caa1983665 docs: Add view/pure to docs (#2336) 2021-11-30 10:03:43 -05:00
Richard Moore
b8391b0e61 Added support for data URLs for avatar metadata. 2021-10-31 00:53:49 -04:00
Richard Moore
1e1c93effa Fixed getAvatar for unconfigured ENS names. 2021-10-31 00:05:27 -04:00
Richard Moore
b145898976 admin: updated dist files 2021-10-20 04:00:49 -04:00
Richard Moore
1bd91615ee Fixed abstract Provider signature issue (#2190). 2021-10-20 03:54:24 -04:00
Richard Moore
d3079745c5 admin: updated dist files 2021-10-19 00:01:37 -04:00
Richard Moore
ecce86125d Added ENS avatar support to provider (#2185). 2021-10-18 23:53:37 -04:00
Richard Moore
5899c8aec0 admin: updated dist files 2021-10-17 23:03:30 -04:00
Richard Moore
3de1b81501 Fixed splitSignature logic for verifying EIP-2930 and EIP-1559 v (#2084). 2021-10-17 22:56:57 -04:00
Richard Moore
ab319f2f4c Include events on ContractFactory deployment transactions (#1334). 2021-10-17 21:38:47 -04:00
Richard Moore
5b94ce2966 admin: updated dist files 2021-10-17 16:23:46 -04:00
Richard Moore
91c577b611 Removed non-english tests from the browser. 2021-10-17 16:18:22 -04:00
Richard Moore
2f363da5ff admin: add changelog 2021-10-16 02:31:02 -04:00
Richard Moore
73a46efea3 admin: updated dist files 2021-10-16 02:29:27 -04:00
Richard Moore
8f3d71dc5f admin: fixed alias script (#1494). 2021-10-16 01:53:12 -04:00
Richard Moore
a5c6a468f4 Better errors when non-string address or ENS name is passed into Contracts or provider methods (#1051). 2021-10-16 01:30:06 -04:00
Richard Moore
8947fd405e Use personal_sign instead of eth_sign for message signing with JsonRpcSigner; added _legacySignMessage for legacy support (#1542, #1840). 2021-10-16 01:11:53 -04:00
Richard Moore
cb43a99405 Removed extra wordlists from the dist files (#2058, #2077). 2021-10-15 22:34:03 -04:00
Richard Moore
b7e61bd67e admin: use https endpoints for NPM registry 2021-10-15 22:03:35 -04:00
Richard Moore
0a8be37b08 Fix issue when Solidity method collises with JavaScript prototype (#1432, #2054, #2120). 2021-10-15 21:32:48 -04:00
Richard Moore
6582ede1ce Add support for Cloudflare Workers (#1886). 2021-10-05 16:57:51 -04:00
Richard Moore
f3c6d819f3 Added more information to some invalid argument errors (#1130). 2021-10-05 16:05:40 -04:00
Richard Moore
bee76a49b2 Fix compile-time error in new TypeScript version. 2021-10-05 15:48:14 -04:00
Richard Moore
68095a48ae Adding customData support to transactions to assist L2 chains (#1761). 2021-10-05 15:47:26 -04:00
Richard Moore
0e5419ec79 Added some explicit null results to previously implicit null results for ENS (#1850). 2021-10-04 12:19:48 -04:00
Richard Moore
a48552a4fb Added BigNumber _difficulty to Block results (#2001, #2036). 2021-10-04 12:09:44 -04:00
Richard Moore
ab806cad15 docs: fixed typo (#1770). 2021-10-04 11:49:33 -04:00
Richard Moore
d5b41ce210 Removed redundant call to normalizing blockTag (1838). 2021-10-04 11:48:36 -04:00
Richard Moore
fb6d141723 docs: fixed typos in comments; h/t @ly0va (#1838). 2021-10-04 11:46:24 -04:00
Richard Moore
7a404fb8ed Fixed isBytes check for invalid length or elements (#1964). 2021-10-04 11:21:43 -04:00
Richard Moore
f8adf82e16 Fixed randomBytes not rejecting NaN as a length (#1977). 2021-10-04 11:08:58 -04:00
Richard Moore
8395cc146f docs: fixed typo in providers README (#1979). 2021-10-04 10:59:37 -04:00
Richard Moore
8fc5914c5a docs: fixed typo in cookbook (#2011). 2021-10-04 10:58:10 -04:00
Richard Moore
cc250b2060 Allow any Networkish for getDefaultProvider (#2031). 2021-10-04 10:57:00 -04:00
Richard Moore
375627f6b1 docs: updated signer prefix info (#2032). 2021-10-04 10:54:31 -04:00
Richard Moore
d67f8fb778 docs: fixed capitalization of MetaMask (#2033). 2021-10-04 10:52:34 -04:00
Richard Moore
45f367512d Stop allowing commas in fixed numbers; left over from legacy comma support (#2083). 2021-10-04 10:48:27 -04:00
Richard Moore
ad87b718a9 docs: fixed typos in comments (#2087). 2021-10-04 10:46:35 -04:00
Richard Moore
48c9e0bf39 Export FallbackProviderConfig (#2121). 2021-10-04 10:44:24 -04:00
Richard Moore
d1d636b503 docs: fixed typo (#2125). 2021-10-04 10:41:54 -04:00
Richard Moore
4166b2753d Updated dist files. 2021-09-16 13:19:43 -04:00
Richard Moore
32a6b2a362 Fix parseUints with excess zeros and fix ReDoS issue (#2016, #1975, #1976). 2021-09-16 13:04:32 -04:00
Richard Moore
f2a32d0d5b docs: added provider.FeeData 2021-08-27 15:35:23 -04:00
620 changed files with 7239 additions and 6591 deletions

View File

@@ -3,6 +3,59 @@ Changelog
This change log is managed by `admin/cmds/update-versions` but may be manually updated.
ethers/v5.5.3 (2022-01-06 03:52)
--------------------------------
- Fixed case-folding in schemes for ENS avatars. ([#2500](https://github.com/ethers-io/ethers.js/issues/2500); [3f5bc6d](https://github.com/ethers-io/ethers.js/commit/3f5bc6ddc1013f0a5974f2ee6f542d6c91480c13))
- Added Kintsugi network. ([#2434](https://github.com/ethers-io/ethers.js/issues/2434); [ab13887](https://github.com/ethers-io/ethers.js/commit/ab13887cda3939703dc1f7e27d139ef6001b7dd2))
- Fix browser random in WebWorkers. ([#2405](https://github.com/ethers-io/ethers.js/issues/2405); [4ba63ac](https://github.com/ethers-io/ethers.js/commit/4ba63acc107fdd0a6d6ef3e27349e65edb007447))
- Add support for IPFS metadata imageUrl in getAvatar. ([#2426](https://github.com/ethers-io/ethers.js/issues/2426); [3d6a7ec](https://github.com/ethers-io/ethers.js/commit/3d6a7ec020eacd993b4b0fd3274574de3ddcc257))
- Do not swallow ENS not supported errors. ([#2387](https://github.com/ethers-io/ethers.js/issues/2387); [2f57c6a](https://github.com/ethers-io/ethers.js/commit/2f57c6a4ab44083b2c03f5e57b2702ab7078d286))
ethers/v5.5.2 (2021-11-30 19:16)
--------------------------------
- Fixed test case for getAvatar; url has moved ([617714d](https://github.com/ethers-io/ethers.js/commit/617714d19632c7b4789f042ef8357f858421fbae))
- Added basic redirect support. ([42784b8](https://github.com/ethers-io/ethers.js/commit/42784b8d38a96170d19ea8adcbc42ebf7415804c))
- Added arbitrum and optimism to networks and providers. ([#2335](https://github.com/ethers-io/ethers.js/issues/2335); [0844de4](https://github.com/ethers-io/ethers.js/commit/0844de4eb45eb4170fafb6f2a239b53b6be22f1c))
- Added support for data URLs for avatar metadata. ([b8391b0](https://github.com/ethers-io/ethers.js/commit/b8391b0e61bf3627702668920c4fd6506f9bdc60))
- Fixed getAvatar for unconfigured ENS names. ([1e1c93e](https://github.com/ethers-io/ethers.js/commit/1e1c93effa083765be52f3dee10400a9b3eeb003))
ethers/v5.5.1 (2021-10-20 03:59)
--------------------------------
- Fixed abstract Provider signature issue. ([#2190](https://github.com/ethers-io/ethers.js/issues/2190); [1bd9161](https://github.com/ethers-io/ethers.js/commit/1bd91615eedcb34a24fca04aa93a9aac394968ed))
ethers/v5.5.0 (2021-10-19 00:01)
--------------------------------
- Added ENS avatar support to provider. ([#2185](https://github.com/ethers-io/ethers.js/issues/2185); [ecce861](https://github.com/ethers-io/ethers.js/commit/ecce86125d87ef5258406bde2fff5bc8c9ff3141))
- Fixed splitSignature logic for verifying EIP-2930 and EIP-1559 v. ([#2084](https://github.com/ethers-io/ethers.js/issues/2084); [3de1b81](https://github.com/ethers-io/ethers.js/commit/3de1b815014b10d223a42e524fe9c25f9087293b))
- Include events on ContractFactory deployment transactions. ([#1334](https://github.com/ethers-io/ethers.js/issues/1334); [ab319f2](https://github.com/ethers-io/ethers.js/commit/ab319f2f4c365d4cd1b1e17e577ecd18a7a89276))
- admin: fixed alias script. ([#1494](https://github.com/ethers-io/ethers.js/issues/1494); [8f3d71d](https://github.com/ethers-io/ethers.js/commit/8f3d71dc5fd0e91407737a4b82c58c31269ed2be))
- Better errors when non-string address or ENS name is passed into Contracts or provider methods. ([#1051](https://github.com/ethers-io/ethers.js/issues/1051); [a5c6a46](https://github.com/ethers-io/ethers.js/commit/a5c6a468f4a7ad29fb5277e08c6b8b208383a575))
- Use personal_sign instead of eth_sign for message signing with JsonRpcSigner; added _legacySignMessage for legacy support. ([#1542](https://github.com/ethers-io/ethers.js/issues/1542), [#1840](https://github.com/ethers-io/ethers.js/issues/1840); [8947fd4](https://github.com/ethers-io/ethers.js/commit/8947fd405e3aea07f6db958d89a3ad39abe3a25a))
- Removed extra wordlists from the dist files. ([#2058](https://github.com/ethers-io/ethers.js/issues/2058), [#2077](https://github.com/ethers-io/ethers.js/issues/2077); [cb43a99](https://github.com/ethers-io/ethers.js/commit/cb43a99405cdc5bdcc875efc1821e00e55447791))
- Fix issue when Solidity method collises with JavaScript prototype. ([#1432](https://github.com/ethers-io/ethers.js/issues/1432), [#2054](https://github.com/ethers-io/ethers.js/issues/2054), [#2120](https://github.com/ethers-io/ethers.js/issues/2120); [0a8be37](https://github.com/ethers-io/ethers.js/commit/0a8be37b087470d9354f387d7c439cb0166eaf4d))
- Add support for Cloudflare Workers. ([#1886](https://github.com/ethers-io/ethers.js/issues/1886); [6582ede](https://github.com/ethers-io/ethers.js/commit/6582ede1ce46be0b3abafb120e052b95a2d172b3))
- Added more information to some invalid argument errors. ([#1130](https://github.com/ethers-io/ethers.js/issues/1130); [f3c6d81](https://github.com/ethers-io/ethers.js/commit/f3c6d819f34b6d93f53d98b9f337ade5aa37a594))
- Fix compile-time error in new TypeScript version. ([bee76a4](https://github.com/ethers-io/ethers.js/commit/bee76a49b2e5f95ea2eab49aabf5e44cb4ca794b))
- Adding customData support to transactions to assist L2 chains. ([#1761](https://github.com/ethers-io/ethers.js/issues/1761); [68095a4](https://github.com/ethers-io/ethers.js/commit/68095a48ae19ed06cbcf2f415f1fcbda90d4b2ae))
- Added some explicit null results to previously implicit null results for ENS. ([#1850](https://github.com/ethers-io/ethers.js/issues/1850); [0e5419e](https://github.com/ethers-io/ethers.js/commit/0e5419ec79cb18d82bab8c47bfa3ab4a21cfd293))
- Added BigNumber _difficulty to Block results. ([#2001](https://github.com/ethers-io/ethers.js/issues/2001), [#2036](https://github.com/ethers-io/ethers.js/issues/2036); [a48552a](https://github.com/ethers-io/ethers.js/commit/a48552a4fb85a08178d07437a3934db98b7d0736))
- Removed redundant call to normalizing blockTag (1838). ([d5b41ce](https://github.com/ethers-io/ethers.js/commit/d5b41ce210c0f22dd795749810f6ce798f71a00f))
- Fixed isBytes check for invalid length or elements. ([#1964](https://github.com/ethers-io/ethers.js/issues/1964); [7a404fb](https://github.com/ethers-io/ethers.js/commit/7a404fb8ed95a99baab8f3b384f438b697fa5d76))
- Fixed randomBytes not rejecting NaN as a length. ([#1977](https://github.com/ethers-io/ethers.js/issues/1977); [f8adf82](https://github.com/ethers-io/ethers.js/commit/f8adf82e16aaad1a7c1750e7f2e3a9f8073b73e1))
- Allow any Networkish for getDefaultProvider. ([#2031](https://github.com/ethers-io/ethers.js/issues/2031); [cc250b2](https://github.com/ethers-io/ethers.js/commit/cc250b2060451e0ee6b1cf3edb6b005f9eee9c61))
- Stop allowing commas in fixed numbers; left over from legacy comma support. ([#2083](https://github.com/ethers-io/ethers.js/issues/2083); [45f3675](https://github.com/ethers-io/ethers.js/commit/45f367512d1d5dccfd06fad9cc8688e4d0cccdb8))
- Export FallbackProviderConfig. ([#2121](https://github.com/ethers-io/ethers.js/issues/2121); [48c9e0b](https://github.com/ethers-io/ethers.js/commit/48c9e0bf39eec9b5b30ab7cd5685effdccaa1b1a))
ethers/v5.4.7 (2021-09-16 13:17)
--------------------------------
- Fix parseUints with excess zeros and fix ReDoS issue. ([#2016](https://github.com/ethers-io/ethers.js/issues/2016), [#1975](https://github.com/ethers-io/ethers.js/issues/1975), [#1976](https://github.com/ethers-io/ethers.js/issues/1976); [32a6b2a](https://github.com/ethers-io/ethers.js/commit/32a6b2a362815eb85ce3f3abad5adf92f2b80e10))
ethers/v5.4.6 (2021-08-27 15:34)
--------------------------------
@@ -15,7 +68,7 @@ ethers/v5.4.6 (2021-08-27 15:34)
ethers/v5.4.5 (2021-08-18 03:05)
--------------------------------
- Fxied getBlockWithTransactions results (1858). ([78e4273](https://github.com/ethers-io/ethers.js/commit/78e4273a327d12da9a1ec008d3f2146d97385921))
- Fxied getBlockWithTransactions results (#1858). ([78e4273](https://github.com/ethers-io/ethers.js/commit/78e4273a327d12da9a1ec008d3f2146d97385921))
ethers/v5.4.4 (2021-08-04 01:37)
--------------------------------

View File

@@ -23,7 +23,7 @@ Consumes the output of the Solidity compiler, extracting the ABI
and bytecode from it, allowing for the various formats the solc
compiler has emitted over its life.
_property: contractFactory.connect(signer) => [[Contract]] @<ContractFactory-connect>
_property: contractFactory.connect(signer) => [[ContractFactory]] @<ContractFactory-connect>
Returns a **new instance** of the ContractFactory with the same //interface//
and //bytecode//, but with a different //signer//.

View File

@@ -98,11 +98,12 @@ at run-time during the **Contract** constructor.
_heading: Read-Only Methods (constant) @<Contract--readonly>
A constant method is read-only and evaluates a small amount of EVM
code against the current blockchain state and can be computed by
asking a single node, which can return a result. It is therefore
free and does not require any ether, but **cannot make changes** to
the blockchain state..
A constant method (denoted by ``pure`` or ``view`` in Solidity)
is read-only and evaluates a small amount of EVM code against the
current blockchain state and can be computed by asking a single
node, which can return a result. It is therefore free and does
not require any ether, but **cannot make changes** to the
blockchain state..
_property: contract.METHOD_NAME(...args [, overrides ]) => Promise<any> @<Contract-functionsCall>
The type of the result depends on the ABI. If the method returns a single

View File

@@ -116,7 +116,7 @@ _code: Example: Override the ENS registry @lang<script>
const network = {
name: "dev",
chianId: 1337,
chainId: 1337,
ensAddress: customEnsAddress
};

View File

@@ -240,6 +240,27 @@ gasPrice = await provider.getGasPrice()
utils.formatUnits(gasPrice, "gwei")
//_log:
_property: provider.getFeeData() => Promise<[[providers-FeeData]]> @<Provider-getFeeData> @SRC<abstract-provider>
Returns the current recommended [[providers-FeeData]] to use in a transaction.
For an EIP-1559 transaction, the ``maxFeePerGas`` and ``maxPriorityFeePerGas``
should be used.
For legacy transactions and networks which do not support EIP-1559, the ``gasPrice``
should be used.
_code: @lang<javascript>
// The gas price (in wei)...
feeData = await provider.getFeeData()
//_log: feeData
// ...often these values are easier to understand or
// display to the user in gwei
//_result:
utils.formatUnits(feeData.maxFeePerGas, "gwei")
//_log:
_property: provider.ready => Promise<[[providers-Network]]> @<Provider-ready> @src<providers/base-provider>
Returns a Promise which will stall until the network has heen established,
ignoring errors due to the target node not being active yet.

View File

@@ -34,6 +34,23 @@ _property: network.ensAddress => string<[[address]]>
The address at which the ENS registry is deployed on this network.
_subsection: FeeData @<providers-FeeData>
A **FeeData** object encapsulates the necessary fee data required
to send a transaction, based on the best available recommendations.
_property: feeData.gasPrice => [[BigNumber]]
The gasPrice to use for legacy transactions or networks which do not
support EIP-1559.
_property: feeData.maxFeePerGas => [[BigNumber]]
The ``maxFeePerGas`` to use for a transaction. This is based on the
most recent block's ``baseFee``.
_property: feeData.maxPriorityFeePerGas => [[BigNumber]]
The ``maxPriorityFeePerGas`` to use for a transaction. This accounts
for the uncle risk and for the majority of current MEV risk.
_subsection: Block @<providers-Block>
_property: block.hash => string<[[DataHexString]]<32>>
@@ -193,7 +210,7 @@ _property: transactionRequest.gasLimit => [[BigNumber]] | Promise<[[BigNumber]]>
The maximum amount of gas this transaction is permitted to use.
If left unspecified, ethers will use ``estimateGas`` to determine the value
to use. For transactions with unpredicatable gas estiamtes, this may be required
to use. For transactions with unpredicatable gas estimates, this may be required
to specify explicitly.
_property: transactionRequest.gasPrice => [[BigNumber]] | Promise<[[BigNumber]]>
@@ -204,7 +221,7 @@ if ``maxFeePerGas`` or ``maxPriorityFeePerGas`` is given.
_property: transactionRequest.maxFeePerGas => [[BigNumber]] | Promise<[[BigNumber]]>
The maximum price (in wei) per unit of gas this transaction will pay for the
[[link-eip-1559]] base fee.
combined [[link-eip-1559]] block's base fee and this transaction's priority fee.
Most developers should leave this unspecified and use the default value that
ethers determines from the network.
@@ -213,9 +230,10 @@ This may not be specified for transactions with ``type`` set to ``0`` or if ``ga
is specified..
_property: transactionRequest.maxPriorityFeePerGas => [[BigNumber]] | Promise<[[BigNumber]]>
The price (in wei) per unit of gas this transaction will pay for the
[[link-eip-1559]] priority fee. This is **included in** the ``maxFeePerGass``,
so this will **not affect** the total maximum cost set with ``maxFeePerGas``.
The price (in wei) per unit of gas this transaction will allow in addition to
the [[link-eip-1559]] block's base fee to bribe miners into giving this transaction
priority. This is **included in** the ``maxFeePerGas``, so this will **not affect**
the total maximum cost set with ``maxFeePerGas``.
Most developers should leave this unspecified and use the default value that
ethers determines from the network.

View File

@@ -74,7 +74,7 @@ _property: signer.signMessage(message) => Promise<string<[RawSignature](signatur
This returns a Promise which resolves to the [[signature-raw]]
of //message//.
A signed message is prefixd with ``"\\x19Ethereum signed message:\\n"`` and
A signed message is prefixd with ``"\\x19Ethereum Signed Message:\\n"`` and
the length of the message, using the [hashMessage](utils-hashMessage)
method, so that it is [EIP-191](link-eip-191) compliant. If recovering
the address in Solidity, this prefix will be required to create a matching

View File

@@ -237,7 +237,7 @@ module.exports = {
"link-infura": { name: "INFURA", url: "https:/\/infura.io" },
"link-javascriptcore": { name: "JavaScriptCore", url: "https:/\/developer.apple.com/documentation/javascriptcore?language=objc" },
"link-ledger": "https:/\/www.ledger.com",
"link-metamask": { name: "Metamask", url: "https:/\/metamask.io/" },
"link-metamask": { name: "MetaMask", url: "https:/\/metamask.io/" },
"link-otto": "https:/\/github.com/robertkrimen/otto",
"link-parity": { name: "Parity", url: "https:/\/www.parity.io" },
"link-pocket": { name: "Pocket Network", url: "https:/\/pokt.network" },

View File

@@ -11,7 +11,7 @@ function getRawTransaction(tx) {
}
// Extract the relevant parts of the transaction and signature
const txFields = "accessList chainId data gasPrice gasLimit maxFeePerGer maxPriorityFeePerGas nonce to type value".split(" ");
const txFields = "accessList chainId data gasPrice gasLimit maxFeePerGas maxPriorityFeePerGas nonce to type value".split(" ");
const sigFields = "v r s".split(" ");
// Seriailze the signed transaction

View File

@@ -73,7 +73,7 @@ $Contract: A Contract is an abstraction which represents a connection to a
| **Contract** | $Contract |
_subsection: Connecting to Ethereum: Metamask @<getting-started--connecting>
_subsection: Connecting to Ethereum: MetaMask @<getting-started--connecting>
The quickest and easiest way to experiment and begin developing on
Ethereum is to use [[link-metamask]], which is a browser extension
@@ -82,13 +82,13 @@ that provides:
- A connection to the Ethereum network (a [[Provider]])
- Holds your private key and can sign things (a [[Signer]])
_code: Connecting to Metamask @lang<script>
_code: Connecting to MetaMask @lang<script>
// A Web3Provider wraps a standard Web3 provider, which is
// what Metamask injects as window.ethereum into each page
// what MetaMask injects as window.ethereum into each page
const provider = new ethers.providers.Web3Provider(window.ethereum)
// The Metamask plugin also allows signing transactions to
// The MetaMask plugin also allows signing transactions to
// send ether and pay to change state within the blockchain.
// For this, you need the account signer...
const signer = provider.getSigner()

View File

@@ -69,7 +69,7 @@ signature = await signer.signMessage('Some data')
_subsection: Contracts
A contract object is an abstraction of a smart contract on the Ethereum Network. It allows for easy interaction with the smart contact.
A contract object is an abstraction of a smart contract on the Ethereum Network. It allows for easy interaction with the smart contract.
_heading: Deploying a Contract

View File

@@ -5,23 +5,23 @@ const path_1 = require("./path");
const utils_1 = require("./utils");
function setupConfig(outDir, moduleType, targetType) {
// Configure the tsconfit.package.json...
const path = path_1.resolve("tsconfig.package.json");
const content = utils_1.loadJson(path);
const path = (0, path_1.resolve)("tsconfig.package.json");
const content = (0, utils_1.loadJson)(path);
content.compilerOptions.module = moduleType;
content.compilerOptions.target = targetType;
utils_1.saveJson(path, content, true);
(0, utils_1.saveJson)(path, content, true);
// Configure the browser field for every pacakge, copying the
// browser.umd filed for UMD and browser.esm for ESM
path_1.dirnames.forEach((dirname) => {
const filename = path_1.getPackageJsonPath(dirname);
const info = utils_1.loadJson(filename);
const filename = (0, path_1.getPackageJsonPath)(dirname);
const info = (0, utils_1.loadJson)(filename);
if (info._ethers_nobuild) {
return;
}
let path = path_1.resolve("packages", dirname, "tsconfig.json");
let content = utils_1.loadJson(path);
let path = (0, path_1.resolve)("packages", dirname, "tsconfig.json");
let content = (0, utils_1.loadJson)(path);
content.compilerOptions.outDir = outDir;
utils_1.saveJson(path, content, true);
(0, utils_1.saveJson)(path, content, true);
});
}
function setupBuild(buildModule) {

View File

@@ -39,7 +39,7 @@ const npm = __importStar(require("./npm"));
const path_1 = require("./path");
const run_1 = require("./run");
const utils_1 = require("./utils");
const changelogPath = path_1.resolve("CHANGELOG.md");
const changelogPath = (0, path_1.resolve)("CHANGELOG.md");
function generate() {
return __awaiter(this, void 0, void 0, function* () {
const lines = fs_1.default.readFileSync(changelogPath).toString().trim().split("\n");
@@ -59,11 +59,11 @@ function generate() {
const published = yield npm.getPackage("ethers");
if (versions.indexOf(version) >= 0) {
const line = `Version ${version} already in CHANGELOG. Please edit before committing.`;
console.log(log_1.colorify.red(utils_1.repeat("=", line.length)));
console.log(log_1.colorify.red((0, utils_1.repeat)("=", line.length)));
console.log(log_1.colorify.red(line));
console.log(log_1.colorify.red(utils_1.repeat("=", line.length)));
console.log(log_1.colorify.red((0, utils_1.repeat)("=", line.length)));
}
const gitResult = yield run_1.run("git", ["log", (published.gitHead + "..")]);
const gitResult = yield (0, run_1.run)("git", ["log", (published.gitHead + "..")]);
if (!gitResult.ok) {
console.log(gitResult);
throw new Error("Error running git log");
@@ -78,7 +78,7 @@ function generate() {
});
}
else if (line.toLowerCase().substring(0, 5) === "date:") {
changes[changes.length - 1].date = utils_1.getDateTime(new Date(line.substring(5).trim()));
changes[changes.length - 1].date = (0, utils_1.getDateTime)(new Date(line.substring(5).trim()));
}
else if (line.substring(0, 1) === " ") {
line = line.trim();
@@ -92,9 +92,9 @@ function generate() {
for (let i = 0; i < firstLine; i++) {
output.push(lines[i]);
}
const newTitle = `ethers/v${version} (${utils_1.getDateTime(new Date())})`;
const newTitle = `ethers/v${version} (${(0, utils_1.getDateTime)(new Date())})`;
output.push(newTitle);
output.push(utils_1.repeat("-", newTitle.length));
output.push((0, utils_1.repeat)("-", newTitle.length));
output.push("");
changes.forEach((change) => {
let body = change.body.trim();

View File

@@ -65,7 +65,7 @@ const path_1 = require("../path");
accum[name] = version;
return accum;
}, {});
const packageJsonPath = path_1.getPackageJsonPath(dirname);
const packageJsonPath = (0, path_1.getPackageJsonPath)(dirname);
local.updateJson(packageJsonPath, {
dependencies: deps,
version: newVersion

View File

@@ -40,8 +40,8 @@ const npm = __importStar(require("../npm"));
const utils_1 = require("../utils");
(function () {
return __awaiter(this, void 0, void 0, function* () {
const common = utils_1.loadJson(path_1.resolve("package.json")).common;
const progress = log_1.getProgressBar(log_1.colorify.bold("Bumping package.json versions"));
const common = (0, utils_1.loadJson)((0, path_1.resolve)("package.json")).common;
const progress = (0, log_1.getProgressBar)(log_1.colorify.bold("Bumping package.json versions"));
const latestVersions = {};
let updated = false;
const output = [];
@@ -49,7 +49,7 @@ const utils_1 = require("../utils");
for (let i = 0; i < path_1.dirnames.length; i++) {
progress(i / path_1.dirnames.length);
const dirname = path_1.dirnames[i];
const packageJsonPath = path_1.getPackageJsonPath(dirname);
const packageJsonPath = (0, path_1.getPackageJsonPath)(dirname);
// Set the common elements to the package.json
local.updateJson(packageJsonPath, common, true);
const pLocal = local.getPackage(dirname);
@@ -68,7 +68,7 @@ const utils_1 = require("../utils");
output.push([
" ",
log_1.colorify.blue(pLocal.name),
utils_1.repeat(" ", 47 - pLocal.name.length - pNpm.version.length),
(0, utils_1.repeat)(" ", 47 - pLocal.name.length - pNpm.version.length),
pNpm.version,
log_1.colorify.bold(" => "),
log_1.colorify.green(version)
@@ -80,13 +80,13 @@ const utils_1 = require("../utils");
// Write out the _version.ts
if (!pLocal._ethers_nobuild) {
const code = "export const version = " + JSON.stringify(dirname + "/" + version) + ";\n";
fs_1.default.writeFileSync(path_1.resolve(path_1.getPackagePath(dirname), "src.ts/_version.ts"), code);
fs_1.default.writeFileSync((0, path_1.resolve)((0, path_1.getPackagePath)(dirname), "src.ts/_version.ts"), code);
}
}
progress(1);
if (updated) {
const filename = path_1.resolve("packages/ethers/package.json");
const info = utils_1.loadJson(filename);
const filename = (0, path_1.resolve)("packages/ethers/package.json");
const info = (0, utils_1.loadJson)(filename);
Object.keys(info.dependencies).forEach((name) => {
const version = latestVersions[name];
if (name == null) {
@@ -94,7 +94,7 @@ const utils_1 = require("../utils");
}
info.dependencies[name] = version;
});
utils_1.saveJson(filename, info);
(0, utils_1.saveJson)(filename, info);
}
output.forEach((line) => { console.log(line); });
});

View File

@@ -38,10 +38,10 @@ const config = {
console.log(log_1.colorify.bold(`Bundling Testcase Data...`));
const data = { "_": JSON.stringify({ name: "browser-fs", config: config }) };
config.dirs.forEach((dirname) => {
let fulldirname = path_2.resolve("packages/testcases", dirname);
let fulldirname = (0, path_2.resolve)("packages/testcases", dirname);
fs_1.default.readdirSync(fulldirname).forEach((filename) => {
const key = path_1.join(dirname, filename);
const content = fs_1.default.readFileSync(path_1.join(fulldirname, filename));
const key = (0, path_1.join)(dirname, filename);
const content = fs_1.default.readFileSync((0, path_1.join)(fulldirname, filename));
if (filename.split(".").pop() === "gz") {
const contentData = zlib_1.default.gunzipSync(content);
data[key] = String(contentData.length) + "," + zlib_1.default.deflateRawSync(contentData).toString("base64");
@@ -52,15 +52,15 @@ const config = {
//console.log(` - Added ${ key } (${ data[key].length } bytes)`);
});
});
utils_1.mkdir(path_2.resolve("packages/testcases/lib"));
utils_1.mkdir(path_2.resolve("packages/testcases/lib._esm"));
utils_1.mkdir(path_2.resolve("packages/testcases/lib.esm"));
(0, utils_1.mkdir)((0, path_2.resolve)("packages/testcases/lib"));
(0, utils_1.mkdir)((0, path_2.resolve)("packages/testcases/lib._esm"));
(0, utils_1.mkdir)((0, path_2.resolve)("packages/testcases/lib.esm"));
// We write it out to all needed places
fs_1.default.writeFileSync(path_2.resolve("packages/testcases/lib/browser-data.json"), JSON.stringify(data));
fs_1.default.writeFileSync(path_2.resolve("packages/testcases/lib._esm/browser-data.json"), JSON.stringify(data));
fs_1.default.writeFileSync(path_2.resolve("packages/testcases/lib.esm/browser-data.json"), JSON.stringify(data));
fs_1.default.writeFileSync((0, path_2.resolve)("packages/testcases/lib/browser-data.json"), JSON.stringify(data));
fs_1.default.writeFileSync((0, path_2.resolve)("packages/testcases/lib._esm/browser-data.json"), JSON.stringify(data));
fs_1.default.writeFileSync((0, path_2.resolve)("packages/testcases/lib.esm/browser-data.json"), JSON.stringify(data));
// Write it to the TypeScript source last, in case it is running it will
// be regenerated overwriting the above files, but with identical content
fs_1.default.writeFileSync(path_2.resolve("packages/testcases/src.ts/browser-data.json"), JSON.stringify(data));
fs_1.default.writeFileSync((0, path_2.resolve)("packages/testcases/src.ts/browser-data.json"), JSON.stringify(data));
});
})();

View File

@@ -15,6 +15,6 @@ const github_1 = require("../github");
return __awaiter(this, void 0, void 0, function* () {
const user = yield config_1.config.get("github-user");
const password = yield config_1.config.get("github-readonly");
yield github_1.syncIssues(user, password);
yield (0, github_1.syncIssues)(user, password);
});
})();

View File

@@ -24,8 +24,8 @@ const log_1 = require("../log");
function alias(name) {
return __awaiter(this, void 0, void 0, function* () {
console.log(` Aliasing: ${name}`);
const baseDir = path_2.resolve("packages", name);
const info = utils_1.loadJson(path_2.resolve(baseDir, "package.json"));
const baseDir = (0, path_2.resolve)("packages", name);
const info = (0, utils_1.loadJson)((0, path_2.resolve)(baseDir, "package.json"));
const replacements = info["_ethers.alias"] || {};
const skip = Object.keys(replacements).reduce((accum, key) => {
const replace = replacements[key];
@@ -37,10 +37,10 @@ function alias(name) {
}, ({}));
const transforms = [];
const recurse = function (input, output) {
fs_1.default.readdirSync(path_1.join(baseDir, input)).forEach((filename) => {
const stat = fs_1.default.statSync(path_1.join(baseDir, input, filename));
fs_1.default.readdirSync((0, path_1.join)(baseDir, input)).forEach((filename) => {
const stat = fs_1.default.statSync((0, path_1.join)(baseDir, input, filename));
if (stat.isDirectory()) {
recurse(path_1.join(input, filename), path_1.join(output, filename));
recurse((0, path_1.join)(input, filename), (0, path_1.join)(output, filename));
return;
}
if (skip[filename]) {
@@ -61,7 +61,7 @@ function alias(name) {
if (replace) {
inputFilename = replace;
transform = function (content) {
content = content.replace(/(\/\/# sourceMappingURL=)(.*)$/g, (all, prefix, mapFilename) => {
content = content.replace(/^(\/\/# sourceMappingURL=)(.*)$/mg, (all, prefix, mapFilename) => {
return prefix + filename + ".map";
});
return content;
@@ -118,19 +118,19 @@ function alias(name) {
};
}
}
transforms.push({ input: path_1.join(input, inputFilename), output: path_1.join(output, filename), transform });
transforms.push({ input: (0, path_1.join)(input, inputFilename), output: (0, path_1.join)(output, filename), transform });
});
};
recurse("lib._esm", "lib.esm");
transforms.forEach(({ input, output, transform }) => {
const sourceFile = path_1.join(baseDir, input);
const sourceFile = (0, path_1.join)(baseDir, input);
let content = fs_1.default.readFileSync(sourceFile).toString();
if (transform) {
content = transform(content);
}
const targetFile = path_1.join(baseDir, output);
const targetDir = path_1.dirname(targetFile);
utils_1.mkdir(targetDir);
const targetFile = (0, path_1.join)(baseDir, output);
const targetDir = (0, path_1.dirname)(targetFile);
(0, utils_1.mkdir)(targetDir);
fs_1.default.writeFileSync(targetFile, content);
});
});
@@ -138,9 +138,9 @@ function alias(name) {
(function () {
return __awaiter(this, void 0, void 0, function* () {
console.log(log_1.colorify.bold(`Aliasing Node ESM to Browser ESM...`));
const dirnames = depgraph_1.getOrdered(true);
const dirnames = (0, depgraph_1.getOrdered)(true);
for (let i = 0; i < dirnames.length; i++) {
//if (dirnames[i] !== "base64") { continue; }
//if (dirnames[i] !== "signing-key") { continue; }
yield alias(dirnames[i]);
}
});

View File

@@ -14,11 +14,11 @@ const local_1 = require("../local");
const log_1 = require("../log");
(function () {
return __awaiter(this, void 0, void 0, function* () {
const dependencies = local_1.getDependencies(null, (name) => {
return !path_1.isEthers(name);
const dependencies = (0, local_1.getDependencies)(null, (name) => {
return !(0, path_1.isEthers)(name);
});
console.log(log_1.colorify.bold(`Hoisting ${Object.keys(dependencies).length} dependencies into root package...`));
local_1.updateJson(path_1.dirs.rootPackageJsonPath, { dependencies });
(0, local_1.updateJson)(path_1.dirs.rootPackageJsonPath, { dependencies });
});
})().catch((error) => {
console.log(`Error running ${process.argv[0]}: ${error.message}`);

View File

@@ -33,28 +33,28 @@ function link(existing, path) {
}
}
// Link
const dir = path_1.dirname(path);
utils_1.mkdir(dir);
const dir = (0, path_1.dirname)(path);
(0, utils_1.mkdir)(dir);
fs_1.default.symlinkSync(existing, path, "junction");
}
(function () {
return __awaiter(this, void 0, void 0, function* () {
console.log(log_1.colorify.bold(`Linking ${path_2.packages.length} package node_modules rat nests...`));
const nodeModulesBase = path_1.resolve(path_2.dirs.root, ".package_node_modules");
const nodeModulesBase = (0, path_1.resolve)(path_2.dirs.root, ".package_node_modules");
// Make a symlink in the ROOT/node_mpdules to each package in this repo
path_2.packages.forEach((name) => {
// e.g. /node_modules/@ethersproject/abi => /packages/abi
link(path_2.getPackagePath(name), path_1.resolve(path_2.dirs.root, "node_modules", name));
link((0, path_2.getPackagePath)(name), (0, path_1.resolve)(path_2.dirs.root, "node_modules", name));
// e.g. /packages/abi/node_modules => /.package_node_modules/abi/
const nodeModules = path_1.resolve(nodeModulesBase, path_2.getDirname(name));
utils_1.mkdir(nodeModules);
link(nodeModules, path_1.resolve(path_2.getPackagePath(name), "node_modules"));
const nodeModules = (0, path_1.resolve)(nodeModulesBase, (0, path_2.getDirname)(name));
(0, utils_1.mkdir)(nodeModules);
link(nodeModules, (0, path_1.resolve)((0, path_2.getPackagePath)(name), "node_modules"));
});
path_2.packages.forEach((name) => {
const nodeModules = path_1.resolve(nodeModulesBase, path_2.getDirname(name));
const deps = local_1.getDependencies(name);
const nodeModules = (0, path_1.resolve)(nodeModulesBase, (0, path_2.getDirname)(name));
const deps = (0, local_1.getDependencies)(name);
Object.keys(deps).forEach((name) => {
link(path_1.resolve(path_2.dirs.root, "node_modules", name), path_1.resolve(nodeModules, name));
link((0, path_1.resolve)(path_2.dirs.root, "node_modules", name), (0, path_1.resolve)(nodeModules, name));
});
});
});

View File

@@ -15,7 +15,7 @@ const utils_1 = require("../utils");
(function () {
return __awaiter(this, void 0, void 0, function* () {
const versions = path_1.dirnames.reduce((accum, dirname) => {
const pkg = local_1.getPackage(dirname);
const pkg = (0, local_1.getPackage)(dirname);
accum[pkg.name] = pkg.version;
return accum;
}, ({}));
@@ -25,8 +25,8 @@ const utils_1 = require("../utils");
return;
}
console.log(dirname);
const path = path_1.resolve("packages", dirname, "package.json");
const json = utils_1.loadJson(path);
const path = (0, path_1.resolve)("packages", dirname, "package.json");
const json = (0, utils_1.loadJson)(path);
for (const name in (json.dependencies || {})) {
const version = json.dependencies[name];
const target = (versions[name] ? ("^" + versions[name]) : version);
@@ -35,7 +35,7 @@ const utils_1 = require("../utils");
}
json.dependencies[name] = target;
}
utils_1.saveJson(path, json, true);
(0, utils_1.saveJson)(path, json, true);
});
});
})();

0
misc/admin/lib/cmds/peg-version.d.ts vendored Normal file
View File

View File

@@ -0,0 +1,16 @@
/*
import { dirnames, getPackage } from "../local";
import { colorify } from "../log";
const dirname = process.argv[2];
if (dirname == null) {
console.log("Usage: peg-version DIRNAME");
process.exit(1);
}
(async function(dirname) {
const { name, version } = getPackage(dirname);
console.log(colorify.bold(`Pegging ${ name } to ${ version }...`));
})(dirname);
*/

View File

@@ -89,10 +89,10 @@ function invalidate(cloudfront, distributionId) {
exports.invalidate = invalidate;
(function () {
return __awaiter(this, void 0, void 0, function* () {
const dirnames = depgraph_1.getOrdered();
const dirnames = (0, depgraph_1.getOrdered)();
// @TODO: Fail if there are any untracked files or unchecked in files
const publish = {};
const progressUpdate = log_1.getProgressBar(log_1.colorify.bold("Finding updated packages..."));
const progressUpdate = (0, log_1.getProgressBar)(log_1.colorify.bold("Finding updated packages..."));
for (let i = 0; i < dirnames.length; i++) {
progressUpdate(i / dirnames.length);
let dirname = dirnames[i];
@@ -103,8 +103,8 @@ exports.invalidate = invalidate;
continue;
}
// Get the latest commit this package was modified at
const path = path_1.resolve("packages", dirname);
const gitHead = yield git_1.getGitTag(path);
const path = (0, path_1.resolve)("packages", dirname);
const gitHead = yield (0, git_1.getGitTag)(path);
if (gitHead == null) {
throw new Error("hmmm...");
}
@@ -119,7 +119,7 @@ exports.invalidate = invalidate;
console.log(log_1.colorify.bold(`Found ${Object.keys(publish).length} updated pacakges...`));
Object.keys(publish).forEach((dirname) => {
const info = publish[dirname];
console.log(` ${log_1.colorify.blue(info.name)} ${utils_1.repeat(" ", 50 - info.name.length - info.oldVersion.length)} ${info.oldVersion} ${log_1.colorify.bold("=>")} ${log_1.colorify.green(info.newVersion)}`);
console.log(` ${log_1.colorify.blue(info.name)} ${(0, utils_1.repeat)(" ", 50 - info.name.length - info.oldVersion.length)} ${info.oldVersion} ${log_1.colorify.bold("=>")} ${log_1.colorify.green(info.newVersion)}`);
});
const publishNames = Object.keys(publish);
publishNames.sort((a, b) => (dirnames.indexOf(a) - dirnames.indexOf(b)));
@@ -149,17 +149,17 @@ exports.invalidate = invalidate;
console.log(log_1.colorify.bold("Publishing:"));
for (let i = 0; i < publishNames.length; i++) {
const dirname = publishNames[i];
const path = path_1.resolve("packages", dirname);
const pathJson = path_1.resolve("packages", dirname, "package.json");
const path = (0, path_1.resolve)("packages", dirname);
const pathJson = (0, path_1.resolve)("packages", dirname, "package.json");
const { gitHead, name, newVersion } = publish[dirname];
console.log(` ${log_1.colorify.blue(name)} @ ${log_1.colorify.green(newVersion)}`);
local.updateJson(pathJson, { gitHead: gitHead }, true);
const info = utils_1.loadJson(pathJson);
const info = (0, utils_1.loadJson)(pathJson);
yield npm.publish(path, info, options);
local.updateJson(pathJson, { gitHead: undefined }, true);
}
if (publishNames.indexOf("ethers") >= 0 || forcePublish) {
const change = changelog_1.getLatestChange();
const change = (0, changelog_1.getLatestChange)();
const patchVersion = change.version.substring(1);
const minorVersion = patchVersion.split(".").slice(0, 2).join(".");
const awsAccessId = yield config_1.config.get("aws-upload-scripts-accesskey");
@@ -169,8 +169,8 @@ exports.invalidate = invalidate;
// The password above already succeeded
const username = yield config_1.config.get("github-user");
const password = yield config_1.config.get("github-release");
const hash = createHash("sha384").update(fs_1.default.readFileSync(path_1.resolve("packages/ethers/dist/ethers.umd.min.js"))).digest("base64");
const gitCommit = yield git_1.getGitTag(path_1.resolve("CHANGELOG.md"));
const hash = createHash("sha384").update(fs_1.default.readFileSync((0, path_1.resolve)("packages/ethers/dist/ethers.umd.min.js"))).digest("base64");
const gitCommit = yield (0, git_1.getGitTag)((0, path_1.resolve)("CHANGELOG.md"));
let content = change.content.trim();
content += '\n\n----\n\n';
content += '**Embedding UMD with [SRI](https:/\/developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity):**\n';
@@ -183,7 +183,7 @@ exports.invalidate = invalidate;
content += '```';
// Publish the release
const beta = false;
const link = yield github_1.createRelease(username, password, change.version, change.title, content, beta, gitCommit);
const link = yield (0, github_1.createRelease)(username, password, change.version, change.title, content, beta, gitCommit);
console.log(`${log_1.colorify.bold("Published release:")} ${link}`);
}
// Upload libs to the CDN (as ethers-v5.1 and ethers-5.1.x)
@@ -244,7 +244,7 @@ exports.invalidate = invalidate;
const { bucketName, originRoot, filename, key, suffix } = fileInfos[i];
yield putObject(s3, {
ACL: "public-read",
Body: fs_1.default.readFileSync(path_1.resolve(filename)),
Body: fs_1.default.readFileSync((0, path_1.resolve)(filename)),
Bucket: bucketName,
ContentType: "application/javascript; charset=utf-8",
Key: (originRoot + key)

View File

@@ -42,8 +42,8 @@ function start(root, options) {
if (options.port == null) {
options.port = 8000;
}
root = path_1.resolve(root);
const server = http_1.createServer((req, resp) => {
root = (0, path_1.resolve)(root);
const server = (0, http_1.createServer)((req, resp) => {
const url = req.url.split("?")[0];
// Follow redirects in options
if (options.redirects && options.redirects[url]) {
@@ -51,7 +51,7 @@ function start(root, options) {
resp.end();
return;
}
let filename = path_1.resolve(root, "." + url);
let filename = (0, path_1.resolve)(root, "." + url);
// Make sure we aren't crawling out of our sandbox
if (url[0] !== "/" || filename.substring(0, filename.length) !== filename) {
resp.writeHead(403);
@@ -94,7 +94,7 @@ function start(root, options) {
return server;
}
exports.start = start;
start(path_2.resolve("docs"), {
start((0, path_2.resolve)("docs"), {
redirects: {
"/": "/v5/"
}

View File

@@ -19,19 +19,19 @@ const utils_1 = require("../utils");
console.log(log_1.colorify.bold("Setting Option:"), arg);
switch (arg) {
case "esm":
build_1.setupBuild(true);
(0, build_1.setupBuild)(true);
break;
case "cjs":
build_1.setupBuild(false);
(0, build_1.setupBuild)(false);
break;
// This will remove the browser field entirely, so make sure
// to set esm of cjs first as they will restore the browser
// field
case "browser-lang-all": {
const filename = path_1.getPackageJsonPath("wordlists");
const info = utils_1.loadJson(filename);
const filename = (0, path_1.getPackageJsonPath)("wordlists");
const info = (0, utils_1.loadJson)(filename);
delete info.browser;
utils_1.saveJson(filename, info, true);
(0, utils_1.saveJson)(filename, info, true);
break;
}
default:

View File

@@ -18,7 +18,7 @@ if (process.argv.length !== 3) {
const key = process.argv[2];
(function () {
return __awaiter(this, void 0, void 0, function* () {
const value = yield log_1.getPassword("Value: ");
const value = yield (0, log_1.getPassword)("Value: ");
yield config_1.config.set(key, value);
});
})().catch((error) => {

View File

@@ -16,7 +16,7 @@ const fs_1 = __importDefault(require("fs"));
const path_1 = require("../path");
const utils_1 = require("../utils");
function copy(src, dst, transform) {
let data = fs_1.default.readFileSync(path_1.resolve(src));
let data = fs_1.default.readFileSync((0, path_1.resolve)(src));
if (transform) {
data = Buffer.from(transform(data.toString()));
}
@@ -24,14 +24,14 @@ function copy(src, dst, transform) {
}
(function () {
return __awaiter(this, void 0, void 0, function* () {
yield utils_1.mkdir(path_1.resolve("output/karma"));
copy(path_1.resolve("packages/ethers/dist/ethers.esm.js"), path_1.resolve("output/karma/ethers.esm.js"));
copy(path_1.resolve("packages/tests/dist/tests.esm.js"), path_1.resolve("output/karma/tests.esm.js"), (data) => {
yield (0, utils_1.mkdir)((0, path_1.resolve)("output/karma"));
copy((0, path_1.resolve)("packages/ethers/dist/ethers.esm.js"), (0, path_1.resolve)("output/karma/ethers.esm.js"));
copy((0, path_1.resolve)("packages/tests/dist/tests.esm.js"), (0, path_1.resolve)("output/karma/tests.esm.js"), (data) => {
return data.replace(/^(import [^;]* from ')(ethers)(';)/, (all, prefix, id, suffix) => {
return prefix + "./ethers.esm.js" + suffix;
});
});
copy(path_1.resolve("packages/ethers/dist/ethers.umd.js"), path_1.resolve("output/karma/ethers.umd.js"));
copy(path_1.resolve("packages/tests/dist/tests.umd.js"), path_1.resolve("output/karma/tests.umd.js"));
copy((0, path_1.resolve)("packages/ethers/dist/ethers.umd.js"), (0, path_1.resolve)("output/karma/ethers.umd.js"));
copy((0, path_1.resolve)("packages/tests/dist/tests.umd.js"), (0, path_1.resolve)("output/karma/tests.umd.js"));
});
})();

View File

@@ -22,7 +22,7 @@ const Words = fs_1.default.readFileSync("/usr/share/dict/words").toString().spli
}, {});
`
// Words missing from the dictionary
accessing addresses aligned autofill called cancelled changed censored
accessing addresses aligned autofill avatar called cancelled changed censored
clamping compiled computed configured consumed creating decoded decoding
decreased decrypt decrypted decrypting deployed deploying deprecated detected
discontinued earliest email emitted enabled encoded encoder encoding encrypt
@@ -58,9 +58,9 @@ ABIEncoder testcase numberish Wordlist
abi addr api app arg arrayify asm backend basex bigint bignumber bn byte
bytecode callback calldata charset checksum ciphertext cli codepoint
commify config
contenthash ctr ctrl debug dd dklen eexist encseed eof eq ethaddr
contenthash ctr ctrl debug dd dklen eexist encseed eof eq erc ethaddr
ethseed ethers eval exec filename func gz gzip hid http https hw iv
info init ipc json kdf kdfparams labelhash lang lib mm multihash nfc
info init ipc json kdf kdfparams labelhash lang lib metadata mm multihash nfc
nfkc nfd nfkd nodehash notok nowait nullish oob opcode pbkdf pc plugin
pragma pre prf recid repl rpc sighash topichash solc stdin stdout subclasses
subnode timeout todo txt typeof ufixed utc utf util url urlencoded uuid vm
@@ -72,13 +72,14 @@ abiv
// Query parameters
apikey asc endblock startblock
alchemyapi Cloudflare Etherscan INFURA IPFS MetaMask Nodesmith
alchemyapi arbitrum Cloudflare Etherscan INFURA IPFS MetaMask Nodesmith
Trezor ledgerhq axic bitcoinjs browserify easyseed ethereumjs
goerli homestead kotti kovan mainnet morden mordor rinkeby
goerli homestead kotti kovan mainnet morden mordor rinkeby kintsugi
ropsten testnet lb maticmum
// Demo words
args foo eth foo foobar ll localhost passwd ricmoo tx xxx yna
brantly
// nameprep tags
ALCat BiDi LCat nameprep
@@ -129,7 +130,7 @@ function getStrings(source) {
const Include = new RegExp("packages/.*/src.ts/.*\.ts$");
const Exclude = new RegExp("/node_modules/|src.ts/.*browser.*");
function getAllStrings(path) {
const Root = path_1.resolve(__dirname, path);
const Root = (0, path_1.resolve)(__dirname, path);
const readdir = function (path) {
if (path.match(Exclude)) {
return [];
@@ -137,7 +138,7 @@ function getAllStrings(path) {
const stat = fs_1.default.statSync(path);
if (stat.isDirectory()) {
return fs_1.default.readdirSync(path).reduce((result, filename) => {
readdir(path_1.resolve(path, filename)).forEach((file) => {
readdir((0, path_1.resolve)(path, filename)).forEach((file) => {
result.push(file);
});
return result;
@@ -174,7 +175,7 @@ function starts(text, prefix) {
return __awaiter(this, void 0, void 0, function* () {
console.log(log_1.colorify.bold("Spell checking source code strings..."));
let count = 0;
getAllStrings(path_1.resolve(__dirname, "../../../../packages")).forEach((file) => {
getAllStrings((0, path_1.resolve)(__dirname, "../../../../packages")).forEach((file) => {
if (starts(file.filename, "/testcases/src.ts/generation-scripts")) {
return;
}

View File

@@ -19,6 +19,6 @@ const path_1 = require("../path");
(function () {
return __awaiter(this, void 0, void 0, function* () {
console.log(log_1.colorify.bold("Updating CHANGELOG.md..."));
fs_1.default.writeFileSync(path_1.resolve("CHANGELOG.md"), yield changelog_1.generate());
fs_1.default.writeFileSync((0, path_1.resolve)("CHANGELOG.md"), yield (0, changelog_1.generate)());
});
})();

View File

@@ -14,8 +14,8 @@ const path_1 = require("../path");
const local_1 = require("../local");
(function () {
return __awaiter(this, void 0, void 0, function* () {
const ordered = depgraph_1.getOrdered(true);
local_1.updateJson(path_1.resolve("tsconfig.project.json"), {
const ordered = (0, depgraph_1.getOrdered)(true);
(0, local_1.updateJson)((0, path_1.resolve)("tsconfig.project.json"), {
references: ordered.map((name) => ({ path: ("./packages/" + name) }))
});
});

View File

@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const log_1 = require("../log");
const path_1 = require("../path");
const sourceEthers = fs_1.default.readFileSync(path_1.resolve("packages/ethers/src.ts/ethers.ts")).toString();
const sourceEthers = fs_1.default.readFileSync((0, path_1.resolve)("packages/ethers/src.ts/ethers.ts")).toString();
const targets = sourceEthers.match(/export\s*{\s*((.|\s)*)}/)[1].trim();
////////////////////
// Begin template
@@ -35,4 +35,4 @@ export {
// End template
////////////////////
console.log(log_1.colorify.bold(`Flattening exports...`));
fs_1.default.writeFileSync(path_1.resolve("packages/ethers/src.ts/index.ts"), output);
fs_1.default.writeFileSync((0, path_1.resolve)("packages/ethers/src.ts/index.ts"), output);

View File

@@ -14,14 +14,14 @@ const log_1 = require("../log");
const path_1 = require("../path");
(function () {
return __awaiter(this, void 0, void 0, function* () {
const progress = log_1.getProgressBar(log_1.colorify.bold("Updating package.json hashes"));
const progress = (0, log_1.getProgressBar)(log_1.colorify.bold("Updating package.json hashes"));
// Updating all tarball hashes now that versions have been updated
for (let i = 0; i < path_1.dirnames.length; i++) {
progress(i / path_1.dirnames.length);
const dirname = path_1.dirnames[i];
//const gitHead = await getGitTag(resolve("packages", dirname));
const tarballHash = local_1.computeTarballHash(dirname);
local_1.updateJson(path_1.getPackageJsonPath(dirname), { tarballHash }, true);
const tarballHash = (0, local_1.computeTarballHash)(dirname);
(0, local_1.updateJson)((0, path_1.getPackageJsonPath)(dirname), { tarballHash }, true);
}
progress(1);
});

View File

@@ -116,7 +116,7 @@ function _getFiles(result, root) {
if (filename === '.DS_Store') {
return;
}
const fullFilename = path_1.join(root, filename);
const fullFilename = (0, path_1.join)(root, filename);
const stat = fs_1.default.statSync(fullFilename);
if (stat.isDirectory()) {
_getFiles(result, fullFilename);
@@ -150,7 +150,7 @@ function getFiles(basedir) {
secretAccessKey: awsSecretKey
});
const added = [], removed = [], changed = [], upload = [];
const basedir = path_2.resolve("docs");
const basedir = (0, path_2.resolve)("docs");
const local = yield getFiles(basedir);
const remote = yield getKeys(s3, bucket);
Object.keys(local).forEach((filename) => {
@@ -177,7 +177,7 @@ function getFiles(basedir) {
console.log('Changed: ', changed.length);
for (let i = 0; i < upload.length; i++) {
const filename = upload[i];
const content = fs_1.default.readFileSync(path_1.join(basedir, filename));
const content = fs_1.default.readFileSync((0, path_1.join)(basedir, filename));
console.log(`Uploading: ${filename} (${content.length} bytes)`);
yield putObject(s3, bucket, filename, content);
}

View File

@@ -22,15 +22,15 @@ const scrypt_js_1 = __importDefault(require("scrypt-js"));
const log_1 = require("./log");
function getRandomBytes(length) {
const result = new Uint8Array(length);
result.set(crypto_1.randomBytes(length));
result.set((0, crypto_1.randomBytes)(length));
return result;
}
function computeHmac(key, data) {
return "0x" + crypto_1.createHmac("sha512", key).update(data).digest("hex");
return "0x" + (0, crypto_1.createHmac)("sha512", key).update(data).digest("hex");
}
function getScrypt(message, password, salt) {
return __awaiter(this, void 0, void 0, function* () {
const progress = log_1.getProgressBar(message);
const progress = (0, log_1.getProgressBar)(message);
return yield scrypt_js_1.default.scrypt(Buffer.from(password), Buffer.from(salt), (1 << 17), 8, 1, 64, progress);
});
}
@@ -58,7 +58,7 @@ class Config {
}
this.canary = data.canary || "";
this.salt = data.salt;
const password = yield log_1.getPassword(log_1.colorify.bold("Password (config-store): "));
const password = yield (0, log_1.getPassword)(log_1.colorify.bold("Password (config-store): "));
this.dkey = yield getScrypt(log_1.colorify.bold("Unlocking config"), password, this.salt);
if (data.ciphertext) {
const ciphertext = Buffer.from(data.ciphertext, "base64");
@@ -113,7 +113,7 @@ class Config {
this.salt = this.dkey = null;
}
}
const _config = new Config(path_1.resolve(os_1.default.homedir(), ".ethers-dist"));
const _config = new Config((0, path_1.resolve)(os_1.default.homedir(), ".ethers-dist"));
exports.config = {
get: function (key) {
return _config.get(key);

View File

@@ -47,7 +47,7 @@ function getOrdered(skipNobuild) {
};
for (let i = 0; i < path_1.dirnames.length; i++) {
let dirname = path_1.dirnames[i];
let info = local_1.getPackage(dirname);
let info = (0, local_1.getPackage)(dirname);
if (skipNobuild && info._ethers_nobuild) {
continue;
}
@@ -91,8 +91,8 @@ exports.getOrdered = getOrdered;
function sort(dirnames) {
let ordered = getOrdered();
dirnames.sort((a, b) => {
let ai = ordered.indexOf(local_1.getPackage(a).name);
let bi = ordered.indexOf(local_1.getPackage(b).name);
let ai = ordered.indexOf((0, local_1.getPackage)(a).name);
let bi = ordered.indexOf((0, local_1.getPackage)(b).name);
if (ai === -1 || bi === -1) {
throw new Error("unknown dirname - " + [a, b].join(", "));
}

View File

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

View File

@@ -14,7 +14,7 @@ const run_1 = require("./run");
// Returns the most recent git commit hash for a given filename
function getGitTag(filename) {
return __awaiter(this, void 0, void 0, function* () {
const result = yield run_1.run("git", ["log", "-n", "1", "--", filename]);
const result = yield (0, run_1.run)("git", ["log", "-n", "1", "--", filename]);
if (!result.ok) {
throw new Error(`git log error`);
}

View File

@@ -22,7 +22,7 @@ function _fetchGitHub(user, password, getUrlFunc, url) {
return __awaiter(this, void 0, void 0, function* () {
const result = [];
while (true) {
const filename = path_1.resolve("github-cache", Buffer.from(js_sha3_1.keccak_256.create().update(Buffer.from(url)).digest()).toString("hex").substring(0, 12));
const filename = (0, path_1.resolve)("github-cache", Buffer.from(js_sha3_1.keccak_256.create().update(Buffer.from(url)).digest()).toString("hex").substring(0, 12));
const headers = {
"User-Agent": "ethers-io",
};
@@ -41,7 +41,7 @@ function _fetchGitHub(user, password, getUrlFunc, url) {
throw error;
}
}
const response = yield geturl_1.getUrl(url, { headers, user, password });
const response = yield (0, geturl_1.getUrl)(url, { headers, user, password });
console.log(response.statusCode);
// Cached response is good; use it!
if (response.statusCode !== 304) {
@@ -129,7 +129,7 @@ function syncIssues(user, password) {
exports.syncIssues = syncIssues;
function createRelease(user, password, tagName, title, body, prerelease, commit) {
return __awaiter(this, void 0, void 0, function* () {
const result = yield geturl_1.getUrl("https:/\/api.github.com/repos/ethers-io/ethers.js/releases", {
const result = yield (0, geturl_1.getUrl)("https:/\/api.github.com/repos/ethers-io/ethers.js/releases", {
body: Buffer.from(JSON.stringify({
tag_name: tagName,
target_commitish: (commit || "master"),

View File

@@ -9,7 +9,7 @@ const path_1 = require("./path");
const run_1 = require("./run");
const utils_1 = require("./utils");
function getPackage(name) {
const value = utils_1.loadJson(path_1.getPackageJsonPath(name));
const value = (0, utils_1.loadJson)((0, path_1.getPackageJsonPath)(name));
return {
name: value.name,
version: value.version,
@@ -23,7 +23,7 @@ function getPackage(name) {
}
exports.getPackage = getPackage;
function updateJson(path, replace, sort) {
const values = utils_1.loadJson(path);
const values = (0, utils_1.loadJson)(path);
Object.keys(replace).forEach((key) => {
const value = replace[key];
if (value === undefined) {
@@ -33,12 +33,12 @@ function updateJson(path, replace, sort) {
values[key] = replace[key];
}
});
utils_1.saveJson(path, values, !!sort);
(0, utils_1.saveJson)(path, values, !!sort);
}
exports.updateJson = updateJson;
function getDependencies(name, filter) {
if (name) {
return utils_1.sortRecords(getPackage(name).dependencies);
return (0, utils_1.sortRecords)(getPackage(name).dependencies);
}
// Find all versions for each package dependency
const deps = path_1.dirnames.reduce((accum, dirname) => {
@@ -55,7 +55,7 @@ function getDependencies(name, filter) {
return accum;
}, {});
// Make sure each package dependency only has 1 version
return utils_1.sortRecords(Object.keys(deps).reduce((accum, name) => {
return (0, utils_1.sortRecords)(Object.keys(deps).reduce((accum, name) => {
const versions = Object.keys(deps[name]);
if (versions.length > 1) {
throw new Error(`cannot depend on multiple versions for ${JSON.stringify(name)}: ${versions.map(v => JSON.stringify(v)).join(", ")}`);
@@ -66,7 +66,7 @@ function getDependencies(name, filter) {
}
exports.getDependencies = getDependencies;
function getPackList(name) {
const result = run_1.run("npm", ["pack", "--json", path_1.getPackagePath(name), "--dry-run"]);
const result = (0, run_1.run)("npm", ["pack", "--json", (0, path_1.getPackagePath)(name), "--dry-run"]);
if (!result.ok) {
const error = new Error(`failed to run npm pack: ${name}`);
error.result = result;
@@ -118,9 +118,9 @@ function computeTarballHash(name) {
const files = getPackList(name);
files.sort();
// Compute the hash for each file
const packageRoot = path_1.getPackagePath(name);
const packageRoot = (0, path_1.getPackagePath)(name);
const hashes = files.reduce((accum, filename) => {
let content = fs_1.default.readFileSync(path_1.resolve(packageRoot, filename));
let content = fs_1.default.readFileSync((0, path_1.resolve)(packageRoot, filename));
// The package.json includes the hash, so we need to nix it to get a consistent hash
if (filename === "package.json") {
const info = JSON.parse(content.toString());
@@ -128,10 +128,10 @@ function computeTarballHash(name) {
delete info.tarballHash;
content = Buffer.from(JSON.stringify(info, null, 2));
}
accum[filename] = utils_1.sha256(content);
accum[filename] = (0, utils_1.sha256)(content);
return accum;
}, {});
return utils_1.sha256(Buffer.from("{" + files.map((filename) => {
return (0, utils_1.sha256)(Buffer.from("{" + files.map((filename) => {
return `${JSON.stringify(filename)}:"${hashes[filename]}"`;
}).join(",") + "}"));
}

View File

@@ -98,7 +98,7 @@ function _getPrompt(prompt, options, callback) {
(process.stdout).clearLine();
(process.stdout).cursorTo(0);
if (options.mask) {
process.stdout.write(prompt + utils_1.repeat(options.mask, message.length));
process.stdout.write(prompt + (0, utils_1.repeat)(options.mask, message.length));
}
else {
process.stdout.write(prompt + message);

View File

@@ -22,10 +22,10 @@ const cache = {};
function getPackageInfo(name) {
return __awaiter(this, void 0, void 0, function* () {
// Convert dirname to package if needed
name = local_1.getPackage(name).name;
name = (0, local_1.getPackage)(name).name;
if (!cache[name]) {
try {
const result = yield geturl_1.getUrl("http:/" + "/registry.npmjs.org/" + name);
const result = yield (0, geturl_1.getUrl)("https:/\/registry.npmjs.org/" + name);
cache[name] = JSON.parse(Buffer.from(result.body).toString("utf8"));
}
catch (error) {
@@ -66,12 +66,12 @@ exports.getPackage = getPackage;
function publish(path, manifest, options) {
return __awaiter(this, void 0, void 0, function* () {
try {
yield libnpmpublish_1.publish(path, manifest, options);
yield (0, libnpmpublish_1.publish)(path, manifest, options);
}
catch (error) {
// We need an OTP
if (error.code === "EOTP") {
const otp = yield log_1.getPrompt(log_1.colorify.bold("Enter OTP: "));
const otp = yield (0, log_1.getPrompt)(log_1.colorify.bold("Enter OTP: "));
options.otp = otp.replace(" ", "");
// Retry with the new OTP
return yield publish(path, manifest, options);

View File

@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.isEthers = exports.getPackageJsonPath = exports.getDirname = exports.getPackagePath = exports.packages = exports.dirnames = exports.dirs = exports.resolve = exports.root = void 0;
const fs_1 = __importDefault(require("fs"));
const path_1 = require("path");
exports.root = path_1.resolve(__dirname, "../../../");
exports.root = (0, path_1.resolve)(__dirname, "../../../");
function resolve(...args) {
args.unshift(exports.root);
return path_1.resolve.apply(null, args);
@@ -23,8 +23,8 @@ exports.dirnames = Object.freeze(fs_1.default.readdirSync(exports.dirs.packages)
return (dirname[0] !== ".");
}));
const packageLookup = exports.dirnames.reduce((accum, dirname) => {
const packagePath = path_1.resolve(exports.dirs.packages, dirname);
const packageJsonPath = path_1.resolve(packagePath, "package.json");
const packagePath = (0, path_1.resolve)(exports.dirs.packages, dirname);
const packageJsonPath = (0, path_1.resolve)(packagePath, "package.json");
const info = JSON.parse(fs_1.default.readFileSync(packageJsonPath).toString());
const packageName = info.name;
const version = info.version;

View File

@@ -10,7 +10,7 @@ function run(progname, args, currentWorkingDirectory) {
if (currentWorkingDirectory) {
options.cwd = currentWorkingDirectory;
}
const child = child_process_1.spawnSync(progname, args, options);
const child = (0, child_process_1.spawnSync)(progname, args, options);
const result = {
_stderr: child.stderr,
stderr: (child.stderr.toString() || null),

View File

@@ -28,7 +28,7 @@ function repeat(char, length) {
}
exports.repeat = repeat;
function sha256(content) {
const hasher = crypto_1.createHash("sha256");
const hasher = (0, crypto_1.createHash)("sha256");
hasher.update(content);
return "0x" + hasher.digest("hex");
}
@@ -43,7 +43,7 @@ function sortRecords(record) {
}
exports.sortRecords = sortRecords;
function atomicWrite(path, value) {
const tmp = path_1.resolve(__dirname, "../../../.atomic-tmp");
const tmp = (0, path_1.resolve)(__dirname, "../../../.atomic-tmp");
fs_1.default.writeFileSync(tmp, value);
fs_1.default.renameSync(tmp, path);
}
@@ -96,7 +96,7 @@ function mkdir(path) {
break;
}
dirs.push(path);
path = path_1.dirname(path);
path = (0, path_1.dirname)(path);
}
while (dirs.length) {
fs_1.default.mkdirSync(dirs.pop());

View File

@@ -52,7 +52,7 @@ async function alias(name: string): Promise<void> {
if (replace) {
inputFilename = replace;
transform = function(content: string) {
content = content.replace(/(\/\/# sourceMappingURL=)(.*)$/g, (all, prefix, mapFilename) => {
content = content.replace(/^(\/\/# sourceMappingURL=)(.*)$/mg, (all, prefix, mapFilename) => {
return prefix + filename + ".map";
});
return content;
@@ -132,7 +132,7 @@ async function alias(name: string): Promise<void> {
console.log(colorify.bold(`Aliasing Node ESM to Browser ESM...`));
const dirnames = getOrdered(true);
for (let i = 0; i < dirnames.length; i++) {
//if (dirnames[i] !== "base64") { continue; }
//if (dirnames[i] !== "signing-key") { continue; }
await alias(dirnames[i]);
}
})();

View File

@@ -0,0 +1,16 @@
/*
import { dirnames, getPackage } from "../local";
import { colorify } from "../log";
const dirname = process.argv[2];
if (dirname == null) {
console.log("Usage: peg-version DIRNAME");
process.exit(1);
}
(async function(dirname) {
const { name, version } = getPackage(dirname);
console.log(colorify.bold(`Pegging ${ name } to ${ version }...`));
})(dirname);
*/

View File

@@ -13,7 +13,7 @@ const Words = fs.readFileSync("/usr/share/dict/words").toString().split("\n").re
`
// Words missing from the dictionary
accessing addresses aligned autofill called cancelled changed censored
accessing addresses aligned autofill avatar called cancelled changed censored
clamping compiled computed configured consumed creating decoded decoding
decreased decrypt decrypted decrypting deployed deploying deprecated detected
discontinued earliest email emitted enabled encoded encoder encoding encrypt
@@ -49,9 +49,9 @@ ABIEncoder testcase numberish Wordlist
abi addr api app arg arrayify asm backend basex bigint bignumber bn byte
bytecode callback calldata charset checksum ciphertext cli codepoint
commify config
contenthash ctr ctrl debug dd dklen eexist encseed eof eq ethaddr
contenthash ctr ctrl debug dd dklen eexist encseed eof eq erc ethaddr
ethseed ethers eval exec filename func gz gzip hid http https hw iv
info init ipc json kdf kdfparams labelhash lang lib mm multihash nfc
info init ipc json kdf kdfparams labelhash lang lib metadata mm multihash nfc
nfkc nfd nfkd nodehash notok nowait nullish oob opcode pbkdf pc plugin
pragma pre prf recid repl rpc sighash topichash solc stdin stdout subclasses
subnode timeout todo txt typeof ufixed utc utf util url urlencoded uuid vm
@@ -63,13 +63,14 @@ abiv
// Query parameters
apikey asc endblock startblock
alchemyapi Cloudflare Etherscan INFURA IPFS MetaMask Nodesmith
alchemyapi arbitrum Cloudflare Etherscan INFURA IPFS MetaMask Nodesmith
Trezor ledgerhq axic bitcoinjs browserify easyseed ethereumjs
goerli homestead kotti kovan mainnet morden mordor rinkeby
goerli homestead kotti kovan mainnet morden mordor rinkeby kintsugi
ropsten testnet lb maticmum
// Demo words
args foo eth foo foobar ll localhost passwd ricmoo tx xxx yna
brantly
// nameprep tags
ALCat BiDi LCat nameprep

View File

@@ -15,7 +15,7 @@ async function getPackageInfo(name: string): Promise<any> {
if (!cache[name]) {
try {
const result = await getUrl("http:/" + "/registry.npmjs.org/" + name);
const result = await getUrl("https:/\/registry.npmjs.org/" + name);
cache[name] = JSON.parse(Buffer.from(result.body).toString("utf8"));
} catch (error) {
if (error.status === 404) { return null; }

2038
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -65,7 +65,7 @@
"@types/node": "^12.7.4",
"@types/semver": "^7.3.4",
"aes-js": "3.0.0",
"aws-sdk": "2.137.0",
"aws-sdk": "2.1039.0",
"diff": "4.0.1",
"flatworm": "0.0.2-beta.7",
"jison": "0.4.18",
@@ -73,14 +73,14 @@
"karma-chrome-launcher": "3.1.0",
"karma-mocha": "2.0.1",
"libnpmpublish": "3.0.1",
"mocha": "^7.1.1",
"mocha": "^9.1.3",
"nyc": "15.1.0",
"rollup": "2.33.2",
"rollup-plugin-node-polyfills": "0.2.1",
"rollup-plugin-sourcemaps": "0.6.3",
"scrypt-js": "3.0.1",
"semver": "^5.6.0",
"typescript": "4.2.2",
"typescript": "4.4.4",
"uglify-es": "3.3.9"
},
"dependencies": {
@@ -95,7 +95,7 @@
"bn.js": "^4.11.9",
"elliptic": "6.5.4",
"hash.js": "1.1.7",
"js-sha3": "0.5.7",
"js-sha3": "0.8.0",
"scrypt-js": "3.0.1",
"solc": "0.7.1",
"tiny-inflate": "1.0.3",

View File

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

View File

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

View File

@@ -201,7 +201,7 @@ export const FormatTypes = Object.freeze({
sighash: "sighash",
// Human-Readable with Minimal spacing and without names (compact human-readable)
minimal: "minimal",
// Human-Readble with nice spacing, including all names
// Human-Readable with nice spacing, including all names
full: "full",
// JSON-format a la Solidity
json: "json"
@@ -239,7 +239,7 @@ export class ParamType {
// Format the parameter fragment
// - sighash: "(uint256,address)"
// - minimal: "tuple(uint256,address) indexed"
// - full: "tuple(uint256 foo, addres bar) indexed baz"
// - full: "tuple(uint256 foo, address bar) indexed baz"
format(format) {
if (!format) {
format = FormatTypes.sighash;

File diff suppressed because one or more lines are too long

View File

@@ -58,7 +58,7 @@ export class Interface {
defineReadOnly(this, "fragments", abi.map((fragment) => {
return Fragment.from(fragment);
}).filter((fragment) => (fragment != null)));
defineReadOnly(this, "_abiCoder", getStatic((new.target), "getAbiCoder")());
defineReadOnly(this, "_abiCoder", getStatic(new.target, "getAbiCoder")());
defineReadOnly(this, "functions", {});
defineReadOnly(this, "errors", {});
defineReadOnly(this, "events", {});
@@ -155,7 +155,7 @@ export class Interface {
}
return this.functions[matching[0]];
}
// Normlize the signature and lookup the function
// Normalize the signature and lookup the function
const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
if (!result) {
logger.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
@@ -185,7 +185,7 @@ export class Interface {
}
return this.events[matching[0]];
}
// Normlize the signature and lookup the function
// Normalize the signature and lookup the function
const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];
if (!result) {
logger.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
@@ -216,7 +216,7 @@ export class Interface {
}
return this.errors[matching[0]];
}
// Normlize the signature and lookup the function
// Normalize the signature and lookup the function
const result = this.errors[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
if (!result) {
logger.throwArgumentError("no matching error", "signature", nameOrSignatureOrSighash);
@@ -428,7 +428,7 @@ export class Interface {
topics.push(keccak256(value));
}
else if (param.baseType === "tuple" || param.baseType === "array") {
// @TOOD
// @TODO
throw new Error("not implemented");
}
else {
@@ -559,7 +559,7 @@ export class Interface {
}
// @TODO: If anonymous, and the only method, and the input count matches, should we parse?
// Probably not, because just because it is the only event in the ABI does
// not mean we have the full ABI; maybe jsut a fragment?
// not mean we have the full ABI; maybe just a fragment?
return new LogDescription({
eventFragment: fragment,
name: fragment.name,

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

@@ -24,7 +24,7 @@ var AbiCoder = /** @class */ (function () {
function AbiCoder(coerceFunc) {
var _newTarget = this.constructor;
logger.checkNew(_newTarget, AbiCoder);
properties_1.defineReadOnly(this, "coerceFunc", coerceFunc || null);
(0, properties_1.defineReadOnly)(this, "coerceFunc", coerceFunc || null);
}
AbiCoder.prototype._getCoder = function (param) {
var _this = this;
@@ -97,7 +97,7 @@ var AbiCoder = /** @class */ (function () {
var _this = this;
var coders = types.map(function (type) { return _this._getCoder(fragments_1.ParamType.from(type)); });
var coder = new tuple_1.TupleCoder(coders, "_");
return coder.decode(this._getReader(bytes_1.arrayify(data), loose));
return coder.decode(this._getReader((0, bytes_1.arrayify)(data), loose));
};
return AbiCoder;
}());

View File

@@ -1 +1 @@
{"version":3,"file":"abi-coder.js","sourceRoot":"","sources":["../src.ts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M,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,yBAAM,GAAN,UAAO,KAAwC,EAAE,IAAe,EAAE,KAAe;QAAjF,iBAIC;QAHG,IAAM,MAAM,GAAiB,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,KAAI,CAAC,SAAS,CAAC,qBAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAApC,CAAoC,CAAC,CAAC;QACvF,IAAM,KAAK,GAAG,IAAI,kBAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC1C,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAA,gBAAQ,EAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IACL,eAAC;AAAD,CAAC,AAzFD,IAyFC;AAzFY,4BAAQ;AA2FR,QAAA,eAAe,GAAa,IAAI,QAAQ,EAAE,CAAC"}

View File

@@ -45,14 +45,14 @@ var Coder = /** @class */ (function () {
exports.Coder = Coder;
var Writer = /** @class */ (function () {
function Writer(wordSize) {
properties_1.defineReadOnly(this, "wordSize", wordSize || 32);
(0, properties_1.defineReadOnly)(this, "wordSize", wordSize || 32);
this._data = [];
this._dataLength = 0;
this._padding = new Uint8Array(wordSize);
}
Object.defineProperty(Writer.prototype, "data", {
get: function () {
return bytes_1.hexConcat(this._data);
return (0, bytes_1.hexConcat)(this._data);
},
enumerable: false,
configurable: true
@@ -68,19 +68,19 @@ var Writer = /** @class */ (function () {
return data.length;
};
Writer.prototype.appendWriter = function (writer) {
return this._writeData(bytes_1.concat(writer._data));
return this._writeData((0, bytes_1.concat)(writer._data));
};
// Arrayish items; padded on the right to wordSize
Writer.prototype.writeBytes = function (value) {
var bytes = bytes_1.arrayify(value);
var bytes = (0, bytes_1.arrayify)(value);
var paddingOffset = bytes.length % this.wordSize;
if (paddingOffset) {
bytes = bytes_1.concat([bytes, this._padding.slice(paddingOffset)]);
bytes = (0, bytes_1.concat)([bytes, this._padding.slice(paddingOffset)]);
}
return this._writeData(bytes);
};
Writer.prototype._getValue = function (value) {
var bytes = bytes_1.arrayify(bignumber_1.BigNumber.from(value));
var bytes = (0, bytes_1.arrayify)(bignumber_1.BigNumber.from(value));
if (bytes.length > this.wordSize) {
logger.throwError("value out-of-bounds", logger_1.Logger.errors.BUFFER_OVERRUN, {
length: this.wordSize,
@@ -88,7 +88,7 @@ var Writer = /** @class */ (function () {
});
}
if (bytes.length % this.wordSize) {
bytes = bytes_1.concat([this._padding.slice(bytes.length % this.wordSize), bytes]);
bytes = (0, bytes_1.concat)([this._padding.slice(bytes.length % this.wordSize), bytes]);
}
return bytes;
};
@@ -110,14 +110,14 @@ var Writer = /** @class */ (function () {
exports.Writer = Writer;
var Reader = /** @class */ (function () {
function Reader(data, wordSize, coerceFunc, allowLoose) {
properties_1.defineReadOnly(this, "_data", bytes_1.arrayify(data));
properties_1.defineReadOnly(this, "wordSize", wordSize || 32);
properties_1.defineReadOnly(this, "_coerceFunc", coerceFunc);
properties_1.defineReadOnly(this, "allowLoose", allowLoose);
(0, properties_1.defineReadOnly)(this, "_data", (0, bytes_1.arrayify)(data));
(0, properties_1.defineReadOnly)(this, "wordSize", wordSize || 32);
(0, properties_1.defineReadOnly)(this, "_coerceFunc", coerceFunc);
(0, properties_1.defineReadOnly)(this, "allowLoose", allowLoose);
this._offset = 0;
}
Object.defineProperty(Reader.prototype, "data", {
get: function () { return bytes_1.hexlify(this._data); },
get: function () { return (0, bytes_1.hexlify)(this._data); },
enumerable: false,
configurable: true
});

File diff suppressed because one or more lines are too long

View File

@@ -29,7 +29,7 @@ var AddressCoder = /** @class */ (function (_super) {
};
AddressCoder.prototype.encode = function (writer, value) {
try {
value = address_1.getAddress(value);
value = (0, address_1.getAddress)(value);
}
catch (error) {
this._throwError(error.message, value);
@@ -37,7 +37,7 @@ var AddressCoder = /** @class */ (function (_super) {
return writer.writeValue(value);
};
AddressCoder.prototype.decode = function (reader) {
return address_1.getAddress(bytes_1.hexZeroPad(reader.readValue().toHexString(), 20));
return (0, address_1.getAddress)((0, bytes_1.hexZeroPad)(reader.readValue().toHexString(), 20));
};
return AddressCoder;
}(abstract_coder_1.Coder));

View File

@@ -1 +1 @@
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/coders/address.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAEb,kDAAoD;AACpD,8CAAkD;AAElD,mDAAyD;AAEzD;IAAkC,gCAAK;IAEnC,sBAAY,SAAiB;eACzB,kBAAM,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC;IACjD,CAAC;IAED,mCAAY,GAAZ;QACI,OAAO,4CAA4C,CAAC;IACxD,CAAC;IAED,6BAAM,GAAN,UAAO,MAAc,EAAE,KAAa;QAChC,IAAI;YACA,KAAK,GAAG,oBAAU,CAAC,KAAK,CAAC,CAAA;SAC5B;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SAC1C;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,6BAAM,GAAN,UAAO,MAAc;QACjB,OAAO,oBAAU,CAAC,kBAAU,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;IACL,mBAAC;AAAD,CAAC,AAtBD,CAAkC,sBAAK,GAsBtC;AAtBY,oCAAY"}
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/coders/address.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAEb,kDAAoD;AACpD,8CAAkD;AAElD,mDAAyD;AAEzD;IAAkC,gCAAK;IAEnC,sBAAY,SAAiB;eACzB,kBAAM,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC;IACjD,CAAC;IAED,mCAAY,GAAZ;QACI,OAAO,4CAA4C,CAAC;IACxD,CAAC;IAED,6BAAM,GAAN,UAAO,MAAc,EAAE,KAAa;QAChC,IAAI;YACA,KAAK,GAAG,IAAA,oBAAU,EAAC,KAAK,CAAC,CAAA;SAC5B;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SAC1C;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,6BAAM,GAAN,UAAO,MAAc;QACjB,OAAO,IAAA,oBAAU,EAAC,IAAA,kBAAU,EAAC,MAAM,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;IACL,mBAAC;AAAD,CAAC,AAtBD,CAAkC,sBAAK,GAsBtC;AAtBY,oCAAY"}

View File

@@ -27,7 +27,7 @@ var DynamicBytesCoder = /** @class */ (function (_super) {
return "0x";
};
DynamicBytesCoder.prototype.encode = function (writer, value) {
value = bytes_1.arrayify(value);
value = (0, bytes_1.arrayify)(value);
var length = writer.writeValue(value.length);
length += writer.writeBytes(value);
return length;
@@ -44,7 +44,7 @@ var BytesCoder = /** @class */ (function (_super) {
return _super.call(this, "bytes", localName) || this;
}
BytesCoder.prototype.decode = function (reader) {
return reader.coerce(this.name, bytes_1.hexlify(_super.prototype.decode.call(this, reader)));
return reader.coerce(this.name, (0, bytes_1.hexlify)(_super.prototype.decode.call(this, reader)));
};
return BytesCoder;
}(DynamicBytesCoder));

View File

@@ -1 +1 @@
{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../src.ts/coders/bytes.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;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AI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC;IACrC,CAAC;IAED,wCAAY,GAAZ;QACI,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,kCAAM,GAAN,UAAO,MAAc,EAAE,KAAU;QAC7B,KAAK,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;QACxB,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,kCAAM,GAAN,UAAO,MAAc;QACjB,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC;IACL,wBAAC;AAAD,CAAC,AAnBD,CAAuC,sBAAK,GAmB3C;AAnBY,8CAAiB;AAqB9B;IAAgC,8BAAiB;IAC7C,oBAAY,SAAiB;eACzB,kBAAM,OAAO,EAAE,SAAS,CAAC;IAC7B,CAAC;IAED,2BAAM,GAAN,UAAO,MAAc;QACjB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAA,eAAO,EAAC,iBAAM,MAAM,YAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;IACL,iBAAC;AAAD,CAAC,AARD,CAAgC,iBAAiB,GAQhD;AARY,gCAAU"}

View File

@@ -32,14 +32,14 @@ var FixedBytesCoder = /** @class */ (function (_super) {
return ("0x0000000000000000000000000000000000000000000000000000000000000000").substring(0, 2 + this.size * 2);
};
FixedBytesCoder.prototype.encode = function (writer, value) {
var data = bytes_1.arrayify(value);
var data = (0, bytes_1.arrayify)(value);
if (data.length !== this.size) {
this._throwError("incorrect data length", value);
}
return writer.writeBytes(data);
};
FixedBytesCoder.prototype.decode = function (reader) {
return reader.coerce(this.name, bytes_1.hexlify(reader.readBytes(this.size)));
return reader.coerce(this.name, (0, bytes_1.hexlify)(reader.readBytes(this.size)));
};
return FixedBytesCoder;
}(abstract_coder_1.Coder));

View File

@@ -1 +1 @@
{"version":3,"file":"fixed-bytes.js","sourceRoot":"","sources":["../../src.ts/coders/fixed-bytes.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAEb,8CAAoE;AAEpE,mDAAyD;AAEzD,+BAA+B;AAC/B;IAAqC,mCAAK;IAGtC,yBAAY,IAAY,EAAE,SAAiB;QAA3C,iBAIC;QAHG,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,QAAA,kBAAM,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAC;QACpC,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;;IACrB,CAAC;IAED,sCAAY,GAAZ;QACI,OAAO,CAAC,oEAAoE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAClH,CAAC;IAED,gCAAM,GAAN,UAAO,MAAc,EAAE,KAAgB;QACnC,IAAI,IAAI,GAAG,gBAAQ,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE;YAAE,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;SAAE;QACpF,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,gCAAM,GAAN,UAAO,MAAc;QACjB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,eAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IACL,sBAAC;AAAD,CAAC,AAtBD,CAAqC,sBAAK,GAsBzC;AAtBY,0CAAe"}
{"version":3,"file":"fixed-bytes.js","sourceRoot":"","sources":["../../src.ts/coders/fixed-bytes.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAEb,8CAAoE;AAEpE,mDAAyD;AAEzD,+BAA+B;AAC/B;IAAqC,mCAAK;IAGtC,yBAAY,IAAY,EAAE,SAAiB;QAA3C,iBAIC;QAHG,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,QAAA,kBAAM,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAC;QACpC,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;;IACrB,CAAC;IAED,sCAAY,GAAZ;QACI,OAAO,CAAC,oEAAoE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAClH,CAAC;IAED,gCAAM,GAAN,UAAO,MAAc,EAAE,KAAgB;QACnC,IAAI,IAAI,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE;YAAE,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;SAAE;QACpF,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,gCAAM,GAAN,UAAO,MAAc;QACjB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAA,eAAO,EAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IACL,sBAAC;AAAD,CAAC,AAtBD,CAAqC,sBAAK,GAsBzC;AAtBY,0CAAe"}

View File

@@ -27,10 +27,10 @@ var StringCoder = /** @class */ (function (_super) {
return "";
};
StringCoder.prototype.encode = function (writer, value) {
return _super.prototype.encode.call(this, writer, strings_1.toUtf8Bytes(value));
return _super.prototype.encode.call(this, writer, (0, strings_1.toUtf8Bytes)(value));
};
StringCoder.prototype.decode = function (reader) {
return strings_1.toUtf8String(_super.prototype.decode.call(this, reader));
return (0, strings_1.toUtf8String)(_super.prototype.decode.call(this, reader));
};
return StringCoder;
}(bytes_1.DynamicBytesCoder));

View File

@@ -1 +1 @@
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../src.ts/coders/string.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAEb,kDAAmE;AAGnE,iCAA4C;AAE5C;IAAiC,+BAAiB;IAE9C,qBAAY,SAAiB;eACzB,kBAAM,QAAQ,EAAE,SAAS,CAAC;IAC9B,CAAC;IAED,kCAAY,GAAZ;QACI,OAAO,EAAE,CAAC;IACd,CAAC;IAED,4BAAM,GAAN,UAAO,MAAc,EAAE,KAAU;QAC7B,OAAO,iBAAM,MAAM,YAAC,MAAM,EAAE,qBAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,4BAAM,GAAN,UAAO,MAAc;QACjB,OAAO,sBAAY,CAAC,iBAAM,MAAM,YAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,CAAC;IACL,kBAAC;AAAD,CAAC,AAjBD,CAAiC,yBAAiB,GAiBjD;AAjBY,kCAAW"}
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../src.ts/coders/string.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAEb,kDAAmE;AAGnE,iCAA4C;AAE5C;IAAiC,+BAAiB;IAE9C,qBAAY,SAAiB;eACzB,kBAAM,QAAQ,EAAE,SAAS,CAAC;IAC9B,CAAC;IAED,kCAAY,GAAZ;QACI,OAAO,EAAE,CAAC;IACd,CAAC;IAED,4BAAM,GAAN,UAAO,MAAc,EAAE,KAAU;QAC7B,OAAO,iBAAM,MAAM,YAAC,MAAM,EAAE,IAAA,qBAAW,EAAC,KAAK,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,4BAAM,GAAN,UAAO,MAAc;QACjB,OAAO,IAAA,sBAAY,EAAC,iBAAM,MAAM,YAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,CAAC;IACL,kBAAC;AAAD,CAAC,AAjBD,CAAiC,yBAAiB,GAiBjD;AAjBY,kCAAW"}

View File

@@ -68,10 +68,10 @@ var TupleCoder = /** @class */ (function (_super) {
return Object.freeze(values);
};
TupleCoder.prototype.encode = function (writer, value) {
return array_1.pack(writer, this.coders, value);
return (0, array_1.pack)(writer, this.coders, value);
};
TupleCoder.prototype.decode = function (reader) {
return reader.coerce(this.name, array_1.unpack(reader, this.coders));
return reader.coerce(this.name, (0, array_1.unpack)(reader, this.coders));
};
return TupleCoder;
}(abstract_coder_1.Coder));

View File

@@ -1 +1 @@
{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../src.ts/coders/tuple.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAEb,mDAAyD;AACzD,iCAAuC;AAEvC;IAAgC,8BAAK;IAGjC,oBAAY,MAAoB,EAAE,SAAiB;QAAnD,iBAWC;QAVG,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,IAAM,KAAK,GAAkB,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,UAAC,KAAK;YACjB,IAAI,KAAK,CAAC,OAAO,EAAE;gBAAE,OAAO,GAAG,IAAI,CAAC;aAAE;YACtC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,IAAM,IAAI,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QAEhD,QAAA,kBAAM,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,SAAC;QACzC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC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AAtDY,gCAAU"}

View File

@@ -210,7 +210,7 @@ function parseParamType(param, allowIndexed) {
}
function populate(object, params) {
for (var key in params) {
properties_1.defineReadOnly(object, key, params[key]);
(0, properties_1.defineReadOnly)(object, key, params[key]);
}
}
exports.FormatTypes = Object.freeze({
@@ -218,7 +218,7 @@ exports.FormatTypes = Object.freeze({
sighash: "sighash",
// Human-Readable with Minimal spacing and without names (compact human-readable)
minimal: "minimal",
// Human-Readble with nice spacing, including all names
// Human-Readable with nice spacing, including all names
full: "full",
// JSON-format a la Solidity
json: "json"
@@ -256,7 +256,7 @@ var ParamType = /** @class */ (function () {
// Format the parameter fragment
// - sighash: "(uint256,address)"
// - minimal: "tuple(uint256,address) indexed"
// - full: "tuple(uint256 foo, addres bar) indexed baz"
// - full: "tuple(uint256 foo, address bar) indexed baz"
ParamType.prototype.format = function (format) {
if (!format) {
format = exports.FormatTypes.sighash;

File diff suppressed because one or more lines are too long

View File

@@ -98,14 +98,14 @@ var Interface = /** @class */ (function () {
else {
abi = fragments;
}
properties_1.defineReadOnly(this, "fragments", abi.map(function (fragment) {
(0, properties_1.defineReadOnly)(this, "fragments", abi.map(function (fragment) {
return fragments_1.Fragment.from(fragment);
}).filter(function (fragment) { return (fragment != null); }));
properties_1.defineReadOnly(this, "_abiCoder", properties_1.getStatic((_newTarget), "getAbiCoder")());
properties_1.defineReadOnly(this, "functions", {});
properties_1.defineReadOnly(this, "errors", {});
properties_1.defineReadOnly(this, "events", {});
properties_1.defineReadOnly(this, "structs", {});
(0, properties_1.defineReadOnly)(this, "_abiCoder", (0, properties_1.getStatic)(_newTarget, "getAbiCoder")());
(0, properties_1.defineReadOnly)(this, "functions", {});
(0, properties_1.defineReadOnly)(this, "errors", {});
(0, properties_1.defineReadOnly)(this, "events", {});
(0, properties_1.defineReadOnly)(this, "structs", {});
// Add all fragments by their signature
this.fragments.forEach(function (fragment) {
var bucket = null;
@@ -116,7 +116,7 @@ var Interface = /** @class */ (function () {
return;
}
//checkNames(fragment, "input", fragment.inputs);
properties_1.defineReadOnly(_this, "deploy", fragment);
(0, properties_1.defineReadOnly)(_this, "deploy", fragment);
return;
case "function":
//checkNames(fragment, "input", fragment.inputs);
@@ -142,12 +142,12 @@ var Interface = /** @class */ (function () {
});
// If we do not have a constructor add a default
if (!this.deploy) {
properties_1.defineReadOnly(this, "deploy", fragments_1.ConstructorFragment.from({
(0, properties_1.defineReadOnly)(this, "deploy", fragments_1.ConstructorFragment.from({
payable: false,
type: "constructor"
}));
}
properties_1.defineReadOnly(this, "_isInterface", true);
(0, properties_1.defineReadOnly)(this, "_isInterface", true);
}
Interface.prototype.format = function (format) {
if (!format) {
@@ -168,17 +168,17 @@ var Interface = /** @class */ (function () {
return abi_coder_1.defaultAbiCoder;
};
Interface.getAddress = function (address) {
return address_1.getAddress(address);
return (0, address_1.getAddress)(address);
};
Interface.getSighash = function (fragment) {
return bytes_1.hexDataSlice(hash_1.id(fragment.format()), 0, 4);
return (0, bytes_1.hexDataSlice)((0, hash_1.id)(fragment.format()), 0, 4);
};
Interface.getEventTopic = function (eventFragment) {
return hash_1.id(eventFragment.format());
return (0, hash_1.id)(eventFragment.format());
};
// Find a function definition by any means necessary (unless it is ambiguous)
Interface.prototype.getFunction = function (nameOrSignatureOrSighash) {
if (bytes_1.isHexString(nameOrSignatureOrSighash)) {
if ((0, bytes_1.isHexString)(nameOrSignatureOrSighash)) {
for (var name_1 in this.functions) {
if (nameOrSignatureOrSighash === this.getSighash(name_1)) {
return this.functions[name_1];
@@ -198,7 +198,7 @@ var Interface = /** @class */ (function () {
}
return this.functions[matching[0]];
}
// Normlize the signature and lookup the function
// Normalize the signature and lookup the function
var result = this.functions[fragments_1.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
if (!result) {
logger.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
@@ -207,7 +207,7 @@ var Interface = /** @class */ (function () {
};
// Find an event definition by any means necessary (unless it is ambiguous)
Interface.prototype.getEvent = function (nameOrSignatureOrTopic) {
if (bytes_1.isHexString(nameOrSignatureOrTopic)) {
if ((0, bytes_1.isHexString)(nameOrSignatureOrTopic)) {
var topichash = nameOrSignatureOrTopic.toLowerCase();
for (var name_3 in this.events) {
if (topichash === this.getEventTopic(name_3)) {
@@ -228,7 +228,7 @@ var Interface = /** @class */ (function () {
}
return this.events[matching[0]];
}
// Normlize the signature and lookup the function
// Normalize the signature and lookup the function
var result = this.events[fragments_1.EventFragment.fromString(nameOrSignatureOrTopic).format()];
if (!result) {
logger.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
@@ -237,8 +237,8 @@ var Interface = /** @class */ (function () {
};
// Find a function definition by any means necessary (unless it is ambiguous)
Interface.prototype.getError = function (nameOrSignatureOrSighash) {
if (bytes_1.isHexString(nameOrSignatureOrSighash)) {
var getSighash = properties_1.getStatic(this.constructor, "getSighash");
if ((0, bytes_1.isHexString)(nameOrSignatureOrSighash)) {
var getSighash = (0, properties_1.getStatic)(this.constructor, "getSighash");
for (var name_5 in this.errors) {
var error = this.errors[name_5];
if (nameOrSignatureOrSighash === getSighash(error)) {
@@ -259,7 +259,7 @@ var Interface = /** @class */ (function () {
}
return this.errors[matching[0]];
}
// Normlize the signature and lookup the function
// Normalize the signature and lookup the function
var result = this.errors[fragments_1.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
if (!result) {
logger.throwArgumentError("no matching error", "signature", nameOrSignatureOrSighash);
@@ -281,14 +281,14 @@ var Interface = /** @class */ (function () {
}
}
}
return properties_1.getStatic(this.constructor, "getSighash")(fragment);
return (0, properties_1.getStatic)(this.constructor, "getSighash")(fragment);
};
// Get the topic (the bytes32 hash) used by Solidity to identify an event
Interface.prototype.getEventTopic = function (eventFragment) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
}
return properties_1.getStatic(this.constructor, "getEventTopic")(eventFragment);
return (0, properties_1.getStatic)(this.constructor, "getEventTopic")(eventFragment);
};
Interface.prototype._decodeParams = function (params, data) {
return this._abiCoder.decode(params, data);
@@ -303,9 +303,9 @@ var Interface = /** @class */ (function () {
if (typeof (fragment) === "string") {
fragment = this.getError(fragment);
}
var bytes = bytes_1.arrayify(data);
if (bytes_1.hexlify(bytes.slice(0, 4)) !== this.getSighash(fragment)) {
logger.throwArgumentError("data signature does not match error " + fragment.name + ".", "data", bytes_1.hexlify(bytes));
var bytes = (0, bytes_1.arrayify)(data);
if ((0, bytes_1.hexlify)(bytes.slice(0, 4)) !== this.getSighash(fragment)) {
logger.throwArgumentError("data signature does not match error " + fragment.name + ".", "data", (0, bytes_1.hexlify)(bytes));
}
return this._decodeParams(fragment.inputs, bytes.slice(4));
};
@@ -313,7 +313,7 @@ var Interface = /** @class */ (function () {
if (typeof (fragment) === "string") {
fragment = this.getError(fragment);
}
return bytes_1.hexlify(bytes_1.concat([
return (0, bytes_1.hexlify)((0, bytes_1.concat)([
this.getSighash(fragment),
this._encodeParams(fragment.inputs, values || [])
]));
@@ -323,9 +323,9 @@ var Interface = /** @class */ (function () {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
var bytes = bytes_1.arrayify(data);
if (bytes_1.hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {
logger.throwArgumentError("data signature does not match function " + functionFragment.name + ".", "data", bytes_1.hexlify(bytes));
var bytes = (0, bytes_1.arrayify)(data);
if ((0, bytes_1.hexlify)(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {
logger.throwArgumentError("data signature does not match function " + functionFragment.name + ".", "data", (0, bytes_1.hexlify)(bytes));
}
return this._decodeParams(functionFragment.inputs, bytes.slice(4));
};
@@ -334,7 +334,7 @@ var Interface = /** @class */ (function () {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return bytes_1.hexlify(bytes_1.concat([
return (0, bytes_1.hexlify)((0, bytes_1.concat)([
this.getSighash(functionFragment),
this._encodeParams(functionFragment.inputs, values || [])
]));
@@ -344,7 +344,7 @@ var Interface = /** @class */ (function () {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
var bytes = bytes_1.arrayify(data);
var bytes = (0, bytes_1.arrayify)(data);
var reason = null;
var errorArgs = null;
var errorName = null;
@@ -357,7 +357,7 @@ var Interface = /** @class */ (function () {
catch (error) { }
break;
case 4: {
var selector = bytes_1.hexlify(bytes.slice(0, 4));
var selector = (0, bytes_1.hexlify)(bytes.slice(0, 4));
var builtin = BuiltinErrors[selector];
if (builtin) {
errorArgs = this._abiCoder.decode(builtin.inputs, bytes.slice(4));
@@ -383,7 +383,10 @@ var Interface = /** @class */ (function () {
}
return logger.throwError("call revert exception", logger_1.Logger.errors.CALL_EXCEPTION, {
method: functionFragment.format(),
errorArgs: errorArgs, errorName: errorName, errorSignature: errorSignature, reason: reason
errorArgs: errorArgs,
errorName: errorName,
errorSignature: errorSignature,
reason: reason
});
};
// Encode the result for a function call (e.g. for eth_call)
@@ -391,7 +394,7 @@ var Interface = /** @class */ (function () {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return bytes_1.hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));
return (0, bytes_1.hexlify)(this._abiCoder.encode(functionFragment.outputs, values || []));
};
// Create the filter for the event with search criteria (e.g. for eth_filterLog)
Interface.prototype.encodeFilterTopics = function (eventFragment, values) {
@@ -411,16 +414,16 @@ var Interface = /** @class */ (function () {
}
var encodeTopic = function (param, value) {
if (param.type === "string") {
return hash_1.id(value);
return (0, hash_1.id)(value);
}
else if (param.type === "bytes") {
return keccak256_1.keccak256(bytes_1.hexlify(value));
return (0, keccak256_1.keccak256)((0, bytes_1.hexlify)(value));
}
// Check addresses are valid
if (param.type === "address") {
_this._abiCoder.encode(["address"], [value]);
}
return bytes_1.hexZeroPad(bytes_1.hexlify(value), 32);
return (0, bytes_1.hexZeroPad)((0, bytes_1.hexlify)(value), 32);
};
values.forEach(function (value, index) {
var param = eventFragment.inputs[index];
@@ -467,13 +470,13 @@ var Interface = /** @class */ (function () {
var value = values[index];
if (param.indexed) {
if (param.type === "string") {
topics.push(hash_1.id(value));
topics.push((0, hash_1.id)(value));
}
else if (param.type === "bytes") {
topics.push(keccak256_1.keccak256(value));
topics.push((0, keccak256_1.keccak256)(value));
}
else if (param.baseType === "tuple" || param.baseType === "array") {
// @TOOD
// @TODO
throw new Error("not implemented");
}
else {
@@ -497,7 +500,7 @@ var Interface = /** @class */ (function () {
}
if (topics != null && !eventFragment.anonymous) {
var topicHash = this.getEventTopic(eventFragment);
if (!bytes_1.isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {
if (!(0, bytes_1.isHexString)(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {
logger.throwError("fragment/topic mismatch", logger_1.Logger.errors.INVALID_ARGUMENT, { argument: "topics[0]", expected: topicHash, value: topics[0] });
}
topics = topics.slice(1);
@@ -521,7 +524,7 @@ var Interface = /** @class */ (function () {
dynamic.push(false);
}
});
var resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, bytes_1.concat(topics)) : null;
var resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, (0, bytes_1.concat)(topics)) : null;
var resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true);
var result = [];
var nonIndexedIndex = 0, indexedIndex = 0;
@@ -607,7 +610,7 @@ var Interface = /** @class */ (function () {
}
// @TODO: If anonymous, and the only method, and the input count matches, should we parse?
// Probably not, because just because it is the only event in the ABI does
// not mean we have the full ABI; maybe jsut a fragment?
// not mean we have the full ABI; maybe just a fragment?
return new LogDescription({
eventFragment: fragment,
name: fragment.name,
@@ -617,7 +620,7 @@ var Interface = /** @class */ (function () {
});
};
Interface.prototype.parseError = function (data) {
var hexData = bytes_1.hexlify(data);
var hexData = (0, bytes_1.hexlify)(data);
var fragment = this.getError(hexData.substring(0, 10).toLowerCase());
if (!fragment) {
return null;

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -1 +1 @@
export const version = "abi/5.4.1";
export const version = "abi/5.5.0";

View File

@@ -239,7 +239,7 @@ export const FormatTypes: { [ name: string ]: string } = Object.freeze({
// Human-Readable with Minimal spacing and without names (compact human-readable)
minimal: "minimal",
// Human-Readble with nice spacing, including all names
// Human-Readable with nice spacing, including all names
full: "full",
// JSON-format a la Solidity
@@ -306,7 +306,7 @@ export class ParamType {
// Format the parameter fragment
// - sighash: "(uint256,address)"
// - minimal: "tuple(uint256,address) indexed"
// - full: "tuple(uint256 foo, addres bar) indexed baz"
// - full: "tuple(uint256 foo, address bar) indexed baz"
format(format?: string): string {
if (!format) { format = FormatTypes.sighash; }
if (!FormatTypes[format]) {

View File

@@ -215,7 +215,7 @@ export class Interface {
return this.functions[matching[0]];
}
// Normlize the signature and lookup the function
// Normalize the signature and lookup the function
const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
if (!result) {
logger.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
@@ -248,7 +248,7 @@ export class Interface {
return this.events[matching[0]];
}
// Normlize the signature and lookup the function
// Normalize the signature and lookup the function
const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];
if (!result) {
logger.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
@@ -282,7 +282,7 @@ export class Interface {
return this.errors[matching[0]];
}
// Normlize the signature and lookup the function
// Normalize the signature and lookup the function
const result = this.errors[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
if (!result) {
logger.throwArgumentError("no matching error", "signature", nameOrSignatureOrSighash);
@@ -521,7 +521,7 @@ export class Interface {
} else if (param.type === "bytes") {
topics.push(keccak256(value))
} else if (param.baseType === "tuple" || param.baseType === "array") {
// @TOOD
// @TODO
throw new Error("not implemented");
} else {
topics.push(this._abiCoder.encode([ param.type] , [ value ]));
@@ -658,7 +658,7 @@ export class Interface {
// @TODO: If anonymous, and the only method, and the input count matches, should we parse?
// Probably not, because just because it is the only event in the ABI does
// not mean we have the full ABI; maybe jsut a fragment?
// not mean we have the full ABI; maybe just a fragment?
return new LogDescription({

View File

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

View File

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

View File

@@ -17,6 +17,7 @@ export declare type TransactionRequest = {
accessList?: AccessListish;
maxPriorityFeePerGas?: BigNumberish;
maxFeePerGas?: BigNumberish;
customData?: Record<string, any>;
};
export interface TransactionResponse extends Transaction {
hash: string;
@@ -29,13 +30,14 @@ export interface TransactionResponse extends Transaction {
wait: (confirmations?: number) => Promise<TransactionReceipt>;
}
export declare type BlockTag = string | number;
interface _Block {
export interface _Block {
hash: string;
parentHash: string;
number: number;
timestamp: number;
nonce: string;
difficulty: number;
_difficulty: BigNumber;
gasLimit: BigNumber;
gasUsed: BigNumber;
miner: string;
@@ -133,8 +135,8 @@ export declare abstract class Provider implements OnceBlockable {
abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
abstract getLogs(filter: Filter): Promise<Array<Log>>;
abstract resolveName(name: string | Promise<string>): Promise<string>;
abstract lookupAddress(address: string | Promise<string>): Promise<string>;
abstract resolveName(name: string | Promise<string>): Promise<null | string>;
abstract lookupAddress(address: string | Promise<string>): Promise<null | string>;
abstract on(eventName: EventType, listener: Listener): Provider;
abstract once(eventName: EventType, listener: Listener): Provider;
abstract emit(eventName: EventType, ...args: Array<any>): boolean;
@@ -149,5 +151,4 @@ export declare abstract class Provider implements OnceBlockable {
constructor();
static isProvider(value: any): value is Provider;
}
export {};
//# sourceMappingURL=index.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;AAEb,OAAO,EAAE,SAAS,EAAgB,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAa,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAc,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAIvG,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;AA2ClC,CAAC;AAiED,CAAC;AAsBF,qCAAqC;AACrC,0EAA0E;AAC1E,IAAI;AAEJ,MAAM,OAAgB,SAAU,SAAQ,WAAW;IAK/C,MAAM,CAAC,WAAW,CAAC,KAAU;QACzB,OAAO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 @@
export declare const version = "abstract-provider/5.4.1";
export declare const version = "abstract-provider/5.5.1";
//# sourceMappingURL=_version.d.ts.map

View File

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

View File

@@ -17,6 +17,7 @@ export declare type TransactionRequest = {
accessList?: AccessListish;
maxPriorityFeePerGas?: BigNumberish;
maxFeePerGas?: BigNumberish;
customData?: Record<string, any>;
};
export interface TransactionResponse extends Transaction {
hash: string;
@@ -29,13 +30,14 @@ export interface TransactionResponse extends Transaction {
wait: (confirmations?: number) => Promise<TransactionReceipt>;
}
export declare type BlockTag = string | number;
interface _Block {
export interface _Block {
hash: string;
parentHash: string;
number: number;
timestamp: number;
nonce: string;
difficulty: number;
_difficulty: BigNumber;
gasLimit: BigNumber;
gasUsed: BigNumber;
miner: string;
@@ -133,8 +135,8 @@ export declare abstract class Provider implements OnceBlockable {
abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
abstract getLogs(filter: Filter): Promise<Array<Log>>;
abstract resolveName(name: string | Promise<string>): Promise<string>;
abstract lookupAddress(address: string | Promise<string>): Promise<string>;
abstract resolveName(name: string | Promise<string>): Promise<null | string>;
abstract lookupAddress(address: string | Promise<string>): Promise<null | string>;
abstract on(eventName: EventType, listener: Listener): Provider;
abstract once(eventName: EventType, listener: Listener): Provider;
abstract emit(eventName: EventType, ...args: Array<any>): boolean;
@@ -149,5 +151,4 @@ export declare abstract class Provider implements OnceBlockable {
constructor();
static isProvider(value: any): value is Provider;
}
export {};
//# sourceMappingURL=index.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -78,7 +78,7 @@ var BlockForkEvent = /** @class */ (function (_super) {
__extends(BlockForkEvent, _super);
function BlockForkEvent(blockHash, expiry) {
var _this = this;
if (!bytes_1.isHexString(blockHash, 32)) {
if (!(0, bytes_1.isHexString)(blockHash, 32)) {
logger.throwArgumentError("invalid blockHash", "blockHash", blockHash);
}
_this = _super.call(this, {
@@ -96,7 +96,7 @@ var TransactionForkEvent = /** @class */ (function (_super) {
__extends(TransactionForkEvent, _super);
function TransactionForkEvent(hash, expiry) {
var _this = this;
if (!bytes_1.isHexString(hash, 32)) {
if (!(0, bytes_1.isHexString)(hash, 32)) {
logger.throwArgumentError("invalid transaction hash", "hash", hash);
}
_this = _super.call(this, {
@@ -114,10 +114,10 @@ var TransactionOrderForkEvent = /** @class */ (function (_super) {
__extends(TransactionOrderForkEvent, _super);
function TransactionOrderForkEvent(beforeHash, afterHash, expiry) {
var _this = this;
if (!bytes_1.isHexString(beforeHash, 32)) {
if (!(0, bytes_1.isHexString)(beforeHash, 32)) {
logger.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
}
if (!bytes_1.isHexString(afterHash, 32)) {
if (!(0, bytes_1.isHexString)(afterHash, 32)) {
logger.throwArgumentError("invalid transaction hash", "afterHash", afterHash);
}
_this = _super.call(this, {
@@ -138,14 +138,14 @@ var Provider = /** @class */ (function () {
function Provider() {
var _newTarget = this.constructor;
logger.checkAbstract(_newTarget, Provider);
properties_1.defineReadOnly(this, "_isProvider", true);
(0, properties_1.defineReadOnly)(this, "_isProvider", true);
}
Provider.prototype.getFeeData = function () {
return __awaiter(this, void 0, void 0, function () {
var _a, block, gasPrice, maxFeePerGas, maxPriorityFeePerGas;
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, properties_1.resolveProperties({
case 0: return [4 /*yield*/, (0, properties_1.resolveProperties)({
block: this.getBlock("latest"),
gasPrice: this.getGasPrice().catch(function (error) {
// @TODO: Why is this now failing on Calaveras?

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAC9B,6DAA6D;4BAC7D,wDAAwD;4BACxD,+CAA+C;4BAC/C,oBAAoB,GAAG,qBAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;4BACpD,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;yBACvE;wBAED,sBAAO,EAAE,YAAY,cAAA,EAAE,oBAAoB,sBAAA,EAAE,QAAQ,UAAA,EAAE,EAAC;;;;KAC3D;IAmCD,iBAAiB;IACjB,8BAAW,GAAX,UAAY,SAAoB,EAAE,QAAkB;QAChD,OAAO,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,kBAAkB;IAClB,iCAAc,GAAd,UAAe,SAAoB,EAAE,QAAkB;QACnD,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAYM,mBAAU,GAAjB,UAAkB,KAAU;QACxB,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAyCL,eAAC;AAAD,CAAC,AA/HD,IA+HC;AA/HqB,4BAAQ"}

View File

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

View File

@@ -1 +1 @@
export const version = "abstract-provider/5.4.1";
export const version = "abstract-provider/5.5.1";

View File

@@ -32,6 +32,8 @@ export type TransactionRequest = {
maxPriorityFeePerGas?: BigNumberish;
maxFeePerGas?: BigNumberish;
customData?: Record<string, any>;
}
export interface TransactionResponse extends Transaction {
@@ -56,7 +58,7 @@ export interface TransactionResponse extends Transaction {
export type BlockTag = string | number;
interface _Block {
export interface _Block {
hash: string;
parentHash: string;
number: number;
@@ -64,6 +66,7 @@ interface _Block {
timestamp: number;
nonce: string;
difficulty: number;
_difficulty: BigNumber;
gasLimit: BigNumber;
gasUsed: BigNumber;
@@ -271,8 +274,8 @@ export abstract class Provider implements OnceBlockable {
abstract getLogs(filter: Filter): Promise<Array<Log>>;
// ENS
abstract resolveName(name: string | Promise<string>): Promise<string>;
abstract lookupAddress(address: string | Promise<string>): Promise<string>;
abstract resolveName(name: string | Promise<string>): Promise<null | string>;
abstract lookupAddress(address: string | Promise<string>): Promise<null | string>;
// Event Emitter (ish)
abstract on(eventName: EventType, listener: Listener): Provider;

View File

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

View File

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

View File

@@ -13,7 +13,7 @@ import { Logger } from "@ethersproject/logger";
import { version } from "./_version";
const logger = new Logger(version);
const allowedTransactionKeys = [
"accessList", "chainId", "data", "from", "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "to", "type", "value"
"accessList", "chainId", "customData", "data", "from", "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "to", "type", "value"
];
const forwardErrors = [
Logger.errors.INSUFFICIENT_FUNDS,
@@ -43,7 +43,7 @@ export class Signer {
return yield this.provider.getTransactionCount(this.getAddress(), blockTag);
});
}
// Populates "from" if unspecified, and estimates the gas for the transation
// Populates "from" if unspecified, and estimates the gas for the transaction
estimateGas(transaction) {
return __awaiter(this, void 0, void 0, function* () {
this._checkProvider("estimateGas");
@@ -51,7 +51,7 @@ export class Signer {
return yield this.provider.estimateGas(tx);
});
}
// Populates "from" if unspecified, and calls with the transation
// Populates "from" if unspecified, and calls with the transaction
call(transaction, blockTag) {
return __awaiter(this, void 0, void 0, function* () {
this._checkProvider("call");
@@ -150,7 +150,7 @@ export class Signer {
// Prevent this error from causing an UnhandledPromiseException
tx.to.catch((error) => { });
}
// Do not allow mixing pre-eip-1559 and eip-1559 proerties
// Do not allow mixing pre-eip-1559 and eip-1559 properties
const hasEip1559 = (tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null);
if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {
logger.throwArgumentError("eip-1559 transaction do not support gasPrice", "transaction", transaction);

File diff suppressed because one or more lines are too long

View File

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

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