@continuumdao/ctm-mpc-defi 0.2.50 → 0.2.51

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 (38) hide show
  1. package/dist/agent/catalog.cjs +770 -28
  2. package/dist/agent/catalog.cjs.map +1 -1
  3. package/dist/agent/catalog.d.ts +6 -1
  4. package/dist/agent/catalog.js +770 -28
  5. package/dist/agent/catalog.js.map +1 -1
  6. package/dist/agent/skills/continuum-dao/SKILL.md +2 -0
  7. package/dist/agent/skills/continuum-dao-marketplace/SKILL.md +58 -0
  8. package/dist/agent/skills/hyperliquidOutcome/SKILL.md +47 -0
  9. package/dist/core/index.cjs +2 -1
  10. package/dist/core/index.cjs.map +1 -1
  11. package/dist/core/index.js +2 -1
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/index.cjs +2 -1
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.js +2 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
  18. package/dist/protocols/evm/aerodrome/index.js.map +1 -1
  19. package/dist/protocols/evm/continuum-dao/index.cjs +2274 -59
  20. package/dist/protocols/evm/continuum-dao/index.cjs.map +1 -1
  21. package/dist/protocols/evm/continuum-dao/index.d.ts +690 -2
  22. package/dist/protocols/evm/continuum-dao/index.js +2218 -61
  23. package/dist/protocols/evm/continuum-dao/index.js.map +1 -1
  24. package/dist/protocols/evm/hyperliquidOutcome/index.cjs +1294 -0
  25. package/dist/protocols/evm/hyperliquidOutcome/index.cjs.map +1 -0
  26. package/dist/protocols/evm/hyperliquidOutcome/index.d.ts +465 -0
  27. package/dist/protocols/evm/hyperliquidOutcome/index.js +1247 -0
  28. package/dist/protocols/evm/hyperliquidOutcome/index.js.map +1 -0
  29. package/dist/protocols/evm/pendle/index.cjs +2 -1
  30. package/dist/protocols/evm/pendle/index.cjs.map +1 -1
  31. package/dist/protocols/evm/pendle/index.js +2 -1
  32. package/dist/protocols/evm/pendle/index.js.map +1 -1
  33. package/dist/protocols/evm/trueo/index.cjs +569 -9
  34. package/dist/protocols/evm/trueo/index.cjs.map +1 -1
  35. package/dist/protocols/evm/trueo/index.d.ts +42 -1
  36. package/dist/protocols/evm/trueo/index.js +569 -9
  37. package/dist/protocols/evm/trueo/index.js.map +1 -1
  38. package/package.json +6 -1
