-
Notifications
You must be signed in to change notification settings - Fork 103
Sponsored EOA Transactions (native AA on zksync chains) #827
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
Conversation
|
We're building your pull request over on Zeet. |
| * @param requestBody | ||
| * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. | ||
| * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. | ||
| * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. |
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.
Was thinking it could also be used to turn sponsoring on/off for smart wallets. Fine for now though
| 'x-backend-wallet-address': xBackendWalletAddress, | ||
| 'x-idempotency-key': xIdempotencyKey, | ||
| 'x-transaction-mode': xTransactionMode, | ||
| 'x-account-address': xAccountAddress, |
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.
Mam so much repetition to add a header. Feels like it should be centralized
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.
Fully agreed. My hono + zod refactor fixes a bunch of these issues
src/server/schemas/wallet/index.ts
Outdated
| Type.Union( | ||
| [ | ||
| Type.Literal("sponsored", { | ||
| description: "Attmpt to use native AA on ZKSync chains", |
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.
Typo in Attempt
| }; | ||
|
|
||
| type SendTransactionOption = TransactionSerializable & { | ||
| type SerializableTransaction = Awaited< |
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 we already have this type exported in the SDK?
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.
Not exported, hance the struggle 😅
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.
Just export it! Put up a PR we can get it out today
| }); | ||
|
|
||
| if (transaction.transactionMode === "sponsored") { | ||
| if (!isZkSyncChain(chain)) { |
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.
Here we could let it through if using a smart backend wallet for example
closes TOOL-3001
PR-Codex overview
This PR focuses on updating the
thirdwebdependency and enhancing transaction handling by introducing a newx-transaction-modeheader to manage transaction modes more effectively, particularly for sponsored transactions.Detailed summary
thirdwebversion from5.80.1-nightlyto5.83.0.transactionModeproperty intypes.tsfor transaction handling.x-transaction-modeheader across multiple routes to specify transaction mode.transactionModein their parameters.sponsoredtransaction mode in various services.