permissionless 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js +21 -9
  3. package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
  4. package/_cjs/accounts/index.js +3 -1
  5. package/_cjs/accounts/index.js.map +1 -1
  6. package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +4 -7
  7. package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
  8. package/_cjs/accounts/safe/signerToSafeSmartAccount.js +4 -7
  9. package/_cjs/accounts/safe/signerToSafeSmartAccount.js.map +1 -1
  10. package/_cjs/accounts/simple/signerToSimpleSmartAccount.js +11 -16
  11. package/_cjs/accounts/simple/signerToSimpleSmartAccount.js.map +1 -1
  12. package/_cjs/accounts/toSmartAccount.js +84 -0
  13. package/_cjs/accounts/toSmartAccount.js.map +1 -0
  14. package/_cjs/clients/createSmartAccountClient.js.map +1 -1
  15. package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js +21 -10
  16. package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
  17. package/_esm/accounts/index.js +2 -1
  18. package/_esm/accounts/index.js.map +1 -1
  19. package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +4 -8
  20. package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
  21. package/_esm/accounts/safe/signerToSafeSmartAccount.js +4 -7
  22. package/_esm/accounts/safe/signerToSafeSmartAccount.js.map +1 -1
  23. package/_esm/accounts/simple/signerToSimpleSmartAccount.js +12 -17
  24. package/_esm/accounts/simple/signerToSimpleSmartAccount.js.map +1 -1
  25. package/_esm/accounts/toSmartAccount.js +80 -0
  26. package/_esm/accounts/toSmartAccount.js.map +1 -0
  27. package/_esm/clients/createSmartAccountClient.js.map +1 -1
  28. package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts.map +1 -1
  29. package/_types/accounts/index.d.ts +2 -1
  30. package/_types/accounts/index.d.ts.map +1 -1
  31. package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -1
  32. package/_types/accounts/safe/signerToSafeSmartAccount.d.ts.map +1 -1
  33. package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts.map +1 -1
  34. package/_types/accounts/toSmartAccount.d.ts +26 -0
  35. package/_types/accounts/toSmartAccount.d.ts.map +1 -0
  36. package/_types/accounts/types.d.ts +1 -1
  37. package/_types/accounts/types.d.ts.map +1 -1
  38. package/_types/clients/createSmartAccountClient.d.ts +5 -5
  39. package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
  40. package/accounts/biconomy/signerToBiconomySmartAccount.ts +34 -16
  41. package/accounts/index.ts +3 -0
  42. package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +4 -9
  43. package/accounts/safe/signerToSafeSmartAccount.ts +216 -207
  44. package/accounts/simple/signerToSimpleSmartAccount.ts +12 -28
  45. package/accounts/toSmartAccount.ts +167 -0
  46. package/accounts/types.ts +2 -2
  47. package/clients/createSmartAccountClient.ts +14 -13
  48. package/package.json +1 -1
@@ -16,7 +16,6 @@ import {
16
16
  keccak256,
17
17
  parseAbiParameters
18
18
  } from "viem"
19
- import { toAccount } from "viem/accounts"
20
19
  import { getChainId, signMessage, signTypedData } from "viem/actions"
21
20
  import { getAccountNonce } from "../../actions/public/getAccountNonce"
22
21
  import type { Prettify } from "../../types"
@@ -24,6 +23,7 @@ import type { ENTRYPOINT_ADDRESS_V06_TYPE } from "../../types/entrypoint"
24
23
  import { getEntryPointVersion } from "../../utils"
25
24
  import { getUserOperationHash } from "../../utils/getUserOperationHash"
26
25
  import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed"
26
+ import { toSmartAccount } from "../toSmartAccount"
27
27
  import {
28
28
  SignTransactionNotSupportedBySmartAccount,
29
29
  type SmartAccount,
@@ -269,11 +269,22 @@ export async function signerToBiconomySmartAccount<
269
269
  accountAddress
270
270
  )
271
271
 
