@rhinestone/sdk 2.0.0 → 2.1.0

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 (50) hide show
  1. package/dist/src/accounts/adapters/hca.d.ts.map +1 -1
  2. package/dist/src/accounts/adapters/hca.js +4 -1
  3. package/dist/src/actions/ecdsa.d.ts +1 -1
  4. package/dist/src/actions/ecdsa.d.ts.map +1 -1
  5. package/dist/src/actions/ecdsa.js +4 -57
  6. package/dist/src/actions/ownable.d.ts +6 -0
  7. package/dist/src/actions/ownable.d.ts.map +1 -0
  8. package/dist/src/actions/ownable.js +63 -0
  9. package/dist/src/actions/passkeys.d.ts.map +1 -1
  10. package/dist/src/actions/passkeys.js +4 -64
  11. package/dist/src/actions/recovery.d.ts +67 -0
  12. package/dist/src/actions/recovery.d.ts.map +1 -0
  13. package/dist/src/actions/recovery.js +134 -0
  14. package/dist/src/actions/runtime.d.ts +5 -0
  15. package/dist/src/actions/runtime.d.ts.map +1 -1
  16. package/dist/src/actions/runtime.js +25 -1
  17. package/dist/src/actions/webauthn.d.ts +6 -0
  18. package/dist/src/actions/webauthn.d.ts.map +1 -0
  19. package/dist/src/actions/webauthn.js +67 -0
  20. package/dist/src/api/account.d.ts.map +1 -1
  21. package/dist/src/api/account.js +3 -2
  22. package/dist/src/api/compose.d.ts.map +1 -1
  23. package/dist/src/api/compose.js +6 -0
  24. package/dist/src/api/signer-selection.d.ts +13 -0
  25. package/dist/src/api/signer-selection.d.ts.map +1 -1
  26. package/dist/src/api/signer-selection.js +50 -0
  27. package/dist/src/clients/orchestrator/client.js +1 -1
  28. package/dist/src/clients/orchestrator/public.d.ts +13 -5
  29. package/dist/src/clients/orchestrator/public.d.ts.map +1 -1
  30. package/dist/src/config/account.d.ts +26 -2
  31. package/dist/src/config/account.d.ts.map +1 -1
  32. package/dist/src/config/input.d.ts +5 -0
  33. package/dist/src/config/input.d.ts.map +1 -1
  34. package/dist/src/config/resolve.d.ts.map +1 -1
  35. package/dist/src/config/resolve.js +27 -1
  36. package/dist/src/errors/execution.d.ts +8 -1
  37. package/dist/src/errors/execution.d.ts.map +1 -1
  38. package/dist/src/errors/execution.js +9 -1
  39. package/dist/src/errors/index.d.ts +2 -2
  40. package/dist/src/errors/index.d.ts.map +1 -1
  41. package/dist/src/errors/index.js +2 -2
  42. package/dist/src/index.d.ts +1 -1
  43. package/dist/src/index.d.ts.map +1 -1
  44. package/dist/src/modules/read-core.d.ts +23 -0
  45. package/dist/src/modules/read-core.d.ts.map +1 -1
  46. package/dist/src/modules/read-core.js +58 -1
  47. package/dist/src/modules/validators/social-recovery.d.ts +16 -0
  48. package/dist/src/modules/validators/social-recovery.d.ts.map +1 -0
  49. package/dist/src/modules/validators/social-recovery.js +17 -0
  50. package/package.json +5 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAA;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAA;AAE1E,OAAO,EACL,aAAa,EAEb,gBAAgB,EAChB,aAAa,EACb,WAAW,EAEX,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,GAC/B,CAAA;AAED,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACxE,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,WAAW,GACZ,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,eAAe,EACf,SAAS,EACT,eAAe,EACf,KAAK,EACL,eAAe,EACf,qBAAqB,EACrB,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,+BAA+B,CAAA;AACtC,YAAY,EACV,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,IAAI,EACJ,SAAS,EACT,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,EAChB,yBAAyB,EACzB,OAAO,EACP,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EACf,eAAe,EACf,UAAU,EACV,wBAAwB,EACxB,kBAAkB,EAClB,MAAM,EACN,cAAc,EACd,uBAAuB,EACvB,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,KAAK,EACL,WAAW,EACX,mCAAmC,EACnC,uBAAuB,GACxB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,8BAA8B,CAAA;AACrC,YAAY,EACV,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,sCAAsC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAA;AAClF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EACrB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,8BAA8B,CAAA;AACrC,YAAY,EACV,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,sCAAsC,CAAA"}
