Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: shared packages #84

Merged
merged 37 commits into from
May 8, 2023
Merged

feat: shared packages #84

merged 37 commits into from
May 8, 2023

Conversation

cbrzn
Copy link
Contributor

@cbrzn cbrzn commented May 2, 2023

Introduces the new structure of the wraps & crates, where two wraps have been created:

  • Core:

    • Has the same functionality as the previous Ethereum wrapper, except for the following methods:
      • encodeFunction
      • encodeParams
      • toEth
      • toWei
    • The *_sync string has been removed from methods & file, to clean the codebase and make it more maintainable
  • Utils:

    • This wrap allows users to interact with Ethereum utility functions. The methods removed from Core were moved here
    • Doesn't need the provider dependency
    • solidityPack was implemented, being compatible with ethers.js implementation 😄
  • Also updates ethers version to 2.0.2

This is the first iteration of the new structure. This will have two more iterations which will be tracked by these issues (in order):

Also, I wanted to propose that once we merge this, we deploy these new wrappers to the ENS domains:

We don't have an easy way to export this two wrappers through the same interface because of this error in the schema compose: polywrap/wrap-cli#1731 - So I think it's okay to start at least using this core and utils wraps from ENS. Open to suggestions tho

So we can start migrating uniswap and safe wrappers to this structure and battle test these news wraps 😛

cbrzn and others added 30 commits March 1, 2023 14:26
* When using a non-custom signer provider (e.g. Browser) and calling eth_signTypedData_v4, we need to pass payload data as a string

* chore(provider/js): improve conditional logic in eth_signTypedData

---------

Co-authored-by: Pileks <[email protected]>
update dev with latest main
…e-packed

# Conflicts:
#	crates/util/Cargo.toml
#	crates/util/src/encode.rs
#	wraps/core/Cargo.toml
#	wraps/utils/Cargo.toml
#	wraps/utils/package.json
#	wraps/utils/src/lib.rs
#	wraps/utils/src/schema.graphql
#	wraps/utils/tests/e2e.spec.ts
Copy link
Contributor

@krisbitney krisbitney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really great work. Thanks for everything you've done to get us here.

I added a couple of comments but they are really not important. Feel free to ignore them.

.github/workflows/wrapper-ci.yaml Outdated Show resolved Hide resolved
wraps/core/src/api/transaction.rs Outdated Show resolved Hide resolved
Copy link
Member

@dOrgJelli dOrgJelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all LGTM, aside from:

  • fleshing out the README of each wrap
  • adding comments to the core wrap's interface (I used ChatGPT for the utils interface, helped speed it up a bit)
  • improving typings & variable names on various functions (ex: toWei(eth: String!) -> toWei(eth: BigInt!))

@cbrzn cbrzn closed this May 8, 2023
@cbrzn cbrzn reopened this May 8, 2023
@cbrzn cbrzn merged commit bbee73c into main May 8, 2023
@cbrzn cbrzn deleted the feat/shared-packages-v2 branch August 24, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants