Compare commits

..

65 Commits
v6 ... v6.0.8

Author SHA1 Message Date
Richard Moore
20bbd12819 Fix matic-mumbai network and include aliases to legacy names (#3811). 2023-02-23 06:29:09 -05:00
Richard Moore
388edf6abc Fixed getSigner bug (#3821). 2023-02-23 06:20:39 -05:00
Richard Moore
3a0d8685ca admin: updated dist files 2023-02-23 01:41:13 -05:00
Richard Moore
b993f7c3b6 Fixed getContentHash (#3819). 2023-02-23 01:39:57 -05:00
Richard Moore
51e72b98a2 admin: update dist files 2023-02-22 21:53:56 -05:00
Richard Moore
8298e8599f admin: added changelog generation scripts 2023-02-22 21:52:33 -05:00
Richard Moore
fb3dffcc12 docs: fixed formatting of ignore character 2023-02-22 21:32:01 -05:00
Richard Moore
77a7323119 Added chain parameters for Arbitrum and Optimism (#3811). 2023-02-22 21:29:44 -05:00
Richard Moore
5a3c10a29c Fix NoneManager race condition (#3812, #3813). 2023-02-22 21:10:43 -05:00
Richard Moore
f9eed4cdb1 Add UMD output to dist builds (#3814). 2023-02-22 21:03:47 -05:00
Richard Moore
981a962543 docs: updated RLP link 2023-02-22 05:04:46 -05:00
Richard Moore
f61a78fceb admin: organize github workflows 2023-02-22 04:49:50 -05:00
Richard Moore
405fbbdea8 admin: fix duplicate name for issue templates 2023-02-22 04:04:57 -05:00
Richard Moore
d5f360d12a docs: add defineProperties to migration docs 2023-02-22 04:02:15 -05:00
Richard Moore
09805afad5 admin: add more changelog details 2023-02-22 04:01:49 -05:00
Richard Moore
5853530bdb admin: fix issue template descriptions 2023-02-22 04:01:30 -05:00
Richard Moore
5715d611e7 admin: updated dist files 2023-02-18 22:18:42 -05:00
Richard Moore
b39e955eb6 docs: fixed typos and improve migration docs (#3717, #3721, #3723, #3725, #3736, #3795). 2023-02-18 22:16:58 -05:00
Richard Moore
399356b912 Fixed Result to behave correctly like an array using slice and toArray (#3787). 2023-02-18 21:42:01 -05:00
Richard Moore
4512e97f9b Replaced substring from 0 index with startsWith (#3691). 2023-02-18 14:00:42 -05:00
Richard Moore
762c2f34ea Fixed inverted assert in duplicate name detection for ABI encoding (#3792). 2023-02-18 13:45:45 -05:00
Richard Moore
48bbef7ade Fixed missing property during transaction copy (#3793). 2023-02-18 13:37:48 -05:00
Richard Moore
4665fb4c68 Add support for Wallet private keys without 0x prefix (#3768). 2023-02-18 13:36:23 -05:00
Richard Moore
b1bb69356a admin: updated GitHub issue templates for adding version tags 2023-02-16 09:51:51 -05:00
Richard Moore
a8afb72fbb Fixed quicknode property for defaultProvider (#3741). 2023-02-16 09:45:28 -05:00
Richard Moore
085a9054f3 Fixed exports field order (#3703, #3755). 2023-02-16 09:44:13 -05:00
Richard Moore
ddaa87a2e6 admin: remove docs and github config from npm package 2023-02-16 08:22:53 -05:00
Richard Moore
5afe840552 admin: update dist files 2023-02-16 08:19:59 -05:00
Richard Moore
4d9b29de75 Fixed custom error decoding (#3785). 2023-02-16 08:17:39 -05:00
Richard Moore
e1e0929348 Removed stray debug logging. 2023-02-16 07:49:33 -05:00
Richard Moore
92def9c148 Fixed lookupAddress when bad resolver is present (#3782). 2023-02-15 15:50:13 -05:00
Richard Moore
557c7d4224 docs: added jsdocs to update-version generated output 2023-02-14 12:24:53 -05:00
Richard Moore
83957dc283 Fixed FallbackProvider median calculation (#3746). 2023-02-14 11:54:08 -05:00
Richard Moore
179e6ca520 Move the xnf normalize variant to pkg.browser instead of import (#3724). 2023-02-13 10:53:47 -05:00
Richard Moore
2a30facb2b docs: added LICENSE.md 2023-02-13 10:48:48 -05:00
Richard Moore
9b508a4656 admin: updated dist files 2023-02-12 22:14:26 -05:00
Richard Moore
6372a46b1b Allow null type in transaction receipt for legacy type 0 networks (#3459). 2023-02-12 22:12:12 -05:00
Richard Moore
2ba4a17255 Fixed events when slicing immutable Result (#3765). 2023-02-12 22:06:39 -05:00
Richard Moore
37bf4fb555 More robust support on networks which throw when filters are not supported (#3767). 2023-02-12 22:04:20 -05:00
Richard Moore
400d57621b Fixed ignored polling override for JsonRpcApiProvider. 2023-02-12 22:03:37 -05:00
Richard Moore
314595113c docs: added more jsdocs and examples 2023-02-12 21:21:11 -05:00
Richard Moore
0bf53d7804 admin: updated dist files 2023-02-04 08:27:45 -05:00
Richard Moore
ef84706312 docs: added post-build folder docs copying to scripts 2023-02-04 08:26:56 -05:00
Richard Moore
6c338c1c5b Fixed crossed assert in Fetch (#3733). 2023-02-04 08:25:15 -05:00
Richard Moore
8d5a13faea docs: updated post-build folder docs 2023-02-04 08:24:19 -05:00
Richard Moore
24e13fc0f2 admin: updated dist files 2023-02-04 03:26:34 -05:00
Richard Moore
faa556c1e5 docs: added basic security details 2023-02-04 03:24:24 -05:00
Richard Moore
1c5e1e8201 docs: added README to explain folder usage 2023-02-04 03:23:32 -05:00
Richard Moore
3f7dbe75ad docs: added more info for migration 2023-02-04 03:22:42 -05:00
Richard Moore
a0f272973d docs: added links for CDN 2023-02-04 03:22:19 -05:00
Richard Moore
b67ad79264 docs: added more docs on Errors 2023-02-04 03:21:16 -05:00
Richard Moore
ccb9a0643e admin: updated post-build file copying 2023-02-04 03:15:22 -05:00
Richard Moore
d0ed91840c Fix Subscriber model when removed within emit callback. 2023-02-04 03:12:04 -05:00
Richard Moore
32b1e7827a docs: replaces ethers.io URLs with ethers.org 2023-02-03 21:53:10 -05:00
Richard Moore
522fd16f68 Fixed human-readable parser when identifier begins with valid type prefix (#3728). 2023-02-03 21:50:30 -05:00
Richard Moore
803e8f9821 Update to latest secp256k1 library (#3719). 2023-02-03 03:28:22 -05:00
Richard Moore
2cba1c7781 admin: added funding details to pacakge.json 2023-02-02 23:05:38 -05:00
Richard Moore
0b92fed9ed admin: added Issue Templates from v5 2023-02-02 23:04:45 -05:00
Richard Moore
0a740c470d admin: updated dist files 2023-02-02 22:21:31 -05:00
Richard Moore
90afd9bd81 Fixed typo in Provider changes. 2023-02-02 22:20:41 -05:00
Richard Moore
a646e4332e Provider objects cleanup. 2023-02-02 22:18:40 -05:00
Richard Moore
6cae18328d Fixed commonjs imports missing types (#3703). 2023-02-02 22:04:33 -05:00
Richard Moore
de2b1f66c6 admin: updated package description 2023-02-02 22:03:45 -05:00
Richard Moore
b3f615a1b2 admin: use default branch for CI checkouts 2023-02-02 21:34:17 -05:00
Richard Moore
0e8a34805f admin: update docs and CI for v6 release 2023-02-02 21:28:26 -05:00
347 changed files with 25340 additions and 1723 deletions

View File

@@ -0,0 +1,81 @@
name: "Bug Report v5 (legacy)"
description: "Open an issue for a bug in Ethers v5 (legacy)"
title: "Add Bug Title Here"
labels: [ "investigate", "v5" ]
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**, specifically for the legacy v5 branch.
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: 5.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?

81
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,81 @@
name: "Bug Report v6 (latest)"
description: "Open an issue for a bug in Ethers v6 (latest)"
title: "Add Bug Title Here"
labels: [ "investigate", "v6" ]
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: 6.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
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

View 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

View 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

45
.github/workflows/generate-docs.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Generate Documentation
on:
push:
branches:
- main
jobs:
docs:
name: Generate Documentation
runs-on: ubuntu-latest
environment: ethers-tests
env:
FAUCET_PRIVATEKEY: ${{ secrets.FAUCET_PRIVATEKEY }}
steps:
- uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: "0"
- name: Install dependencies
run: npm ci
- name: Install Flatworm
run: npm install --no-save 'https://github.com/ricmoo/flatworm.git#tsdocs'
- name: Build Documentation
run: node node_modules/flatworm/lib/test-api-index ./docs.wrm/config.js
- name: Upload documentation to to docs.ethers.org
uses: ethers-io/sync-s3-action@main
with:
aws_access_key_id: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY}}
aws_s3_bucket: ethers.org
source_folder: 'output/docs/'
destination_prefix: 'docs/'
aws_cloudfront_id: ${{ secrets.DOCS_AWS_CLOUDFRONT_ID }}

View File

@@ -3,7 +3,9 @@ name: CI Tests
on:
push:
branches:
- v6
- main
paths:
- "src.ts/**"
jobs:
@@ -32,8 +34,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: "v6"
- name: Install dependencies
run: npm ci
@@ -65,8 +65,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: "v6"
- name: Install dependencies
run: npm ci
@@ -101,45 +99,3 @@ jobs:
source_folder: 'output/'
destination_prefix: 'build/output/'
aws_cloudfront_id: ${{ secrets.BUILD_AWS_CLOUDFRONT_ID }}
docs:
name: Generate Documentation
runs-on: ubuntu-latest
environment: ethers-tests
env:
FAUCET_PRIVATEKEY: ${{ secrets.FAUCET_PRIVATEKEY }}
continue-on-error: true
steps:
- uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: "v6"
fetch-depth: "0"
- name: Install dependencies
run: npm ci
- name: Install Flatworm
run: npm install --no-save 'https://github.com/ricmoo/flatworm.git#tsdocs'
- name: Build Documentation
run: node node_modules/flatworm/lib/test-api-index ./docs.wrm/config.js
- name: Upload documentation to to docs.ethers.org
uses: ethers-io/sync-s3-action@main
with:
aws_access_key_id: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY}}
aws_s3_bucket: ethers.org
source_folder: 'output/docs/'
destination_prefix: 'docs/'
aws_cloudfront_id: ${{ secrets.DOCS_AWS_CLOUDFRONT_ID }}

View File

@@ -4,6 +4,8 @@ tsconfig.*.json
tsconfig.tsbuildinfo
rollup.config.js
output/**
docs.wrm/**
.github/**
# Ignore admin scripts and files
src.ts/_admin/**

61
CHANGELOG.md Normal file
View File

@@ -0,0 +1,61 @@
Change Log
==========
This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated.
ethers/v6.0.7 (2023-02-23 01:41)
--------------------------------
- Fixed getContentHash ([#3819](https://github.com/ethers-io/ethers.js/issues/3819); [b993f7c](https://github.com/ethers-io/ethers.js/commit/b993f7c3b6c0e135c460c8b8dc5943215628231a)).
ethers/v6.0.6 (2023-02-22 21:53)
--------------------------------
- Added chain parameters for Arbitrum and Optimism ([#3811](https://github.com/ethers-io/ethers.js/issues/3811); [77a7323](https://github.com/ethers-io/ethers.js/commit/77a7323119923e596f4def4f1bc90beae5447320)).
- Fix NonceManager race condition ([#3812](https://github.com/ethers-io/ethers.js/issues/3812), [#3813](https://github.com/ethers-io/ethers.js/issues/3813); [5a3c10a](https://github.com/ethers-io/ethers.js/commit/5a3c10a29c047609a50828adb620d88aa8cf0014)).
- Add UMD output to dist builds ([#3814](https://github.com/ethers-io/ethers.js/issues/3814); [f9eed4c](https://github.com/ethers-io/ethers.js/commit/f9eed4cdb190b06dd4ddaa2382c1de42e8e98de6)).
ethers/v6.0.5 (2023-02-18 22:36)
--------------------------------
- Fixed Result to behave correctly like an array using slice and toArray ([#3787](https://github.com/ethers-io/ethers.js/issues/3787); [399356b](https://github.com/ethers-io/ethers.js/commit/399356b91227db04e496628af60c4b8e38207760)).
- Replaced substring from 0 index with startsWith ([#3691](https://github.com/ethers-io/ethers.js/issues/3691); [4512e97](https://github.com/ethers-io/ethers.js/commit/4512e97f9b55607ce388aa6eb63a37fc196a5d9d)).
- Fixed inverted assert in duplicate name detection for ABI encoding ([#3792](https://github.com/ethers-io/ethers.js/issues/3792); [762c2f3](https://github.com/ethers-io/ethers.js/commit/762c2f34eac848c5464389f11d1697dcd8ebcbb5)).
- Fixed missing property during transaction copy ([#3793](https://github.com/ethers-io/ethers.js/issues/3793); [48bbef7](https://github.com/ethers-io/ethers.js/commit/48bbef7ade69bcfe86542f752f15049cc62f4141)).
- Add support for Wallet private keys without 0x prefix ([#3768](https://github.com/ethers-io/ethers.js/issues/3768); [4665fb4](https://github.com/ethers-io/ethers.js/commit/4665fb4c6886c8b344dee316ba9f4fde57ce7557)).
- Fixed quicknode property for defaultProvider ([#3741](https://github.com/ethers-io/ethers.js/issues/3741); [a8afb72](https://github.com/ethers-io/ethers.js/commit/a8afb72fbbceb6a5024c1edb85badb72099787ea)).
- Fixed exports field order ([#3703](https://github.com/ethers-io/ethers.js/issues/3703), [#3755](https://github.com/ethers-io/ethers.js/issues/3755); [085a905](https://github.com/ethers-io/ethers.js/commit/085a9054f349afb816ca1a123737293ec9bd2532)).
ethers/v6.0.4 (2023-02-16 08:55)
--------------------------------
- Fixed custom error decoding ([#3785](https://github.com/ethers-io/ethers.js/issues/3785); [4d9b29d](https://github.com/ethers-io/ethers.js/commit/4d9b29de751e2387c143e474bb96d271da892ea6)).
- Removed stray debug logging ([e1e0929](https://github.com/ethers-io/ethers.js/commit/e1e09293483a9d07fd8e8f96552aa958b5ec45ed)).
- Fixed lookupAddress when bad resolver is present ([#3782](https://github.com/ethers-io/ethers.js/issues/3782); [92def9c](https://github.com/ethers-io/ethers.js/commit/92def9c1489bb35ad13fe58a1cd107ee3a05a112)).
- Fixed FallbackProvider median calculation ([#3746](https://github.com/ethers-io/ethers.js/issues/3746); [83957dc](https://github.com/ethers-io/ethers.js/commit/83957dc283043b9af8f6e89920faac3e09ca69fc)).
- Move the xnf normalize variant to pkg.browser instead of import ([#3724](https://github.com/ethers-io/ethers.js/issues/3724); [179e6ca](https://github.com/ethers-io/ethers.js/commit/179e6ca520392177c7dea5e477b29930952ed637)).
ethers/v6.0.3 (2023-02-12 22:45)
--------------------------------
- Allow null type in transaction receipt for legacy type 0 networks ([#3459](https://github.com/ethers-io/ethers.js/issues/3459); [6372a46](https://github.com/ethers-io/ethers.js/commit/6372a46b1b273db3e4c1189daebb4b888bd588bc)).
- Fixed events when slicing immutable Result ([#3765](https://github.com/ethers-io/ethers.js/issues/3765); [2ba4a17](https://github.com/ethers-io/ethers.js/commit/2ba4a172555b7e17ac01fedfc944549defab61bc)).
- More robust support on networks which throw when filters are not supported ([#3767](https://github.com/ethers-io/ethers.js/issues/3767); [37bf4fb](https://github.com/ethers-io/ethers.js/commit/37bf4fb55563d7ff66edee15c7515c8a0d6a2266)).
- Fixed ignored polling override for JsonRpcApiProvider ([400d576](https://github.com/ethers-io/ethers.js/commit/400d57621b3e9a33679a528b5072449699f0a068)).
ethers/v6.0.2 (2023-02-04 08:50)
--------------------------------
- Fixed crossed assert in Fetch ([#3733](https://github.com/ethers-io/ethers.js/issues/3733); [6c338c1](https://github.com/ethers-io/ethers.js/commit/6c338c1c5b4013db9754c9d1a33dcbf54330e5c7)).
ethers/v6.0.1 (2023-02-04 04:06)
--------------------------------
- Fix Subscriber model when removed within emit callback ([d0ed918](https://github.com/ethers-io/ethers.js/commit/d0ed91840c9f51c7ce9061ebb1d36727dbdd51a4)).
- Fixed human-readable parser when identifier begins with valid type prefix ([#3728](https://github.com/ethers-io/ethers.js/issues/3728); [522fd16](https://github.com/ethers-io/ethers.js/commit/522fd16f68aabc53e4dc8745d4128e0d61260ed5)).
- Update to latest secp256k1 library ([#3719](https://github.com/ethers-io/ethers.js/issues/3719); [803e8f9](https://github.com/ethers-io/ethers.js/commit/803e8f9821950b83efa876d64b1cfb35f6bccc38)).
ethers/v6.0.0 (2023-02-02 22:48)
--------------------------------
- Initial release ([90afd9b](https://github.com/ethers-io/ethers.js/commit/90afd9bd81ed1408421a0247fa0845a74c9eb319)).

21
LICENSE.md Normal file
View 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.

View File

@@ -1,30 +1,11 @@
The Ethers Project
==================
```
This branch (i.e. v6-beta-exports) is still experimental and a
playground for new ideas for the upcoming v6 release. Please
don't use it in production yet.
To install:
npm install ethers@beta-exports
Please try it out and report any bugs you find using the v6-beta
template in the GitHub issues.
Documentation is coming, but will still take a bit of time.
In general, please be a patient as there is lots to do.
Thanks! :)
```
[![npm (tag)](https://img.shields.io/npm/v/ethers)](https://www.npmjs.com/package/ethers)
[![CI Tests](https://github.com/ethers-io/ethers.js/actions/workflows/test-ci.yml/badge.svg?branch=v6-beta-exports)](https://github.com/ethers-io/ethers.js/actions/workflows/test-ci.yml)
[![GitPOAP Badge](https://public-api.gitpoap.io/v1/repo/ethers-io/ethers.js/badge)](https://www.gitpoap.io/gh/ethers-io/ethers.js)
![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/ethers/beta-exports)
[![CI Tests](https://github.com/ethers-io/ethers.js/actions/workflows/test-ci.yml/badge.svg?branch=main)](https://github.com/ethers-io/ethers.js/actions/workflows/test-ci.yml)
![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/ethers)
![npm (downloads)](https://img.shields.io/npm/dm/ethers)
[![GitPOAP Badge](https://public-api.gitpoap.io/v1/repo/ethers-io/ethers.js/badge)](https://www.gitpoap.io/gh/ethers-io/ethers.js)
[![Twitter Follow](https://img.shields.io/twitter/follow/ricmoo?style=social)](https://twitter.com/ricmoo)
-----
@@ -43,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
@@ -57,10 +38,11 @@ For the latest news and advisories, please follow the
non-marketing, important information only) as well as watch this GitHub project.
For the latest changes, see the
[CHANGELOG](https://github.com/ethers-io/ethers.js/blob/master/CHANGELOG.md).
[CHANGELOG](https://github.com/ethers-io/ethers.js/blob/main/CHANGELOG.md).
**Summaries**
- [September 2022](https://blog.ricmoo.com/highlights-ethers-js-september-2022-d7bda0fc37ed)
- [June 2022](https://blog.ricmoo.com/highlights-ethers-js-june-2022-f5328932e35d)
- [March 2022](https://blog.ricmoo.com/highlights-ethers-js-march-2022-f511fe1e88a1)
- [December 2021](https://blog.ricmoo.com/highlights-ethers-js-december-2021-dc1adb779d1a)
@@ -77,7 +59,7 @@ Installing
**NodeJS**
```
/home/ricmoo/some_project> npm install ethers@beta-exports
/home/ricmoo/some_project> npm install ethers
```
**Browser (ESM)**
@@ -94,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/v5/getting-started/)
- [Full API Documentation](https://docs.ethers.io/v5/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/)
@@ -121,12 +101,13 @@ 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:
- [Ankr](https://www.ankr.com/)
- [QuickNode](https://www.quicknode.com/)
- [Etherscan](https://etherscan.io/)
- [INFURA](https://infura.io/)
- [Alchemy](https://dashboard.alchemyapi.io/signup?referral=55a35117-028e-4b7c-9e47-e275ad0acc6d)

34
SECURITY.md Normal file
View 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
View 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`.

990
dist/ethers.js vendored

File diff suppressed because it is too large Load Diff

2
dist/ethers.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/ethers.min.js vendored

File diff suppressed because one or more lines are too long

22304
dist/ethers.umd.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/ethers.umd.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/ethers.umd.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -145,7 +145,11 @@ const u64 = {
add, add3L, add3H, add4L, add4H, add5H, add5L,
};
const version = "6.0.0";
/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */
/**
* The current version of Ethers.
*/
const version = "6.0.7";
/**
* Property helper functions.
@@ -278,7 +282,7 @@ function makeError(message, code, info) {
}
defineProperties(error, { code });
if (info) {
defineProperties(error, info);
Object.assign(error, info);
}
return error;
}
@@ -426,7 +430,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 +589,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 +915,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 {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5
docs.wrm/README.md Normal file
View File

@@ -0,0 +1,5 @@
Documentation Source
====================
This folder contains all the Flatworm source for the documentation.

View File

@@ -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"

View File

@@ -1,4 +1,4 @@
_section: Contributings and Hacking @<about-contrib> @priority<-90>
_section: Contributions and Hacking @<about-contrib> @priority<-90>
Pull requests are welcome, but please keep the following in mind:
@@ -93,7 +93,7 @@ _subsection: Adding Features @<about-contrib-feature>
Contributing new features usually require a deeper understanding
of the internal interactions with Ethers and its components, and
generally requires a minor version bumpincludes anything w
generally requires a minor version bump.
When making any of the following changes, you must first open a
[[link-discussion]] as the minor version will need to be bumped.

View File

@@ -48,7 +48,7 @@ objects available and what they are responsible for, at a high level.
_heading: Provider
A [[Provider]] is a read-only connection to the blockchain, which allows
querying the blockchain state, such as accout, block or transaction details,
querying the blockchain state, such as account, block or transaction details,
querying event logs or evaluating read-only code using call.
If you are coming from Web3.js, you are used to a **Provider** offering
@@ -118,7 +118,7 @@ extension that injects objects into the ``window``, providing:
- authenticated write access backed by a private key (a [[Signer]])
When requesting access to the authenticated methods, such as
sending a transaction or even requesting the private key addess,
sending a transaction or even requesting the private key address,
MetaMask will show a pop-up to the user asking for permission.
_code: @lang<script>
@@ -172,7 +172,7 @@ _code: connecting to a JSON-RPC URL @lang<script>
_subsection: User Interaction @<starting-display>
All units in Ethereum tend to be integer values, since dealing with
decimals and floating points can lead to inprecise and non-obvious
decimals and floating points can lead to imprecise and non-obvious
results when performing mathematic operations.
As a result, the internal units used (e.g. wei) which are suited for
@@ -272,7 +272,7 @@ _subsection: Contracts @<starting-contracts>
A **Contract** is a meta-class, which means that its definition
its derived at run-time, based on the ABI it is passed, which then
determined what mehods and properties are available on it.
determined what methods and properties are available on it.
_heading: Application Binary Interface (ABI)
@@ -291,7 +291,7 @@ Any methods or events that are not needed can be safely excluded.
There are several common formats available to describe an ABI. The
Solidity compiler usually dumps a JSON representation but when typing
an ABI by hand it is often easier (and more readable) to use the
human-readable ABI, which is just the Solidity signautre.
human-readable ABI, which is just the Solidity signature.
_code: simplified ERC-20 ABI @lang<script>
abi = [
@@ -478,7 +478,7 @@ it. It can also be used to sign other forms of data, which are then able
to be validated for other purposes.
For example, signing **a message** can be used to prove ownership of an
account which a website could use to authenicate a user and log them in.
account which a website could use to authenticate a user and log them in.
_code: @lang<javascript>

View File

@@ -1,35 +1,28 @@
_section: Documentation (BETA) @<about-home> @nav<Documentation>
**NOTE:** This documentation is for the **beta branch** (i.e. ``v6-beta-exports``), which
is still undergoing minor changes.
To try it out:
_code:
/home/ricmoo> npm install ethers@beta-exports
_null:
Please [report any v6 issues](link-issue) and I will get to them right away.
If you are looking v5 docs, please see the [v5 documentation here](link-docs-v5).
_subsection: What is Ethers?
_section: Documentation @<about-home> @nav<Documentation>
The ethers.js library aims to be a complete and compact library
for interacting with the Ethereum Blockchain and its ecosystem.
It is ofen used to create decentralized applications (dapps),
It is often used to create decentralized applications (dapps),
wallets (such as [[link-metamask]] and [[link-tally]]) and
other tools and simple scripts that require reading and writing
to the blockchain.
_subsection: About this documentation?
These docs are still under construction, and are being expanded
every day.
Developers new to Ethers shoud be sure to read through the
Developers new to Ethers should be sure to read through the
[[getting-started]] section.
And the [[about-api]] is available for drilling down into more details.
And the [[about-api]] is available for drilling down into more details
about the entire Application Programming Interface.
_subsection: Older Documentation
- [v5 documentation](link-docs-v5)
- [v4 documentation](link-docs-v4)
- [v3 documentation](link-docs-v3)

View File

@@ -34,7 +34,7 @@ link-infura-secret [link-infura-secret](https://infura.io/docs/gettingStarted/au
link-parity-trace [link-parity-trace](https://openethereum.github.io/wiki/JSONRPC-trace-module)
link-parity-rpc [link-parity-rpc](https://openethereum.github.io/wiki/JSONRPC)
link-pocket-signup [link-pocket-signup](https://pokt.network/pocket-gateway-ethereum-mainnet/)
link-web3 [link-web3](https://github.com/ethereum/web3.js)
link-web3js [link-web3](https://github.com/ethereum/web3.js)
link-web3-http [link-web3-http](https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-http)
link-web3-ipc [link-web3-ipc](https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ipc)
link-web3-send [link-web3-send](https://github.com/ethereum/web3.js/blob/1.x/packages/web3-providers-http/types/index.d.ts#L57)

View File

@@ -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)

View File

@@ -39,7 +39,7 @@ link-icap [ICAP Address](https://github.com/ethereum/wiki/wiki/Inter-exchange-Cl
link-jsonrpc [link-jsonrpc](https://github.com/ethereum/wiki/wiki/JSON-RPC)
link-mit [MIT License](https://en.m.wikipedia.org/wiki/MIT_License)
link-namehash [namehash](https://docs.ens.domains/contract-api-reference/name-processing#hashing-names)
link-rlp [Recursive-Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)
link-rlp [Recursive-Length Prefix](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/)
link-pbkdf2 [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2)
link-solc-errors [Solidity Custom Errors](https://docs.soliditylang.org/en/v0.8.4/abi-spec.html#errors)
link-solc-events [Solidity Events](https://docs.soliditylang.org/en/v0.8.4/abi-spec.html#events)

View File

@@ -10,7 +10,11 @@ so a lot of changes are largely internal.
- [BigNumbers](migrate-bigint)
- [Contracts](migrate-contracts)
- [Importing](migrate-importing)
- [Odds and Ends](migrate-other)
- [Providers](migrate-providers)
- [Signatures](migrate-signatures)
- [Transactions](migrate-transactions)
- [Utilities](migrate-utils)
- [Removed Items](migrate-missing)
_subsection: Big Numbers @<migrate-bigint>
@@ -32,7 +36,7 @@ _code: creating large numbers @lang<script>
// Using BigNumber in v5
value = BigNumber.from("1000")
// Using BigInt in v6 (ysing literal notation).
// Using BigInt in v6 (using literal notation).
// Notice the suffix n
value = 1000n
@@ -193,10 +197,95 @@ _code: importing in v6 @lang<script>
import { InfuraProvider } from "ethers/providers"
_subsection: Odds and Ends @<migrate-other>
_subsection: Providers @<migrate-providers>
In addition to all the ``ethers.providers.*`` being moved to
``ethers.*``, the biggest change developers need to keep in
mind is that ``Web3Provider`` (which historically was used
to wrap [[link-web3js]] providers) is now called
[[BrowserProvider]] which is designed to wrap EIP-1193
providers, which is the standard that both modern Web3.js and
injected providers offer.
_code: wrapping EIP-1193 providers @lang<script>
// v5
provider = new ethers.providers.Web3Provider(window.ethereum)
// v6:
provider = new ethers.BrowserProvider(window.ethereum)
_code: default AbiCoder @lang<script>
_subsection: Signatures @<migrate-signatures>
The Signature is now a class which facilitates all the parsing
and serializing.
_code: signature manipulation
// v5
splitSig = splitSignature(sigBytes)
sigBytes = joinSignature(splitSig)
// v6
splitSig = ethers.Signature.from(sigBytes)
sigBytes = ethers.Signature.from(splitSig).serialized
_subsection: Transactions @<migrate-transactions>
The transaction helpers present in v5 were all wrapped into a
[[Transaction]] class, which can handle any supported transaction
format to be further processed
_code: parasing transactions @lang<script>
// v5
tx = parseTransaction(txBytes)
txBytes = serializeTransaction(tx)
txBytes = serializeTransaction(tx, sig)
// v6
tx = Transaction.from(txBytes)
// v6 (the tx can optionally include the signature)
txBytes = Transaction.from(tx).serialized
_subsection: Utilities @<migrate-utils>
_code: Bytes32 string helpers @lang<script>
// In v5:
bytes32 = ethers.utils.formatBytes32String(text)
text = ethers.utils.parseBytes32String(bytes32)
// In v6:
bytes32 = ethers.encodeBytes32String(text)
text = ethers.decodeBytes32String(bytes32)
_code: constants @lang<script>
// v5:
ethers.constants.AddressZero
ethers.constants.HashZero
// v6:
ethers.ZeroAddress
ethers.ZeroHash
_code: data manipulation @lang<script>
// v5
slice = ethers.utils.hexDataSlice(value, start, end)
padded = ethers.utils.hexZeroPad(value, length)
// v5; converting numbers to hexstrings
hex = hexlify(35)
// v6
slice = ethers.dataSlice(value, start, end)
padded = ethers.zeroPadValue(value, length)
// v6; converting numbers to hexstrings
hex = toBeHex(35)
_code: defaultAbiCoder @lang<script>
// In v5, it is a property of AbiCoder
coder = AbiCoder.defaultAbiCoder
@@ -206,3 +295,34 @@ _code: default AbiCoder @lang<script>
// instance is returned.
coder = AbiCoder.defaultAbiCoder()
_code: hex conversion @lang<script>
// v5
hex = ethers.utils.hexValue(value)
array = ethers.utils.arrayify(value)
// v6
hex = ethers.toQuantity(value)
array = ethers.getBytes(value)
_code: solidity non-standard packed @lang<script>
// v5
ethers.utils.solidityPack(types, values)
// v6
ethers.solidityPacked(types, values)
_code: property manipulation @lang<script>
// v5
ethers.utils.defineReadOnly(obj, "name", value)
// v6
ethers.defineProperties(obj, { name: value });
_subsection: Removed Classes and functions @<migrate-missing>
The **Logger** class has been replaced by
[several Error utility functions](about-errors).
The ``checkProperties`` and ``shallowCopy`` have been
removed in favor of using ``.map`` and ``Object.assign``.

16
lib.commonjs/README.md Normal file
View 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`.

View File

@@ -189,11 +189,19 @@ describe("Test Provider Transaction operations", function () {
assert_1.default.ok(receipt != null, "receipt != null");
// Cloudflare doesn't return the root in legacy receipts; but it isn't
// *actually* that important, so we'll give it a pass...
if (providerName === "CloudflareProvider") {
if (providerName === "CloudflareProvider" || providerName === "AnkrProvider" || providerName === "PocketProvider") {
test = Object.assign({}, test, { root: undefined });
}
//if (providerName === "PocketProvider") {
//}
assertReceipt(receipt, test);
};
});
forEach("test lookupAddress(addr) == null", blockchain_data_js_1.testReceipt, (providerName, test) => {
return async (provider) => {
const name = await provider.lookupAddress("0x0123456789012345678901234567890123456789");
assert_1.default.ok(name == null, "name == null");
};
});
});
//# sourceMappingURL=test-providers-data.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,9 @@
"use strict";
/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "6.0.0";
/**
* The current version of Ethers.
*/
exports.version = "6.0.7";
//# sourceMappingURL=_version.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"_version.js","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAW,OAAO,CAAC"}
{"version":3,"file":"_version.js","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":";AAAA,mEAAmE;;;AAEnE;;GAEG;AACU,QAAA,OAAO,GAAW,OAAO,CAAC"}

View File

@@ -52,7 +52,11 @@ function getBuiltinCallException(action, tx, data, abiCoder) {
message = "execution reverted";
const bytes = (0, index_js_3.getBytes)(data);
data = (0, index_js_3.hexlify)(data);
if (bytes.length % 32 !== 4) {
if (bytes.length === 0) {
message += " (no data present; likely require(false) occurred";
reason = "require(false)";
}
else if (bytes.length % 32 !== 4) {
message += " (could not decode reason; invalid data length)";
}
else if ((0, index_js_3.hexlify)(bytes.slice(0, 4)) === "0x08c379a0") {
@@ -67,8 +71,7 @@ function getBuiltinCallException(action, tx, data, abiCoder) {
message += `: ${JSON.stringify(reason)}`;
}
catch (error) {
console.log(error);
message += " (could not decode reason; invalid data)";
message += " (could not decode reason; invalid string data)";
}
}
else if ((0, index_js_3.hexlify)(bytes.slice(0, 4)) === "0x4e487b71") {
@@ -84,8 +87,7 @@ function getBuiltinCallException(action, tx, data, abiCoder) {
message += `: ${reason}`;
}
catch (error) {
console.log(error);
message += " (could not decode panic reason)";
message += " (could not decode panic code)";
}
}
else {
@@ -190,7 +192,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%%.
*/

File diff suppressed because one or more lines are too long

View File

@@ -112,12 +112,14 @@ class Result extends Array {
* errors.
*/
toArray() {
const result = [];
this.forEach((item, index) => {
if (item instanceof Error) {
throwError(`index ${index}`, item);
}
result.push(item);
});
return Array.of(this);
return result;
}
/**
* Returns the Result as an Object with each name-value pair.
@@ -144,9 +146,24 @@ class Result extends Array {
if (start == null) {
start = 0;
}
if (start < 0) {
start += this.length;
if (start < 0) {
start = 0;
}
}
if (end == null) {
end = this.length;
}
if (end < 0) {
end += this.length;
if (end < 0) {
end = 0;
}
}
if (end > this.length) {
end = this.length;
}
const result = [], names = [];
for (let i = start; i < end; i++) {
result.push(this[i]);

File diff suppressed because one or more lines are too long

View File

@@ -18,7 +18,7 @@ function pack(writer, coders, values) {
arrayValues = coders.map((coder) => {
const name = coder.localName;
(0, index_js_1.assert)(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values });
(0, index_js_1.assert)(unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values });
(0, index_js_1.assert)(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values });
unique[name] = true;
return values[name];
});

File diff suppressed because one or more lines are too long

View File

@@ -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);
@@ -670,7 +671,7 @@ class ParamType {
});
return new ParamType(_guard, name || "", type, "array", indexed, null, arrayLength, arrayChildren);
}
if (type === "tuple" || type.substring(0, 5) === "tuple(" || type[0] === "(") {
if (type === "tuple" || type.startsWith("tuple(" /* fix: ) */) || type.startsWith("(" /* fix: ) */)) {
const comps = (obj.components != null) ? obj.components.map((c) => ParamType.from(c)) : null;
const tuple = new ParamType(_guard, name || "", type, "tuple", indexed, comps, null, null);
// @TODO: use lexer to validate and normalize type
@@ -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

View File

@@ -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 });

View File

@@ -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.
*/
@@ -670,16 +670,15 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
const data = (0, index_js_3.getBytes)(_data, "data");
const error = abi_coder_js_1.AbiCoder.getBuiltinCallException("call", tx, data);
// Not a built-in error; try finding a custom error
if (!error.message.match(/could not decode/)) {
const customPrefix = "execution reverted (unknown custom error)";
if (error.message.startsWith(customPrefix)) {
const selector = (0, index_js_3.hexlify)(data.slice(0, 4));
error.message = "execution reverted (unknown custom error)";
const ef = this.getError(selector);
if (ef) {
try {
const args = this.#abiCoder.decode(ef.inputs, data.slice(4));
error.revert = {
name: ef.name,
signature: ef.format(),
args: this.#abiCoder.decode(ef.inputs, data.slice(4))
name: ef.name, signature: ef.format(), args
};
error.reason = error.revert.signature;
error.message = `execution reverted: ${error.reason}`;

File diff suppressed because one or more lines are too long

View File

@@ -62,7 +62,7 @@ class Typed {
return !!(this.type.match(/^u?int[0-9]+$/));
}
isData() {
return (this.type.substring(0, 5) === "bytes");
return this.type.startsWith("bytes");
}
isString() {
return (this.type === "string");

File diff suppressed because one or more lines are too long

View File

@@ -110,7 +110,7 @@ function getAddress(address) {
(0, index_js_2.assertArgument)(typeof (address) === "string", "invalid address", "address", address);
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
// Missing the 0x prefix
if (address.substring(0, 2) !== "0x") {
if (!address.startsWith("0x")) {
address = "0x" + address;
}
const result = getChecksumAddress(address);

View File

@@ -1 +1 @@
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/address/address.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,gDAA6D;AAG7D,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAEzB,SAAS,kBAAkB,CAAC,OAAe;IAC3C,sCAAsC;IACtC,2EAA2E;IAC3E,OAAO;IAEH,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAEhC,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAE7C,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QACzB,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KACxC;IAED,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC,CAAC;IAE7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE;QAC5B,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE;YAC5B,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SACrC;QACD,IAAI,CAAC,MAAM,CAA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AAM,GAAG,EAAE,EAAE;YAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;SAAE;QACrD,OAAQ,kBAAkB,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;KAC7C;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AA7BD,gCA6BC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,cAAc,CAAC,OAAe;IAC1C,2EAA2E;IAC3E,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACpE,OAAO,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;KAAE;IACrD,OAAO,IAAI,GAAG,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;AACzD,CAAC;AALD,wCAKC"}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -21,7 +21,7 @@ class ContractFactory {
if (typeof (bytecode) === "object") {
bytecode = bytecode.object;
}
if (bytecode.substring(0, 2) !== "0x") {
if (!bytecode.startsWith("0x")) {
bytecode = "0x" + bytecode;
}
bytecode = (0, index_js_3.hexlify)((0, index_js_3.getBytes)(bytecode));

View File

@@ -1 +1 @@
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":";;;AACA,8CAA4C;AAC5C,kDAAuD;AACvD,gDAG2B;AAE3B,+CAAyE;AAYzE,mCAAmC;AACnC,sCAAsC;AACtC,MAAa,eAAe;IACf,SAAS,CAAa;IACtB,QAAQ,CAAU;IAClB,MAAM,CAAyB;IAExC,YAAY,GAA6B,EAAE,QAAwC,EAAE,MAA8B;QAC/G,MAAM,KAAK,GAAG,oBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAElC,wEAAwE;QACxE,IAAI,QAAQ,YAAY,UAAU,EAAE;YAChC,QAAQ,GAAG,IAAA,kBAAO,EAAC,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAC,CAAC;SAC1C;aAAM;YACH,IAAI,OAAM,CAAC,QAAQ,CAAC,KAAK,QAAQ,EAAE;gBAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC;aAAE;YAClE,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;gBAAE,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;aAAE;YACtE,QAAQ,GAAG,IAAA,kBAAO,EAAC,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAC,CAAC;SAC1C;QAED,IAAA,2BAAgB,EAAkB,IAAI,EAAE;YACpC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,MAAM,IAAI,IA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,EAAE;YAAE,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAAE;QAEjE,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QAEvB,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,IAAI,MAAM,CAAC,QAAQ,EAAE;YACjB,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;SAC9B;aAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;YAC1C,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;SAClC;QAED,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;CACJ;AAzED,0CAyEC"}

View File

@@ -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; } });

View File

@@ -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;

View File

@@ -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,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CAAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,UAAU,CAAC,OAAkB,EAAE,KAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa;IAC3G,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAC,EAAC,YAAY,CAAC,MAAM,EAAE,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"}

View File

@@ -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

View File

@@ -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);

View File

@@ -1 +1 @@
{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":";;;;;;;;;;;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_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;

View File

@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = void 0;
const index_js_1 = require("../crypto/index.js");
const index_js_2 = require("../utils/index.js");
const xnf_1 = require("@adraffy/ens-normalize/xnf");
const ens_normalize_1 = require("@adraffy/ens-normalize");
const Zeros = new Uint8Array(32);
Zeros.fill(0);
function checkComponent(comp) {
@@ -35,7 +35,7 @@ function ensNameSplit(name) {
*/
function ensNormalize(name) {
try {
return (0, xnf_1.ens_normalize)(name);
return (0, ens_normalize_1.ens_normalize)(name);
}
catch (error) {
(0, index_js_2.assertArgument)(false, `invalid ENS name (${error.message})`, "name", name);

View File

@@ -1 +1 @@
{"version":3,"file":"namehash.js","sourceRoot":"","sources":["../../src.ts/hash/namehash.ts"],"names":[],"mappings":";;;AACA,iDAA+C;AAC/C,gDAE2B;AAG3B,oDAA2D;AAE3D,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACjC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEd,SAAS,cAAc,CAAC,IAAgB;IACpC,IAAA,yBAAc,EAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,mCAAmC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IACpF,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAC9B,MAAM,KAAK,GAAG,IAAA,sBAAW,EAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAsB,EAAG,CAAC;IAErC,IAAI,IAAI,CAAC,MAAM,KA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AAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC9C,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC;IAEjB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AAChB,CAAC;AAbD,8BAaC"}

View File

@@ -733,14 +733,23 @@ class AbstractProvider {
"function name(bytes32) view returns (string)"
], this);
const name = await resolverContract.name(node);
// Failed forward resolution
const check = await this.resolveName(name);
if (check !== address) {
console.log("FAIL", address, check);
return null;
}
return name;
}
catch (error) {
console.log("TEMP", error);
// No data was returned from the resolver
if ((0, index_js_6.isError)(error, "BAD_DATA") && error.value === "0x") {
return null;
}
// Something reerted
if ((0, index_js_6.isError)(error, "CALL_EXCEPTION")) {
return null;
}
throw error;
}
return null;
}

File diff suppressed because one or more lines are too long

View File

@@ -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;

View File

@@ -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,OAA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,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"}

View File

@@ -90,7 +90,7 @@ function getDefaultProvider(network, options) {
*/
if (options.quicknode !== "-") {
try {
let token = options.qquicknode;
let token = options.quicknode;
providers.push(new provider_quicknode_js_1.QuickNodeProvider(network, token));
}
catch (error) {

View File

@@ -1 +1 @@
{"version":3,"file":"default-provider.js","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":";;;AACA,gDAA2C;AAE3C,yDAAkD;AAClD,+DAAwD;AACxD,qEAA8D;AAC9D,mEAA4D;AAC5D,6DAAsD;AACtD,wDAAwD;AACxD,mEAA4D;AAE5D,iEAA0D;AAC1D,+DAAwD;AACxD,mEAA4D;AAM5D,SAAS,eAAe,CAAC,KAAU;IAC/B,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU;QAC9C,OAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,CAAC;AAC5C,CAAC;AAED,SAAgB,kBAAkB,CAAC,OAA4C,EAAE,OAAa;IAC1F,IAAI,OAAO,IAAI,IAAI,EAAE;QAAE,OAAO,GAAG,EAAG,CAAC;KAAE;IAEvC,IAAI,OAAM,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;QAC3D,OAAO,IAAI,qCAAe,CAAC,OAAO,CAAC,CAAC;KACvC;IAED,IAAI,OAAM,CAAC,OAAO,CAAC,K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E;KAC1C;IAED,IAAA,iBAAM,EAAC,SAAS,CAAC,MAAM,EAAE,6BAA6B,EAAE,uBAAuB,EAAE;QAC7E,SAAS,EAAE,oBAAoB;KAClC,CAAC,CAAC;IAEH,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;KAAE;IAEpD,OAAO,IAAI,uCAAgB,CAAC,SAAS,CAAC,CAAC;AAC3C,CAAC;AA7ED,gDA6EC"}

View File

@@ -94,7 +94,7 @@ class EnsResolver {
"function addr(bytes32) view returns (address)",
"function addr(bytes32, uint) view returns (address)",
"function text(bytes32, string) view returns (string)",
"function contenthash() view returns (bytes)",
"function contenthash(bytes32) view returns (bytes)",
], provider);
}
/**
@@ -223,7 +223,7 @@ class EnsResolver {
*/
async getContentHash() {
// keccak256("contenthash()")
const data = await this.#fetch("contenthash()");
const data = await this.#fetch("contenthash(bytes32)");
// No contenthash
if (data == null || data === "0x") {
return null;

File diff suppressed because one or more lines are too long

View File

@@ -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

View File

@@ -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;

View File

@@ -229,32 +229,46 @@ function injectCommonNetworks() {
registerEth("classic", 61, {});
registerEth("classicKotti", 6, {});
registerEth("xdai", 100, { ensNetwork: 1 });
registerEth("optimism", 10, {
ensNetwork: 1,
etherscan: { url: "https:/\/api-optimistic.etherscan.io/" }
});
registerEth("optimism-goerli", 420, {
etherscan: { url: "https:/\/api-goerli-optimistic.etherscan.io/" }
});
registerEth("arbitrum", 42161, {
ensNetwork: 1,
etherscan: { url: "https:/\/api.arbiscan.io/" }
});
registerEth("arbitrum-goerli", 421613, {
etherscan: { url: "https:/\/api-goerli.arbiscan.io/" }
});
// Polygon has a 35 gwei maxPriorityFee requirement
registerEth("matic", 137, {
ensNetwork: 1,
// priorityFee: 35000000000,
etherscan: {
apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api.polygonscan.com/"
}
});
registerEth("maticMumbai", 80001, {
// priorityFee: 35000000000,
etherscan: {
apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api-testnet.polygonscan.com/"
}
});
registerEth("bnb", 56, {
ensNetwork: 1,
etherscan: {
apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api.bscscan.com"
}
});
registerEth("bnbt", 97, {
etherscan: {
apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api-testnet.bscscan.com"
}
});

File diff suppressed because one or more lines are too long

View File

@@ -138,7 +138,7 @@ function getMedian(quorum, results) {
}
// Get the sorted values
values.sort((a, b) => ((a < b) ? -1 : (b > a) ? 1 : 0));
const mid = values.length / 2;
const mid = Math.floor(values.length / 2);
// Odd-length; take the middle value
if (values.length % 2) {
return values[mid];

File diff suppressed because one or more lines are too long

View File

@@ -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

View File

@@ -89,7 +89,7 @@ function copyRequest(req) {
if (req.data) {
result.data = (0, index_js_1.hexlify)(req.data);
}
const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerGas, maxPriorityFeePerGas,value".split(/,/);
const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);
for (const key of bigIntKeys) {
if (!(key in req) || req[key] == null) {
continue;
@@ -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

View File

@@ -24,7 +24,8 @@ class NonceManager extends abstract_signer_js_1.AbstractSigner {
if (this.#noncePromise == null) {
this.#noncePromise = super.getNonce("pending");
}
return (await this.#noncePromise) + this.#delta;
const delta = this.#delta;
return (await this.#noncePromise) + delta;
}
return super.getNonce(blockTag);
}

View File

@@ -1 +1 @@
{"version":3,"file":"signer-noncemanager.js","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":";;;AAAA,gDAAqD;AACrD,6DAAsD;AAUtD,MAAa,YAAa,SAAQ,mCAAc;IAC5C,MAAM,CAAU;IAEhB,aAAa,CAAyB;IACtC,MAAM,CAAS;IAEf,YAAY,MAAc;QACtB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,IAAA,2BAAgB,EAAe,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,UAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC;IAED,OAAO,CAAC,QAAyB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ACL,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAED,KAAK;QACD,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAsB;QACxC,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;QAEjB,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;QAC/C,EAAE,CAAC,KAAK,GAAG,MAAM,YAAY,CAAC;QAE9B,sDAAsD;QACtD,wDAAwD;QACxD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,eAAe,CAAC,EAAsB;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,WAAW,CAAC,OAA4B;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,aAAa,CAAC,MAAuB,EAAE,KAA4C,EAAE,KAA0B;QAC3G,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC;CACJ;AAnED,oCAmEC"}

View File

@@ -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;

View File

@@ -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;YAC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AAE,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,CAAC,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO;SAAE;QAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,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;AA/CD,8DA+CC"}

View File

@@ -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);

View File

@@ -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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AA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,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"}

View File

@@ -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

View File

@@ -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

View File

@@ -1 +0,0 @@
{"version":3,"file":"subscriber.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDE"}

View File

@@ -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;

View File

@@ -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");

View File

@@ -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"}

View File

@@ -130,7 +130,7 @@ exports.dataSlice = dataSlice;
*/
function stripZerosLeft(data) {
let bytes = hexlify(data).substring(2);
while (bytes.substring(0, 2) == "00") {
while (bytes.startsWith("00")) {
bytes = bytes.substring(2);
}
return "0x" + bytes;
@@ -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

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