Sponsored EOA Transactions (native AA on zksync chains)#827
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.
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.
Mam so much repetition to add a header. Feels like it should be centralized
There was a problem hiding this comment.
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", |
| }; | ||
|
|
||
| type SendTransactionOption = TransactionSerializable & { | ||
| type SerializableTransaction = Awaited< |
There was a problem hiding this comment.
Don't we already have this type exported in the SDK?
There was a problem hiding this comment.
Not exported, hance the struggle 😅
There was a problem hiding this comment.
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.
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.