@msafe/sui-app-store 0.0.353 → 0.0.355

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,13 +1,11 @@
1
1
  import { PoolName } from '@alphafi/alphafi-sdk';
2
2
  import { SuiAddress, TransactionType, CreateStreamIntentionData, SetAutoClaimIntentionData, ClaimStreamIntentionData, ClaimByProxyStreamIntentionData, CancelStreamIntentionData } from '@msafe/sui3-utils';
3
3
  import { NumStr } from '@firefly-exchange/library-sui';
4
- import { Pool, NFT, Trade } from 'turbos-clmm-sdk';
4
+ import { Pool, Position, Trade } from 'turbos-clmm-sdk';
5
5
  import { Transaction } from '@mysten/sui/transactions';
6
6
  import { IdentifierString, WalletAccount, SuiSignTransactionBlockInput } from '@mysten/wallet-standard';
7
+ import * as _mysten_sui_client from '@mysten/sui/client';
7
8
  import { SuiGrpcClient } from '@mysten/sui/grpc';
8
- import { DevInspectResults } from '@mysten/sui/jsonRpc';
9
- import { SuiClient as SuiClient$1 } from '@mysten/sui.js/client';
10
- import { TransactionBlock } from '@mysten/sui.js/transactions';
11
9
 
12
10
  type AlphaFiIntentionData = DepositDoubleAssetIntentionData | DepositSingleAssetIntentionData | WithdrawAlphaIntentionData | WithdrawIntentionData$2 | EmptyIntentionData;
13
11
  interface EmptyIntentionData {
@@ -241,6 +239,50 @@ interface IAppHelperInternalGrpc<T> {
241
239
  }): Promise<Transaction>;
242
240
  }
243
241
 
242
+ /**
243
+ * Local client/response shapes used by app-store helpers.
244
+ * Kept independent of @mysten/sui/jsonRpc so runtime code does not depend on JSON-RPC typings.
245
+ */
246
+ type CoinStruct = {
247
+ coinType: string;
248
+ coinObjectId: string;
249
+ version: string;
250
+ digest: string;
251
+ balance: string;
252
+ previousTransaction: string;
253
+ };
254
+ type PaginatedCoins = {
255
+ data: CoinStruct[];
256
+ hasNextPage: boolean;
257
+ nextCursor: string | null;
258
+ };
259
+ /** Subset of the former JSON-RPC DevInspectResults shape used by decoders. */
260
+ type DevInspectEvent = {
261
+ type: string;
262
+ parsedJson?: unknown;
263
+ packageId?: string;
264
+ transactionModule?: string;
265
+ sender?: string;
266
+ bcs?: string;
267
+ id?: {
268
+ txDigest: string;
269
+ eventSeq: string;
270
+ };
271
+ };
272
+ type DevInspectResults = {
273
+ error?: string | null;
274
+ effects: {
275
+ status: {
276
+ status: 'success' | 'failure';
277
+ error?: string;
278
+ };
279
+ };
280
+ events: DevInspectEvent[];
281
+ results?: Array<{
282
+ returnValues?: Array<[number[], string]>;
283
+ }> | null;
284
+ };
285
+
244
286
  type SuiNetworkName = 'mainnet' | 'testnet' | 'devnet' | 'localnet';
245
287
 
246
288
  type MPayIntentionData = CreateStreamIntentionData | SetAutoClaimIntentionData | ClaimStreamIntentionData | ClaimByProxyStreamIntentionData | CancelStreamIntentionData;
