@charterlabs/rhinestone-sdk 0.1.0 → 0.1.2

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 (194) hide show
  1. package/README.md +74 -181
  2. package/dist/src/accounts/error.d.ts +69 -0
  3. package/dist/src/accounts/error.d.ts.map +1 -0
  4. package/dist/src/accounts/error.js +109 -0
  5. package/dist/{accounts → src/accounts}/index.d.ts +14 -21
  6. package/dist/src/accounts/index.d.ts.map +1 -0
  7. package/dist/src/accounts/index.js +469 -0
  8. package/dist/src/accounts/index.test.d.ts +2 -0
  9. package/dist/src/accounts/index.test.d.ts.map +1 -0
  10. package/dist/src/accounts/index.test.js +36 -0
  11. package/dist/{accounts → src/accounts}/kernel.d.ts +7 -9
  12. package/dist/src/accounts/kernel.d.ts.map +1 -0
  13. package/dist/{accounts → src/accounts}/kernel.js +0 -8
  14. package/dist/src/accounts/kernel.test.d.ts +2 -0
  15. package/dist/src/accounts/kernel.test.d.ts.map +1 -0
  16. package/dist/src/accounts/kernel.test.js +105 -0
  17. package/dist/{accounts → src/accounts}/nexus.d.ts +14 -13
  18. package/dist/src/accounts/nexus.d.ts.map +1 -0
  19. package/dist/{accounts → src/accounts}/nexus.js +92 -88
  20. package/dist/src/accounts/nexus.test.d.ts +2 -0
  21. package/dist/src/accounts/nexus.test.d.ts.map +1 -0
  22. package/dist/src/accounts/nexus.test.js +87 -0
  23. package/dist/{accounts → src/accounts}/safe.d.ts +4 -6
  24. package/dist/src/accounts/safe.d.ts.map +1 -0
  25. package/dist/{accounts → src/accounts}/safe.js +20 -29
  26. package/dist/src/accounts/safe.test.d.ts +2 -0
  27. package/dist/src/accounts/safe.test.d.ts.map +1 -0
  28. package/dist/src/accounts/safe.test.js +87 -0
  29. package/dist/src/accounts/startale.d.ts +20 -0
  30. package/dist/src/accounts/startale.d.ts.map +1 -0
  31. package/dist/src/accounts/startale.js +100 -0
  32. package/dist/src/accounts/startale.test.d.ts +2 -0
  33. package/dist/src/accounts/startale.test.d.ts.map +1 -0
  34. package/dist/src/accounts/startale.test.js +99 -0
  35. package/dist/{accounts → src/accounts}/utils.d.ts +4 -3
  36. package/dist/src/accounts/utils.d.ts.map +1 -0
  37. package/dist/{accounts → src/accounts}/utils.js +44 -0
  38. package/dist/src/accounts/utils.test.d.ts +2 -0
  39. package/dist/src/accounts/utils.test.d.ts.map +1 -0
  40. package/dist/src/accounts/utils.test.js +49 -0
  41. package/dist/src/actions/index.d.ts +39 -0
  42. package/dist/src/actions/index.d.ts.map +1 -0
  43. package/dist/{actions → src/actions}/index.js +108 -15
  44. package/dist/src/actions/index.test.d.ts +2 -0
  45. package/dist/src/actions/index.test.d.ts.map +1 -0
  46. package/dist/src/actions/index.test.js +302 -0
  47. package/dist/{actions → src/actions}/smart-session.d.ts +2 -2
  48. package/dist/src/actions/smart-session.d.ts.map +1 -0
  49. package/dist/src/execution/compact.d.ts +8 -0
  50. package/dist/src/execution/compact.d.ts.map +1 -0
  51. package/dist/src/execution/compact.js +105 -0
  52. package/dist/src/execution/error.d.ts +54 -0
  53. package/dist/src/execution/error.d.ts.map +1 -0
  54. package/dist/src/execution/error.js +78 -0
  55. package/dist/{execution → src/execution}/index.d.ts +7 -6
  56. package/dist/src/execution/index.d.ts.map +1 -0
  57. package/dist/src/execution/index.js +150 -0
  58. package/dist/src/execution/smart-session.d.ts +15 -0
  59. package/dist/src/execution/smart-session.d.ts.map +1 -0
  60. package/dist/{execution → src/execution}/smart-session.js +16 -77
  61. package/dist/src/execution/smart-session.test.d.ts +2 -0
  62. package/dist/src/execution/smart-session.test.d.ts.map +1 -0
  63. package/dist/src/execution/smart-session.test.js +34 -0
  64. package/dist/src/execution/utils.d.ts +45 -0
  65. package/dist/src/execution/utils.d.ts.map +1 -0
  66. package/dist/src/execution/utils.js +433 -0
  67. package/dist/src/index.d.ts +41 -0
  68. package/dist/src/index.d.ts.map +1 -0
  69. package/dist/src/index.js +154 -0
  70. package/dist/src/modules/abi/smart-sessions.d.ts.map +1 -0
  71. package/dist/src/modules/common.d.ts.map +1 -0
  72. package/dist/{modules → src/modules}/index.d.ts +3 -11
  73. package/dist/src/modules/index.d.ts.map +1 -0
  74. package/dist/{modules → src/modules}/index.js +3 -45
  75. package/dist/src/modules/index.test.d.ts +2 -0
  76. package/dist/src/modules/index.test.d.ts.map +1 -0
  77. package/dist/src/modules/index.test.js +107 -0
  78. package/dist/src/modules/omni-account.d.ts +7 -0
  79. package/dist/src/modules/omni-account.d.ts.map +1 -0
  80. package/dist/src/modules/omni-account.js +11 -0
  81. package/dist/src/modules/read.d.ts +9 -0
  82. package/dist/src/modules/read.d.ts.map +1 -0
  83. package/dist/{modules → src/modules}/read.js +6 -37
  84. package/dist/{modules → src/modules}/validators/core.d.ts +6 -7
  85. package/dist/src/modules/validators/core.d.ts.map +1 -0
  86. package/dist/{modules → src/modules}/validators/core.js +83 -8
  87. package/dist/src/modules/validators/core.test.d.ts +2 -0
  88. package/dist/src/modules/validators/core.test.d.ts.map +1 -0
  89. package/dist/src/modules/validators/core.test.js +108 -0
  90. package/dist/src/modules/validators/index.d.ts +4 -0
  91. package/dist/src/modules/validators/index.d.ts.map +1 -0
  92. package/dist/{modules → src/modules}/validators/index.js +1 -3
  93. package/dist/{modules → src/modules}/validators/smart-sessions.d.ts +4 -15
  94. package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -0
  95. package/dist/{modules → src/modules}/validators/smart-sessions.js +7 -61
  96. package/dist/src/modules/validators/smart-sessions.test.d.ts +2 -0
  97. package/dist/src/modules/validators/smart-sessions.test.d.ts.map +1 -0
  98. package/dist/src/modules/validators/smart-sessions.test.js +226 -0
  99. package/dist/src/orchestrator/client.d.ts +21 -0
  100. package/dist/src/orchestrator/client.d.ts.map +1 -0
  101. package/dist/src/orchestrator/client.js +284 -0
  102. package/dist/src/orchestrator/consts.d.ts +5 -0
  103. package/dist/src/orchestrator/consts.d.ts.map +1 -0
  104. package/dist/src/orchestrator/consts.js +9 -0
  105. package/dist/src/orchestrator/error.d.ts +96 -0
  106. package/dist/src/orchestrator/error.d.ts.map +1 -0
  107. package/dist/src/orchestrator/error.js +132 -0
  108. package/dist/src/orchestrator/index.d.ts +11 -0
  109. package/dist/src/orchestrator/index.d.ts.map +1 -0
  110. package/dist/src/orchestrator/index.js +42 -0
  111. package/dist/src/orchestrator/registry.d.ts +39 -0
  112. package/dist/src/orchestrator/registry.d.ts.map +1 -0
  113. package/dist/src/orchestrator/registry.js +121 -0
  114. package/dist/src/orchestrator/registry.json +365 -0
  115. package/dist/src/orchestrator/registry.test.d.ts +2 -0
  116. package/dist/src/orchestrator/registry.test.d.ts.map +1 -0
  117. package/dist/src/orchestrator/registry.test.js +137 -0
  118. package/dist/src/orchestrator/types.d.ts +275 -0
  119. package/dist/src/orchestrator/types.d.ts.map +1 -0
  120. package/dist/src/orchestrator/types.js +19 -0
  121. package/dist/src/orchestrator/utils.d.ts +5 -0
  122. package/dist/src/orchestrator/utils.d.ts.map +1 -0
  123. package/dist/src/orchestrator/utils.js +126 -0
  124. package/dist/{types.d.ts → src/types.d.ts} +42 -21
  125. package/dist/src/types.d.ts.map +1 -0
  126. package/dist/test/consts.d.ts +10 -0
  127. package/dist/test/consts.d.ts.map +1 -0
  128. package/dist/test/consts.js +22 -0
  129. package/package.json +11 -20
  130. package/dist/accounts/index.d.ts.map +0 -1
  131. package/dist/accounts/index.js +0 -419
  132. package/dist/accounts/kernel.d.ts.map +0 -1
  133. package/dist/accounts/nexus.d.ts.map +0 -1
  134. package/dist/accounts/safe.d.ts.map +0 -1
  135. package/dist/accounts/utils.d.ts.map +0 -1
  136. package/dist/actions/index.d.ts +0 -29
  137. package/dist/actions/index.d.ts.map +0 -1
  138. package/dist/actions/registry.d.ts +0 -7
  139. package/dist/actions/registry.d.ts.map +0 -1
  140. package/dist/actions/registry.js +0 -7
  141. package/dist/actions/smart-session.d.ts.map +0 -1
  142. package/dist/execution/index.d.ts.map +0 -1
  143. package/dist/execution/index.js +0 -149
  144. package/dist/execution/smart-session.d.ts +0 -23
  145. package/dist/execution/smart-session.d.ts.map +0 -1
  146. package/dist/execution/utils.d.ts +0 -68
  147. package/dist/execution/utils.d.ts.map +0 -1
  148. package/dist/execution/utils.js +0 -482
  149. package/dist/index.d.ts +0 -38
  150. package/dist/index.d.ts.map +0 -1
  151. package/dist/index.js +0 -119
  152. package/dist/modules/abi/smart-sessions.d.ts.map +0 -1
  153. package/dist/modules/common.d.ts.map +0 -1
  154. package/dist/modules/index.d.ts.map +0 -1
  155. package/dist/modules/omni-account.d.ts +0 -9
  156. package/dist/modules/omni-account.d.ts.map +0 -1
  157. package/dist/modules/omni-account.js +0 -15
  158. package/dist/modules/read.d.ts +0 -10
  159. package/dist/modules/read.d.ts.map +0 -1
  160. package/dist/modules/registry.d.ts +0 -9
  161. package/dist/modules/registry.d.ts.map +0 -1
  162. package/dist/modules/registry.js +0 -60
  163. package/dist/modules/validators/core.d.ts.map +0 -1
  164. package/dist/modules/validators/index.d.ts +0 -4
  165. package/dist/modules/validators/index.d.ts.map +0 -1
  166. package/dist/modules/validators/smart-sessions.d.ts.map +0 -1
  167. package/dist/orchestrator/client.d.ts +0 -29
  168. package/dist/orchestrator/client.d.ts.map +0 -1
  169. package/dist/orchestrator/client.js +0 -250
  170. package/dist/orchestrator/consts.d.ts +0 -5
  171. package/dist/orchestrator/consts.d.ts.map +0 -1
  172. package/dist/orchestrator/consts.js +0 -9
  173. package/dist/orchestrator/error.d.ts +0 -18
  174. package/dist/orchestrator/error.d.ts.map +0 -1
  175. package/dist/orchestrator/error.js +0 -33
  176. package/dist/orchestrator/index.d.ts +0 -11
  177. package/dist/orchestrator/index.d.ts.map +0 -1
  178. package/dist/orchestrator/index.js +0 -40
  179. package/dist/orchestrator/registry.d.ts +0 -20
  180. package/dist/orchestrator/registry.d.ts.map +0 -1
  181. package/dist/orchestrator/registry.js +0 -444
  182. package/dist/orchestrator/types.d.ts +0 -242
  183. package/dist/orchestrator/types.d.ts.map +0 -1
  184. package/dist/orchestrator/types.js +0 -19
  185. package/dist/orchestrator/utils.d.ts +0 -29
  186. package/dist/orchestrator/utils.d.ts.map +0 -1
  187. package/dist/orchestrator/utils.js +0 -319
  188. package/dist/types.d.ts.map +0 -1
  189. /package/dist/{actions → src/actions}/smart-session.js +0 -0
  190. /package/dist/{modules → src/modules}/abi/smart-sessions.d.ts +0 -0
  191. /package/dist/{modules → src/modules}/abi/smart-sessions.js +0 -0
  192. /package/dist/{modules → src/modules}/common.d.ts +0 -0
  193. /package/dist/{modules → src/modules}/common.js +0 -0
  194. /package/dist/{types.js → src/types.js} +0 -0
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SAME_CHAIN_MODULE_ADDRESS = exports.TARGET_MODULE_ADDRESS = exports.HOOK_ADDRESS = exports.RHINESTONE_ATTESTER_ADDRESS = exports.RHINESTONE_MODULE_REGISTRY_ADDRESS = exports.OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS = void 0;
4
- const OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS = '0x6D0515e8E499468DCe9583626f0cA15b887f9d03';
5
- exports.OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS = OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS;
6
- const RHINESTONE_MODULE_REGISTRY_ADDRESS = '0x000000000069e2a187aeffb852bf3ccdc95151b2';
7
- exports.RHINESTONE_MODULE_REGISTRY_ADDRESS = RHINESTONE_MODULE_REGISTRY_ADDRESS;
8
- const RHINESTONE_ATTESTER_ADDRESS = '0x000000333034E9f539ce08819E12c1b8Cb29084d';
9
- exports.RHINESTONE_ATTESTER_ADDRESS = RHINESTONE_ATTESTER_ADDRESS;
10
- const HOOK_ADDRESS = '0x0000000000f6Ed8Be424d673c63eeFF8b9267420';
11
- exports.HOOK_ADDRESS = HOOK_ADDRESS;
12
- const TARGET_MODULE_ADDRESS = '0x0000000000E5a37279A001301A837a91b5de1D5E';
13
- exports.TARGET_MODULE_ADDRESS = TARGET_MODULE_ADDRESS;
14
- const SAME_CHAIN_MODULE_ADDRESS = '0x000000000043ff16d5776c7F0f65Ec485C17Ca04';
15
- exports.SAME_CHAIN_MODULE_ADDRESS = SAME_CHAIN_MODULE_ADDRESS;
@@ -1,10 +0,0 @@
1
- import { Address, Chain } from 'viem';
2
- import { AccountType } from '../types';
3
- declare function getValidators(accountType: AccountType, account: Address, chain: Chain): Promise<Address[]>;
4
- declare function getOwners(account: Address, chain: Chain): Promise<{
5
- accounts: Address[];
6
- threshold: number;
7
- } | null>;
8
- declare function areAttestersTrusted(account: Address, chain: Chain): Promise<boolean>;
9
- export { getValidators, getOwners, areAttestersTrusted };
10
- //# sourceMappingURL=read.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../modules/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAwC,MAAM,MAAM,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAKtC,iBAAe,aAAa,CAC1B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,OAAO,EAAE,CAAC,CA6CpB;AAED,iBAAe,SAAS,CACtB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,OAAO,CAAC;IACT,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,CAkER;AAED,iBAAe,mBAAmB,CAChC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,OAAO,CAAC,CA+BlB;AAED,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAA"}
@@ -1,9 +0,0 @@
1
- import { Address, PublicClient } from 'viem';
2
- import { RhinestoneAccountConfig } from '../types';
3
- declare function getTrustAttesterCall(config: RhinestoneAccountConfig): {
4
- to: `0x${string}`;
5
- data: `0x${string}`;
6
- };
7
- declare function getTrustedAttesters(client: PublicClient, account: Address): Promise<readonly Address[]>;
8
- export { getTrustAttesterCall, getTrustedAttesters };
9
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../modules/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsB,YAAY,EAAE,MAAM,MAAM,CAAA;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAIlD,iBAAS,oBAAoB,CAAC,MAAM,EAAE,uBAAuB;;;EA0B5D;AAED,iBAAe,mBAAmB,CAChC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAyB7B;AAED,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAA"}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTrustAttesterCall = getTrustAttesterCall;
4
- exports.getTrustedAttesters = getTrustedAttesters;
5
- const viem_1 = require("viem");
6
- const _1 = require(".");
7
- const omni_account_1 = require("./omni-account");
8
- function getTrustAttesterCall(config) {
9
- const moduleSetup = (0, _1.getSetup)(config);
10
- return {
11
- to: omni_account_1.RHINESTONE_MODULE_REGISTRY_ADDRESS,
12
- data: (0, viem_1.encodeFunctionData)({
13
- abi: [
14
- {
15
- name: 'trustAttesters',
16
- type: 'function',
17
- inputs: [
18
- {
19
- name: 'threshold',
20
- type: 'uint8',
21
- },
22
- {
23
- name: 'attesters',
24
- type: 'address[]',
25
- },
26
- ],
27
- outputs: [],
28
- },
29
- ],
30
- functionName: 'trustAttesters',
31
- args: [moduleSetup.threshold, moduleSetup.attesters],
32
- }),
33
- };
34
- }
35
- async function getTrustedAttesters(client, account) {
36
- return await client.readContract({
37
- address: omni_account_1.RHINESTONE_MODULE_REGISTRY_ADDRESS,
38
- abi: [
39
- {
40
- type: 'function',
41
- stateMutability: 'view',
42
- name: 'findTrustedAttesters',
43
- inputs: [
44
- {
45
- type: 'address',
46
- name: 'smartAccount',
47
- },
48
- ],
49
- outputs: [
50
- {
51
- type: 'address[]',
52
- name: 'attesters',
53
- },
54
- ],
55
- },
56
- ],
57
- functionName: 'findTrustedAttesters',
58
- args: [account],
59
- });
60
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../modules/validators/core.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,OAAO,EAIZ,KAAK,GAAG,EAET,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAEpE,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AAEjE,UAAU,SAAS;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,SAAS,GAAG,GAAG,GAAG,UAAU,CAAA;IACpC,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,QAAA,MAAM,yBAAyB,EAAE,OACa,CAAA;AAC9C,QAAA,MAAM,0BAA0B,EAAE,OACY,CAAA;AAU9C,iBAAS,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,UAEzD;AAED,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAUjD;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,QAAQ,UAarC;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,MAAM,GACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,OAAO,EAAE,CAAA;CAClB,GAAG,MAAM,CAiBT;AAED,iBAAS,oBAAoB,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,MAAM,CAgD5E;AAED,iBAAS,0BAA0B,CACjC,SAAS,EAAE,OAAO,EAAE,EACpB,SAAS,SAAI,GACZ,MAAM,CAsBR;AAeD,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,YAAY,EACZ,gBAAgB,GACjB,CAAA;AACD,YAAY,EAAE,kBAAkB,EAAE,CAAA"}
@@ -1,4 +0,0 @@
1
- import { getMockSignature, getOwnerValidator } from './core';
2
- import { encodeSmartSessionSignature, getAccountEIP712Domain, getEnableSessionCall, getPermissionId, getSessionAllowedERC7739Content, getSmartSessionValidator, isSessionEnabled, SMART_SESSION_MODE_ENABLE, SMART_SESSION_MODE_USE, SMART_SESSIONS_VALIDATOR_ADDRESS } from './smart-sessions';
3
- export { SMART_SESSION_MODE_USE, SMART_SESSION_MODE_ENABLE, SMART_SESSIONS_VALIDATOR_ADDRESS, getOwnerValidator, getSmartSessionValidator, getEnableSessionCall, encodeSmartSessionSignature, getPermissionId, getMockSignature, getAccountEIP712Domain, isSessionEnabled, getSessionAllowedERC7739Content, };
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,+BAA+B,EAC/B,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,EACtB,gCAAgC,EACjC,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,gCAAgC,EAChC,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,+BAA+B,GAChC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../modules/validators/smart-sessions.ts"],"names":[],"mappings":"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"}
@@ -1,29 +0,0 @@
1
- import { type Address, type Hex } from 'viem';
2
- import type { UserOperation } from 'viem/account-abstraction';
3
- import type { BundleEvent, BundleResult, MetaIntent, OrderCostResult, OrderFeeInput, OrderPath, PostOrderBundleResult, SignedMultiChainCompact, UserTokenBalance } from './types';
4
- export declare class Orchestrator {
5
- private serverUrl;
6
- private apiKey;
7
- constructor(serverUrl: string, apiKey: string);
8
- getPortfolio(userAddress: Address, filter?: {
9
- chainIds?: number[];
10
- tokens?: {
11
- [chainId: number]: Address[];
12
- };
13
- }): Promise<UserTokenBalance[]>;
14
- getMaxTokenAmount(userAddress: Address, targetChainId: number, targetTokenAddress: Address, targetGasUnits: bigint): Promise<bigint>;
15
- getIntentCost(intent: OrderFeeInput, userAddress: Address): Promise<OrderCostResult>;
16
- getOrderPath(intent: MetaIntent, userAddress: Address): Promise<OrderPath>;
17
- postSignedOrderBundle(signedOrderBundles: {
18
- signedOrderBundle: SignedMultiChainCompact;
19
- initCode?: Hex;
20
- userOp?: UserOperation;
21
- }[]): Promise<PostOrderBundleResult>;
22
- getBundleStatus(bundleId: bigint): Promise<BundleResult>;
23
- getPendingBundles(count?: number, offset?: number): Promise<{
24
- pendingBundles: BundleEvent[];
25
- nextOffset?: number;
26
- }>;
27
- private parseError;
28
- }
29
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../orchestrator/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAU,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAG7D,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAEZ,UAAU,EAEV,eAAe,EACf,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EAEvB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAShB,qBAAa,YAAY;IACvB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,MAAM,CAAQ;gBAEV,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAKvC,YAAY,CAChB,WAAW,EAAE,OAAO,EACpB,MAAM,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,MAAM,CAAC,EAAE;YACP,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;SAC7B,CAAA;KACF,GACA,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAwCxB,iBAAiB,CACrB,WAAW,EAAE,OAAO,EACpB,aAAa,EAAE,MAAM,EACrB,kBAAkB,EAAE,OAAO,EAC3B,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC;IAgCZ,aAAa,CACjB,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,eAAe,CAAC;IAqBrB,YAAY,CAChB,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,SAAS,CAAC;IAgCf,qBAAqB,CACzB,kBAAkB,EAAE;QAClB,iBAAiB,EAAE,uBAAuB,CAAA;QAC1C,QAAQ,CAAC,EAAE,GAAG,CAAA;QACd,MAAM,CAAC,EAAE,aAAa,CAAA;KACvB,EAAE,GACF,OAAO,CAAC,qBAAqB,CAAC;IA2C3B,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAyBxD,iBAAiB,CACrB,KAAK,GAAE,MAAW,EAClB,MAAM,GAAE,MAAU,GACjB,OAAO,CAAC;QAAE,cAAc,EAAE,WAAW,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAuBlE,OAAO,CAAC,UAAU;CA6DnB"}
@@ -1,250 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Orchestrator = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- const viem_1 = require("viem");
9
- const error_1 = require("./error");
10
- const utils_1 = require("./utils");
11
- class Orchestrator {
12
- serverUrl;
13
- apiKey;
14
- constructor(serverUrl, apiKey) {
15
- this.serverUrl = serverUrl;
16
- this.apiKey = apiKey;
17
- }
18
- async getPortfolio(userAddress, filter) {
19
- try {
20
- const response = await axios_1.default.get(`${this.serverUrl}/accounts/${userAddress}/portfolio`, {
21
- params: {
22
- chainIds: filter?.chainIds?.join(','),
23
- tokens: filter?.tokens
24
- ? Object.entries(filter.tokens)
25
- .map(([chainId, tokens]) => tokens.map((token) => `${chainId}:${token}`))
26
- .reduce(viem_1.concat, [])
27
- : undefined,
28
- },
29
- headers: {
30
- 'x-api-key': this.apiKey,
31
- },
32
- });
33
- return response.data.portfolio.map((balance) => {
34
- return {
35
- ...balance,
36
- balance: BigInt(balance.balance),
37
- tokenChainBalance: balance.tokenChainBalance.map((chainBalance) => {
38
- return {
39
- ...chainBalance,
40
- balance: BigInt(chainBalance.balance),
41
- };
42
- }),
43
- };
44
- });
45
- }
46
- catch (error) {
47
- this.parseError(error);
48
- throw new Error('Failed to get portfolio');
49
- }
50
- }
51
- async getMaxTokenAmount(userAddress, targetChainId, targetTokenAddress, targetGasUnits) {
52
- const intentCost = await this.getIntentCost({
53
- targetChainId,
54
- targetGasUnits,
55
- tokenTransfers: [
56
- {
57
- tokenAddress: targetTokenAddress,
58
- },
59
- ],
60
- }, userAddress);
61
- if (!intentCost.hasFulfilledAll) {
62
- return 0n;
63
- }
64
- const tokenReceived = intentCost.tokensReceived.find((token) => token.tokenAddress.toLowerCase() === targetTokenAddress.toLowerCase());
65
- if (!tokenReceived) {
66
- return 0n;
67
- }
68
- const tokenAmount = tokenReceived.targetAmount;
69
- if (tokenAmount < 0n) {
70
- throw new Error(`Balance not available. Make sure the account is deployed`);
71
- }
72
- return tokenReceived.targetAmount;
73
- }
74
- async getIntentCost(intent, userAddress) {
75
- try {
76
- const response = await axios_1.default.post(`${this.serverUrl}/accounts/${userAddress}/bundles/cost`, {
77
- ...(0, utils_1.convertBigIntFields)(intent),
78
- }, {
79
- headers: {
80
- 'x-api-key': this.apiKey,
81
- },
82
- });
83
- return (0, utils_1.parseOrderCostResult)(response.data);
84
- }
85
- catch (error) {
86
- this.parseError(error);
87
- throw new Error(error);
88
- }
89
- }
90
- async getOrderPath(intent, userAddress) {
91
- try {
92
- const response = await axios_1.default.post(`${this.serverUrl}/accounts/${userAddress}/bundles/path`, {
93
- ...(0, utils_1.convertBigIntFields)(intent),
94
- }, {
95
- headers: {
96
- 'x-api-key': this.apiKey,
97
- },
98
- });
99
- return response.data.orderBundles.map((orderPath) => {
100
- return {
101
- orderBundle: (0, utils_1.parseCompactResponse)(orderPath.orderBundle),
102
- injectedExecutions: orderPath.injectedExecutions.map((exec) => {
103
- return {
104
- ...exec,
105
- value: BigInt(exec.value),
106
- };
107
- }),
108
- intentCost: (0, utils_1.parseOrderCost)(orderPath.intentCost),
109
- };
110
- });
111
- }
112
- catch (error) {
113
- this.parseError(error);
114
- throw new Error(error);
115
- }
116
- }
117
- async postSignedOrderBundle(signedOrderBundles) {
118
- try {
119
- const bundles = signedOrderBundles.map((signedOrderBundle) => {
120
- return {
121
- signedOrderBundle: (0, utils_1.convertBigIntFields)(signedOrderBundle.signedOrderBundle),
122
- initCode: signedOrderBundle.initCode,
123
- userOp: signedOrderBundle.userOp
124
- ? (0, utils_1.convertBigIntFields)(signedOrderBundle.userOp)
125
- : undefined,
126
- };
127
- });
128
- const response = await axios_1.default.post(`${this.serverUrl}/bundles`, {
129
- bundles,
130
- }, {
131
- headers: {
132
- 'x-api-key': this.apiKey,
133
- },
134
- });
135
- return response.data.bundleResults.map((bundleResult) => {
136
- return {
137
- ...bundleResult,
138
- bundleId: BigInt(bundleResult.bundleId),
139
- };
140
- });
141
- }
142
- catch (error) {
143
- this.parseError(error);
144
- throw new Error('Failed to post order bundle');
145
- }
146
- }
147
- async getBundleStatus(bundleId) {
148
- try {
149
- const response = await axios_1.default.get(`${this.serverUrl}/bundles/${bundleId.toString()}`, {
150
- headers: {
151
- 'x-api-key': this.apiKey,
152
- },
153
- });
154
- response.data.claims = response.data.claims.map((claim) => {
155
- return {
156
- ...claim,
157
- depositId: BigInt(claim.depositId),
158
- };
159
- });
160
- return response.data;
161
- }
162
- catch (error) {
163
- this.parseError(error);
164
- throw new Error('Failed to get bundle status');
165
- }
166
- }
167
- async getPendingBundles(count = 20, offset = 0) {
168
- try {
169
- const response = await axios_1.default.get(`${this.serverUrl}/bundles/events`, {
170
- params: {
171
- count,
172
- offset,
173
- },
174
- headers: {
175
- 'x-api-key': this.apiKey,
176
- },
177
- });
178
- const { events: pendingBundles, nextOffset } = response.data;
179
- return {
180
- pendingBundles: pendingBundles.map(utils_1.parsePendingBundleEvent),
181
- nextOffset,
182
- };
183
- }
184
- catch (error) {
185
- this.parseError(error);
186
- throw new Error('Failed to get pending bundles');
187
- }
188
- }
189
- parseError(error) {
190
- if (error.response) {
191
- let errorType;
192
- if (error.response.status) {
193
- switch (error.response.status) {
194
- case 400:
195
- errorType = 'Bad Request';
196
- break;
197
- case 401:
198
- errorType = 'Unauthorized';
199
- break;
200
- case 403:
201
- errorType = 'Forbidden';
202
- break;
203
- case 404:
204
- errorType = 'Not Found';
205
- break;
206
- case 409:
207
- errorType = 'Conflict';
208
- break;
209
- case 422:
210
- errorType = 'Unprocessable Entity';
211
- break;
212
- case 500:
213
- errorType = 'Internal Server Error';
214
- break;
215
- default:
216
- errorType = 'Unknown';
217
- }
218
- }
219
- let context = {};
220
- if (error.response.data) {
221
- const { errors, traceId } = error.response.data;
222
- for (const err of errors) {
223
- let errorMessage = `Rhinestone Error: ${err.message}`;
224
- if (errorType) {
225
- errorMessage += ` (${errorType})`;
226
- }
227
- if (traceId) {
228
- errorMessage += ` [Trace ID: ${traceId}]`;
229
- context.traceId = traceId;
230
- }
231
- console.error(errorMessage);
232
- if (err.context) {
233
- console.error(`Context: ${JSON.stringify(err.context, undefined, 4)}`);
234
- }
235
- context = { ...context, ...err.context };
236
- }
237
- }
238
- else {
239
- console.error(error);
240
- }
241
- throw new error_1.OrchestratorError({
242
- message: error.response.data.errors[0].message,
243
- context,
244
- errorType,
245
- traceId: context.traceId,
246
- });
247
- }
248
- }
249
- }
250
- exports.Orchestrator = Orchestrator;
@@ -1,5 +0,0 @@
1
- declare const PROD_ORCHESTRATOR_URL = "https://orchestrator.rhinestone.dev";
2
- declare const DEV_ORCHESTRATOR_URL = "https://dev.orchestrator.rhinestone.dev";
3
- declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
4
- export { PROD_ORCHESTRATOR_URL, DEV_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, };
5
- //# sourceMappingURL=consts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,wCAAwC,CAAA;AACnE,QAAA,MAAM,oBAAoB,4CAA4C,CAAA;AACtE,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,GAC9B,CAAA"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.DEV_ORCHESTRATOR_URL = exports.PROD_ORCHESTRATOR_URL = void 0;
4
- const PROD_ORCHESTRATOR_URL = 'https://orchestrator.rhinestone.dev';
5
- exports.PROD_ORCHESTRATOR_URL = PROD_ORCHESTRATOR_URL;
6
- const DEV_ORCHESTRATOR_URL = 'https://dev.orchestrator.rhinestone.dev';
7
- exports.DEV_ORCHESTRATOR_URL = DEV_ORCHESTRATOR_URL;
8
- const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
9
- exports.RHINESTONE_SPOKE_POOL_ADDRESS = RHINESTONE_SPOKE_POOL_ADDRESS;
@@ -1,18 +0,0 @@
1
- export declare class OrchestratorError extends Error {
2
- private readonly _message;
3
- private readonly _context;
4
- private readonly _errorType;
5
- private readonly _traceId;
6
- constructor(params?: {
7
- message?: string;
8
- context?: any;
9
- errorType?: string;
10
- traceId?: string;
11
- });
12
- get message(): string;
13
- get context(): any;
14
- get errorType(): string;
15
- get traceId(): string;
16
- }
17
- export declare function isOrchestratorError(error: Error): error is OrchestratorError;
18
- //# sourceMappingURL=error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../orchestrator/error.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,IAAI,OAAO,QAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,WAEV;CACF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,iBAAiB,CAE5E"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrchestratorError = void 0;
4
- exports.isOrchestratorError = isOrchestratorError;
5
- class OrchestratorError extends Error {
6
- _message;
7
- _context;
8
- _errorType;
9
- _traceId;
10
- constructor(params) {
11
- super();
12
- this._message = params?.message || 'OrchestratorError ';
13
- this._context = params?.context || {};
14
- this._errorType = params?.errorType || 'Unknown';
15
- this._traceId = params?.traceId || '';
16
- }
17
- get message() {
18
- return this._message;
19
- }
20
- get context() {
21
- return this._context;
22
- }
23
- get errorType() {
24
- return this._errorType;
25
- }
26
- get traceId() {
27
- return this._traceId;
28
- }
29
- }
30
- exports.OrchestratorError = OrchestratorError;
31
- function isOrchestratorError(error) {
32
- return error instanceof OrchestratorError;
33
- }
@@ -1,11 +0,0 @@
1
- import { Orchestrator } from './client';
2
- import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
3
- import { isOrchestratorError, OrchestratorError } from './error';
4
- import { getHookAddress, getRhinestoneSpokePoolAddress, getSameChainModuleAddress, getSupportedTokens, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
5
- import type { BundleResult, Execution, MetaIntent, MultiChainCompact, OrderCost, OrderCostResult, OrderFeeInput, OrderPath, PostOrderBundleResult, SignedMultiChainCompact, UserTokenBalance } from './types';
6
- import { BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN } from './types';
7
- import { applyInjectedExecutions, BundleStatusEnum, getEmptyUserOp, getOrderBundleHash } from './utils';
8
- declare function getOrchestrator(apiKey: string, orchestratorUrl?: string): Orchestrator;
9
- export type { Execution, BundleResult, MetaIntent, MultiChainCompact, OrderPath, SignedMultiChainCompact, PostOrderBundleResult, OrderCost, OrderCostResult, OrderFeeInput, UserTokenBalance, };
10
- export { BundleStatusEnum as BundleStatus, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getTokenAddress, getSupportedTokens, isOrchestratorError, isTokenAddressSupported, applyInjectedExecutions, };
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EACL,cAAc,EACd,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAEhB,iBAAS,eAAe,CACtB,MAAM,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,MAAM,GACvB,YAAY,CAEd;AAED,YAAY,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,aAAa,EACb,gBAAgB,GACjB,CAAA;AACD,OAAO,EACL,gBAAgB,IAAI,YAAY,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,GACxB,CAAA"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyInjectedExecutions = exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.getRhinestoneSpokePoolAddress = exports.getTargetModuleAddress = exports.getSameChainModuleAddress = exports.getHookAddress = exports.getTokenSymbol = exports.getTokenRootBalanceSlot = exports.getTokenBalanceSlot = exports.getWethAddress = exports.getEmptyUserOp = exports.getOrderBundleHash = exports.OrchestratorError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.BUNDLE_STATUS_UNKNOWN = exports.BUNDLE_STATUS_PRECONFIRMED = exports.BUNDLE_STATUS_FAILED = exports.BUNDLE_STATUS_FILLED = exports.BUNDLE_STATUS_COMPLETED = exports.BUNDLE_STATUS_PARTIALLY_COMPLETED = exports.BUNDLE_STATUS_EXPIRED = exports.BUNDLE_STATUS_PENDING = exports.BundleStatus = void 0;
4
- exports.getOrchestrator = getOrchestrator;
5
- const client_1 = require("./client");
6
- Object.defineProperty(exports, "Orchestrator", { enumerable: true, get: function () { return client_1.Orchestrator; } });
7
- const consts_1 = require("./consts");
8
- Object.defineProperty(exports, "RHINESTONE_SPOKE_POOL_ADDRESS", { enumerable: true, get: function () { return consts_1.RHINESTONE_SPOKE_POOL_ADDRESS; } });
9
- const error_1 = require("./error");
10
- Object.defineProperty(exports, "isOrchestratorError", { enumerable: true, get: function () { return error_1.isOrchestratorError; } });
11
- Object.defineProperty(exports, "OrchestratorError", { enumerable: true, get: function () { return error_1.OrchestratorError; } });
12
- const registry_1 = require("./registry");
13
- Object.defineProperty(exports, "getHookAddress", { enumerable: true, get: function () { return registry_1.getHookAddress; } });
14
- Object.defineProperty(exports, "getRhinestoneSpokePoolAddress", { enumerable: true, get: function () { return registry_1.getRhinestoneSpokePoolAddress; } });
15
- Object.defineProperty(exports, "getSameChainModuleAddress", { enumerable: true, get: function () { return registry_1.getSameChainModuleAddress; } });
16
- Object.defineProperty(exports, "getSupportedTokens", { enumerable: true, get: function () { return registry_1.getSupportedTokens; } });
17
- Object.defineProperty(exports, "getTargetModuleAddress", { enumerable: true, get: function () { return registry_1.getTargetModuleAddress; } });
18
- Object.defineProperty(exports, "getTokenAddress", { enumerable: true, get: function () { return registry_1.getTokenAddress; } });
19
- Object.defineProperty(exports, "getTokenBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenBalanceSlot; } });
20
- Object.defineProperty(exports, "getTokenRootBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenRootBalanceSlot; } });
21
- Object.defineProperty(exports, "getTokenSymbol", { enumerable: true, get: function () { return registry_1.getTokenSymbol; } });
22
- Object.defineProperty(exports, "getWethAddress", { enumerable: true, get: function () { return registry_1.getWethAddress; } });
23
- Object.defineProperty(exports, "isTokenAddressSupported", { enumerable: true, get: function () { return registry_1.isTokenAddressSupported; } });
24
- const types_1 = require("./types");
25
- Object.defineProperty(exports, "BUNDLE_STATUS_COMPLETED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_COMPLETED; } });
26
- Object.defineProperty(exports, "BUNDLE_STATUS_EXPIRED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_EXPIRED; } });
27
- Object.defineProperty(exports, "BUNDLE_STATUS_FAILED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_FAILED; } });
28
- Object.defineProperty(exports, "BUNDLE_STATUS_FILLED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_FILLED; } });
29
- Object.defineProperty(exports, "BUNDLE_STATUS_PARTIALLY_COMPLETED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_PARTIALLY_COMPLETED; } });
30
- Object.defineProperty(exports, "BUNDLE_STATUS_PENDING", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_PENDING; } });
31
- Object.defineProperty(exports, "BUNDLE_STATUS_PRECONFIRMED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_PRECONFIRMED; } });
32
- Object.defineProperty(exports, "BUNDLE_STATUS_UNKNOWN", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_UNKNOWN; } });
33
- const utils_1 = require("./utils");
34
- Object.defineProperty(exports, "applyInjectedExecutions", { enumerable: true, get: function () { return utils_1.applyInjectedExecutions; } });
35
- Object.defineProperty(exports, "BundleStatus", { enumerable: true, get: function () { return utils_1.BundleStatusEnum; } });
36
- Object.defineProperty(exports, "getEmptyUserOp", { enumerable: true, get: function () { return utils_1.getEmptyUserOp; } });
37
- Object.defineProperty(exports, "getOrderBundleHash", { enumerable: true, get: function () { return utils_1.getOrderBundleHash; } });
38
- function getOrchestrator(apiKey, orchestratorUrl) {
39
- return new client_1.Orchestrator(orchestratorUrl ?? consts_1.PROD_ORCHESTRATOR_URL, apiKey);
40
- }
@@ -1,20 +0,0 @@
1
- import { type Address, type Chain, type Hex } from 'viem';
2
- import { TokenConfig } from './types';
3
- declare function getWethAddress(chain: Chain): "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" | "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14" | "0x4200000000000000000000000000000000000006" | "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" | "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73" | "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619" | "0x52eF3d68BaB452a294342DC3e5f464d7f610f72E" | "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91";
4
- declare function getTokenRootBalanceSlot(chain: Chain, tokenAddress: Address): bigint | null;
5
- declare function getTokenBalanceSlot(tokenSymbol: string, chainId: number, accountAddress: Address): Hex;
6
- declare function getHookAddress(_chainId?: number): Address;
7
- declare function getSameChainModuleAddress(_chainId?: number): Address;
8
- declare function getTargetModuleAddress(_chainId?: number): Address;
9
- declare function getRhinestoneSpokePoolAddress(_chainId?: number): Address;
10
- declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
11
- declare function getTokenAddress(tokenSymbol: string, chainId: number): Address;
12
- declare function getChainById(chainId: number): Chain | undefined;
13
- declare function isTestnet(chainId: number): boolean;
14
- declare function isTokenAddressSupported(address: Address, chainId: number): boolean;
15
- declare function getSupportedTokens(chainId: number): TokenConfig[];
16
- declare function getDefaultAccountAccessList(onTestnets?: boolean): {
17
- chainIds: (11155111 | 84532 | 421614 | 11155420)[] | (1 | 8453 | 42161 | 10)[];
18
- };
19
- export { getTokenSymbol, getTokenAddress, getTokenRootBalanceSlot, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, getSupportedTokens, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, };
20
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAeb,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,yXAuCnC;AAqED,iBAAS,uBAAuB,CAC9B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,GACpB,MAAM,GAAG,IAAI,CA4Lf;AAED,iBAAS,mBAAmB,CAC1B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,OAAO,GACtB,GAAG,CAgBL;AAED,iBAAS,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,iBAAS,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,iBAAS,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,iBAAS,6BAA6B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,iBAAS,cAAc,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAWtE;AAED,iBAAS,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAqBtE;AAED,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,qBAmBpC;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,MAAM,WAMjC;AAED,iBAAS,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAW3E;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAkB1D;AAmBD,iBAAS,2BAA2B,CAAC,UAAU,CAAC,EAAE,OAAO;;EAMxD;AAED,OAAO,EACL,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,uBAAuB,EACvB,2BAA2B,GAC5B,CAAA"}