272
- // Build the EOA Signer
273
- const account = toAccount({
272
+ return toSmartAccount({
274
273
  address: accountAddress,
275
274
  async signMessage({ message }) {
276
- return signMessage(client, { account: viemSigner, message })
275
+ let signature = await signMessage(client, {
276
+ account: viemSigner,
277
+ message
278
+ })
279
+ const potentiallyIncorrectV = parseInt(signature.slice(-2), 16)
280
+ if (![27, 28].includes(potentiallyIncorrectV)) {
281
+ const correctV = potentiallyIncorrectV + 27
282
+ signature = signature.slice(0, -2) + correctV.toString(16)
283
+ }
284
+ return encodeAbiParameters(
285
+ [{ type: "bytes" }, { type: "address" }],
286
+ [signature as Hex, ecdsaModuleAddress]
287
+ )
277
288
  },
278
289
  async signTransaction(_, __) {
279
290
  throw new SignTransactionNotSupportedBySmartAccount()
@@ -284,18 +295,25 @@ export async function signerToBiconomySmartAccount<
284
295
  | keyof TTypedData
285
296
  | "EIP712Domain" = keyof TTypedData
286
297
  >(typedData: TypedDataDefinition<TTypedData, TPrimaryType>) {
287
- return signTypedData<TTypedData, TPrimaryType, TChain, undefined>(
288
- client,
289
- {
290
- account: viemSigner,
291
- ...typedData
292
- }
298
+ let signature = await signTypedData<
299
+ TTypedData,
300
+ TPrimaryType,
301
+ TChain,
302
+ undefined
303
+ >(client, {
304
+ account: viemSigner,
305
+ ...typedData
306
+ })
307
+ const potentiallyIncorrectV = parseInt(signature.slice(-2), 16)
308
+ if (![27, 28].includes(potentiallyIncorrectV)) {
309
+ const correctV = potentiallyIncorrectV + 27
310
+ signature = signature.slice(0, -2) + correctV.toString(16)
311
+ }
312
+ return encodeAbiParameters(
313
+ [{ type: "bytes" }, { type: "address" }],
314
+ [signature as Hex, ecdsaModuleAddress]
293
315
  )
294
- }
295
- })
296
-
297
- return {
298
- ...account,
316
+ },
299
317
  client: client,
300
318
  publicKey: accountAddress,
301
319
  entryPoint: entryPointAddress,
@@ -415,5 +433,5 @@ export async function signerToBiconomySmartAccount<
415
433
  const dynamicPart = moduleAddress.substring(2).padEnd(40, "0")
416
434
  return `0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000${dynamicPart}000000000000000000000000000000000000000000000000000000000000004181d4b4981670cb18f99f0b4a66446df1bf5b204d24cfcb659bf38ba27a4359b5711649ec2423c5e1247245eba2964679b6a1dbb85c992ae40b9b00c6935b02ff1b00000000000000000000000000000000000000000000000000000000000000`
417
435
  }
418
- }
436
+ })
419
437
  }
package/accounts/index.ts CHANGED
@@ -44,6 +44,8 @@ import {
44
44
  type SmartAccountSigner
45
45
  } from "./types"
46
46
 
47
+ import { toSmartAccount } from "./toSmartAccount"
48
+
47
49
  export {
48
50
  type SafeVersion,
49
51
  type SmartAccountSigner,
@@ -60,6 +62,7 @@ export {
60
62
  signerToEcdsaKernelSmartAccount,
61
63
  type BiconomySmartAccount,
62
64
  signerToBiconomySmartAccount,
65
+ toSmartAccount,
63
66
  type SignerToSimpleSmartAccountParameters,
64
67
  type SignerToSafeSmartAccountParameters,
65
68
  type PrivateKeyToSimpleSmartAccountParameters,
@@ -11,7 +11,6 @@ import {
11
11
  encodeFunctionData,
12
12
  isAddressEqual
13
13
  } from "viem"
14
- import { toAccount } from "viem/accounts"
15
14
  import {
16
15
  getChainId,
17
16
  readContract,
@@ -25,6 +24,7 @@ import type { ENTRYPOINT_ADDRESS_V06_TYPE } from "../../types/entrypoint"
25
24
  import { getEntryPointVersion } from "../../utils"
26
25
  import { getUserOperationHash } from "../../utils/getUserOperationHash"
27
26
  import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed"
27
+ import { toSmartAccount } from "../toSmartAccount"
28
28
  import type { SmartAccount } from "../types"
29
29
  import {
30
30
  SignTransactionNotSupportedBySmartAccount,
@@ -289,8 +289,7 @@ export async function signerToEcdsaKernelSmartAccount<
289
289
  accountAddress
290
290
  )
291
291
 
292
- // Build the EOA Signer
293
- const account = toAccount({
292
+ return toSmartAccount({
294
293
  address: accountAddress,
295
294
  async signMessage({ message }) {
296
295
  return signMessage(client, { account: viemSigner, message })
@@ -311,11 +310,7 @@ export async function signerToEcdsaKernelSmartAccount<
311
310
  ...typedData
312
311
  }
313
312
  )
314
- }
315
- })
316
-
317
- return {
318
- ...account,
313
+ },
319
314
  client: client,
320
315
  publicKey: accountAddress,
321
316
  entryPoint: entryPointAddress,
@@ -420,5 +415,5 @@ export async function signerToEcdsaKernelSmartAccount<
420
415
  async getDummySignature(_userOperation) {
421
416
  return "0x00000000fffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"
422
417
  }
423
- }
418
+ })
424
419
  }
