@charterlabs/rhinestone-sdk 0.2.7-dev.3 → 0.2.8

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 (155) hide show
  1. package/README.md +46 -8
  2. package/dist/src/accounts/error.d.ts +38 -3
  3. package/dist/src/accounts/error.d.ts.map +1 -1
  4. package/dist/src/accounts/error.js +55 -7
  5. package/dist/src/accounts/index.d.ts +31 -20
  6. package/dist/src/accounts/index.d.ts.map +1 -1
  7. package/dist/src/accounts/index.js +231 -25
  8. package/dist/src/accounts/index.test.js +2 -4
  9. package/dist/src/accounts/json-rpc/index.d.ts +5 -0
  10. package/dist/src/accounts/json-rpc/index.d.ts.map +1 -0
  11. package/dist/src/accounts/json-rpc/index.js +16 -0
  12. package/dist/src/accounts/json-rpc/providers.d.ts +4 -0
  13. package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -0
  14. package/dist/src/accounts/json-rpc/providers.js +52 -0
  15. package/dist/src/accounts/kernel.d.ts +1 -1
  16. package/dist/src/accounts/kernel.d.ts.map +1 -1
  17. package/dist/src/accounts/kernel.js +29 -1
  18. package/dist/src/accounts/kernel.test.js +35 -8
  19. package/dist/src/accounts/nexus.d.ts +4 -3
  20. package/dist/src/accounts/nexus.d.ts.map +1 -1
  21. package/dist/src/accounts/nexus.js +82 -14
  22. package/dist/src/accounts/nexus.test.js +33 -6
  23. package/dist/src/accounts/passport.d.ts +12 -0
  24. package/dist/src/accounts/passport.d.ts.map +1 -0
  25. package/dist/src/accounts/passport.js +173 -0
  26. package/dist/src/accounts/safe.d.ts.map +1 -1
  27. package/dist/src/accounts/safe.js +85 -53
  28. package/dist/src/accounts/safe.test.js +33 -6
  29. package/dist/src/accounts/signing/common.d.ts +4 -4
  30. package/dist/src/accounts/signing/common.d.ts.map +1 -1
  31. package/dist/src/accounts/signing/common.js +21 -9
  32. package/dist/src/accounts/signing/message.d.ts +1 -1
  33. package/dist/src/accounts/signing/message.d.ts.map +1 -1
  34. package/dist/src/accounts/signing/message.js +6 -6
  35. package/dist/src/accounts/signing/passkeys.d.ts +8 -1
  36. package/dist/src/accounts/signing/passkeys.d.ts.map +1 -1
  37. package/dist/src/accounts/signing/passkeys.js +35 -0
  38. package/dist/src/accounts/signing/passkeys.test.js +15 -0
  39. package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
  40. package/dist/src/accounts/signing/typedData.js +2 -2
  41. package/dist/src/accounts/startale.test.js +0 -4
  42. package/dist/src/accounts/utils.d.ts +4 -4
  43. package/dist/src/accounts/utils.d.ts.map +1 -1
  44. package/dist/src/accounts/utils.js +3 -40
  45. package/dist/src/accounts/walletClient.d.ts +7 -0
  46. package/dist/src/accounts/walletClient.d.ts.map +1 -0
  47. package/dist/src/accounts/walletClient.js +38 -0
  48. package/dist/src/actions/compact.d.ts +13 -0
  49. package/dist/src/actions/compact.d.ts.map +1 -0
  50. package/dist/src/actions/compact.js +210 -0
  51. package/dist/src/actions/ecdsa.d.ts +35 -0
  52. package/dist/src/actions/ecdsa.d.ts.map +1 -0
  53. package/dist/src/actions/ecdsa.js +114 -0
  54. package/dist/src/actions/ecdsa.test.d.ts +2 -0
  55. package/dist/src/actions/ecdsa.test.d.ts.map +1 -0
  56. package/dist/src/actions/ecdsa.test.js +99 -0
  57. package/dist/src/actions/index.d.ts +23 -166
  58. package/dist/src/actions/index.d.ts.map +1 -1
  59. package/dist/src/actions/index.js +25 -544
  60. package/dist/src/actions/mfa.d.ts +37 -0
  61. package/dist/src/actions/mfa.d.ts.map +1 -0
  62. package/dist/src/actions/mfa.js +133 -0
  63. package/dist/src/actions/passkeys.d.ts +37 -0
  64. package/dist/src/actions/passkeys.d.ts.map +1 -0
  65. package/dist/src/actions/passkeys.js +129 -0
  66. package/dist/src/actions/passkeys.test.d.ts +2 -0
  67. package/dist/src/actions/passkeys.test.d.ts.map +1 -0
  68. package/dist/src/actions/passkeys.test.js +54 -0
  69. package/dist/src/actions/recovery.d.ts +33 -0
  70. package/dist/src/actions/recovery.d.ts.map +1 -0
  71. package/dist/src/actions/recovery.js +193 -0
  72. package/dist/src/actions/recovery.test.d.ts +2 -0
  73. package/dist/src/actions/recovery.test.d.ts.map +1 -0
  74. package/dist/src/actions/recovery.test.js +168 -0
  75. package/dist/src/actions/smart-sessions.d.ts +23 -0
  76. package/dist/src/actions/smart-sessions.d.ts.map +1 -0
  77. package/dist/src/actions/{smart-session.js → smart-sessions.js} +13 -0
  78. package/dist/src/errors/index.d.ts +5 -0
  79. package/dist/src/errors/index.d.ts.map +1 -0
  80. package/dist/src/errors/index.js +50 -0
  81. package/dist/src/execution/compact.d.ts +25 -9
  82. package/dist/src/execution/compact.d.ts.map +1 -1
  83. package/dist/src/execution/compact.js +29 -103
  84. package/dist/src/execution/error.d.ts +6 -6
  85. package/dist/src/execution/error.d.ts.map +1 -1
  86. package/dist/src/execution/error.js +13 -13
  87. package/dist/src/execution/index.d.ts +34 -22
  88. package/dist/src/execution/index.d.ts.map +1 -1
  89. package/dist/src/execution/index.js +115 -46
  90. package/dist/src/execution/multiChainOps.d.ts +40 -0
  91. package/dist/src/execution/multiChainOps.d.ts.map +1 -0
  92. package/dist/src/execution/multiChainOps.js +39 -0
  93. package/dist/src/execution/permit2.d.ts +148 -0
  94. package/dist/src/execution/permit2.d.ts.map +1 -0
  95. package/dist/src/execution/permit2.js +291 -0
  96. package/dist/src/execution/smart-session.d.ts +3 -3
  97. package/dist/src/execution/smart-session.d.ts.map +1 -1
  98. package/dist/src/execution/smart-session.js +3 -3
  99. package/dist/src/execution/types.d.ts +36 -0
  100. package/dist/src/execution/types.d.ts.map +1 -0
  101. package/dist/src/execution/types.js +2 -0
  102. package/dist/src/execution/utils.d.ts +43 -28
  103. package/dist/src/execution/utils.d.ts.map +1 -1
  104. package/dist/src/execution/utils.js +269 -99
  105. package/dist/src/index.d.ts +38 -19
  106. package/dist/src/index.d.ts.map +1 -1
  107. package/dist/src/index.js +121 -69
  108. package/dist/src/modules/common.d.ts +10 -4
  109. package/dist/src/modules/common.d.ts.map +1 -1
  110. package/dist/src/modules/common.js +22 -1
  111. package/dist/src/modules/index.d.ts +3 -2
  112. package/dist/src/modules/index.d.ts.map +1 -1
  113. package/dist/src/modules/index.js +16 -13
  114. package/dist/src/modules/index.test.js +9 -12
  115. package/dist/src/modules/read.d.ts.map +1 -1
  116. package/dist/src/modules/read.js +5 -1
  117. package/dist/src/modules/validators/core.d.ts +5 -3
  118. package/dist/src/modules/validators/core.d.ts.map +1 -1
  119. package/dist/src/modules/validators/core.js +29 -10
  120. package/dist/src/modules/validators/core.test.js +4 -4
  121. package/dist/src/modules/validators/smart-sessions.d.ts +4 -4
  122. package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
  123. package/dist/src/modules/validators/smart-sessions.js +10 -72
  124. package/dist/src/modules/validators/smart-sessions.test.js +4 -8
  125. package/dist/src/modules/validators/webauthn-contract.d.ts.map +1 -1
  126. package/dist/src/orchestrator/client.d.ts +4 -2
  127. package/dist/src/orchestrator/client.d.ts.map +1 -1
  128. package/dist/src/orchestrator/client.js +230 -162
  129. package/dist/src/orchestrator/consts.d.ts +1 -2
  130. package/dist/src/orchestrator/consts.d.ts.map +1 -1
  131. package/dist/src/orchestrator/consts.js +1 -3
  132. package/dist/src/orchestrator/error.d.ts +111 -1
  133. package/dist/src/orchestrator/error.d.ts.map +1 -1
  134. package/dist/src/orchestrator/error.js +128 -1
  135. package/dist/src/orchestrator/index.d.ts +4 -4
  136. package/dist/src/orchestrator/index.d.ts.map +1 -1
  137. package/dist/src/orchestrator/index.js +16 -1
  138. package/dist/src/orchestrator/registry.d.ts +3 -25
  139. package/dist/src/orchestrator/registry.d.ts.map +1 -1
  140. package/dist/src/orchestrator/registry.js +82 -46
  141. package/dist/src/orchestrator/registry.test.js +7 -7
  142. package/dist/src/orchestrator/types.d.ts +53 -43
  143. package/dist/src/orchestrator/types.d.ts.map +1 -1
  144. package/dist/src/types.d.ts +74 -9
  145. package/dist/src/types.d.ts.map +1 -1
  146. package/dist/src/utils/index.d.ts +3 -0
  147. package/dist/src/utils/index.d.ts.map +1 -0
  148. package/dist/src/utils/index.js +5 -0
  149. package/package.json +73 -2
  150. package/dist/src/actions/index.test.d.ts +0 -2
  151. package/dist/src/actions/index.test.d.ts.map +0 -1
  152. package/dist/src/actions/index.test.js +0 -302
  153. package/dist/src/actions/smart-session.d.ts +0 -11
  154. package/dist/src/actions/smart-session.d.ts.map +0 -1
  155. package/dist/src/orchestrator/registry.json +0 -365
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.experimental_getModuleSetup = void 0;
4
+ const modules_1 = require("../modules");
5
+ Object.defineProperty(exports, "experimental_getModuleSetup", { enumerable: true, get: function () { return modules_1.getSetup; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charterlabs/rhinestone-sdk",
3
- "version": "0.2.7-dev.3",
3
+ "version": "0.2.8",
4
4
  "description": "Rhinestone SDK for Charter Labs",
5
5
  "author": {
6
6
  "name": "Charter Labs",
@@ -19,6 +19,76 @@
19
19
  "types": "./dist/src/index.d.ts",
20
20
  "import": "./dist/src/index.js",
21
21
  "require": "./dist/src/index.js"
22
+ },
23
+ "./actions": {
24
+ "types": "./dist/src/actions/index.d.ts",
25
+ "import": "./dist/src/actions/index.js",
26
+ "require": "./dist/src/actions/index.js"
27
+ },
28
+ "./actions/compact": {
29
+ "types": "./dist/src/actions/compact.d.ts",
30
+ "import": "./dist/src/actions/compact.js",
31
+ "require": "./dist/src/actions/compact.js"
32
+ },
33
+ "./actions/ecdsa": {
34
+ "types": "./dist/src/actions/ecdsa.d.ts",
35
+ "import": "./dist/src/actions/ecdsa.js",
36
+ "require": "./dist/src/actions/ecdsa.js"
37
+ },
38
+ "./actions/mfa": {
39
+ "types": "./dist/src/actions/mfa.d.ts",
40
+ "import": "./dist/src/actions/mfa.js",
41
+ "require": "./dist/src/actions/mfa.js"
42
+ },
43
+ "./actions/passkeys": {
44
+ "types": "./dist/src/actions/passkeys.d.ts",
45
+ "import": "./dist/src/actions/passkeys.js",
46
+ "require": "./dist/src/actions/passkeys.js"
47
+ },
48
+ "./actions/recovery": {
49
+ "types": "./dist/src/actions/recovery.d.ts",
50
+ "import": "./dist/src/actions/recovery.js",
51
+ "require": "./dist/src/actions/recovery.js"
52
+ },
53
+ "./errors": {
54
+ "types": "./dist/src/errors/index.d.ts",
55
+ "import": "./dist/src/errors/index.js",
56
+ "require": "./dist/src/errors/index.js"
57
+ },
58
+ "./dist/src/actions": {
59
+ "types": "./dist/src/actions/index.d.ts",
60
+ "import": "./dist/src/actions/index.js",
61
+ "require": "./dist/src/actions/index.js"
62
+ },
63
+ "./dist/src/actions/compact": {
64
+ "types": "./dist/src/actions/compact.d.ts",
65
+ "import": "./dist/src/actions/compact.js",
66
+ "require": "./dist/src/actions/compact.js"
67
+ },
68
+ "./dist/src/actions/ecdsa": {
69
+ "types": "./dist/src/actions/ecdsa.d.ts",
70
+ "import": "./dist/src/actions/ecdsa.js",
71
+ "require": "./dist/src/actions/ecdsa.js"
72
+ },
73
+ "./dist/src/actions/mfa": {
74
+ "types": "./dist/src/actions/mfa.d.ts",
75
+ "import": "./dist/src/actions/mfa.js",
76
+ "require": "./dist/src/actions/mfa.js"
77
+ },
78
+ "./dist/src/actions/passkeys": {
79
+ "types": "./dist/src/actions/passkeys.d.ts",
80
+ "import": "./dist/src/actions/passkeys.js",
81
+ "require": "./dist/src/actions/passkeys.js"
82
+ },
83
+ "./dist/src/actions/recovery": {
84
+ "types": "./dist/src/actions/recovery.d.ts",
85
+ "import": "./dist/src/actions/recovery.js",
86
+ "require": "./dist/src/actions/recovery.js"
87
+ },
88
+ "./dist/src/errors": {
89
+ "types": "./dist/src/errors/index.d.ts",
90
+ "import": "./dist/src/errors/index.js",
91
+ "require": "./dist/src/errors/index.js"
22
92
  }
23
93
  },
24
94
  "files": [
@@ -36,10 +106,11 @@
36
106
  "access": "public"
37
107
  },
38
108
  "dependencies": {
109
+ "@rhinestone/shared-configs": "^1.4.4",
39
110
  "axios": "^1.7.0",
40
111
  "solady": "^0.1.21"
41
112
  },
42
113
  "peerDependencies": {
43
114
  "viem": "^2.28.0"
44
115
  }
45
- }
116
+ }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../actions/index.test.ts"],"names":[],"mappings":""}
@@ -1,302 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const viem_1 = require("viem");
4
- const chains_1 = require("viem/chains");
5
- const vitest_1 = require("vitest");
6
- const consts_1 = require("../../test/consts");
7
- const __1 = require("..");
8
- const _1 = require(".");
9
- const MOCK_OWNER_A = '0xd1aefebdceefc094f1805b241fa5e6db63a9181a';
10
- const MOCK_OWNER_B = '0xeddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817';
11
- const MOCK_OWNER_C = '0xb31e76f19defe76edc4b7eceeb4b0a2d6ddaca39';
12
- const MOCK_ACCOUNT_ADDRESS = '0x1234567890123456789012345678901234567890';
13
- const accountAddress = '0x36c03e7d593f7b2c6b06fc18b5f4e9a4a29c99b0';
14
- // Mock viem
15
- vitest_1.vi.mock('viem', async (importOriginal) => {
16
- const actual = await importOriginal();
17
- return {
18
- // @ts-ignore
19
- ...actual,
20
- createPublicClient: vitest_1.vi.fn(),
21
- };
22
- });
23
- (0, vitest_1.describe)('Actions', () => {
24
- (0, vitest_1.describe)('Install Ownable Validator', async () => {
25
- const rhinestoneAccount = await (0, __1.createRhinestoneAccount)({
26
- owners: {
27
- type: 'ecdsa',
28
- accounts: [consts_1.accountA],
29
- },
30
- rhinestoneApiKey: consts_1.MOCK_API_KEY,
31
- });
32
- (0, vitest_1.test)('1/1 Owners', () => {
33
- (0, vitest_1.expect)((0, _1.enableEcdsa)({
34
- rhinestoneAccount,
35
- owners: [MOCK_OWNER_A],
36
- })).toEqual([
37
- {
38
- to: accountAddress,
39
- value: 0n,
40
- data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e9800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a',
41
- },
42
- ]);
43
- });
44
- (0, vitest_1.test)('1/N Owners', () => {
45
- (0, vitest_1.expect)((0, _1.enableEcdsa)({
46
- rhinestoneAccount,
47
- owners: [MOCK_OWNER_A, MOCK_OWNER_B],
48
- })).toEqual([
49
- {
50
- to: accountAddress,
51
- value: 0n,
52
- data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e98000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
53
- },
54
- ]);
55
- });
56
- (0, vitest_1.test)('M/N Owners', () => {
57
- (0, vitest_1.expect)((0, _1.enableEcdsa)({
58
- rhinestoneAccount,
59
- owners: [MOCK_OWNER_A, MOCK_OWNER_B, MOCK_OWNER_C],
60
- threshold: 2,
61
- })).toEqual([
62
- {
63
- to: accountAddress,
64
- value: 0n,
65
- data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e98000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000003000000000000000000000000b31e76f19defe76edc4b7eceeb4b0a2d6ddaca39000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
66
- },
67
- ]);
68
- });
69
- });
70
- (0, vitest_1.describe)('Install WebAuthn Validator', async () => {
71
- const rhinestoneAccount = await (0, __1.createRhinestoneAccount)({
72
- owners: {
73
- type: 'ecdsa',
74
- accounts: [consts_1.accountA],
75
- },
76
- rhinestoneApiKey: consts_1.MOCK_API_KEY,
77
- });
78
- (0, vitest_1.test)('', () => {
79
- (0, vitest_1.expect)((0, _1.enablePasskeys)({
80
- rhinestoneAccount,
81
- pubKey: consts_1.passkeyAccount.publicKey,
82
- authenticatorId: consts_1.passkeyAccount.id,
83
- })).toEqual([
84
- {
85
- to: accountAddress,
86
- value: 0n,
87
- data: '0x9517e29f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000578c4cb0e472a5462da43c495c3f33000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d10000000000000000000000000000000000000000000000000000000000000000',
88
- },
89
- ]);
90
- });
91
- });
92
- (0, vitest_1.describe)('Uninstall Ownable Validator', async () => {
93
- const rhinestoneAccount = await (0, __1.createRhinestoneAccount)({
94
- owners: {
95
- type: 'ecdsa',
96
- accounts: [consts_1.accountA],
97
- },
98
- rhinestoneApiKey: consts_1.MOCK_API_KEY,
99
- });
100
- (0, vitest_1.test)('', () => {
101
- (0, vitest_1.expect)((0, _1.disableEcdsa)({
102
- rhinestoneAccount,
103
- })).toEqual([
104
- {
105
- to: accountAddress,
106
- value: 0n,
107
- data: '0xa71763a80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e9800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000',
108
- },
109
- ]);
110
- });
111
- });
112
- (0, vitest_1.describe)('Uninstall WebAuthn Validator', async () => {
113
- const rhinestoneAccount = await (0, __1.createRhinestoneAccount)({
114
- owners: {
115
- type: 'ecdsa',
116
- accounts: [consts_1.accountA],
117
- },
118
- rhinestoneApiKey: consts_1.MOCK_API_KEY,
119
- });
120
- (0, vitest_1.test)('', () => {
121
- (0, vitest_1.expect)((0, _1.disablePasskeys)({
122
- rhinestoneAccount,
123
- })).toEqual([
124
- {
125
- to: accountAddress,
126
- value: 0n,
127
- data: '0xa71763a800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000578c4cb0e472a5462da43c495c3f3300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000',
128
- },
129
- ]);
130
- });
131
- });
132
- (0, vitest_1.describe)('Add Owner', () => {
133
- (0, vitest_1.test)('', () => {
134
- (0, vitest_1.expect)((0, _1.addOwner)(MOCK_OWNER_A)).toEqual({
135
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
136
- value: 0n,
137
- data: '0x7065cb48000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a',
138
- });
139
- });
140
- });
141
- (0, vitest_1.describe)('Remove Owner', () => {
142
- (0, vitest_1.test)('', () => {
143
- (0, vitest_1.expect)((0, _1.removeOwner)(MOCK_OWNER_A, MOCK_OWNER_B)).toEqual({
144
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
145
- value: 0n,
146
- data: '0xfbe5ce0a000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
147
- });
148
- });
149
- });
150
- (0, vitest_1.describe)('Set Threshold', () => {
151
- (0, vitest_1.test)('', () => {
152
- (0, vitest_1.expect)((0, _1.changeThreshold)(1)).toEqual({
153
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
154
- value: 0n,
155
- data: '0x960bfe040000000000000000000000000000000000000000000000000000000000000001',
156
- });
157
- });
158
- });
159
- (0, vitest_1.describe)('Set Up Recovery', async () => {
160
- const rhinestoneAccount = await (0, __1.createRhinestoneAccount)({
161
- owners: {
162
- type: 'ecdsa',
163
- accounts: [consts_1.accountA],
164
- },
165
- rhinestoneApiKey: consts_1.MOCK_API_KEY,
166
- });
167
- (0, vitest_1.test)('Single Guardian', () => {
168
- (0, vitest_1.expect)((0, _1.setUpRecovery)({
169
- rhinestoneAccount,
170
- guardians: [consts_1.accountB],
171
- threshold: 1,
172
- })).toEqual([
173
- {
174
- to: accountAddress,
175
- value: 0n,
176
- data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a04d053b3c8021e8d5bf641816c42daa75d8b597000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7',
177
- },
178
- ]);
179
- });
180
- (0, vitest_1.test)('Guardian Multi-Sig', () => {
181
- (0, vitest_1.expect)((0, _1.setUpRecovery)({
182
- rhinestoneAccount,
183
- guardians: [consts_1.accountB, consts_1.accountC, consts_1.accountD],
184
- threshold: 2,
185
- })).toEqual([
186
- {
187
- to: accountAddress,
188
- value: 0n,
189
- data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a04d053b3c8021e8d5bf641816c42daa75d8b597000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000030000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000c27b7578151c5ef713c62c65db09763d57ac3596000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
190
- },
191
- ]);
192
- });
193
- });
194
- (0, vitest_1.describe)('Recover', () => {
195
- const mockPublicClient = {
196
- readContract: vitest_1.vi.fn(),
197
- multicall: vitest_1.vi.fn(),
198
- };
199
- (0, vitest_1.beforeEach)(() => {
200
- const createPublicClientMock = viem_1.createPublicClient;
201
- createPublicClientMock.mockReturnValue(mockPublicClient);
202
- vitest_1.vi.clearAllMocks();
203
- });
204
- (0, vitest_1.test)('1/1 Owners - Single owner to different single owner', async () => {
205
- // Initial state
206
- mockPublicClient.multicall.mockResolvedValueOnce([
207
- { result: [consts_1.accountA.address.toLowerCase()], status: 'success' },
208
- { result: 1n, status: 'success' },
209
- ]);
210
- const newOwners = {
211
- type: 'ecdsa',
212
- accounts: [consts_1.accountB],
213
- threshold: 1,
214
- };
215
- const result = await (0, _1.recover)(MOCK_ACCOUNT_ADDRESS, newOwners, chains_1.base);
216
- (0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
217
- (0, vitest_1.expect)(result).toEqual([
218
- {
219
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
220
- value: 0n,
221
- data: '0x7065cb480000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7',
222
- },
223
- {
224
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
225
- value: 0n,
226
- data: '0xfbe5ce0a0000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
227
- },
228
- ]);
229
- });
230
- (0, vitest_1.test)('1/N Owners - Single owner to multiple owners', async () => {
231
- // Initial state
232
- mockPublicClient.multicall.mockResolvedValueOnce([
233
- {
234
- result: [
235
- consts_1.accountA.address.toLowerCase(),
236
- consts_1.accountB.address.toLowerCase(),
237
- consts_1.accountC.address.toLowerCase(),
238
- ],
239
- status: 'success',
240
- },
241
- { result: 1n, status: 'success' },
242
- ]);
243
- const newOwners = {
244
- type: 'ecdsa',
245
- accounts: [consts_1.accountB, consts_1.accountC, consts_1.accountD],
246
- threshold: 1,
247
- };
248
- const result = await (0, _1.recover)(MOCK_ACCOUNT_ADDRESS, newOwners, chains_1.base);
249
- (0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
250
- (0, vitest_1.expect)(result).toEqual([
251
- {
252
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
253
- value: 0n,
254
- data: '0x7065cb48000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
255
- },
256
- {
257
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
258
- value: 0n,
259
- data: '0xfbe5ce0a000000000000000000000000c5587d912c862252599b61926adaef316ba06da0000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
260
- },
261
- ]);
262
- });
263
- (0, vitest_1.test)('M/N Owners - Multiple owners to different multiple owners', async () => {
264
- // Initial state
265
- mockPublicClient.multicall.mockResolvedValueOnce([
266
- {
267
- result: [
268
- consts_1.accountA.address.toLowerCase(),
269
- consts_1.accountB.address.toLowerCase(),
270
- consts_1.accountC.address.toLowerCase(),
271
- ],
272
- status: 'success',
273
- },
274
- { result: 2n, status: 'success' },
275
- ]);
276
- const newOwners = {
277
- type: 'ecdsa',
278
- accounts: [consts_1.accountB, consts_1.accountD],
279
- threshold: 2,
280
- };
281
- const result = await (0, _1.recover)(MOCK_ACCOUNT_ADDRESS, newOwners, chains_1.base);
282
- (0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
283
- (0, vitest_1.expect)(result).toEqual([
284
- {
285
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
286
- value: 0n,
287
- data: '0x7065cb48000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
288
- },
289
- {
290
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
291
- value: 0n,
292
- data: '0xfbe5ce0a000000000000000000000000c5587d912c862252599b61926adaef316ba06da0000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
293
- },
294
- {
295
- to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
296
- value: 0n,
297
- data: '0xfbe5ce0a0000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000c27b7578151c5ef713c62c65db09763d57ac3596',
298
- },
299
- ]);
300
- });
301
- });
302
- });
@@ -1,11 +0,0 @@
1
- import type { Hex } from 'viem';
2
- import type { SessionDetails } from '../execution/smart-session';
3
- /**
4
- * Encode a smart session signature
5
- * @param sessionDetails Session details
6
- * @param sessionSignature Session signature
7
- * @returns Encoded smart session signature
8
- */
9
- declare function encodeSmartSessionSignature(sessionDetails: SessionDetails, sessionSignature: Hex): `0x${string}`;
10
- export { encodeSmartSessionSignature };
11
- //# sourceMappingURL=smart-session.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"smart-session.d.ts","sourceRoot":"","sources":["../../../actions/smart-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAGhE;;;;;GAKG;AACH,iBAAS,2BAA2B,CAClC,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,GAAG,iBAQtB;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAA"}