@msafe/sui-app-store 0.0.337 → 0.0.340

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.
package/dist/index.d.mts CHANGED
@@ -1,17 +1,229 @@
1
- import { TransactionType } from '@msafe/sui3-utils';
1
+ import { PoolName } from '@alphafi/alphafi-sdk';
2
+ import { SuiAddress, TransactionType, CreateStreamIntentionData, SetAutoClaimIntentionData, ClaimStreamIntentionData, ClaimByProxyStreamIntentionData, CancelStreamIntentionData } from '@msafe/sui3-utils';
3
+ import { NumStr } from '@firefly-exchange/library-sui';
4
+ import { Pool, NFT, Trade } from 'turbos-clmm-sdk';
2
5
  import { Transaction } from '@mysten/sui/transactions';
3
- import { SuiSignTransactionBlockInput, WalletAccount, IdentifierString } from '@mysten/wallet-standard';
6
+ import { IdentifierString, WalletAccount, SuiSignTransactionBlockInput } from '@mysten/wallet-standard';
4
7
  import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
5
8
  import { SuiGrpcClient } from '@mysten/sui/grpc';
6
9
  import { SuiClient } from '@mysten/sui.js/client';
7
10
  import { TransactionBlock } from '@mysten/sui.js/transactions';
8
11
 
12
+ type AlphaFiIntentionData = DepositDoubleAssetIntentionData | DepositSingleAssetIntentionData | WithdrawAlphaIntentionData | WithdrawIntentionData$2 | EmptyIntentionData;
13
+ interface EmptyIntentionData {
14
+ }
15
+ interface DepositDoubleAssetIntentionData {
16
+ poolName: PoolName;
17
+ amount: string;
18
+ isAmountA: boolean;
19
+ }
20
+ interface DepositSingleAssetIntentionData {
21
+ poolName: PoolName;
22
+ amount: string;
23
+ }
24
+ interface WithdrawIntentionData$2 {
25
+ xTokensAmount: string;
26
+ poolName: PoolName;
27
+ }
28
+ interface WithdrawAlphaIntentionData {
29
+ xTokensAmount: string;
30
+ withdrawFromLocked: boolean;
31
+ }
32
+
33
+ interface Token {
34
+ address: string;
35
+ name: string;
36
+ symbol: string;
37
+ decimals: number;
38
+ logoURI: string;
39
+ totalSupply: string;
40
+ circulatingSupply: string;
41
+ isVerified: boolean;
42
+ hasBluefinPools: boolean;
43
+ rfqSupported: boolean;
44
+ }
45
+ type FeeTokens = [string, string];
46
+ type RewardTokens = Array<string>;
47
+ type CollectTokens = {
48
+ collectFeeTokens: FeeTokens;
49
+ collectRewardTokens: RewardTokens;
50
+ };
51
+ type OpenPositionIntentionData = {
52
+ pool: SuiAddress;
53
+ lowerTick: number;
54
+ upperTick: number;
55
+ tokenAmount: string;
56
+ maxAmountTokenA: string;
57
+ maxAmountTokenB: string;
58
+ isTokenAFixed: boolean;
59
+ };
60
+ type ClosePositionIntentionData = {
61
+ pool: SuiAddress;
62
+ position: SuiAddress;
63
+ transferTokensTo?: SuiAddress;
64
+ } & CollectTokens;
65
+ type ProvideLiquidityIntentionData = {
66
+ pool: SuiAddress;
67
+ position: SuiAddress;
68
+ lowerTick: number;
69
+ upperTick: number;
70
+ tokenAmount: string;
71
+ maxAmountTokenA: string;
72
+ maxAmountTokenB: string;
73
+ isTokenAFixed: boolean;
74
+ };
75
+ type RemoveLiquidityIntentionData$1 = {
76
+ pool: SuiAddress;
77
+ position: SuiAddress;
78
+ liquidity: string;
79
+ maxAmountTokenA: string;
80
+ maxAmountTokenB: string;
81
+ transferTokensTo?: SuiAddress;
82
+ } & CollectTokens;
83
+ type CollectRewardsAndFeeIntentionData = {
84
+ pool: SuiAddress;
85
+ position: SuiAddress;
86
+ } & CollectTokens;
87
+ type CollectRewardsIntentionData = {
88
+ pool: SuiAddress;
89
+ position: SuiAddress;
90
+ collectRewardTokens: RewardTokens;
91
+ };
92
+ type CollectFeeIntentionData$1 = {
93
+ pool: SuiAddress;
94
+ position: SuiAddress;
95
+ collectFeeTokens: FeeTokens;
96
+ };
97
+ type Aggregator7KSwapIntentionData = {
98
+ tokenIn: Token | undefined;
99
+ tokenOut: Token | undefined;
100
+ amountIn: string;
101
+ maxSlippage: string;
102
+ };
103
+ type BluefinIntentionData = OpenPositionIntentionData | ClosePositionIntentionData | ProvideLiquidityIntentionData | RemoveLiquidityIntentionData$1 | CollectRewardsIntentionData | CollectFeeIntentionData$1 | CollectRewardsAndFeeIntentionData | Aggregator7KSwapIntentionData;
104
+
9
105
  type SuiNetworks = 'sui:devnet' | 'sui:testnet' | 'sui:localnet' | 'sui:mainnet';