@@ -15,6 +15,28 @@ export declare function readValidatorInitialized(input: {
15
15
  readonly account: Address;
16
16
  readonly validator: Address;
17
17
  }): Promise<boolean>;
18
+ /**
19
+ * Reads an ownable-style validator's owner list and threshold.
20
+ *
21
+ * The owner list is returned in the validator's own linked-list order, which
22
+ * callers need to derive the `prevOwner` argument for removals.
23
+ */
24
+ export declare function readValidatorOwnership(input: {
25
+ readonly rpc: RpcReadPort;
26
+ readonly chain: EvmChainReference;
27
+ readonly account: Address;
28
+ readonly validator: Address;
29
+ }): Promise<{
30
+ readonly owners: readonly Address[];
31
+ readonly threshold: number;
32
+ }>;
33
+ /** Reads a validator's signature threshold for an account. */
34
+ export declare function readValidatorThreshold(input: {
35
+ readonly rpc: RpcReadPort;
36
+ readonly chain: EvmChainReference;
37
+ readonly account: Address;
38
+ readonly validator: Address;
39
+ }): Promise<number>;
18
40
  export declare function readModuleInstallations(input: {
19
41
  readonly rpc: RpcReadPort;
20
42
  readonly chain: EvmChainReference;
@@ -26,6 +48,7 @@ export declare function readOwners(input: {
26
48
  readonly chain: EvmChainReference;
27
49
  readonly accountKind: string;
28
50
  readonly account: Address;
51
+ readonly ownerValidator?: Address;
29
52
  readonly hcaFactory?: Address;
30
53
  }): Promise<{
31
54
  readonly accounts: readonly Address[];
@@ -1 +1 @@
1
- {"version":3,"file":"read-core.d.ts","sourceRoot":"","sources":["../../../modules/read-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAuB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAClE,OAAO,KAAK,EAAE,iBAAi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AAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B,GAAG,OAAO,CAAC;IACV,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAA;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,GAAG,IAAI,CAAC,CAmER;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,OAAO,EAAE,CAAA;CACvC,GAAG,GAAG,CAkBN"}
@@ -50,6 +50,63 @@ export async function readValidatorInitialized(input) {
50
50
  args: [input.account],
51
51
  });
52
52
  }
53
+ const validatorThresholdAbi = [
54
+ {
55
+ name: 'threshold',
56
+ type: 'function',
57
+ stateMutability: 'view',
58
+ inputs: [{ name: 'account', type: 'address' }],
59
+ outputs: [{ name: '', type: 'uint256' }],
60
+ },
61
+ ];
62
+ const validatorOwnersAbi = [
63
+ {
64
+ name: 'getOwners',
65
+ type: 'function',
66
+ stateMutability: 'view',
67
+ inputs: [{ name: 'account', type: 'address' }],
68
+ outputs: [{ name: 'ownersArray', type: 'address[]' }],
69
+ },
70
+ ];
71
+ /**
72
+ * Reads an ownable-style validator's owner list and threshold.
73
+ *
74
+ * The owner list is returned in the validator's own linked-list order, which
75
+ * callers need to derive the `prevOwner` argument for removals.
76
+ */
77
+ export async function readValidatorOwnership(input) {
78
+ const [owners, threshold] = await input.rpc.multicall({ chain: input.chain }, [
79
+ {
80
+ address: input.validator,
81
+ abi: validatorOwnersAbi,
82
+ functionName: 'getOwners',
83
+ args: [input.account],
84
+ },
85
+ {
86
+ address: input.validator,
87
+ abi: validatorThresholdAbi,
88
+ functionName: 'threshold',
89
+ args: [input.account],
90
+ },
91
+ ]);
92
+ if (!owners.result || threshold.result === undefined) {
93
+ throw new Error('Failed to read existing owners or threshold');
94
+ }
95
+ return {
96
+ owners: owners.result.map((owner) => owner.toLowerCase()),
97
+ threshold: Number(threshold.result),
98
+ };
99
+ }
100
+ /** Reads a validator's signature threshold for an account. */
101
+ export async function readValidatorThreshold(input) {
102
+ const threshold = await input.rpc.readContract({ chain: input.chain }, {
103
+ address: input.validator,
104
+ abi: validatorThresholdAbi,
105
+ functionName: 'threshold',
106
+ args: [input.account],
107
+ });
108
+ return Number(threshold);
109
+ }
53
110
  const moduleInstalledAbi = [
54
111
  {
55
112
  type: 'function',
@@ -77,7 +134,7 @@ export async function readModuleInstallations(input) {
77
134
  return results.map(({ result }) => result === true);
78
135
  }
79
136
  export async function readOwners(input) {
80
- let validator = OWNABLE_VALIDATOR_ADDRESS;
137
+ let validator = input.ownerValidator ?? OWNABLE_VALIDATOR_ADDRESS;
81
138
  if (input.accountKind === 'hca') {
82
139
  validator = input.hcaFactory
83
140
  ? await input.rpc.readContract({ chain: input.chain }, {
@@ -0,0 +1,16 @@
1
+ import type { Address } from 'viem';
2
+ import type { ResolvedModule } from '../types.js';
3
+ export declare const SOCIAL_RECOVERY_VALIDATOR_ADDRESS: Address;
4
+ /**
5
+ * Resolves the social recovery validator module.
6
+ *
7
+ * The module shares the ownable validator's `(threshold, address[])` init
8
+ * encoding and its concatenated-ECDSA signature format, so it resolves through
9
+ * the same encoder at a different address. `onInstall` requires the guardian
10
+ * list to be sorted and unique, which `resolveOwnableAddresses` guarantees.
11
+ */
12
+ export declare function resolveSocialRecoveryValidator(input: {
13
+ readonly guardians: readonly Address[];
14
+ readonly threshold?: number;
15
+ }): ResolvedModule;
16
+ //# sourceMappingURL=social-recovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-recovery.d.ts","sourceRoot":"","sources":["../../../../modules/validators/social-recovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C,eAAO,MAAM,iCAAiC,EAAE,OACF,CAAA;AAE9C;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE;IACpD,QAAQ,CAAC,SAAS,EAAE,SAAS,OAAO,EAAE,CAAA;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,GAAG,cAAc,CAMjB"}
@@ -0,0 +1,17 @@
1
+ import { resolveOwnableAddresses } from './ownable.js';
2
+ export const SOCIAL_RECOVERY_VALIDATOR_ADDRESS = '0xa04d053b3c8021e8d5bf641816c42daa75d8b597';
3
+ /**
4
+ * Resolves the social recovery validator module.
5
+ *
6
+ * The module shares the ownable validator's `(threshold, address[])` init
7
+ * encoding and its concatenated-ECDSA signature format, so it resolves through
8
+ * the same encoder at a different address. `onInstall` requires the guardian
9
+ * list to be sorted and unique, which `resolveOwnableAddresses` guarantees.
10
+ */
11
+ export function resolveSocialRecoveryValidator(input) {
12
+ return resolveOwnableAddresses({
13
+ owners: input.guardians,
14
+ threshold: input.threshold ?? 1,
15
+ address: SOCIAL_RECOVERY_VALIDATOR_ADDRESS,
16
+ });
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/sdk",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "End-to-end chain abstraction and modularity toolkit",
5
5
  "author": {
6
6
  "name": "Rhinestone",
@@ -35,6 +35,10 @@
35
35
  "types": "./dist/src/actions/passkeys.d.ts",
36
36
  "import": "./dist/src/actions/passkeys.js"
37
37
  },
38
+ "./actions/recovery": {
39
+ "types": "./dist/src/actions/recovery.d.ts",
40
+ "import": "./dist/src/actions/recovery.js"
41
+ },
38
42
  "./signing/passkeys": {
39
43
  "types": "./dist/src/signing/passkeys.d.ts",
40
44
  "import": "./dist/src/signing/passkeys.js"