Skip to content

Commit

Permalink
feat: Add gas estimation utilities
Browse files Browse the repository at this point in the history
feat: Add feeEstimation function and move to correct package

Apply suggestions from code review

Co-authored-by: Annie Ke <[email protected]>

fix: Remove the copy pasta from package.json

Update packages/fee-estimation/README.md

feat: Offer passing in viem client as an option

better api and tests

better docs

all the docs

fix: Make viem a peer dep

typo

fix: Refactor to use viem correctly (docs not updated yet)

moar tests more explicit implementations

Update packages/fee-estimation/src/estimateFees.ts

fix: lint

fix: Remove bad import and debugging fs.writeFile

chore: pnpm up --latest packages

feat: Add zora and base mainnet

fix: linter
  • Loading branch information
Will Cory authored and Will Cory committed Jul 20, 2023
1 parent 677bff3 commit b7986e6
Show file tree
Hide file tree
Showing 19 changed files with 1,736 additions and 172 deletions.
29 changes: 29 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,28 @@ jobs:
name: Upload coverage
command: codecov --verbose --clean --flags <<parameters.coverage_flag>>

fee-estimation:
docker:
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
resource_class: large
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore pnpm Package Cache
keys:
- pnpm-packages-v2-{{ checksum "pnpm.lock.yaml" }}
- check-changed:
patterns: sdk,contracts-bedrock,contracts
- run:
name: Typecheck
command: pnpm nx typecheck
working_directory: packages/fee-estimation
- run:
name: Lint
command: pnpm nx lint
working_directory: packages/fee-estimation

contracts-ts-tests:
docker:
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
Expand Down Expand Up @@ -1362,6 +1384,13 @@ workflows:
dependencies: '(contracts-bedrock|contracts-ts)'
requires:
- pnpm-monorepo
- js-lint-test:
name: fee-estimation
coverage_flag: fee-estimation-tests
package_name: fee-estimation
dependencies: '(contracts-bedrock|contracts-ts|fee-estimation|contracts-periphery)'
requires:
- pnpm-monorepo
- js-lint-test:
name: sdk-next-tests
coverage_flag: sdk-next-tests
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-ts/src/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by @wagmi/[email protected] on 7/17/2023 at 7:42:03 PM
// Generated by @wagmi/[email protected] on 7/17/2023 at 7:42:52 PM
import {
getContract,
GetContractArgs,
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-ts/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by @wagmi/[email protected] on 7/17/2023 at 7:42:02 PM
// Generated by @wagmi/[email protected] on 7/17/2023 at 7:42:50 PM

/* eslint-disable */

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-ts/src/react.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by @wagmi/[email protected] on 7/17/2023 at 7:42:04 PM
// Generated by @wagmi/[email protected] on 7/17/2023 at 7:42:52 PM
import {
useNetwork,
useContractRead,
Expand Down
8 changes: 8 additions & 0 deletions packages/fee-estimation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
artifacts
cache
typechain
.deps
.envrc
.env
/dist/
coverage
7 changes: 7 additions & 0 deletions packages/fee-estimation/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
artifacts
cache
typechain
.deps
.envrc
.env
/dist/
3 changes: 3 additions & 0 deletions packages/fee-estimation/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('../../.prettierrc.js'),
}
21 changes: 21 additions & 0 deletions packages/fee-estimation/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Optimism

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.
Loading

0 comments on commit b7986e6

Please sign in to comment.