Compare commits

..

83 Commits

Author SHA1 Message Date
Richard Moore
30ffa78d14 Added extra details in the error info field for RPC errors. 2023-03-20 14:42:19 -04:00
Richard Moore
6e01e5448f Remove Ankr as a deafult for now as the provided API key is failing. 2023-03-20 14:40:43 -04:00
Richard Moore
d2e683e8eb admin: updated dist files 2023-03-20 13:33:56 -04:00
Richard Moore
2e3802a83b Fixed deferred filters after unsafe-eval changes (#3749, #3763). 2023-03-20 13:32:50 -04:00
Richard Moore
0816d54dd5 admin: fixed typo in CI workflow 2023-03-20 12:59:57 -04:00
Richard Moore
d4af1046c8 docs: added info on replacing fetchJson with FetchRequest 2023-03-20 12:58:10 -04:00
Richard Moore
0a9e4cd67d tests: updated ENS normalization tests to latest standard 2023-03-20 12:54:08 -04:00
Richard Moore
e03390130c admin: updated dist files 2023-03-20 12:53:37 -04:00
Richard Moore
7d3af512c7 Remove use of Function sub-class to address unsafe-eval issues (#3749, #3763). 2023-03-20 12:49:58 -04:00
Richard Moore
5318b939fd tests: added contract integration tests and llocal Geth 2023-03-20 12:46:21 -04:00
Richard Moore
f06a445247 Added verifyTypedData utility (reported on Farcaster). 2023-03-20 11:31:35 -04:00
Richard Moore
e11d4c1c20 Removed stray logging in IpcProvider (#3908, #3909). 2023-03-18 13:27:47 -04:00
Richard Moore
fcf6c8fcee Fixed legacy serialization for implicit chainId transactions (#3898, #3899). 2023-03-16 12:11:46 -04:00
Richard Moore
3ad4273b8b Fix Webpack issue (reported on discord). 2023-03-16 10:19:33 -04:00
Richard Moore
6315e78ea3 Fix some bundlers which cannot handle recursive pkg.exports (#3848). 2023-03-13 06:41:18 -04:00
Richard Moore
7eaf3c4e8b docs: added provider updates to migration (#3844) 2023-03-13 01:16:41 -04:00
Richard Moore
8a02029c00 docs: fixed typo (#3864) 2023-03-13 01:10:42 -04:00
Richard Moore
4a581b9944 admin: added script to create github releases (#3784) 2023-03-12 05:41:15 -04:00
Richard Moore
47ef3ebde3 Fixed typo in signature.s error (#3891). 2023-03-12 04:50:42 -04:00
Richard Moore
f61ad27a8e docs: fixed typo (#3877) 2023-03-12 04:47:08 -04:00
Richard Moore
c220fe2ea7 Fixed stray unreachable code (#3890). 2023-03-12 04:45:12 -04:00
Richard Moore
8136a6476b docs: added more jsdocs to TransactionResponse 2023-03-11 01:02:24 -05:00
Richard Moore
02a0aad612 Move all wrapping to proper _wrap functions (#3818). 2023-03-10 07:02:51 -05:00
Richard Moore
278f841744 admin: updated dist files 2023-03-07 02:11:03 -05:00
Richard Moore
5f2678fb05 Fixed ethers imported in web workers (#3856). 2023-03-07 02:07:03 -05:00
Richard Moore
abeaa74da0 Added Sepolia support (#3863). 2023-03-07 01:36:57 -05:00
Richard Moore
26a830eef5 docs: updated project links 2023-03-03 18:25:27 -07:00
Richard Moore
dced2b7dac admin: updated dist files 2023-03-03 18:25:07 -07:00
Richard Moore
06aa30363f Added missing exports (#3734). 2023-03-03 18:05:55 -07:00
Richard Moore
a32af3adc1 Allow null values for TypedData domain (#3623). 2023-03-03 17:59:58 -07:00
Richard Moore
287d94fc45 Added listAccounts to JsonRpcProvider (#3778). 2023-03-03 17:59:05 -07:00
Richard Moore
fe1f04c6e5 Allow BigInt for blockTag (#3780). 2023-03-03 17:44:08 -07:00
Richard Moore
f1a810dcb5 Fixed typo in error messages (#3822, #3824). 2023-02-28 21:18:27 -05:00
Richard Moore
76fab923da Re-adding definition files to require exports (#3703). 2023-02-28 21:15:18 -05:00
Richard Moore
4f2d1e1c7b docs: fixed typos in docs 2023-02-26 18:25:02 -05:00
Richard Moore
ba967875f7 docs: update flatworm cli 2023-02-24 00:49:05 -05:00
Richard Moore
0d417ff2a9 admin: updated dist files 2023-02-23 06:31:09 -05:00
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
459 changed files with 28693 additions and 2252 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?

View File

@@ -1,7 +1,7 @@
name: Bug Report
description: Open an issue for a bug in Ethers
title: "Bug Report Title"
labels: ["investigate"]
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:
@@ -18,7 +18,7 @@ body:
attributes:
label: Ethers Version
description: What version of ethers are you using? Before opening an issue, please make sure you are up to date.
placeholder: x.y.z
placeholder: 6.y.z
validations:
required: true
- type: input

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/cli-test ./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 @@ on:
push:
branches:
- main
paths:
- "src.ts/**"
jobs:
@@ -30,6 +32,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install and run Geth
uses: ethers-io/run-geth-action@main
- name: Checkout repository
uses: actions/checkout@v2
@@ -61,6 +66,9 @@ jobs:
with:
node-version: 18.x
- name: Install and run Geth
uses: ethers-io/run-geth-action@main
- name: Checkout repository
uses: actions/checkout@v2
@@ -97,44 +105,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:
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/**

View File

@@ -1,7 +1,94 @@
Changelog
=========
Change Log
==========
ethers/v6.0.0 (2023-02-02 21:19)
This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated.
ethers/v6.2.0 (2023-03-20 13:33)
--------------------------------
- Initial v6 release.
- tests: updated ENS normalization tests to latest standard ([0a9e4cd](https://github.com/ethers-io/ethers.js/commit/0a9e4cd67dd0187445930cdb9d75d548590af9b2)).
- Remove use of Function sub-class to address unsafe-eval issues ([#3749](https://github.com/ethers-io/ethers.js/issues/3749), [#3763](https://github.com/ethers-io/ethers.js/issues/3763); [7d3af51](https://github.com/ethers-io/ethers.js/commit/7d3af512c75b4c24027ec2daef1e9f4c1064194a), [2e3802a](https://github.com/ethers-io/ethers.js/commit/2e3802a83b8ad2f5a6269d79fbd1c83c9f2d1047)).
- tests: added contract integration tests and llocal Geth ([5318b93](https://github.com/ethers-io/ethers.js/commit/5318b939fdfe8f58cdea4bdff7923f18afbea3a2)).
- Added verifyTypedData utility (reported on Farcaster) ([f06a445](https://github.com/ethers-io/ethers.js/commit/f06a445247f3b294f9fc805cc8fe0752accb8edc)).
- Removed stray logging in IpcProvider ([#3908](https://github.com/ethers-io/ethers.js/issues/3908), [#3909](https://github.com/ethers-io/ethers.js/issues/3909); [e11d4c1](https://github.com/ethers-io/ethers.js/commit/e11d4c1c20cc5b6fd5803cf9636c4f5bc082dab7)).
- Fixed legacy serialization for implicit chainId transactions ([#3898](https://github.com/ethers-io/ethers.js/issues/3898), [#3899](https://github.com/ethers-io/ethers.js/issues/3899); [fcf6c8f](https://github.com/ethers-io/ethers.js/commit/fcf6c8fcee95ec412aaafba8ec84d5049b077a4e)).
- Fix Webpack issue (reported on discord) ([3ad4273](https://github.com/ethers-io/ethers.js/commit/3ad4273b8b714bff344ccbfb1eb71ed8a8b7cfa4)).
- Fix some bundlers which cannot handle recursive pkg.exports ([#3848](https://github.com/ethers-io/ethers.js/issues/3848); [6315e78](https://github.com/ethers-io/ethers.js/commit/6315e78ea32147653b72ca06f6800f3e2df6ffbf)).
- Fixed typo in signature.s error ([#3891](https://github.com/ethers-io/ethers.js/issues/3891); [47ef3eb](https://github.com/ethers-io/ethers.js/commit/47ef3ebde37bfa0c015c258c3d8a6800d751e147)).
- Fixed stray unreachable code ([#3890](https://github.com/ethers-io/ethers.js/issues/3890); [c220fe2](https://github.com/ethers-io/ethers.js/commit/c220fe2ea747ccc80cd3c4020e0278e3daf3c4fc)).
- Move all wrapping to proper _wrap functions ([#3818](https://github.com/ethers-io/ethers.js/issues/3818); [02a0aad](https://github.com/ethers-io/ethers.js/commit/02a0aad61212c35e8d2723a8ae589989b97dae3e)).
ethers/v6.1.0 (2023-03-07 02:10)
--------------------------------
- Fixed ethers imported in web workers ([#3856](https://github.com/ethers-io/ethers.js/issues/3856); [5f2678f](https://github.com/ethers-io/ethers.js/commit/5f2678fb059d643638b9cc1dc59cbfc61ce7a7b8)).
- Added Sepolia support ([#3863](https://github.com/ethers-io/ethers.js/issues/3863); [abeaa74](https://github.com/ethers-io/ethers.js/commit/abeaa74da04fbe25e837a2ffa7d1e9c1257a5da5)).
- Added missing exports ([#3734](https://github.com/ethers-io/ethers.js/issues/3734); [06aa303](https://github.com/ethers-io/ethers.js/commit/06aa30363f88144db672376d39012d7fe3f86c33)).
- Allow null values for TypedData domain ([#3623](https://github.com/ethers-io/ethers.js/issues/3623); [a32af3a](https://github.com/ethers-io/ethers.js/commit/a32af3adc104c4b07a45097a4a3725a4ce9e0be6)).
- Added listAccounts to JsonRpcProvider ([#3778](https://github.com/ethers-io/ethers.js/issues/3778); [287d94f](https://github.com/ethers-io/ethers.js/commit/287d94fc454d03f1b3086ea98745131cdf40129a)).
- Allow BigInt for blockTag ([#3780](https://github.com/ethers-io/ethers.js/issues/3780); [fe1f04c](https://github.com/ethers-io/ethers.js/commit/fe1f04c6e5fb4254a100f492d7dcbdc3cf19a446)).
- Fixed typo in error messages ([#3822](https://github.com/ethers-io/ethers.js/issues/3822), [#3824](https://github.com/ethers-io/ethers.js/issues/3824); [f1a810d](https://github.com/ethers-io/ethers.js/commit/f1a810dcb56df54b1e1567f2a59c73500619472f)).
- Re-adding definition files to require exports ([#3703](https://github.com/ethers-io/ethers.js/issues/3703); [76fab92](https://github.com/ethers-io/ethers.js/commit/76fab923da33e71e6bb751bb0b5e3ba3faa27ab2)).
ethers/v6.0.8 (2023-02-23 06:30)
--------------------------------
- Fix matic-mumbai network and include aliases to legacy names ([#3811](https://github.com/ethers-io/ethers.js/issues/3811); [20bbd12](https://github.com/ethers-io/ethers.js/commit/20bbd1281911d31b360f6f5032251c9257943541)).
- Fixed getSigner bug ([#3821](https://github.com/ethers-io/ethers.js/issues/3821); [388edf6](https://github.com/ethers-io/ethers.js/commit/388edf6abc168f89f1ca609e9e5b025dc9205add)).
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.

25
dist/README.md vendored
View File

@@ -1,7 +1,22 @@
Distribution Files
==================
Distribution Folder
===================
This folder contains the library reduced to single-file variants.
The contents of this folder are for using `import` in ESM
browser-base projects.
They are generate with the `npm run build-dist` command, which uses
rollup (via the `/rollup.config.js` configuration).
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`.

1850
dist/ethers.js vendored

File diff suppressed because one or more lines are too long

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

22816
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.2.0";
/**
* 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

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

@@ -3,7 +3,7 @@ _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.
@@ -14,7 +14,7 @@ _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

View File

@@ -24,7 +24,7 @@ link-tally [Tally](https://tallyho.org)
# Project-specific
link-alchemy-signup [Alchemy Signup](https://dashboard.alchemyapi.io/signup?referral=55a35117-028e-4b7c-9e47-e275ad0acc6d)
link-ankr-public [link-ankr-public](https://www.ankr.com/protocol/public/)
link-ankr-premium [link-ankr-premium](https://www.ankr.com/protocol/plan/)
link-ankr-signup [link-ankr-premium](https://www.ankr.com/protocol/plan/)
link-etherscan-signup [Etherscan Signup](https://etherscan.io/apis)
link-etherscan-ratelimit [link-etherscan-ratelimit](https://info.etherscan.com/api-return-errors/)
link-infura-signup [INFURA Signup](https://infura.io/register)
@@ -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

@@ -26,6 +26,7 @@ link-eip-1014 [EIP-1014](https://eips.ethereum.org/EIPS/eip-1014)
link-eip-1193 [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193)
link-eip-1559 [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559)
link-eip-1577 [EIP-1577](https://eips.ethereum.org/EIPS/eip-1577)
link-eip-2070 [EIP-2930](https://eips.ethereum.org/EIPS/eip-2070)
link-eip-2098 [EIP-2098](https://eips.ethereum.org/EIPS/eip-2098)
link-eip-2304 [EIP-2304](https://eips.ethereum.org/EIPS/eip-2304)
link-eip-2718 [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718)
@@ -39,8 +40,9 @@ 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-abi [ABI Specification](https://docs.soliditylang.org/en/v0.8.19/abi-spec.html#formal-specification-of-the-encoding)
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)
link-solc-output [solc standard output](https://solidity.readthedocs.io/en/v0.6.0/using-the-compiler.html#output-description)

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,105 @@ _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)
Also, the method for braodcasting transactions to the network has
changed:
_code: broadcasting transactions @lang<script>
// v5
provider.sendTransaction(signedTx)
// v6
provider.broadcastTransaction(signedTx)
_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: parsing 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,23 +305,65 @@ _code: default AbiCoder @lang<script>
// instance is returned.
coder = AbiCoder.defaultAbiCoder()
_code: getting a JSON-RPC quantity @lang<script>
// In v5:
hex = ethers.util.hexValue(value)
_code: fetching content @lang<script>
// v5, with a body and no weird things
data = await ethers.utils.fetchJson(url, json, processFunc)
// In v6:
// v5 with Connection overrides
req = {
url, user: "username", password: "password"
// etc. properties have FetchRequest equivalents
};
data = await ethers.utils.detchJson(req, json, processFunc)
// v6
req = new ethers.FetchRequest(url)
// set a body; optional
req.body = json
// set credentials; optional
req.setCredentials("username", "password")
// set a processFunc; optional
req.processFunc = processFunc
// send the request!
resp = await req.send()
// Get the response body; depending on desired format
data = resp.body // Uint8Array
data = resp.bodyText // Utf8String; throws if invalid
data = resp.bodyJson // Object; throws if invalid
_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: using Bytes32 strings @lang<script>
// In v5:
bytes32 = formatBytes32String(text)
text = parseBytes32String(bytes32)
_code: solidity non-standard packed @lang<script>
// v5
ethers.utils.solidityPack(types, values)
// In v6:
bytes32 = encodeBytes32String(text)
text = decodeBytes32String(bytes32)
// v6
ethers.solidityPacked(types, values)
_subsection: Removed Classes and functions
_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

@@ -0,0 +1,80 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const index_js_1 = require("../index.js");
describe("Tests contract integration", function () {
const provider = new index_js_1.ethers.JsonRpcProvider("http:/\/127.0.0.1:8545");
const abi = [
"constructor(address owner, uint maxSupply)",
"function mint(address target) returns (bool minted)",
"function totalSupply() view returns (uint supply)",
"function balanceOf(address target) view returns (uint balance)",
"event Minted(address target)"
];
let address = null;
it("deploys a contract", async function () {
this.timeout(10000);
const bytecode = "0x60c060405234801561001057600080fd5b506040516105863803806105868339818101604052810190610032919061010e565b8173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508060a08181525050505061014e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a58261007a565b9050919050565b6100b58161009a565b81146100c057600080fd5b50565b6000815190506100d2816100ac565b92915050565b6000819050919050565b6100eb816100d8565b81146100f657600080fd5b50565b600081519050610108816100e2565b92915050565b6000806040838503121561012557610124610075565b5b6000610133858286016100c3565b9250506020610144858286016100f9565b9150509250929050565b60805160a051610414610172600039600060fa0152600061021f01526104146000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806318160ddd146100515780636a6278421461006f57806370a082311461009f5780638da5cb5b146100cf575b600080fd5b6100596100ed565b604051610066919061025c565b60405180910390f35b610089600480360381019061008491906102da565b6100f6565b6040516100969190610322565b60405180910390f35b6100b960048036038101906100b491906102da565b6101d2565b6040516100c6919061025c565b60405180910390f35b6100d761021b565b6040516100e4919061034c565b60405180910390f35b60008054905090565b60007f00000000000000000000000000000000000000000000000000000000000000006000541061012657600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061017690610396565b919050555060008081548092919061018d90610396565b91905055507f90ddedd5a25821bba11fbb98de02ec1f75c1be90ae147d6450ce873e7b78b5d8826040516101c1919061034c565b60405180910390a160019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000905090565b6000819050919050565b61025681610243565b82525050565b6000602082019050610271600083018461024d565b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102a78261027c565b9050919050565b6102b78161029c565b81146102c257600080fd5b50565b6000813590506102d4816102ae565b92915050565b6000602082840312156102f0576102ef610277565b5b60006102fe848285016102c5565b91505092915050565b60008115159050919050565b61031c81610307565b82525050565b60006020820190506103376000830184610313565b92915050565b6103468161029c565b82525050565b6000602082019050610361600083018461033d565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006103a182610243565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036103d3576103d2610367565b5b60018201905091905056fea26469706673582212200a979ea2bfdf429b5546fa25906c9d20a3d67ef5fbe531f31d2cc83533e3239564736f6c63430008120033";
const signer = await provider.getSigner(0);
const factory = new index_js_1.ethers.ContractFactory(abi, bytecode, signer);
const contract = await factory.deploy(signer, 100);
address = await contract.getAddress();
await contract.waitForDeployment();
const deployed = await provider.getCode(address);
assert_1.default.ok(deployed != "0x", "has bytescode");
});
it("runs contract operations", async function () {
this.timeout(10000);
assert_1.default.ok(address != null);
const signer = await provider.getSigner(0);
const CustomContract = index_js_1.ethers.BaseContract.buildClass(abi);
const contract = new CustomContract(address, signer); //ethers.Contract.from<ContractAbi>(address, abi, signer);
// Test implicit staticCall (i.e. view/pure)
{
const supply0 = await contract.totalSupply();
assert_1.default.equal(supply0, BigInt(0), "initial supply 0; default");
}
// Test explicit staticCall
{
const supply0 = await contract.totalSupply.staticCall();
assert_1.default.equal(supply0, BigInt(0), "initial supply 0; staticCall");
}
// Test staticCallResult (positional and named)
{
const supply0 = await contract.totalSupply.staticCallResult();
assert_1.default.equal(supply0[0], BigInt(0), "initial supply 0; staticCallResult");
assert_1.default.equal(supply0.supply, BigInt(0), "initial supply 0; staticCallResult");
}
// Test populateTransaction
const txInfo = await contract.mint.populateTransaction(signer);
assert_1.default.equal(txInfo.to, address, "populateTransaction.to");
const txInfoData = index_js_1.ethers.hexlify(index_js_1.ethers.concat([
"0x6a627842",
index_js_1.ethers.zeroPadValue(await signer.getAddress(), 32)
]));
assert_1.default.equal(txInfo.data, txInfoData, "populateTransaction.data");
// Test minting (default)
const tx = await contract.mint(signer);
const receipt = await tx.wait();
assert_1.default.ok(receipt, "receipt");
// Check the receipt has parsed the events
assert_1.default.equal(receipt.logs.length, 1, "logs.length");
assert_1.default.ok(receipt instanceof index_js_1.ethers.ContractTransactionReceipt, "receipt typeof");
assert_1.default.ok(receipt.logs[0] instanceof index_js_1.ethers.EventLog, "receipt.log typeof");
assert_1.default.equal(receipt.logs[0].fragment && receipt.logs[0].fragment.name, "Minted", "logs[0].fragment.name");
assert_1.default.equal(receipt.logs[0].args[0], await signer.getAddress(), "logs[0].args[0]");
assert_1.default.equal(receipt.logs[0].args.target, await signer.getAddress(), "logs[0].args.target");
// Check the state has been adjusted
assert_1.default.equal(await contract.totalSupply(), BigInt(1), "initial supply 1; default");
assert_1.default.equal(await contract.balanceOf(signer), BigInt(1), "balanceOf(signer)");
// Test minting (explicit)
const tx2 = await contract.mint.send(signer);
await tx2.wait();
// Check the state has been adjusted
assert_1.default.equal(await contract.totalSupply(), BigInt(2), "initial supply 2; default");
});
});
//# sourceMappingURL=test-contract-integ.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"test-contract-integ.js","sourceRoot":"","sources":["../../src.ts/_tests/test-contract-integ.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAG5B,0CAAqC;AAQrC,QAAQ,CAAC,4BAA4B,EAAE;IACnC,MAAM,QAAQ,GAAG,IAAI,iBAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;IAEtE,MAAM,GAAG,GAAG;QACR,4CAA4C;QAC5C,qDAAqD;QACrD,mDAAmD;QACnD,gEAAgE;QAChE,8BAA8B;KACjC,CAAC;IAEF,IAAI,OAAO,GAAkB,IAAI,CAAC;IAElC,EAAE,CAAC,oBAAoB,EAAE,KAAK;QAC1B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEpB,MAAM,QAAQ,GAAG,gxFAAgxF,CAAC;QAClyF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAE3C,MAAM,OAAO,GAAG,IAAI,iBAAM,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAElE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACnD,OAAO,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;QAEtC,MAAM,QAAQ,CAAC,iBAAiB,EAAE,CAAC;QAEnC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,gBAAM,CAAC,EAAE,CAAC,QAAQ,IAAI,IAAI,EAAE,eAAe,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,KAAK;QAChC,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,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,qBAAqB,CAAC,CAAC;QAE5F,oCAAoC;QACpC,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;QACnF,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;QAE/E,0BAA0B;QAC1B,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAEjB,oCAAoC;QACpC,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

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 +1,4 @@
/**
* The current version of Ethers.
*/
export declare const version: string;

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.2.0";
//# 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

@@ -1,6 +1,6 @@
/**
* When sending values to or receiving values from a [[Contract]], the
* data is generally encoded using the [ABI standard](solc-abi-standard).
* data is generally encoded using the [ABI standard](link-solc-abi).
*
* The AbiCoder provides a utility to encode values to ABI data and
* decode values from ABI data.
@@ -46,7 +46,7 @@ export declare class AbiCoder {
*/
static defaultAbiCoder(): AbiCoder;
/**
* Returns an ethers-compatible [[CALL_EXCEPTION]] Error for the given
* Returns an ethers-compatible [[CallExceptionError]] Error for the given
* result %%data%% for the [[CallExceptionAction]] %%action%% against
* the Transaction %%tx%%.
*/

View File

@@ -1,7 +1,7 @@
"use strict";
/**
* When sending values to or receiving values from a [[Contract]], the
* data is generally encoded using the [ABI standard](solc-abi-standard).
* data is generally encoded using the [ABI standard](link-solc-abi).
*
* The AbiCoder provides a utility to encode values to ABI data and
* decode values from ABI data.
@@ -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

@@ -1,7 +1,7 @@
/**
* About frgaments...
*
* @_subsection api/abi/abi-coder:Fragments
* @_subsection api/abi/abi-coder:Fragments [about-fragments]
*/
/**
* A type description in a JSON API.
@@ -104,26 +104,25 @@ export declare class ParamType {
/**
* True if the parameters is indexed.
*
* For non-indexable types (see [[ParamType_isIndexable]]) this
* is ``null``.
* For non-indexable types this is ``null``.
*/
readonly indexed: null | boolean;
/**
* The components for the tuple.
*
* For non-tuple types (see [[ParamType_isTuple]]) this is ``null``.
* For non-tuple types this is ``null``.
*/
readonly components: null | ReadonlyArray<ParamType>;
/**
* The array length, or ``-1`` for dynamic-lengthed arrays.
*
* For non-array types (see [[ParamType_isArray]]) this is ``null``.
* For non-array types this is ``null``.
*/
readonly arrayLength: null | number;
/**
* The type of each child in the array.
*
* For non-array types (see [[ParamType_isArray]]) this is ``null``.
* For non-array types this is ``null``.
*/
readonly arrayChildren: null | ParamType;
/**

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;
@@ -55,7 +57,6 @@ class TokenString {
linkBack: (t.linkBack - from),
linkNext: (t.linkNext - from),
}));
return t;
}));
}
// Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens
@@ -145,7 +146,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 +195,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 +210,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 +357,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;
/**
@@ -505,7 +505,7 @@ class ParamType {
walk(value, process) {
if (this.isArray()) {
if (!Array.isArray(value)) {
throw new Error("invlaid array value");
throw new Error("invalid array value");
}
if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
throw new Error("array is wrong length");
@@ -515,7 +515,7 @@ class ParamType {
}
if (this.isTuple()) {
if (!Array.isArray(value)) {
throw new Error("invlaid tuple value");
throw new Error("invalid tuple value");
}
if (value.length !== this.components.length) {
throw new Error("array is wrong length");
@@ -528,7 +528,7 @@ class ParamType {
#walkAsync(promises, value, process, setValue) {
if (this.isArray()) {
if (!Array.isArray(value)) {
throw new Error("invlaid array value");
throw new Error("invalid array value");
}
if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
throw new Error("array is wrong length");
@@ -552,7 +552,7 @@ class ParamType {
}
else {
if (value == null || typeof (value) !== "object") {
throw new Error("invlaid tuple value");
throw new Error("invalid tuple value");
}
result = components.map((param) => {
if (!param.name) {
@@ -654,7 +654,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 +670,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 +799,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

@@ -1,7 +1,7 @@
/**
* Explain about ABI here...
*
* @_section api/abi:Application Binary Interface [abi]
* @_section api/abi:Application Binary Interface [about-abi]
* @_navTitle: ABI
*/
export { AbiCoder } from "./abi-coder.js";

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

@@ -160,7 +160,7 @@ export declare class Interface {
* specified error (see [[getError]] for valid values for
* %%key%%).
*
* Most developers should prefer the [[parseResult]] method instead,
* Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error.
*/
@@ -194,7 +194,7 @@ export declare class Interface {
* specified function (see [[getFunction]] for valid values for
* %%key%%).
*
* Most developers should prefer the [[parseResult]] method instead,
* Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error.
*/

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

@@ -37,7 +37,7 @@ export declare function getAddress(address: string): string;
/**
* The [ICAP Address format](link-icap) format is an early checksum
* format which attempts to be compatible with the banking
* industry [IBAN format](link-wiki-iban] for bank accounts.
* industry [IBAN format](link-wiki-iban) for bank accounts.
*
* It is no longer common or a recommended format.
*

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);
@@ -134,7 +134,7 @@ exports.getAddress = getAddress;
/**
* The [ICAP Address format](link-icap) format is an early checksum
* format which attempts to be compatible with the banking
* industry [IBAN format](link-wiki-iban] for bank accounts.
* industry [IBAN format](link-wiki-iban) for bank accounts.
*
* It is no longer common or a recommended format.
*

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

@@ -10,7 +10,7 @@
* These functions help convert between various formats, validate
* addresses and safely resolve ENS names.
*
* @_section: api/address:Addresses [addresses]
* @_section: api/address:Addresses [about-addresses]
*/
/**
* An interface for objects which have an address, and can

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

@@ -1,7 +1,7 @@
/**
* Some common constants useful for Ethereum.
*
* @_section: api/constants: Constants [constants]
* @_section: api/constants: Constants [about-constants]
*/
export { ZeroAddress } from "./addresses.js";
export { ZeroHash } from "./hashes.js";

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

@@ -4,8 +4,8 @@ import { ContractTransactionResponse, EventLog } from "./wrappers.js";
import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js";
import type { Addressable } from "../address/index.js";
import type { EventEmitterable, Listener } from "../utils/index.js";
import type { BlockTag, ContractRunner, TransactionRequest } from "../providers/index.js";
import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction } from "./types.js";
import type { BlockTag, ContractRunner } from "../providers/index.js";
import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction, WrappedFallback } from "./types.js";
/**
* @_ignore:
*/
@@ -14,14 +14,6 @@ export declare function copyOverrides<O extends string = "data" | "to">(arg: any
* @_ignore:
*/
export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray<ParamType>, args: Array<any>): Promise<Array<any>>;
declare class WrappedFallback {
readonly _contract: BaseContract;
constructor(contract: BaseContract);
populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction>;
staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string>;
send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint>;
}
declare const internal: unique symbol;
export declare class BaseContract implements Addressable, EventEmitterable<ContractEventName> {
readonly target: string | Addressable;

View File

@@ -58,9 +58,6 @@ class PreparedTopicFilter {
// D = The type the default call will return (i.e. R for view/pure,
// TransactionResponse otherwise)
//export interface ContractMethod<A extends Array<any> = Array<any>, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {
function _WrappedMethodBase() {
return Function;
}
function getRunner(value, feature) {
if (value == null) {
return null;
@@ -112,98 +109,142 @@ async function resolveArgs(_runner, inputs, args) {
}));
}
exports.resolveArgs = resolveArgs;
class WrappedFallback {
_contract;
constructor(contract) {
(0, index_js_3.defineProperties)(this, { _contract: contract });
const proxy = new Proxy(this, {
// Perform send when called
apply: async (target, thisArg, args) => {
return await target.send(...args);
},
});
return proxy;
}
async populateTransaction(overrides) {
function buildWrappedFallback(contract) {
const populateTransaction = async function (overrides) {
// If an overrides was passed in, copy it and normalize the values
const tx = (await copyOverrides(overrides, ["data"]));
tx.to = await this._contract.getAddress();
const iface = this._contract.interface;
tx.to = await contract.getAddress();
const iface = contract.interface;
// Only allow payable contracts to set non-zero value
const payable = iface.receive || (iface.fallback && iface.fallback.payable);
(0, index_js_3.assertArgument)(payable || (tx.value || BN_0) === BN_0, "cannot send value to non-payable contract", "overrides.value", tx.value);
// Only allow fallback contracts to set non-empty data
(0, index_js_3.assertArgument)(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data);
return tx;
}
async staticCall(overrides) {
const runner = getRunner(this._contract.runner, "call");
};
const staticCall = async function (overrides) {
const runner = getRunner(contract.runner, "call");
(0, index_js_3.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
const tx = await this.populateTransaction(overrides);
const tx = await populateTransaction(overrides);
try {
return await runner.call(tx);
}
catch (error) {
if ((0, index_js_3.isCallException)(error) && error.data) {
throw contract.interface.makeError(error.data, tx);
}
throw error;
}
};
const send = async function (overrides) {
const runner = contract.runner;
(0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
const tx = await runner.sendTransaction(await populateTransaction(overrides));
const provider = getProvider(contract.runner);
// @TODO: the provider can be null; make a custom dummy provider that will throw a
// meaningful error
return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx);
};
const estimateGas = async function (overrides) {
const runner = getRunner(contract.runner, "estimateGas");
(0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
return await runner.estimateGas(await populateTransaction(overrides));
};
const method = async (overrides) => {
return await send(overrides);
};
(0, index_js_3.defineProperties)(method, {
_contract: contract,
estimateGas,
populateTransaction,
send, staticCall
});
return method;
}
/*
class WrappedFallback {
constructor (contract: BaseContract) {
defineProperties<WrappedFallback>(this, { _contract: contract });
const proxy = new Proxy(this, {
// Perform send when called
apply: async (target, thisArg, args: Array<any>) => {
return await target.send(...args);
},
});
return proxy;
}
async populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction> {
// If an overrides was passed in, copy it and normalize the values
const tx: ContractTransaction = <any>(await copyOverrides<"data">(overrides, [ "data" ]));
tx.to = await this._contract.getAddress();
const iface = this._contract.interface;
// Only allow payable contracts to set non-zero value
const payable = iface.receive || (iface.fallback && iface.fallback.payable);
assertArgument(payable || (tx.value || BN_0) === BN_0,
"cannot send value to non-payable contract", "overrides.value", tx.value);
// Only allow fallback contracts to set non-empty data
assertArgument(iface.fallback || (tx.data || "0x") === "0x",
"cannot send data to receive-only contract", "overrides.data", tx.data);
return tx;
}
async staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string> {
const runner = getRunner(this._contract.runner, "call");
assert(canCall(runner), "contract runner does not support calling",
"UNSUPPORTED_OPERATION", { operation: "call" });
const tx = await this.populateTransaction(overrides);
try {
return await runner.call(tx);
} catch (error: any) {
if (isCallException(error) && error.data) {
throw this._contract.interface.makeError(error.data, tx);
}
throw error;
}
}
async send(overrides) {
async send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse> {
const runner = this._contract.runner;
(0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
assert(canSend(runner), "contract runner does not support sending transactions",
"UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
const tx = await runner.sendTransaction(await this.populateTransaction(overrides));
const provider = getProvider(this._contract.runner);
// @TODO: the provider can be null; make a custom dummy provider that will throw a
// meaningful error
return new wrappers_js_1.ContractTransactionResponse(this._contract.interface, provider, tx);
return new ContractTransactionResponse(this._contract.interface, <Provider>provider, tx);
}
async estimateGas(overrides) {
async estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint> {
const runner = getRunner(this._contract.runner, "estimateGas");
(0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
assert(canEstimate(runner), "contract runner does not support gas estimation",
"UNSUPPORTED_OPERATION", { operation: "estimateGas" });
return await runner.estimateGas(await this.populateTransaction(overrides));
}
}
class WrappedMethod extends _WrappedMethodBase() {
name = ""; // Investigate!
_contract;
_key;
constructor(contract, key) {
super();
(0, index_js_3.defineProperties)(this, {
name: contract.interface.getFunctionName(key),
_contract: contract, _key: key
});
const proxy = new Proxy(this, {
// Perform the default operation for this fragment type
apply: async (target, thisArg, args) => {
const fragment = target.getFragment(...args);
if (fragment.constant) {
return await target.staticCall(...args);
}
return await target.send(...args);
},
});
return proxy;
}
// Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
get fragment() {
const fragment = this._contract.interface.getFunction(this._key);
*/
function buildWrappedMethod(contract, key) {
const getFragment = function (...args) {
const fragment = contract.interface.getFunction(key, args);
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
operation: "fragment"
});
return fragment;
}
getFragment(...args) {
const fragment = this._contract.interface.getFunction(this._key, args);
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
operation: "fragment"
});
return fragment;
}
async populateTransaction(...args) {
const fragment = this.getFragment(...args);
};
const populateTransaction = async function (...args) {
const fragment = getFragment(...args);
// If an overrides was passed in, copy it and normalize the values
let overrides = {};
if (fragment.inputs.length + 1 === args.length) {
@@ -212,88 +253,109 @@ class WrappedMethod extends _WrappedMethodBase() {
if (fragment.inputs.length !== args.length) {
throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");
}
const resolvedArgs = await resolveArgs(this._contract.runner, fragment.inputs, args);
const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);
return Object.assign({}, overrides, await (0, index_js_3.resolveProperties)({
to: this._contract.getAddress(),
data: this._contract.interface.encodeFunctionData(fragment, resolvedArgs)
to: contract.getAddress(),
data: contract.interface.encodeFunctionData(fragment, resolvedArgs)
}));
}
async staticCall(...args) {
const result = await this.staticCallResult(...args);
};
const staticCall = async function (...args) {
const result = await staticCallResult(...args);
if (result.length === 1) {
return result[0];
}
return result;
}
async send(...args) {
const runner = this._contract.runner;
};
const send = async function (...args) {
const runner = contract.runner;
(0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
const tx = await runner.sendTransaction(await this.populateTransaction(...args));
const provider = getProvider(this._contract.runner);
const tx = await runner.sendTransaction(await populateTransaction(...args));
const provider = getProvider(contract.runner);
// @TODO: the provider can be null; make a custom dummy provider that will throw a
// meaningful error
return new wrappers_js_1.ContractTransactionResponse(this._contract.interface, provider, tx);
}
async estimateGas(...args) {
const runner = getRunner(this._contract.runner, "estimateGas");
return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx);
};
const estimateGas = async function (...args) {
const runner = getRunner(contract.runner, "estimateGas");
(0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
return await runner.estimateGas(await this.populateTransaction(...args));
}
async staticCallResult(...args) {
const runner = getRunner(this._contract.runner, "call");
return await runner.estimateGas(await populateTransaction(...args));
};
const staticCallResult = async function (...args) {
const runner = getRunner(contract.runner, "call");
(0, index_js_3.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
const tx = await this.populateTransaction(...args);
const tx = await populateTransaction(...args);
let result = "0x";
try {
result = await runner.call(tx);
}
catch (error) {
if ((0, index_js_3.isCallException)(error) && error.data) {
throw this._contract.interface.makeError(error.data, tx);
throw contract.interface.makeError(error.data, tx);
}
throw error;
}
const fragment = this.getFragment(...args);
return this._contract.interface.decodeFunctionResult(fragment, result);
}
const fragment = getFragment(...args);
return contract.interface.decodeFunctionResult(fragment, result);
};
const method = async (...args) => {
const fragment = getFragment(...args);
if (fragment.constant) {
return await staticCall(...args);
}
return await send(...args);
};
(0, index_js_3.defineProperties)(method, {
name: contract.interface.getFunctionName(key),
_contract: contract, _key: key,
getFragment,
estimateGas,
populateTransaction,
send, staticCall, staticCallResult,
});
// Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
Object.defineProperty(method, "fragment", {
configurable: false,
enumerable: true,
get: () => {
const fragment = contract.interface.getFunction(key);
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
operation: "fragment"
});
return fragment;
}
});
return method;
}
function _WrappedEventBase() {
return Function;
}
class WrappedEvent extends _WrappedEventBase() {
name = ""; // @TODO: investigate
_contract;
_key;
constructor(contract, key) {
super();
(0, index_js_3.defineProperties)(this, {
name: contract.interface.getEventName(key),
_contract: contract, _key: key
});
return new Proxy(this, {
// Perform the default operation for this fragment type
apply: (target, thisArg, args) => {
return new PreparedTopicFilter(contract, target.getFragment(...args), args);
},
});
}
// Only works on non-ambiguous keys
get fragment() {
const fragment = this._contract.interface.getEvent(this._key);
function buildWrappedEvent(contract, key) {
const getFragment = function (...args) {
const fragment = contract.interface.getEvent(key, args);
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
operation: "fragment"
});
return fragment;
}
getFragment(...args) {
const fragment = this._contract.interface.getEvent(this._key, args);
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
operation: "fragment"
});
return fragment;
}
};
const method = function (...args) {
return new PreparedTopicFilter(contract, getFragment(...args), args);
};
(0, index_js_3.defineProperties)(method, {
name: contract.interface.getEventName(key),
_contract: contract, _key: key,
getFragment
});
// Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
Object.defineProperty(method, "fragment", {
configurable: false,
enumerable: true,
get: () => {
const fragment = contract.interface.getEvent(key);
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
operation: "fragment"
});
return fragment;
}
});
return method;
}
;
// The combination of TypeScrype, Private Fields and Proxies makes
// the world go boom; so we hide variables with some trickery keeping
// a symbol attached to each BaseContract which its sub-class (even
@@ -457,7 +519,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));
}
@@ -553,7 +615,7 @@ class BaseContract {
});
(0, index_js_3.defineProperties)(this, { filters });
(0, index_js_3.defineProperties)(this, {
fallback: ((iface.receive || iface.fallback) ? (new WrappedFallback(this)) : null)
fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null)
});
// Return a Proxy that will respond to functions
return new Proxy(this, {
@@ -621,13 +683,14 @@ class BaseContract {
if (typeof (key) !== "string") {
key = key.format();
}
return (new WrappedMethod(this, key));
const func = buildWrappedMethod(this, key);
return func;
}
getEvent(key) {
if (typeof (key) !== "string") {
key = key.format();
}
return (new WrappedEvent(this, key));
return buildWrappedEvent(this, key);
}
async queryTransaction(hash) {
// Is this useful?

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,EA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SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,CAAC,MAA6B;QACjC,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,CAAC,YAAY,CAA2D,MAAW,EAAE,MAAuB;QAC9G,IAAA,yBAAc,EAAC,MAAM,IAAI,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAExE,IAAI,OAAM,CAAC,MAAM,CAAC,KAAK,QAAQ,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

@@ -1,9 +1,9 @@
/**
* About contracts...
*
* @_section: api/contract:Contracts [contracts]
* @_section: api/contract:Contracts [about-contracts]
*/
export { BaseContract, Contract } from "./contract.js";
export { ContractFactory } from "./factory.js";
export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./wrappers.js";
export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides } from "./types.js";
export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, WrappedFallback } from "./types.js";

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

@@ -46,3 +46,10 @@ export interface ContractEvent<A extends Array<any> = Array<any>> {
fragment: EventFragment;
getFragment(...args: ContractEventArgs<A>): EventFragment;
}
export interface WrappedFallback {
(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction>;
staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string>;
send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint>;
}

View File

@@ -19,16 +19,16 @@ class EventLog extends provider_js_1.Log {
}
exports.EventLog = EventLog;
class ContractTransactionReceipt extends provider_js_1.TransactionReceipt {
#interface;
#iface;
constructor(iface, provider, tx) {
super(tx, provider);
this.#interface = iface;
this.#iface = iface;
}
get logs() {
return super.logs.map((log) => {
const fragment = log.topics.length ? this.#interface.getEvent(log.topics[0]) : null;
const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;
if (fragment) {
return new EventLog(log, this.#interface, fragment);
return new EventLog(log, this.#iface, fragment);
}
else {
return log;
@@ -38,17 +38,17 @@ class ContractTransactionReceipt extends provider_js_1.TransactionReceipt {
}
exports.ContractTransactionReceipt = ContractTransactionReceipt;
class ContractTransactionResponse extends provider_js_1.TransactionResponse {
#interface;
#iface;
constructor(iface, provider, tx) {
super(tx, provider);
this.#interface = iface;
this.#iface = iface;
}
async wait(confirms) {
const receipt = await super.wait();
if (receipt == null) {
return null;
}
return new ContractTransactionReceipt(this.#interface, this.provider, receipt);
return new ContractTransactionReceipt(this.#iface, this.provider, receipt);
}
}
exports.ContractTransactionResponse = ContractTransactionResponse;

View File

@@ -1 +1 @@
{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yBAAyB;AACzB,0DAEkC;AAClC,gDAAmE;AAYnE,MAAa,QAAS,SAAQ,iBAAG;IACpB,SAAS,CAAa;IACtB,QAAQ,CAAiB;IACzB,IAAI,CAAU;IAEvB,YAAY,GAAQ,EAAE,KAAgB,EAAE,QAAuB;QAC3D,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAClE,IAAA,2BAAgB,EAAW,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,SAAS,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,IAAI,cAAc,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAClE;AAbD,4BAaC;AAED,MAAa,0BAA2B,SAAQ,gCAAkB;IACrD,UAAU,CAAY;IAE/B,YAAY,KAAgB,EAAE,QAAkB,EAAE,EAAsB;QACpE,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CA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pF,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzF,IAAA,2BAAgB,EAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClC,CAAC;CACJ;AAnBD,oDAmBC"}

View File

@@ -2,7 +2,7 @@
* A fundamental building block of Ethereum is the underlying
* cryptographic primitives.
*
* @_section: api/crypto:Cryptographic Functions [crypto]
* @_section: api/crypto:Cryptographic Functions [about-crypto]
*/
import { computeHmac } from "./hmac.js";
import { keccak256 } from "./keccak.js";

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

@@ -4,6 +4,8 @@ import type { BytesLike } from "../utils/index.js";
* UI or provide programatic access to the progress.
*
* The %%percent%% is a value between ``0`` and ``1``.
*
* @_docloc: api/crypto:Passwords
*/
export type ProgressCallback = (percent: number) => void;
/**

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;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C;KAAE;IACzD,aAAa,GAAG,IAAI,CAAC;AACzB,CAAC,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

@@ -1,4 +1,9 @@
import type { BigNumberish, BytesLike } from "../utils/index.js";
/**
* A SignatureLike
*
* @_docloc: api/crypto:Signing
*/
export type SignatureLike = Signature | string | {
r: string;
s: string;
@@ -20,6 +25,9 @@ export type SignatureLike = Signature | string | {
};
/**
* A Signature @TODO
*
*
* @_docloc: api/crypto:Signing
*/
export declare class Signature {
#private;

View File

@@ -16,6 +16,9 @@ function toUint256(value) {
}
/**
* A Signature @TODO
*
*
* @_docloc: api/crypto:Signing
*/
class Signature {
#r;
@@ -38,7 +41,7 @@ class Signature {
*/
get s() { return this.#s; }
set s(_value) {
(0, index_js_2.assertArgument)((0, index_js_2.dataLength)(_value) === 32, "invalid r", "value", _value);
(0, index_js_2.assertArgument)((0, index_js_2.dataLength)(_value) === 32, "invalid s", "value", _value);
const value = (0, index_js_2.hexlify)(_value);
(0, index_js_2.assertArgument)(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value);
this.#s = value;
@@ -243,7 +246,7 @@ class Signature {
const v = Signature.getNormalizedV(bytes[64]);
return new Signature(_guard, r, (0, index_js_2.hexlify)(s), v);
}
assertError(false, "invlaid raw signature length");
assertError(false, "invalid raw signature length");
}
if (sig instanceof Signature) {
return sig.clone();

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,8 @@
/**
* Add details about signing here.
*
* @_subsection: api/crypto:Signing [about-signing]
*/
import { Signature } from "./signature.js";
import type { BytesLike } from "../utils/index.js";
import type { SignatureLike } from "./index.js";

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);
@@ -173,10 +178,8 @@ class SigningKey {
const sig = signature_js_1.Signature.from(signature);
const der = secp256k1.Signature.fromCompact((0, index_js_1.getBytesCopy)((0, index_js_1.concat)([sig.r, sig.s]))).toDERRawBytes();
const pubKey = secp256k1.recoverPublicKey((0, index_js_1.getBytesCopy)(digest), der, sig.yParity);
if (pubKey != null) {
return (0, index_js_1.hexlify)(pubKey);
}
(0, index_js_1.assertArgument)(false, "invalid signautre for digest", "signature", signature);
(0, index_js_1.assertArgument)(pubKey != null, "invalid signautre for digest", "signature", signature);
return (0, index_js_1.hexlify)(pubKey);
}
/**
* Returns the point resulting from adding the ellipic curve points

View File

@@ -1 +1 @@
{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"m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ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, checkResultErrors, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js";
export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js";
export { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddressable, isAddress, resolveAddress } from "./address/index.js";
export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from "./constants/index.js";
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./contract/index.js";
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js";
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network } from "./providers/index.js";
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js";
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp } from "./utils/index.js";
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js";
export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js";
export { Wordlist, LangEn, WordlistOwl, WordlistOwlA } from "./wordlists/index.js";
export type { JsonFragment, JsonFragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc } from "./abi/index.js";
export type { Addressable } from "./address/index.js";
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides } from "./contract/index.js";
export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from "./wordlists/index.js";
export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc } from "./abi/index.js";
export type { Addressable, AddressLike, NameResolver } from "./address/index.js";
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback } from "./contract/index.js";
export type { ProgressCallback, SignatureLike } from "./crypto/index.js";
export type { TypedDataDomain, TypedDataField } from "./hash/index.js";
export type { Provider, Signer } from "./providers/index.js";
export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js";
export type { AccessList, AccessListish, AccessListEntry, TransactionLike } from "./transaction/index.js";
export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedEthersError, } from "./utils/index.js";
export type { KeystoreAccount, EncryptOptions } from "./wallet/index.js";
export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedEthersError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener } from "./utils/index.js";
export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions } from "./wallet/index.js";

View File

@@ -2,10 +2,10 @@
/////////////////////////////
//
Object.defineProperty(exports, "__esModule", { value: true });
exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.EventLog = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.checkResultErrors = exports.ParamType = exports.FunctionFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.version = void 0;
exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = void 0;
exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = void 0;
exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = void 0;
exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.EventLog = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.ErrorDescription = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.FallbackFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.version = void 0;
exports.FeeDataNetworkPlugin = exports.EtherscanPlugin = exports.EnsPlugin = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = void 0;
exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.NetworkPlugin = exports.GasCostPlugin = void 0;
exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = void 0;
var _version_js_1 = require("./_version.js");
Object.defineProperty(exports, "version", { enumerable: true, get: function () { return _version_js_1.version; } });
var index_js_1 = require("./abi/index.js");
@@ -16,9 +16,13 @@ Object.defineProperty(exports, "ConstructorFragment", { enumerable: true, get: f
Object.defineProperty(exports, "ErrorFragment", { enumerable: true, get: function () { return index_js_1.ErrorFragment; } });
Object.defineProperty(exports, "EventFragment", { enumerable: true, get: function () { return index_js_1.EventFragment; } });
Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return index_js_1.Fragment; } });
Object.defineProperty(exports, "FallbackFragment", { enumerable: true, get: function () { return index_js_1.FallbackFragment; } });
Object.defineProperty(exports, "FunctionFragment", { enumerable: true, get: function () { return index_js_1.FunctionFragment; } });
Object.defineProperty(exports, "NamedFragment", { enumerable: true, get: function () { return index_js_1.NamedFragment; } });
Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return index_js_1.ParamType; } });
Object.defineProperty(exports, "StructFragment", { enumerable: true, get: function () { return index_js_1.StructFragment; } });
Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return index_js_1.checkResultErrors; } });
Object.defineProperty(exports, "ErrorDescription", { enumerable: true, get: function () { return index_js_1.ErrorDescription; } });
Object.defineProperty(exports, "Indexed", { enumerable: true, get: function () { return index_js_1.Indexed; } });
Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return index_js_1.Interface; } });
Object.defineProperty(exports, "LogDescription", { enumerable: true, get: function () { return index_js_1.LogDescription; } });
@@ -50,6 +54,7 @@ Object.defineProperty(exports, "ContractFactory", { enumerable: true, get: funct
Object.defineProperty(exports, "ContractEventPayload", { enumerable: true, get: function () { return index_js_4.ContractEventPayload; } });
Object.defineProperty(exports, "ContractTransactionReceipt", { enumerable: true, get: function () { return index_js_4.ContractTransactionReceipt; } });
Object.defineProperty(exports, "ContractTransactionResponse", { enumerable: true, get: function () { return index_js_4.ContractTransactionResponse; } });
Object.defineProperty(exports, "ContractUnknownEventPayload", { enumerable: true, get: function () { return index_js_4.ContractUnknownEventPayload; } });
Object.defineProperty(exports, "EventLog", { enumerable: true, get: function () { return index_js_4.EventLog; } });
var index_js_5 = require("./crypto/index.js");
Object.defineProperty(exports, "computeHmac", { enumerable: true, get: function () { return index_js_5.computeHmac; } });
@@ -76,6 +81,7 @@ Object.defineProperty(exports, "solidityPacked", { enumerable: true, get: functi
Object.defineProperty(exports, "solidityPackedKeccak256", { enumerable: true, get: function () { return index_js_6.solidityPackedKeccak256; } });
Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return index_js_6.solidityPackedSha256; } });
Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return index_js_6.TypedDataEncoder; } });
Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return index_js_6.verifyTypedData; } });
var index_js_7 = require("./providers/index.js");
Object.defineProperty(exports, "getDefaultProvider", { enumerable: true, get: function () { return index_js_7.getDefaultProvider; } });
Object.defineProperty(exports, "Block", { enumerable: true, get: function () { return index_js_7.Block; } });
@@ -97,6 +103,7 @@ Object.defineProperty(exports, "AnkrProvider", { enumerable: true, get: function
Object.defineProperty(exports, "CloudflareProvider", { enumerable: true, get: function () { return index_js_7.CloudflareProvider; } });
Object.defineProperty(exports, "EtherscanProvider", { enumerable: true, get: function () { return index_js_7.EtherscanProvider; } });
Object.defineProperty(exports, "InfuraProvider", { enumerable: true, get: function () { return index_js_7.InfuraProvider; } });
Object.defineProperty(exports, "InfuraWebSocketProvider", { enumerable: true, get: function () { return index_js_7.InfuraWebSocketProvider; } });
Object.defineProperty(exports, "PocketProvider", { enumerable: true, get: function () { return index_js_7.PocketProvider; } });
Object.defineProperty(exports, "QuickNodeProvider", { enumerable: true, get: function () { return index_js_7.QuickNodeProvider; } });
Object.defineProperty(exports, "IpcSocketProvider", { enumerable: true, get: function () { return index_js_7.IpcSocketProvider; } });
@@ -104,6 +111,18 @@ Object.defineProperty(exports, "SocketProvider", { enumerable: true, get: functi
Object.defineProperty(exports, "WebSocketProvider", { enumerable: true, get: function () { return index_js_7.WebSocketProvider; } });
Object.defineProperty(exports, "EnsResolver", { enumerable: true, get: function () { return index_js_7.EnsResolver; } });
Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return index_js_7.Network; } });
Object.defineProperty(exports, "EnsPlugin", { enumerable: true, get: function () { return index_js_7.EnsPlugin; } });
Object.defineProperty(exports, "EtherscanPlugin", { enumerable: true, get: function () { return index_js_7.EtherscanPlugin; } });
Object.defineProperty(exports, "FeeDataNetworkPlugin", { enumerable: true, get: function () { return index_js_7.FeeDataNetworkPlugin; } });
Object.defineProperty(exports, "GasCostPlugin", { enumerable: true, get: function () { return index_js_7.GasCostPlugin; } });
Object.defineProperty(exports, "NetworkPlugin", { enumerable: true, get: function () { return index_js_7.NetworkPlugin; } });
Object.defineProperty(exports, "SocketBlockSubscriber", { enumerable: true, get: function () { return index_js_7.SocketBlockSubscriber; } });
Object.defineProperty(exports, "SocketEventSubscriber", { enumerable: true, get: function () { return index_js_7.SocketEventSubscriber; } });
Object.defineProperty(exports, "SocketPendingSubscriber", { enumerable: true, get: function () { return index_js_7.SocketPendingSubscriber; } });
Object.defineProperty(exports, "SocketSubscriber", { enumerable: true, get: function () { return index_js_7.SocketSubscriber; } });
Object.defineProperty(exports, "UnmanagedSubscriber", { enumerable: true, get: function () { return index_js_7.UnmanagedSubscriber; } });
Object.defineProperty(exports, "copyRequest", { enumerable: true, get: function () { return index_js_7.copyRequest; } });
Object.defineProperty(exports, "showThrottleMessage", { enumerable: true, get: function () { return index_js_7.showThrottleMessage; } });
var index_js_8 = require("./transaction/index.js");
Object.defineProperty(exports, "accessListify", { enumerable: true, get: function () { return index_js_8.accessListify; } });
Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return index_js_8.computeAddress; } });
@@ -126,6 +145,7 @@ Object.defineProperty(exports, "stripZerosLeft", { enumerable: true, get: functi
Object.defineProperty(exports, "zeroPadBytes", { enumerable: true, get: function () { return index_js_9.zeroPadBytes; } });
Object.defineProperty(exports, "zeroPadValue", { enumerable: true, get: function () { return index_js_9.zeroPadValue; } });
Object.defineProperty(exports, "defineProperties", { enumerable: true, get: function () { return index_js_9.defineProperties; } });
Object.defineProperty(exports, "resolveProperties", { enumerable: true, get: function () { return index_js_9.resolveProperties; } });
Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return index_js_9.assert; } });
Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return index_js_9.assertArgument; } });
Object.defineProperty(exports, "assertArgumentCount", { enumerable: true, get: function () { return index_js_9.assertArgumentCount; } });
@@ -134,6 +154,7 @@ Object.defineProperty(exports, "assertPrivate", { enumerable: true, get: functio
Object.defineProperty(exports, "makeError", { enumerable: true, get: function () { return index_js_9.makeError; } });
Object.defineProperty(exports, "isCallException", { enumerable: true, get: function () { return index_js_9.isCallException; } });
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return index_js_9.isError; } });
Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return index_js_9.EventPayload; } });
Object.defineProperty(exports, "FetchRequest", { enumerable: true, get: function () { return index_js_9.FetchRequest; } });
Object.defineProperty(exports, "FetchResponse", { enumerable: true, get: function () { return index_js_9.FetchResponse; } });
Object.defineProperty(exports, "FetchCancelSignal", { enumerable: true, get: function () { return index_js_9.FetchCancelSignal; } });
@@ -159,6 +180,7 @@ Object.defineProperty(exports, "toUtf8String", { enumerable: true, get: function
Object.defineProperty(exports, "Utf8ErrorFuncs", { enumerable: true, get: function () { return index_js_9.Utf8ErrorFuncs; } });
Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return index_js_9.decodeRlp; } });
Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return index_js_9.encodeRlp; } });
Object.defineProperty(exports, "uuidV4", { enumerable: true, get: function () { return index_js_9.uuidV4; } });
var index_js_10 = require("./wallet/index.js");
Object.defineProperty(exports, "Mnemonic", { enumerable: true, get: function () { return index_js_10.Mnemonic; } });
Object.defineProperty(exports, "BaseWallet", { enumerable: true, get: function () { return index_js_10.BaseWallet; } });
@@ -179,4 +201,5 @@ Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function ()
Object.defineProperty(exports, "LangEn", { enumerable: true, get: function () { return index_js_11.LangEn; } });
Object.defineProperty(exports, "WordlistOwl", { enumerable: true, get: function () { return index_js_11.WordlistOwl; } });
Object.defineProperty(exports, "WordlistOwlA", { enumerable: true, get: function () { return index_js_11.WordlistOwlA; } });
Object.defineProperty(exports, "wordlists", { enumerable: true, get: function () { return index_js_11.wordlists; } });
//# sourceMappingURL=ethers.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":";AAEA,6BAA6B;AAC7B,EAAE;;;;;;AAEF,6CAAwC;AAA/B,sGAAA,OAAO,OAAA;AAEhB,2CAQwB;AAPpB,+GAAA,mBAAmB,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAExC,oGAAA,QAAQ,OAAA;AACR,+GAAA,mBAAmB,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE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AA,MAAM,OAAA;AAGV,+CAY2B;AAXvB,qGAAA,QAAQ,OAAA;AACR,uGAAA,UAAU,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAC1C,mGAAA,MAAM,OAAA;AAEN,wGAAA,WAAW,OAAA;AAEX,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AAAE,2GAAA,cAAc,OAAA;AAE/B,iHAAA,oBAAoB,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAClE,gHAAA,mBAAmB,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAGhD,kDAE8B;AAD1B,qGAAA,QAAQ,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,wGAAA,WAAW,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,sGAAA,SAAS,OAAA"}

View File

@@ -1,11 +1,11 @@
/**
* About hashing here...
*
* @_section: api/hashing:Hashing Utilities [hashing]
* @_section: api/hashing:Hashing Utilities [about-hashing]
*/
export { id } from "./id.js";
export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js";
export { hashMessage, verifyMessage } from "./message.js";
export { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from "./solidity.js";
export { TypedDataEncoder } from "./typed-data.js";
export { TypedDataEncoder, verifyTypedData } from "./typed-data.js";
export type { TypedDataDomain, TypedDataField } from "./typed-data.js";

View File

@@ -2,10 +2,10 @@
/**
* About hashing here...
*
* @_section: api/hashing:Hashing Utilities [hashing]
* @_section: api/hashing:Hashing Utilities [about-hashing]
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = void 0;
exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = void 0;
var id_js_1 = require("./id.js");
Object.defineProperty(exports, "id", { enumerable: true, get: function () { return id_js_1.id; } });
var namehash_js_1 = require("./namehash.js");
@@ -22,4 +22,5 @@ Object.defineProperty(exports, "solidityPackedKeccak256", { enumerable: true, ge
Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return solidity_js_1.solidityPackedSha256; } });
var typed_data_js_1 = require("./typed-data.js");
Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return typed_data_js_1.TypedDataEncoder; } });
Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return typed_data_js_1.verifyTypedData; } });
//# sourceMappingURL=index.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAA4B;AAAnB,2FAAA,EAAE,OAAA;AACX,6CAA+E;AAAtE,2GAAA,YAAY,OAAA;AAAE,0GAAA,WAAW,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAAE,wGAAA,SAAS,OAAA;AACvD,2CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACnC,6CAEuB;AADnB,6GAAA,cAAc,OAAA;AAAE,sHAAA,uBAAuB,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAEjE,iDAAmD;AAA1C,iHAAA,gBAAgB,OAAA"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAA4B;AAAnB,2FAAA,EAAE,OAAA;AACX,6CAA+E;AAAtE,2GAAA,YAAY,OAAA;AAAE,0GAAA,WAAW,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAAE,wGAAA,SAAS,OAAA;AACvD,2CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACnC,6CAEuB;AADnB,6GAAA,cAAc,OAAA;AAAE,sHAAA,uBAAuB,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAEjE,iDAAoE;AAA3D,iHAAA,gBAAgB,OAAA;AAAE,gHAAA,eAAe,OAAA"}

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,KAAK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I,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

@@ -1,10 +1,11 @@
import type { SignatureLike } from "../crypto/index.js";
import type { BigNumberish, BytesLike } from "../utils/index.js";
export interface TypedDataDomain {
name?: string;
version?: string;
chainId?: BigNumberish;
verifyingContract?: string;
salt?: BytesLike;
name?: null | string;
version?: null | string;
chainId?: null | BigNumberish;
verifyingContract?: null | string;
salt?: null | BytesLike;
}
export interface TypedDataField {
name: string;
@@ -35,3 +36,7 @@ export declare class TypedDataEncoder {
}>;
static getPayload(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): any;
}
/**
* Compute the address used to sign the typed data for the %%signature%%.
*/
export declare function verifyTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>, signature: SignatureLike): string;

View File

@@ -1,10 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypedDataEncoder = void 0;
exports.verifyTypedData = exports.TypedDataEncoder = void 0;
//import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer";
const index_js_1 = require("../address/index.js");
const index_js_2 = require("../crypto/index.js");
const index_js_3 = require("../utils/index.js");
const index_js_3 = require("../transaction/index.js");
const index_js_4 = require("../utils/index.js");
const id_js_1 = require("./id.js");
const padding = new Uint8Array(32);
padding.fill(0);
@@ -15,15 +16,15 @@ const BN_MAX_UINT256 = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffff
;
;
function hexPadRight(value) {
const bytes = (0, index_js_3.getBytes)(value);
const bytes = (0, index_js_4.getBytes)(value);
const padOffset = bytes.length % 32;
if (padOffset) {
return (0, index_js_3.concat)([bytes, padding.slice(padOffset)]);
return (0, index_js_4.concat)([bytes, padding.slice(padOffset)]);
}
return (0, index_js_3.hexlify)(bytes);
return (0, index_js_4.hexlify)(bytes);
}
const hexTrue = (0, index_js_3.toBeHex)(BN_1, 32);
const hexFalse = (0, index_js_3.toBeHex)(BN_0, 32);
const hexTrue = (0, index_js_4.toBeHex)(BN_1, 32);
const hexFalse = (0, index_js_4.toBeHex)(BN_0, 32);
const domainFieldTypes = {
name: "string",
version: "string",
@@ -36,7 +37,7 @@ const domainFieldNames = [
];
function checkString(key) {
return function (value) {
(0, index_js_3.assertArgument)(typeof (value) === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);
(0, index_js_4.assertArgument)(typeof (value) === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);
return value;
};
}
@@ -44,19 +45,19 @@ const domainChecks = {
name: checkString("name"),
version: checkString("version"),
chainId: function (value) {
return (0, index_js_3.getBigInt)(value, "domain.chainId");
return (0, index_js_4.getBigInt)(value, "domain.chainId");
},
verifyingContract: function (value) {
try {
return (0, index_js_1.getAddress)(value).toLowerCase();
}
catch (error) { }
(0, index_js_3.assertArgument)(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
(0, index_js_4.assertArgument)(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
},
salt: function (value) {
const bytes = (0, index_js_3.getBytes)(value, "domain.salt");
(0, index_js_3.assertArgument)(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value);
return (0, index_js_3.hexlify)(bytes);
const bytes = (0, index_js_4.getBytes)(value, "domain.salt");
(0, index_js_4.assertArgument)(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value);
return (0, index_js_4.hexlify)(bytes);
}
};
function getBaseEncoder(type) {
@@ -66,13 +67,13 @@ function getBaseEncoder(type) {
if (match) {
const signed = (match[1] === "");
const width = parseInt(match[2] || "256");
(0, index_js_3.assertArgument)(width % 8 === 0 && width !== 0 && width <= 256 && (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type);
const boundsUpper = (0, index_js_3.mask)(BN_MAX_UINT256, signed ? (width - 1) : width);
(0, index_js_4.assertArgument)(width % 8 === 0 && width !== 0 && width <= 256 && (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type);
const boundsUpper = (0, index_js_4.mask)(BN_MAX_UINT256, signed ? (width - 1) : width);
const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0;
return function (_value) {
const value = (0, index_js_3.getBigInt)(_value, "value");
(0, index_js_3.assertArgument)(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value);
return (0, index_js_3.toBeHex)((0, index_js_3.toTwos)(value, 256), 32);
const value = (0, index_js_4.getBigInt)(_value, "value");
(0, index_js_4.assertArgument)(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value);
return (0, index_js_4.toBeHex)((0, index_js_4.toTwos)(value, 256), 32);
};
}
}
@@ -81,17 +82,17 @@ function getBaseEncoder(type) {
const match = type.match(/^bytes(\d+)$/);
if (match) {
const width = parseInt(match[1]);
(0, index_js_3.assertArgument)(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type);
(0, index_js_4.assertArgument)(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type);
return function (value) {
const bytes = (0, index_js_3.getBytes)(value);
(0, index_js_3.assertArgument)(bytes.length === width, `invalid length for ${type}`, "value", value);
const bytes = (0, index_js_4.getBytes)(value);
(0, index_js_4.assertArgument)(bytes.length === width, `invalid length for ${type}`, "value", value);
return hexPadRight(value);
};
}
}
switch (type) {
case "address": return function (value) {
return (0, index_js_3.zeroPadValue)((0, index_js_1.getAddress)(value), 32);
return (0, index_js_4.zeroPadValue)((0, index_js_1.getAddress)(value), 32);
};
case "bool": return function (value) {
return ((!value) ? hexFalse : hexTrue);
@@ -135,17 +136,17 @@ class TypedDataEncoder {
const uniqueNames = new Set();
for (const field of types[name]) {
// Check each field has a unique name
(0, index_js_3.assertArgument)(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types);
(0, index_js_4.assertArgument)(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types);
uniqueNames.add(field.name);
// Get the base type (drop any array specifiers)
const baseType = (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null;
(0, index_js_3.assertArgument)(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types);
(0, index_js_4.assertArgument)(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types);
// Is this a base encoding type?
const encoder = getBaseEncoder(baseType);
if (encoder) {
continue;
}
(0, index_js_3.assertArgument)(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types);
(0, index_js_4.assertArgument)(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types);
// Add linkage
parents.get(baseType).push(name);
links.get(name).add(baseType);
@@ -153,12 +154,12 @@ class TypedDataEncoder {
}
// Deduce the primary type
const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0));
(0, index_js_3.assertArgument)(primaryTypes.length !== 0, "missing primary type", "types", types);
(0, index_js_3.assertArgument)(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", types);
(0, index_js_3.defineProperties)(this, { primaryType: primaryTypes[0] });
(0, index_js_4.assertArgument)(primaryTypes.length !== 0, "missing primary type", "types", types);
(0, index_js_4.assertArgument)(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", types);
(0, index_js_4.defineProperties)(this, { primaryType: primaryTypes[0] });
// Check for circular type references
function checkCircular(type, found) {
(0, index_js_3.assertArgument)(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types);
(0, index_js_4.assertArgument)(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types);
found.add(type);
for (const child of links.get(type)) {
if (!parents.has(child)) {
@@ -203,12 +204,12 @@ class TypedDataEncoder {
const subtype = match[1];
const subEncoder = this.getEncoder(subtype);
return (value) => {
(0, index_js_3.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
(0, index_js_4.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
let result = value.map(subEncoder);
if (this.#fullTypes.has(subtype)) {
result = result.map(index_js_2.keccak256);
}
return (0, index_js_2.keccak256)((0, index_js_3.concat)(result));
return (0, index_js_2.keccak256)((0, index_js_4.concat)(result));
};
}
// Struct
@@ -224,14 +225,14 @@ class TypedDataEncoder {
return result;
});
values.unshift(encodedType);
return (0, index_js_3.concat)(values);
return (0, index_js_4.concat)(values);
};
}
(0, index_js_3.assertArgument)(false, `unknown type: ${type}`, "type", type);
(0, index_js_4.assertArgument)(false, `unknown type: ${type}`, "type", type);
}
encodeType(name) {
const result = this.#fullTypes.get(name);
(0, index_js_3.assertArgument)(result, `unknown type: ${JSON.stringify(name)}`, "name", name);
(0, index_js_4.assertArgument)(result, `unknown type: ${JSON.stringify(name)}`, "name", name);
return result;
}
encodeData(type, value) {
@@ -257,7 +258,7 @@ class TypedDataEncoder {
// Array
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
if (match) {
(0, index_js_3.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
(0, index_js_4.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
return value.map((v) => this._visit(match[1], v, callback));
}
// Struct
@@ -268,7 +269,7 @@ class TypedDataEncoder {
return accum;
}, {});
}
(0, index_js_3.assertArgument)(false, `unknown type: ${type}`, "type", type);
(0, index_js_4.assertArgument)(false, `unknown type: ${type}`, "type", type);
}
visit(value, callback) {
return this._visit(this.primaryType, value, callback);
@@ -285,8 +286,11 @@ class TypedDataEncoder {
static hashDomain(domain) {
const domainFields = [];
for (const name in domain) {
if (domain[name] == null) {
continue;
}
const type = domainFieldTypes[name];
(0, index_js_3.assertArgument)(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
(0, index_js_4.assertArgument)(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
domainFields.push({ name, type });
}
domainFields.sort((a, b) => {
@@ -295,7 +299,7 @@ class TypedDataEncoder {
return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain);
}
static encode(domain, types, value) {
return (0, index_js_3.concat)([
return (0, index_js_4.concat)([
"0x1901",
TypedDataEncoder.hashDomain(domain),
TypedDataEncoder.from(types).hash(value)
@@ -308,17 +312,23 @@ class TypedDataEncoder {
static async resolveNames(domain, types, value, resolveName) {
// Make a copy to isolate it from the object passed in
domain = Object.assign({}, domain);
// Allow passing null to ignore value
for (const key in domain) {
if (domain[key] == null) {
delete domain[key];
}
}
// Look up all ENS names
const ensCache = {};
// Do we need to look up the domain's verifyingContract?
if (domain.verifyingContract && !(0, index_js_3.isHexString)(domain.verifyingContract, 20)) {
if (domain.verifyingContract && !(0, index_js_4.isHexString)(domain.verifyingContract, 20)) {
ensCache[domain.verifyingContract] = "0x";
}
// We are going to use the encoder to visit all the base values
const encoder = TypedDataEncoder.from(types);
// Get a list of all the addresses
encoder.visit(value, (type, value) => {
if (type === "address" && !(0, index_js_3.isHexString)(value, 20)) {
if (type === "address" && !(0, index_js_4.isHexString)(value, 20)) {
ensCache[value] = "0x";
}
return value;
@@ -356,7 +366,7 @@ class TypedDataEncoder {
});
const encoder = TypedDataEncoder.from(types);
const typesWithDomain = Object.assign({}, types);
(0, index_js_3.assertArgument)(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types);
(0, index_js_4.assertArgument)(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types);
typesWithDomain.EIP712Domain = domainTypes;
// Validate the data structures and types
encoder.encode(value);
@@ -367,11 +377,11 @@ class TypedDataEncoder {
message: encoder.visit(value, (type, value) => {
// bytes
if (type.match(/^bytes(\d*)/)) {
return (0, index_js_3.hexlify)((0, index_js_3.getBytes)(value));
return (0, index_js_4.hexlify)((0, index_js_4.getBytes)(value));
}
// uint or int
if (type.match(/^u?int/)) {
return (0, index_js_3.getBigInt)(value).toString();
return (0, index_js_4.getBigInt)(value).toString();
}
switch (type) {
case "address":
@@ -379,13 +389,20 @@ class TypedDataEncoder {
case "bool":
return !!value;
case "string":
(0, index_js_3.assertArgument)(typeof (value) === "string", "invalid string", "value", value);
(0, index_js_4.assertArgument)(typeof (value) === "string", "invalid string", "value", value);
return value;
}
(0, index_js_3.assertArgument)(false, "unsupported type", "type", type);
(0, index_js_4.assertArgument)(false, "unsupported type", "type", type);
})
};
}
}
exports.TypedDataEncoder = TypedDataEncoder;
/**
* Compute the address used to sign the typed data for the %%signature%%.
*/
function verifyTypedData(domain, types, value, signature) {
return (0, index_js_3.recoverAddress)(TypedDataEncoder.hash(domain, types, value), signature);
}
exports.verifyTypedData = verifyTypedData;
//# sourceMappingURL=typed-data.js.map

File diff suppressed because one or more lines are too long

View File

@@ -266,7 +266,7 @@ class AbstractProvider {
return new provider_js_1.TransactionReceipt((0, format_js_1.formatTransactionReceipt)(value), this);
}
_wrapTransactionResponse(tx, network) {
return new provider_js_1.TransactionResponse(tx, this);
return new provider_js_1.TransactionResponse((0, format_js_1.formatTransactionResponse)(tx), this);
}
_detectNetwork() {
(0, index_js_6.assert)(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", {
@@ -311,6 +311,9 @@ class AbstractProvider {
}
return (0, index_js_6.toQuantity)(blockTag);
}
if (typeof (blockTag) === "bigint") {
blockTag = (0, index_js_6.getNumber)(blockTag, "blockTag");
}
if (typeof (blockTag) === "number") {
if (blockTag >= 0) {
return (0, index_js_6.toQuantity)(blockTag);
@@ -641,7 +644,7 @@ class AbstractProvider {
if (params == null) {
return null;
}
return this._wrapBlock((0, format_js_1.formatBlock)(params), network);
return this._wrapBlock(params, network);
}
async getTransaction(hash) {
const { network, params } = await (0, index_js_6.resolveProperties)({
@@ -651,7 +654,7 @@ class AbstractProvider {
if (params == null) {
return null;
}
return this._wrapTransactionResponse((0, format_js_1.formatTransactionResponse)(params), network);
return this._wrapTransactionResponse(params, network);
}
async getTransactionReceipt(hash) {
const { network, params } = await (0, index_js_6.resolveProperties)({
@@ -670,7 +673,7 @@ class AbstractProvider {
}
params.effectiveGasPrice = tx.gasPrice;
}
return this._wrapTransactionReceipt((0, format_js_1.formatTransactionReceipt)(params), network);
return this._wrapTransactionReceipt(params, network);
}
async getTransactionResult(hash) {
const { result } = await (0, index_js_6.resolveProperties)({
@@ -692,7 +695,7 @@ class AbstractProvider {
network: this.getNetwork(),
params: this.#perform({ method: "getLogs", filter })
});
return params.map((p) => this._wrapLog((0, format_js_1.formatLog)(p), network));
return params.map((p) => this._wrapLog(p, network));
}
// ENS
_getProvider(chainId) {
@@ -733,14 +736,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,OAAO,CAAC,GAAG,CAAC,6BAA8B,OAAQ,sCAAsC,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC;AAhBD,kDAgBC"}
{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IAC/C,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO;KAAE;IACnC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,6BAA8B,OAAQ,sCAAsC,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC;AAhBD,kDAgBC"}

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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AC,CAAC,CAAC;SACzE;QAAC,OAAO,KAAK,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAAE;KAC1C;IACL;;;;;;;;;;;;;;MAcE;IACE,IAAI,OAAO,CAAC,SAAS,KAAK,GAAG,EAAE;QAC3B,IAAI;YACA,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC;YAC9B,SAAS,CAAC,IAAI,CAAC,IAAI,yCAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;SACzD;QAAC,OAAO,KAAK,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAAE;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

@@ -61,7 +61,7 @@ export declare class EnsResolver {
*/
address: string;
/**
* The name this resovler was resolved against.
* The name this resolver was resolved against.
*/
name: string;
constructor(provider: AbstractProvider, address: string, name: string);
@@ -75,7 +75,7 @@ export declare class EnsResolver {
*/
getAddress(coinType?: number): Promise<null | string>;
/**
* Resovles to the EIP-643 text record for %%key%%, or ``null``
* Resolves to the EIP-643 text record for %%key%%, or ``null``
* if unconfigured.
*/
getText(key: string): Promise<null | string>;

View File

@@ -79,7 +79,7 @@ class EnsResolver {
*/
address;
/**
* The name this resovler was resolved against.
* The name this resolver was resolved against.
*/
name;
// For EIP-2544 names, the ancestor that provided the resolver
@@ -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);
}
/**
@@ -208,7 +208,7 @@ class EnsResolver {
});
}
/**
* Resovles to the EIP-643 text record for %%key%%, or ``null``
* Resolves to the EIP-643 text record for %%key%%, or ``null``
* if unconfigured.
*/
async getText(key) {
@@ -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

@@ -1,7 +1,7 @@
/**
* About providers.
*
* @_section: api/providers:Providers [providers]
* @_section: api/providers:Providers [about-providers]
*/
export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js";
export { AbstractSigner, VoidSigner, } from "./abstract-signer.js";

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;

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