@mimicprotocol/sdk 0.0.1-rc.35 → 0.0.1-rc.37

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 (93) 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/index.d.ts +1 -0
  6. package/dist/axia/index.d.ts.map +1 -1
  7. package/dist/axia/index.js +1 -0
  8. package/dist/axia/index.js.map +1 -1
  9. package/dist/axia/validators.d.ts +320 -320
  10. package/dist/axia/validators.d.ts.map +1 -1
  11. package/dist/axia/validators.js +15 -16
  12. package/dist/axia/validators.js.map +1 -1
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/oracle/validators.d.ts +74 -74
  18. package/dist/registry/constants.d.ts +2 -0
  19. package/dist/registry/constants.d.ts.map +1 -0
  20. package/dist/registry/constants.js +5 -0
  21. package/dist/registry/constants.js.map +1 -0
  22. package/dist/registry/index.d.ts +1 -0
  23. package/dist/registry/index.d.ts.map +1 -1
  24. package/dist/registry/index.js +1 -0
  25. package/dist/registry/index.js.map +1 -1
  26. package/dist/registry/validators.d.ts +126 -126
  27. package/dist/registry/validators.d.ts.map +1 -1
  28. package/dist/registry/validators.js +14 -14
  29. package/dist/registry/validators.js.map +1 -1
  30. package/dist/relayer/validators.d.ts +162 -162
  31. package/dist/runner/validators.d.ts +90 -90
  32. package/dist/settler/index.d.ts +2 -0
  33. package/dist/settler/index.d.ts.map +1 -0
  34. package/dist/settler/index.js +18 -0
  35. package/dist/settler/index.js.map +1 -0
  36. package/dist/settler/svm/Controller.d.ts +22 -0
  37. package/dist/settler/svm/Controller.d.ts.map +1 -0
  38. package/dist/settler/svm/Controller.js +114 -0
  39. package/dist/settler/svm/Controller.js.map +1 -0
  40. package/dist/settler/svm/Settler.d.ts +41 -0
  41. package/dist/settler/svm/Settler.d.ts.map +1 -0
  42. package/dist/settler/svm/Settler.js +272 -0
  43. package/dist/settler/svm/Settler.js.map +1 -0
  44. package/dist/settler/svm/idls/controller.json +461 -0
  45. package/dist/settler/svm/idls/settler.json +1553 -0
  46. package/dist/settler/svm/idls/types/controller.d.ts +310 -0
  47. package/dist/settler/svm/idls/types/controller.d.ts.map +1 -0
  48. package/dist/settler/svm/idls/types/controller.js +3 -0
  49. package/dist/settler/svm/idls/types/controller.js.map +1 -0
  50. package/dist/settler/svm/idls/types/settler.d.ts +1174 -0
  51. package/dist/settler/svm/idls/types/settler.d.ts.map +1 -0
  52. package/dist/settler/svm/idls/types/settler.js +3 -0
  53. package/dist/settler/svm/idls/types/settler.js.map +1 -0
  54. package/dist/settler/svm/index.d.ts +4 -0
  55. package/dist/settler/svm/index.d.ts.map +1 -0
  56. package/dist/settler/svm/index.js +27 -0
  57. package/dist/settler/svm/index.js.map +1 -0
  58. package/dist/settler/svm/types.d.ts +44 -0
  59. package/dist/settler/svm/types.d.ts.map +1 -0
  60. package/dist/settler/svm/types.js +3 -0
  61. package/dist/settler/svm/types.js.map +1 -0
  62. package/dist/shared/codec/encoder.d.ts +1 -1
  63. package/dist/shared/utils/constants.d.ts +2 -0
  64. package/dist/shared/utils/constants.d.ts.map +1 -0
  65. package/dist/shared/utils/constants.js +5 -0
  66. package/dist/shared/utils/constants.js.map +1 -0
  67. package/dist/shared/utils/index.d.ts +1 -0
  68. package/dist/shared/utils/index.d.ts.map +1 -1
  69. package/dist/shared/utils/index.js +1 -0
  70. package/dist/shared/utils/index.js.map +1 -1
  71. package/dist/shared/utils/numbers.d.ts +6 -0
  72. package/dist/shared/utils/numbers.d.ts.map +1 -1
  73. package/dist/shared/utils/numbers.js +17 -3
  74. package/dist/shared/utils/numbers.js.map +1 -1
  75. package/dist/shared/utils/tokens.d.ts +0 -2
  76. package/dist/shared/utils/tokens.d.ts.map +1 -1
  77. package/dist/shared/utils/tokens.js +0 -4
  78. package/dist/shared/utils/tokens.js.map +1 -1
  79. package/dist/shared/utils/validations.d.ts +2 -0
  80. package/dist/shared/utils/validations.d.ts.map +1 -1
  81. package/dist/shared/utils/validations.js +8 -1
  82. package/dist/shared/utils/validations.js.map +1 -1
  83. package/dist/shared/validators/executions.d.ts +2 -2
  84. package/dist/shared/validators/intents.d.ts +10 -10
  85. package/dist/shared/validators/primitives.d.ts +2 -0
  86. package/dist/shared/validators/primitives.d.ts.map +1 -1
  87. package/dist/shared/validators/primitives.js +6 -1
  88. package/dist/shared/validators/primitives.js.map +1 -1
  89. package/dist/validator/ValidatorSigner.d.ts +4 -2
  90. package/dist/validator/ValidatorSigner.d.ts.map +1 -1
  91. package/dist/validator/ValidatorSigner.js +14 -4
  92. package/dist/validator/ValidatorSigner.js.map +1 -1
  93. package/package.json +3 -2
