Skip to content

Commit

Permalink
Support both single and multiple url configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
plusminushalf committed Nov 1, 2024
1 parent 743cb49 commit 7276ed0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/wagmi/hooks/useSendTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,21 @@ const sendTransactionMutationOptions = <config extends Config>(
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
}
})
}
Expand Down

0 comments on commit 7276ed0

Please sign in to comment.