@@ -3,7 +3,6 @@ import type { FastifyInstance } from "fastify";
33import { StatusCodes } from "http-status-codes" ;
44import type { Address , Hex } from "thirdweb" ;
55import { insertTransaction } from "../../../shared/utils/transaction/insert-transaction" ;
6- import { AddressSchema } from "../../schemas/address" ;
76import {
87 requestQuerystringSchema ,
98 standardResponseSchema ,
@@ -22,36 +21,29 @@ import {
2221 WalletDetailsError ,
2322} from "../../../shared/db/wallets/get-wallet-details" ;
2423import { createCustomError } from "../../middleware/error" ;
24+ import { RawTransactionParamsSchema } from "../../schemas/transaction/raw-transaction-parms" ;
2525
2626const requestBodySchema = Type . Object ( {
27- transactions : Type . Array (
28- Type . Object ( {
29- toAddress : Type . Optional ( AddressSchema ) ,
30- data : Type . String ( {
31- examples : [ "0x..." ] ,
32- } ) ,
33- value : Type . String ( {
34- examples : [ "10000000" ] ,
35- } ) ,
36- } ) ,
37- ) ,
27+ transactions : Type . Array ( RawTransactionParamsSchema , {
28+ minItems : 1 ,
29+ } ) ,
3830} ) ;
3931
40- export async function sendTransactionsAtomicRoute ( fastify : FastifyInstance ) {
32+ export async function sendTransactionBatchAtomicRoute ( fastify : FastifyInstance ) {
4133 fastify . route < {
4234 Params : Static < typeof walletChainParamSchema > ;
4335 Body : Static < typeof requestBodySchema > ;
4436 Reply : Static < typeof transactionWritesResponseSchema > ;
4537 Querystring : Static < typeof requestQuerystringSchema > ;
4638 } > ( {
4739 method : "POST" ,
48- url : "/backend-wallet/:chain/send-transactions -atomic" ,
40+ url : "/backend-wallet/:chain/send-transaction-batch -atomic" ,
4941 schema : {
5042 summary : "Send a batch of raw transactions atomically" ,
5143 description :
52- "Send a batch of raw transactions in a single UserOp. Can only be used with smart wallets." ,
44+ "Send a batch of raw transactions in a single UserOp. Transactions will be sent in-order and atomically. Can only be used with smart wallets." ,
5345 tags : [ "Backend Wallet" ] ,
54- operationId : "sendTransactionsAtomic " ,
46+ operationId : "sendTransactionBatchAtomic " ,
5547 params : walletChainParamSchema ,
5648 body : requestBodySchema ,
5749 headers : Type . Omit ( walletWithAAHeaderSchema , [ "x-transaction-mode" ] ) ,
0 commit comments