Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d9b29de75 | ||
|
|
e1e0929348 | ||
|
|
92def9c148 | ||
|
|
557c7d4224 | ||
|
|
83957dc283 | ||
|
|
179e6ca520 | ||
|
|
2a30facb2b | ||
|
|
9b508a4656 | ||
|
|
6372a46b1b | ||
|
|
2ba4a17255 | ||
|
|
37bf4fb555 | ||
|
|
400d57621b | ||
|
|
314595113c | ||
|
|
0bf53d7804 | ||
|
|
ef84706312 | ||
|
|
6c338c1c5b | ||
|
|
8d5a13faea | ||
|
|
24e13fc0f2 | ||
|
|
faa556c1e5 | ||
|
|
1c5e1e8201 | ||
|
|
3f7dbe75ad | ||
|
|
a0f272973d | ||
|
|
b67ad79264 | ||
|
|
ccb9a0643e | ||
|
|
d0ed91840c | ||
|
|
32b1e7827a | ||
|
|
522fd16f68 | ||
|
|
803e8f9821 | ||
|
|
2cba1c7781 | ||
|
|
0b92fed9ed | ||
|
|
0a740c470d |
81
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
81
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
name: Bug Report
|
||||
description: Open an issue for a bug in Ethers
|
||||
title: "Bug Report Title"
|
||||
labels: ["investigate"]
|
||||
assignees:
|
||||
- ricmoo
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**READ THIS FIRST** and follow all instructions, please. `:)`
|
||||
|
||||
Thank you for taking the time to report an issue. This form is for reporting **bugs within ethers**.
|
||||
|
||||
If you are **new to ethers** or *uncertain* whether this is a bug in ethers, a bug in another framework or a bug in your own code, please [start a discussion](https://github.com/ethers-io/ethers.js/discussions) first.
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Ethers Version
|
||||
description: What version of ethers are you using? Before opening an issue, please make sure you are up to date.
|
||||
placeholder: x.y.z
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: search-terms
|
||||
attributes:
|
||||
label: Search Terms
|
||||
description: Have you searched for answers [in the documentation](https://docs.ethers.org), through [the issues](https://github.com/ethers-io/ethers.js/issues) and [on the discusions](https://github.com/ethers-io/ethers.js/discussions)? Please include the search terms you have tried. This helps us add more keywords where needed.
|
||||
placeholder: e.g. abi, network, utf8
|
||||
- type: textarea
|
||||
id: about-the-bug
|
||||
attributes:
|
||||
label: Describe the Problem
|
||||
description: Please describe what you expected to happen vs what did happen?
|
||||
placeholder: What happened?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: code-snippet
|
||||
attributes:
|
||||
label: Code Snippet
|
||||
description: If possible, please include a **short and concise** code snippets that can reproduce this issue. Ideally code that can be pasted into the [Ethers Playground](https://playground.ethers.org).
|
||||
placeholder: e.g. provider.getBlockNumber()
|
||||
render: shell
|
||||
- type: textarea
|
||||
id: contract-abi
|
||||
attributes:
|
||||
label: Contract ABI
|
||||
description: If this involves a contract, please include any **concise and relevant** ABI fragments.
|
||||
placeholder: e.g. [ 'function balanceOf(address owner) view returns (uint)' ]
|
||||
render: shell
|
||||
- type: textarea
|
||||
id: errors
|
||||
attributes:
|
||||
label: Errors
|
||||
description: If there is an error, please include the **entire error** (redacting any sensitive information).
|
||||
placeholder: "e.g. Error: invalid name (code='INVALID_ARGUMENT, ...)"
|
||||
render: shell
|
||||
- type: dropdown
|
||||
id: environment
|
||||
attributes:
|
||||
label: Environment
|
||||
description: What environment, platforms or frameworks are you using? Select all that apply.
|
||||
multiple: true
|
||||
options:
|
||||
- Ethereum (mainnet/ropsten/rinkeby/goerli)
|
||||
- Altcoin - Please specify (e.g. Polygon)
|
||||
- node.js (v12 or newer)
|
||||
- node.js (older than v12)
|
||||
- Browser (Chrome, Safari, etc)
|
||||
- React Native/Expo/JavaScriptCore
|
||||
- Hardhat
|
||||
- Geth
|
||||
- Parity
|
||||
- Ganache
|
||||
- Other (please specify)
|
||||
- type: input
|
||||
id: other-envrionment
|
||||
attributes:
|
||||
label: Environment (Other)
|
||||
placeholder: anything else?
|
||||
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
||||
23
.github/ISSUE_TEMPLATE/documentation.yml
vendored
Normal file
23
.github/ISSUE_TEMPLATE/documentation.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
name: Documentation
|
||||
description: Documentation update, change or suggestion
|
||||
title: "Documentation Title"
|
||||
labels: ["documentation"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Please include anything about the [documentation](https://docs.ethers.org) you would like to see improved.
|
||||
|
||||
- Missing information or details?
|
||||
- Spelling or Grammar mistakes?
|
||||
- Wrong Information?
|
||||
- Dead or wrong links?
|
||||
- Something needs code examples?
|
||||
- General feedback or anything else?
|
||||
- type: textarea
|
||||
id: suggestion
|
||||
attributes:
|
||||
label: Suggestion
|
||||
placeholder: e.g. please add an example for ropsten
|
||||
validations:
|
||||
required: true
|
||||
26
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Normal file
26
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Feature Request
|
||||
description: Suggest a new feature or addition to Ethers
|
||||
title: "Feature Request Title"
|
||||
labels: [ "enhancement" ]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
The best place to start a new feature request is by starting an [Idea discussion](https://github.com/ethers-io/ethers.js/discussions), to mull over the feature, discuss current options and think through the impact on the overall library.
|
||||
|
||||
Keep in mind that features increase the library size, and may require additional dependencies. Ethers strives to remain lean and the number of dependencies low, so many features may make more sense as ancillary packages.
|
||||
- type: textarea
|
||||
id: about-the-feature
|
||||
attributes:
|
||||
label: Describe the Feature
|
||||
description: Please describe the feature, the problem it is solving, your solution and alternatives you've considered.
|
||||
placeholder: e.g. I want Ethers to be more/less magical.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: code-example
|
||||
attributes:
|
||||
label: Code Example
|
||||
description: Optionally, provide an example of how the feature would be used in code.
|
||||
placeholder: e.g. provider.doMagic()
|
||||
render: shell
|
||||
21
LICENSE.md
Normal file
21
LICENSE.md
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016-2023 Richard Moore
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
14
README.md
14
README.md
@@ -3,7 +3,7 @@ The Ethers Project
|
||||
|
||||
[](https://www.npmjs.com/package/ethers)
|
||||
[](https://github.com/ethers-io/ethers.js/actions/workflows/test-ci.yml)
|
||||

|
||||

|
||||

|
||||
[](https://www.gitpoap.io/gh/ethers-io/ethers.js)
|
||||
[](https://twitter.com/ricmoo)
|
||||
@@ -24,7 +24,7 @@ in [TypeScript](https://www.typescriptlang.org).
|
||||
- **Tiny** (~120kb compressed; 400kb uncompressed)
|
||||
- **Tree-shaking** focused; include only what you need during bundling
|
||||
- **Complete** functionality for all your Ethereum desires
|
||||
- Extensive [documentation](https://docs.ethers.io/v5/)
|
||||
- Extensive [documentation](https://docs.ethers.org/v6/)
|
||||
- Large collection of **test cases** which are maintained and added to
|
||||
- Fully written in **TypeScript**, with strict types for security
|
||||
- **MIT License** (including ALL dependencies); completely open source to do with as you please
|
||||
@@ -76,12 +76,10 @@ The bundled library is available in the `./dist/` folder in this repo.
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
**Note: The v6 docs are not available yet**
|
||||
Browse the [documentation](https://docs.ethers.org) online:
|
||||
|
||||
Browse the [documentation](https://docs.ethers.io) online:
|
||||
|
||||
- [Getting Started](https://docs.ethers.io/v6/getting-started/)
|
||||
- [Full API Documentation](https://docs.ethers.io/v6/api/)
|
||||
- [Getting Started](https://docs.ethers.org/v6/getting-started/)
|
||||
- [Full API Documentation](https://docs.ethers.org/v6/api/)
|
||||
- [Various Ethereum Articles](https://blog.ricmoo.com/)
|
||||
|
||||
|
||||
@@ -103,7 +101,7 @@ responses, more capacity, analytics and other features like archival
|
||||
data.
|
||||
|
||||
When you are ready to sign up and start using for your own keys, please
|
||||
check out the [Provider API Keys](https://docs.ethers.io/v5/api-keys/) in
|
||||
check out the [Provider API Keys](https://docs.ethers.org/v5/api-keys/) in
|
||||
the documentation.
|
||||
|
||||
A special thanks to these services for providing community resources:
|
||||
|
||||
34
SECURITY.md
Normal file
34
SECURITY.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Maintaining multiple versions of the library is quite time consuming, so
|
||||
the majority of the effort is focused on the latest major release.
|
||||
|
||||
If you do require a version outside of this chart updated with patch fix,
|
||||
please [contact me](mailto:github@ricmoo.com).
|
||||
|
||||
| Version | Supported | Initial Release |
|
||||
| ------- | ------------------------------------------ | ----------------- |
|
||||
| 6.0.x | :white_check_mark: | 2023-02-02 |
|
||||
| 5.0.x | :white_check_mark: (security updates) | 2020-06-12 |
|
||||
| 4.0.x | :x: | 2018-10-01 |
|
||||
| 3.0.x | :x: | 2018-03-05 |
|
||||
| 2.2.x | :x: | 2018-01-11 |
|
||||
| 2.1.x | :x: | 2017-05-22 |
|
||||
| 2.0.x | :x: | 2017-04-05 |
|
||||
| 1.0.x | :x: | 2016-08-23 |
|
||||
| 0.0.x | :x: | 2016-07-14 |
|
||||
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you identify a security vulnerability with this library (or any dependency),
|
||||
please do not hesitate to contact [github@ricmoo.com](mailto:github@ricmoo.com)
|
||||
immediately.
|
||||
|
||||
I try to respond within the same day and will address any concern as quickly
|
||||
as possible (including code fixes and publishing to NPM).
|
||||
|
||||
Any vulnerability will also be published to this file, along with credits,
|
||||
pertinent information and links to fixes.
|
||||
22
dist/README.md
vendored
Normal file
22
dist/README.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Distribution Folder
|
||||
===================
|
||||
|
||||
The contents of this folder are for using `import` in ESM
|
||||
browser-base projects.
|
||||
|
||||
The `ethers.js` (and `ethers.min.js`) files only include the
|
||||
English wordlist to conserve space.
|
||||
|
||||
For additional Wordlist support, the `wordlist-extra.js` (and
|
||||
`wordlist-extra.min.js`) should be imported too.
|
||||
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
The contents are generated via the `npm build dist` target using
|
||||
`rollup` and the `/rollup.config.js` configuration.
|
||||
|
||||
Do not modify the files in this folder. They are deleted on `build-clean`.
|
||||
|
||||
To modify this `README.md`, see the `/output/post-build/dist`.
|
||||
873
dist/ethers.js
vendored
873
dist/ethers.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/ethers.js.map
vendored
2
dist/ethers.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.min.js
vendored
2
dist/ethers.min.js
vendored
File diff suppressed because one or more lines are too long
22
dist/wordlists-extra.js
vendored
22
dist/wordlists-extra.js
vendored
@@ -145,7 +145,7 @@ const u64 = {
|
||||
add, add3L, add3H, add4L, add4H, add5H, add5L,
|
||||
};
|
||||
|
||||
const version = "6.0.0";
|
||||
const version = "6.0.3";
|
||||
|
||||
/**
|
||||
* Property helper functions.
|
||||
@@ -426,7 +426,21 @@ function replaceFunc(reason, offset, bytes, output, badCodepoint) {
|
||||
// Otherwise, process as if ignoring errors
|
||||
return ignoreFunc(reason, offset, bytes);
|
||||
}
|
||||
// Common error handing strategies
|
||||
/**
|
||||
* A handful of popular, built-in UTF-8 error handling strategies.
|
||||
*
|
||||
* **``"error"``** - throws on ANY illegal UTF-8 sequence or
|
||||
* non-canonical (overlong) codepoints (this is the default)
|
||||
*
|
||||
* **``"ignore"``** - silently drops any illegal UTF-8 sequence
|
||||
* and accepts non-canonical (overlong) codepoints
|
||||
*
|
||||
* **``"replace"``** - replace any illegal UTF-8 sequence with the
|
||||
* UTF-8 replacement character (i.e. `\ufffd`) and accepts
|
||||
* non-canonical (overlong) codepoints
|
||||
*
|
||||
* @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc>
|
||||
*/
|
||||
const Utf8ErrorFuncs = Object.freeze({
|
||||
error: errorFunc,
|
||||
ignore: ignoreFunc,
|
||||
@@ -571,7 +585,7 @@ function _toUtf8String(codePoints) {
|
||||
*
|
||||
* When %%onError%% function is specified, it is called on UTF-8
|
||||
* errors allowing recovery using the [[Utf8ErrorFunc]] API.
|
||||
* (default: [error](Utf8ErrorFuncs-error))
|
||||
* (default: [error](Utf8ErrorFuncs))
|
||||
*/
|
||||
function toUtf8String(bytes, onError) {
|
||||
return _toUtf8String(getUtf8CodePoints(bytes, onError));
|
||||
@@ -897,7 +911,7 @@ function decodeOwl(data) {
|
||||
|
||||
/**
|
||||
* A Wordlist represents a collection of language-specific
|
||||
* words used to encode and devoce [[BIP-39]] encoded data
|
||||
* words used to encode and devoce [[link-bip-39]] encoded data
|
||||
* by mapping words to 11-bit values and vice versa.
|
||||
*/
|
||||
class Wordlist {
|
||||
|
||||
2
dist/wordlists-extra.js.map
vendored
2
dist/wordlists-extra.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlists-extra.min.js
vendored
2
dist/wordlists-extra.min.js
vendored
File diff suppressed because one or more lines are too long
5
docs.wrm/README.md
Normal file
5
docs.wrm/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Documentation Source
|
||||
====================
|
||||
|
||||
This folder contains all the Flatworm source for the documentation.
|
||||
|
||||
@@ -13,11 +13,26 @@ const subtitle = (function(version) {
|
||||
return version.substring(dash + 1);
|
||||
})(version);
|
||||
|
||||
const extraLinks = function() {
|
||||
return [
|
||||
`link-cdnjs [ethers.min.js](https:/\/cdnjs.cloudflare.com/ajax/libs/ethers/${ version }/ethers.min.js)`,
|
||||
`link-cdnjs-wordlists [wordlists-extra.min.js](https:/\/cdnjs.cloudflare.com/ajax/libs/ethers/${ version }/wordlists-extra.min.js)`,
|
||||
];
|
||||
}
|
||||
|
||||
export default {
|
||||
title, subtitle,
|
||||
|
||||
// Where all the basic documentation is
|
||||
docRoot: ".",
|
||||
|
||||
// Where all the code is for the jsdocs API crawler
|
||||
codeRoot: "../src.ts/index.ts",
|
||||
|
||||
// Place all files in the /v6/ folder
|
||||
prefix: "v6",
|
||||
|
||||
// Prepare the context for running the examples
|
||||
contextify: function(context) {
|
||||
Object.assign(context, ethers);
|
||||
context.provider = new ethers.InfuraProvider();
|
||||
@@ -42,22 +57,28 @@ export default {
|
||||
};
|
||||
},
|
||||
|
||||
// The base URL to use for the <src> links
|
||||
srcBaseUrl: "https:/\/github.com/ethers-io/ethers.js/blob/main/src.ts/{FILENAME}#L{LINENO}",
|
||||
|
||||
// Used at the bottom of each page to indicate the last-modified-time.
|
||||
// This uses the most recent time in the repo that the file was
|
||||
// updated.
|
||||
getTimestamp: function(path) {
|
||||
return getModifiedTime(path);
|
||||
},
|
||||
|
||||
docRoot: ".",
|
||||
|
||||
codeRoot: "../src.ts/index.ts",
|
||||
// All the links to pull in
|
||||
links: [
|
||||
"./links/javascript.txt",
|
||||
"./links/npm.txt",
|
||||
"./links/projects.txt",
|
||||
"./links/ricmoo.txt",
|
||||
"./links/specs.txt",
|
||||
"./links/wiki.txt"
|
||||
"./links/wiki.txt",
|
||||
extraLinks
|
||||
],
|
||||
|
||||
// Extra files to copy over to the /static folder
|
||||
staticFiles: [
|
||||
"logo.svg",
|
||||
"social.jpg"
|
||||
|
||||
@@ -23,6 +23,6 @@ about the entire Application Programming Interface.
|
||||
|
||||
_subsection: Older Documentation
|
||||
|
||||
- [v5 documentation here](link-docs-v5)
|
||||
- [v4 documentation here](link-docs-v4)
|
||||
- [v3 documentation here](link-docs-v3)
|
||||
- [v5 documentation](link-docs-v5)
|
||||
- [v4 documentation](link-docs-v4)
|
||||
- [v3 documentation](link-docs-v3)
|
||||
|
||||
@@ -6,9 +6,9 @@ link-ci [Ethers CI](https://github.com/ethers-io/ethers.js/actions/runs/15800690
|
||||
link-discussion [Ethers Discussion](https://github.com/ethers-io/ethers.js/discussions)
|
||||
link-issue [Open Ethers Issue](https://github.com/ethers-io/ethers.js/issues/new/choose)
|
||||
link-issues [Ethers Issues](https://github.com/ethers-io/ethers.js/issues)
|
||||
link-docs-v3 [V3 Documentation](https://docs.ethers.io/v3/)
|
||||
link-docs-v4 [V4 Documentation](https://docs.ethers.io/v4/)
|
||||
link-docs-v5 [V5 Documentation](https://docs.ethers.io/v5/)
|
||||
link-docs-v3 [V3 Documentation](https://docs.ethers.org/v3/)
|
||||
link-docs-v4 [V4 Documentation](https://docs.ethers.org/v4/)
|
||||
link-docs-v5 [V5 Documentation](https://docs.ethers.org/v5/)
|
||||
|
||||
# Social profiles
|
||||
link-repo [GitHub Repo](https://github.com/ethers-io/ethers.js)
|
||||
|
||||
@@ -206,3 +206,23 @@ _code: default AbiCoder @lang<script>
|
||||
// instance is returned.
|
||||
coder = AbiCoder.defaultAbiCoder()
|
||||
|
||||
_code: getting a JSON-RPC quantity @lang<script>
|
||||
// In v5:
|
||||
hex = ethers.util.hexValue(value)
|
||||
|
||||
// In v6:
|
||||
hex = ethers.toQuantity(value)
|
||||
|
||||
_code: using Bytes32 strings @lang<script>
|
||||
// In v5:
|
||||
bytes32 = formatBytes32String(text)
|
||||
text = parseBytes32String(bytes32)
|
||||
|
||||
// In v6:
|
||||
bytes32 = encodeBytes32String(text)
|
||||
text = decodeBytes32String(bytes32)
|
||||
|
||||
_subsection: Removed Classes and functions
|
||||
|
||||
The **Logger** class has been replaced by
|
||||
[several Error utility functions](about-errors).
|
||||
|
||||
16
lib.commonjs/README.md
Normal file
16
lib.commonjs/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
CommonJS Files
|
||||
==============
|
||||
|
||||
The contents of this folder are for using `require` in CommonJS
|
||||
projects.
|
||||
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
The contents are generated via the `npm run build-commonjs` target
|
||||
using `tsc` and the `/tsconfig.commonjs.json` configuration.
|
||||
|
||||
Do not modify the files in this folder. They are deleted on `build-clean`.
|
||||
|
||||
To modify this `README.md`, see the `/output/post-build/lib.commonjs`.
|
||||
@@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "6.0.0";
|
||||
exports.version = "6.0.3";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
2
lib.commonjs/abi/abi-coder.d.ts
vendored
2
lib.commonjs/abi/abi-coder.d.ts
vendored
@@ -46,7 +46,7 @@ export declare class AbiCoder {
|
||||
*/
|
||||
static defaultAbiCoder(): AbiCoder;
|
||||
/**
|
||||
* Returns an ethers-compatible [[CALL_EXCEPTION]] Error for the given
|
||||
* Returns an ethers-compatible [[CallExceptionError]] Error for the given
|
||||
* result %%data%% for the [[CallExceptionAction]] %%action%% against
|
||||
* the Transaction %%tx%%.
|
||||
*/
|
||||
|
||||
@@ -190,7 +190,7 @@ class AbiCoder {
|
||||
return defaultCoder;
|
||||
}
|
||||
/**
|
||||
* Returns an ethers-compatible [[CALL_EXCEPTION]] Error for the given
|
||||
* Returns an ethers-compatible [[CallExceptionError]] Error for the given
|
||||
* result %%data%% for the [[CallExceptionAction]] %%action%% against
|
||||
* the Transaction %%tx%%.
|
||||
*/
|
||||
|
||||
11
lib.commonjs/abi/fragments.d.ts
vendored
11
lib.commonjs/abi/fragments.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* About frgaments...
|
||||
*
|
||||
* @_subsection api/abi/abi-coder:Fragments
|
||||
* @_subsection api/abi/abi-coder:Fragments [about-fragments]
|
||||
*/
|
||||
/**
|
||||
* A type description in a JSON API.
|
||||
@@ -104,26 +104,25 @@ export declare class ParamType {
|
||||
/**
|
||||
* True if the parameters is indexed.
|
||||
*
|
||||
* For non-indexable types (see [[ParamType_isIndexable]]) this
|
||||
* is ``null``.
|
||||
* For non-indexable types this is ``null``.
|
||||
*/
|
||||
readonly indexed: null | boolean;
|
||||
/**
|
||||
* The components for the tuple.
|
||||
*
|
||||
* For non-tuple types (see [[ParamType_isTuple]]) this is ``null``.
|
||||
* For non-tuple types this is ``null``.
|
||||
*/
|
||||
readonly components: null | ReadonlyArray<ParamType>;
|
||||
/**
|
||||
* The array length, or ``-1`` for dynamic-lengthed arrays.
|
||||
*
|
||||
* For non-array types (see [[ParamType_isArray]]) this is ``null``.
|
||||
* For non-array types this is ``null``.
|
||||
*/
|
||||
readonly arrayLength: null | number;
|
||||
/**
|
||||
* The type of each child in the array.
|
||||
*
|
||||
* For non-array types (see [[ParamType_isArray]]) this is ``null``.
|
||||
* For non-array types this is ``null``.
|
||||
*/
|
||||
readonly arrayChildren: null | ParamType;
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* About frgaments...
|
||||
*
|
||||
* @_subsection api/abi/abi-coder:Fragments
|
||||
* @_subsection api/abi/abi-coder:Fragments [about-fragments]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StructFragment = exports.FunctionFragment = exports.FallbackFragment = exports.ConstructorFragment = exports.EventFragment = exports.ErrorFragment = exports.NamedFragment = exports.Fragment = exports.ParamType = void 0;
|
||||
@@ -33,10 +33,12 @@ const SimpleTokens = {
|
||||
",": "COMMA", "@": "AT"
|
||||
};
|
||||
// Parser regexes to consume the next token
|
||||
const regexWhitespace = new RegExp("^(\\s*)");
|
||||
const regexNumber = new RegExp("^([0-9]+)");
|
||||
const regexIdentifier = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");
|
||||
const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))");
|
||||
const regexWhitespacePrefix = new RegExp("^(\\s*)");
|
||||
const regexNumberPrefix = new RegExp("^([0-9]+)");
|
||||
const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");
|
||||
// Parser regexs to check validity
|
||||
const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");
|
||||
const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");
|
||||
class TokenString {
|
||||
#offset;
|
||||
#tokens;
|
||||
@@ -145,7 +147,7 @@ function lex(text) {
|
||||
while (offset < text.length) {
|
||||
// Strip off any leading whitespace
|
||||
let cur = text.substring(offset);
|
||||
let match = cur.match(regexWhitespace);
|
||||
let match = cur.match(regexWhitespacePrefix);
|
||||
if (match) {
|
||||
offset += match[1].length;
|
||||
cur = text.substring(offset);
|
||||
@@ -194,7 +196,7 @@ function lex(text) {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
match = cur.match(regexIdentifier);
|
||||
match = cur.match(regexIdPrefix);
|
||||
if (match) {
|
||||
token.text = match[1];
|
||||
offset += token.text.length;
|
||||
@@ -209,7 +211,7 @@ function lex(text) {
|
||||
token.type = "ID";
|
||||
continue;
|
||||
}
|
||||
match = cur.match(regexNumber);
|
||||
match = cur.match(regexNumberPrefix);
|
||||
if (match) {
|
||||
token.text = match[1];
|
||||
token.type = "NUMBER";
|
||||
@@ -356,26 +358,25 @@ class ParamType {
|
||||
/**
|
||||
* True if the parameters is indexed.
|
||||
*
|
||||
* For non-indexable types (see [[ParamType_isIndexable]]) this
|
||||
* is ``null``.
|
||||
* For non-indexable types this is ``null``.
|
||||
*/
|
||||
indexed;
|
||||
/**
|
||||
* The components for the tuple.
|
||||
*
|
||||
* For non-tuple types (see [[ParamType_isTuple]]) this is ``null``.
|
||||
* For non-tuple types this is ``null``.
|
||||
*/
|
||||
components;
|
||||
/**
|
||||
* The array length, or ``-1`` for dynamic-lengthed arrays.
|
||||
*
|
||||
* For non-array types (see [[ParamType_isArray]]) this is ``null``.
|
||||
* For non-array types this is ``null``.
|
||||
*/
|
||||
arrayLength;
|
||||
/**
|
||||
* The type of each child in the array.
|
||||
*
|
||||
* For non-array types (see [[ParamType_isArray]]) this is ``null``.
|
||||
* For non-array types this is ``null``.
|
||||
*/
|
||||
arrayChildren;
|
||||
/**
|
||||
@@ -654,7 +655,7 @@ class ParamType {
|
||||
return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);
|
||||
}
|
||||
const name = obj.name;
|
||||
(0, index_js_1.assertArgument)(!name || (typeof (name) === "string" && name.match(regexIdentifier)), "invalid name", "obj.name", name);
|
||||
(0, index_js_1.assertArgument)(!name || (typeof (name) === "string" && name.match(regexId)), "invalid name", "obj.name", name);
|
||||
let indexed = obj.indexed;
|
||||
if (indexed != null) {
|
||||
(0, index_js_1.assertArgument)(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed);
|
||||
@@ -799,7 +800,7 @@ class NamedFragment extends Fragment {
|
||||
*/
|
||||
constructor(guard, type, name, inputs) {
|
||||
super(guard, type, inputs);
|
||||
(0, index_js_1.assertArgument)(typeof (name) === "string" && name.match(regexIdentifier), "invalid identifier", "name", name);
|
||||
(0, index_js_1.assertArgument)(typeof (name) === "string" && name.match(regexId), "invalid identifier", "name", name);
|
||||
inputs = Object.freeze(inputs.slice());
|
||||
(0, index_js_1.defineProperties)(this, { name });
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
lib.commonjs/abi/index.d.ts
vendored
2
lib.commonjs/abi/index.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Explain about ABI here...
|
||||
*
|
||||
* @_section api/abi:Application Binary Interface [abi]
|
||||
* @_section api/abi:Application Binary Interface [about-abi]
|
||||
* @_navTitle: ABI
|
||||
*/
|
||||
export { AbiCoder } from "./abi-coder.js";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Explain about ABI here...
|
||||
*
|
||||
* @_section api/abi:Application Binary Interface [abi]
|
||||
* @_section api/abi:Application Binary Interface [about-abi]
|
||||
* @_navTitle: ABI
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
||||
4
lib.commonjs/abi/interface.d.ts
vendored
4
lib.commonjs/abi/interface.d.ts
vendored
@@ -160,7 +160,7 @@ export declare class Interface {
|
||||
* specified error (see [[getError]] for valid values for
|
||||
* %%key%%).
|
||||
*
|
||||
* Most developers should prefer the [[parseResult]] method instead,
|
||||
* Most developers should prefer the [[parseCallResult]] method instead,
|
||||
* which will automatically detect a ``CALL_EXCEPTION`` and throw the
|
||||
* corresponding error.
|
||||
*/
|
||||
@@ -194,7 +194,7 @@ export declare class Interface {
|
||||
* specified function (see [[getFunction]] for valid values for
|
||||
* %%key%%).
|
||||
*
|
||||
* Most developers should prefer the [[parseResult]] method instead,
|
||||
* Most developers should prefer the [[parseCallResult]] method instead,
|
||||
* which will automatically detect a ``CALL_EXCEPTION`` and throw the
|
||||
* corresponding error.
|
||||
*/
|
||||
|
||||
@@ -570,7 +570,7 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
|
||||
* specified error (see [[getError]] for valid values for
|
||||
* %%key%%).
|
||||
*
|
||||
* Most developers should prefer the [[parseResult]] method instead,
|
||||
* Most developers should prefer the [[parseCallResult]] method instead,
|
||||
* which will automatically detect a ``CALL_EXCEPTION`` and throw the
|
||||
* corresponding error.
|
||||
*/
|
||||
@@ -640,7 +640,7 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
|
||||
* specified function (see [[getFunction]] for valid values for
|
||||
* %%key%%).
|
||||
*
|
||||
* Most developers should prefer the [[parseResult]] method instead,
|
||||
* Most developers should prefer the [[parseCallResult]] method instead,
|
||||
* which will automatically detect a ``CALL_EXCEPTION`` and throw the
|
||||
* corresponding error.
|
||||
*/
|
||||
|
||||
2
lib.commonjs/address/index.d.ts
vendored
2
lib.commonjs/address/index.d.ts
vendored
@@ -10,7 +10,7 @@
|
||||
* These functions help convert between various formats, validate
|
||||
* addresses and safely resolve ENS names.
|
||||
*
|
||||
* @_section: api/address:Addresses [addresses]
|
||||
* @_section: api/address:Addresses [about-addresses]
|
||||
*/
|
||||
/**
|
||||
* An interface for objects which have an address, and can
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* These functions help convert between various formats, validate
|
||||
* addresses and safely resolve ENS names.
|
||||
*
|
||||
* @_section: api/address:Addresses [addresses]
|
||||
* @_section: api/address:Addresses [about-addresses]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = void 0;
|
||||
|
||||
2
lib.commonjs/constants/index.d.ts
vendored
2
lib.commonjs/constants/index.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Some common constants useful for Ethereum.
|
||||
*
|
||||
* @_section: api/constants: Constants [constants]
|
||||
* @_section: api/constants: Constants [about-constants]
|
||||
*/
|
||||
export { ZeroAddress } from "./addresses.js";
|
||||
export { ZeroHash } from "./hashes.js";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Some common constants useful for Ethereum.
|
||||
*
|
||||
* @_section: api/constants: Constants [constants]
|
||||
* @_section: api/constants: Constants [about-constants]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.MessagePrefix = exports.EtherSymbol = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.N = exports.ZeroHash = exports.ZeroAddress = void 0;
|
||||
|
||||
@@ -457,7 +457,7 @@ async function _emit(contract, event, args, payloadFunc) {
|
||||
}
|
||||
const count = sub.listeners.length;
|
||||
sub.listeners = sub.listeners.filter(({ listener, once }) => {
|
||||
const passArgs = args.slice();
|
||||
const passArgs = Array.from(args);
|
||||
if (payloadFunc) {
|
||||
passArgs.push(payloadFunc(once ? null : listener));
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
lib.commonjs/contract/index.d.ts
vendored
2
lib.commonjs/contract/index.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* About contracts...
|
||||
*
|
||||
* @_section: api/contract:Contracts [contracts]
|
||||
* @_section: api/contract:Contracts [about-contracts]
|
||||
*/
|
||||
export { BaseContract, Contract } from "./contract.js";
|
||||
export { ContractFactory } from "./factory.js";
|
||||
|
||||
@@ -4,7 +4,7 @@ exports.EventLog = exports.ContractTransactionResponse = exports.ContractTransac
|
||||
/**
|
||||
* About contracts...
|
||||
*
|
||||
* @_section: api/contract:Contracts [contracts]
|
||||
* @_section: api/contract:Contracts [about-contracts]
|
||||
*/
|
||||
var contract_js_1 = require("./contract.js");
|
||||
Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return contract_js_1.BaseContract; } });
|
||||
|
||||
2
lib.commonjs/crypto/index.d.ts
vendored
2
lib.commonjs/crypto/index.d.ts
vendored
@@ -2,7 +2,7 @@
|
||||
* A fundamental building block of Ethereum is the underlying
|
||||
* cryptographic primitives.
|
||||
*
|
||||
* @_section: api/crypto:Cryptographic Functions [crypto]
|
||||
* @_section: api/crypto:Cryptographic Functions [about-crypto]
|
||||
*/
|
||||
import { computeHmac } from "./hmac.js";
|
||||
import { keccak256 } from "./keccak.js";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* A fundamental building block of Ethereum is the underlying
|
||||
* cryptographic primitives.
|
||||
*
|
||||
* @_section: api/crypto:Cryptographic Functions [crypto]
|
||||
* @_section: api/crypto:Cryptographic Functions [about-crypto]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.lock = exports.Signature = exports.SigningKey = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = void 0;
|
||||
|
||||
2
lib.commonjs/crypto/scrypt.d.ts
vendored
2
lib.commonjs/crypto/scrypt.d.ts
vendored
@@ -4,6 +4,8 @@ import type { BytesLike } from "../utils/index.js";
|
||||
* UI or provide programatic access to the progress.
|
||||
*
|
||||
* The %%percent%% is a value between ``0`` and ``1``.
|
||||
*
|
||||
* @_docloc: api/crypto:Passwords
|
||||
*/
|
||||
export type ProgressCallback = (percent: number) => void;
|
||||
/**
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":";;;AAAA,iDAAwF;AAExF,gDAA2D;AAa3D,IAAI,UAAU,GAAG,KAAK,EAAE,WAAW,GAAG,KAAK,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,WAAU,MAAkB,EAAE,IAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa,EAAE,UAA6B;IACnJ,OAAO,MAAM,IAAA,oBAAW,EAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AAC3E,CAAC,CAAA;AACD,MAAM,WAAW,GAAG,UAAS,MAAkB,EAAE,IAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa;IAC7G,OAAO,IAAA,eAAU,EAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAA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,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACzD,CAAC;AAJD,gCAIC;AACD,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC;AAC3B,UAAU,CAAC,IAAI,GAAG,cAAmB,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACzD,UAAU,CAAC,QAAQ,GAAG,UAAS,IAAyG;IACpI,IAAI,UAAU,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KAAE;IAC5D,YAAY,GAAG,IAAI,CAAC;AACxB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"}
|
||||
8
lib.commonjs/crypto/signature.d.ts
vendored
8
lib.commonjs/crypto/signature.d.ts
vendored
@@ -1,4 +1,9 @@
|
||||
import type { BigNumberish, BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* A SignatureLike
|
||||
*
|
||||
* @_docloc: api/crypto:Signing
|
||||
*/
|
||||
export type SignatureLike = Signature | string | {
|
||||
r: string;
|
||||
s: string;
|
||||
@@ -20,6 +25,9 @@ export type SignatureLike = Signature | string | {
|
||||
};
|
||||
/**
|
||||
* A Signature @TODO
|
||||
*
|
||||
*
|
||||
* @_docloc: api/crypto:Signing
|
||||
*/
|
||||
export declare class Signature {
|
||||
#private;
|
||||
|
||||
@@ -16,6 +16,9 @@ function toUint256(value) {
|
||||
}
|
||||
/**
|
||||
* A Signature @TODO
|
||||
*
|
||||
*
|
||||
* @_docloc: api/crypto:Signing
|
||||
*/
|
||||
class Signature {
|
||||
#r;
|
||||
|
||||
File diff suppressed because one or more lines are too long
5
lib.commonjs/crypto/signing-key.d.ts
vendored
5
lib.commonjs/crypto/signing-key.d.ts
vendored
@@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Add details about signing here.
|
||||
*
|
||||
* @_subsection: api/crypto:Signing [about-signing]
|
||||
*/
|
||||
import { Signature } from "./signature.js";
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
import type { SignatureLike } from "./index.js";
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Add details about signing here.
|
||||
*
|
||||
* @_subsection: api/crypto:Signing [about-signing]
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAA8C;AAE9C,gDAG2B;AAE3B,uCAAwC;AACxC,iDAA2C;AAO3C,yFAAyF;AAEzF,4BAA4B;AAC5B,SAAS,CAAC,KAAK,CAAC,cAAc,GAAG,UAAS,GAAe,EAAE,GAAG,QAA2B;IACrF,OAAO,IAAA,mBAAQ,EAAC,IAAA,qBAAW,EAAC,QAAQ,EAAE,GAAG,EAAE,IAAA,iBAAM,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC,CAAA;AAED;;;GAGG;AACH,MAAa,UAAU;IACnB,WAAW,CAAS;IAEpB;;OAEG;IACH,YAAY,UAAqB;QAC7B,IAAA,yBAAc,EAAC,IAAA,qBAAU,EAAC,UAAU,CAAC,KAAK,EAAE,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;QACjG,IAAI,CAAC,WAAW,GAAG,IAAA,kBAAO,EAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,IAAI,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAErD;;;;;OAKG;IACH,IAAI,SAAS,KAAa,OAAO,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAEjF;;;;;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gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QACnF,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QACnF,OAAO,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IACpD,CAAC;CACJ;AA3KD,gCA2KC"}
|
||||
2
lib.commonjs/hash/index.d.ts
vendored
2
lib.commonjs/hash/index.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* About hashing here...
|
||||
*
|
||||
* @_section: api/hashing:Hashing Utilities [hashing]
|
||||
* @_section: api/hashing:Hashing Utilities [about-hashing]
|
||||
*/
|
||||
export { id } from "./id.js";
|
||||
export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* About hashing here...
|
||||
*
|
||||
* @_section: api/hashing:Hashing Utilities [hashing]
|
||||
* @_section: api/hashing:Hashing Utilities [about-hashing]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = void 0;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -33,7 +33,7 @@ function showThrottleMessage(service) {
|
||||
console.log("signing up for your own API keys to improve performance, increase your");
|
||||
console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");
|
||||
console.log("");
|
||||
console.log("For more details: https:/\/docs.ethers.io/api-keys/");
|
||||
console.log("For more details: https:/\/docs.ethers.org/api-keys/");
|
||||
console.log("==========================");
|
||||
}
|
||||
exports.showThrottleMessage = showThrottleMessage;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IAC/C,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO;KAAE;IACnC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,6BAA8B,OAAQ,sCAAsC,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC;AAhBD,kDAgBC"}
|
||||
{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IAC/C,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO;KAAE;IACnC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,6BAA8B,OAAQ,sCAAsC,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC;AAhBD,kDAgBC"}
|
||||
@@ -161,7 +161,7 @@ const _formatTransactionReceipt = object({
|
||||
cumulativeGasUsed: index_js_4.getBigInt,
|
||||
effectiveGasPrice: allowNull(index_js_4.getBigInt),
|
||||
status: allowNull(index_js_4.getNumber),
|
||||
type: index_js_4.getNumber
|
||||
type: allowNull(index_js_4.getNumber, 0)
|
||||
}, {
|
||||
effectiveGasPrice: ["gasPrice"],
|
||||
hash: ["transactionHash"],
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
lib.commonjs/providers/index.d.ts
vendored
2
lib.commonjs/providers/index.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* About providers.
|
||||
*
|
||||
* @_section: api/providers:Providers [providers]
|
||||
* @_section: api/providers:Providers [about-providers]
|
||||
*/
|
||||
export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js";
|
||||
export { AbstractSigner, VoidSigner, } from "./abstract-signer.js";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* About providers.
|
||||
*
|
||||
* @_section: api/providers:Providers [providers]
|
||||
* @_section: api/providers:Providers [about-providers]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanPlugin = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.copyRequest = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = exports.NonceManager = exports.Network = exports.EnsResolver = exports.getDefaultProvider = exports.showThrottleMessage = exports.VoidSigner = exports.AbstractSigner = exports.UnmanagedSubscriber = exports.AbstractProvider = void 0;
|
||||
|
||||
@@ -18,6 +18,7 @@ const abstract_provider_js_1 = require("./abstract-provider.js");
|
||||
const abstract_signer_js_1 = require("./abstract-signer.js");
|
||||
const network_js_1 = require("./network.js");
|
||||
const subscriber_filterid_js_1 = require("./subscriber-filterid.js");
|
||||
const subscriber_polling_js_1 = require("./subscriber-polling.js");
|
||||
const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g);
|
||||
//const Methods = "getAddress,then".split(/,/g);
|
||||
function deepCopy(value) {
|
||||
@@ -423,6 +424,9 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
return new subscriber_filterid_js_1.FilterIdPendingSubscriber(this);
|
||||
}
|
||||
if (sub.type === "event") {
|
||||
if (this._getOption("polling")) {
|
||||
return new subscriber_polling_js_1.PollingEventSubscriber(this, sub.filter);
|
||||
}
|
||||
return new subscriber_filterid_js_1.FilterIdEventSubscriber(this, sub.filter);
|
||||
}
|
||||
// Orphaned Logs are handled automatically, by the filter, since
|
||||
@@ -578,74 +582,6 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
const e = index_js_1.AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null));
|
||||
e.info = { error, payload };
|
||||
return e;
|
||||
/*
|
||||
let message = "missing revert data during JSON-RPC call";
|
||||
|
||||
const action = <"call" | "estimateGas" | "unknown">(({ eth_call: "call", eth_estimateGas: "estimateGas" })[method] || "unknown");
|
||||
let data: null | string = null;
|
||||
let reason: null | string = null;
|
||||
const transaction = <{ from: string, to: string, data: string }>((<any>payload).params[0]);
|
||||
const invocation = null;
|
||||
let revert: null | { signature: string, name: string, args: Array<any> } = null;
|
||||
|
||||
if (result) {
|
||||
// @TODO: Extract errorSignature, errorName, errorArgs, reason if
|
||||
// it is Error(string) or Panic(uint25)
|
||||
message = "execution reverted during JSON-RPC call";
|
||||
data = result.data;
|
||||
|
||||
let bytes = getBytes(data);
|
||||
if (bytes.length % 32 !== 4) {
|
||||
message += " (could not parse reason; invalid data length)";
|
||||
|
||||
} else if (data.substring(0, 10) === "0x08c379a0") {
|
||||
// Error(string)
|
||||
try {
|
||||
if (bytes.length < 68) { throw new Error("bad length"); }
|
||||
bytes = bytes.slice(4);
|
||||
const pointer = getNumber(hexlify(bytes.slice(0, 32)));
|
||||
bytes = bytes.slice(pointer);
|
||||
if (bytes.length < 32) { throw new Error("overrun"); }
|
||||
const length = getNumber(hexlify(bytes.slice(0, 32)));
|
||||
bytes = bytes.slice(32);
|
||||
if (bytes.length < length) { throw new Error("overrun"); }
|
||||
reason = toUtf8String(bytes.slice(0, length));
|
||||
revert = {
|
||||
signature: "Error(string)",
|
||||
name: "Error",
|
||||
args: [ reason ]
|
||||
};
|
||||
message += `: ${ JSON.stringify(reason) }`;
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
message += " (could not parse reason; invalid data length)";
|
||||
}
|
||||
|
||||
} else if (data.substring(0, 10) === "0x4e487b71") {
|
||||
// Panic(uint256)
|
||||
try {
|
||||
if (bytes.length !== 36) { throw new Error("bad length"); }
|
||||
const arg = getNumber(hexlify(bytes.slice(4)));
|
||||
revert = {
|
||||
signature: "Panic(uint256)",
|
||||
name: "Panic",
|
||||
args: [ arg ]
|
||||
};
|
||||
reason = `Panic due to ${ PanicReasons.get(Number(arg)) || "UNKNOWN" }(${ arg })`;
|
||||
message += `: ${ reason }`;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
message += " (could not parse panic reason)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return makeError(message, "CALL_EXCEPTION", {
|
||||
action, data, reason, transaction, invocation, revert,
|
||||
info: { payload, error }
|
||||
});
|
||||
*/
|
||||
}
|
||||
// Only estimateGas and call can return arbitrary contract-defined text, so now we
|
||||
// we can process text safely.
|
||||
@@ -670,7 +606,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
const transaction = (payload.params[0]);
|
||||
if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
|
||||
return (0, index_js_5.makeError)("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", {
|
||||
transaction
|
||||
transaction, info: { error }
|
||||
});
|
||||
}
|
||||
if (message.match(/nonce/i) && message.match(/too low/i)) {
|
||||
@@ -688,7 +624,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
}
|
||||
if (message.match(/the method .* does not exist/i)) {
|
||||
return (0, index_js_5.makeError)("unsupported operation", "UNSUPPORTED_OPERATION", {
|
||||
operation: payload.method
|
||||
operation: payload.method, info: { error }
|
||||
});
|
||||
}
|
||||
return (0, index_js_5.makeError)("could not coalesce error", "UNKNOWN_ERROR", { error });
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
lib.commonjs/providers/provider.d.ts
vendored
4
lib.commonjs/providers/provider.d.ts
vendored
@@ -177,7 +177,7 @@ export declare class Block implements BlockParams, Iterable<string> {
|
||||
* prefetched them, by passing ``true`` to %%prefetchTxs%%
|
||||
* into [[provider_getBlock]].
|
||||
*/
|
||||
get transactionResponses(): Array<TransactionResponse>;
|
||||
get prefetchedTransactions(): Array<TransactionResponse>;
|
||||
/**
|
||||
* Returns a JSON-friendly value.
|
||||
*/
|
||||
@@ -195,7 +195,7 @@ export declare class Block implements BlockParams, Iterable<string> {
|
||||
* Get the transaction at %%indexe%% within this block.
|
||||
*/
|
||||
getTransaction(indexOrHash: number | string): Promise<TransactionResponse>;
|
||||
getTransactionResponse(indexOrHash: number | string): TransactionResponse;
|
||||
getPrefetchedTransaction(indexOrHash: number | string): TransactionResponse;
|
||||
/**
|
||||
* Has this block been mined.
|
||||
*
|
||||
|
||||
@@ -233,7 +233,7 @@ class Block {
|
||||
* prefetched them, by passing ``true`` to %%prefetchTxs%%
|
||||
* into [[provider_getBlock]].
|
||||
*/
|
||||
get transactionResponses() {
|
||||
get prefetchedTransactions() {
|
||||
const txs = this.#transactions.slice();
|
||||
// Doesn't matter...
|
||||
if (txs.length === 0) {
|
||||
@@ -326,8 +326,8 @@ class Block {
|
||||
return tx;
|
||||
}
|
||||
}
|
||||
getTransactionResponse(indexOrHash) {
|
||||
const txs = this.transactionResponses;
|
||||
getPrefetchedTransaction(indexOrHash) {
|
||||
const txs = this.prefetchedTransactions;
|
||||
if (typeof (indexOrHash) === "number") {
|
||||
return txs[indexOrHash];
|
||||
}
|
||||
@@ -337,7 +337,7 @@ class Block {
|
||||
return tx;
|
||||
}
|
||||
}
|
||||
throw new Error("no such tx");
|
||||
(0, index_js_1.assertArgument)(false, "no matching transaction", "indexOrHash", indexOrHash);
|
||||
}
|
||||
/**
|
||||
* Has this block been mined.
|
||||
@@ -362,23 +362,6 @@ class Block {
|
||||
exports.Block = Block;
|
||||
//////////////////////
|
||||
// Log
|
||||
/*
|
||||
export interface LogParams {
|
||||
transactionHash: string;
|
||||
blockHash: string;
|
||||
blockNumber: number;
|
||||
|
||||
removed: boolean;
|
||||
|
||||
address: string;
|
||||
data: string;
|
||||
|
||||
topics: ReadonlyArray<string>;
|
||||
|
||||
index: number;
|
||||
transactionIndex: number;
|
||||
}
|
||||
*/
|
||||
class Log {
|
||||
provider;
|
||||
transactionHash;
|
||||
@@ -405,9 +388,6 @@ class Log {
|
||||
transactionIndex: log.transactionIndex,
|
||||
});
|
||||
}
|
||||
//connect(provider: Provider): Log {
|
||||
// return new Log(this, provider);
|
||||
//}
|
||||
toJSON() {
|
||||
const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex } = this;
|
||||
return {
|
||||
@@ -439,32 +419,6 @@ exports.Log = Log;
|
||||
//////////////////////
|
||||
// Transaction Receipt
|
||||
/*
|
||||
export interface TransactionReceiptParams {
|
||||
to: null | string;
|
||||
from: string;
|
||||
contractAddress: null | string;
|
||||
|
||||
hash: string;
|
||||
index: number;
|
||||
|
||||
blockHash: string;
|
||||
blockNumber: number;
|
||||
|
||||
logsBloom: string;
|
||||
logs: ReadonlyArray<LogParams>;
|
||||
|
||||
gasUsed: bigint;
|
||||
cumulativeGasUsed: bigint;
|
||||
gasPrice?: null | bigint;
|
||||
effectiveGasPrice?: null | bigint;
|
||||
|
||||
type: number;
|
||||
//byzantium: boolean;
|
||||
status: null | number;
|
||||
root: null | string;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
export interface LegacyTransactionReceipt {
|
||||
byzantium: false;
|
||||
status: null;
|
||||
@@ -519,9 +473,6 @@ class TransactionReceipt {
|
||||
});
|
||||
}
|
||||
get logs() { return this.#logs; }
|
||||
//connect(provider: Provider): TransactionReceipt {
|
||||
// return new TransactionReceipt(this, provider);
|
||||
//}
|
||||
toJSON() {
|
||||
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,
|
||||
status, root } = this;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -10,13 +10,19 @@ const index_js_1 = require("../utils/index.js");
|
||||
class BlockConnectionSubscriber {
|
||||
#provider;
|
||||
#blockNumber;
|
||||
#running;
|
||||
#filterId;
|
||||
constructor(provider) {
|
||||
this.#provider = provider;
|
||||
this.#blockNumber = -2;
|
||||
this.#running = false;
|
||||
this.#filterId = null;
|
||||
}
|
||||
start() {
|
||||
if (this.#running) {
|
||||
return;
|
||||
}
|
||||
this.#running = true;
|
||||
this.#filterId = this.#provider._subscribe(["newHeads"], (result) => {
|
||||
const blockNumber = (0, index_js_1.getNumber)(result.number);
|
||||
const initial = (this.#blockNumber === -2) ? blockNumber : (this.#blockNumber + 1);
|
||||
@@ -27,6 +33,10 @@ class BlockConnectionSubscriber {
|
||||
});
|
||||
}
|
||||
stop() {
|
||||
if (!this.#running) {
|
||||
return;
|
||||
}
|
||||
this.#running = false;
|
||||
if (this.#filterId != null) {
|
||||
this.#provider._unsubscribe(this.#filterId);
|
||||
this.#filterId = null;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":";;;AACA,gDAA8C;AAmB9C;;;;GAIG;AACH,MAAa,yBAAyB;IAClC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,SAAS,CAAgB;IAEzB,YAAY,QAA+B;QACvC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAE,UAAU,CAAE,EAAE,CAAC,MAAW,EAAE,EAAE;YACvE,MAAM,WAAW,GAAG,IAAA,oBAAS,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA;YACjF,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE;gBACzC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;aACnC;YACD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI;QACA,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YACxB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACzB;IACL,CAAC;IAED,KAAK,CAAC,eAAyB;QAC3B,IAAI,eAAe,EAAE;YAAE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SAAE;QAChD,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ;AAtCD,8DAsCC"}
|
||||
{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":";;;AACA,gDAA8C;AAmB9C;;;;GAIG;AACH,MAAa,yBAAyB;IAClC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,QAAQ,CAAU;IAElB,SAAS,CAAgB;IAEzB,YAAY,QAA+B;QACvC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;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AC;IAChB,CAAC;IAED,MAAM;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ;AA/CD,8DA+CC"}
|
||||
@@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FilterIdPendingSubscriber = exports.FilterIdEventSubscriber = exports.FilterIdSubscriber = void 0;
|
||||
const index_js_1 = require("../utils/index.js");
|
||||
const subscriber_polling_js_1 = require("./subscriber-polling.js");
|
||||
function copy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
@@ -19,12 +20,14 @@ class FilterIdSubscriber {
|
||||
#provider;
|
||||
#filterIdPromise;
|
||||
#poller;
|
||||
#running;
|
||||
#network;
|
||||
#hault;
|
||||
constructor(provider) {
|
||||
this.#provider = provider;
|
||||
this.#filterIdPromise = null;
|
||||
this.#poller = this.#poll.bind(this);
|
||||
this.#running = false;
|
||||
this.#network = null;
|
||||
this.#hault = false;
|
||||
}
|
||||
@@ -39,11 +42,24 @@ class FilterIdSubscriber {
|
||||
}
|
||||
async #poll(blockNumber) {
|
||||
try {
|
||||
// Subscribe if necessary
|
||||
if (this.#filterIdPromise == null) {
|
||||
this.#filterIdPromise = this._subscribe(this.#provider);
|
||||
}
|
||||
const filterId = await this.#filterIdPromise;
|
||||
// Get the Filter ID
|
||||
let filterId = null;
|
||||
try {
|
||||
filterId = await this.#filterIdPromise;
|
||||
}
|
||||
catch (error) {
|
||||
if (!(0, index_js_1.isError)(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
// The backend does not support Filter ID; downgrade to
|
||||
// polling
|
||||
if (filterId == null) {
|
||||
this.#filterIdPromise = null;
|
||||
this.#provider._recoverSubscriber(this, this._recover(this.#provider));
|
||||
return;
|
||||
}
|
||||
@@ -74,8 +90,18 @@ class FilterIdSubscriber {
|
||||
});
|
||||
}
|
||||
}
|
||||
start() { this.#poll(-2); }
|
||||
start() {
|
||||
if (this.#running) {
|
||||
return;
|
||||
}
|
||||
this.#running = true;
|
||||
this.#poll(-2);
|
||||
}
|
||||
stop() {
|
||||
if (!this.#running) {
|
||||
return;
|
||||
}
|
||||
this.#running = false;
|
||||
this.#hault = true;
|
||||
this.#teardown();
|
||||
this.#provider.off("block", this.#poller);
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":";;;AAAA,mEAAiE;AAQjE,SAAS,IAAI,CAAC,GAAQ;IAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAa,kBAAkB;IAC3B,SAAS,CAAqB;IAE9B,gBAAgB,CAAyB;IACzC,OAAO,CAA+B;IAEtC,QAAQ,CAAiB;IAEzB,MAAM,CAAU;IAEhB,YAAY,QAA4B;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,UAAU,CAAC,QAA4B;QACnC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;IAED,YAAY,CAAC,QAA0B,EAAE,MAAkB;QACvD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;IAED,QAAQ,CAAC,QAA0B;QAC/B,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,WAAmB;QAC3B,IAAI;Y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AC,CAAC,CAAC;SAC5E;IACL,CAAC;CACJ;AAtBD,0DAsBC;AAED;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,kBAAkB;IAC7D,KAAK,CAAC,UAAU,CAAC,QAA4B;QACzC,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAG,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SACpC;IACL,CAAC;CACJ;AAVD,8DAUC"}
|
||||
@@ -68,14 +68,14 @@ class PollingBlockSubscriber {
|
||||
}
|
||||
start() {
|
||||
if (this.#poller) {
|
||||
throw new Error("subscriber already running");
|
||||
return;
|
||||
}
|
||||
this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);
|
||||
this.#poll();
|
||||
}
|
||||
stop() {
|
||||
if (!this.#poller) {
|
||||
throw new Error("subscriber not running");
|
||||
return;
|
||||
}
|
||||
this.#provider._clearTimeout(this.#poller);
|
||||
this.#poller = null;
|
||||
@@ -99,8 +99,10 @@ exports.PollingBlockSubscriber = PollingBlockSubscriber;
|
||||
class OnBlockSubscriber {
|
||||
#provider;
|
||||
#poll;
|
||||
#running;
|
||||
constructor(provider) {
|
||||
this.#provider = provider;
|
||||
this.#running = false;
|
||||
this.#poll = (blockNumber) => {
|
||||
this._poll(blockNumber, this.#provider);
|
||||
};
|
||||
@@ -109,10 +111,18 @@ class OnBlockSubscriber {
|
||||
throw new Error("sub-classes must override this");
|
||||
}
|
||||
start() {
|
||||
if (this.#running) {
|
||||
return;
|
||||
}
|
||||
this.#running = true;
|
||||
this.#poll(-2);
|
||||
this.#provider.on("block", this.#poll);
|
||||
}
|
||||
stop() {
|
||||
if (!this.#running) {
|
||||
return;
|
||||
}
|
||||
this.#running = false;
|
||||
this.#provider.off("block", this.#poll);
|
||||
}
|
||||
pause(dropWhilePaused) { this.stop(); }
|
||||
@@ -164,6 +174,7 @@ class PollingEventSubscriber {
|
||||
#provider;
|
||||
#filter;
|
||||
#poller;
|
||||
#running;
|
||||
// The most recent block we have scanned for events. The value -2
|
||||
// indicates we still need to fetch an initial block number
|
||||
#blockNumber;
|
||||
@@ -171,6 +182,7 @@ class PollingEventSubscriber {
|
||||
this.#provider = provider;
|
||||
this.#filter = copy(filter);
|
||||
this.#poller = this.#poll.bind(this);
|
||||
this.#running = false;
|
||||
this.#blockNumber = -2;
|
||||
}
|
||||
async #poll(blockNumber) {
|
||||
@@ -196,6 +208,10 @@ class PollingEventSubscriber {
|
||||
}
|
||||
}
|
||||
start() {
|
||||
if (this.#running) {
|
||||
return;
|
||||
}
|
||||
this.#running = true;
|
||||
if (this.#blockNumber === -2) {
|
||||
this.#provider.getBlockNumber().then((blockNumber) => {
|
||||
this.#blockNumber = blockNumber;
|
||||
@@ -204,6 +220,10 @@ class PollingEventSubscriber {
|
||||
this.#provider.on("block", this.#poller);
|
||||
}
|
||||
stop() {
|
||||
if (!this.#running) {
|
||||
return;
|
||||
}
|
||||
this.#running = false;
|
||||
this.#provider.off("block", this.#poller);
|
||||
}
|
||||
pause(dropWhilePaused) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
lib.commonjs/providers/subscriber.d.ts
vendored
1
lib.commonjs/providers/subscriber.d.ts
vendored
@@ -1 +0,0 @@
|
||||
export {};
|
||||
@@ -1,58 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/*
|
||||
import { defineProperties } from "@ethersproject/properties";
|
||||
export type EventCommon = "block" | "debug" | "blockObject";
|
||||
|
||||
export type Event = EventCommon | string | { address?: string, topics: Array<string | Array<string>> }
|
||||
|
||||
export type EventLike = Event | Array<string>;
|
||||
|
||||
export function getTag(eventName: Event): string {
|
||||
if (typeof(eventName) === "string") { return eventName; }
|
||||
|
||||
if (typeof(eventName) === "object") {
|
||||
return (eventName.address || "*") + (eventName.topics || []).map((topic) => {
|
||||
if (typeof(topic) === "string") { return topic; }
|
||||
return topic.join("|");
|
||||
}).join("&");
|
||||
}
|
||||
|
||||
throw new Error("FOO");
|
||||
}
|
||||
|
||||
export function getEvent(tag: string): Event {
|
||||
}
|
||||
|
||||
let nextId = 1;
|
||||
|
||||
export class Subscriber {
|
||||
readonly id!: number;
|
||||
readonly tag!: string;
|
||||
|
||||
#paused: boolean;
|
||||
#blockNumber: number;
|
||||
|
||||
constructor(tag: string) {
|
||||
this.#paused = false;
|
||||
this.#blockNumber = -1;
|
||||
defineProperties<Subscriber>(this, { id: nextId++, tag });
|
||||
}
|
||||
|
||||
get blockNumber(): number {
|
||||
return this.#blockNumber;
|
||||
}
|
||||
_setBlockNumber(blockNumber: number): void { this.#blockNumber = blockNumber; }
|
||||
|
||||
setup(): void { }
|
||||
teardown(): void { }
|
||||
|
||||
isPaused(): boolean { return this.#paused; }
|
||||
pause(): void { this.#paused = true; }
|
||||
resume(): void { this.#paused = false; }
|
||||
|
||||
resubscribeInfo(): string { return this.tag; }
|
||||
resubscribe(info: string): boolean { return true; }
|
||||
}
|
||||
*/
|
||||
//# sourceMappingURL=subscriber.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"subscriber.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDE"}
|
||||
2
lib.commonjs/transaction/index.d.ts
vendored
2
lib.commonjs/transaction/index.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Transactions..
|
||||
*
|
||||
* @_section api/transaction:Transactions [transactions]
|
||||
* @_section api/transaction:Transactions [about-transactions]
|
||||
*/
|
||||
/**
|
||||
* A single [[AccessList]] entry of storage keys (slots) for an address.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Transactions..
|
||||
*
|
||||
* @_section api/transaction:Transactions [transactions]
|
||||
* @_section api/transaction:Transactions [about-transactions]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = void 0;
|
||||
|
||||
30
lib.commonjs/utils/base64.d.ts
vendored
30
lib.commonjs/utils/base64.d.ts
vendored
@@ -1,9 +1,39 @@
|
||||
import type { BytesLike } from "./data.js";
|
||||
/**
|
||||
* Decodes the base-64 encoded %%value%%.
|
||||
*
|
||||
* @example:
|
||||
* // The decoded value is always binary data...
|
||||
* result = decodeBase64("SGVsbG8gV29ybGQhIQ==")
|
||||
* //_result:
|
||||
*
|
||||
* // ...use toUtf8String to convert it to a string.
|
||||
* toUtf8String(result)
|
||||
* //_result:
|
||||
*
|
||||
* // Decoding binary data
|
||||
* decodeBase64("EjQ=")
|
||||
* //_result:
|
||||
*/
|
||||
export declare function decodeBase64(value: string): Uint8Array;
|
||||
/**
|
||||
* Encodes %%data%% as a base-64 encoded string.
|
||||
*
|
||||
* @example:
|
||||
* // Encoding binary data as a hexstring
|
||||
* encodeBase64("0x1234")
|
||||
* //_result:
|
||||
*
|
||||
* // Encoding binary data as a Uint8Array
|
||||
* encodeBase64(new Uint8Array([ 0x12, 0x34 ]))
|
||||
* //_result:
|
||||
*
|
||||
* // The input MUST be data...
|
||||
* encodeBase64("Hello World!!")
|
||||
* //_error:
|
||||
*
|
||||
* // ...use toUtf8Bytes for this.
|
||||
* encodeBase64(toUtf8Bytes("Hello World!!"))
|
||||
* //_result:
|
||||
*/
|
||||
export declare function encodeBase64(data: BytesLike): string;
|
||||
|
||||
@@ -12,6 +12,19 @@ exports.encodeBase64 = exports.decodeBase64 = void 0;
|
||||
const data_js_1 = require("./data.js");
|
||||
/**
|
||||
* Decodes the base-64 encoded %%value%%.
|
||||
*
|
||||
* @example:
|
||||
* // The decoded value is always binary data...
|
||||
* result = decodeBase64("SGVsbG8gV29ybGQhIQ==")
|
||||
* //_result:
|
||||
*
|
||||
* // ...use toUtf8String to convert it to a string.
|
||||
* toUtf8String(result)
|
||||
* //_result:
|
||||
*
|
||||
* // Decoding binary data
|
||||
* decodeBase64("EjQ=")
|
||||
* //_result:
|
||||
*/
|
||||
function decodeBase64(value) {
|
||||
return (0, data_js_1.getBytesCopy)(Buffer.from(value, "base64"));
|
||||
@@ -20,6 +33,23 @@ exports.decodeBase64 = decodeBase64;
|
||||
;
|
||||
/**
|
||||
* Encodes %%data%% as a base-64 encoded string.
|
||||
*
|
||||
* @example:
|
||||
* // Encoding binary data as a hexstring
|
||||
* encodeBase64("0x1234")
|
||||
* //_result:
|
||||
*
|
||||
* // Encoding binary data as a Uint8Array
|
||||
* encodeBase64(new Uint8Array([ 0x12, 0x34 ]))
|
||||
* //_result:
|
||||
*
|
||||
* // The input MUST be data...
|
||||
* encodeBase64("Hello World!!")
|
||||
* //_error:
|
||||
*
|
||||
* // ...use toUtf8Bytes for this.
|
||||
* encodeBase64(toUtf8Bytes("Hello World!!"))
|
||||
* //_result:
|
||||
*/
|
||||
function encodeBase64(data) {
|
||||
return Buffer.from((0, data_js_1.getBytes)(data)).toString("base64");
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCAAmD;AAKnD;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAa;IACtC,OAAO,IAAA,sBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AAFD,oCAEC;AAAA,CAAC;AAEF;;GAEG;AACH,SAAgB,YAAY,CAAC,IAAe;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAFD,oCAEC"}
|
||||
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCAAmD;AAKnD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,YAAY,CAAC,KAAa;IACtC,OAAO,IAAA,sBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AAFD,oCAEC;AAAA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,YAAY,CAAC,IAAe;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAFD,oCAEC"}
|
||||
4
lib.commonjs/utils/data.d.ts
vendored
4
lib.commonjs/utils/data.d.ts
vendored
@@ -72,7 +72,7 @@ export declare function stripZerosLeft(data: BytesLike): string;
|
||||
* Return the [[DataHexString]] of %%data%% padded on the **left**
|
||||
* to %%length%% bytes.
|
||||
*
|
||||
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is
|
||||
* If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
|
||||
* thrown.
|
||||
*
|
||||
* This pads data the same as **values** are in Solidity
|
||||
@@ -83,7 +83,7 @@ export declare function zeroPadValue(data: BytesLike, length: number): string;
|
||||
* Return the [[DataHexString]] of %%data%% padded on the **right**
|
||||
* to %%length%% bytes.
|
||||
*
|
||||
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is
|
||||
* If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
|
||||
* thrown.
|
||||
*
|
||||
* This pads data the same as **bytes** are in Solidity
|
||||
|
||||
@@ -157,7 +157,7 @@ function zeroPad(data, length, left) {
|
||||
* Return the [[DataHexString]] of %%data%% padded on the **left**
|
||||
* to %%length%% bytes.
|
||||
*
|
||||
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is
|
||||
* If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
|
||||
* thrown.
|
||||
*
|
||||
* This pads data the same as **values** are in Solidity
|
||||
@@ -171,7 +171,7 @@ exports.zeroPadValue = zeroPadValue;
|
||||
* Return the [[DataHexString]] of %%data%% padded on the **right**
|
||||
* to %%length%% bytes.
|
||||
*
|
||||
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is
|
||||
* If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
|
||||
* thrown.
|
||||
*
|
||||
* This pads data the same as **bytes** are in Solidity
|
||||
|
||||
63
lib.commonjs/utils/errors.d.ts
vendored
63
lib.commonjs/utils/errors.d.ts
vendored
@@ -10,11 +10,62 @@ export type ErrorInfo<T> = Omit<T, "code" | "name" | "message">;
|
||||
* All errors emitted by ethers have an **ErrorCode** to help
|
||||
* identify and coalesce errors to simplfy programatic analysis.
|
||||
*
|
||||
* _property: ``"UNKNOWN_ERROR"``
|
||||
* This is a general puspose fallback when no other error makes sense
|
||||
* or the error wasn't expected
|
||||
* Each **ErrorCode** is the %%code%% proerty of a coresponding
|
||||
* [[EthersError]].
|
||||
*
|
||||
* _property: ``"NOT_IMPLEMENTED"``
|
||||
* **Generic Errors**
|
||||
*
|
||||
* **``"UNKNOWN_ERROR"``** - see [[UnknownError]]
|
||||
*
|
||||
* **``"NOT_IMPLEMENTED"``** - see [[NotImplementedError]]
|
||||
*
|
||||
* **``"UNSUPPORTED_OPERATION"``** - see [[UnsupportedOperationError]]
|
||||
*
|
||||
* **``"NETWORK_ERROR"``** - see [[NetworkError]]
|
||||
*
|
||||
* **``"SERVER_ERROR"``** - see [[ServerError]]
|
||||
*
|
||||
* **``"TIMEOUT"``** - see [[TimeoutError]]
|
||||
*
|
||||
* **``"BAD_DATA"``** - see [[BadDataError]]
|
||||
*
|
||||
* **``"CANCELLED"``** - see [[CancelledError]]
|
||||
*
|
||||
* **Operational Errors**
|
||||
*
|
||||
* **``"BUFFER_OVERRUN"``** - see [[BufferOverrunError]]
|
||||
*
|
||||
* **``"NUMERIC_FAULT"``** - see [[NumericFaultError]]
|
||||
*
|
||||
* **Argument Errors**
|
||||
*
|
||||
* **``"INVALID_ARGUMENT"``** - see [[InvalidArgumentError]]
|
||||
*
|
||||
* **``"MISSING_ARGUMENT"``** - see [[MissingArgumentError]]
|
||||
*
|
||||
* **``"UNEXPECTED_ARGUMENT"``** - see [[UnexpectedArgumentError]]
|
||||
*
|
||||
* **``"VALUE_MISMATCH"``** - //unused//
|
||||
*
|
||||
* **Blockchain Errors**
|
||||
*
|
||||
* **``"CALL_EXCEPTION"``** - see [[CallExceptionError]]
|
||||
*
|
||||
* **``"INSUFFICIENT_FUNDS"``** - see [[InsufficientFundsError]]
|
||||
*
|
||||
* **``"NONCE_EXPIRED"``** - see [[NonceExpiredError]]
|
||||
*
|
||||
* **``"REPLACEMENT_UNDERPRICED"``** - see [[ReplacementUnderpricedError]]
|
||||
*
|
||||
* **``"TRANSACTION_REPLACED"``** - see [[TransactionReplacedError]]
|
||||
*
|
||||
* **``"UNCONFIGURED_NAME"``** - see [[UnconfiguredNameError]]
|
||||
*
|
||||
* **``"OFFCHAIN_FAULT"``** - see [[OffchainFaultError]]
|
||||
*
|
||||
* **User Interaction Errors**
|
||||
*
|
||||
* **``"ACTION_REJECTED"``** - see [[ActionRejectedError]]
|
||||
*/
|
||||
export type ErrorCode = "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | "CANCELLED" | "BUFFER_OVERRUN" | "NUMERIC_FAULT" | "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | "VALUE_MISMATCH" | "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | "ACTION_REJECTED";
|
||||
/**
|
||||
@@ -333,7 +384,7 @@ export interface TransactionReplacedError extends EthersError<"TRANSACTION_REPLA
|
||||
* been configured.
|
||||
*
|
||||
* This could indicate an ENS name is unowned or that the current
|
||||
* address being pointed to is the [[Zero]].
|
||||
* address being pointed to is the [[ZeroAddress]].
|
||||
*/
|
||||
export interface UnconfiguredNameError extends EthersError<"UNCONFIGURED_NAME"> {
|
||||
/**
|
||||
@@ -391,7 +442,7 @@ export type CodedEthersError<T> = T extends "UNKNOWN_ERROR" ? UnknownError : T e
|
||||
*/
|
||||
export declare function isError<K extends ErrorCode, T extends CodedEthersError<K>>(error: any, code: K): error is T;
|
||||
/**
|
||||
* Returns true if %%error%% is a [CALL_EXCEPTION](api:CallExceptionError).
|
||||
* Returns true if %%error%% is a [[CallExceptionError].
|
||||
*/
|
||||
export declare function isCallException(error: any): error is CallExceptionError;
|
||||
/**
|
||||
|
||||
@@ -69,7 +69,7 @@ function isError(error, code) {
|
||||
}
|
||||
exports.isError = isError;
|
||||
/**
|
||||
* Returns true if %%error%% is a [CALL_EXCEPTION](api:CallExceptionError).
|
||||
* Returns true if %%error%% is a [[CallExceptionError].
|
||||
*/
|
||||
function isCallException(error) {
|
||||
return isError(error, "CALL_EXCEPTION");
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -80,17 +80,14 @@ class FetchCancelSignal {
|
||||
});
|
||||
}
|
||||
addListener(listener) {
|
||||
(0, errors_js_1.assert)(this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", {
|
||||
(0, errors_js_1.assert)(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fetchCancelSignal.addCancelListener"
|
||||
});
|
||||
this.#listeners.push(listener);
|
||||
}
|
||||
get cancelled() { return this.#cancelled; }
|
||||
checkSignal() {
|
||||
if (!this.cancelled) {
|
||||
return;
|
||||
}
|
||||
(0, errors_js_1.assert)(false, "cancelled", "CANCELLED", {});
|
||||
(0, errors_js_1.assert)(!this.cancelled, "cancelled", "CANCELLED", {});
|
||||
}
|
||||
}
|
||||
exports.FetchCancelSignal = FetchCancelSignal;
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
lib.commonjs/utils/index.d.ts
vendored
2
lib.commonjs/utils/index.d.ts
vendored
@@ -3,7 +3,7 @@
|
||||
* Ethereum and to simplify the library, without increasing
|
||||
* the library dependencies for simple functions.
|
||||
*
|
||||
* @_section api/utils:Utilities [utils]
|
||||
* @_section api/utils:Utilities [about-utils]
|
||||
*/
|
||||
export { decodeBase58, encodeBase58 } from "./base58.js";
|
||||
export { decodeBase64, encodeBase64 } from "./base64.js";
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Ethereum and to simplify the library, without increasing
|
||||
* the library dependencies for simple functions.
|
||||
*
|
||||
* @_section api/utils:Utilities [utils]
|
||||
* @_section api/utils:Utilities [about-utils]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.encodeRlp = exports.decodeRlp = exports.defineProperties = exports.resolveProperties = exports.toQuantity = exports.toBeArray = exports.toBeHex = exports.toNumber = exports.toBigInt = exports.getUint = exports.getNumber = exports.getBigInt = exports.mask = exports.toTwos = exports.fromTwos = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.makeError = exports.assertNormalize = exports.assertPrivate = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.isError = exports.isCallException = exports.zeroPadBytes = exports.zeroPadValue = exports.stripZerosLeft = exports.dataSlice = exports.dataLength = exports.concat = exports.hexlify = exports.isBytesLike = exports.isHexString = exports.getBytesCopy = exports.getBytes = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = void 0;
|
||||
|
||||
2
lib.commonjs/utils/maths.d.ts
vendored
2
lib.commonjs/utils/maths.d.ts
vendored
@@ -26,7 +26,7 @@ export declare function toTwos(_value: BigNumberish, _width: Numeric): bigint;
|
||||
*/
|
||||
export declare function mask(_value: BigNumberish, _bits: Numeric): bigint;
|
||||
/**
|
||||
* Gets a [[BigInt]] from %%value%%. If it is an invalid value for
|
||||
* Gets a BigInt from %%value%%. If it is an invalid value for
|
||||
* a BigInt, then an ArgumentError will be thrown for %%name%%.
|
||||
*/
|
||||
export declare function getBigInt(value: BigNumberish, name?: string): bigint;
|
||||
|
||||
@@ -69,7 +69,7 @@ function mask(_value, _bits) {
|
||||
}
|
||||
exports.mask = mask;
|
||||
/**
|
||||
* Gets a [[BigInt]] from %%value%%. If it is an invalid value for
|
||||
* Gets a BigInt from %%value%%. If it is an invalid value for
|
||||
* a BigInt, then an ArgumentError will be thrown for %%name%%.
|
||||
*/
|
||||
function getBigInt(value, name) {
|
||||
|
||||
4
lib.commonjs/utils/units.d.ts
vendored
4
lib.commonjs/utils/units.d.ts
vendored
@@ -7,7 +7,7 @@ import type { BigNumberish, Numeric } from "../utils/index.js";
|
||||
*/
|
||||
export declare function formatUnits(value: BigNumberish, unit?: string | Numeric): string;
|
||||
/**
|
||||
* Converts the //decimal string// %%value%% to a [[BigInt]], assuming
|
||||
* Converts the //decimal string// %%value%% to a BigInt, assuming
|
||||
* %%unit%% decimal places. The %%unit%% may the number of decimal places
|
||||
* or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
|
||||
*/
|
||||
@@ -17,7 +17,7 @@ export declare function parseUnits(value: string, unit?: string | Numeric): bigi
|
||||
*/
|
||||
export declare function formatEther(wei: BigNumberish): string;
|
||||
/**
|
||||
* Converts the //decimal string// %%ether%% to a [[BigInt]], using 18
|
||||
* Converts the //decimal string// %%ether%% to a BigInt, using 18
|
||||
* decimal places.
|
||||
*/
|
||||
export declare function parseEther(ether: string): bigint;
|
||||
|
||||
@@ -54,7 +54,7 @@ function formatUnits(value, unit) {
|
||||
}
|
||||
exports.formatUnits = formatUnits;
|
||||
/**
|
||||
* Converts the //decimal string// %%value%% to a [[BigInt]], assuming
|
||||
* Converts the //decimal string// %%value%% to a BigInt, assuming
|
||||
* %%unit%% decimal places. The %%unit%% may the number of decimal places
|
||||
* or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
|
||||
*/
|
||||
@@ -80,7 +80,7 @@ function formatEther(wei) {
|
||||
}
|
||||
exports.formatEther = formatEther;
|
||||
/**
|
||||
* Converts the //decimal string// %%ether%% to a [[BigInt]], using 18
|
||||
* Converts the //decimal string// %%ether%% to a BigInt, using 18
|
||||
* decimal places.
|
||||
*/
|
||||
function parseEther(ether) {
|
||||
|
||||
17
lib.commonjs/utils/utf8.d.ts
vendored
17
lib.commonjs/utils/utf8.d.ts
vendored
@@ -57,6 +57,21 @@ export type Utf8ErrorReason = "UNEXPECTED_CONTINUE" | "BAD_PREFIX" | "OVERRUN" |
|
||||
* when control resumes to the FSM.
|
||||
*/
|
||||
export type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array<number>, badCodepoint?: number) => number;
|
||||
/**
|
||||
* A handful of popular, built-in UTF-8 error handling strategies.
|
||||
*
|
||||
* **``"error"``** - throws on ANY illegal UTF-8 sequence or
|
||||
* non-canonical (overlong) codepoints (this is the default)
|
||||
*
|
||||
* **``"ignore"``** - silently drops any illegal UTF-8 sequence
|
||||
* and accepts non-canonical (overlong) codepoints
|
||||
*
|
||||
* **``"replace"``** - replace any illegal UTF-8 sequence with the
|
||||
* UTF-8 replacement character (i.e. `\ufffd`) and accepts
|
||||
* non-canonical (overlong) codepoints
|
||||
*
|
||||
* @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc>
|
||||
*/
|
||||
export declare const Utf8ErrorFuncs: Readonly<Record<"error" | "ignore" | "replace", Utf8ErrorFunc>>;
|
||||
/**
|
||||
* Returns the UTF-8 byte representation of %%str%%.
|
||||
@@ -69,7 +84,7 @@ export declare function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm
|
||||
*
|
||||
* When %%onError%% function is specified, it is called on UTF-8
|
||||
* errors allowing recovery using the [[Utf8ErrorFunc]] API.
|
||||
* (default: [error](Utf8ErrorFuncs-error))
|
||||
* (default: [error](Utf8ErrorFuncs))
|
||||
*/
|
||||
export declare function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string;
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,21 @@ function replaceFunc(reason, offset, bytes, output, badCodepoint) {
|
||||
// Otherwise, process as if ignoring errors
|
||||
return ignoreFunc(reason, offset, bytes, output, badCodepoint);
|
||||
}
|
||||
// Common error handing strategies
|
||||
/**
|
||||
* A handful of popular, built-in UTF-8 error handling strategies.
|
||||
*
|
||||
* **``"error"``** - throws on ANY illegal UTF-8 sequence or
|
||||
* non-canonical (overlong) codepoints (this is the default)
|
||||
*
|
||||
* **``"ignore"``** - silently drops any illegal UTF-8 sequence
|
||||
* and accepts non-canonical (overlong) codepoints
|
||||
*
|
||||
* **``"replace"``** - replace any illegal UTF-8 sequence with the
|
||||
* UTF-8 replacement character (i.e. `\ufffd`) and accepts
|
||||
* non-canonical (overlong) codepoints
|
||||
*
|
||||
* @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc>
|
||||
*/
|
||||
exports.Utf8ErrorFuncs = Object.freeze({
|
||||
error: errorFunc,
|
||||
ignore: ignoreFunc,
|
||||
@@ -194,7 +208,7 @@ function _toUtf8String(codePoints) {
|
||||
*
|
||||
* When %%onError%% function is specified, it is called on UTF-8
|
||||
* errors allowing recovery using the [[Utf8ErrorFunc]] API.
|
||||
* (default: [error](Utf8ErrorFuncs-error))
|
||||
* (default: [error](Utf8ErrorFuncs))
|
||||
*/
|
||||
function toUtf8String(bytes, onError) {
|
||||
return _toUtf8String(getUtf8CodePoints(bytes, onError));
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
lib.commonjs/wallet/index.d.ts
vendored
2
lib.commonjs/wallet/index.d.ts
vendored
@@ -14,7 +14,7 @@
|
||||
* low-level details of how an HD wallets are derived, exported
|
||||
* or imported.
|
||||
*
|
||||
* @_section: api/wallet:Wallets [wallets]
|
||||
* @_section: api/wallet:Wallets [about-wallets]
|
||||
*/
|
||||
export { BaseWallet } from "./base-wallet.js";
|
||||
export { defaultPath, getAccountPath, HDNodeWallet, HDNodeVoidWallet, } from "./hdwallet.js";
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* low-level details of how an HD wallets are derived, exported
|
||||
* or imported.
|
||||
*
|
||||
* @_section: api/wallet:Wallets [wallets]
|
||||
* @_section: api/wallet:Wallets [about-wallets]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Wallet = exports.Mnemonic = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.isKeystoreJson = exports.decryptCrowdsaleJson = exports.isCrowdsaleJson = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.getAccountPath = exports.defaultPath = exports.BaseWallet = void 0;
|
||||
|
||||
4
lib.commonjs/wallet/mnemonic.d.ts
vendored
4
lib.commonjs/wallet/mnemonic.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
import type { Wordlist } from "../wordlists/index.js";
|
||||
/**
|
||||
* A **Mnemonic** wraps all properties required to compute [[link-bip39]]
|
||||
* A **Mnemonic** wraps all properties required to compute [[link-bip-39]]
|
||||
* seeds and convert between phrases and entropy.
|
||||
*/
|
||||
export declare class Mnemonic {
|
||||
@@ -55,7 +55,7 @@ export declare class Mnemonic {
|
||||
*/
|
||||
static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string;
|
||||
/**
|
||||
* Returns true if %%phrase%% is a valid [[link-bip39]] phrase.
|
||||
* Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.
|
||||
*
|
||||
* This checks all the provided words belong to the %%wordlist%%,
|
||||
* that the length is valid and the checksum is correct.
|
||||
|
||||
@@ -71,7 +71,7 @@ function entropyToMnemonic(entropy, wordlist) {
|
||||
}
|
||||
const _guard = {};
|
||||
/**
|
||||
* A **Mnemonic** wraps all properties required to compute [[link-bip39]]
|
||||
* A **Mnemonic** wraps all properties required to compute [[link-bip-39]]
|
||||
* seeds and convert between phrases and entropy.
|
||||
*/
|
||||
class Mnemonic {
|
||||
@@ -151,7 +151,7 @@ class Mnemonic {
|
||||
return mnemonicToEntropy(phrase, wordlist);
|
||||
}
|
||||
/**
|
||||
* Returns true if %%phrase%% is a valid [[link-bip39]] phrase.
|
||||
* Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.
|
||||
*
|
||||
* This checks all the provided words belong to the %%wordlist%%,
|
||||
* that the length is valid and the checksum is correct.
|
||||
|
||||
2
lib.commonjs/wordlists/index.d.ts
vendored
2
lib.commonjs/wordlists/index.d.ts
vendored
@@ -15,7 +15,7 @@
|
||||
* languages, but for maximal compatibility, the
|
||||
* [English Wordlist](LangEn) is recommended.
|
||||
*
|
||||
* @_section: api/wordlists:Wordlists [wordlists]
|
||||
* @_section: api/wordlists:Wordlists [about-wordlists]
|
||||
*/
|
||||
export { Wordlist } from "./wordlist.js";
|
||||
export { LangEn } from "./lang-en.js";
|
||||
|
||||
@@ -18,7 +18,7 @@ exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn
|
||||
* languages, but for maximal compatibility, the
|
||||
* [English Wordlist](LangEn) is recommended.
|
||||
*
|
||||
* @_section: api/wordlists:Wordlists [wordlists]
|
||||
* @_section: api/wordlists:Wordlists [about-wordlists]
|
||||
*/
|
||||
var wordlist_js_1 = require("./wordlist.js");
|
||||
Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return wordlist_js_1.Wordlist; } });
|
||||
|
||||
2
lib.commonjs/wordlists/wordlist.d.ts
vendored
2
lib.commonjs/wordlists/wordlist.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* A Wordlist represents a collection of language-specific
|
||||
* words used to encode and devoce [[BIP-39]] encoded data
|
||||
* words used to encode and devoce [[link-bip-39]] encoded data
|
||||
* by mapping words to 11-bit values and vice versa.
|
||||
*/
|
||||
export declare abstract class Wordlist {
|
||||
|
||||
@@ -4,7 +4,7 @@ exports.Wordlist = void 0;
|
||||
const index_js_1 = require("../utils/index.js");
|
||||
/**
|
||||
* A Wordlist represents a collection of language-specific
|
||||
* words used to encode and devoce [[BIP-39]] encoded data
|
||||
* words used to encode and devoce [[link-bip-39]] encoded data
|
||||
* by mapping words to 11-bit values and vice versa.
|
||||
*/
|
||||
class Wordlist {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user