|
1 | 1 | import { Type, type Static } from "@sinclair/typebox"; |
2 | 2 | import type { FastifyInstance } from "fastify"; |
3 | 3 | import { StatusCodes } from "http-status-codes"; |
4 | | -import type { Address, Hex } from "thirdweb"; |
| 4 | +import { getAddress, type Address, type Hex } from "thirdweb"; |
5 | 5 | import { insertTransaction } from "../../../shared/utils/transaction/insert-transaction"; |
6 | 6 | import { |
7 | 7 | requestQuerystringSchema, |
@@ -29,7 +29,9 @@ const requestBodySchema = Type.Object({ |
29 | 29 | }), |
30 | 30 | }); |
31 | 31 |
|
32 | | -export async function sendTransactionBatchAtomicRoute(fastify: FastifyInstance) { |
| 32 | +export async function sendTransactionBatchAtomicRoute( |
| 33 | + fastify: FastifyInstance, |
| 34 | +) { |
33 | 35 | fastify.route<{ |
34 | 36 | Params: Static<typeof walletChainParamSchema>; |
35 | 37 | Body: Static<typeof requestBodySchema>; |
@@ -113,8 +115,10 @@ export async function sendTransactionBatchAtomicRoute(fastify: FastifyInstance) |
113 | 115 |
|
114 | 116 | const queueId = await insertTransaction({ |
115 | 117 | insertedTransaction: { |
| 118 | + ...(hasSmartHeaders |
| 119 | + ? { isUserOp: true, signerAddress: getAddress(fromAddress) } |
| 120 | + : { isUserOp: false }), |
116 | 121 | transactionMode: undefined, |
117 | | - isUserOp: false, |
118 | 122 | chainId, |
119 | 123 | from: fromAddress as Address, |
120 | 124 | accountAddress: maybeAddress(accountAddress, "x-account-address"), |
|
0 commit comments