@msafe/sui-app-store 0.0.126 → 0.0.127

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/README.md CHANGED
@@ -76,7 +76,7 @@ export type CoreIntention = CoinTransferIntention | ObjectTransferIntention;
76
76
 
77
77
  export type CoreIntentionData = CoinTransferIntentionData | ObjectTransferIntentionData;
78
78
 
79
- export class CoreHelper implements MSafeAppHelper<CoreIntention, CoreIntentionData> {
79
+ export class CoreHelper implements IAppHelperInternalLegacy<CoreIntention, CoreIntentionData> {
80
80
  application: string;
81
81
 
82
82
  constructor() {
package/dist/index.d.mts CHANGED
@@ -1,12 +1,35 @@
1
1
  import { TransactionType } from '@msafe/sui3-utils';
2
+ import { SuiClient as SuiClient$1 } from '@mysten/sui/client';
3
+ import { Transaction } from '@mysten/sui/transactions';
2
4
  import { SuiClient } from '@mysten/sui.js/client';
3
5
  import { TransactionBlock } from '@mysten/sui.js/transactions';
4
- import { SuiSignTransactionBlockInput, WalletAccount } from '@mysten/wallet-standard';
6
+ import { SuiSignTransactionBlockInput, WalletAccount, IdentifierString } from '@mysten/wallet-standard';
5
7
 
6
8
  type SuiNetworks = 'sui:devnet' | 'sui:testnet' | 'sui:localnet' | 'sui:mainnet';
7
9
 
8
- interface MSafeAppHelper<T> {
10
+ interface IAppHelper<T> {
9
11
  application: string;
12
+ deserialize(input: SuiSignTransactionBlockInput & {
13
+ network: SuiNetworks;
14
+ clientUrl: string;
15
+ account: WalletAccount;
16
+ }): Promise<{
17
+ txType: TransactionType;
18
+ txSubType: string;
19
+ intentionData: T;
20
+ }>;
21
+ build(input: {
22
+ network: SuiNetworks;
23
+ txType: TransactionType;
24
+ txSubType: string;
25
+ intentionData: T;
26
+ clientUrl: string;
27
+ account: WalletAccount;
28
+ }): Promise<TransactionBlock>;
29
+ }
30
+ interface IAppHelperInternalLegacy<T> {
31
+ application: string;
32
+ supportSDK: '@mysten/sui.js';
10
33
  deserialize(input: SuiSignTransactionBlockInput & {
11
34
  network: SuiNetworks;
12
35
  suiClient: SuiClient;
@@ -25,11 +48,34 @@ interface MSafeAppHelper<T> {
25
48
  account: WalletAccount;
26
49
  }): Promise<TransactionBlock>;
27
50
  }
51
+ interface IAppHelperInternal<T> {
52
+ application: string;
53
+ supportSDK: '@mysten/sui';
54
+ deserialize(input: {
55
+ transaction: Transaction;
56
+ chain: IdentifierString;
57
+ network: SuiNetworks;
58
+ suiClient: SuiClient$1;
59
+ account: WalletAccount;
60
+ }): Promise<{
61
+ txType: TransactionType;
62
+ txSubType: string;
63
+ intentionData: T;
64
+ }>;
65
+ build(input: {
66
+ network: SuiNetworks;
67
+ txType: TransactionType;
68
+ txSubType: string;
69
+ intentionData: T;
70
+ suiClient: SuiClient$1;
71
+ account: WalletAccount;
72
+ }): Promise<Transaction>;
73
+ }
28
74
 
29
75
  declare class MSafeApps {
30
- apps: Map<string, MSafeAppHelper<any>>;
31
- constructor(apps: MSafeAppHelper<any>[]);
32
- getAppHelper(appName: string): MSafeAppHelper<any>;
76
+ apps: Map<string, IAppHelper<any>>;
77
+ constructor(apps: (IAppHelperInternalLegacy<any> | IAppHelperInternal<any>)[]);
78
+ getAppHelper(appName: string): IAppHelper<any>;
33
79
  }
34
80
 
35
81
  declare const appHelpers: MSafeApps;
package/dist/index.d.ts CHANGED
@@ -1,12 +1,35 @@
1
1
  import { TransactionType } from '@msafe/sui3-utils';
2
+ import { SuiClient as SuiClient$1 } from '@mysten/sui/client';
3
+ import { Transaction } from '@mysten/sui/transactions';
2
4
  import { SuiClient } from '@mysten/sui.js/client';
3
5
  import { TransactionBlock } from '@mysten/sui.js/transactions';
4
- import { SuiSignTransactionBlockInput, WalletAccount } from '@mysten/wallet-standard';
6
+ import { SuiSignTransactionBlockInput, WalletAccount, IdentifierString } from '@mysten/wallet-standard';
5
7
 
6
8
  type SuiNetworks = 'sui:devnet' | 'sui:testnet' | 'sui:localnet' | 'sui:mainnet';
7
9
 
8
- interface MSafeAppHelper<T> {
10
+ interface IAppHelper<T> {
9
11
  application: string;
12
+ deserialize(input: SuiSignTransactionBlockInput & {
13
+ network: SuiNetworks;
14
+ clientUrl: string;
15
+ account: WalletAccount;
16
+ }): Promise<{
17
+ txType: TransactionType;
18
+ txSubType: string;
19
+ intentionData: T;
20
+ }>;
21
+ build(input: {
22
+ network: SuiNetworks;
23
+ txType: TransactionType;
24
+ txSubType: string;
25
+ intentionData: T;
26
+ clientUrl: string;
27
+ account: WalletAccount;
28
+ }): Promise<TransactionBlock>;
29
+ }
30
+ interface IAppHelperInternalLegacy<T> {
31
+ application: string;
32
+ supportSDK: '@mysten/sui.js';
10
33
  deserialize(input: SuiSignTransactionBlockInput & {
11
34
  network: SuiNetworks;
12
35
  suiClient: SuiClient;
@@ -25,11 +48,34 @@ interface MSafeAppHelper<T> {
25
48
  account: WalletAccount;
26
49
  }): Promise<TransactionBlock>;
27
50
  }
51
+ interface IAppHelperInternal<T> {
52
+ application: string;
53
+ supportSDK: '@mysten/sui';
54
+ deserialize(input: {
55
+ transaction: Transaction;
56
+ chain: IdentifierString;
57
+ network: SuiNetworks;
58
+ suiClient: SuiClient$1;
59
+ account: WalletAccount;
60
+ }): Promise<{
61
+ txType: TransactionType;
62
+ txSubType: string;
63
+ intentionData: T;
64
+ }>;
65
+ build(input: {
66
+ network: SuiNetworks;
67
+ txType: TransactionType;
68
+ txSubType: string;
69
+ intentionData: T;
70
+ suiClient: SuiClient$1;
71
+ account: WalletAccount;
72
+ }): Promise<Transaction>;
73
+ }
28
74
 
29
75
  declare class MSafeApps {
30
- apps: Map<string, MSafeAppHelper<any>>;
31
- constructor(apps: MSafeAppHelper<any>[]);
32
- getAppHelper(appName: string): MSafeAppHelper<any>;
76
+ apps: Map<string, IAppHelper<any>>;
77
+ constructor(apps: (IAppHelperInternalLegacy<any> | IAppHelperInternal<any>)[]);
78
+ getAppHelper(appName: string): IAppHelper<any>;
33
79
  }
34
80
 
35
81
  declare const appHelpers: MSafeApps;