@0xobelisk/sui-client 1.0.5 → 1.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/dubhe.d.ts +19 -1
- package/dist/index.js +4059 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4059 -11
- package/dist/index.mjs.map +1 -1
- package/dist/libs/http/errors.d.ts +28 -0
- package/dist/libs/http/http.d.ts +21 -0
- package/dist/libs/http/index.d.ts +4 -0
- package/dist/libs/http/types.d.ts +1 -0
- package/dist/libs/suiIndexerClient/index.d.ts +92 -0
- package/dist/libs/suiIndexerClient/types.d.ts +0 -0
- package/dist/libs/suiInteractor/defaultConfig.d.ts +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +14 -9
- package/src/dubhe.ts +71 -1
- package/src/libs/http/errors.ts +122 -0
- package/src/libs/http/http.ts +153 -0
- package/src/libs/http/index.ts +4 -0
- package/src/libs/http/types.ts +1 -0
- package/src/libs/suiIndexerClient/index.ts +225 -0
- package/src/libs/suiIndexerClient/types.ts +0 -0
- package/src/libs/suiInteractor/defaultConfig.ts +6 -0
- package/src/libs/suiInteractor/suiInteractor.ts +8 -0
- package/src/types/index.ts +5 -0
- package/src/utils/index.ts +9 -0
package/dist/dubhe.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ import { SuiContractFactory } from './libs/suiContractFactory';
|
|
|
8
8
|
import { SuiMoveMoudleFuncType } from './libs/suiContractFactory/types';
|
|
9
9
|
import { NetworkConfig } from './libs/suiInteractor';
|
|
10
10
|
import { DerivePathParams, FaucetNetworkType, MapMoudleFuncQuery, MapMoudleFuncTx, DubheParams, SuiTxArg, SuiObjectArg, SuiVecTxArg } from './types';
|
|
11
|
+
import { ConnectionResponse, OrderBy, Schema, SuiIndexerClient } from './libs/suiIndexerClient';
|
|
12
|
+
import { Http } from './libs/http';
|
|
13
|
+
import { WebSocket } from 'ws';
|
|
11
14
|
export declare function isUndefined(value?: unknown): value is undefined;
|
|
12
15
|
export declare function withMeta<T extends {
|
|
13
16
|
meta: SuiMoveMoudleFuncType;
|
|
@@ -18,8 +21,10 @@ export declare function withMeta<T extends {
|
|
|
18
21
|
*/
|
|
19
22
|
export declare class Dubhe {
|
|
20
23
|
#private;
|
|
24
|
+
http: Http;
|
|
21
25
|
accountManager: SuiAccountManager;
|
|
22
26
|
suiInteractor: SuiInteractor;
|
|
27
|
+
suiIndexerClient: SuiIndexerClient;
|
|
23
28
|
contractFactory: SuiContractFactory;
|
|
24
29
|
packageId: string | undefined;
|
|
25
30
|
metadata: SuiMoveNormalizedModules | undefined;
|
|
@@ -35,7 +40,7 @@ export declare class Dubhe {
|
|
|
35
40
|
* @param fullnodeUrl, the fullnode url, default is the preconfig fullnode url for the given network type
|
|
36
41
|
* @param packageId
|
|
37
42
|
*/
|
|
38
|
-
constructor({ mnemonics, secretKey, networkType, fullnodeUrls, packageId, metadata, }?: DubheParams);
|
|
43
|
+
constructor({ mnemonics, secretKey, networkType, fullnodeUrls, packageId, metadata, customFetch, defaultOptions, indexerUrl, indexerWsUrl, }?: DubheParams);
|
|
39
44
|
get query(): MapMoudleFuncQuery;
|
|
40
45
|
get tx(): MapMoudleFuncTx;
|
|
41
46
|
get object(): MapObjectStruct;
|
|
@@ -51,6 +56,18 @@ export declare class Dubhe {
|
|
|
51
56
|
storageType: string;
|
|
52
57
|
params: any[];
|
|
53
58
|
}): Promise<any[] | undefined>;
|
|
59
|
+
getStorage({ name, key1, key2, first, after, last, before, orderBy, distinct, }: {
|
|
60
|
+
name: string;
|
|
61
|
+
key1?: string;
|
|
62
|
+
key2?: string;
|
|
63
|
+
first?: number;
|
|
64
|
+
after?: string;
|
|
65
|
+
last?: number;
|
|
66
|
+
before?: string;
|
|
67
|
+
orderBy?: OrderBy;
|
|
68
|
+
distinct?: boolean;
|
|
69
|
+
}): Promise<ConnectionResponse<Schema>>;
|
|
70
|
+
subscribe(names: string[], handleData: (data: any) => void): Promise<WebSocket>;
|
|
54
71
|
/**
|
|
55
72
|
* else:
|
|
56
73
|
* it will generate signer from the mnemonic with the given derivePathParams.
|
|
@@ -83,6 +100,7 @@ export declare class Dubhe {
|
|
|
83
100
|
getBalance(coinType?: string, derivePathParams?: DerivePathParams): Promise<import("@mysten/sui/client").CoinBalance>;
|
|
84
101
|
balanceOf(accountAddress?: string, coinType?: string, derivePathParams?: DerivePathParams): Promise<import("@mysten/sui/client").CoinBalance>;
|
|
85
102
|
client(): import("@mysten/sui/client").SuiClient;
|
|
103
|
+
indexerClient(): SuiIndexerClient;
|
|
86
104
|
getObject(objectId: string): Promise<SuiObjectData>;
|
|
87
105
|
getObjects(objectIds: string[]): Promise<SuiObjectData[]>;
|
|
88
106
|
signTxn(tx: Uint8Array | Transaction | SuiTx, derivePathParams?: DerivePathParams): Promise<import("@mysten/sui/dist/cjs/cryptography").SignatureWithBytes>;
|