@msafe/sui-app-store 0.0.5 → 0.0.7
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 +42 -0
- package/dist/index.d.ts +31 -35
- package/dist/index.global.js +4 -4
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +132 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +19 -11
- package/dist/index.cjs +0 -64
- package/dist/index.cjs.map +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as _mysten_sui_js_dist_cjs_builder from '@mysten/sui.js/dist/cjs/builder';
|
|
2
|
+
import { TransactionType } from '@msafe/sui3-utils';
|
|
3
|
+
import { SuiClient } from '@mysten/sui.js/client';
|
|
4
|
+
import { SuiSignTransactionBlockInput, WalletAccount } from '@mysten/wallet-standard';
|
|
5
|
+
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
6
|
+
|
|
7
|
+
interface MSafeAppHelper<T extends TransactionIntention<D>, D> {
|
|
8
|
+
application: string;
|
|
9
|
+
deserialize(input: SuiSignTransactionBlockInput): T;
|
|
10
|
+
build(input: {
|
|
11
|
+
txType: TransactionType;
|
|
12
|
+
txSubType: string;
|
|
13
|
+
intentionData: D;
|
|
14
|
+
suiClient: SuiClient;
|
|
15
|
+
account: WalletAccount;
|
|
16
|
+
}): Promise<TransactionBlock>;
|
|
17
|
+
}
|
|
18
|
+
interface TransactionIntention<D> {
|
|
19
|
+
application: string;
|
|
20
|
+
txType: TransactionType;
|
|
21
|
+
txSubType: string;
|
|
22
|
+
data: D;
|
|
23
|
+
serialize(): string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare class MSafeApps {
|
|
27
|
+
apps: Map<string, MSafeAppHelper<any, any>>;
|
|
28
|
+
constructor(apps: MSafeAppHelper<any, any>[]);
|
|
29
|
+
getAppHelper(appName: string): MSafeAppHelper<any, any>;
|
|
30
|
+
deserialize(appName: string, input: SuiSignTransactionBlockInput): any;
|
|
31
|
+
build(appName: string, input: {
|
|
32
|
+
intentionData: any;
|
|
33
|
+
txType: TransactionType;
|
|
34
|
+
txSubType: string;
|
|
35
|
+
suiClient: SuiClient;
|
|
36
|
+
account: WalletAccount;
|
|
37
|
+
}): Promise<_mysten_sui_js_dist_cjs_builder.TransactionBlock>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare const appHelpers: MSafeApps;
|
|
41
|
+
|
|
42
|
+
export { appHelpers };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,46 +1,42 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _mysten_sui_js_dist_cjs_builder from '@mysten/sui.js/dist/cjs/builder';
|
|
2
|
+
import { TransactionType } from '@msafe/sui3-utils';
|
|
2
3
|
import { SuiClient } from '@mysten/sui.js/client';
|
|
3
|
-
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
4
4
|
import { SuiSignTransactionBlockInput, WalletAccount } from '@mysten/wallet-standard';
|
|
5
|
+
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
transactionIntention: TransactionIntention<keyof TransactionIntentions>;
|
|
10
|
-
context: MSafeWalletContext;
|
|
11
|
-
}): Promise<TransactionBlock>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface MSafeWalletApi {
|
|
15
|
-
/**
|
|
16
|
-
* Deserialize transaction block data to human readable data structure.
|
|
17
|
-
* @param input transaction block input
|
|
18
|
-
*/
|
|
19
|
-
deserialize(input: SuiSignTransactionBlockInput): Promise<TransactionIntention<keyof TransactionIntentions>>;
|
|
7
|
+
interface MSafeAppHelper<T extends TransactionIntention<D>, D> {
|
|
8
|
+
application: string;
|
|
9
|
+
deserialize(input: SuiSignTransactionBlockInput): T;
|
|
20
10
|
build(input: {
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
txType: TransactionType;
|
|
12
|
+
txSubType: string;
|
|
13
|
+
intentionData: D;
|
|
14
|
+
suiClient: SuiClient;
|
|
15
|
+
account: WalletAccount;
|
|
23
16
|
}): Promise<TransactionBlock>;
|
|
24
17
|
}
|
|
25
|
-
interface
|
|
26
|
-
|
|
27
|
-
account: WalletAccount;
|
|
28
|
-
}
|
|
29
|
-
interface TransactionIntention<T extends keyof TransactionIntentions> {
|
|
18
|
+
interface TransactionIntention<D> {
|
|
19
|
+
application: string;
|
|
30
20
|
txType: TransactionType;
|
|
31
|
-
txSubType:
|
|
32
|
-
data:
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Support transaction intention data structure.
|
|
36
|
-
* App need to add your transaction intention types here
|
|
37
|
-
*/
|
|
38
|
-
interface TransactionIntentions {
|
|
39
|
-
CoinTransfer: CoinTransferIntention;
|
|
40
|
-
ObjectTransfer: ObjectTransferIntention;
|
|
21
|
+
txSubType: string;
|
|
22
|
+
data: D;
|
|
23
|
+
serialize(): string;
|
|
41
24
|
}
|
|
25
|
+
|
|
42
26
|
declare class MSafeApps {
|
|
43
|
-
|
|
27
|
+
apps: Map<string, MSafeAppHelper<any, any>>;
|
|
28
|
+
constructor(apps: MSafeAppHelper<any, any>[]);
|
|
29
|
+
getAppHelper(appName: string): MSafeAppHelper<any, any>;
|
|
30
|
+
deserialize(appName: string, input: SuiSignTransactionBlockInput): any;
|
|
31
|
+
build(appName: string, input: {
|
|
32
|
+
intentionData: any;
|
|
33
|
+
txType: TransactionType;
|
|
34
|
+
txSubType: string;
|
|
35
|
+
suiClient: SuiClient;
|
|
36
|
+
account: WalletAccount;
|
|
37
|
+
}): Promise<_mysten_sui_js_dist_cjs_builder.TransactionBlock>;
|
|
44
38
|
}
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
declare const appHelpers: MSafeApps;
|
|
41
|
+
|
|
42
|
+
export { appHelpers };
|