Skip to content

Commit

Permalink
change providerToSmartAccountSigner positional args to keyword args
Browse files Browse the repository at this point in the history
  • Loading branch information
plusminushalf committed Feb 25, 2024
1 parent 7c3ce9f commit c13cf4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,14 @@ describe("Simple Account from walletClient", () => {
const publicClient = await getPublicClient()

const bundlerClient = getBundlerClient()
const pimlicoPaymaster = getPimlicoPaymasterClient()

const smartAccountClient = await getSmartAccountClient({
account: await getSignerToSimpleSmartAccount({
signer: await getCustomSignerToSimpleSmartAccount()
}),
sponsorUserOperation: async ({
entryPoint: _entryPoint,
userOperation
}) => {
const pimlicoPaymaster = getPimlicoPaymasterClient()
return pimlicoPaymaster.sponsorUserOperation({
userOperation,
entryPoint: getEntryPoint()
})
middleware: {
sponsorUserOperation: pimlicoPaymaster.sponsorUserOperation
}
})

Expand Down Expand Up @@ -304,20 +298,14 @@ describe("Simple Account from walletClient", () => {
const publicClient = await getPublicClient()

const bundlerClient = getBundlerClient()
const pimlicoPaymaster = getPimlicoPaymasterClient()

const smartAccountClient = await getSmartAccountClient({
account: await getSignerToSimpleSmartAccount({
signer: await getCustomSignerToSimpleSmartAccount()
}),
sponsorUserOperation: async ({
entryPoint: _entryPoint,
userOperation
}) => {
const pimlicoPaymaster = getPimlicoPaymasterClient()
return pimlicoPaymaster.sponsorUserOperation({
userOperation,
entryPoint: getEntryPoint()
})
middleware: {
sponsorUserOperation: pimlicoPaymaster.sponsorUserOperation
}
})

Expand Down
9 changes: 6 additions & 3 deletions packages/permissionless/utils/providerToSmartAccountSigner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import {
} from "viem"
import { walletClientToSmartAccountSigner } from "./walletClientToSmartAccountSigner"

export const providerToSmartAccountSigner = async (
provider: EIP1193Provider,
export const providerToSmartAccountSigner = async ({
provider,
signerAddress
}: {
provider: EIP1193Provider
signerAddress?: Hex
) => {
}) => {
let account: Hex
if (!signerAddress) {
;[account] = await provider.request({ method: "eth_requestAccounts" })
Expand Down

0 comments on commit c13cf4e

Please sign in to comment.