@0xobelisk/sui-client 0.5.3 → 0.5.4

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.
Files changed (42) hide show
  1. package/dist/index.d.ts +3 -1
  2. package/dist/index.js +343 -238
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +331 -245
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/libs/multiSig/client.d.ts +15 -0
  7. package/dist/libs/multiSig/index.d.ts +1 -0
  8. package/dist/libs/multiSig/publickey.d.ts +2 -0
  9. package/dist/libs/suiAccountManager/index.d.ts +1 -1
  10. package/dist/libs/suiAccountManager/keypair.d.ts +1 -1
  11. package/dist/libs/suiContractFactory/index.d.ts +1 -1
  12. package/dist/libs/suiContractFactory/types.d.ts +1 -1
  13. package/dist/libs/suiInteractor/index.d.ts +0 -1
  14. package/dist/libs/suiInteractor/suiInteractor.d.ts +17 -177
  15. package/dist/libs/suiModel/suiOwnedObject.d.ts +4 -4
  16. package/dist/libs/suiModel/suiSharedObject.d.ts +4 -5
  17. package/dist/libs/suiTxBuilder/index.d.ts +178 -374
  18. package/dist/libs/suiTxBuilder/util.d.ts +41 -59
  19. package/dist/metadata/index.d.ts +2 -33
  20. package/dist/obelisk.d.ts +20 -2454
  21. package/dist/types/index.d.ts +28 -6
  22. package/package.json +22 -19
  23. package/src/index.ts +3 -1
  24. package/src/libs/multiSig/client.ts +44 -0
  25. package/src/libs/multiSig/index.ts +1 -0
  26. package/src/libs/multiSig/publickey.ts +11 -0
  27. package/src/libs/suiAccountManager/index.ts +1 -1
  28. package/src/libs/suiAccountManager/keypair.ts +1 -1
  29. package/src/libs/suiAccountManager/util.ts +1 -1
  30. package/src/libs/suiContractFactory/index.ts +1 -1
  31. package/src/libs/suiContractFactory/types.ts +2 -2
  32. package/src/libs/suiInteractor/index.ts +1 -1
  33. package/src/libs/suiInteractor/suiInteractor.ts +106 -111
  34. package/src/libs/suiModel/suiOwnedObject.ts +5 -10
  35. package/src/libs/suiModel/suiSharedObject.ts +4 -7
  36. package/src/libs/suiTxBuilder/index.ts +146 -100
  37. package/src/libs/suiTxBuilder/util.ts +145 -31
  38. package/src/metadata/index.ts +5 -3
  39. package/src/obelisk.ts +52 -37
  40. package/src/types/index.ts +53 -24
  41. package/dist/libs/suiInteractor/defaultConfig.d.ts +0 -10
  42. package/src/libs/suiInteractor/defaultConfig.ts +0 -32
@@ -1,76 +1,58 @@
1
- import { TransactionArgument, TransactionBlock } from '@mysten/sui.js';
2
- import { SuiTxArg, SuiInputTypes } from '../../types';
3
- export declare const getDefaultSuiInputType: (value: any) => SuiInputTypes;
1
+ import type { TransactionArgument, TransactionBlock, TransactionObjectArgument } from '@mysten/sui.js/transactions';
2
+ import type { SuiInputTypes, SuiObjectArg, SuiAddressArg, SuiTxArg, SuiVecTxArg } from 'src/types';
3
+ export declare const getDefaultSuiInputType: (value: SuiTxArg) => SuiInputTypes | undefined;
4
4
  /**
5
5
  * Since we know the elements in the array are the same type
6
6
  * If type is not provided, we will try to infer the type from the first element
7
7
  * By default,
8
8
  *
9
- * string starting with `0x` =====> object id
9
+ * string is hex and its length equal to 32 =====> object id
10
10
  * number, bigint ====> u64
11
11
  * boolean =====> bool
12
12
  *
13
- *
14
13
  * If type is provided, we will use the type to convert the array
15
14
  * @param args
16
- * @param type 'address' | 'bool' | 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'object'
15
+ * @param type 'address' | 'bool' | 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'signer' | 'object' | string
17
16
  */
