diff --git a/packages/wagmi/hooks/useSendTransaction.ts b/packages/wagmi/hooks/useSendTransaction.ts index 4425bf0b..f0c2238f 100644 --- a/packages/wagmi/hooks/useSendTransaction.ts +++ b/packages/wagmi/hooks/useSendTransaction.ts @@ -31,14 +31,21 @@ const sendTransactionMutationOptions = ( if (parameters.capabilities) { const client = config.getClient({ chainId: variables.chainId }) + const paymasterServiceUrl = parameters.capabilities + ?.paymasterService?.url + ? parameters.capabilities?.paymasterService?.url + : parameters.capabilities?.paymasterService[client.chain.id] + ?.url + return sendCalls(config, { calls: [variables], capabilities: { ...parameters.capabilities, - paymasterService: - parameters.capabilities?.paymasterService[ - client.chain.id - ] + paymasterService: paymasterServiceUrl + ? { + url: paymasterServiceUrl + } + : undefined } }) }