@scallop-io/sui-kit 2.0.1 → 2.2.0

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.
@@ -1,87 +1,87 @@
1
+ import type { SerializedBcs } from "@mysten/bcs";
2
+ import type { ClientWithCoreApi, SuiClientTypes } from "@mysten/sui/client";
1
3
  import type {
2
- Transaction,
3
- TransactionObjectArgument,
4
- Argument,
5
- Inputs,
6
- TransactionArgument,
7
- } from '@mysten/sui/transactions';
8
- import type { SerializedBcs } from '@mysten/bcs';
9
- import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client';
10
- import { SuiTxBlock } from 'src/libs/suiTxBuilder/index.js';
4
+ Argument,
5
+ Inputs,
6
+ Transaction,
7
+ TransactionArgument,
8
+ TransactionObjectArgument,
9
+ } from "@mysten/sui/transactions";
10
+ import type { SuiTxBlock } from "src/libs/suiTxBuilder/index.js";
11
11
 
12
12
  export type SuiKitParams = (AccountManagerParams & {
13
- faucetUrl?: string;
14
- networkType?: NetworkType;
13
+ faucetUrl?: string;
14
+ networkType?: NetworkType;
15
15
  }) &
16
- Partial<SuiInteractorParams>;
16
+ Partial<SuiInteractorParams>;
17
17
 
18
18
  export type SuiInteractorParams =
19
- | {
20
- fullnodeUrls: string[];
21
- network?: NetworkType;
22
- }
23
- | {
24
- suiClients: ClientWithCoreApi[];
25
- };
19
+ | {
20
+ fullnodeUrls: string[];
21
+ network?: NetworkType;
22
+ }
23
+ | {
24
+ suiClients: ClientWithCoreApi[];
25
+ };
26
26
 
27
- export type NetworkType = 'testnet' | 'mainnet' | 'devnet' | 'localnet';
27
+ export type NetworkType = "testnet" | "mainnet" | "devnet" | "localnet";
28
28
 
29
29
  export type AccountManagerParams = {
30
- mnemonics?: string;
31
- secretKey?: string;
30
+ mnemonics?: string;
31
+ secretKey?: string;
32
32
  };
33
33
 
34
34
  export type DerivePathParams = {
35
- accountIndex?: number;
36
- isExternal?: boolean;
37
- addressIndex?: number;
35
+ accountIndex?: number;
36
+ isExternal?: boolean;
37
+ addressIndex?: number;
38
38
  };
39
39
 
40
40
  type TransactionBlockType = InstanceType<typeof Transaction>;
41
41
 
42
42
  export type PureCallArg = {
43
- Pure: number[];
43
+ Pure: number[];
44
44
  };
45
45
 
46
46
  type SharedObjectRef = {
47
- /** Hex code as string representing the object id */
48
- objectId: string;
47
+ /** Hex code as string representing the object id */
48
+ objectId: string;
49
49
 
50
- /** The version the object was shared at */
51
- initialSharedVersion: number | string;
50
+ /** The version the object was shared at */
51
+ initialSharedVersion: number | string;
52
52
 
53
- /** Whether reference is mutable */
54
- mutable: boolean;
53
+ /** Whether reference is mutable */
54
+ mutable: boolean;
55
55
  };
56
56
 
57
57
  type SuiObjectRef = {
58
- /** Base64 string representing the object digest */
59
- objectId: string;
60
- /** Object version */
61
- version: number | string;
62
- /** Hex code as string representing the object id */
63
- digest: string;
58
+ /** Base64 string representing the object digest */
59
+ objectId: string;
60
+ /** Object version */
61
+ version: number | string;
62
+ /** Hex code as string representing the object id */
63
+ digest: string;
64
64
  };
65
65
 
66
66
  /**
67
67
  * An object argument.
68
68
  */
69
69
  type ObjectArg =
70
- | { ImmOrOwnedObject: SuiObjectRef }
71
- | { SharedObject: SharedObjectRef }
72
- | { Receiving: SuiObjectRef };
70
+ | { ImmOrOwnedObject: SuiObjectRef }
71
+ | { SharedObject: SharedObjectRef }
72
+ | { Receiving: SuiObjectRef };
73
73
 
74
74
  export type ObjectCallArg = {
75
- Object: ObjectArg;
75
+ Object: ObjectArg;
76
76
  };
77
- export type TransactionType = Parameters<TransactionBlockType['add']>;
77
+ export type TransactionType = Parameters<TransactionBlockType["add"]>;
78
78
 
79
79
  export type TransactionPureArgument = Extract<
80
- Argument,
81
- {
82
- $kind: 'Input';
83
- type?: 'pure';
84
- }
80
+ Argument,
81
+ {
82
+ $kind: "Input";
83
+ type?: "pure";
84
+ }
85
85
  >;
86
86
 
87
87
  export type SuiTxArg = TransactionArgument | SerializedBcs<any>;
@@ -89,44 +89,39 @@ export type SuiAddressArg = Argument | SerializedBcs<any> | string;
89
89
  export type SuiAmountsArg = SuiTxArg | number | bigint;
90
90
 
91
91
  export type SuiObjectArg =
92
- | TransactionObjectArgument
93
- | string
94
- | Parameters<typeof Inputs.ObjectRef>[0]
95
- | Parameters<typeof Inputs.SharedObjectRef>[0]
96
- | ObjectCallArg;
92
+ | TransactionObjectArgument
93
+ | string
94
+ | Parameters<typeof Inputs.ObjectRef>[0]
95
+ | Parameters<typeof Inputs.SharedObjectRef>[0]
96
+ | ObjectCallArg;
97
97
 
98
98
  export type SuiVecTxArg =
99
- | { value: SuiTxArg[]; vecType: SuiInputTypes }
100
- | SuiTxArg[];
99
+ | { value: SuiTxArg[]; vecType: SuiInputTypes }
100
+ | SuiTxArg[];
101
101
 
102
102
  /**
103
103
  * These are the basics types that can be used in the SUI
104
104
  */
105
105
  export type SuiBasicTypes =
106
- | 'address'
107
- | 'bool'
108
- | 'u8'
109
- | 'u16'
110
- | 'u32'
111
- | 'u64'
112
- | 'u128'
113
- | 'u256';
114
-
115
- export type SuiInputTypes = 'object' | SuiBasicTypes;
116
-
117
- // Transaction result type from SDK v2
118
- export type SuiTransactionResult<
119
- Include extends SuiClientTypes.TransactionInclude = {},
120
- > = SuiClientTypes.TransactionResult<Include>;
106
+ | "address"
107
+ | "bool"
108
+ | "u8"
109
+ | "u16"
110
+ | "u32"
111
+ | "u64"
112
+ | "u128"
113
+ | "u256";
114
+
115
+ export type SuiInputTypes = "object" | SuiBasicTypes;
121
116
 
122
117
  // Full transaction response with all includes enabled
123
118
  export type SuiTransactionBlockResponse = SuiClientTypes.TransactionResult<{
124
- balanceChanges: true;
125
- effects: true;
126
- events: true;
127
- objectTypes: true;
119
+ balanceChanges: true;
120
+ effects: true;
121
+ events: true;
122
+ objectTypes: true;
128
123
  }>;
129
124
 
130
125
  export type SuiKitReturnType<T extends boolean> = T extends true
131
- ? SuiTransactionBlockResponse
132
- : SuiTxBlock;
126
+ ? SuiTransactionBlockResponse
127
+ : SuiTxBlock;