-
Notifications
You must be signed in to change notification settings - Fork 409
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
[SDK] Feature: Basic EIP7702 Support #5801
Conversation
🦋 Changeset detectedLatest commit: 429e112 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
size-limit report 📦
|
from: options.from ? getAddress(options.from) : undefined, | ||
from: | ||
typeof options.from === "string" // Is this just an address? | ||
? checksumAddress(options.from) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getaddress is nice because it throws if invalid input, not sure if checksum does that
}): Promise<SignedAuthorization[]> { | ||
const { authorizations, account } = options; | ||
|
||
return Promise.all( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no way to sign multiple authorizations with one signature? Assume this will prompt multiple signatures right
resolvePromisedValue(options.transaction.to), | ||
resolvePromisedValue(options.transaction.accessList), | ||
resolvePromisedValue(options.transaction.value), | ||
resolvePromisedValue(options.transaction.authorizations), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this right? Weird to have this and the one below
@@ -112,5 +128,50 @@ export async function toSerializableTransaction( | |||
accessList, | |||
value, | |||
...feeData, | |||
// For some reason authorizationList is not getting properly typed when returned from resolveAndSignAuthorizations? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prob because of the comment above
async function resolveAndSignAuthorizations( | ||
options: ToSerializableTransactionOptions, | ||
): Promise<SignedAuthorization[] | undefined> { | ||
if (typeof options.transaction.authorizations === "undefined") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to resolvePromise this first?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5801 +/- ##
==========================================
+ Coverage 55.41% 55.43% +0.01%
==========================================
Files 1123 1124 +1
Lines 59708 59758 +50
Branches 5066 5076 +10
==========================================
+ Hits 33089 33128 +39
- Misses 25895 25904 +9
- Partials 724 726 +2
*This pull request uses carry forward flags. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful
55bb597
to
d59413e
Compare
Merge activity
|
39fddac
to
0f3da1a
Compare
<!-- start pr-codex --> ## PR-Codex overview This PR introduces beta support for `EIP-7702` authorization lists, enhancing transaction handling and signing within the `thirdweb` library. ### Detailed summary - Added `style` configuration in `biome.json`. - Introduced `signAuthorization` function for EIP-7702 authorizations. - Updated transaction preparation to include `authorizationList`. - Added tests for `signAuthorization` and transaction serialization. - Modified `serializeTransaction` to handle EIP-7702 transactions. - Enhanced gas estimation and transaction preparation functions to support authorization lists. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
491b5e9
to
429e112
Compare
PR-Codex overview
This PR introduces beta support for
EIP-7702
authorization lists, enhancing transaction capabilities in thethirdweb
library. It includes new types, functions, and tests related to authorization signing and transaction preparation.Detailed summary
style
configuration inbiome.json
.signAuthorization
function forEIP-7702
inprivate-key.ts
.prepareTransaction
to acceptauthorizationList
.signAuthorization
and transaction serialization.EIP-7702
.