@mimicprotocol/sdk 0.0.1-rc.9 → 0.0.2-rc.1

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 (267) hide show
  1. package/dist/axia/ProposalSigner.d.ts +24 -0
  2. package/dist/axia/ProposalSigner.d.ts.map +1 -0
  3. package/dist/axia/ProposalSigner.js +39 -0
  4. package/dist/axia/ProposalSigner.js.map +1 -0
  5. package/dist/axia/constants.d.ts +36 -22
  6. package/dist/axia/constants.d.ts.map +1 -1
  7. package/dist/axia/constants.js +32 -26
  8. package/dist/axia/constants.js.map +1 -1
  9. package/dist/axia/index.d.ts +1 -0
  10. package/dist/axia/index.d.ts.map +1 -1
  11. package/dist/axia/index.js +1 -0
  12. package/dist/axia/index.js.map +1 -1
  13. package/dist/axia/types.d.ts +3 -2
  14. package/dist/axia/types.d.ts.map +1 -1
  15. package/dist/axia/validators.d.ts +2505 -813
  16. package/dist/axia/validators.d.ts.map +1 -1
  17. package/dist/axia/validators.js +42 -28
  18. package/dist/axia/validators.js.map +1 -1
  19. package/dist/client/core/auth.d.ts +2 -1
  20. package/dist/client/core/auth.d.ts.map +1 -1
  21. package/dist/client/core/auth.js +3 -2
  22. package/dist/client/core/auth.js.map +1 -1
  23. package/dist/client/core/config.d.ts +1 -1
  24. package/dist/client/core/config.d.ts.map +1 -1
  25. package/dist/client/core/config.js +3 -2
  26. package/dist/client/core/config.js.map +1 -1
  27. package/dist/client/domains/Client.d.ts.map +1 -1
  28. package/dist/client/domains/Client.js +4 -2
  29. package/dist/client/domains/Client.js.map +1 -1
  30. package/dist/client/domains/FunctionsClient.d.ts +11 -0
  31. package/dist/client/domains/FunctionsClient.d.ts.map +1 -0
  32. package/dist/client/domains/FunctionsClient.js +30 -0
  33. package/dist/client/domains/FunctionsClient.js.map +1 -0
  34. package/dist/client/domains/IntentsClient.d.ts +36 -22
  35. package/dist/client/domains/IntentsClient.d.ts.map +1 -1
  36. package/dist/client/domains/IntentsClient.js +42 -28
  37. package/dist/client/domains/IntentsClient.js.map +1 -1
  38. package/dist/client/domains/TriggersClient.d.ts +19 -0
  39. package/dist/client/domains/TriggersClient.d.ts.map +1 -0
  40. package/dist/client/domains/TriggersClient.js +89 -0
  41. package/dist/client/domains/TriggersClient.js.map +1 -0
  42. package/dist/client/domains/UsersClient.d.ts +16 -0
  43. package/dist/client/domains/UsersClient.d.ts.map +1 -0
  44. package/dist/client/domains/UsersClient.js +45 -0
  45. package/dist/client/domains/UsersClient.js.map +1 -0
  46. package/dist/client/domains/index.d.ts +3 -2
  47. package/dist/client/domains/index.d.ts.map +1 -1
  48. package/dist/client/domains/index.js +7 -5
  49. package/dist/client/domains/index.js.map +1 -1
  50. package/dist/client/index.d.ts +6 -4
  51. package/dist/client/index.d.ts.map +1 -1
  52. package/dist/client/index.js +6 -3
  53. package/dist/client/index.js.map +1 -1
  54. package/dist/index.d.ts +3 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +4 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/oracle/eip712Types.d.ts +45 -5
  59. package/dist/oracle/eip712Types.d.ts.map +1 -1
  60. package/dist/oracle/eip712Types.js +50 -10
  61. package/dist/oracle/eip712Types.js.map +1 -1
  62. package/dist/oracle/types.d.ts +15 -1
  63. package/dist/oracle/types.d.ts.map +1 -1
  64. package/dist/oracle/validators.d.ts +878 -256
  65. package/dist/oracle/validators.d.ts.map +1 -1
  66. package/dist/oracle/validators.js +34 -5
  67. package/dist/oracle/validators.js.map +1 -1
  68. package/dist/registry/AuthSigner.d.ts +5 -4
  69. package/dist/registry/AuthSigner.d.ts.map +1 -1
  70. package/dist/registry/AuthSigner.js +6 -5
  71. package/dist/registry/AuthSigner.js.map +1 -1
  72. package/dist/registry/TriggerSigner.d.ts +26 -0
  73. package/dist/registry/TriggerSigner.d.ts.map +1 -0
  74. package/dist/registry/TriggerSigner.js +115 -0
  75. package/dist/registry/TriggerSigner.js.map +1 -0
  76. package/dist/registry/constants.d.ts +2 -0
  77. package/dist/registry/constants.d.ts.map +1 -0
  78. package/dist/registry/constants.js +5 -0
  79. package/dist/registry/constants.js.map +1 -0
  80. package/dist/registry/eip712Types.d.ts +31 -5
  81. package/dist/registry/eip712Types.d.ts.map +1 -1
  82. package/dist/registry/eip712Types.js +39 -11
  83. package/dist/registry/eip712Types.js.map +1 -1
  84. package/dist/registry/index.d.ts +2 -1
  85. package/dist/registry/index.d.ts.map +1 -1
  86. package/dist/registry/index.js +2 -1
  87. package/dist/registry/index.js.map +1 -1
  88. package/dist/registry/types.d.ts +34 -25
  89. package/dist/registry/types.d.ts.map +1 -1
  90. package/dist/registry/types.js +5 -1
  91. package/dist/registry/types.js.map +1 -1
  92. package/dist/registry/validations.d.ts +2 -4
  93. package/dist/registry/validations.d.ts.map +1 -1
  94. package/dist/registry/validations.js +5 -13
  95. package/dist/registry/validations.js.map +1 -1
  96. package/dist/registry/validators.d.ts +1769 -419
  97. package/dist/registry/validators.d.ts.map +1 -1
  98. package/dist/registry/validators.js +144 -81
  99. package/dist/registry/validators.js.map +1 -1
  100. package/dist/relayer/eip712Types.d.ts +8 -0
  101. package/dist/relayer/eip712Types.d.ts.map +1 -1
  102. package/dist/relayer/types.d.ts +2 -1
  103. package/dist/relayer/types.d.ts.map +1 -1
  104. package/dist/relayer/validators.d.ts +2874 -1056
  105. package/dist/relayer/validators.d.ts.map +1 -1
  106. package/dist/relayer/validators.js +4 -17
  107. package/dist/relayer/validators.js.map +1 -1
  108. package/dist/runner/validators.d.ts +770 -168
  109. package/dist/runner/validators.d.ts.map +1 -1
  110. package/dist/runner/validators.js +12 -2
  111. package/dist/runner/validators.js.map +1 -1
  112. package/dist/settler/index.d.ts +2 -0
  113. package/dist/settler/index.d.ts.map +1 -0
  114. package/dist/settler/index.js +18 -0
  115. package/dist/settler/index.js.map +1 -0
  116. package/dist/settler/svm/Controller.d.ts +24 -0
  117. package/dist/settler/svm/Controller.d.ts.map +1 -0
  118. package/dist/settler/svm/Controller.js +136 -0
  119. package/dist/settler/svm/Controller.js.map +1 -0
  120. package/dist/settler/svm/Settler.d.ts +46 -0
  121. package/dist/settler/svm/Settler.d.ts.map +1 -0
  122. package/dist/settler/svm/Settler.js +305 -0
  123. package/dist/settler/svm/Settler.js.map +1 -0
  124. package/dist/settler/svm/idls/controller.json +621 -0
  125. package/dist/settler/svm/idls/settler.json +1707 -0
  126. package/dist/settler/svm/idls/types/controller.d.ts +401 -0
  127. package/dist/settler/svm/idls/types/controller.d.ts.map +1 -0
  128. package/dist/settler/svm/idls/types/controller.js +3 -0
  129. package/dist/settler/svm/idls/types/controller.js.map +1 -0
  130. package/dist/settler/svm/idls/types/settler.d.ts +1299 -0
  131. package/dist/settler/svm/idls/types/settler.d.ts.map +1 -0
  132. package/dist/settler/svm/idls/types/settler.js +3 -0
  133. package/dist/settler/svm/idls/types/settler.js.map +1 -0
  134. package/dist/settler/svm/index.d.ts +4 -0
  135. package/dist/settler/svm/index.d.ts.map +1 -0
  136. package/dist/settler/svm/index.js +27 -0
  137. package/dist/settler/svm/index.js.map +1 -0
  138. package/dist/settler/svm/types.d.ts +44 -0
  139. package/dist/settler/svm/types.d.ts.map +1 -0
  140. package/dist/{shared/types/events.js → settler/svm/types.js} +1 -1
  141. package/dist/settler/svm/types.js.map +1 -0
  142. package/dist/shared/codec/chains/evm.d.ts +9 -5
  143. package/dist/shared/codec/chains/evm.d.ts.map +1 -1
  144. package/dist/shared/codec/chains/evm.js +105 -26
  145. package/dist/shared/codec/chains/evm.js.map +1 -1
  146. package/dist/shared/codec/chains/svm.d.ts +20 -12
  147. package/dist/shared/codec/chains/svm.d.ts.map +1 -1
  148. package/dist/shared/codec/chains/svm.js +185 -47
  149. package/dist/shared/codec/chains/svm.js.map +1 -1
  150. package/dist/shared/codec/decoder.d.ts +16 -5
  151. package/dist/shared/codec/decoder.d.ts.map +1 -1
  152. package/dist/shared/codec/decoder.js +67 -22
  153. package/dist/shared/codec/decoder.js.map +1 -1
  154. package/dist/shared/codec/encoder.d.ts +107 -10
  155. package/dist/shared/codec/encoder.d.ts.map +1 -1
  156. package/dist/shared/codec/encoder.js +72 -33
  157. package/dist/shared/codec/encoder.js.map +1 -1
  158. package/dist/shared/codec/index.d.ts +1 -1
  159. package/dist/shared/codec/index.d.ts.map +1 -1
  160. package/dist/shared/codec/index.js +13 -8
  161. package/dist/shared/codec/index.js.map +1 -1
  162. package/dist/shared/eip712Types/index.d.ts +27 -4
  163. package/dist/shared/eip712Types/index.d.ts.map +1 -1
  164. package/dist/shared/eip712Types/index.js +42 -12
  165. package/dist/shared/eip712Types/index.js.map +1 -1
  166. package/dist/shared/signer/EthersSigner.d.ts +2 -1
  167. package/dist/shared/signer/EthersSigner.d.ts.map +1 -1
  168. package/dist/shared/signer/EthersSigner.js +3 -0
  169. package/dist/shared/signer/EthersSigner.js.map +1 -1
  170. package/dist/shared/signer/Signer.d.ts +1 -0
  171. package/dist/shared/signer/Signer.d.ts.map +1 -1
  172. package/dist/shared/signer/WindowEthereumSigner.d.ts +2 -1
  173. package/dist/shared/signer/WindowEthereumSigner.d.ts.map +1 -1
  174. package/dist/shared/signer/WindowEthereumSigner.js +3 -0
  175. package/dist/shared/signer/WindowEthereumSigner.js.map +1 -1
  176. package/dist/shared/types/executions.d.ts +3 -2
  177. package/dist/shared/types/executions.d.ts.map +1 -1
  178. package/dist/shared/types/index.d.ts +0 -1
  179. package/dist/shared/types/index.d.ts.map +1 -1
  180. package/dist/shared/types/index.js +0 -1
  181. package/dist/shared/types/index.js.map +1 -1
  182. package/dist/shared/types/intents.d.ts +25 -11
  183. package/dist/shared/types/intents.d.ts.map +1 -1
  184. package/dist/shared/types/primitives.d.ts +4 -1
  185. package/dist/shared/types/primitives.d.ts.map +1 -1
  186. package/dist/shared/utils/addresses.d.ts +5 -2
  187. package/dist/shared/utils/addresses.d.ts.map +1 -1
  188. package/dist/shared/utils/addresses.js +11 -1
  189. package/dist/shared/utils/addresses.js.map +1 -1
  190. package/dist/shared/utils/bytes.d.ts +2 -0
  191. package/dist/shared/utils/bytes.d.ts.map +1 -1
  192. package/dist/shared/utils/bytes.js +10 -0
  193. package/dist/shared/utils/bytes.js.map +1 -1
  194. package/dist/shared/utils/chains.d.ts +4 -0
  195. package/dist/shared/utils/chains.d.ts.map +1 -1
  196. package/dist/shared/utils/chains.js +4 -0
  197. package/dist/shared/utils/chains.js.map +1 -1
  198. package/dist/shared/utils/constants.d.ts +2 -0
  199. package/dist/shared/utils/constants.d.ts.map +1 -0
  200. package/dist/shared/utils/constants.js +5 -0
  201. package/dist/shared/utils/constants.js.map +1 -0
  202. package/dist/shared/utils/index.d.ts +2 -0
  203. package/dist/shared/utils/index.d.ts.map +1 -1
  204. package/dist/shared/utils/index.js +2 -0
  205. package/dist/shared/utils/index.js.map +1 -1
  206. package/dist/shared/utils/numbers.d.ts +20 -6
  207. package/dist/shared/utils/numbers.d.ts.map +1 -1
  208. package/dist/shared/utils/numbers.js +85 -22
  209. package/dist/shared/utils/numbers.js.map +1 -1
  210. package/dist/shared/utils/random.d.ts +1 -3
  211. package/dist/shared/utils/random.d.ts.map +1 -1
  212. package/dist/shared/utils/random.js +13 -6
  213. package/dist/shared/utils/random.js.map +1 -1
  214. package/dist/shared/utils/time.d.ts +14 -0
  215. package/dist/shared/utils/time.d.ts.map +1 -0
  216. package/dist/shared/utils/time.js +59 -0
  217. package/dist/shared/utils/time.js.map +1 -0
  218. package/dist/shared/utils/tokens.d.ts +1 -2
  219. package/dist/shared/utils/tokens.d.ts.map +1 -1
  220. package/dist/shared/utils/tokens.js +4 -4
  221. package/dist/shared/utils/tokens.js.map +1 -1
  222. package/dist/shared/utils/validations.d.ts +5 -0
  223. package/dist/shared/utils/validations.d.ts.map +1 -1
  224. package/dist/shared/utils/validations.js +28 -1
  225. package/dist/shared/utils/validations.js.map +1 -1
  226. package/dist/shared/validators/executions.d.ts +85 -48
  227. package/dist/shared/validators/executions.d.ts.map +1 -1
  228. package/dist/shared/validators/executions.js +16 -22
  229. package/dist/shared/validators/executions.js.map +1 -1
  230. package/dist/shared/validators/index.d.ts +0 -1
  231. package/dist/shared/validators/index.d.ts.map +1 -1
  232. package/dist/shared/validators/index.js +0 -1
  233. package/dist/shared/validators/index.js.map +1 -1
  234. package/dist/shared/validators/intents.d.ts +1738 -127
  235. package/dist/shared/validators/intents.d.ts.map +1 -1
  236. package/dist/shared/validators/intents.js +93 -27
  237. package/dist/shared/validators/intents.js.map +1 -1
  238. package/dist/shared/validators/primitives.d.ts +46 -6
  239. package/dist/shared/validators/primitives.d.ts.map +1 -1
  240. package/dist/shared/validators/primitives.js +29 -9
  241. package/dist/shared/validators/primitives.js.map +1 -1
  242. package/dist/validator/ValidatorSigner.d.ts +13 -4
  243. package/dist/validator/ValidatorSigner.d.ts.map +1 -1
  244. package/dist/validator/ValidatorSigner.js +25 -7
  245. package/dist/validator/ValidatorSigner.js.map +1 -1
  246. package/dist/validator/eip712Types.js +1 -1
  247. package/dist/validator/eip712Types.js.map +1 -1
  248. package/package.json +8 -2
  249. package/dist/client/domains/ConfigsClient.d.ts +0 -18
  250. package/dist/client/domains/ConfigsClient.d.ts.map +0 -1
  251. package/dist/client/domains/ConfigsClient.js +0 -81
  252. package/dist/client/domains/ConfigsClient.js.map +0 -1
  253. package/dist/client/domains/TasksClient.d.ts +0 -11
  254. package/dist/client/domains/TasksClient.d.ts.map +0 -1
  255. package/dist/client/domains/TasksClient.js +0 -33
  256. package/dist/client/domains/TasksClient.js.map +0 -1
  257. package/dist/registry/ConfigSigner.d.ts +0 -25
  258. package/dist/registry/ConfigSigner.d.ts.map +0 -1
  259. package/dist/registry/ConfigSigner.js +0 -93
  260. package/dist/registry/ConfigSigner.js.map +0 -1
  261. package/dist/shared/types/events.d.ts +0 -4
  262. package/dist/shared/types/events.d.ts.map +0 -1
  263. package/dist/shared/types/events.js.map +0 -1
  264. package/dist/shared/validators/events.d.ts +0 -20
  265. package/dist/shared/validators/events.d.ts.map +0 -1
  266. package/dist/shared/validators/events.js +0 -17
  267. package/dist/shared/validators/events.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/runner/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASvC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;EAGtC,CAAA"}
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/runner/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAcvB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBrC,CAAA;AAEJ,eAAO,MAAM,2BAA2B;;;;;;;;;EAGtC,CAAA"}
@@ -4,15 +4,25 @@ exports.RunExecutionResultValidator = exports.RunExecutionRequestValidator = voi
4
4
  const zod_1 = require("zod");