@@ -260,15 +302,11 @@ interface ObjectTransferIntentionData {
260
302
  type CoreIntentionData = CoinTransferIntentionData | ObjectTransferIntentionData;
261
303
 
262
304
  type SuiClientOptions = {
263
- network: SuiNetworkName;
305
+ network?: SuiNetworkName;
264
306
  /** @deprecated Prefer baseUrl. Accepted for existing call sites. */
265
307
  url?: string;
266
308
  baseUrl?: string;
267
309
  };
268
- /**
269
- * SuiClient backed by gRPC, with a few JSON-RPC-shaped helpers still used by apps
270
- * (getCoins, devInspectTransactionBlock) until those call sites migrate fully.
271
- */
272
310
  declare class SuiClient extends SuiGrpcClient {
273
311
  constructor(options: SuiClientOptions);
274
312
  getCoins(input: {
@@ -276,14 +314,42 @@ declare class SuiClient extends SuiGrpcClient {
276
314
  coinType?: string;
277
315
  cursor?: string | null;
278
316
  limit?: number;
317
+ }): Promise<PaginatedCoins>;
318
+ /**
319
+ * Legacy JSON-RPC-shaped getOwnedObjects for third-party SDKs (e.g. bucket-protocol-sdk).
320
+ * Backed by gRPC listOwnedObjects.
321
+ */
322
+ getOwnedObjects(input: {
323
+ owner: string;
324
+ cursor?: string | null;
325
+ limit?: number | null;
326
+ filter?: {
327
+ StructType?: string;
328
+ Package?: string;
329
+ MatchAll?: unknown[];
330
+ MatchAny?: unknown[];
331
+ } | null;
332
+ options?: {
333
+ showContent?: boolean;
334
+ showType?: boolean;
335
+ showDisplay?: boolean;
336
+ showOwner?: boolean;
337
+ } | null;
279
338
  }): Promise<{
280
339
  data: {
281
- coinType: string;
282
- coinObjectId: string;
283
- version: string;
284
- digest: string;
285
- balance: string;
286
- previousTransaction: string;
340
+ data: {
341
+ objectId: string;
342
+ version: string;
343
+ digest: string;
344
+ type: string;
345
+ owner: _mysten_sui_client.SuiClientTypes.ObjectOwner;
346
+ content: {
347
+ dataType: "moveObject";
348
+ type: string;
349
+ fields: never;
350
+ hasPublicTransfer: boolean;
351
+ };
352
+ };
287
353
  }[];
288
354
  hasNextPage: boolean;
289
355
  nextCursor: string;
@@ -646,7 +712,7 @@ interface RepayIntentionData {
646
712
  type TURBOSIntentionData = CreatePoolIntentionData | AddLiquidityIntentionData | IncreaseLiquidityIntentionData | DecreaseLiquidityIntentionData | DecreaseLiquidityWithReturnIntentionData | CollectFeeIntentionData | CollectRewardIntentionData | RemoveLiquidityIntentionData | RemoveLiquidityWithReturnIntentionData | BurnIntentionData | SwapIntentionData | PrixJoinIntentionData | PrixClaimIntentionData | SwapExactQuoteForBaseIntentionData | SwapExactBaseForQuoteIntentionData;
647
713
  type CreatePoolIntentionData = Pool.CreatePoolOptions;
648
714
  type AddLiquidityIntentionData = Pool.AddLiquidityOptions;
649
- type BurnIntentionData = NFT.BurnOptions;
715
+ type BurnIntentionData = Position.BurnOptions;
650
716
  type CollectFeeIntentionData = Pool.CollectFeeOptions;
651
717
  type CollectRewardIntentionData = Pool.CollectRewardOptions;
652
718
  type DecreaseLiquidityIntentionData = Pool.DecreaseLiquidityOptions;
@@ -672,29 +738,6 @@ interface SwapExactQuoteForBaseIntentionData {
672
738
  amountIn: number;
673
739
  }
674
740
 
675
- interface IAppHelperInternalLegacy<T> {
676
- application: string;
677
- supportSDK: '@mysten/sui.js';
678
- deserialize(input: SuiSignTransactionBlockInput & {
679
- network: SuiNetworks;
680
- suiClient: SuiClient$1;
681
- account: WalletAccount;
682
- appContext?: any;
683
- }): Promise<{
684
- txType: TransactionType;
685
- txSubType: string;
686
- intentionData: T;
687
- }>;
688
- build(input: {
689
- network: SuiNetworks;
690
- txType: TransactionType;
691
- txSubType: string;
692
- intentionData: T;
693
- suiClient: SuiClient$1;
694
- account: WalletAccount;
695
- }): Promise<TransactionBlock>;
696
- }
697
-
698
741
  interface ClaimTicketIntentionData {
699
742
  ticketId: string;
700
743
  }
@@ -755,13 +798,12 @@ interface IAppHelper<T> {
755
798
  }): Promise<Transaction>;
756
799
  }
757
800
 
758
- type InternalAppHelper<T> = IAppHelperInternalLegacy<T> | IAppHelperInternal<T> | IAppHelperInternalGrpc<T>;
801
+ type InternalAppHelper<T> = IAppHelperInternal<T> | IAppHelperInternalGrpc<T>;
759
802
  type RegisteredAppHelper = IAppHelper<AppRegistry[AppName]>;
760
803
  declare class MSafeApps {
761
804
  apps: Map<AppName, RegisteredAppHelper>;
762
805
  private constructor();
763
806
  static fromHelpers(apps: InternalAppHelper<any>[]): MSafeApps;
764
- addLegacyHelper(app: IAppHelperInternalLegacy<any>): void;
765
807
  addHelper(app: IAppHelperInternal<any>): void;
766
808
  addGrpcHelper(app: IAppHelperInternalGrpc<any>): void;
767
809
  getAppHelper<K extends AppName>(appName: K): IAppHelper<AppRegistry[K]>;
package/dist/index.d.ts CHANGED
@@ -1,13 +1,11 @@
1
1
  import { PoolName } from '@alphafi/alphafi-sdk';
2
2
  import { SuiAddress, TransactionType, CreateStreamIntentionData, SetAutoClaimIntentionData, ClaimStreamIntentionData, ClaimByProxyStreamIntentionData, CancelStreamIntentionData } from '@msafe/sui3-utils';
3
3
  import { NumStr } from '@firefly-exchange/library-sui';
4
- import { Pool, NFT, Trade } from 'turbos-clmm-sdk';
4
+ import { Pool, Position, Trade } from 'turbos-clmm-sdk';
5
5
  import { Transaction } from '@mysten/sui/transactions';
6
6
  import { IdentifierString, WalletAccount, SuiSignTransactionBlockInput } from '@mysten/wallet-standard';
7
+ import * as _mysten_sui_client from '@mysten/sui/client';
7
8
  import { SuiGrpcClient } from '@mysten/sui/grpc';
8
- import { DevInspectResults } from '@mysten/sui/jsonRpc';
9
- import { SuiClient as SuiClient$1 } from '@mysten/sui.js/client';
10
- import { TransactionBlock } from '@mysten/sui.js/transactions';
11
9
 
12
10
  type AlphaFiIntentionData = DepositDoubleAssetIntentionData | DepositSingleAssetIntentionData | WithdrawAlphaIntentionData | WithdrawIntentionData$2 | EmptyIntentionData;
13
11
  interface EmptyIntentionData {
@@ -241,6 +239,50 @@ interface IAppHelperInternalGrpc<T> {
241
239
  }): Promise<Transaction>;
242
240
  }
243
241
 
242
+ /**
243
+ * Local client/response shapes used by app-store helpers.
244
+ * Kept independent of @mysten/sui/jsonRpc so runtime code does not depend on JSON-RPC typings.
245
+ */
246
+ type CoinStruct = {
247
+ coinType: string;
248
+ coinObjectId: string;
249
+ version: string;
250
+ digest: string;
251
+ balance: string;
252
+ previousTransaction: string;
253
+ };
254
+ type PaginatedCoins = {
255
+ data: CoinStruct[];
256
+ hasNextPage: boolean;
257
+ nextCursor: string | null;
258
+ };
259
+ /** Subset of the former JSON-RPC DevInspectResults shape used by decoders. */
260
+ type DevInspectEvent = {
261
+ type: string;
262
+ parsedJson?: unknown;
263
+ packageId?: string;
264
+ transactionModule?: string;
265
+ sender?: string;
266
+ bcs?: string;
267
+ id?: {
268
+ txDigest: string;
269
+ eventSeq: string;
270
+ };
271
+ };
272
+ type DevInspectResults = {
273
+ error?: string | null;
274
+ effects: {
275
+ status: {
276
+ status: 'success' | 'failure';
277
+ error?: string;
278
+ };
279
+ };
280
+ events: DevInspectEvent[];
281
+ results?: Array<{
282
+ returnValues?: Array<[number[], string]>;
283
+ }> | null;
284
+ };
285
+
244
286
  type SuiNetworkName = 'mainnet' | 'testnet' | 'devnet' | 'localnet';
245
287
 
246
288
  type MPayIntentionData = CreateStreamIntentionData | SetAutoClaimIntentionData | ClaimStreamIntentionData | ClaimByProxyStreamIntentionData | CancelStreamIntentionData;
@@ -260,15 +302,11 @@ interface ObjectTransferIntentionData {
260
302
  type CoreIntentionData = CoinTransferIntentionData | ObjectTransferIntentionData;
261
303
 
262
304
  type SuiClientOptions = {
263
- network: SuiNetworkName;
305
+ network?: SuiNetworkName;
264
306
  /** @deprecated Prefer baseUrl. Accepted for existing call sites. */
265
307
  url?: string;
266
308
  baseUrl?: string;
267
309
  };
268
- /**
269
- * SuiClient backed by gRPC, with a few JSON-RPC-shaped helpers still used by apps
270
- * (getCoins, devInspectTransactionBlock) until those call sites migrate fully.
271
- */
272
310
  declare class SuiClient extends SuiGrpcClient {
273
311
  constructor(options: SuiClientOptions);
274
312
  getCoins(input: {
@@ -276,14 +314,42 @@ declare class SuiClient extends SuiGrpcClient {
276
314
  coinType?: string;
277
315
  cursor?: string | null;
278
316
  limit?: number;
317
+ }): Promise<PaginatedCoins>;
318
+ /**
319
+ * Legacy JSON-RPC-shaped getOwnedObjects for third-party SDKs (e.g. bucket-protocol-sdk).
320
+ * Backed by gRPC listOwnedObjects.
321
+ */
322
+ getOwnedObjects(input: {
323
+ owner: string;
324
+ cursor?: string | null;
325
+ limit?: number | null;
326
+ filter?: {
327
+ StructType?: string;
328
+ Package?: string;
329
+ MatchAll?: unknown[];
330
+ MatchAny?: unknown[];
331
+ } | null;
332
+ options?: {
333
+ showContent?: boolean;
334
+ showType?: boolean;
335
+ showDisplay?: boolean;
336
+ showOwner?: boolean;
337
+ } | null;
279
338
  }): Promise<{
280
339
  data: {
281
- coinType: string;
282
- coinObjectId: string;
283
- version: string;
284
- digest: string;
285
- balance: string;
286
- previousTransaction: string;
340
+ data: {
341
+ objectId: string;
342
+ version: string;
343
+ digest: string;
344
+ type: string;
345
+ owner: _mysten_sui_client.SuiClientTypes.ObjectOwner;
346
+ content: {
347
+ dataType: "moveObject";
348
+ type: string;
349
+ fields: never;
350
+ hasPublicTransfer: boolean;
351
+ };
352
+ };
287
353
  }[];
288
354
  hasNextPage: boolean;
289
355
  nextCursor: string;
@@ -646,7 +712,7 @@ interface RepayIntentionData {
646
712
  type TURBOSIntentionData = CreatePoolIntentionData | AddLiquidityIntentionData | IncreaseLiquidityIntentionData | DecreaseLiquidityIntentionData | DecreaseLiquidityWithReturnIntentionData | CollectFeeIntentionData | CollectRewardIntentionData | RemoveLiquidityIntentionData | RemoveLiquidityWithReturnIntentionData | BurnIntentionData | SwapIntentionData | PrixJoinIntentionData | PrixClaimIntentionData | SwapExactQuoteForBaseIntentionData | SwapExactBaseForQuoteIntentionData;
647
713
  type CreatePoolIntentionData = Pool.CreatePoolOptions;
648
714
  type AddLiquidityIntentionData = Pool.AddLiquidityOptions;
649
- type BurnIntentionData = NFT.BurnOptions;
715
+ type BurnIntentionData = Position.BurnOptions;
650
716
  type CollectFeeIntentionData = Pool.CollectFeeOptions;
651
717
  type CollectRewardIntentionData = Pool.CollectRewardOptions;
652
718
  type DecreaseLiquidityIntentionData = Pool.DecreaseLiquidityOptions;
@@ -672,29 +738,6 @@ interface SwapExactQuoteForBaseIntentionData {
672
738
  amountIn: number;
673
739
  }
674
740
 
675
- interface IAppHelperInternalLegacy<T> {
676
- application: string;
677
- supportSDK: '@mysten/sui.js';
678
- deserialize(input: SuiSignTransactionBlockInput & {
679
- network: SuiNetworks;
680
- suiClient: SuiClient$1;
681
- account: WalletAccount;
682
- appContext?: any;
683
- }): Promise<{
684
- txType: TransactionType;
685
- txSubType: string;
686
- intentionData: T;
687
- }>;
688
- build(input: {
689
- network: SuiNetworks;
690
- txType: TransactionType;
691
- txSubType: string;
692
- intentionData: T;
693
- suiClient: SuiClient$1;
694
- account: WalletAccount;
695
- }): Promise<TransactionBlock>;
696
- }
697
-
698
741
  interface ClaimTicketIntentionData {
699
742
  ticketId: string;
700
743
  }
@@ -755,13 +798,12 @@ interface IAppHelper<T> {
755
798
  }): Promise<Transaction>;
756
799
  }
757
800
 
758
- type InternalAppHelper<T> = IAppHelperInternalLegacy<T> | IAppHelperInternal<T> | IAppHelperInternalGrpc<T>;
801
+ type InternalAppHelper<T> = IAppHelperInternal<T> | IAppHelperInternalGrpc<T>;
759
802
  type RegisteredAppHelper = IAppHelper<AppRegistry[AppName]>;
760
803
  declare class MSafeApps {
761
804
  apps: Map<AppName, RegisteredAppHelper>;
762
805
  private constructor();
763
806
  static fromHelpers(apps: InternalAppHelper<any>[]): MSafeApps;
764
- addLegacyHelper(app: IAppHelperInternalLegacy<any>): void;
765
807
  addHelper(app: IAppHelperInternal<any>): void;
766
808
  addGrpcHelper(app: IAppHelperInternalGrpc<any>): void;
767
809
  getAppHelper<K extends AppName>(appName: K): IAppHelper<AppRegistry[K]>;