@mimicprotocol/sdk 0.0.1-rc.4 → 0.0.1-rc.41

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 -16
  6. package/dist/axia/constants.d.ts.map +1 -1
  7. package/dist/axia/constants.js +32 -19
  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 +2271 -786
  16. package/dist/axia/validators.d.ts.map +1 -1
  17. package/dist/axia/validators.js +38 -26
  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 +25 -8
  35. package/dist/client/domains/IntentsClient.d.ts.map +1 -1
  36. package/dist/client/domains/IntentsClient.js +26 -4
  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 +35 -6
  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/{ConfigSigner.js → TriggerSigner.js} +48 -25
  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 +40 -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 -401
  97. package/dist/registry/validators.d.ts.map +1 -1
  98. package/dist/registry/validators.js +144 -79
  99. package/dist/registry/validators.js.map +1 -1
  100. package/dist/relayer/eip712Types.d.ts +4 -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 +1887 -524
  105. package/dist/relayer/validators.d.ts.map +1 -1
  106. package/dist/relayer/validators.js +7 -15
  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 +22 -0
  117. package/dist/settler/svm/Controller.d.ts.map +1 -0
  118. package/dist/settler/svm/Controller.js +114 -0
  119. package/dist/settler/svm/Controller.js.map +1 -0
  120. package/dist/settler/svm/Settler.d.ts +43 -0
  121. package/dist/settler/svm/Settler.d.ts.map +1 -0
  122. package/dist/settler/svm/Settler.js +284 -0
  123. package/dist/settler/svm/Settler.js.map +1 -0
  124. package/dist/settler/svm/idls/controller.json +461 -0
  125. package/dist/settler/svm/idls/settler.json +1545 -0
  126. package/dist/settler/svm/idls/types/controller.d.ts +310 -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 +1166 -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 -0
  143. package/dist/shared/codec/chains/evm.d.ts.map +1 -0
  144. package/dist/shared/codec/chains/evm.js +122 -0
  145. package/dist/shared/codec/chains/evm.js.map +1 -0
  146. package/dist/shared/codec/chains/svm.d.ts +22 -0
  147. package/dist/shared/codec/chains/svm.d.ts.map +1 -0
  148. package/dist/shared/codec/chains/svm.js +233 -0
  149. package/dist/shared/codec/chains/svm.js.map +1 -0
  150. package/dist/shared/codec/decoder.d.ts +7 -2
  151. package/dist/shared/codec/decoder.d.ts.map +1 -1
  152. package/dist/shared/codec/decoder.js +51 -41
  153. package/dist/shared/codec/decoder.js.map +1 -1
  154. package/dist/shared/codec/encoder.d.ts +98 -5
  155. package/dist/shared/codec/encoder.d.ts.map +1 -1
  156. package/dist/shared/codec/encoder.js +38 -56
  157. package/dist/shared/codec/encoder.js.map +1 -1
  158. package/dist/shared/codec/index.d.ts +1 -0
  159. package/dist/shared/codec/index.d.ts.map +1 -1
  160. package/dist/shared/codec/index.js +14 -0
  161. package/dist/shared/codec/index.js.map +1 -1
  162. package/dist/shared/eip712Types/index.d.ts +17 -1
  163. package/dist/shared/eip712Types/index.d.ts.map +1 -1
  164. package/dist/shared/eip712Types/index.js +28 -6
  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 +11 -4
  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 +5 -0
  195. package/dist/shared/utils/chains.d.ts.map +1 -1
  196. package/dist/shared/utils/chains.js +5 -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 +4 -1
  211. package/dist/shared/utils/random.d.ts.map +1 -1
  212. package/dist/shared/utils/random.js +22 -4
  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 +11 -1
  223. package/dist/shared/utils/validations.d.ts.map +1 -1
  224. package/dist/shared/utils/validations.js +51 -3
  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 +480 -47
  235. package/dist/shared/validators/intents.d.ts.map +1 -1
  236. package/dist/shared/validators/intents.js +40 -14
  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 +32 -11
  241. package/dist/shared/validators/primitives.js.map +1 -1
  242. package/dist/validator/ValidatorSigner.d.ts +15 -6
  243. package/dist/validator/ValidatorSigner.d.ts.map +1 -1
  244. package/dist/validator/ValidatorSigner.js +31 -10
  245. package/dist/validator/ValidatorSigner.js.map +1 -1
  246. package/dist/validator/eip712Types.d.ts.map +1 -1
  247. package/dist/validator/eip712Types.js +5 -2
  248. package/dist/validator/eip712Types.js.map +1 -1
  249. package/package.json +9 -2
  250. package/dist/client/domains/ConfigsClient.d.ts +0 -18
  251. package/dist/client/domains/ConfigsClient.d.ts.map +0 -1
  252. package/dist/client/domains/ConfigsClient.js +0 -81
  253. package/dist/client/domains/ConfigsClient.js.map +0 -1
  254. package/dist/client/domains/TasksClient.d.ts +0 -11
  255. package/dist/client/domains/TasksClient.d.ts.map +0 -1
  256. package/dist/client/domains/TasksClient.js +0 -33
  257. package/dist/client/domains/TasksClient.js.map +0 -1
  258. package/dist/registry/ConfigSigner.d.ts +0 -25
  259. package/dist/registry/ConfigSigner.d.ts.map +0 -1
  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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
  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,C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1,2 @@
