@0xobelisk/sui-client 1.2.0-pre.99 → 2.0.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.
- package/LICENSE +92 -0
- package/dist/dubhe.d.ts +417 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +838 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +832 -26
- package/dist/index.mjs.map +1 -1
- package/dist/libs/suiInteractor/defaultConfig.d.ts +26 -0
- package/dist/libs/suiInteractor/index.d.ts +1 -1
- package/dist/types/index.d.ts +14 -0
- package/dist/utils/index.d.ts +19 -1
- package/package.json +21 -21
- package/src/dubhe.ts +1058 -23
- package/src/index.ts +9 -0
- package/src/libs/suiInteractor/defaultConfig.ts +53 -8
- package/src/libs/suiInteractor/index.ts +1 -1
- package/src/types/index.ts +14 -0
- package/src/utils/index.ts +24 -1
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { NetworkType } from 'src/types';
|
|
2
|
+
/**
|
|
3
|
+
* Testnet deployment of the Dubhe framework.
|
|
4
|
+
* Update these constants whenever the framework is redeployed to testnet.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TESTNET_DUBHE_FRAMEWORK_PACKAGE_ID = "0xae33be6675639d6f1a5c468ae6bbc457ae4e22e57cd7526741d6143ce219d995";
|
|
7
|
+
export declare const TESTNET_DUBHE_HUB_OBJECT_ID = "0x80391929a8772aba091156fd1f099bf79240d2cf4471a14026b4aa68e3a240cc";
|
|
8
|
+
/**
|
|
9
|
+
* Mainnet deployment of the Dubhe framework.
|
|
10
|
+
* Update these constants whenever the framework is redeployed to mainnet.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MAINNET_DUBHE_FRAMEWORK_PACKAGE_ID = "0x5bc40de124588b1e3514ca50f5e7109869351c4d9544e5f0cb9d30dd47bf8de7";
|
|
13
|
+
export declare const MAINNET_DUBHE_HUB_OBJECT_ID = "0x96e92d9baccfd0a2927b4f209756e1edbc18904bff34e486e4bb4a151320e1e5";
|
|
2
14
|
export interface NetworkConfig {
|
|
3
15
|
fullNode: string;
|
|
4
16
|
graphql?: string;
|
|
@@ -8,5 +20,19 @@ export interface NetworkConfig {
|
|
|
8
20
|
explorer: string;
|
|
9
21
|
indexerUrl: string;
|
|
10
22
|
channelUrl: string;
|
|
23
|
+
/**
|
|
24
|
+
* Published package ID of the Dubhe framework for this network.
|
|
25
|
+
* Defined for testnet and mainnet (known constants).
|
|
26
|
+
* Undefined for localnet/devnet — supply after deploying dubhe locally.
|
|
27
|
+
*/
|
|
28
|
+
frameworkPackageId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Shared DappHub object ID for this network.
|
|
31
|
+
* Defined for testnet and mainnet (known constants).
|
|
32
|
+
* Undefined for localnet/devnet — read from the deployment JSON after publishing.
|
|
33
|
+
*/
|
|
34
|
+
dappHubId?: string;
|
|
11
35
|
}
|
|
36
|
+
export declare const getDefaultConfig: (networkType?: NetworkType) => NetworkConfig;
|
|
37
|
+
/** @deprecated Use `getDefaultConfig` instead. */
|
|
12
38
|
export declare const getDefaultURL: (networkType?: NetworkType) => NetworkConfig;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -27,8 +27,22 @@ export type DubheParams = {
|
|
|
27
27
|
faucetUrl?: string;
|
|
28
28
|
networkType?: NetworkType;
|
|
29
29
|
packageId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The canonical dapp_key type string, e.g. `"0105c1...::dapp_key::DappKey"`.
|
|
32
|
+
* Stable across all upgrades — derived from the original (genesis) package ID.
|
|
33
|
+
* When provided this value is used directly; otherwise it is computed from packageId
|
|
34
|
+
* (only safe before the first upgrade).
|
|
35
|
+
* Obtain from the generated `DappKey` export in deployment.ts.
|
|
36
|
+
*/
|
|
37
|
+
dappKey?: string;
|
|
30
38
|
metadata?: SuiMoveNormalizedModules;
|
|
31
39
|
channelUrl?: string;
|
|
40
|
+
/** Published package ID of the dubhe framework. Required for session and user-storage operations. */
|
|
41
|
+
frameworkPackageId?: string;
|
|
42
|
+
/** Object ID of the DappStorage shared object. Stored for convenience; also passed to individual methods. */
|
|
43
|
+
dappStorageId?: string;
|
|
44
|
+
/** Object ID of the DappHub shared object. Required for activate/deactivate session and other DappHub-gated calls. */
|
|
45
|
+
dappHubId?: string;
|
|
32
46
|
};
|
|
33
47
|
export type SchemaFieldType = {
|
|
34
48
|
schemas: {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -4,4 +4,22 @@ declare function normalizeHexAddress(input: string): string | null;
|
|
|
4
4
|
declare function numberToAddressHex(num: number): string;
|
|
5
5
|
declare function normalizePackageId(input: string): string;
|
|
6
6
|
declare function convertHttpToWebSocket(url: string): string;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Build the fully-qualified Move type string for a DApp's `DappKey`.
|
|
9
|
+
*
|
|
10
|
+
* The format matches what `std::type_name::get<DappKey>()` returns on-chain:
|
|
11
|
+
* `<64-char-zero-padded-address>::dapp_key::DappKey`
|
|
12
|
+
*
|
|
13
|
+
* @param packageId - The DApp's published package ID (with or without 0x prefix).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* tx.moveCall({
|
|
18
|
+
* target: `${frameworkPackageId}::dapp_system::settle_writes`,
|
|
19
|
+
* typeArguments: [normalizeDappKey(packageId)],
|
|
20
|
+
* arguments: [...],
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function normalizeDappKey(packageId: string): string;
|
|
25
|
+
export { BasicBcsTypes, capitalizeFirstLetter, normalizeHexAddress, numberToAddressHex, normalizePackageId, convertHttpToWebSocket, normalizeDappKey };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xobelisk/sui-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Tookit for interacting with move eps framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sui",
|
|
@@ -31,25 +31,6 @@
|
|
|
31
31
|
"dist",
|
|
32
32
|
"src"
|
|
33
33
|
],
|
|
34
|
-
"scripts": {
|
|
35
|
-
"build": "npm run build:types && npm run build:tsup",
|
|
36
|
-
"build:tsup": "tsup ./src/index.ts --format esm,cjs --sourcemap",
|
|
37
|
-
"build:types": "tsc --build",
|
|
38
|
-
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
39
|
-
"commit": "commit",
|
|
40
|
-
"doc": "typedoc --out docs src/index.ts",
|
|
41
|
-
"format": "prettier --write .",
|
|
42
|
-
"format:check": "prettier --check .",
|
|
43
|
-
"format:fix": "prettier --write '**/*.{ts,json,md}'",
|
|
44
|
-
"lint": "eslint . --ext .ts",
|
|
45
|
-
"test": "pnpm test:typecheck && pnpm test:unit",
|
|
46
|
-
"test:typecheck": "tsc -p ./test",
|
|
47
|
-
"type-check": "tsc --noEmit",
|
|
48
|
-
"validate": "pnpm format:check && pnpm type-check",
|
|
49
|
-
"watch": "pnpm run clean & pnpm run watch:types & pnpm run watch:tsup",
|
|
50
|
-
"watch:tsup": "tsup ./src/index.ts --format esm,cjs --clean --splitting --watch",
|
|
51
|
-
"watch:types": "tsc --watch"
|
|
52
|
-
},
|
|
53
34
|
"dependencies": {
|
|
54
35
|
"@mysten/bcs": "1.6.3",
|
|
55
36
|
"@mysten/sui": "1.35.0",
|
|
@@ -98,5 +79,24 @@
|
|
|
98
79
|
},
|
|
99
80
|
"publishConfig": {
|
|
100
81
|
"access": "public"
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"build": "npm run build:types && npm run build:tsup",
|
|
85
|
+
"build:tsup": "tsup ./src/index.ts --format esm,cjs --sourcemap",
|
|
86
|
+
"build:types": "tsc --build",
|
|
87
|
+
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
88
|
+
"commit": "commit",
|
|
89
|
+
"doc": "typedoc --out docs src/index.ts",
|
|
90
|
+
"format": "prettier --write .",
|
|
91
|
+
"format:check": "prettier --check .",
|
|
92
|
+
"format:fix": "prettier --write '**/*.{ts,json,md}'",
|
|
93
|
+
"lint": "eslint . --ext .ts",
|
|
94
|
+
"test": "pnpm test:typecheck && pnpm test:unit",
|
|
95
|
+
"test:typecheck": "tsc -p ./test",
|
|
96
|
+
"type-check": "tsc --noEmit",
|
|
97
|
+
"validate": "pnpm format:check && pnpm type-check",
|
|
98
|
+
"watch": "pnpm run clean & pnpm run watch:types & pnpm run watch:tsup",
|
|
99
|
+
"watch:tsup": "tsup ./src/index.ts --format esm,cjs --clean --splitting --watch",
|
|
100
|
+
"watch:types": "tsc --watch"
|
|
101
101
|
}
|
|
102
|
-
}
|
|
102
|
+
}
|