permissionless 0.3.5 → 0.3.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 (95) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/_cjs/accounts/biconomy/index.js +8 -0
  3. package/_cjs/accounts/biconomy/index.js.map +1 -0
  4. package/_cjs/accounts/etherspot/index.js +8 -0
  5. package/_cjs/accounts/etherspot/index.js.map +1 -0
  6. package/_cjs/accounts/kernel/index.js +18 -0
  7. package/_cjs/accounts/kernel/index.js.map +1 -0
  8. package/_cjs/accounts/kernel/toKernelSmartAccount.js +6 -6
  9. package/_cjs/accounts/kernel/toKernelSmartAccount.js.map +1 -1
  10. package/_cjs/accounts/kernel/utils/signMessage.js +9 -7
  11. package/_cjs/accounts/kernel/utils/signMessage.js.map +1 -1
  12. package/_cjs/accounts/kernel/utils/signTypedData.js +7 -6
  13. package/_cjs/accounts/kernel/utils/signTypedData.js.map +1 -1
  14. package/_cjs/accounts/kernel/utils/wrapMessageHash.js +3 -3
  15. package/_cjs/accounts/kernel/utils/wrapMessageHash.js.map +1 -1
  16. package/_cjs/accounts/light/index.js +8 -0
  17. package/_cjs/accounts/light/index.js.map +1 -0
  18. package/_cjs/accounts/nexus/index.js +8 -0
  19. package/_cjs/accounts/nexus/index.js.map +1 -0
  20. package/_cjs/accounts/simple/index.js +10 -0
  21. package/_cjs/accounts/simple/index.js.map +1 -0
  22. package/_cjs/accounts/thirdweb/index.js +8 -0
  23. package/_cjs/accounts/thirdweb/index.js.map +1 -0
  24. package/_cjs/accounts/trust/index.js +8 -0
  25. package/_cjs/accounts/trust/index.js.map +1 -0
  26. package/_esm/accounts/biconomy/index.js +5 -0
  27. package/_esm/accounts/biconomy/index.js.map +1 -0
  28. package/_esm/accounts/etherspot/index.js +5 -0
  29. package/_esm/accounts/etherspot/index.js.map +1 -0
  30. package/_esm/accounts/kernel/index.js +15 -0
  31. package/_esm/accounts/kernel/index.js.map +1 -0
  32. package/_esm/accounts/kernel/toKernelSmartAccount.js +6 -6
  33. package/_esm/accounts/kernel/toKernelSmartAccount.js.map +1 -1
  34. package/_esm/accounts/kernel/utils/signMessage.js +9 -7
  35. package/_esm/accounts/kernel/utils/signMessage.js.map +1 -1
  36. package/_esm/accounts/kernel/utils/signTypedData.js +7 -6
  37. package/_esm/accounts/kernel/utils/signTypedData.js.map +1 -1
  38. package/_esm/accounts/kernel/utils/wrapMessageHash.js +3 -3
  39. package/_esm/accounts/kernel/utils/wrapMessageHash.js.map +1 -1
  40. package/_esm/accounts/light/index.js +5 -0
  41. package/_esm/accounts/light/index.js.map +1 -0
  42. package/_esm/accounts/nexus/index.js +5 -0
  43. package/_esm/accounts/nexus/index.js.map +1 -0
  44. package/_esm/accounts/simple/index.js +7 -0
  45. package/_esm/accounts/simple/index.js.map +1 -0
  46. package/_esm/accounts/thirdweb/index.js +5 -0
  47. package/_esm/accounts/thirdweb/index.js.map +1 -0
  48. package/_esm/accounts/trust/index.js +5 -0
  49. package/_esm/accounts/trust/index.js.map +1 -0
  50. package/_types/accounts/biconomy/index.d.ts +6 -0
  51. package/_types/accounts/biconomy/index.d.ts.map +1 -0
  52. package/_types/accounts/etherspot/index.d.ts +6 -0
  53. package/_types/accounts/etherspot/index.d.ts.map +1 -0
  54. package/_types/accounts/kernel/index.d.ts +22 -0
  55. package/_types/accounts/kernel/index.d.ts.map +1 -0
  56. package/_types/accounts/kernel/utils/signMessage.d.ts +4 -5
  57. package/_types/accounts/kernel/utils/signMessage.d.ts.map +1 -1
  58. package/_types/accounts/kernel/utils/signTypedData.d.ts +4 -4
  59. package/_types/accounts/kernel/utils/signTypedData.d.ts.map +1 -1
  60. package/_types/accounts/kernel/utils/wrapMessageHash.d.ts +8 -3
  61. package/_types/accounts/kernel/utils/wrapMessageHash.d.ts.map +1 -1
  62. package/_types/accounts/light/index.d.ts +6 -0
  63. package/_types/accounts/light/index.d.ts.map +1 -0
  64. package/_types/accounts/nexus/index.d.ts +6 -0
  65. package/_types/accounts/nexus/index.d.ts.map +1 -0
  66. package/_types/accounts/simple/index.d.ts +9 -0
  67. package/_types/accounts/simple/index.d.ts.map +1 -0
  68. package/_types/accounts/thirdweb/index.d.ts +6 -0
  69. package/_types/accounts/thirdweb/index.d.ts.map +1 -0
  70. package/_types/accounts/trust/index.d.ts +6 -0
  71. package/_types/accounts/trust/index.d.ts.map +1 -0
  72. package/accounts/biconomy/index.ts +11 -0
  73. package/accounts/etherspot/index.ts +11 -0
  74. package/accounts/kernel/index.ts +33 -0
  75. package/accounts/kernel/toKernelSmartAccount.ts +6 -6
  76. package/accounts/kernel/utils/signMessage.ts +19 -15
  77. package/accounts/kernel/utils/signTypedData.ts +14 -11
  78. package/accounts/kernel/utils/wrapMessageHash.ts +11 -8
  79. package/accounts/light/index.ts +12 -0
  80. package/accounts/nexus/index.ts +11 -0
  81. package/accounts/simple/index.ts +18 -0
  82. package/accounts/thirdweb/index.ts +11 -0
  83. package/accounts/trust/index.ts +11 -0
  84. package/actions/erc7579/installModule.test.ts +4 -6
  85. package/actions/erc7579/installModules.test.ts +4 -6
  86. package/actions/erc7579/uninstallModule.test.ts +2 -3
  87. package/actions/pimlico/getUserOperationStatus.test.ts +40 -16
  88. package/actions/smartAccount/getCallsStatus.test.ts +2 -4
  89. package/actions/smartAccount/sendCalls.test.ts +2 -4
  90. package/actions/smartAccount/sendTransaction.test.ts +2 -4
  91. package/actions/smartAccount/signMessage.test.ts +2 -4
  92. package/actions/smartAccount/signTypedData.test.ts +2 -4
  93. package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.test.ts +76 -25
  94. package/package.json +41 -1
  95. package/vitest.config.ts +11 -1