@@ -20,7 +20,6 @@ import {
20
20
  toBytes,
21
21
  zeroAddress
22
22
  } from "viem"
23
- import { toAccount } from "viem/accounts"
24
23
  import {
25
24
  getChainId,
26
25
  readContract,
@@ -32,6 +31,7 @@ import type { ENTRYPOINT_ADDRESS_V06_TYPE, Prettify } from "../../types"
32
31
  import type { EntryPoint } from "../../types/entrypoint"
33
32
  import { getEntryPointVersion } from "../../utils"
34
33
  import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed"
34
+ import { toSmartAccount } from "../toSmartAccount"
35
35
  import {
36
36
  SignTransactionNotSupportedBySmartAccount,
37
37
  type SmartAccount,
@@ -598,46 +598,11 @@ export async function signerToSafeSmartAccount<
598
598
 
599
599
  let safeDeployed = await isSmartAccountDeployed(client, accountAddress)
600
600
 
601
- const account = toAccount({
602
- address: accountAddress,
603
- async signMessage({ message }) {
604
- const messageHash = hashTypedData({
605
- domain: {
606
- chainId: chainId,
607
- verifyingContract: accountAddress
608
- },
609
- types: {
610
- SafeMessage: [{ name: "message", type: "bytes" }]
611
- },
612
- primaryType: "SafeMessage",
613
- message: {
614
- message: generateSafeMessageMessage(message)
615
- }
616
- })
617
-
618
- return adjustVInSignature(
619
- "eth_sign",
620
- await signMessage(client, {
621
- account: viemSigner,
622
- message: {
623
- raw: toBytes(messageHash)
624
- }
625
- })
626
- )
627
- },
628
- async signTransaction(_, __) {
629
- throw new SignTransactionNotSupportedBySmartAccount()
630
- },
631
- async signTypedData<
632
- const TTypedData extends TypedData | Record<string, unknown>,
633
- TPrimaryType extends
634
- | keyof TTypedData
635
- | "EIP712Domain" = keyof TTypedData
636
- >(typedData: TypedDataDefinition<TTypedData, TPrimaryType>) {
637
- return adjustVInSignature(
638
- "eth_signTypedData",
639
- await signTypedData(client, {
640
- account: viemSigner,
601
+ const safeSmartAccount: SafeSmartAccount<entryPoint, TTransport, TChain> =
602
+ toSmartAccount({
603
+ address: accountAddress,
604
+ async signMessage({ message }) {
605
+ const messageHash = hashTypedData({
641
606
  domain: {
642
607
  chainId: chainId,
643
608
  verifyingContract: accountAddress
@@ -647,195 +612,239 @@ export async function signerToSafeSmartAccount<
647
612
  },
648
613
  primaryType: "SafeMessage",
649
614
  message: {
650
- message: generateSafeMessageMessage<
651
- TTypedData,
652
- TPrimaryType
653
- >(typedData)
615
+ message: generateSafeMessageMessage(message)
654
616
  }
655
617
  })
656
- )
657
- }
658
- })
659
618
 
660
- const safeSmartAccount: SafeSmartAccount<entryPoint, TTransport, TChain> = {
661
- ...account,
662
- client: client,
663
- publicKey: accountAddress,
664
- entryPoint: entryPointAddress,
665
- source: "SafeSmartAccount",
666
- async getNonce() {
667
- return getAccountNonce(client, {
668
- sender: accountAddress,
669
- entryPoint: entryPointAddress
670
- })
671
- },
672
- async signUserOperation(userOperation) {
673
- const signatures = [
674
- {
675
- signer: viemSigner.address,
676
- data: await signTypedData(client, {
619
+ return adjustVInSignature(
620
+ "eth_sign",
621
+ await signMessage(client, {
622
+ account: viemSigner,
623
+ message: {
624
+ raw: toBytes(messageHash)
625
+ }
626
+ })
627
+ )
628
+ },
629
+ async signTransaction(_, __) {
630
+ throw new SignTransactionNotSupportedBySmartAccount()
631
+ },
632
+ async signTypedData<
633
+ const TTypedData extends TypedData | Record<string, unknown>,
634
+ TPrimaryType extends
635
+ | keyof TTypedData
636
+ | "EIP712Domain" = keyof TTypedData
637
+ >(typedData: TypedDataDefinition<TTypedData, TPrimaryType>) {
638
+ return adjustVInSignature(
639
+ "eth_signTypedData",
640
+ await signTypedData(client, {
677
641
  account: viemSigner,
678
642
  domain: {
679
643
  chainId: chainId,
680
- verifyingContract: safe4337ModuleAddress
644
+ verifyingContract: accountAddress
645
+ },
646
+ types: {
647
+ SafeMessage: [{ name: "message", type: "bytes" }]
681
648
  },
682
- types: EIP712_SAFE_OPERATION_TYPE,
683
- primaryType: "SafeOp",
649
+ primaryType: "SafeMessage",
684
650
  message: {
685
- safe: accountAddress,
686
- callData: userOperation.callData,
687
- entryPoint: entryPointAddress,
688
- nonce: userOperation.nonce,
689
- initCode: userOperation.initCode,
690
- maxFeePerGas: userOperation.maxFeePerGas,
691
- maxPriorityFeePerGas:
692
- userOperation.maxPriorityFeePerGas,
693
- preVerificationGas:
694
- userOperation.preVerificationGas,
695
- verificationGasLimit:
696
- userOperation.verificationGasLimit,
697
- callGasLimit: userOperation.callGasLimit,
698
- paymasterAndData: userOperation.paymasterAndData,
699
- validAfter: validAfter,
700
- validUntil: validUntil
651
+ message: generateSafeMessageMessage<
652
+ TTypedData,
653
+ TPrimaryType
654
+ >(typedData)
701
655
  }
702
656
  })
703
- }
704
- ]
657
+ )
658
+ },
659
+ client: client,
660
+ publicKey: accountAddress,
661
+ entryPoint: entryPointAddress,
662
+ source: "SafeSmartAccount",
663
+ async getNonce() {
664
+ return getAccountNonce(client, {
665
+ sender: accountAddress,
666
+ entryPoint: entryPointAddress
667
+ })
668
+ },
669
+ async signUserOperation(userOperation) {
670
+ const signatures = [
671
+ {
672
+ signer: viemSigner.address,
673
+ data: await signTypedData(client, {
674
+ account: viemSigner,
675
+ domain: {
676
+ chainId: chainId,
677
+ verifyingContract: safe4337ModuleAddress
678
+ },
679
+ types: EIP712_SAFE_OPERATION_TYPE,
680
+ primaryType: "SafeOp",
681
+ message: {
682
+ safe: accountAddress,
683
+ callData: userOperation.callData,
684
+ entryPoint: entryPointAddress,
685
+ nonce: userOperation.nonce,
686
+ initCode: userOperation.initCode,
687
+ maxFeePerGas: userOperation.maxFeePerGas,
688
+ maxPriorityFeePerGas:
689
+ userOperation.maxPriorityFeePerGas,
690
+ preVerificationGas:
691
+ userOperation.preVerificationGas,
692
+ verificationGasLimit:
693
+ userOperation.verificationGasLimit,
694
+ callGasLimit: userOperation.callGasLimit,
695
+ paymasterAndData:
696
+ userOperation.paymasterAndData,
697
+ validAfter: validAfter,
698
+ validUntil: validUntil
699
+ }
700
+ })
701
+ }
702
+ ]
705
703
 
706
- signatures.sort((left, right) =>
707
- left.signer
708
- .toLowerCase()
709
- .localeCompare(right.signer.toLowerCase())
710
- )
704
+ signatures.sort((left, right) =>
705
+ left.signer
706
+ .toLowerCase()
707
+ .localeCompare(right.signer.toLowerCase())
708
+ )
711
709
 
712
- const signatureBytes = concat(signatures.map((sig) => sig.data))
710
+ const signatureBytes = concat(signatures.map((sig) => sig.data))
713
711
 
714
- return encodePacked(
715
- ["uint48", "uint48", "bytes"],
716
- [validAfter, validUntil, signatureBytes]
717
- )
718
- },
719
- async getInitCode() {
720
- if (safeDeployed) return "0x"
712
+ return encodePacked(
713
+ ["uint48", "uint48", "bytes"],
714
+ [validAfter, validUntil, signatureBytes]
715
+ )
716
+ },
717
+ async getInitCode() {
718
+ if (safeDeployed) return "0x"
721
719
 
722
- safeDeployed = await isSmartAccountDeployed(client, accountAddress)
720
+ safeDeployed = await isSmartAccountDeployed(
721
+ client,
722
+ accountAddress
723
+ )
723
724
 
724
- if (safeDeployed) return "0x"
725
+ if (safeDeployed) return "0x"
726
+
727
+ const initCodeCallData = await getAccountInitCode({
728
+ owner: viemSigner.address,
729
+ addModuleLibAddress,
730
+ safe4337ModuleAddress,
731
+ safeSingletonAddress,
732
+ multiSendAddress,
733
+ saltNonce,
734
+ setupTransactions,
735
+ safeModules
736
+ })
725
737
 
726
- const initCodeCallData = await getAccountInitCode({
727
- owner: viemSigner.address,
728
- addModuleLibAddress,
729
- safe4337ModuleAddress,
730
- safeSingletonAddress,
731
- multiSendAddress,
732
- saltNonce,
733
- setupTransactions,
734
- safeModules
735
- })
738
+ return concatHex([safeProxyFactoryAddress, initCodeCallData])
739
+ },
740
+ async getFactory() {
741
+ if (safeDeployed) return undefined
736
742
 
737
- return concatHex([safeProxyFactoryAddress, initCodeCallData])
738
- },
739
- async getFactory() {
740
- if (safeDeployed) return undefined
743
+ safeDeployed = await isSmartAccountDeployed(
744
+ client,
745
+ accountAddress
746
+ )
741
747
 
742
- safeDeployed = await isSmartAccountDeployed(client, accountAddress)
748
+ if (safeDeployed) return undefined
743
749
 
744
- if (safeDeployed) return undefined
750
+ return safeProxyFactoryAddress
751
+ },
752
+ async getFactoryData() {
753
+ if (safeDeployed) return undefined
745
754
 
746
- return safeProxyFactoryAddress
747
- },
748
- async getFactoryData() {
749
- if (safeDeployed) return undefined
750
-
751
- safeDeployed = await isSmartAccountDeployed(client, accountAddress)
752
-
753
- if (safeDeployed) return undefined
754
-
755
- return await getAccountInitCode({
756
- owner: viemSigner.address,
757
- addModuleLibAddress,
758
- safe4337ModuleAddress,
759
- safeSingletonAddress,
760
- multiSendAddress,
761
- saltNonce,
762
- setupTransactions,
763
- safeModules
764
- })
765
- },
766
- async encodeDeployCallData(_) {
767
- throw new Error("Safe account doesn't support account deployment")
768
- },
769
- async encodeCallData(args) {
770
- let to: Address
771
- let value: bigint
772
- let data: Hex
773
- let operationType = 0
774
-
775
- if (Array.isArray(args)) {
776
- const argsArray = args as {
777
- to: Address
778
- value: bigint
779
- data: Hex
780
- }[]
781
-
782
- to = multiSendCallOnlyAddress
783
- value = 0n
784
-
785
- data = encodeMultiSend(
786
- argsArray.map((tx) => ({ ...tx, operation: 0 }))
755
+ safeDeployed = await isSmartAccountDeployed(
756
+ client,
757
+ accountAddress
787
758
  )
788
- operationType = 1
789
- } else {
790
- const singleTransaction = args as {
791
- to: Address
792
- value: bigint
793
- data: Hex
794
- }
795
- to = singleTransaction.to
796
- data = singleTransaction.data
797
- value = singleTransaction.value
798
- }
799
759
 
800
- return encodeFunctionData({
801
- abi: [
802
- {
803
- inputs: [
804
- {
805
- internalType: "address",
806
- name: "to",
807
- type: "address"
808
- },
809
- {
810
- internalType: "uint256",
811
- name: "value",
812
- type: "uint256"
813
- },
814
- {
815
- internalType: "bytes",
816
- name: "data",
817
- type: "bytes"
818
- },
819
- {
820
- internalType: "uint8",
821
- name: "operation",
822
- type: "uint8"
823
- }
824
- ],
825
- name: "executeUserOpWithErrorString",
826
- outputs: [],
827
- stateMutability: "nonpayable",
828
- type: "function"
760
+ if (safeDeployed) return undefined
761
+
762
+ return await getAccountInitCode({
763
+ owner: viemSigner.address,
764
+ addModuleLibAddress,
765
+ safe4337ModuleAddress,
766
+ safeSingletonAddress,
767
+ multiSendAddress,
768
+ saltNonce,
769
+ setupTransactions,
770
+ safeModules
771
+ })
772
+ },
773
+ async encodeDeployCallData(_) {
774
+ throw new Error(
775
+ "Safe account doesn't support account deployment"
776
+ )
777
+ },
778
+ async encodeCallData(args) {
779
+ let to: Address
780
+ let value: bigint
781
+ let data: Hex
782
+ let operationType = 0
783
+
784
+ if (Array.isArray(args)) {
785
+ const argsArray = args as {
786
+ to: Address
787
+ value: bigint
788
+ data: Hex
789
+ }[]
790
+
791
+ to = multiSendCallOnlyAddress
792
+ value = 0n
793
+
794
+ data = encodeMultiSend(
795
+ argsArray.map((tx) => ({ ...tx, operation: 0 }))
796
+ )
797
+ operationType = 1
798
+ } else {
799
+ const singleTransaction = args as {
800
+ to: Address
801
+ value: bigint
802
+ data: Hex
829
803
  }
830
- ],
831
- functionName: "executeUserOpWithErrorString",
832
- args: [to, value, data, operationType]
833
- })
834
- },
835
- async getDummySignature(_userOperation) {
836
- return "0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
837
- }
838
- }
804
+ to = singleTransaction.to
805
+ data = singleTransaction.data
806
+ value = singleTransaction.value
807
+ }
808
+
809
+ return encodeFunctionData({
810
+ abi: [
811
+ {
812
+ inputs: [
813
+ {
814
+ internalType: "address",
815
+ name: "to",
816
+ type: "address"
817
+ },
818
+ {
819
+ internalType: "uint256",
820
+ name: "value",
821
+ type: "uint256"
822
+ },
823
+ {
824
+ internalType: "bytes",
825
+ name: "data",
826
+ type: "bytes"
827
+ },
828
+ {
829
+ internalType: "uint8",
830
+ name: "operation",
831
+ type: "uint8"
832
+ }
833
+ ],
834
+ name: "executeUserOpWithErrorString",
835
+ outputs: [],
836
+ stateMutability: "nonpayable",
837
+ type: "function"
838
+ }
839
+ ],
840
+ functionName: "executeUserOpWithErrorString",
841
+ args: [to, value, data, operationType]
842
+ })
843
+ },
844
+ async getDummySignature(_userOperation) {
845
+ return "0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
846
+ }
847
+ })
839
848
 
840
849
  return safeSmartAccount
841
850
  }