1
+ export * 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,22 @@
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, caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
13
+ setAdmin(newAdmin: web3.PublicKey, caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
14
+ setAllowedEntityIx(entityType: EntityType, entityAddress: web3.PublicKey | Buffer, caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
15
+ closeEntityRegistryIx(entityType: EntityType, entityAddress: web3.PublicKey | Buffer, caller?: web3.PublicKey): Promise<web3.TransactionInstruction>;
16
+ getSignerKey(): web3.PublicKey;
17
+ getControllerSettingsPubkey(): web3.PublicKey;
18
+ getEntityRegistryPubkey(entityType: EntityType, entityAddress: web3.PublicKey | Buffer): web3.PublicKey;
19
+ entityTypeToAnchorEnum(entityType: EntityType): IdlTypes<Controller>['entityType'];
20
+ private pubkeyOrBufferToBuffer;
21
+ }
22
+ //# 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,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAYlG,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAYjG,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,114 @@
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, caller) {
39
+ const controllerSettings = this.getControllerSettingsPubkey();
40
+ const ix = await this.program.methods
41
+ .initialize(admin)
42
+ .accountsPartial({
43
+ deployer: caller ?? this.getSignerKey(),
44
+ controllerSettings,
45
+ })
46
+ .instruction();
47
+ return ix;
48
+ }
49
+ async setAdmin(newAdmin, caller) {
50
+ const controllerSettings = this.getControllerSettingsPubkey();
51
+ const ix = await this.program.methods
52
+ .setAdmin(newAdmin)
53
+ .accountsPartial({
54
+ admin: caller ?? this.getSignerKey(),
55
+ controllerSettings,
56
+ })
57
+ .instruction();
58
+ return ix;
59
+ }
60
+ async setAllowedEntityIx(entityType, entityAddress, caller) {
61
+ const entityAddressBuffer = this.pubkeyOrBufferToBuffer(entityAddress);
62
+ const entityRegistry = this.getEntityRegistryPubkey(entityType, entityAddressBuffer);
63
+ const controllerSettings = this.getControllerSettingsPubkey();
64
+ const ix = await this.program.methods
65
+ .setAllowedEntity(this.entityTypeToAnchorEnum(entityType), entityAddressBuffer)
66
+ .accountsPartial({
67
+ admin: caller ?? this.getSignerKey(),
68
+ entityRegistry,
69
+ controllerSettings,
70
+ })
71
+ .instruction();
72
+ return ix;
73
+ }
74
+ async closeEntityRegistryIx(entityType, entityAddress, caller) {
75
+ const entityAddressBuffer = this.pubkeyOrBufferToBuffer(entityAddress);
76
+ const entityRegistry = this.getEntityRegistryPubkey(entityType, entityAddressBuffer);
77
+ const controllerSettings = this.getControllerSettingsPubkey();
78
+ const ix = await this.program.methods
79
+ .closeEntityRegistry(this.entityTypeToAnchorEnum(entityType), entityAddressBuffer)
80
+ .accountsPartial({
81
+ admin: caller ?? this.getSignerKey(),
82
+ entityRegistry,
83
+ controllerSettings,
84
+ })
85
+ .instruction();
86
+ return ix;
87
+ }
88
+ getSignerKey() {
89
+ if (!this.program.provider.wallet)
90
+ throw new Error('Must set program provider wallet');
91
+ return this.program.provider.wallet?.publicKey;
92
+ }
93
+ getControllerSettingsPubkey() {
94
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('controller-settings')], this.program.programId)[0];
95
+ }
96
+ getEntityRegistryPubkey(entityType, entityAddress) {
97
+ const entityAddressBuffer = this.pubkeyOrBufferToBuffer(entityAddress);
98
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('entity-registry'), Buffer.from([entityType]), entityAddressBuffer], this.program.programId)[0];
99
+ }
100
+ entityTypeToAnchorEnum(entityType) {
101
+ if (entityType === exports.EntityType.Validator)
102
+ return { validator: {} };
103
+ if (entityType === exports.EntityType.Axia)
104
+ return { axia: {} };
105
+ if (entityType === exports.EntityType.Solver)
106
+ return { solver: {} };
107
+ throw new Error(`Unsupported entity type ${entityType}`);
108
+ }
109
+ pubkeyOrBufferToBuffer(pubkeyOrBuffer) {
110
+ return Buffer.isBuffer(pubkeyOrBuffer) ? pubkeyOrBuffer : pubkeyOrBuffer.toBuffer();
111
+ }
112
+ }
113
+ exports.default = SvmController;
114
+ //# 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;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BAAsB,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;AAjGD,gCAiGC"}
@@ -0,0 +1,43 @@
1
+ import { Address, IdlTypes, Program, Provider, web3 } from '@coral-xyz/anchor';
2
+ import { OpType, Proposal } from '../../shared';
3
+ import { Settler } from './idls/types/settler';
4
+ import { EntityType } from './Controller';
5
+ import { CreateIntentParams, CreateProposalParams, ExtendIntentParams, ProposalInstruction, SolanaEip712Domain } from './types';
6
+ type ProposalAccount = NonNullable<Awaited<ReturnType<Program<Settler>['account']['proposal']['fetch']>>>;
7
+ export default class SvmSettler {
8
+ protected program: Program<Settler>;
9
+ private validatorSigner;
10
+ private proposalSigner;
11
+ constructor(provider: Provider);
12
+ initializeIx(domain: SolanaEip712Domain): Promise<web3.TransactionInstruction>;
13
+ updateEip712DomainIx(domain: SolanaEip712Domain): Promise<web3.TransactionInstruction>;
14
+ createIntentIx(intentHashHex: string, params: CreateIntentParams, isFinal?: boolean): Promise<web3.TransactionInstruction>;
15
+ extendIntentIx(intentHashHex: string, params: ExtendIntentParams, finalize?: boolean): Promise<web3.TransactionInstruction>;
16
+ claimStaleIntentIx(intentHashHex: string): Promise<web3.TransactionInstruction>;
17
+ createProposalIx(intentHashHex: string, params: CreateProposalParams): Promise<web3.TransactionInstruction>;
18
+ addInstructionsToProposalIx(intentHashHex: string, moreInstructions: ProposalInstruction[], finalize?: boolean): Promise<web3.TransactionInstruction>;
19
+ claimStaleProposalIx(intentHashHex: string): Promise<web3.TransactionInstruction>;
20
+ addValidatorSigIxs(intentHashHex: string, validatorEthAddress: string, signature: string): Promise<web3.TransactionInstruction[]>;
21
+ addAxiaSigIxs(intentHash: string, proposal: Proposal, axiaEthAddress: string, signature: string): Promise<web3.TransactionInstruction[]>;
22
+ getSettlerSettingsKey(): web3.PublicKey;
23
+ getIntentKey(intentHashHex: string): web3.PublicKey;
24
+ getFulfilledIntentKey(intentHashHex: string): web3.PublicKey;
25
+ getProposalKey(intentHashHex: string, solverPubkey?: Address): web3.PublicKey;
26
+ getEntityRegistryKey(entityType: EntityType, entityAddress: Address | Buffer): web3.PublicKey;
27
+ getSignerKey(): web3.PublicKey;
28
+ opTypeToAnchorEnum(op: OpType): IdlTypes<Settler>['opType'];
29
+ anchorProposalToEip712Proposal(proposalAccount: ProposalAccount, intentHash: number[]): Proposal & {
30
+ intent: string;
31
+ };
32
+ private parseSolanaEip712Domain;
33
+ private parseIntentHashHex;
34
+ private parseIntentNonceHex;
35
+ private parseIntentEventsHex;
36
+ private parseIntentTokenFees;
37
+ private parseProposalTokenFees;
38
+ private parseProposalInstructions;
39
+ private pubkeyOrBufferToBuffer;
40
+ private parseSignature;
41
+ }
42
+ export {};
43
+ //# sourceMappingURL=Settler.d.ts.map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C;IAS3D,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,oBAAoB;IAS5B,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,yBAAyB;IAQjC,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,cAAc;CASvB"}
@@ -0,0 +1,284 @@
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 { op, 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.parseIntentEventsHex(eventsHex);
55
+ const ix = await this.program.methods
56
+ .createIntent(intentHash, data, maxFeesBn, events, minValidations, this.opTypeToAnchorEnum(op), (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.parseIntentEventsHex(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
+ getSettlerSettingsKey() {
175
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('settler-settings')], this.program.programId)[0];
176
+ }
177
+ getIntentKey(intentHashHex) {
178
+ const intentHash = Buffer.from(this.parseIntentHashHex(intentHashHex));
179
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('intent'), intentHash], this.program.programId)[0];
180
+ }
181
+ getFulfilledIntentKey(intentHashHex) {
182
+ const intentHash = Buffer.from(this.parseIntentHashHex(intentHashHex));
183
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('fulfilled-intent'), intentHash], this.program.programId)[0];
184
+ }
185
+ getProposalKey(intentHashHex, solverPubkey) {
186
+ this.parseIntentHashHex(intentHashHex);
187
+ const intentKey = this.getIntentKey(intentHashHex);
188
+ const solver = solverPubkey || this.getSignerKey();
189
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('proposal'), intentKey.toBuffer(), (0, anchor_1.translateAddress)(solver).toBuffer()], this.program.programId)[0];
190
+ }
191
+ getEntityRegistryKey(entityType, entityAddress) {
192
+ const addressBuffer = this.pubkeyOrBufferToBuffer(entityAddress);
193
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('entity-registry'), Buffer.from([entityType]), addressBuffer], new anchor_1.web3.PublicKey(ControllerIDL.address))[0];
194
+ }
195
+ getSignerKey() {
196
+ if (!this.program.provider.wallet)
197
+ throw new Error('Must set program provider wallet');
198
+ return this.program.provider.wallet?.publicKey;
199
+ }
200
+ opTypeToAnchorEnum(op) {
201
+ if (op === shared_1.OpType.Transfer)
202
+ return { transfer: {} };
203
+ if (op === shared_1.OpType.Swap)
204
+ return { swap: {} };
205
+ if (op === shared_1.OpType.EvmCall)
206
+ return { evmCall: {} };
207
+ if (op === shared_1.OpType.SvmCall)
208
+ return { svmCall: {} };
209
+ throw new Error(`Unsupported op ${op}`);
210
+ }
211
+ anchorProposalToEip712Proposal(proposalAccount, intentHash) {
212
+ return {
213
+ intent: (0, shared_1.bytesToHex)(Uint8Array.from(intentHash)),
214
+ solver: proposalAccount.creator.toString(),
215
+ deadline: proposalAccount.deadline.toString(),
216
+ data: '0x', // TODO
217
+ fees: proposalAccount.fees.map((fee) => fee.toString()),
218
+ };
219
+ }
220
+ parseSolanaEip712Domain(domain) {
221
+ if (domain.salt && domain.salt.length != 32)
222
+ throw new Error(`EIP712 domain salt must be 32 bytes`);
223
+ return {
224
+ name: null,
225
+ version: null,
226
+ ...domain,
227
+ salt: domain.salt ? Array.from(domain.salt) : null,
228
+ chainId: domain.chainId ? new anchor_1.BN(domain.chainId) : null,
229
+ };
230
+ }
231
+ parseIntentHashHex(intentHashHex) {
232
+ const intentHash = (0, shared_1.hexToBytes)(intentHashHex);
233
+ if (intentHash.length != 32)
234
+ throw new Error(`Intent hash must be 32 bytes: ${intentHashHex}`);
235
+ return Array.from(intentHash);
236
+ }
237
+ parseIntentNonceHex(nonceHex) {
238
+ const nonce = (0, shared_1.hexToBytes)(nonceHex);
239
+ if (nonce.length != 32)
240
+ throw new Error(`Nonce must be 32 bytes: ${nonceHex}`);
241
+ return Array.from(nonce);
242
+ }
243
+ parseIntentEventsHex(eventsHex) {
244
+ const events = eventsHex.map((eventHex) => ({
245
+ topic: Array.from((0, shared_1.hexToBytes)(eventHex.topic)),
246
+ data: (0, shared_1.hexToBytes)(eventHex.data),
247
+ }));
248
+ if (events.some((event) => event.topic.length != 32))
249
+ throw new Error(`Event topics must be 32 bytes`);
250
+ return events;
251
+ }
252
+ parseIntentTokenFees(tokenFees) {
253
+ return tokenFees.map((tokenFee) => ({
254
+ amount: new anchor_1.BN(tokenFee.amount),
255
+ token: (0, anchor_1.translateAddress)(tokenFee.token),
256
+ }));
257
+ }
258
+ parseProposalTokenFees(tokenFees) {
259
+ return tokenFees.map((tokenFee) => new anchor_1.BN(tokenFee));
260
+ }
261
+ parseProposalInstructions(instructions) {
262
+ return instructions.map((instruction) => ({
263
+ ...instruction,
264
+ programId: (0, anchor_1.translateAddress)(instruction.programId),
265
+ data: typeof instruction.data === 'string' ? (0, shared_1.hexToBytes)(instruction.data) : instruction.data,
266
+ }));
267
+ }
268
+ pubkeyOrBufferToBuffer(pubkeyOrBuffer) {
269
+ return Buffer.isBuffer(pubkeyOrBuffer) ? pubkeyOrBuffer : (0, anchor_1.translateAddress)(pubkeyOrBuffer).toBuffer();
270
+ }
271
+ parseSignature(signature) {
272
+ if (!(0, shared_1.isValidHex)(signature))
273
+ throw new Error('Invalid signature - not hex');
274
+ if ((0, shared_1.hexToBytes)(signature).length !== 65)
275
+ throw new Error('Invalid signature - not 65 bytes');
276
+ const parsedSig = ethers_1.ethers.Signature.from(signature);
277
+ return {
278
+ signedMessage: Buffer.from(ethers_1.ethers.getBytes(parsedSig.r + parsedSig.s.slice(2))),
279
+ recoveryId: parsedSig.v - 27,
280
+ };
281
+ }
282
+ }
283
+ exports.default = SvmSettler;
284
+ //# sourceMappingURL=Settler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settler.js","sourceRoot":"","sources":["../../../src/settler/svm/Settler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAoG;AACpG,mCAA+B;AAE/B,qCAA2C;AAC3C,yCAAwG;AACxG,+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,2BAAe,EAAE,CAAA;QAC5C,IAAI,CAAC,cAAc,GAAG,IAAI,qBAAc,EAAE,CAAA;IAC5C,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