@@ -1 +1 @@
1
- {"version":3,"file":"signTypedData.js","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACpB,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,iBAAiB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,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,cAAc;gBACvB,OAAO,EAAE,OAAO;gBAChB,iBAAiB,EAAE,cAAc;aACpC;SACJ,CAAC,CAAA;IACN,CAAC;IAED,MAAM,kBAAkB,GAAG,eAAe,CAAC,SAAS,EAAE;QAClD,aAAa,EAAE,cAAc;QAC7B,cAAc;QACd,OAAO,EAAE,OAAO;KACnB,CAAC,CAAA;IAEF,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,WAAW,CAAC;YACf,OAAO,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE;YACpC,KAAK;YACL,cAAc;YACd,aAAa,EAAE,cAAc;YAC7B,OAAO;YACP,OAAO,EAAE,KAAK;SACjB,CAAC,CAAA;IACN,CAAC;IAED,OAAO,KAAK,CAAC,WAAW,CAAC;QACrB,OAAO,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE;KACvC,CAAC,CAAA;AAAA,CACL"}
1
+ {"version":3,"file":"signTypedData.js","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACpB,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAEH,eAAe,EAClB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,UAKC,EAC+B;IAChC,MAAM,EACF,KAAK,EACL,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,cAAc,EACvB,OAAO,EACP,OAAO,GAAG,KAAK,EACf,GAAG,SAAS,EACf,GAAG,UAAU,CAAA;IAEd,IACI,CAAC,cAAc,KAAK,OAAO,IAAI,cAAc,KAAK,OAAO,CAAC;QAC1D,CAAC,iBAAiB,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AAG,EAAE,kBAAkB,EAAE;YACpC,KAAK;YACL,OAAO,EAAE,cAAc;YACvB,OAAO,EAAE,cAAc;YACvB,OAAO;YACP,OAAO,EAAE,KAAK;SACjB,CAAC,CAAA;IACN,CAAC;IAED,OAAO,KAAK,CAAC,WAAW,CAAC;QACrB,OAAO,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE;KACvC,CAAC,CAAA;AAAA,CACL"}
@@ -1,6 +1,6 @@
1
1
  import { concatHex, domainSeparator, encodeAbiParameters, keccak256, stringToHex } from "viem";
2
2
  import { isKernelV2 } from "./isKernelV2.js";
