@0xobelisk/sui-client 0.5.4 → 0.5.6
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.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.ts +5 -19
- package/package.json +3 -3
- package/src/obelisk.ts +14 -12
- package/src/types/index.ts +24 -23
- package/dist/libs/multiSig/client.d.ts +0 -15
- package/dist/libs/multiSig/index.d.ts +0 -1
- package/dist/libs/multiSig/publickey.d.ts +0 -2
- package/dist/libs/suiAccountManager/crypto.d.ts +0 -1
- package/dist/libs/suiAccountManager/util.d.ts +0 -29
- package/dist/libs/suiContractFactory/index.d.ts +0 -20
- package/dist/libs/suiContractFactory/types.d.ts +0 -49
- package/dist/libs/suiInteractor/util.d.ts +0 -1
- package/dist/libs/suiModel/index.d.ts +0 -2
- package/dist/libs/suiModel/suiOwnedObject.d.ts +0 -24
- package/dist/libs/suiModel/suiSharedObject.d.ts +0 -11
- package/dist/utils/index.d.ts +0 -3
package/src/types/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ObjectContentFields } from '@mysten/sui.js/src/types';
|
|
2
|
+
import type { SerializedBcs } from '@mysten/bcs';
|
|
3
|
+
import type { TransactionArgument } from '@mysten/sui.js/transactions';
|
|
2
4
|
import type {
|
|
3
5
|
TransactionBlock,
|
|
4
6
|
TransactionObjectArgument,
|
|
5
|
-
TransactionArgument,
|
|
6
7
|
TransactionResult,
|
|
7
8
|
} from '@mysten/sui.js/transactions';
|
|
8
9
|
import type {
|
|
@@ -14,7 +15,6 @@ import type {
|
|
|
14
15
|
MoveStruct,
|
|
15
16
|
} from '@mysten/sui.js/client';
|
|
16
17
|
import type { SharedObjectRef, ObjectArg } from '@mysten/sui.js/bcs';
|
|
17
|
-
import type { SerializedBcs } from '@mysten/bcs';
|
|
18
18
|
// export type TransactionResult = TransactionArgument & TransactionArgument[];
|
|
19
19
|
|
|
20
20
|
import { SuiMoveMoudleFuncType } from '../libs/suiContractFactory/types';
|
|
@@ -67,25 +67,26 @@ export type SchemaValueType = {
|
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
export type SuiTxArgument =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
// export type SuiTxArgument =
|
|
71
|
+
// | {
|
|
72
|
+
// kind: 'Input';
|
|
73
|
+
// index: number;
|
|
74
|
+
// type?: 'object' | 'pure' | undefined;
|
|
75
|
+
// value?: any;
|
|
76
|
+
// }
|
|
77
|
+
// | {
|
|
78
|
+
// kind: 'GasCoin';
|
|
79
|
+
// }
|
|
80
|
+
// | {
|
|
81
|
+
// kind: 'Result';
|
|
82
|
+
// index: number;
|
|
83
|
+
// }
|
|
84
|
+
// | {
|
|
85
|
+
// kind: 'NestedResult';
|
|
86
|
+
// index: number;
|
|
87
|
+
// resultIndex: number;
|
|
88
|
+
// };
|
|
89
|
+
|
|
89
90
|
export type SchemaContentType = {
|
|
90
91
|
type: string;
|
|
91
92
|
fields: SchemaValueType;
|
|
@@ -100,7 +101,7 @@ export interface MessageMeta {
|
|
|
100
101
|
export interface ContractQuery extends MessageMeta {
|
|
101
102
|
(
|
|
102
103
|
tx: TransactionBlock,
|
|
103
|
-
params:
|
|
104
|
+
params: (TransactionArgument | SerializedBcs<any>)[],
|
|
104
105
|
typeArguments?: string[],
|
|
105
106
|
isRaw?: boolean
|
|
106
107
|
): Promise<DevInspectResults | TransactionResult>;
|
|
@@ -109,7 +110,7 @@ export interface ContractQuery extends MessageMeta {
|
|
|
109
110
|
export interface ContractTx extends MessageMeta {
|
|
110
111
|
(
|
|
111
112
|
tx: TransactionBlock,
|
|
112
|
-
params:
|
|
113
|
+
params: (TransactionArgument | SerializedBcs<any>)[],
|
|
113
114
|
typeArguments?: string[],
|
|
114
115
|
isRaw?: boolean
|
|
115
116
|
): Promise<SuiTransactionBlockResponse | TransactionResult>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MultiSigPublicKey } from '@mysten/sui.js/multisig';
|
|
2
|
-
import type { PublicKey } from '@mysten/sui.js/src/cryptography';
|
|
3
|
-
export type PublicKeyWeightPair = {
|
|
4
|
-
publicKey: PublicKey;
|
|
5
|
-
weight: number;
|
|
6
|
-
};
|
|
7
|
-
export declare class MultiSigClient {
|
|
8
|
-
readonly pksWeightPairs: PublicKeyWeightPair[];
|
|
9
|
-
readonly threshold: number;
|
|
10
|
-
readonly multiSigPublicKey: MultiSigPublicKey;
|
|
11
|
-
constructor(pks: PublicKeyWeightPair[], threshold: number);
|
|
12
|
-
static fromRawEd25519PublicKeys(rawPublicKeys: string[], weights: number[], threshold: number): MultiSigClient;
|
|
13
|
-
multiSigAddress(): string;
|
|
14
|
-
combinePartialSigs(sigs: string[]): string;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MultiSigClient } from './client';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const generateMnemonic: (numberOfWords?: 12 | 24) => string;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description This regular expression matches any string that contains only hexadecimal digits (0-9, A-F, a-f).
|
|
3
|
-
* @param str
|
|
4
|
-
*/
|
|
5
|
-
export declare const isHex: (str: string) => boolean;
|
|
6
|
-
/**
|
|
7
|
-
* @description This regular expression matches any string that contains only base64 digits (0-9, A-Z, a-z, +, /, =).
|
|
8
|
-
* Note that the "=" signs at the end are optional padding characters that may be present in some base64 encoded strings.
|
|
9
|
-
* @param str
|
|
10
|
-
*/
|
|
11
|
-
export declare const isBase64: (str: string) => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Convert a hex string to Uint8Array
|
|
14
|
-
* @param hexStr
|
|
15
|
-
*/
|
|
16
|
-
export declare const fromHEX: (hexStr: string) => Uint8Array;
|
|
17
|
-
/**
|
|
18
|
-
* @description Convert a hex or base64 string to Uint8Array
|
|
19
|
-
*/
|
|
20
|
-
export declare const hexOrBase64ToUint8Array: (str: string) => Uint8Array;
|
|
21
|
-
/**
|
|
22
|
-
* normalize a private key
|
|
23
|
-
* A private key is a 32-byte array.
|
|
24
|
-
* But there are two different formats for private keys:
|
|
25
|
-
* 1. A 32-byte array
|
|
26
|
-
* 2. A 64-byte array with the first 32 bytes being the private key and the last 32 bytes being the public key
|
|
27
|
-
* 3. A 33-byte array with the first byte being 0x00 (sui.keystore key is a Base64 string with scheme flag 0x00 at the beginning)
|
|
28
|
-
*/
|
|
29
|
-
export declare const normalizePrivateKey: (key: Uint8Array) => Uint8Array;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { SuiMoveNormalizedModules } from '@mysten/sui.js/client';
|
|
2
|
-
import type { ContractFactoryParams } from './types';
|
|
3
|
-
export type ApiTypes = 'promise' | 'rxjs';
|
|
4
|
-
export declare class SuiContractFactory {
|
|
5
|
-
packageId: string;
|
|
6
|
-
metadata: SuiMoveNormalizedModules | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Support the following ways to init the SuiToolkit:
|
|
9
|
-
* 1. mnemonics
|
|
10
|
-
* 2. secretKey (base64 or hex)
|
|
11
|
-
* If none of them is provided, will generate a random mnemonics with 24 words.
|
|
12
|
-
*
|
|
13
|
-
* @param mnemonics, 12 or 24 mnemonics words, separated by space
|
|
14
|
-
* @param secretKey, base64 or hex string, when mnemonics is provided, secretKey will be ignored
|
|
15
|
-
*/
|
|
16
|
-
constructor({ packageId, metadata }?: ContractFactoryParams);
|
|
17
|
-
getFuncByModuleName(moduleName: string): void;
|
|
18
|
-
getAllFunc(): void;
|
|
19
|
-
getAllModule(): void;
|
|
20
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { SuiMoveNormalizedModules, SuiMoveNormalizedType } from '@mysten/sui.js/client';
|
|
2
|
-
export type ContractFactoryParams = {
|
|
3
|
-
packageId?: string;
|
|
4
|
-
metadata?: SuiMoveNormalizedModules;
|
|
5
|
-
};
|
|
6
|
-
export type SuiMoveMoudleValueType = {
|
|
7
|
-
address: string;
|
|
8
|
-
name: string;
|
|
9
|
-
fileFormatVersion: number;
|
|
10
|
-
friends: {
|
|
11
|
-
address: string;
|
|
12
|
-
name: string;
|
|
13
|
-
}[];
|
|
14
|
-
structs: Record<string, {
|
|
15
|
-
fields: {
|
|
16
|
-
type: SuiMoveNormalizedType;
|
|
17
|
-
name: string;
|
|
18
|
-
}[];
|
|
19
|
-
abilities: {
|
|
20
|
-
abilities: string[];
|
|
21
|
-
};
|
|
22
|
-
typeParameters: {
|
|
23
|
-
constraints: {
|
|
24
|
-
abilities: string[];
|
|
25
|
-
};
|
|
26
|
-
isPhantom: boolean;
|
|
27
|
-
}[];
|
|
28
|
-
}>;
|
|
29
|
-
exposedFunctions: Record<string, {
|
|
30
|
-
visibility: 'Private' | 'Public' | 'Friend';
|
|
31
|
-
isEntry: boolean;
|
|
32
|
-
typeParameters: {
|
|
33
|
-
abilities: string[];
|
|
34
|
-
}[];
|
|
35
|
-
parameters: SuiMoveNormalizedType[];
|
|
36
|
-
return: SuiMoveNormalizedType[];
|
|
37
|
-
}>;
|
|
38
|
-
};
|
|
39
|
-
export type SuiMoveMoudleFuncType = {
|
|
40
|
-
moduleName: string;
|
|
41
|
-
funcName: string;
|
|
42
|
-
visibility: 'Private' | 'Public' | 'Friend';
|
|
43
|
-
isEntry: boolean;
|
|
44
|
-
typeParameters: {
|
|
45
|
-
abilities: string[];
|
|
46
|
-
}[];
|
|
47
|
-
parameters: SuiMoveNormalizedType[];
|
|
48
|
-
return: SuiMoveNormalizedType[];
|
|
49
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const delay: (ms: number) => Promise<unknown>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { SuiTransactionBlockResponse } from '@mysten/sui.js/client';
|
|
2
|
-
import type { CallArg } from '@mysten/sui.js/bcs';
|
|
3
|
-
export declare class SuiOwnedObject {
|
|
4
|
-
readonly objectId: string;
|
|
5
|
-
version?: string;
|
|
6
|
-
digest?: string;
|
|
7
|
-
constructor(param: {
|
|
8
|
-
objectId: string;
|
|
9
|
-
version?: string;
|
|
10
|
-
digest?: string;
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* Check if the object is fully initialized.
|
|
14
|
-
* So that when it's used as an input, it won't be necessary to fetch from fullnode again.
|
|
15
|
-
* Which can save time when sending transactions.
|
|
16
|
-
*/
|
|
17
|
-
isFullObject(): boolean;
|
|
18
|
-
asCallArg(): CallArg | string;
|
|
19
|
-
/**
|
|
20
|
-
* Update object version & digest based on the transaction response.
|
|
21
|
-
* @param txResponse
|
|
22
|
-
*/
|
|
23
|
-
updateFromTxResponse(txResponse: SuiTransactionBlockResponse): void;
|
|
24
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CallArg } from '@mysten/sui.js/bcs';
|
|
2
|
-
export declare class SuiSharedObject {
|
|
3
|
-
readonly objectId: string;
|
|
4
|
-
initialSharedVersion?: string;
|
|
5
|
-
constructor(param: {
|
|
6
|
-
objectId: string;
|
|
7
|
-
initialSharedVersion?: string;
|
|
8
|
-
mutable?: boolean;
|
|
9
|
-
});
|
|
10
|
-
asCallArg(mutable?: boolean): CallArg | string;
|
|
11
|
-
}
|
package/dist/utils/index.d.ts
DELETED