5
5
  const oracle_1 = require("../oracle");
6
6
  const shared_1 = require("../shared");
7
- exports.RunExecutionRequestValidator = zod_1.z.object({
7
+ exports.RunExecutionRequestValidator = zod_1.z
8
+ .object({
8
9
  input: zod_1.z.record(shared_1.StringValidator, zod_1.z.unknown()),
9
10
  callbackUrl: shared_1.UrlValidator,
10
- configSig: shared_1.StringValidator,
11
11
  user: shared_1.AddressValidator,
12
12
  settlers: shared_1.StringValidator,
13
13
  timestamp: shared_1.TimestampValidator,
14
+ oracleUrls: zod_1.z.array(shared_1.UrlValidator).optional(),
14
15
  oracleResponses: zod_1.z.array(oracle_1.OracleResponseValidator).optional(),
15
16
  hash: shared_1.HexValidator,
17
+ triggerSig: shared_1.StringValidator,
18
+ triggerConfig: zod_1.z.object({
19
+ data: shared_1.HexValidator,
20
+ type: zod_1.z.nativeEnum(shared_1.TriggerType),
21
+ }),
22
+ version: shared_1.SemVerValidator,
23
+ })
24
+ .refine((data) => (data.oracleUrls && !data.oracleResponses) || (!data.oracleUrls && data.oracleResponses), {
25
+ message: 'Either oracleUrls or oracleResponses must be present, but not both',
16
26
  });
17
27
  exports.RunExecutionResultValidator = zod_1.z.object({
18
28
  stdout: shared_1.EmptyStringValidator,
@@ -1 +1 @@
1
- {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/runner/validators.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,sCAAmD;AACnD,sCAOkB;AAEL,QAAA,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IACnD,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,wBAAe,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;IAC7C,WAAW,EAAE,qBAAY;IACzB,SAAS,EAAE,wBAAe;IAC1B,IAAI,EAAE,yBAAgB;IACtB,QAAQ,EAAE,wBAAe;IACzB,SAAS,EAAE,2BAAkB;IAC7B,eAAe,EAAE,OAAC,CAAC,KAAK,CAAC,gCAAuB,CAAC,CAAC,QAAQ,EAAE;IAC5D,IAAI,EAAE,qBAAY;CACnB,CAAC,CAAA;AAEW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from './svm';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/settler/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./svm"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/settler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB"}
@@ -0,0 +1,24 @@
1
+ import { IdlTypes, Program, Provider, web3 } from '@coral-xyz/anchor';
2
+ import { Controller } from './idls/types/controller';
3
+ export declare const EntityType: {
4
+ readonly Validator: 0;
5
+ readonly Axia: 1;
6
+ readonly Solver: 2;
7
+ };
8
+ export type EntityType = (typeof EntityType)[keyof typeof EntityType];
9
+ export default class SvmController {
10
+ protected program: Program<Controller>;
11
+ constructor(provider?: Provider);
12
+ initializeIx(admin: web3.PublicKey, minValidations: number, caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
13
+ resizeSettings(caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
14
+ setAdminIx(newAdmin: web3.PublicKey, caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
15
+ setMinValidationsIx(newMinValidations: number, caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
16
+ setAllowedEntityIx(entityType: EntityType, entityAddress: web3.PublicKey | Buffer, caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
17
+ closeEntityRegistryIx(entityType: EntityType, entityAddress: web3.PublicKey | Buffer, caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
18
+ getSignerKey(): web3.PublicKey;
19
+ getControllerSettingsPubkey(): web3.PublicKey;
20
+ getEntityRegistryPubkey(entityType: EntityType, entityAddress: web3.PublicKey | Buffer): web3.PublicKey;
21
+ entityTypeToAnchorEnum(entityType: EntityType): IdlTypes<Controller>['entityType'];
22
+ private pubkeyOrBufferToBuffer;
23
+ }
24
+ //# sourceMappingURL=Controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Controller.d.ts","sourceRoot":"","sources":["../../../src/settler/svm/Controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,eAAO,MAAM,UAAU;;;;CAIb,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAErE,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;gBAE1B,QAAQ,CAAC,EAAE,QAAQ;IAIzB,YAAY,CAChB,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,GACtB,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAYjC,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAY7E,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAYnG,mBAAmB,CAAC,iBAAiB,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAY7G,kBAAkB,CACtB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,IAAI,CAAC,SAAS,GAAG,MAAM,EACtC,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,GACtB,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAejC,qBAAqB,CACzB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,IAAI,CAAC,SAAS,GAAG,MAAM,EACtC,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,GACtB,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAevC,YAAY,IAAI,IAAI,CAAC,SAAS;IAK9B,2BAA2B,IAAI,IAAI,CAAC,SAAS;IAI7C,uBAAuB,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,GAAG,MAAM,GAAG,IAAI,CAAC,SAAS;IAQvG,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC;IAQlF,OAAO,CAAC,sBAAsB;CAG/B"}
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.EntityType = void 0;
27
+ const anchor_1 = require("@coral-xyz/anchor");
28
+ const ControllerIDL = __importStar(require("./idls/controller.json"));
29
+ exports.EntityType = {
30
+ Validator: 0,
31
+ Axia: 1,
32
+ Solver: 2,
33
+ };
34
+ class SvmController {
35
+ constructor(provider) {
36
+ this.program = new anchor_1.Program(ControllerIDL, provider);
37
+ }
38
+ async initializeIx(admin, minValidations, caller) {
39
+ const controllerSettings = this.getControllerSettingsPubkey();
40
+ const ix = await this.program.methods
41
+ .initialize(admin, minValidations)
42
+ .accountsPartial({
43
+ deployer: caller ?? this.getSignerKey(),
44
+ controllerSettings,
45
+ })
46
+ .instruction();
47
+ return ix;
48
+ }
49
+ async resizeSettings(caller) {
50
+ const controllerSettings = this.getControllerSettingsPubkey();
51
+ const ix = await this.program.methods
52
+ .resizeSettings()
53
+ .accountsPartial({
54
+ admin: caller ?? this.getSignerKey(),
55
+ controllerSettings,
56
+ })
57
+ .instruction();
58
+ return ix;
59
+ }
60
+ async setAdminIx(newAdmin, caller) {
61
+ const controllerSettings = this.getControllerSettingsPubkey();
62
+ const ix = await this.program.methods
63
+ .setAdmin(newAdmin)
64
+ .accountsPartial({
65
+ admin: caller ?? this.getSignerKey(),
66
+ controllerSettings,
67
+ })
68
+ .instruction();
69
+ return ix;
70
+ }
71
+ async setMinValidationsIx(newMinValidations, caller) {
72
+ const controllerSettings = this.getControllerSettingsPubkey();
73
+ const ix = await this.program.methods
74
+ .setMinValidations(newMinValidations)
75
+ .accountsPartial({
76
+ admin: caller ?? this.getSignerKey(),
77
+ controllerSettings,
78
+ })
79
+ .instruction();
80
+ return ix;
81
+ }
82
+ async setAllowedEntityIx(entityType, entityAddress, caller) {
83
+ const entityAddressBuffer = this.pubkeyOrBufferToBuffer(entityAddress);
84
+ const entityRegistry = this.getEntityRegistryPubkey(entityType, entityAddressBuffer);
85
+ const controllerSettings = this.getControllerSettingsPubkey();
86
+ const ix = await this.program.methods
87
+ .setAllowedEntity(this.entityTypeToAnchorEnum(entityType), entityAddressBuffer)
88
+ .accountsPartial({
89
+ admin: caller ?? this.getSignerKey(),
90
+ entityRegistry,
91
+ controllerSettings,
92
+ })
93
+ .instruction();
94
+ return ix;
95
+ }
96
+ async closeEntityRegistryIx(entityType, entityAddress, caller) {
97
+ const entityAddressBuffer = this.pubkeyOrBufferToBuffer(entityAddress);
98
+ const entityRegistry = this.getEntityRegistryPubkey(entityType, entityAddressBuffer);
99
+ const controllerSettings = this.getControllerSettingsPubkey();
100
+ const ix = await this.program.methods
101
+ .closeEntityRegistry(this.entityTypeToAnchorEnum(entityType), entityAddressBuffer)
102
+ .accountsPartial({
103
+ admin: caller ?? this.getSignerKey(),
104
+ entityRegistry,
105
+ controllerSettings,
106
+ })
107
+ .instruction();
108
+ return ix;
109
+ }
110
+ getSignerKey() {
111
+ if (!this.program.provider.wallet)
112
+ throw new Error('Must set program provider wallet');
113
+ return this.program.provider.wallet?.publicKey;
114
+ }
115
+ getControllerSettingsPubkey() {
116
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('controller-settings')], this.program.programId)[0];
117
+ }
118
+ getEntityRegistryPubkey(entityType, entityAddress) {
119
+ const entityAddressBuffer = this.pubkeyOrBufferToBuffer(entityAddress);
120
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('entity-registry'), Buffer.from([entityType]), entityAddressBuffer], this.program.programId)[0];
121
+ }
122
+ entityTypeToAnchorEnum(entityType) {
123
+ if (entityType === exports.EntityType.Validator)
124
+ return { validator: {} };
125
+ if (entityType === exports.EntityType.Axia)
126
+ return { axia: {} };
127
+ if (entityType === exports.EntityType.Solver)
128
+ return { solver: {} };
129
+ throw new Error(`Unsupported entity type ${entityType}`);
130
+ }
131
+ pubkeyOrBufferToBuffer(pubkeyOrBuffer) {
132
+ return Buffer.isBuffer(pubkeyOrBuffer) ? pubkeyOrBuffer : pubkeyOrBuffer.toBuffer();
133
+ }
134
+ }
135
+ exports.default = SvmController;
136
+ //# sourceMappingURL=Controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Controller.js","sourceRoot":"","sources":["../../../src/settler/svm/Controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAqE;AAErE,sEAAuD;AAG1C,QAAA,UAAU,GAAG;IACxB,SAAS,EAAE,CAAC;IACZ,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;CACD,CAAA;AAIV,MAAqB,aAAa;IAGhC,YAAY,QAAmB;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IACrD,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,KAAqB,EACrB,cAAsB,EACtB,MAAuB;QAEvB,MAAM,kBAAkB,GAAG,IAAI,CAAC,2BAA2B,EAAE,CAAA;QAC7D,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO;aAClC,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC;aACjC,eAAe,CAAC;YACf,QAAQ,EAAE,MAAM,IAAI,IAAI,CAAC,YAAY,EAAE;YACvC,kBAAkB;SACnB,CAAC;aACD,WAAW,EAAE,CAAA;QAChB,OAAO,EAAE,CAAA;IACX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,aAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/G,CAAC;IAED,uBAAuB,CAAC,UAAsB,EAAE,aAAsC;QACpF,MAAM,mBAAmB,GAAG,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAA;QACtE,OAAO,aAAI,CAAC,SAAS,CAAC,sBAAsB,CAC1C,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,mBAAmB,CAAC,EAChF,IAAI,CAAC,OAAO,CAAC,SAAS,CACvB,CAAC,CAAC,CAAC,CAAA;IACN,CAAC;IAED,sBAAsB,CAAC,UAAsB;QAC3C,IAAI,UAAU,KAAK,kBAAU,CAAC,SAAS;YAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAA;QACjE,IAAI,UAAU,KAAK,kBAAU,CAAC,IAAI;YAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;QACvD,IAAI,UAAU,KAAK,kBAAU,CAAC,MAAM;YAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;QAE3D,MAAM,IAAI,KAAK,CAAC,2BAA2B,UAAU,EAAE,CAAC,CAAA;IAC1D,CAAC;IAEO,sBAAsB,CAAC,cAAuC;QACpE,OAAO,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAA;IACrF,CAAC;CACF;AA7HD,gCA6HC"}
@@ -0,0 +1,46 @@
1
+ import { Address, IdlTypes, Program, Provider, web3 } from '@coral-xyz/anchor';
2
+ import { AccountMeta } from '@solana/web3.js';
3
+ import { Intent, OpType, Proposal } from '../../shared';
4
+ import { Settler } from './idls/types/settler';
5
+ import { EntityType } from './Controller';
6
+ import { CreateIntentParams, CreateProposalParams, ExtendIntentParams, ProposalInstruction, SolanaEip712Domain } from './types';
7
+ type ProposalAccount = NonNullable<Awaited<ReturnType<Program<Settler>['account']['proposal']['fetch']>>>;
8
+ export default class SvmSettler {
9
+ protected program: Program<Settler>;
10
+ private validatorSigner;
11
+ private proposalSigner;
12
+ constructor(provider: Provider);
13
+ initializeIx(domain: SolanaEip712Domain): Promise<web3.TransactionInstruction>;
14
+ updateEip712DomainIx(domain: SolanaEip712Domain): Promise<web3.TransactionInstruction>;
15
+ createIntentIx(intentHashHex: string, params: CreateIntentParams, isFinal?: boolean): Promise<web3.TransactionInstruction>;
16
+ extendIntentIx(intentHashHex: string, params: ExtendIntentParams, finalize?: boolean): Promise<web3.TransactionInstruction>;
17
+ claimStaleIntentIx(intentHashHex: string): Promise<web3.TransactionInstruction>;
18
+ createProposalIx(intentHashHex: string, params: CreateProposalParams): Promise<web3.TransactionInstruction>;
19
+ addInstructionsToProposalIx(intentHashHex: string, moreInstructions: ProposalInstruction[], finalize?: boolean): Promise<web3.TransactionInstruction>;
20
+ claimStaleProposalIx(intentHashHex: string): Promise<web3.TransactionInstruction>;
21
+ addValidatorSigIxs(intentHashHex: string, validatorEthAddress: string, signature: string): Promise<web3.TransactionInstruction[]>;
22
+ addAxiaSigIxs(intentHash: string, proposal: Proposal, axiaEthAddress: string, signature: string): Promise<web3.TransactionInstruction[]>;
23
+ executeProposalIx(intentHash: string, intent: Intent, proposal: Proposal, remainingAccounts: AccountMeta[]): Promise<web3.TransactionInstruction>;
24
+ getSettlerSettingsKey(): web3.PublicKey;
25
+ getIntentKey(intentHashHex: string): web3.PublicKey;
26
+ getFulfilledIntentKey(intentHashHex: string): web3.PublicKey;
27
+ getProposalKey(intentHashHex: string, solverPubkey?: Address): web3.PublicKey;
28
+ getEntityRegistryKey(entityType: EntityType, entityAddress: Address | Buffer): web3.PublicKey;
29
+ getDelegateKey(user?: Address): web3.PublicKey;
30
+ getSignerKey(): web3.PublicKey;
31
+ opTypeToAnchorEnum(opType: OpType): IdlTypes<Settler>['opType'];
32
+ anchorProposalToEip712Proposal(proposalAccount: ProposalAccount, intentHash: number[]): Proposal & {
33
+ intent: string;
34
+ };
35
+ private parseSolanaEip712Domain;
36
+ private parseIntentHashHex;
37
+ private parseIntentNonceHex;
38
+ private parseOperationEventsHex;
39
+ private parseIntentTokenFees;
40
+ private parseProposalTokenFees;
41
+ private parseProposalInstructions;
42
+ private pubkeyOrBufferToBuffer;
43
+ private parseSignature;
44
+ }
45
+ export {};
46
+ //# sourceMappingURL=Settler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settler.d.ts","sourceRoot":"","sources":["../../../src/settler/svm/Settler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAM,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAoB,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAI7C,OAAO,EAAkC,MAAM,EAA8B,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAKnH,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EAEnB,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAmBhB,KAAK,eAAe,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAEzG,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IACnC,OAAO,CAAC,eAAe,CAA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CACrB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,WAAW,EAAE,GAC/B,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAmBvC,qBAAqB,IAAI,IAAI,CAAC,SAAS;IAIvC,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC,SAAS;IAMnD,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC,SAAS;IAS5D,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,SAAS;IAY7E,oBAAoB,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC,SAAS;IAQ7F,cAAc,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,SAAS;IAS9C,YAAY,IAAI,IAAI,CAAC,SAAS;IAK9B,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;IAS/D,8BAA8B,CAC5B,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,MAAM,EAAE,GACnB,QAAQ,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAUhC,OAAO,CAAC,uBAAuB;IAY/B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,uBAAuB;IAS/B,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,yBAAyB;IAQjC,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,cAAc;CASvB"}
@@ -0,0 +1,305 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const anchor_1 = require("@coral-xyz/anchor");
27
+ const ethers_1 = require("ethers");
28
+ const axia_1 = require("../../axia");
29
+ const shared_1 = require("../../shared");
30
+ const validator_1 = require("../../validator");
31
+ const ControllerIDL = __importStar(require("./idls/controller.json"));
32
+ const SettlerIDL = __importStar(require("./idls/settler.json"));
33
+ const Controller_1 = require("./Controller");
34
+ class SvmSettler {
35
+ constructor(provider) {
36
+ this.program = new anchor_1.Program(SettlerIDL, provider);
37
+ this.validatorSigner = new validator_1.ValidatorSigner();
38
+ this.proposalSigner = new axia_1.ProposalSigner();
39
+ }
40
+ async initializeIx(domain) {
41
+ const ix = await this.program.methods.initialize(this.parseSolanaEip712Domain(domain)).instruction();
42
+ return ix;
43
+ }
44
+ async updateEip712DomainIx(domain) {
45
+ const ix = await this.program.methods.updateEip712Domain(this.parseSolanaEip712Domain(domain)).instruction();
46
+ return ix;
47
+ }
48
+ async createIntentIx(intentHashHex, params, isFinal = true) {
49
+ const { opType, user, nonce: nonceHex, deadline, minValidations, data: dataHex, maxFees, events: eventsHex, } = params;
50
+ const intentHash = this.parseIntentHashHex(intentHashHex);
51
+ const nonce = this.parseIntentNonceHex(nonceHex);
52
+ const data = (0, shared_1.hexToBytes)(dataHex);
53
+ const maxFeesBn = this.parseIntentTokenFees(maxFees);
54
+ const events = this.parseOperationEventsHex(eventsHex);
55
+ const ix = await this.program.methods
56
+ .createIntent(intentHash, data, maxFeesBn, events, minValidations, this.opTypeToAnchorEnum(opType), (0, anchor_1.translateAddress)(user), nonce, new anchor_1.BN(deadline), isFinal)
57
+ .accountsPartial({
58
+ solver: this.getSignerKey(),
59
+ solverRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Solver, this.getSignerKey()),
60
+ })
61
+ .instruction();
62
+ return ix;
63
+ }
64
+ async extendIntentIx(intentHashHex, params, finalize = true) {
65
+ const { moreDataHex = '', moreMaxFees = [], moreEventsHex = [] } = params;
66
+ const moreData = (0, shared_1.hexToBytes)(moreDataHex);
67
+ const moreMaxFeesBn = this.parseIntentTokenFees(moreMaxFees);
68
+ const moreEvents = this.parseOperationEventsHex(moreEventsHex);
69
+ const ix = await this.program.methods
70
+ .extendIntent(moreData, moreMaxFeesBn, moreEvents, finalize)
71
+ .accountsPartial({
72
+ creator: this.getSignerKey(),
73
+ intent: this.getIntentKey(intentHashHex),
74
+ })
75
+ .instruction();
76
+ return ix;
77
+ }
78
+ async claimStaleIntentIx(intentHashHex) {
79
+ const ix = await this.program.methods
80
+ .claimStaleIntent()
81
+ .accountsPartial({
82
+ creator: this.getSignerKey(),
83
+ intent: this.getIntentKey(intentHashHex),
84
+ })
85
+ .instruction();
86
+ return ix;
87
+ }
88
+ async createProposalIx(intentHashHex, params) {
89
+ const { instructions, fees, deadline, isFinal } = params;
90
+ const parsedInstructions = this.parseProposalInstructions(instructions);
91
+ const parsedFees = this.parseProposalTokenFees(fees);
92
+ const ix = await this.program.methods
93
+ .createProposal(parsedInstructions, parsedFees, new anchor_1.BN(deadline), isFinal ?? false)
94
+ .accountsPartial({
95
+ solver: this.getSignerKey(),
96
+ solverRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Solver, this.getSignerKey()),
97
+ intent: this.getIntentKey(intentHashHex),
98
+ fulfilledIntent: this.getFulfilledIntentKey(intentHashHex),
99
+ })
100
+ .instruction();
101
+ return ix;
102
+ }
103
+ async addInstructionsToProposalIx(intentHashHex, moreInstructions, finalize = true) {
104
+ const parsedInstructions = this.parseProposalInstructions(moreInstructions);
105
+ const ix = await this.program.methods
106
+ .addInstructionsToProposal(parsedInstructions, finalize)
107
+ .accountsPartial({
108
+ creator: this.getSignerKey(),
109
+ proposal: this.getProposalKey(intentHashHex),
110
+ })
111
+ .instruction();
112
+ return ix;
113
+ }
114
+ async claimStaleProposalIx(intentHashHex) {
115
+ const ix = await this.program.methods
116
+ .claimStaleProposal()
117
+ .accountsPartial({
118
+ creator: this.getSignerKey(),
119
+ proposal: this.getProposalKey(intentHashHex),
120
+ })
121
+ .instruction();
122
+ return ix;
123
+ }
124
+ async addValidatorSigIxs(intentHashHex, validatorEthAddress, signature) {
125
+ const { signedMessage, recoveryId } = this.parseSignature(signature);
126
+ const eip712Preimage = this.validatorSigner.getIntentMessage({
127
+ hash: intentHashHex,
128
+ settler: this.program.programId.toString(),
129
+ chainId: shared_1.Chains.Solana,
130
+ });
131
+ const secp256k1Ix = anchor_1.web3.Secp256k1Program.createInstructionWithEthAddress({
132
+ message: (0, shared_1.hexToBytes)(eip712Preimage),
133
+ ethAddress: (0, shared_1.hexToBytes)(validatorEthAddress),
134
+ signature: signedMessage,
135
+ recoveryId,
136
+ });
137
+ const ix = await this.program.methods
138
+ .addValidatorSig()
139
+ .accountsPartial({
140
+ solver: this.getSignerKey(),
141
+ solverRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Solver, this.getSignerKey()),
142
+ intent: this.getIntentKey(intentHashHex),
143
+ fulfilledIntent: this.getFulfilledIntentKey(intentHashHex),
144
+ validatorRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Validator, (0, shared_1.hexToBytes)(validatorEthAddress)),
145
+ settlerSettings: this.getSettlerSettingsKey(),
146
+ ixSysvar: anchor_1.web3.SYSVAR_INSTRUCTIONS_PUBKEY,
147
+ })
148
+ .instruction();
149
+ return [secp256k1Ix, ix];
150
+ }
151
+ async addAxiaSigIxs(intentHash, proposal, axiaEthAddress, signature) {
152
+ const { signedMessage, recoveryId } = this.parseSignature(signature);
153
+ const eip712Preimage = this.proposalSigner.getMessage({ ...proposal, intent: intentHash }, { chainId: shared_1.Chains.Solana, address: this.program.programId.toString() });
154
+ const secp256k1Ix = anchor_1.web3.Secp256k1Program.createInstructionWithEthAddress({
155
+ message: (0, shared_1.hexToBytes)(eip712Preimage),
156
+ ethAddress: axiaEthAddress,
157
+ signature: signedMessage,
158
+ recoveryId,
159
+ });
160
+ const ix = await this.program.methods
161
+ .addAxiaSig()
162
+ .accountsPartial({
163
+ solver: this.getSignerKey(),
164
+ solverRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Solver, this.getSignerKey()),
165
+ proposal: this.getProposalKey(intentHash, proposal.solver),
166
+ intent: this.getIntentKey(intentHash),
167
+ axiaRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Axia, (0, shared_1.hexToBytes)(axiaEthAddress)),
168
+ settlerSettings: this.getSettlerSettingsKey(),
169
+ ixSysvar: anchor_1.web3.SYSVAR_INSTRUCTIONS_PUBKEY,
170
+ })
171
+ .instruction();
172
+ return [secp256k1Ix, ix];
173
+ }
174
+ async executeProposalIx(intentHash, intent, proposal, remainingAccounts) {
175
+ const ix = await this.program.methods
176
+ .executeProposal()
177
+ .accountsPartial({
178
+ solver: this.getSignerKey(),
179
+ solverRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Solver, this.getSignerKey()),
180
+ proposalCreator: (0, anchor_1.translateAddress)(proposal.solver),
181
+ proposal: this.getProposalKey(intentHash, proposal.solver),
182
+ intentCreator: proposal.solver,
183
+ intent: this.getIntentKey(intentHash),
184
+ fulfilledIntent: this.getFulfilledIntentKey(intentHash),
185
+ delegate: this.getDelegateKey(intent.operations[0]?.user),
186
+ })
187
+ .remainingAccounts(remainingAccounts)
188
+ .instruction();
189
+ return ix;
190
+ }
191
+ getSettlerSettingsKey() {
192
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('settler-settings')], this.program.programId)[0];
193
+ }
194
+ getIntentKey(intentHashHex) {
195
+ const intentHash = Buffer.from(this.parseIntentHashHex(intentHashHex));
196
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('intent'), intentHash], this.program.programId)[0];
197
+ }
198
+ getFulfilledIntentKey(intentHashHex) {
199
+ const intentHash = Buffer.from(this.parseIntentHashHex(intentHashHex));
200
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('fulfilled-intent'), intentHash], this.program.programId)[0];
201
+ }
202
+ getProposalKey(intentHashHex, solverPubkey) {
203
+ this.parseIntentHashHex(intentHashHex);
204
+ const intentKey = this.getIntentKey(intentHashHex);
205
+ const solver = solverPubkey || this.getSignerKey();
206
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('proposal'), intentKey.toBuffer(), (0, anchor_1.translateAddress)(solver).toBuffer()], this.program.programId)[0];
207
+ }
208
+ getEntityRegistryKey(entityType, entityAddress) {
209
+ const addressBuffer = this.pubkeyOrBufferToBuffer(entityAddress);
210
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('entity-registry'), Buffer.from([entityType]), addressBuffer], new anchor_1.web3.PublicKey(ControllerIDL.address))[0];
211
+ }
212
+ getDelegateKey(user) {
213
+ const userKey = user ?? this.getSignerKey();
214
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('delegate'), (0, anchor_1.translateAddress)(userKey).toBuffer()], this.program.programId)[0];
215
+ }
216
+ getSignerKey() {
217
+ if (!this.program.provider.wallet)
218
+ throw new Error('Must set program provider wallet');
219
+ return this.program.provider.wallet?.publicKey;
220
+ }
221
+ opTypeToAnchorEnum(opType) {
222
+ if (opType === shared_1.OpType.Transfer)
223
+ return { transfer: {} };
224
+ if (opType === shared_1.OpType.Swap)
225
+ return { swap: {} };
226
+ if (opType === shared_1.OpType.EvmCall)
227
+ return { evmCall: {} };
228
+ if (opType === shared_1.OpType.SvmCall)
229
+ return { svmCall: {} };
230
+ throw new Error(`Unsupported opType ${opType}`);
231
+ }
232
+ anchorProposalToEip712Proposal(proposalAccount, intentHash) {
233
+ return {
234
+ intent: (0, shared_1.bytesToHex)(Uint8Array.from(intentHash)),
235
+ solver: proposalAccount.creator.toString(),
236
+ deadline: proposalAccount.deadline.toString(),
237
+ datas: ['0x'], // TODO
238
+ fees: proposalAccount.fees.map((fee) => fee.toString()),
239
+ };
240
+ }
241
+ parseSolanaEip712Domain(domain) {
242
+ if (domain.salt && domain.salt.length != 32)
243
+ throw new Error(`EIP712 domain salt must be 32 bytes`);
244
+ return {
245
+ name: null,
246
+ version: null,
247
+ ...domain,
248
+ salt: domain.salt ? Array.from(domain.salt) : null,
249
+ chainId: domain.chainId ? new anchor_1.BN(domain.chainId) : null,
250
+ };
251
+ }
252
+ parseIntentHashHex(intentHashHex) {
253
+ const intentHash = (0, shared_1.hexToBytes)(intentHashHex);
254
+ if (intentHash.length != 32)
255
+ throw new Error(`Intent hash must be 32 bytes: ${intentHashHex}`);
256
+ return Array.from(intentHash);
257
+ }
258
+ parseIntentNonceHex(nonceHex) {
259
+ const nonce = (0, shared_1.hexToBytes)(nonceHex);
260
+ if (nonce.length != 32)
261
+ throw new Error(`Nonce must be 32 bytes: ${nonceHex}`);
262
+ return Array.from(nonce);
263
+ }
264
+ parseOperationEventsHex(eventsHex) {
265
+ const events = eventsHex.map((eventHex) => ({
266
+ topic: Array.from((0, shared_1.hexToBytes)(eventHex.topic)),
267
+ data: (0, shared_1.hexToBytes)(eventHex.data),
268
+ }));
269
+ if (events.some((event) => event.topic.length != 32))
270
+ throw new Error(`Event topics must be 32 bytes`);
271
+ return events;
272
+ }
273
+ parseIntentTokenFees(tokenFees) {
274
+ return tokenFees.map((tokenFee) => ({
275
+ amount: new anchor_1.BN(tokenFee.amount),
276
+ token: (0, anchor_1.translateAddress)(tokenFee.token),
277
+ }));
278
+ }
279
+ parseProposalTokenFees(tokenFees) {
280
+ return tokenFees.map((tokenFee) => new anchor_1.BN(tokenFee));
281
+ }
282
+ parseProposalInstructions(instructions) {
283
+ return instructions.map((instruction) => ({
284
+ ...instruction,
285
+ programId: (0, anchor_1.translateAddress)(instruction.programId),
286
+ data: typeof instruction.data === 'string' ? (0, shared_1.hexToBytes)(instruction.data) : instruction.data,
287
+ }));
288
+ }
289
+ pubkeyOrBufferToBuffer(pubkeyOrBuffer) {
290
+ return Buffer.isBuffer(pubkeyOrBuffer) ? pubkeyOrBuffer : (0, anchor_1.translateAddress)(pubkeyOrBuffer).toBuffer();
291
+ }
292
+ parseSignature(signature) {
293
+ if (!(0, shared_1.isValidHex)(signature))
294
+ throw new Error('Invalid signature - not hex');
295
+ if ((0, shared_1.hexToBytes)(signature).length !== 65)
296
+ throw new Error('Invalid signature - not 65 bytes');
297
+ const parsedSig = ethers_1.ethers.Signature.from(signature);
298
+ return {
299
+ signedMessage: Buffer.from(ethers_1.ethers.getBytes(parsedSig.r + parsedSig.s.slice(2))),
300
+ recoveryId: parsedSig.v - 27,
301
+ };
302
+ }
303
+ }
304
+ exports.default = SvmSettler;
305
+ //# sourceMappingURL=Settler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settler.js","sourceRoot":"","sources":["../../../src/settler/svm/Settler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAoG;AAEpG,mCAA+B;AAE/B,qCAA2C;AAC3C,yCAAmH;AACnH,+CAAiD;AAEjD,sEAAuD;AACvD,gEAAiD;AAEjD,6CAAyC;AA8BzC,MAAqB,UAAU;IAK7B,YAAY,QAAkB;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAChD,IAAI,CAAC,eAAe,GAAG,IAAI,2BAA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