10
106
 
11
- interface IAppHelper<T> {
12
- deserialize(input: SuiSignTransactionBlockInput & {
107
+ interface CloseIntentionData {
108
+ collateralType: string;
109
+ recipient: string;
110
+ strapId?: string;
111
+ }
112
+ interface BorrowIntentionData$2 {
113
+ collateralType: string;
114
+ collateralAmount: string;
115
+ borrowAmount: string;
116
+ insertionPlace?: string;
117
+ strapId?: string;
118
+ }
119
+ interface WithdrawIntentionData$1 {
120
+ collateralType: string;
121
+ withdrawAmount: string;
122
+ insertionPlace?: string;
123
+ strapId?: string;
124
+ }
125
+ interface RepayIntentionData$2 {
126
+ collateralType: string;
127
+ repayAmount: string;
128
+ withdrawAmount: string;
129
+ isSurplus: boolean;
130
+ insertionPlace?: string;
131
+ strapId?: string;
132
+ }
133
+ interface PsmIntentionData {
134
+ coinType: string;
135
+ amount: string;
136
+ buckToCoin: boolean;
137
+ }
138
+ interface SBUCKDepositIntentionData {
139
+ coinType: string;
140
+ amount: string;
141
+ isStake: boolean;
142
+ }
143
+ interface SBUCKUnstakeIntentionData {
144
+ stakeProofs: string[];
145
+ amount: string;
146
+ isStake: boolean;
147
+ toBuck: boolean;
148
+ }
149
+ interface SBUCKWithdrawIntentionData {
150
+ amount: string;
151
+ }
152
+ interface SBUCKClaimIntentionData {
153
+ stakeProofs: string[];
154
+ }
155
+ interface TankDepositIntentionData {
156
+ coinType: string;
157
+ amount: string;
158
+ }
159
+ interface TankWithdrawIntentionData {
160
+ coinType: string;
161
+ amount: string;
162
+ }
163
+ interface TankClaimIntentionData {
164
+ coinType: string;
165
+ }
166
+
167
+ interface LockClaimIntentionData {
168
+ coinType: string;
169
+ proofCount: number;
170
+ }
171
+
172
+ type BucketIntentionData = PsmIntentionData | BorrowIntentionData$2 | WithdrawIntentionData$1 | RepayIntentionData$2 | CloseIntentionData | TankDepositIntentionData | TankWithdrawIntentionData | TankClaimIntentionData | SBUCKDepositIntentionData | SBUCKWithdrawIntentionData | SBUCKUnstakeIntentionData | SBUCKClaimIntentionData | LockClaimIntentionData;
173
+
174
+ interface CetusIntentionData {
175
+ txbParams: any;
176
+ action: string;
177
+ }
178
+
179
+ type DepositAssetIntentionData = {
180
+ vaultID: SuiAddress;
181
+ amount: NumStr;
182
+ };
183
+ type MintSharesIntentionData = {
184
+ vaultID: SuiAddress;
185
+ numShares: NumStr;
186
+ };
187
+ type RedeemSharesIntentionData = {
188
+ vaultID: SuiAddress;
189
+ numShares: NumStr;
190
+ };
191
+ type CancelPendingWithdrawalRequestIntentionData = {
192
+ vaultID: SuiAddress;
193
+ sequenceNumber: NumStr;
194
+ };
195
+ type EmberIntentionData = DepositAssetIntentionData | MintSharesIntentionData | RedeemSharesIntentionData | CancelPendingWithdrawalRequestIntentionData;
196
+
197
+ type MMTDEXIntentionData = {
198
+ action: TransactionSubType;
199
+ params: any;
200
+ };
201
+ declare enum TransactionSubType {
202
+ AddLiquidity = "AddLiquidity",
203
+ AddLiquiditySingleSide = "AddLiquiditySingleSide",
204
+ ClaimAllRewards = "ClaimAllRewards",
205
+ ClaimRewards = "ClaimRewards",
206
+ ClaimRewardsAs = "ClaimRewardsAs",
207
+ RemoveLiquidity = "RemoveLiquidity",
208
+ Swap = "Swap",
209
+ ManageLiquidity = "ManageLiquidity",
210
+ ManageLiquiditySingleSide = "ManageLiquiditySingleSide",
211
+ StakeXSui = "StakeXSui",
212
+ UnstakeXSui = "UnstakeXSui",
213
+ Bond = "Bond",
214
+ Extend = "Extend",
215
+ Merge = "Merge",
216
+ Unbond = "Unbond"
217
+ }
218
+
219
+ interface IAppHelperInternalGrpc<T> {
220
+ application: string;
221
+ supportSDK: '@mysten/sui-v2';
222
+ deserialize(input: {
223
+ transaction: Transaction;
224
+ chain: IdentifierString;
13
225
  network: SuiNetworks;
14
- clientUrl: string;
226
+ suiGrpcClient: SuiGrpcClient;
15
227
  account: WalletAccount;
16
228
  appContext?: any;
17
229
  }): Promise<{
@@ -24,11 +236,27 @@ interface IAppHelper<T> {
24
236
  txType: TransactionType;
25
237
  txSubType: string;
26
238
  intentionData: T;
27
- clientUrl: string;
239
+ suiGrpcClient: SuiGrpcClient;
28
240
  account: WalletAccount;
29
241
  }): Promise<Transaction>;
30
242
  }
31
243
 
244
+ type MPayIntentionData = CreateStreamIntentionData | SetAutoClaimIntentionData | ClaimStreamIntentionData | ClaimByProxyStreamIntentionData | CancelStreamIntentionData;
245
+
246
+ interface CoinTransferIntentionData {
247
+ recipient: string;
248
+ coinType: string;
249
+ amount: string;
250
+ }
251
+
252
+ interface ObjectTransferIntentionData {
253
+ receiver: string;
254
+ objectType: string;
255
+ objectId: string;
256
+ }
257
+
258
+ type CoreIntentionData = CoinTransferIntentionData | ObjectTransferIntentionData;
259
+
32
260
  interface IAppHelperInternal<T> {
33
261
  application: string;
34
262
  supportSDK: '@mysten/sui';
@@ -54,14 +282,365 @@ interface IAppHelperInternal<T> {
54
282
  }): Promise<Transaction>;
55
283
  }
56
284
 
57
- interface IAppHelperInternalGrpc<T> {
285
+ interface ClaimRewardIntentionData {
286
+ type: string;
287
+ }
288
+
289
+ interface ClaimSupplyIntentionData {
290
+ type: string;
291
+ }
292
+
293
+ interface EntryBorrowIntentionData {
294
+ amount: number;
295
+ assetId: number;
296
+ }
297
+
298
+ interface EntryDepositIntentionData {
299
+ amount: number;
300
+ assetId: number;
301
+ }
302
+
303
+ interface EntryRepayIntentionData {
304
+ amount: number;
305
+ assetId: number;
306
+ }
307
+
308
+ interface EntryWithdrawIntentionData {
309
+ amount: number;
310
+ assetId: number;
311
+ }
312
+
313
+ interface EntryMultiDepositIntentionData {
314
+ list: {
315
+ amount: number;
316
+ assetId: number;
317
+ }[];
318
+ }
319
+
320
+ interface PlainTransactionIntentionData {
321
+ content: string;
322
+ scene: string;
323
+ }
324
+
325
+ type NAVIIntentionData = EntryDepositIntentionData | EntryBorrowIntentionData | EntryRepayIntentionData | EntryWithdrawIntentionData | EntryMultiDepositIntentionData | ClaimRewardIntentionData | ClaimSupplyIntentionData | PlainTransactionIntentionData;
326
+
327
+ type PlainTransactionData = {
328
+ content: string;
329
+ };
330
+
331
+ interface BorrowIntentionData$1 {
332
+ coinName: string;
333
+ amount: number | string;
334
+ obligationId: string;
335
+ obligationKey: string;
336
+ }
337
+
338
+ interface BorrowWithBoostIntentionData {
339
+ coinName: string;
340
+ amount: number | string;
341
+ obligationId: string;
342
+ obligationKey: string;
343
+ veScaKey: string;
344
+ }
345
+
346
+ interface BorrowWithReferralIntentionData {
347
+ coinName: string;
348
+ amount: number | string;
349
+ obligationId: string;
350
+ obligationKey: string;
351
+ veScaKey: string | undefined;
352
+ }
353
+
354
+ interface DepositCollateralIntentionData {
355
+ collateralCoinName: string;
356
+ amount: number | string;
357
+ obligationId: string;
358
+ }
359
+
360
+ interface MigrateAndClaimIntentionData {
361
+ obligationKey: string;
362
+ obligationId: string;
363
+ rewardCoinName: string;
364
+ veScaKey?: string;
365
+ }
366
+
367
+ interface MigrateScoinIntentionData {
368
+ }
369
+
370
+ interface OpenObligationIntentionData {
371
+ }
372
+
373
+ interface RepayIntentionData$1 {
374
+ coinName: string;
375
+ amount: number | string;
376
+ obligationId: string;
377
+ obligationKey: string;
378
+ }
379
+
380
+ interface RepayWithBoostIntentionData {
381
+ coinName: string;
382
+ amount: number | string;
383
+ obligationId: string;
384
+ veScaKey: string;
385
+ }
386
+
387
+ interface SupplyLendingIntentionData {
388
+ amount: number | string;
389
+ coinName: string;
390
+ }
391
+
392
+ interface UnstakeSpoolIntentionData {
393
+ amount: number | string;
394
+ marketCoinName: string;
395
+ stakeAccountId: string | null;
396
+ }
397
+
398
+ interface WithdrawAndUnstakeLendingIntentionData {
399
+ amount: number | undefined;
400
+ coinName: string;
401
+ stakeAccountId: {
402
+ id: string;
403
+ coin: number;
404
+ }[];
405
+ }
406
+
407
+ interface WithdrawCollateralIntentionData {
408
+ collateralCoinName: string;
409
+ amount: number | string;
410
+ obligationId: string;
411
+ obligationKey: string;
412
+ }
413
+
414
+ interface WithdrawLendingIntentionData {
415
+ amount: string | number;
416
+ coinName: string;
417
+ }
418
+
419
+ interface BindReferralIntentionData {
420
+ veScaKey: string;
421
+ }
422
+
423
+ interface ClaimRevenueReferralIntentionData {
424
+ veScaKey: string;
425
+ coins: string[];
426
+ }
427
+
428
+ interface CreateReferralLinkIntentionData {
429
+ }
430
+
431
+ interface ExtendPeriodAndStakeMoreIntentionData {
432
+ amount: number;
433
+ veScaKey: string;
434
+ unlockTime: number;
435
+ obligationId: string | undefined;
436
+ obligationKey: string | undefined;
437
+ isOldBorrowIncentive: boolean;
438
+ isObligationLocked: boolean;
439
+ }
440
+
441
+ interface ExtendStakePeriodIntentionData {
442
+ isObligationLocked: boolean;
443
+ isOldBorrowIncentive: boolean;
444
+ obligationId: string | undefined;
445
+ obligationKey: string | undefined;
446
+ unlockTime: number | undefined;
447
+ veScaKey: string | undefined;
448
+ }
449
+
450
+ interface MergeVeScaIntentionData {
451
+ targetVeScaKey: string;
452
+ sourceVeScaKey: string;
453
+ obligationDatas: {
454
+ obligationKey: string;
455
+ obligationId: string;
456
+ }[];
457
+ }
458
+
459
+ interface RedeemScaIntentionData {
460
+ veScaKey: string;
461
+ }
462
+
463
+ interface RenewExpStakePeriodIntentionData {
464
+ amount: number;
465
+ unlockTime: number;
466
+ veScaKey: string;
467
+ isHaveRedeem: boolean;
468
+ obligation?: string;
469
+ obligationKey?: string;
470
+ isObligationLocked: boolean;
471
+ isOldBorrowIncentive: boolean;
472
+ }
473
+
474
+ interface SplitVeScaIntentionData {
475
+ targetVeScaKey: string;
476
+ splitAmount: number;
477
+ }
478
+
479
+ interface StakeScaIntentionData {
480
+ amount: number;
481
+ isObligationLocked: boolean;
482
+ isOldBorrowIncentive: boolean;
483
+ obligationId: string | undefined;
484
+ obligationKey: string | undefined;
485
+ unlockTime: number | undefined;
486
+ veScaKey: string | undefined;
487
+ }
488
+
489
+ interface SupplyAndStakeLendingIntentionData {
490
+ amount: number | string;
491
+ coinName: string;
492
+ stakeAccountId?: string | null;
493
+ }
494
+
495
+ /**
496
+ * Represents possible actions in the system
497
+ */
498
+ type Action = 'stake' | 'unstake' | 'deactivate';
499
+ /**
500
+ * Type mapping from Action to its required arguments
501
+ */
502
+ type Args<T extends Action> = T extends 'stake' ? StakeArgs : T extends 'unstake' ? UnstakeArgs : T extends 'deactivate' ? DeactivateArgs : never;
503
+ /**
504
+ * Arguments required for the 'stake' action
505
+ */
506
+ interface StakeArgs {
507
+ veScaKey: string;
508
+ obligationId: string;
509
+ obligationKey: string;
510
+ }
511
+ /**
512
+ * Arguments required for the 'unstake' action
513
+ */
514
+ interface UnstakeArgs {
515
+ obligationId: string;
516
+ obligationKey: string;
517
+ }
518
+ /**
519
+ * Arguments required for the 'deactivate' action
520
+ */
521
+ interface DeactivateArgs {
522
+ veScaKey: string;
523
+ obligationId: string;
524
+ }
525
+ type BindingDatas = {
526
+ action: 'deactivate';
527
+ args: Args<'deactivate'>;
528
+ } | {
529
+ action: 'stake';
530
+ args: Args<'stake'>;
531
+ } | {
532
+ action: 'unstake';
533
+ args: Args<'unstake'>;
534
+ };
535
+ interface VeScaObligationBindingsIntentData {
536
+ bindingDatas: BindingDatas[];
537
+ }
538
+
539
+ interface TransferVeScaKeysIntentionData {
540
+ veScaKeys: {
541
+ objectId: string;
542
+ version: string;
543
+ digest: string;
544
+ }[];
545
+ }
546
+
547
+ interface WithdrawStakedScaIntentionData {
548
+ vescaKey?: string;
549
+ }
550
+
551
+ type ScallopIntentionData = SupplyLendingIntentionData | WithdrawLendingIntentionData | BorrowIntentionData$1 | RepayIntentionData$1 | DepositCollateralIntentionData | WithdrawCollateralIntentionData | OpenObligationIntentionData | UnstakeSpoolIntentionData | BorrowWithBoostIntentionData | StakeScaIntentionData | ExtendStakePeriodIntentionData | ExtendPeriodAndStakeMoreIntentionData | RenewExpStakePeriodIntentionData | WithdrawStakedScaIntentionData | SupplyAndStakeLendingIntentionData | WithdrawAndUnstakeLendingIntentionData | RedeemScaIntentionData | MigrateAndClaimIntentionData | BorrowWithReferralIntentionData | CreateReferralLinkIntentionData | ClaimRevenueReferralIntentionData | BindReferralIntentionData | MigrateScoinIntentionData | RepayWithBoostIntentionData | MergeVeScaIntentionData | SplitVeScaIntentionData | VeScaObligationBindingsIntentData | TransferVeScaKeysIntentionData;
552
+
553
+ interface StakeIntentionData$1 {
554
+ amount: string;
555
+ outCoinType: string;
556
+ }
557
+ interface StakeAndDepositIntentionData {
558
+ amount: string;
559
+ outCoinType: string;
560
+ }
561
+ interface ConvertIntentionData {
562
+ amount: string;
563
+ inCoinType: string;
564
+ outCoinType: string;
565
+ }
566
+ interface ConvertAndDepositIntentionData {
567
+ amount: string;
568
+ inCoinType: string;
569
+ outCoinType: string;
570
+ }
571
+ interface UnstakeIntentionData {
572
+ amount: string;
573
+ inCoinType: string;
574
+ }
575
+ type SpringSuiIntentionData = StakeIntentionData$1 | StakeAndDepositIntentionData | ConvertIntentionData | ConvertAndDepositIntentionData | UnstakeIntentionData;
576
+
577
+ interface MintIntentionData {
578
+ amount: string;
579
+ }
580
+ interface RedeemIntentionData {
581
+ amount: string;
582
+ }
583
+ type StSuiIntentionData = MintIntentionData | RedeemIntentionData;
584
+
585
+ type SuilendIntentionData = DepositIntentionData | WithdrawIntentionData | BorrowIntentionData | RepayIntentionData | ClaimIntentionData | ClaimAndDepositIntentionData;
586
+ interface WithdrawIntentionData {
587
+ coinType: string;
588
+ value: string;
589
+ }
590
+ interface BorrowIntentionData {
591
+ coinType: string;
592
+ value: string;
593
+ }
594
+ interface ClaimIntentionData {
595
+ value: Record<string, string>;
596
+ }
597
+ interface ClaimAndDepositIntentionData {
598
+ value: Record<string, string>;
599
+ }
600
+ interface DepositIntentionData {
601
+ coinType: string;
602
+ value: string;
603
+ }
604
+ interface RepayIntentionData {
605
+ coinType: string;
606
+ value: string;
607
+ }
608
+
609
+ type TURBOSIntentionData = CreatePoolIntentionData | AddLiquidityIntentionData | IncreaseLiquidityIntentionData | DecreaseLiquidityIntentionData | DecreaseLiquidityWithReturnIntentionData | CollectFeeIntentionData | CollectRewardIntentionData | RemoveLiquidityIntentionData | RemoveLiquidityWithReturnIntentionData | BurnIntentionData | SwapIntentionData | PrixJoinIntentionData | PrixClaimIntentionData | SwapExactQuoteForBaseIntentionData | SwapExactBaseForQuoteIntentionData;
610
+ type CreatePoolIntentionData = Pool.CreatePoolOptions;
611
+ type AddLiquidityIntentionData = Pool.AddLiquidityOptions;
612
+ type BurnIntentionData = NFT.BurnOptions;
613
+ type CollectFeeIntentionData = Pool.CollectFeeOptions;
614
+ type CollectRewardIntentionData = Pool.CollectRewardOptions;
615
+ type DecreaseLiquidityIntentionData = Pool.DecreaseLiquidityOptions;
616
+ type DecreaseLiquidityWithReturnIntentionData = Pool.DecreaseLiquidityOptions;
617
+ type IncreaseLiquidityIntentionData = Pool.IncreaseLiquidityOptions;
618
+ interface PrixClaimIntentionData {
619
+ }
620
+ interface PrixJoinIntentionData {
621
+ }
622
+ type RemoveLiquidityIntentionData = Pool.RemoveLiquidityOptions;
623
+ type RemoveLiquidityWithReturnIntentionData = Pool.RemoveLiquidityOptions;
624
+ type SwapIntentionData = Trade.SwapOptions;
625
+ interface SwapExactBaseForQuoteIntentionData {
626
+ token1: string;
627
+ token2: string;
628
+ poolId: string;
629
+ amountIn: number;
630
+ }
631
+ interface SwapExactQuoteForBaseIntentionData {
632
+ token1: string;
633
+ token2: string;
634
+ poolId: string;
635
+ amountIn: number;
636
+ }
637
+
638
+ interface IAppHelperInternalLegacy<T> {
58
639
  application: string;
59
- supportSDK: '@mysten/sui-v2';
60
- deserialize(input: {
61
- transaction: Transaction;
62
- chain: IdentifierString;
640
+ supportSDK: '@mysten/sui.js';
641
+ deserialize(input: SuiSignTransactionBlockInput & {
63
642
  network: SuiNetworks;
64
- suiGrpcClient: SuiGrpcClient;
643
+ suiClient: SuiClient;
65
644
  account: WalletAccount;
66
645
  appContext?: any;
67
646
  }): Promise<{
@@ -74,17 +653,54 @@ interface IAppHelperInternalGrpc<T> {
74
653
  txType: TransactionType;
75
654
  txSubType: string;
76
655
  intentionData: T;
77
- suiGrpcClient: SuiGrpcClient;
656
+ suiClient: SuiClient;
78
657
  account: WalletAccount;
79
- }): Promise<Transaction>;
658
+ }): Promise<TransactionBlock>;
80
659
  }
81
660
 
82
- interface IAppHelperInternalLegacy<T> {
83
- application: string;
84
- supportSDK: '@mysten/sui.js';
661
+ interface ClaimTicketIntentionData {
662
+ ticketId: string;
663
+ }
664
+
665
+ interface StakeIntentionData {
666
+ amount: number;
667
+ }
668
+
669
+ interface UnStakeIntentionData {
670
+ amount: number;
671
+ }
672
+
673
+ type VoloIntentionData = StakeIntentionData | UnStakeIntentionData | ClaimTicketIntentionData;
674
+
675
+ /**
676
+ * Maps each registered application name to its intention data type.
677
+ * Add new apps here when registering helpers in `src/index.ts`.
678
+ */
679
+ interface AppRegistry {
680
+ alphafi: AlphaFiIntentionData;
681
+ bluefin: BluefinIntentionData;
682
+ bucket: BucketIntentionData;
683
+ cetus: CetusIntentionData;
684
+ ember: EmberIntentionData;
685
+ 'mmt-dex': MMTDEXIntentionData;
686
+ mpay: MPayIntentionData;
687
+ 'msafe-core': CoreIntentionData;
688
+ 'msafe-plain-tx': PlainTransactionData;
689
+ navi: NAVIIntentionData;
690
+ scallop: ScallopIntentionData;
691
+ SpringSui: SpringSuiIntentionData;
692
+ stsui: StSuiIntentionData;
693
+ Suilend: SuilendIntentionData;
694
+ turbos: TURBOSIntentionData;
695
+ volo: VoloIntentionData;
696
+ }
697
+ type AppName = keyof AppRegistry;
698
+ type AppIntentionData<K extends AppName> = AppRegistry[K];
699
+
700
+ interface IAppHelper<T> {
85
701
  deserialize(input: SuiSignTransactionBlockInput & {
86
702
  network: SuiNetworks;
87
- suiClient: SuiClient;
703
+ clientUrl: string;
88
704
  account: WalletAccount;
89
705
  appContext?: any;
90
706
  }): Promise<{
@@ -97,22 +713,25 @@ interface IAppHelperInternalLegacy<T> {
97
713
  txType: TransactionType;
98
714
  txSubType: string;
99
715
  intentionData: T;
100
- suiClient: SuiClient;
716
+ clientUrl: string;
101
717
  account: WalletAccount;
102
- }): Promise<TransactionBlock>;
718
+ }): Promise<Transaction>;
103
719
  }
104
720
 
105
721
  type InternalAppHelper<T> = IAppHelperInternalLegacy<T> | IAppHelperInternal<T> | IAppHelperInternalGrpc<T>;
722
+ type RegisteredAppHelper = IAppHelper<AppRegistry[AppName]>;
106
723
  declare class MSafeApps {
107
- apps: Map<string, IAppHelper<any>>;
724
+ apps: Map<AppName, RegisteredAppHelper>;
108
725
  private constructor();
109
726
  static fromHelpers(apps: InternalAppHelper<any>[]): MSafeApps;
110
727
  addLegacyHelper(app: IAppHelperInternalLegacy<any>): void;
111
728
  addHelper(app: IAppHelperInternal<any>): void;
112
729
  addGrpcHelper(app: IAppHelperInternalGrpc<any>): void;
113
- getAppHelper(appName: string): IAppHelper<any>;
730
+ getAppHelper<K extends AppName>(appName: K): IAppHelper<AppRegistry[K]>;
731
+ getAppHelper(appName: string): IAppHelper<unknown>;
732
+ private setApp;
114
733
  }
115
734
 
116
735
  declare const appHelpers: MSafeApps;
117
736
 
118
- export { appHelpers };
737
+ export { type AppIntentionData, type AppName, type AppRegistry, appHelpers };