Skip to content

Commit

Permalink
update getBatchTransactionObject to accept address instead of account
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeexcoin committed Mar 8, 2025
1 parent 082a112 commit 536248d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/agw-client/src/actions/sendTransactionBatch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
type Account,
type Address,
type Client,
encodeFunctionData,
type PublicClient,
Expand All @@ -25,10 +26,7 @@ export function getBatchTransactionObject<
chain,
chainOverride
> = SendTransactionRequest<chain, chainOverride>,
>(
client: Client<Transport, ChainEIP712, Account>,
parameters: SendTransactionBatchParameters<request>,
) {
>(address: Address, parameters: SendTransactionBatchParameters<request>) {
const { calls, paymaster, paymasterInput } = parameters;
const batchCalls: Call[] = calls.map((tx) => {
if (!tx.to) throw new Error('Transaction target (to) is required');
Expand All @@ -53,7 +51,7 @@ export function getBatchTransactionObject<
);

const batchTransaction = {
to: client.account.address,
to: address,
data: batchCallData,
value: totalValue,
paymaster: paymaster,
Expand Down Expand Up @@ -87,7 +85,10 @@ export async function sendTransactionBatch<
return await sendPrivyTransaction(client, parameters);
}

const batchTransaction = getBatchTransactionObject(client, parameters);
const batchTransaction = getBatchTransactionObject(
client.account.address,
parameters,
);

return sendTransactionInternal(
client,
Expand Down

0 comments on commit 536248d

Please sign in to comment.