@0xobelisk/sui-client 1.2.0-pre.71 → 1.2.0-pre.72
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/README.md +7 -8
- package/dist/dubhe.d.ts +4 -4
- package/dist/index.js +116 -214
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +117 -218
- package/dist/index.mjs.map +1 -1
- package/dist/libs/suiContractFactory/index.d.ts +1 -1
- package/dist/libs/suiInteractor/suiInteractor.d.ts +1 -1
- package/dist/libs/suiTxBuilder/index.d.ts +4 -4
- package/dist/types/index.d.ts +2 -2
- package/package.json +19 -75
- package/src/dubhe.ts +150 -252
- package/src/errors/index.ts +2 -4
- package/src/libs/multiSig/client.ts +2 -2
- package/src/libs/suiAccountManager/index.ts +4 -13
- package/src/libs/suiAccountManager/keypair.ts +3 -12
- package/src/libs/suiAccountManager/util.ts +1 -2
- package/src/libs/suiContractFactory/index.ts +27 -33
- package/src/libs/suiContractFactory/types.ts +1 -4
- package/src/libs/suiInteractor/defaultConfig.ts +8 -12
- package/src/libs/suiInteractor/suiInteractor.ts +29 -51
- package/src/libs/suiInteractor/util.ts +1 -2
- package/src/libs/suiModel/suiOwnedObject.ts +3 -3
- package/src/libs/suiModel/suiSharedObject.ts +4 -8
- package/src/libs/suiTxBuilder/index.ts +23 -83
- package/src/libs/suiTxBuilder/util.ts +11 -33
- package/src/metadata/index.ts +1 -2
- package/src/types/index.ts +6 -18
|
@@ -14,7 +14,7 @@ export declare class SuiContractFactory {
|
|
|
14
14
|
* @param secretKey, base64 or hex string, when mnemonics is provided, secretKey will be ignored
|
|
15
15
|
*/
|
|
16
16
|
constructor({ packageId, metadata }?: ContractFactoryParams);
|
|
17
|
-
getFuncByModuleName(
|
|
17
|
+
getFuncByModuleName(_moduleName: string): void;
|
|
18
18
|
getAllFunc(): void;
|
|
19
19
|
getAllModule(): void;
|
|
20
20
|
}
|
|
@@ -17,7 +17,7 @@ export declare class SuiInteractor {
|
|
|
17
17
|
constructor(fullNodeUrls: string[], network?: NetworkType);
|
|
18
18
|
switchToNextClient(): void;
|
|
19
19
|
sendTx(transactionBlock: Uint8Array | string, signature: string | string[]): Promise<SuiTransactionBlockResponse>;
|
|
20
|
-
waitForTransaction({ digest, timeout, pollInterval
|
|
20
|
+
waitForTransaction({ digest, timeout, pollInterval }: {
|
|
21
21
|
digest: string;
|
|
22
22
|
timeout?: number;
|
|
23
23
|
pollInterval?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transaction } from '@mysten/sui/transactions';
|
|
2
2
|
import type { SuiClient, SuiObjectRef } from '@mysten/sui/client';
|
|
3
|
-
import type { TransactionArgument,
|
|
3
|
+
import type { TransactionArgument, TransactionObjectInput } from '@mysten/sui/transactions';
|
|
4
4
|
import type { Keypair } from '@mysten/sui/cryptography';
|
|
5
5
|
import type { SuiTxArg, SuiAddressArg, SuiObjectArg, SuiVecTxArg, SuiAmountsArg } from '../../types';
|
|
6
6
|
import type { bcs } from '@mysten/sui/bcs';
|
|
@@ -314,7 +314,7 @@ export declare class SuiTx {
|
|
|
314
314
|
client?: SuiClient;
|
|
315
315
|
}): Promise<string>;
|
|
316
316
|
add(...args: Parameters<typeof this.tx.add>): import("@mysten/sui/transactions").TransactionResult;
|
|
317
|
-
publish({ modules, dependencies
|
|
317
|
+
publish({ modules, dependencies }: {
|
|
318
318
|
modules: number[][] | string[];
|
|
319
319
|
dependencies: string[];
|
|
320
320
|
}): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -335,7 +335,7 @@ export declare class SuiTx {
|
|
|
335
335
|
moveCall(target: string, args?: (SuiTxArg | SuiVecTxArg)[], typeArgs?: string[]): import("@mysten/sui/transactions").TransactionResult;
|
|
336
336
|
transferSuiToMany(recipients: SuiAddressArg[], amounts: (SuiTxArg | number | bigint)[]): this;
|
|
337
337
|
transferSui(address: SuiAddressArg, amount: SuiTxArg | number | bigint): this;
|
|
338
|
-
takeAmountFromCoins(coins: SuiObjectArg[], amount: SuiTxArg | number | bigint): TransactionObjectArgument[];
|
|
338
|
+
takeAmountFromCoins(coins: SuiObjectArg[], amount: SuiTxArg | number | bigint): import("@mysten/sui/transactions").TransactionObjectArgument[];
|
|
339
339
|
splitSUIFromGas(amounts: SuiAmountsArg[]): {
|
|
340
340
|
$kind: "Result";
|
|
341
341
|
Result: number;
|
|
@@ -351,7 +351,7 @@ export declare class SuiTx {
|
|
|
351
351
|
$kind: "NestedResult";
|
|
352
352
|
NestedResult: [number, number];
|
|
353
353
|
}[];
|
|
354
|
-
mergedCoin: TransactionObjectArgument;
|
|
354
|
+
mergedCoin: import("@mysten/sui/transactions").TransactionObjectArgument;
|
|
355
355
|
};
|
|
356
356
|
transferCoinToMany(coins: SuiObjectArg[], sender: SuiAddressArg, recipients: SuiAddressArg[], amounts: SuiAmountsArg[]): this;
|
|
357
357
|
transferCoin(coins: SuiObjectArg[], sender: SuiAddressArg, recipient: SuiAddressArg, amount: SuiAmountsArg): this;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export interface MessageMeta {
|
|
|
60
60
|
readonly meta: SuiMoveMoudleFuncType;
|
|
61
61
|
}
|
|
62
62
|
export interface ContractQuery extends MessageMeta {
|
|
63
|
-
({ tx, params, typeArguments, isRaw
|
|
63
|
+
({ tx, params, typeArguments, isRaw }: {
|
|
64
64
|
tx: Transaction;
|
|
65
65
|
params?: (TransactionArgument | SerializedBcs<any>)[];
|
|
66
66
|
typeArguments?: string[];
|
|
@@ -68,7 +68,7 @@ export interface ContractQuery extends MessageMeta {
|
|
|
68
68
|
}): Promise<DevInspectResults | TransactionResult>;
|
|
69
69
|
}
|
|
70
70
|
export interface ContractTx extends MessageMeta {
|
|
71
|
-
({ tx, params, typeArguments, isRaw, onSuccess, onError
|
|
71
|
+
({ tx, params, typeArguments, isRaw, onSuccess, onError }: {
|
|
72
72
|
tx: Transaction;
|
|
73
73
|
params?: (TransactionArgument | SerializedBcs<any>)[];
|
|
74
74
|
typeArguments?: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xobelisk/sui-client",
|
|
3
|
-
"version": "1.2.0-pre.
|
|
3
|
+
"version": "1.2.0-pre.72",
|
|
4
4
|
"description": "Tookit for interacting with move eps framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sui",
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"move",
|
|
9
9
|
"blockchain"
|
|
10
10
|
],
|
|
11
|
-
"author": "team@obelisk.build",
|
|
12
11
|
"homepage": "https://github.com/0xobelisk/dubhe/tree/main/packages/sui-client#readme",
|
|
13
12
|
"bugs": "https://github.com/0xobelisk/dubhe/issues",
|
|
14
13
|
"repository": {
|
|
@@ -16,15 +15,7 @@
|
|
|
16
15
|
"url": "https://github.com/0xobelisk/dubhe.git"
|
|
17
16
|
},
|
|
18
17
|
"license": "Apache-2.0",
|
|
19
|
-
"
|
|
20
|
-
"access": "public"
|
|
21
|
-
},
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=22.0.0"
|
|
24
|
-
},
|
|
25
|
-
"main": "./dist/index.js",
|
|
26
|
-
"module": "./dist/index.mjs",
|
|
27
|
-
"types": "./dist/index.d.ts",
|
|
18
|
+
"author": "team@obelisk.build",
|
|
28
19
|
"exports": {
|
|
29
20
|
".": {
|
|
30
21
|
"source": "./src/index.ts",
|
|
@@ -33,6 +24,9 @@
|
|
|
33
24
|
"types": "./dist/index.d.ts"
|
|
34
25
|
}
|
|
35
26
|
},
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"module": "./dist/index.mjs",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
36
30
|
"files": [
|
|
37
31
|
"dist",
|
|
38
32
|
"src"
|
|
@@ -68,7 +62,7 @@
|
|
|
68
62
|
"@typescript-eslint/eslint-plugin": "^6.8.0",
|
|
69
63
|
"@typescript-eslint/parser": "^6.8.0",
|
|
70
64
|
"dotenv": "^16.3.1",
|
|
71
|
-
"eslint": "^
|
|
65
|
+
"eslint": "^9.0.0",
|
|
72
66
|
"eslint-config-prettier": "^9.1.0",
|
|
73
67
|
"eslint-plugin-prettier": "^5.0.1",
|
|
74
68
|
"jest": "^29.7.0",
|
|
@@ -80,79 +74,29 @@
|
|
|
80
74
|
"typedoc": "^0.27.9",
|
|
81
75
|
"typescript": "^5.2.2"
|
|
82
76
|
},
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"pnpm run format:fix",
|
|
86
|
-
"pnpm run lint:fix"
|
|
87
|
-
],
|
|
88
|
-
"**/*.json|md": [
|
|
89
|
-
"pnpm run format:fix"
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
|
-
"commitlint": {
|
|
93
|
-
"extends": [
|
|
94
|
-
"@commitlint/config-conventional"
|
|
95
|
-
]
|
|
96
|
-
},
|
|
97
|
-
"prettier": {
|
|
98
|
-
"trailingComma": "es5",
|
|
99
|
-
"tabWidth": 2,
|
|
100
|
-
"semi": true,
|
|
101
|
-
"singleQuote": true,
|
|
102
|
-
"useTabs": false,
|
|
103
|
-
"quoteProps": "as-needed",
|
|
104
|
-
"bracketSpacing": true,
|
|
105
|
-
"arrowParens": "always",
|
|
106
|
-
"endOfLine": "lf"
|
|
77
|
+
"engines": {
|
|
78
|
+
"node": ">=22.0.0"
|
|
107
79
|
},
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"env": {
|
|
111
|
-
"browser": true,
|
|
112
|
-
"node": true,
|
|
113
|
-
"es2022": true
|
|
114
|
-
},
|
|
115
|
-
"extends": [
|
|
116
|
-
"eslint:recommended",
|
|
117
|
-
"plugin:@typescript-eslint/eslint-recommended",
|
|
118
|
-
"plugin:prettier/recommended"
|
|
119
|
-
],
|
|
120
|
-
"plugins": [
|
|
121
|
-
"@typescript-eslint",
|
|
122
|
-
"prettier"
|
|
123
|
-
],
|
|
124
|
-
"parser": "@typescript-eslint/parser",
|
|
125
|
-
"rules": {
|
|
126
|
-
"prettier/prettier": "warn",
|
|
127
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
128
|
-
"no-unused-vars": "off",
|
|
129
|
-
"@typescript-eslint/no-unused-vars": [
|
|
130
|
-
"error",
|
|
131
|
-
{
|
|
132
|
-
"argsIgnorePattern": "^_",
|
|
133
|
-
"varsIgnorePattern": "^_",
|
|
134
|
-
"caughtErrorsIgnorePattern": "^_"
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
}
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"access": "public"
|
|
138
82
|
},
|
|
139
83
|
"scripts": {
|
|
140
|
-
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
141
84
|
"build": "npm run build:types && npm run build:tsup",
|
|
142
85
|
"build:tsup": "tsup ./src/index.ts --format esm,cjs --sourcemap",
|
|
143
86
|
"build:types": "tsc --build",
|
|
144
|
-
"
|
|
145
|
-
"watch:types": "tsc --watch",
|
|
146
|
-
"watch": "pnpm run clean & pnpm run watch:types & pnpm run watch:tsup",
|
|
147
|
-
"test": "pnpm test:typecheck && pnpm test:unit",
|
|
148
|
-
"test:typecheck": "tsc -p ./test",
|
|
149
|
-
"format:fix": "prettier --ignore-path 'dist/* docs/*' --write '**/*.{ts,json,md}'",
|
|
150
|
-
"lint:fix": "eslint . --ignore-pattern dist --ext .ts --fix",
|
|
87
|
+
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
151
88
|
"commit": "commit",
|
|
152
89
|
"doc": "typedoc --out docs src/index.ts",
|
|
153
90
|
"format": "prettier --write .",
|
|
154
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",
|
|
155
96
|
"type-check": "tsc --noEmit",
|
|
156
|
-
"validate": "pnpm format:check && pnpm type-check"
|
|
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"
|
|
157
101
|
}
|
|
158
102
|
}
|