3
- export const wrapMessageHash = (messageHash, { accountAddress, kernelVersion, chainId }) => {
3
+ export const wrapMessageHash = ({ hash, address: accountAddress, version: kernelVersion, chainId }) => {
4
4
  const _domainSeparator = domainSeparator({
5
5
  domain: {
6
6
  name: "Kernel",
@@ -10,8 +10,8 @@ export const wrapMessageHash = (messageHash, { accountAddress, kernelVersion, ch
10
10
  }
11
11
  });
12
12
  const wrappedMessageHash = isKernelV2(kernelVersion)
13
- ? messageHash
14
- : keccak256(encodeAbiParameters([{ type: "bytes32" }, { type: "bytes32" }], [keccak256(stringToHex("Kernel(bytes32 hash)")), messageHash]));
13
+ ? hash
14
+ : keccak256(encodeAbiParameters([{ type: "bytes32" }, { type: "bytes32" }], [keccak256(stringToHex("Kernel(bytes32 hash)")), hash]));
15
15
  const digest = keccak256(concatHex(["0x1901", _domainSeparator, wrappedMessageHash]));
16
16
  return digest;
17
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"wrapMessageHash.js","sourceRoot":"","sources":["../../../../accounts/kernel/utils/wrapMessageHash.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,SAAS,EACT,WAAW,EACd,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAQ5C,MAAM,CAAC,MAAM,eAAe,GAAG,CAC3B,WAAgB,E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kBAAkB,GAAG,UAAU,CAAC,aAAa,CAAC;QAChD,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,SAAS,CACL,mBAAmB,CACf,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC1C,CAAC,SAAS,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,EAAE,IAAI,CAAC,CACzD,CACJ,CAAA;IAEP,MAAM,MAAM,GAAG,SAAS,CACpB,SAAS,CAAC,CAAC,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,CAAC,CAC9D,CAAA;IACD,OAAO,MAAM,CAAA;AAAA,CAChB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { toLightSmartAccount } from "./toLightSmartAccount.js";
2
+ export const LightSmartAccount = {
3
+ toLightSmartAccount
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../accounts/light/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,mBAAmB;CACtB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { toNexusSmartAccount } from "./toNexusSmartAccount.js";
2
+ export const NexusSmartAccount = {
3
+ toNexusSmartAccount
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../accounts/nexus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,mBAAmB;CACtB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { to7702SimpleSmartAccount } from "./to7702SimpleSmartAccount.js";
2
+ import { toSimpleSmartAccount } from "./toSimpleSmartAccount.js";
3
+ export const SimpleSmartAccount = {
4
+ toSimpleSmartAccount,
5
+ to7702SimpleSmartAccount
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../accounts/simple/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,oBAAoB;IACpB,wBAAwB;CAC3B,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { toThirdwebSmartAccount } from "./toThirdwebSmartAccount.js";
2
+ export const ThirdwebSmartAccount = {
3
+ toThirdwebSmartAccount
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../accounts/thirdweb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,sBAAsB;CACzB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { toTrustSmartAccount } from "./toTrustSmartAccount.js";
2
+ export const TrustSmartAccount = {
3
+ toTrustSmartAccount
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../accounts/trust/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,mBAAmB;CACtB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { toBiconomySmartAccount } from "./toBiconomySmartAccount.js";
2
+ export declare const BiconomySmartAccount: {
3
+ toBiconomySmartAccount: typeof toBiconomySmartAccount;
4
+ };
5
+ export type { BiconomySmartAccountImplementation, ToBiconomySmartAccountParameters, ToBiconomySmartAccountReturnType } from "./toBiconomySmartAccount.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/biconomy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,eAAO,MAAM,oBAAoB;;CAEhC,CAAA;AAED,YAAY,EACR,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EACnC,MAAM,6BAA6B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { toEtherspotSmartAccount } from "./toEtherspotSmartAccount.js";
2
+ export declare const EtherspotSmartAccount: {
3
+ toEtherspotSmartAccount: typeof toEtherspotSmartAccount;
4
+ };
5
+ export type { EtherspotSmartAccountImplementation, ToEtherspotSmartAccountParameters, ToEtherspotSmartAccountReturnType } from "./toEtherspotSmartAccount.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/etherspot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAEtE,eAAO,MAAM,qBAAqB;;CAEjC,CAAA;AAED,YAAY,EACR,mCAAmC,EACnC,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,8BAA8B,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { to7702KernelSmartAccount } from "./to7702KernelSmartAccount.js";
2
+ import { toKernelSmartAccount } from "./toKernelSmartAccount.js";
3
+ import { signMessage } from "./utils/signMessage.js";
4
+ import { signTypedData } from "./utils/signTypedData.js";
5
+ export declare const KernelSmartAccount: {
6
+ toKernelSmartAccount: typeof toKernelSmartAccount;
7
+ to7702KernelSmartAccount: typeof to7702KernelSmartAccount;
8
+ wrapMessageHash: ({ hash, address: accountAddress, version: kernelVersion, chainId }: {
9
+ version: import("./toKernelSmartAccount.js").KernelVersion<"0.6" | "0.7">;
10
+ address: `0x${string}`;
11
+ chainId: number;
12
+ hash: `0x${string}`;
13
+ }) => `0x${string}`;
14
+ signMessage: typeof signMessage;
15
+ signTypedData: typeof signTypedData;
16
+ isKernelV2: (version: import("./toKernelSmartAccount.js").KernelVersion<"0.6" | "0.7">) => boolean;
17
+ };
18
+ export type { KernelSmartAccountImplementation, KernelVersion, ToKernelSmartAccountParameters, ToKernelSmartAccountReturnType } from "./toKernelSmartAccount.js";
19
+ export type { EcdsaKernelSmartAccountImplementation, ToEcdsaKernelSmartAccountParameters, ToEcdsaKernelSmartAccountReturnType } from "./toEcdsaKernelSmartAccount.js";
20
+ export type { To7702KernelSmartAccountImplementation, To7702KernelSmartAccountParameters, To7702KernelSmartAccountReturnType } from "./to7702KernelSmartAccount.js";
21
+ export type { WrapMessageHashParams } from "./utils/wrapMessageHash.js";
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/kernel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAGxD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAO9B,CAAA;AAED,YAAY,EACR,gCAAgC,EAChC,aAAa,EACb,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACR,qCAAqC,EACrC,mCAAmC,EACnC,mCAAmC,EACtC,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACR,sCAAsC,EACtC,kCAAkC,EAClC,kCAAkC,EACrC,MAAM,+BAA+B,CAAA;AACtC,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA"}
@@ -1,10 +1,9 @@
1
- import { type LocalAccount, type SignMessageReturnType, type SignableMessage } from "viem";
1
+ import { type LocalAccount, type Prettify, type SignMessageReturnType, type SignableMessage } from "viem";
2
2
  import type { WebAuthnAccount } from "viem/account-abstraction";
3
3
  import { type WrapMessageHashParams } from "./wrapMessageHash.js";
4
- export declare function signMessage({ message, owner, accountAddress, kernelVersion: accountVersion, chainId, eip7702 }: {
5
- chainId: number;
4
+ export declare function signMessage({ message, owner, address: accountAddress, version: accountVersion, chainId, eip7702 }: Prettify<{
6
5
  message: SignableMessage;
7
6
  owner: LocalAccount | WebAuthnAccount;
8
- eip7702: boolean;
9
- } & WrapMessageHashParams): Promise<SignMessageReturnType>;
7
+ eip7702?: boolean;
8
+ } & WrapMessageHashParams>): Promise<SignMessageReturnType>;
10
9
  //# sourceMappingURL=signMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EAGvB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI/D,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,wBAAsB,WAAW,CAAC,EAC9B,OAAO,EACP,KAAK,EACL,cAAc,EACd,aAAa,EAAE,cAAc,EAC7B,OAAO,EACP,OAAO,EACV,EAAE;IACC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,eAAe,CAAA;IACxB,KAAK,EAAE,YAAY,GAAG,eAAe,CAAA;IACrC,OAAO,EAAE,OAAO,CAAA;CACnB,GAAG,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAqFzD"}
1
+ {"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EAGvB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI/D,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,wBAAsB,WAAW,CAAC,EAC9B,OAAO,EACP,KAAK,EACL,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,cAAc,EACvB,OAAO,EACP,OAAe,EAClB,EAAE,QAAQ,CACP;IACI,OAAO,EAAE,eAAe,CAAA;IACxB,KAAK,EAAE,YAAY,GAAG,eAAe,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,qBAAqB,CAC5B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuFjC"}
@@ -1,8 +1,8 @@
1
- import { type LocalAccount, type SignTypedDataReturnType, type TypedDataDefinition } from "viem";
1
+ import { type LocalAccount, type Prettify, type SignTypedDataReturnType, type TypedDataDefinition } from "viem";
2
2
  import type { WebAuthnAccount } from "viem/account-abstraction";
3
3
  import { type WrapMessageHashParams } from "./wrapMessageHash.js";
4
- export declare function signTypedData(parameters: TypedDataDefinition & WrapMessageHashParams & {
4
+ export declare function signTypedData(parameters: Prettify<WrapMessageHashParams & {
5
5
  owner: LocalAccount | WebAuthnAccount;
6
- eip7702: boolean;
7
- }): Promise<SignTypedDataReturnType>;
6
+ eip7702?: boolean;
7
+ } & TypedDataDefinition>): Promise<SignTypedDataReturnType>;
8
8
  //# sourceMappingURL=signTypedData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signTypedData.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAI3B,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAG/D,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,wBAAsB,aAAa,CAC/B,UAAU,EAAE,mBAAmB,GAC3B,qBAAqB,GAAG;IACpB,KAAK,EAAE,YAAY,GAAG,eAAe,CAAA;IACrC,OAAO,EAAE,OAAO,CAAA;CACnB,GACN,OAAO,CAAC,uBAAuB,CAAC,CA0ElC"}
1
+ {"version":3,"file":"signTypedData.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAI3B,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAG/D,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,wBAAsB,aAAa,CAC/B,UAAU,EAAE,QAAQ,CAChB,qBAAqB,GAAG;IACpB,KAAK,EAAE,YAAY,GAAG,eAAe,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,mBAAmB,CAC1B,GACF,OAAO,CAAC,uBAAuB,CAAC,CA2ElC"}
@@ -1,9 +1,14 @@
1
1
  import { type Address } from "viem";
2
2
  import type { KernelVersion } from "../toKernelSmartAccount.js";
3
3
  export type WrapMessageHashParams = {
4
- kernelVersion: KernelVersion<"0.6" | "0.7">;
5
- accountAddress: Address;
4
+ version: KernelVersion<"0.6" | "0.7">;
5
+ address: Address;
6
6
  chainId: number;
7
7
  };
8
- export declare const wrapMessageHash: (messageHash: `0x${string}`, { accountAddress, kernelVersion, chainId }: WrapMessageHashParams) => `0x${string}`;
8
+ export declare const wrapMessageHash: ({ hash, address: accountAddress, version: kernelVersion, chainId }: {
9
+ version: KernelVersion<"0.6" | "0.7">;
10
+ address: `0x${string}`;
11
+ chainId: number;
12
+ hash: `0x${string}`;
13
+ }) => `0x${string}`;
9
14
  //# sourceMappingURL=wrapMessageHash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrapMessageHash.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/wrapMessageHash.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EAOf,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAG/D,MAAM,MAAM,qBAAqB,GAAG;IAChC,aAAa,EAAE,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,CAAA;IAC3C,cAAc,EAAE,OAAO,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,eAAe,kHAyB3B,CAAA"}
1
+ {"version":3,"file":"wrapMessageHash.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/wrapMessageHash.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EAQf,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAG/D,MAAM,MAAM,qBAAqB,GAAG;IAChC,OAAO,EAAE,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,CAAA;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,eAAe;;;;;mBA2B3B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { toLightSmartAccount } from "./toLightSmartAccount.js";
2
+ export declare const LightSmartAccount: {
3
+ toLightSmartAccount: typeof toLightSmartAccount;
4
+ };
5
+ export type { LightAccountVersion, LightSmartAccountImplementation, ToLightSmartAccountParameters, ToLightSmartAccountReturnType } from "./toLightSmartAccount.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/light/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,iBAAiB;;CAE7B,CAAA;AAED,YAAY,EACR,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,6BAA6B,EAChC,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { toNexusSmartAccount } from "./toNexusSmartAccount.js";
2
+ export declare const NexusSmartAccount: {
3
+ toNexusSmartAccount: typeof toNexusSmartAccount;
4
+ };
5
+ export type { NexusSmartAccountImplementation, ToNexusSmartAccountParameters, ToNexusSmartAccountReturnType } from "./toNexusSmartAccount.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/nexus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,iBAAiB;;CAE7B,CAAA;AAED,YAAY,EACR,+BAA+B,EAC/B,6BAA6B,EAC7B,6BAA6B,EAChC,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { to7702SimpleSmartAccount } from "./to7702SimpleSmartAccount.js";
2
+ import { toSimpleSmartAccount } from "./toSimpleSmartAccount.js";
3
+ export declare const SimpleSmartAccount: {
4
+ toSimpleSmartAccount: typeof toSimpleSmartAccount;
5
+ to7702SimpleSmartAccount: typeof to7702SimpleSmartAccount;
6
+ };
7
+ export type { SimpleSmartAccountImplementation, ToSimpleSmartAccountParameters, ToSimpleSmartAccountReturnType } from "./toSimpleSmartAccount.js";
8
+ export type { To7702SimpleSmartAccountImplementation, To7702SimpleSmartAccountParameters, To7702SimpleSmartAccountReturnType } from "./to7702SimpleSmartAccount.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/simple/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,eAAO,MAAM,kBAAkB;;;CAG9B,CAAA;AAED,YAAY,EACR,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACR,sCAAsC,EACtC,kCAAkC,EAClC,kCAAkC,EACrC,MAAM,+BAA+B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { toThirdwebSmartAccount } from "./toThirdwebSmartAccount.js";
2
+ export declare const ThirdwebSmartAccount: {
3
+ toThirdwebSmartAccount: typeof toThirdwebSmartAccount;
4
+ };
5
+ export type { ThirdwebSmartAccountImplementation, ToThirdwebSmartAccountParameters, ToThirdwebSmartAccountReturnType } from "./toThirdwebSmartAccount.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/thirdweb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,eAAO,MAAM,oBAAoB;;CAEhC,CAAA;AAED,YAAY,EACR,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EACnC,MAAM,6BAA6B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { toTrustSmartAccount } from "./toTrustSmartAccount.js";
2
+ export declare const TrustSmartAccount: {
3
+ toTrustSmartAccount: typeof toTrustSmartAccount;
4
+ };
5
+ export type { ToTrustSmartAccountParameters, ToTrustSmartAccountReturnType, TrustSmartAccountImplementation } from "./toTrustSmartAccount.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/trust/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,iBAAiB;;CAE7B,CAAA;AAED,YAAY,EACR,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAClC,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { toBiconomySmartAccount } from "./toBiconomySmartAccount.js"
2
+
3
+ export const BiconomySmartAccount = {
4
+ toBiconomySmartAccount
5
+ }
6
+
7
+ export type {
8
+ BiconomySmartAccountImplementation,
9
+ ToBiconomySmartAccountParameters,
10
+ ToBiconomySmartAccountReturnType
11
+ } from "./toBiconomySmartAccount.js"
@@ -0,0 +1,11 @@
1
+ import { toEtherspotSmartAccount } from "./toEtherspotSmartAccount.js"
2
+
3
+ export const EtherspotSmartAccount = {
4
+ toEtherspotSmartAccount
5
+ }
6
+
7
+ export type {
8
+ EtherspotSmartAccountImplementation,
9
+ ToEtherspotSmartAccountParameters,
10
+ ToEtherspotSmartAccountReturnType
11
+ } from "./toEtherspotSmartAccount.js"
@@ -0,0 +1,33 @@
1
+ import { to7702KernelSmartAccount } from "./to7702KernelSmartAccount.js"
2
+ import { toKernelSmartAccount } from "./toKernelSmartAccount.js"
3
+ import { isKernelV2 } from "./utils/isKernelV2.js"
4
+ import { signMessage } from "./utils/signMessage.js"
5
+ import { signTypedData } from "./utils/signTypedData.js"
6
+ import { wrapMessageHash } from "./utils/wrapMessageHash.js"
7
+
8
+ export const KernelSmartAccount = {
9
+ toKernelSmartAccount,
10
+ to7702KernelSmartAccount,
11
+ wrapMessageHash,
12
+ signMessage,
13
+ signTypedData,
14
+ isKernelV2
15
+ }
16
+
17
+ export type {
18
+ KernelSmartAccountImplementation,
19
+ KernelVersion,
20
+ ToKernelSmartAccountParameters,
21
+ ToKernelSmartAccountReturnType
22
+ } from "./toKernelSmartAccount.js"
23
+ export type {
24
+ EcdsaKernelSmartAccountImplementation,
25
+ ToEcdsaKernelSmartAccountParameters,
26
+ ToEcdsaKernelSmartAccountReturnType
27
+ } from "./toEcdsaKernelSmartAccount.js"
28
+ export type {
29
+ To7702KernelSmartAccountImplementation,
30
+ To7702KernelSmartAccountParameters,
31
+ To7702KernelSmartAccountReturnType
32
+ } from "./to7702KernelSmartAccount.js"
33
+ export type { WrapMessageHashParams } from "./utils/wrapMessageHash.js"
@@ -901,8 +901,8 @@ export async function toKernelSmartAccount<
901
901
  const signature = await signMessage({
902
902
  owner,
903
903
  message,
904
- accountAddress: await this.getAddress(),
905
- kernelVersion: kernelVersion,
904
+ address: await this.getAddress(),
905
+ version: kernelVersion,
906
906
  chainId: await getMemoizedChainId(),
907
907
  eip7702: eip7702
908
908
  })
@@ -931,8 +931,8 @@ export async function toKernelSmartAccount<
931
931
  owner: owner,
932
932
  chainId: await getMemoizedChainId(),
933
933
  ...(typedData as TypedDataDefinition),
934
- accountAddress: await this.getAddress(),
935
- kernelVersion: kernelVersion,
934
+ address: await this.getAddress(),
935
+ version: kernelVersion,
936
936
  eip7702
937
937
  })
938
938
 
@@ -966,8 +966,8 @@ export async function toKernelSmartAccount<
966
966
  owner,
967
967
  message: { raw: hash },
968
968
  chainId,
969
- accountAddress: await this.getAddress(),
970
- kernelVersion,
969
+ address: await this.getAddress(),
970
+ version: kernelVersion,
971
971
  eip7702: false
972
972
  })
973
973
  : await owner.signMessage({
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  type Hash,
3
3
  type LocalAccount,
4
+ type Prettify,
4
5
  type SignMessageReturnType,
5
6
  type SignableMessage,
6
7
  encodeAbiParameters,
@@ -18,23 +19,25 @@ import {
18
19
  export async function signMessage({
19
20
  message,
20
21
  owner,
21
- accountAddress,
22
- kernelVersion: accountVersion,
22
+ address: accountAddress,
23
+ version: accountVersion,
23
24
  chainId,
24
- eip7702
25
- }: {
26
- chainId: number
27
- message: SignableMessage
28
- owner: LocalAccount | WebAuthnAccount
29
- eip7702: boolean
30
- } & WrapMessageHashParams): Promise<SignMessageReturnType> {
25
+ eip7702 = false
26
+ }: Prettify<
27
+ {
28
+ message: SignableMessage
29
+ owner: LocalAccount | WebAuthnAccount
30
+ eip7702?: boolean
31
+ } & WrapMessageHashParams
32
+ >): Promise<SignMessageReturnType> {
31
33
  if (isWebAuthnAccount(owner)) {
32
34
  let messageContent: string
33
35
  if (typeof message === "string") {
34
36
  // message is a string
35
- messageContent = wrapMessageHash(hashMessage(message), {
36
- kernelVersion: accountVersion,
37
- accountAddress,
37
+ messageContent = wrapMessageHash({
38
+ hash: hashMessage(message),
39
+ version: accountVersion,
40
+ address: accountAddress,
38
41
  chainId
39
42
  // chainId: client.chain
40
43
  // ? client.chain.id
@@ -100,9 +103,10 @@ export async function signMessage({
100
103
  })
101
104
  }
102
105
 
103
- const wrappedMessageHash = wrapMessageHash(hashMessage(message), {
104
- kernelVersion: accountVersion,
105
- accountAddress,
106
+ const wrappedMessageHash = wrapMessageHash({
107
+ hash: hashMessage(message),
108
+ version: accountVersion,
109
+ address: accountAddress,
106
110
  chainId
107
111
  // chainId: client.chain
108
112
  // ? client.chain.id
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  type LocalAccount,
3
+ type Prettify,
3
4
  type SignTypedDataReturnType,
4
5
  type TypedDataDefinition,
5
6
  getTypesForEIP712Domain,
@@ -15,18 +16,19 @@ import {
15
16
  } from "./wrapMessageHash.js"
16
17
 
17
18
  export async function signTypedData(
18
- parameters: TypedDataDefinition &
19
+ parameters: Prettify<
19
20
  WrapMessageHashParams & {
20
21
  owner: LocalAccount | WebAuthnAccount
21
- eip7702: boolean
22
- }
22
+ eip7702?: boolean
23
+ } & TypedDataDefinition
24
+ >
23
25
  ): Promise<SignTypedDataReturnType> {
24
26
  const {
25
27
  owner,
26
- accountAddress,
27
- kernelVersion: accountVersion,
28
+ address: accountAddress,
29
+ version: accountVersion,
28
30
  chainId,
29
- eip7702,
31
+ eip7702 = false,
30
32
  ...typedData
31
33
  } = parameters
32
34
 
@@ -74,9 +76,10 @@ export async function signTypedData(
74
76
  })
75
77
  }
76
78
 
77
- const wrappedMessageHash = wrapMessageHash(typedHash, {
78
- kernelVersion: accountVersion,
79
- accountAddress,
79
+ const wrappedMessageHash = wrapMessageHash({
80
+ hash: typedHash,
81
+ version: accountVersion,
82
+ address: accountAddress,
80
83
  chainId: chainId
81
84
  })
82
85
 
@@ -84,8 +87,8 @@ export async function signTypedData(
84
87
  return signMessage({
85
88
  message: { raw: wrappedMessageHash },
86
89
  owner,
87
- accountAddress,
88
- kernelVersion: accountVersion,
90
+ address: accountAddress,
91
+ version: accountVersion,
89
92
  chainId,
90
93
  eip7702: false
91
94
  })
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  type Address,
3
3
  type Hex,
4
+ type Prettify,
4
5
  concatHex,
5
6
  domainSeparator,
6
7
  encodeAbiParameters,
@@ -11,15 +12,17 @@ import type { KernelVersion } from "../toKernelSmartAccount.js"
11
12
  import { isKernelV2 } from "./isKernelV2.js"
12
13
 
13
14
  export type WrapMessageHashParams = {
14
- kernelVersion: KernelVersion<"0.6" | "0.7">
15
- accountAddress: Address
15
+ version: KernelVersion<"0.6" | "0.7">
16
+ address: Address
16
17
  chainId: number
17
18
  }
18
19
 
19
- export const wrapMessageHash = (
20
- messageHash: Hex,
21
- { accountAddress, kernelVersion, chainId }: WrapMessageHashParams
22
- ) => {
20
+ export const wrapMessageHash = ({
21
+ hash,
22
+ address: accountAddress,
23
+ version: kernelVersion,
24
+ chainId
25
+ }: Prettify<{ hash: Hex } & WrapMessageHashParams>) => {
23
26
  const _domainSeparator = domainSeparator({
24
27
  domain: {
25
28
  name: "Kernel",
@@ -29,11 +32,11 @@ export const wrapMessageHash = (
29
32
  }
30
33
  })
31
34
  const wrappedMessageHash = isKernelV2(kernelVersion)
32
- ? messageHash
35
+ ? hash
33
36
  : keccak256(
34
37
  encodeAbiParameters(
35
38
  [{ type: "bytes32" }, { type: "bytes32" }],
36
- [keccak256(stringToHex("Kernel(bytes32 hash)")), messageHash]
39
+ [keccak256(stringToHex("Kernel(bytes32 hash)")), hash]
37
40
  )
38
41
  )
39
42
 
@@ -0,0 +1,12 @@
1
+ import { toLightSmartAccount } from "./toLightSmartAccount.js"
2
+
3
+ export const LightSmartAccount = {
4
+ toLightSmartAccount
5
+ }
6
+
7
+ export type {
8
+ LightAccountVersion,
9
+ LightSmartAccountImplementation,
10
+ ToLightSmartAccountParameters,
11
+ ToLightSmartAccountReturnType
12
+ } from "./toLightSmartAccount.js"
@@ -0,0 +1,11 @@
1
+ import { toNexusSmartAccount } from "./toNexusSmartAccount.js"
2
+
3
+ export const NexusSmartAccount = {
4
+ toNexusSmartAccount
5
+ }
6
+
7
+ export type {
8
+ NexusSmartAccountImplementation,
9
+ ToNexusSmartAccountParameters,
10
+ ToNexusSmartAccountReturnType
11
+ } from "./toNexusSmartAccount.js"
@@ -0,0 +1,18 @@
1
+ import { to7702SimpleSmartAccount } from "./to7702SimpleSmartAccount.js"
2
+ import { toSimpleSmartAccount } from "./toSimpleSmartAccount.js"
3
+
4
+ export const SimpleSmartAccount = {
5
+ toSimpleSmartAccount,
6
+ to7702SimpleSmartAccount
7
+ }
8
+
9
+ export type {
10
+ SimpleSmartAccountImplementation,
11
+ ToSimpleSmartAccountParameters,
12
+ ToSimpleSmartAccountReturnType
13
+ } from "./toSimpleSmartAccount.js"
14
+ export type {
15
+ To7702SimpleSmartAccountImplementation,
16
+ To7702SimpleSmartAccountParameters,
17
+ To7702SimpleSmartAccountReturnType
18
+ } from "./to7702SimpleSmartAccount.js"
@@ -0,0 +1,11 @@
1
+ import { toThirdwebSmartAccount } from "./toThirdwebSmartAccount.js"
2
+
3
+ export const ThirdwebSmartAccount = {
4
+ toThirdwebSmartAccount
5
+ }
6
+
7
+ export type {
8
+ ThirdwebSmartAccountImplementation,
9
+ ToThirdwebSmartAccountParameters,
10
+ ToThirdwebSmartAccountReturnType
11
+ } from "./toThirdwebSmartAccount.js"
@@ -0,0 +1,11 @@
1
+ import { toTrustSmartAccount } from "./toTrustSmartAccount.js"
2
+
3
+ export const TrustSmartAccount = {
4
+ toTrustSmartAccount
5
+ }
6
+
7
+ export type {
8
+ ToTrustSmartAccountParameters,
9
+ ToTrustSmartAccountReturnType,
10
+ TrustSmartAccountImplementation
11
+ } from "./toTrustSmartAccount.js"