@@ -0,0 +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,yBA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 "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;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IACrD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,KAAqB,EAAE,MAAuB;QAC/D,MAAM,kBAAkB,GAAG,IAAI,CAAC,2BAA2B,EAAE,CAAA;QAC7D,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO;aAClC,UAAU,CAAC,KAAK,CAAC;aACjB,eAAe,CAAC;YACf,QAAQ,EAAE,MAAM,IAAI,IAAI,CAAC,YAAY,EAAE;YACvC,kBAAkB;SACnB,CAAC;aACD,WAAW,EAAE,CAAA;QAChB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAwB,EAAE,MAAuB;QAC9D,MAAM,kBAAkB,GAAG,IAAI,CAAC,2BAA2B,EAAE,CAAA;QAC7D,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO;aAClC,QAAQ,CAAC,QAAQ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C1D,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,41 @@
1
+ import { 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: Buffer, signature: number[], recoveryId: number): Promise<web3.TransactionInstruction[]>;
21
+ addAxiaSigIxs(proposal: web3.PublicKey, axiaEthAddress: Buffer, signature: number[], recoveryId: number): Promise<web3.TransactionInstruction[]>;
22
+ getSettlerSettingsKey(): web3.PublicKey;
23
+ getIntentKey(intentHashHex: string): web3.PublicKey;
24
+ getFulfilledIntentKey(intentHashHex: string): web3.PublicKey;
25
+ getProposalKey(intentHashHex: string, solverPubkey?: web3.PublicKey): web3.PublicKey;
26
+ getEntityRegistryKey(entityType: EntityType, entityAddress: web3.PublicKey | 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 parseTokenFees;
37
+ private parseProposalInstructions;
38
+ private pubkeyOrBufferToBuffer;
39
+ }
40
+ export {};
41
+ //# 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,EAAM,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAA+C,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAK5F,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;AAGzG,MAAM,CAAC,OAA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AAC,SAAS,EACxB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,EAAE,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAmCzC,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,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS;IAYpF,oBAAoB,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,GAAG,MAAM,GAAG,IAAI,CAAC,SAAS;IAQpG,YAAY,IAAI,IAAI,CAAC,SAAS;IAK9B,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;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,cAAc;IAOtB,OAAO,CAAC,yBAAyB;IAOjC,OAAO,CAAC,sBAAsB;CAG/B"}
@@ -0,0 +1,272 @@
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 axia_1 = require("../../axia");
28
+ const shared_1 = require("../../shared");
29
+ const validator_1 = require("../../validator");
30
+ const ControllerIDL = __importStar(require("./idls/controller.json"));
31
+ const SettlerIDL = __importStar(require("./idls/settler.json"));
32
+ const Controller_1 = require("./Controller");
33
+ class SvmSettler {
34
+ constructor(provider) {
35
+ this.program = new anchor_1.Program(SettlerIDL, provider);
36
+ this.validatorSigner = new validator_1.ValidatorSigner();
37
+ this.proposalSigner = new axia_1.ProposalSigner();
38
+ }
39
+ async initializeIx(domain) {
40
+ const ix = await this.program.methods.initialize(this.parseSolanaEip712Domain(domain)).instruction();
41
+ return ix;
42
+ }
43
+ async updateEip712DomainIx(domain) {
44
+ const ix = await this.program.methods.updateEip712Domain(this.parseSolanaEip712Domain(domain)).instruction();
45
+ return ix;
46
+ }
47
+ async createIntentIx(intentHashHex, params, isFinal = true) {
48
+ const { op, user, nonceHex, deadline, minValidations, dataHex, maxFees, eventsHex } = params;
49
+ const intentHash = this.parseIntentHashHex(intentHashHex);
50
+ const nonce = this.parseIntentNonceHex(nonceHex);
51
+ const data = (0, shared_1.hexToBytes)(dataHex);
52
+ const maxFeesBn = this.parseTokenFees(maxFees);
53
+ const events = this.parseIntentEventsHex(eventsHex);
54
+ const ix = await this.program.methods
55
+ .createIntent(intentHash, data, maxFeesBn, events, minValidations, this.opTypeToAnchorEnum(op), user, nonce, new anchor_1.BN(deadline), isFinal)
56
+ .accountsPartial({
57
+ solver: this.getSignerKey(),
58
+ solverRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Solver, this.getSignerKey()),
59
+ })
60
+ .instruction();
61
+ return ix;
62
+ }
63
+ async extendIntentIx(intentHashHex, params, finalize = true) {
64
+ const { moreDataHex = '', moreMaxFees = [], moreEventsHex = [] } = params;
65
+ const moreData = (0, shared_1.hexToBytes)(moreDataHex);
66
+ const moreMaxFeesBn = this.parseTokenFees(moreMaxFees);
67
+ const moreEvents = this.parseIntentEventsHex(moreEventsHex);
68
+ const ix = await this.program.methods
69
+ .extendIntent(moreData, moreMaxFeesBn, moreEvents, finalize)
70
+ .accountsPartial({
71
+ creator: this.getSignerKey(),
72
+ intent: this.getIntentKey(intentHashHex),
73
+ })
74
+ .instruction();
75
+ return ix;
76
+ }
77
+ async claimStaleIntentIx(intentHashHex) {
78
+ const ix = await this.program.methods
79
+ .claimStaleIntent()
80
+ .accountsPartial({
81
+ creator: this.getSignerKey(),
82
+ intent: this.getIntentKey(intentHashHex),
83
+ })
84
+ .instruction();
85
+ return ix;
86
+ }
87
+ async createProposalIx(intentHashHex, params) {
88
+ const { instructions, fees, deadline, isFinal } = params;
89
+ const parsedInstructions = this.parseProposalInstructions(instructions);
90
+ const parsedFees = this.parseTokenFees(fees);
91
+ const ix = await this.program.methods
92
+ .createProposal(parsedInstructions, parsedFees, new anchor_1.BN(deadline), isFinal ?? false)
93
+ .accountsPartial({
94
+ solver: this.getSignerKey(),
95
+ solverRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Solver, this.getSignerKey()),
96
+ intent: this.getIntentKey(intentHashHex),
97
+ fulfilledIntent: this.getFulfilledIntentKey(intentHashHex),
98
+ })
99
+ .instruction();
100
+ return ix;
101
+ }
102
+ async addInstructionsToProposalIx(intentHashHex, moreInstructions, finalize = true) {
103
+ const parsedInstructions = this.parseProposalInstructions(moreInstructions);
104
+ const ix = await this.program.methods
105
+ .addInstructionsToProposal(parsedInstructions, finalize)
106
+ .accountsPartial({
107
+ creator: this.getSignerKey(),
108
+ proposal: this.getProposalKey(intentHashHex),
109
+ })
110
+ .instruction();
111
+ return ix;
112
+ }
113
+ async claimStaleProposalIx(intentHashHex) {
114
+ const ix = await this.program.methods
115
+ .claimStaleProposal()
116
+ .accountsPartial({
117
+ creator: this.getSignerKey(),
118
+ proposal: this.getProposalKey(intentHashHex),
119
+ })
120
+ .instruction();
121
+ return ix;
122
+ }
123
+ async addValidatorSigIxs(intentHashHex, validatorEthAddress, signature, recoveryId) {
124
+ const eip712Preimage = this.validatorSigner.getIntentMessage({
125
+ hash: intentHashHex,
126
+ settler: this.program.programId.toString(),
127
+ chainId: shared_1.Chains.Solana,
128
+ });
129
+ const secp256k1Ix = anchor_1.web3.Secp256k1Program.createInstructionWithEthAddress({
130
+ message: (0, shared_1.hexToBytes)(eip712Preimage),
131
+ ethAddress: validatorEthAddress,
132
+ signature: Buffer.from(signature),
133
+ recoveryId,
134
+ });
135
+ const ix = await this.program.methods
136
+ .addValidatorSig()
137
+ .accountsPartial({
138
+ solver: this.getSignerKey(),
139
+ solverRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Solver, this.getSignerKey()),
140
+ intent: this.getIntentKey(intentHashHex),
141
+ fulfilledIntent: this.getFulfilledIntentKey(intentHashHex),
142
+ validatorRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Validator, validatorEthAddress),
143
+ settlerSettings: this.getSettlerSettingsKey(),
144
+ ixSysvar: anchor_1.web3.SYSVAR_INSTRUCTIONS_PUBKEY,
145
+ })
146
+ .instruction();
147
+ return [secp256k1Ix, ix];
148
+ }
149
+ async addAxiaSigIxs(proposal, axiaEthAddress, signature, recoveryId) {
150
+ const proposalAccount = await this.program.account.proposal.fetchNullable(proposal);
151
+ if (!proposalAccount)
152
+ throw new Error(`Couldn't fetch Proposal at address ${proposal}`);
153
+ const intentAccount = await this.program.account.intent.fetchNullable(proposalAccount.intent);
154
+ if (!intentAccount)
155
+ throw new Error(`Couldn't fetch Intent at address ${proposalAccount.intent}`);
156
+ const eip712Preimage = this.proposalSigner.getMessage(this.anchorProposalToEip712Proposal(proposalAccount, intentAccount.hash), { chainId: shared_1.Chains.Solana, address: this.program.programId.toString() });
157
+ const secp256k1Ix = anchor_1.web3.Secp256k1Program.createInstructionWithEthAddress({
158
+ message: (0, shared_1.hexToBytes)(eip712Preimage),
159
+ ethAddress: axiaEthAddress,
160
+ signature: Buffer.from(signature),
161
+ recoveryId,
162
+ });
163
+ const ix = await this.program.methods
164
+ .addAxiaSig()
165
+ .accountsPartial({
166
+ solver: this.getSignerKey(),
167
+ solverRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Solver, this.getSignerKey()),
168
+ proposal,
169
+ intent: proposalAccount.intent,
170
+ axiaRegistry: this.getEntityRegistryKey(Controller_1.EntityType.Axia, axiaEthAddress),
171
+ settlerSettings: this.getSettlerSettingsKey(),
172
+ ixSysvar: anchor_1.web3.SYSVAR_INSTRUCTIONS_PUBKEY,
173
+ })
174
+ .instruction();
175
+ return [secp256k1Ix, ix];
176
+ }
177
+ getSettlerSettingsKey() {
178
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('settler-settings')], this.program.programId)[0];
179
+ }
180
+ getIntentKey(intentHashHex) {
181
+ const intentHash = Buffer.from(this.parseIntentHashHex(intentHashHex));
182
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('intent'), intentHash], this.program.programId)[0];
183
+ }
184
+ getFulfilledIntentKey(intentHashHex) {
185
+ const intentHash = Buffer.from(this.parseIntentHashHex(intentHashHex));
186
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('fulfilled-intent'), intentHash], this.program.programId)[0];
187
+ }
188
+ getProposalKey(intentHashHex, solverPubkey) {
189
+ this.parseIntentHashHex(intentHashHex);
190
+ const intentKey = this.getIntentKey(intentHashHex);
191
+ const solver = solverPubkey || this.getSignerKey();
192
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('proposal'), intentKey.toBuffer(), solver.toBuffer()], this.program.programId)[0];
193
+ }
194
+ getEntityRegistryKey(entityType, entityAddress) {
195
+ const addressBuffer = this.pubkeyOrBufferToBuffer(entityAddress);
196
+ return anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from('entity-registry'), Buffer.from([entityType]), addressBuffer], new anchor_1.web3.PublicKey(ControllerIDL.address))[0];
197
+ }
198
+ getSignerKey() {
199
+ if (!this.program.provider.wallet)
200
+ throw new Error('Must set program provider wallet');
201
+ return this.program.provider.wallet?.publicKey;
202
+ }
203
+ opTypeToAnchorEnum(op) {
204
+ if (op === shared_1.OpType.Transfer)
205
+ return { transfer: {} };
206
+ if (op === shared_1.OpType.Swap)
207
+ return { swap: {} };
208
+ if (op === shared_1.OpType.EvmCall)
209
+ return { evmCall: {} };
210
+ if (op === shared_1.OpType.SvmCall)
211
+ return { svmCall: {} };
212
+ throw new Error(`Unsupported op ${op}`);
213
+ }
214
+ anchorProposalToEip712Proposal(proposalAccount, intentHash) {
215
+ return {
216
+ intent: (0, shared_1.bytesToHex)(Uint8Array.from(intentHash)),
217
+ solver: proposalAccount.creator.toString(),
218
+ deadline: proposalAccount.deadline.toString(),
219
+ data: '0x', // TODO
220
+ fees: proposalAccount.fees.map((fee) => fee.amount.toString()),
221
+ };
222
+ }
223
+ parseSolanaEip712Domain(domain) {
224
+ if (domain.salt && domain.salt.length != 32)
225
+ throw new Error(`EIP712 domain salt must be 32 bytes`);
226
+ return {
227
+ name: null,
228
+ version: null,
229
+ ...domain,
230
+ salt: domain.salt ? Array.from(domain.salt) : null,
231
+ chainId: domain.chainId ? new anchor_1.BN(domain.chainId) : null,
232
+ };
233
+ }
234
+ parseIntentHashHex(intentHashHex) {
235
+ const intentHash = (0, shared_1.hexToBytes)(intentHashHex);
236
+ if (intentHash.length != 32)
237
+ throw new Error(`Intent hash must be 32 bytes: ${intentHashHex}`);
238
+ return Array.from(intentHash);
239
+ }
240
+ parseIntentNonceHex(nonceHex) {
241
+ const nonce = (0, shared_1.hexToBytes)(nonceHex);
242
+ if (nonce.length != 32)
243
+ throw new Error(`Nonce must be 32 bytes: ${nonceHex}`);
244
+ return Array.from(nonce);
245
+ }
246
+ parseIntentEventsHex(eventsHex) {
247
+ const events = eventsHex.map((eventHex) => ({
248
+ topic: Array.from((0, shared_1.hexToBytes)(eventHex.topic)),
249
+ data: (0, shared_1.hexToBytes)(eventHex.data),
250
+ }));
251
+ if (events.some((event) => event.topic.length != 32))
252
+ throw new Error(`Event topics must be 32 bytes`);
253
+ return events;
254
+ }
255
+ parseTokenFees(tokenFees) {
256
+ return tokenFees.map((tokenFee) => ({
257
+ ...tokenFee,
258
+ amount: new anchor_1.BN(tokenFee.amount),
259
+ }));
260
+ }
261
+ parseProposalInstructions(instructions) {
262
+ return instructions.map((instruction) => ({
263
+ ...instruction,
264
+ data: typeof instruction.data === 'string' ? (0, shared_1.hexToBytes)(instruction.data) : instruction.data,
265
+ }));
266
+ }
267
+ pubkeyOrBufferToBuffer(pubkeyOrBuffer) {
268
+ return Buffer.isBuffer(pubkeyOrBuffer) ? pubkeyOrBuffer : pubkeyOrBuffer.toBuffer();
269
+ }
270
+ }
271
+ exports.default = SvmSettler;
272
+ //# sourceMappingURL=Settler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settler.js","sourceRoot":"","sources":["../../../src/settler/svm/Settler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAyE;AAEzE,qCAA2C;AAC3C,yCAA4F;AAC5F,+CAAiD;AAEjD,sEAAuD;AACvD,gEAAiD;AAEjD,6CAAyC;AA+BzC,MAAqB,UAAU;IAK7B,YAAY,QAAmB;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAO,CAAC,UAAU,EAAE,QAAQ,CAAC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