18
- export declare function makeVecParam(txBlock: TransactionBlock, args: SuiTxArg[], type?: SuiInputTypes): ({
19
- kind: "GasCoin";
20
- } & ({
21
- kind: "Input";
22
- index: number;
23
- type?: "object" | "pure" | undefined;
24
- value?: any;
25
- } | {
26
- kind: "GasCoin";
27
- } | {
28
- kind: "Result";
29
- index: number;
30
- } | {
31
- kind: "NestedResult";
32
- index: number;
33
- resultIndex: number;
34
- })[]) | ({
35
- kind: "Result";
36
- index: number;
37
- } & ({
38
- kind: "Input";
39
- index: number;
40
- type?: "object" | "pure" | undefined;
41
- value?: any;
42
- } | {
43
- kind: "GasCoin";
44
- } | {
45
- kind: "Result";
46
- index: number;
47
- } | {
48
- kind: "NestedResult";
49
- index: number;
50
- resultIndex: number;
51
- })[]) | ({
52
- kind: "NestedResult";
17
+ export declare function makeVecParam(txBlock: TransactionBlock, args: SuiTxArg[], type?: SuiInputTypes): TransactionArgument;
18
+ /**
19
+ * Check whether it is an valid move vec input.
20
+ *
21
+ * @param arg The argument to check.
22
+ * @returns boolean.
23
+ */
24
+ export declare function isMoveVecArg(arg: SuiTxArg | SuiVecTxArg): arg is SuiVecTxArg;
25
+ /**
26
+ * Convert any valid input into array of TransactionArgument.
27
+ *
28
+ * @param txb The Transaction Block
29
+ * @param args The array of argument to convert.
30
+ * @returns The converted array of TransactionArgument.
31
+ */
32
+ export declare function convertArgs(txBlock: TransactionBlock, args: (SuiTxArg | SuiVecTxArg)[]): ({
33
+ type: "pure";
53
34
  index: number;
54
- resultIndex: number;
55
- } & ({
56
35
  kind: "Input";
57
- index: number;
58
- type?: "object" | "pure" | undefined;
59
36
  value?: any;
60
- } | {
61
- kind: "GasCoin";
62
- } | {
63
- kind: "Result";
64
- index: number;
65
- } | {
66
- kind: "NestedResult";
37
+ } | TransactionObjectArgument | import("@mysten/bcs").SerializedBcs<unknown, unknown>)[];
38
+ /**
39
+ * Convert any valid address input into a TransactionArgument.
40
+ *
41
+ * @param txb The Transaction Block
42
+ * @param arg The address argument to convert.
43
+ * @returns The converted TransactionArgument.
44
+ */
45
+ export declare function convertAddressArg(txBlock: TransactionBlock, arg: SuiAddressArg): TransactionObjectArgument | {
46
+ type: "pure";
67
47
  index: number;
68
- resultIndex: number;
69
- })[]) | {
70
48
  kind: "Input";
71
- index: number;
72
- type?: "object" | "pure" | undefined;
73
49
  value?: any;
74
- };
75
- export declare function isMoveVecArg(arg: any): any;
76
- export declare function convertArgs(txBlock: TransactionBlock, args: any[]): TransactionArgument[];
50
+ } | import("@mysten/bcs").SerializedBcs<unknown, unknown>;
51
+ /**
52
+ * Convert any valid object input into a TransactionArgument.
53
+ *
54
+ * @param txb The Transaction Block
55
+ * @param arg The object argument to convert.
56
+ * @returns The converted TransactionArgument.
57
+ */
58
+ export declare function convertObjArg(txb: TransactionBlock, arg: SuiObjectArg): TransactionObjectArgument;
@@ -1,34 +1,3 @@
1
+ import { SuiMoveNormalizedModules } from '@mysten/sui.js/client';
1
2
  import { NetworkType } from '../types';
2
- export declare function loadMetadata(networkType: NetworkType, packageId: string): Promise<Record<string, {
3
- address: string;
4
- name: string;
5
- fileFormatVersion: number;
6
- friends: {
7
- address: string;
8
- name: string;
9
- }[];
10
- structs: Record<string, {
11
- fields: {
12
- type: import("@mysten/sui.js").SuiMoveNormalizedType;
13
- name: string;
14
- }[];
15
- abilities: {
16
- abilities: string[];
17
- };
18
- typeParameters: {
19
- constraints: {
20
- abilities: string[];
21
- };
22
- isPhantom: boolean;
23
- }[];
24
- }>;
25
- exposedFunctions: Record<string, {
26
- visibility: "Private" | "Public" | "Friend";
27
- isEntry: boolean;
28
- typeParameters: {
29
- abilities: string[];
30
- }[];
31
- parameters: import("@mysten/sui.js").SuiMoveNormalizedType[];
32
- return: import("@mysten/sui.js").SuiMoveNormalizedType[];
33
- }>;
34
- }> | undefined>;
3
+ export declare function loadMetadata(networkType: NetworkType, packageId: string): Promise<SuiMoveNormalizedModules | undefined>;