@@ -0,0 +1,465 @@
1
+ /** Aligns with app NonEvmChainType + 'evm'. Extend as mpc-auth adds chains. */
2
+ type ChainCategory = 'evm' | 'solana' | 'near' | 'sui' | 'ton' | 'stellar';
3
+ type MultisignBuildResult = {
4
+ bodyForSign: Record<string, unknown>;
5
+ messageToSign: string;
6
+ };
7
+ type EvmTokenKind = 'native' | 'erc20' | 'erc721' | 'ctmerc20' | 'ctmrwa1';
8
+ type SolanaTokenKind = 'native' | 'spl' | 'spl2022';
9
+ type NearTokenKind = 'native' | 'nep141';
10
+ type TokenRef = {
11
+ category: 'evm';
12
+ kind: EvmTokenKind;
13
+ address: `0x${string}`;
14
+ } | {
15
+ category: 'solana';
16
+ kind: SolanaTokenKind;
17
+ mint: string;
18
+ } | {
19
+ category: 'near';
20
+ kind: NearTokenKind;
21
+ contractId: string;
22
+ };
23
+ type ParamDoc = {
24
+ type: string;
25
+ required: boolean;
26
+ description: string;
27
+ };
28
+ type ProtocolActionDescriptor = {
29
+ id: string;
30
+ protocolId: string;
31
+ chainCategory: ChainCategory;
32
+ description: string;
33
+ commonParams: Array<'keyGen' | 'purposeText' | 'useCustomGas' | 'useCustomFees'>;
34
+ params: Record<string, ParamDoc>;
35
+ };
36
+ type ChainSupportContext = {
37
+ chainCategory: ChainCategory;
38
+ chainId: string | number;
39
+ };
40
+ interface ProtocolModule {
41
+ id: string;
42
+ chainCategory: ChainCategory;
43
+ isChainSupported(ctx: ChainSupportContext): boolean | Promise<boolean>;
44
+ isTokenSupported(token: TokenRef): boolean | Promise<boolean>;
45
+ actions: ProtocolActionDescriptor[];
46
+ }
47
+ type KeyGenSubset = {
48
+ pubkeyhex?: string;
49
+ keylist?: string[];
50
+ ClientKeys?: Record<string, string>;
51
+ groupId?: string;
52
+ GroupId?: string;
53
+ };
54
+ /** App-compatible alias used by multisign builders and Permit2 helpers. */
55
+ type KeyGenSubsetForPermit = KeyGenSubset;
56
+
57
+ /** HIP-4 outcome id + side (0 = first side, usually Yes). */
58
+ declare function outcomeEncoding(outcome: number, side: number): number;
59
+ declare function outcomeTradeCoin(encoding: number): string;
60
+ declare function outcomeBalanceCoin(encoding: number): string;
61
+ declare function outcomeAssetId(encoding: number): number;
62
+ declare function outcomeSideIndex(side: 'yes' | 'no' | 0 | 1): 0 | 1;
63
+ declare function outcomeSideName(name: string | undefined, fallback: string): string;
64
+ type HyperliquidOutcomeSideSpec = {
65
+ name?: string;
66
+ };
67
+ type HyperliquidOutcomeMeta = {
68
+ outcome: number;
69
+ name: string;
70
+ description: string;
71
+ sideSpecs?: HyperliquidOutcomeSideSpec[];
72
+ quoteToken?: string;
73
+ venue?: string;
74
+ deployerFeeScale?: string;
75
+ };
76
+ type HyperliquidOutcomeQuestion = {
77
+ question: number;
78
+ name?: string;
79
+ description?: string;
80
+ fallbackOutcome?: number;
81
+ namedOutcomes?: number[];
82
+ settledNamedOutcomes?: number[];
83
+ };
84
+ declare function parseHyperliquidPipeFields(description: string | undefined): Record<string, string>;
85
+ /** `20261001-0000` → unix seconds UTC. */
86
+ declare function parseHyperliquidStamp(raw: string | undefined): number | null;
87
+ declare function formatHyperliquidStamp(unixSec: number | null): string | null;
88
+ declare function questionForOutcome(outcomeId: number, questions: readonly HyperliquidOutcomeQuestion[]): HyperliquidOutcomeQuestion | undefined;
89
+ declare function formatOutcomeQuestion(outcome: HyperliquidOutcomeMeta, question?: HyperliquidOutcomeQuestion): string;
90
+ type HyperliquidOutcomeTemplate = {
91
+ id: string;
92
+ description?: string;
93
+ role?: string | {
94
+ questionOutcome?: {
95
+ parent?: string;
96
+ };
97
+ };
98
+ };
99
+ declare function outcomeTemplateId(name: string | undefined): string;
100
+ declare function outcomeFieldMap(outcome: HyperliquidOutcomeMeta, question?: HyperliquidOutcomeQuestion): Record<string, string>;
101
+ declare function fillOutcomeTemplate(text: string, fields: Record<string, string>): string;
102
+ declare function resolveOutcomeSideLabel(specName: string | undefined, fields: Record<string, string>, fallback: string): string;
103
+ /** Official template text with this market's fields filled in. */
104
+ declare function formatOutcomeRules(outcome: HyperliquidOutcomeMeta, question?: HyperliquidOutcomeQuestion, templates?: readonly HyperliquidOutcomeTemplate[]): string;
105
+ declare function outcomeExpiryUnix(outcome: HyperliquidOutcomeMeta, question?: HyperliquidOutcomeQuestion): number;
106
+
107
+ declare const HYPERLIQUID_OUTCOME_PROTOCOL_ID = "hyperliquidOutcome";
108
+ declare const HYPERLIQUID_OUTCOME_MAINNET_CHAIN_ID = 999;
109
+ type OutcomeBookLevel = {
110
+ px: string;
111
+ sz: string;
112
+ n: number;
113
+ };
114
+ type OutcomeBook = {
115
+ coin: string;
116
+ time: number | null;
117
+ bids: OutcomeBookLevel[];
118
+ asks: OutcomeBookLevel[];
119
+ };
120
+ type HyperliquidOutcomeMarket = {
121
+ outcome: number;
122
+ name: string;
123
+ description: string;
124
+ question: string;
125
+ questionId: number | null;
126
+ sideNames: [string, string];
127
+ quoteToken: string;
128
+ venue: string;
129
+ categories: string[];
130
+ yesEncoding: number;
131
+ noEncoding: number;
132
+ yesCoin: string;
133
+ noCoin: string;
134
+ yesAssetId: number;
135
+ noAssetId: number;
136
+ yesBalanceCoin: string;
137
+ noBalanceCoin: string;
138
+ yesPrice: number | null;
139
+ noPrice: number | null;
140
+ yesPriceLabel: string | null;
141
+ noPriceLabel: string | null;
142
+ expiresAt: string | null;
143
+ endOfTrading: number;
144
+ status: 'live' | 'closed';
145
+ tradable: boolean;
146
+ rules: string;
147
+ };
148
+ declare function clearHyperliquidOutcomeMetaCache(): void;
149
+ declare function hyperliquidOutcomeMatchesQuery(market: HyperliquidOutcomeMarket, query: string): boolean;
150
+ declare function listHyperliquidOutcomeMarkets(args: {
151
+ chainId?: number;
152
+ query?: string;
153
+ }): Promise<{
154
+ markets: HyperliquidOutcomeMarket[];
155
+ questions: HyperliquidOutcomeQuestion[];
156
+ }>;
157
+ declare function getHyperliquidOutcomeMarket(args: {
158
+ chainId?: number;
159
+ outcomeId: number;
160
+ }): Promise<HyperliquidOutcomeMarket>;
161
+ type OutcomeChanceBar = {
162
+ timestamp: number;
163
+ open: number;
164
+ high: number;
165
+ low: number;
166
+ close: number;
167
+ };
168
+ /** Hourly Yes/No mid history from candleSnapshot. Closes are probabilities in 0–1. */
169
+ declare function fetchHyperliquidOutcomeChanceSeries(args: {
170
+ chainId?: number;
171
+ coin: string;
172
+ }): Promise<OutcomeChanceBar[]>;
173
+ declare function fetchHyperliquidOutcomeBook(args: {
174
+ chainId?: number;
175
+ coin: string;
176
+ }): Promise<OutcomeBook>;
177
+ type OutcomeBalance = {
178
+ coin: string;
179
+ total: string;
180
+ hold: string;
181
+ outcome: number | null;
182
+ side: 'yes' | 'no' | null;
183
+ };
184
+ type OutcomeOpenOrder = {
185
+ coin: string;
186
+ side: string;
187
+ limitPx: string;
188
+ sz: string;
189
+ oid: number;
190
+ timestamp: number;
191
+ outcome: number | null;
192
+ outcomeSide: 'yes' | 'no' | null;
193
+ };
194
+ declare function fetchHyperliquidOutcomeAccount(args: {
195
+ chainId?: number;
196
+ user: string;
197
+ }): Promise<{
198
+ quoteBalances: Array<{
199
+ coin: string;
200
+ total: string;
201
+ hold: string;
202
+ }>;
203
+ outcomeBalances: OutcomeBalance[];
204
+ openOrders: OutcomeOpenOrder[];
205
+ }>;
206
+
207
+ type HyperliquidOutcomePurposeAction = 'order' | 'cancel' | 'split' | 'merge' | 'mergeQuestion' | 'negate';
208
+ declare function buildHyperliquidOutcomePurposePrefill(args: {
209
+ action: HyperliquidOutcomePurposeAction;
210
+ question?: string;
211
+ side?: 'yes' | 'no';
212
+ isBuy?: boolean;
213
+ szHuman?: string;
214
+ limitPxHuman?: string;
215
+ tif?: string;
216
+ amountHuman?: string;
217
+ oid?: number;
218
+ }): string;
219
+
220
+ type HyperliquidL1Tif = 'Alo' | 'Gtc' | 'Ioc';
221
+ type HyperliquidOrderGrouping = 'na' | 'normalTpsl' | 'positionTpsl';
222
+ type HyperliquidOrderWire = {
223
+ a: number;
224
+ b: boolean;
225
+ p: string;
226
+ s: string;
227
+ r: boolean;
228
+ t: {
229
+ limit: {
230
+ tif: HyperliquidL1Tif;
231
+ };
232
+ } | {
233
+ trigger: {
234
+ isMarket: boolean;
235
+ triggerPx: string;
236
+ tpsl: 'tp' | 'sl';
237
+ };
238
+ };
239
+ c?: string;
240
+ };
241
+ type HyperliquidOrderAction = {
242
+ type: 'order';
243
+ orders: HyperliquidOrderWire[];
244
+ grouping: HyperliquidOrderGrouping;
245
+ };
246
+
247
+ type OutcomeMultisignCommon = {
248
+ keyGen: KeyGenSubsetForPermit;
249
+ chainId: number;
250
+ purposeText: string;
251
+ nonce?: number;
252
+ expiryDate?: number;
253
+ };
254
+ type HyperliquidOutcomeOrderArgs = OutcomeMultisignCommon & {
255
+ outcome: number;
256
+ side: 'yes' | 'no';
257
+ isBuy: boolean;
258
+ limitPxHuman: string;
259
+ szHuman: string;
260
+ tif?: string;
261
+ reduceOnly?: boolean;
262
+ };
263
+ declare function buildHyperliquidOutcomeOrderAction(args: {
264
+ outcome: number;
265
+ side: 'yes' | 'no';
266
+ isBuy: boolean;
267
+ limitPxHuman: string;
268
+ szHuman: string;
269
+ tif?: string;
270
+ reduceOnly?: boolean;
271
+ }): {
272
+ encoding: number;
273
+ coin: string;
274
+ asset: number;
275
+ action: HyperliquidOrderAction;
276
+ };
277
+ declare function buildEvmMultisignBodyHyperliquidOutcomeOrder(args: HyperliquidOutcomeOrderArgs): Promise<MultisignBuildResult>;
278
+ declare function buildHyperliquidOutcomeCancelAction(args: {
279
+ outcome: number;
280
+ side: 'yes' | 'no';
281
+ oid: number;
282
+ }): {
283
+ encoding: number;
284
+ coin: string;
285
+ asset: number;
286
+ action: {
287
+ type: string;
288
+ cancels: {
289
+ a: number;
290
+ o: number;
291
+ }[];
292
+ };
293
+ };
294
+ declare function buildEvmMultisignBodyHyperliquidOutcomeCancel(args: OutcomeMultisignCommon & {
295
+ outcome: number;
296
+ side: 'yes' | 'no';
297
+ oid: number;
298
+ }): Promise<MultisignBuildResult>;
299
+ declare function buildHyperliquidOutcomeSplitAction(args: {
300
+ outcome: number;
301
+ amountHuman: string;
302
+ }): {
303
+ type: "userOutcome";
304
+ splitOutcome: {
305
+ outcome: number;
306
+ amount: string;
307
+ };
308
+ };
309
+ declare function buildEvmMultisignBodyHyperliquidOutcomeSplit(args: OutcomeMultisignCommon & {
310
+ outcome: number;
311
+ amountHuman: string;
312
+ }): Promise<MultisignBuildResult>;
313
+ declare function buildHyperliquidOutcomeMergeAction(args: {
314
+ outcome: number;
315
+ amountHuman?: string;
316
+ amountMax?: boolean;
317
+ }): {
318
+ type: "userOutcome";
319
+ mergeOutcome: {
320
+ outcome: number;
321
+ amount: string | null;
322
+ };
323
+ };
324
+ declare function buildEvmMultisignBodyHyperliquidOutcomeMerge(args: OutcomeMultisignCommon & {
325
+ outcome: number;
326
+ amountHuman?: string;
327
+ amountMax?: boolean;
328
+ }): Promise<MultisignBuildResult>;
329
+ declare function buildHyperliquidOutcomeMergeQuestionAction(args: {
330
+ question: number;
331
+ amountHuman?: string;
332
+ amountMax?: boolean;
333
+ }): {
334
+ type: "userOutcome";
335
+ mergeQuestion: {
336
+ question: number;
337
+ amount: string | null;
338
+ };
339
+ };
340
+ declare function buildEvmMultisignBodyHyperliquidOutcomeMergeQuestion(args: OutcomeMultisignCommon & {
341
+ question: number;
342
+ amountHuman?: string;
343
+ amountMax?: boolean;
344
+ }): Promise<MultisignBuildResult>;
345
+ declare function buildHyperliquidOutcomeNegateAction(args: {
346
+ question: number;
347
+ outcome: number;
348
+ amountHuman: string;
349
+ }): {
350
+ type: "userOutcome";
351
+ negateOutcome: {
352
+ question: number;
353
+ outcome: number;
354
+ amount: string;
355
+ };
356
+ };
357
+ declare function buildEvmMultisignBodyHyperliquidOutcomeNegate(args: OutcomeMultisignCommon & {
358
+ question: number;
359
+ outcome: number;
360
+ amountHuman: string;
361
+ }): Promise<MultisignBuildResult>;
362
+
363
+ declare function hyperliquidOutcomeToPredictionFields(market: HyperliquidOutcomeMarket, chainId: number): {
364
+ venue: "hyperliquid";
365
+ venueMarketId: string;
366
+ question: string;
367
+ categories: string[];
368
+ yesPrice: number | null;
369
+ noPrice: number | null;
370
+ yesPriceLabel: string | null;
371
+ noPriceLabel: string | null;
372
+ volume: string;
373
+ tvl: null;
374
+ expiresAt: string | null;
375
+ expiresAtLabel: string | null;
376
+ tradingEndsLabel: string;
377
+ endOfTrading: number;
378
+ status: "live" | "closed";
379
+ outcome: number;
380
+ statusUpdatedAt: null;
381
+ resolutionLabel: null;
382
+ chainId: number;
383
+ paymentSymbol: string;
384
+ tradable: boolean;
385
+ rules: string;
386
+ source: string;
387
+ };
388
+ declare function hyperliquidOutcomeFetchMarketsSummary(input: {
389
+ chainId?: number;
390
+ query?: string;
391
+ limit?: number;
392
+ offset?: number;
393
+ }): Promise<{
394
+ markets: HyperliquidOutcomeMarket[];
395
+ hasMore: boolean;
396
+ nextOffset: number;
397
+ notes: string;
398
+ }>;
399
+ declare function hyperliquidOutcomeFetchMarketSummary(input: {
400
+ chainId?: number;
401
+ outcome: number;
402
+ }): Promise<{
403
+ yesBook: OutcomeBook;
404
+ noBook: OutcomeBook;
405
+ notes: string;
406
+ outcome: number;
407
+ name: string;
408
+ description: string;
409
+ question: string;
410
+ questionId: number | null;
411
+ sideNames: [string, string];
412
+ quoteToken: string;
413
+ venue: string;
414
+ categories: string[];
415
+ yesEncoding: number;
416
+ noEncoding: number;
417
+ yesCoin: string;
418
+ noCoin: string;
419
+ yesAssetId: number;
420
+ noAssetId: number;
421
+ yesBalanceCoin: string;
422
+ noBalanceCoin: string;
423
+ yesPrice: number | null;
424
+ noPrice: number | null;
425
+ yesPriceLabel: string | null;
426
+ noPriceLabel: string | null;
427
+ expiresAt: string | null;
428
+ endOfTrading: number;
429
+ status: "live" | "closed";
430
+ tradable: boolean;
431
+ rules: string;
432
+ }>;
433
+ declare function hyperliquidOutcomeFetchOrderbookSummary(input: {
434
+ chainId?: number;
435
+ outcome: number;
436
+ side?: 'yes' | 'no';
437
+ }): Promise<{
438
+ outcome: number;
439
+ side: "yes" | "no";
440
+ book: OutcomeBook;
441
+ notes: string;
442
+ }>;
443
+ declare function hyperliquidOutcomeFetchPositionsSummary(input: {
444
+ chainId?: number;
445
+ user: string;
446
+ }): Promise<{
447
+ quoteBalances: {
448
+ coin: string;
449
+ total: string;
450
+ hold: string;
451
+ }[];
452
+ outcomeBalances: OutcomeBalance[];
453
+ notes: string;
454
+ }>;
455
+ declare function hyperliquidOutcomeFetchOpenOrdersSummary(input: {
456
+ chainId?: number;
457
+ user: string;
458
+ }): Promise<{
459
+ openOrders: OutcomeOpenOrder[];
460
+ notes: string;
461
+ }>;
462
+
463
+ declare const hyperliquidOutcomeProtocolModule: ProtocolModule;
464
+
465
+ export { HYPERLIQUID_OUTCOME_MAINNET_CHAIN_ID, HYPERLIQUID_OUTCOME_PROTOCOL_ID, type HyperliquidOutcomeMarket, type HyperliquidOutcomeMeta, type HyperliquidOutcomeOrderArgs, type HyperliquidOutcomePurposeAction, type HyperliquidOutcomeQuestion, type HyperliquidOutcomeSideSpec, type HyperliquidOutcomeTemplate, type OutcomeBalance, type OutcomeBook, type OutcomeBookLevel, type OutcomeChanceBar, type OutcomeOpenOrder, buildEvmMultisignBodyHyperliquidOutcomeCancel, buildEvmMultisignBodyHyperliquidOutcomeMerge, buildEvmMultisignBodyHyperliquidOutcomeMergeQuestion, buildEvmMultisignBodyHyperliquidOutcomeNegate, buildEvmMultisignBodyHyperliquidOutcomeOrder, buildEvmMultisignBodyHyperliquidOutcomeSplit, buildHyperliquidOutcomeCancelAction, buildHyperliquidOutcomeMergeAction, buildHyperliquidOutcomeMergeQuestionAction, buildHyperliquidOutcomeNegateAction, buildHyperliquidOutcomeOrderAction, buildHyperliquidOutcomePurposePrefill, buildHyperliquidOutcomeSplitAction, clearHyperliquidOutcomeMetaCache, fetchHyperliquidOutcomeAccount, fetchHyperliquidOutcomeBook, fetchHyperliquidOutcomeChanceSeries, fillOutcomeTemplate, formatHyperliquidStamp, formatOutcomeQuestion, formatOutcomeRules, getHyperliquidOutcomeMarket, hyperliquidOutcomeFetchMarketSummary, hyperliquidOutcomeFetchMarketsSummary, hyperliquidOutcomeFetchOpenOrdersSummary, hyperliquidOutcomeFetchOrderbookSummary, hyperliquidOutcomeFetchPositionsSummary, hyperliquidOutcomeMatchesQuery, hyperliquidOutcomeProtocolModule, hyperliquidOutcomeToPredictionFields, listHyperliquidOutcomeMarkets, outcomeAssetId, outcomeBalanceCoin, outcomeEncoding, outcomeExpiryUnix, outcomeFieldMap, outcomeSideIndex, outcomeSideName, outcomeTemplateId, outcomeTradeCoin, parseHyperliquidPipeFields, parseHyperliquidStamp, questionForOutcome, resolveOutcomeSideLabel };