@mysten/sui 1.30.2 → 1.30.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.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/experimental/transports/jsonRPC.js +4 -2
- package/dist/cjs/experimental/transports/jsonRPC.js.map +2 -2
- package/dist/cjs/transactions/Transaction.js +22 -3
- package/dist/cjs/transactions/Transaction.js.map +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/experimental/transports/jsonRPC.js +4 -2
- package/dist/esm/experimental/transports/jsonRPC.js.map +2 -2
- package/dist/esm/transactions/Transaction.js +22 -3
- package/dist/esm/transactions/Transaction.js.map +2 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/src/experimental/transports/jsonRPC.ts +2 -0
- package/src/transactions/Transaction.ts +28 -4
- package/src/version.ts +1 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
4
4
|
"description": "Sui TypeScript API(Work in Progress)",
|
|
5
5
|
"homepage": "https://sdk.mystenlabs.com",
|
|
6
|
-
"version": "1.30.
|
|
6
|
+
"version": "1.30.4",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"files": [
|
|
@@ -113,42 +113,42 @@
|
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@0no-co/graphqlsp": "^1.12.11",
|
|
115
115
|
"@graphql-codegen/add": "^5.0.3",
|
|
116
|
-
"@graphql-codegen/cli": "^5.0.
|
|
116
|
+
"@graphql-codegen/cli": "^5.0.6",
|
|
117
117
|
"@graphql-codegen/typed-document-node": "^5.1.1",
|
|
118
118
|
"@graphql-codegen/typescript": "4.1.6",
|
|
119
119
|
"@graphql-codegen/typescript-document-nodes": "4.0.16",
|
|
120
|
-
"@graphql-codegen/typescript-operations": "^4.6.
|
|
120
|
+
"@graphql-codegen/typescript-operations": "^4.6.1",
|
|
121
121
|
"@iarna/toml": "^2.2.5",
|
|
122
122
|
"@parcel/watcher": "^2.5.1",
|
|
123
|
-
"@types/node": "^22.
|
|
123
|
+
"@types/node": "^22.15.29",
|
|
124
124
|
"@types/tmp": "^0.2.6",
|
|
125
125
|
"@types/ws": "^8.18.1",
|
|
126
126
|
"cross-env": "^7.0.3",
|
|
127
|
-
"graphql-config": "^5.
|
|
128
|
-
"msw": "^2.
|
|
127
|
+
"graphql-config": "^5.1.5",
|
|
128
|
+
"msw": "^2.9.0",
|
|
129
129
|
"tmp": "^0.2.3",
|
|
130
130
|
"ts-retry-promise": "^0.8.1",
|
|
131
|
-
"typescript": "^5.8.
|
|
132
|
-
"vite": "^6.
|
|
131
|
+
"typescript": "^5.8.3",
|
|
132
|
+
"vite": "^6.3.5",
|
|
133
133
|
"vite-tsconfig-paths": "^5.1.4",
|
|
134
|
-
"vitest": "^3.
|
|
134
|
+
"vitest": "^3.2.1",
|
|
135
135
|
"wait-on": "^8.0.3",
|
|
136
|
-
"ws": "^8.18.
|
|
136
|
+
"ws": "^8.18.2",
|
|
137
137
|
"@mysten/build-scripts": "^0.0.0"
|
|
138
138
|
},
|
|
139
139
|
"dependencies": {
|
|
140
140
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
141
|
-
"@noble/curves": "^1.
|
|
142
|
-
"@noble/hashes": "^1.
|
|
143
|
-
"@scure/base": "^1.2.
|
|
144
|
-
"@scure/bip32": "^1.
|
|
145
|
-
"@scure/bip39": "^1.
|
|
141
|
+
"@noble/curves": "^1.9.1",
|
|
142
|
+
"@noble/hashes": "^1.8.0",
|
|
143
|
+
"@scure/base": "^1.2.6",
|
|
144
|
+
"@scure/bip32": "^1.7.0",
|
|
145
|
+
"@scure/bip39": "^1.6.0",
|
|
146
146
|
"gql.tada": "^1.8.2",
|
|
147
|
-
"graphql": "^16.
|
|
147
|
+
"graphql": "^16.11.0",
|
|
148
148
|
"poseidon-lite": "^0.2.0",
|
|
149
149
|
"valibot": "^0.36.0",
|
|
150
|
-
"@mysten/bcs": "1.6.
|
|
151
|
-
"@mysten/utils": "0.0.
|
|
150
|
+
"@mysten/bcs": "1.6.2",
|
|
151
|
+
"@mysten/utils": "0.0.1"
|
|
152
152
|
},
|
|
153
153
|
"scripts": {
|
|
154
154
|
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
@@ -154,6 +154,7 @@ export class JSONRpcTransport extends Experimental_CoreClient {
|
|
|
154
154
|
showObjectChanges: true,
|
|
155
155
|
showRawEffects: true,
|
|
156
156
|
showEvents: true,
|
|
157
|
+
showEffects: true,
|
|
157
158
|
},
|
|
158
159
|
signal: options.signal,
|
|
159
160
|
});
|
|
@@ -171,6 +172,7 @@ export class JSONRpcTransport extends Experimental_CoreClient {
|
|
|
171
172
|
showEvents: true,
|
|
172
173
|
showObjectChanges: true,
|
|
173
174
|
showRawInput: true,
|
|
175
|
+
showEffects: true,
|
|
174
176
|
},
|
|
175
177
|
signal: options.signal,
|
|
176
178
|
});
|
|
@@ -43,8 +43,16 @@ export type AsyncTransactionThunk<
|
|
|
43
43
|
T extends TransactionResultArgument | void = TransactionResultArgument | void,
|
|
44
44
|
> = (tx: Transaction) => Promise<T | void>;
|
|
45
45
|
|
|
46
|
-
function createTransactionResult(
|
|
47
|
-
|
|
46
|
+
function createTransactionResult(
|
|
47
|
+
index: number | (() => number),
|
|
48
|
+
length = Infinity,
|
|
49
|
+
): TransactionResult {
|
|
50
|
+
const baseResult = {
|
|
51
|
+
$kind: 'Result' as const,
|
|
52
|
+
get Result() {
|
|
53
|
+
return typeof index === 'function' ? index() : index;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
48
56
|
|
|
49
57
|
const nestedResults: {
|
|
50
58
|
$kind: 'NestedResult';
|
|
@@ -58,7 +66,9 @@ function createTransactionResult(index: number, length = Infinity): TransactionR
|
|
|
58
66
|
} =>
|
|
59
67
|
(nestedResults[resultIndex] ??= {
|
|
60
68
|
$kind: 'NestedResult' as const,
|
|
61
|
-
NestedResult
|
|
69
|
+
get NestedResult() {
|
|
70
|
+
return [typeof index === 'function' ? index() : index, resultIndex] as [number, number];
|
|
71
|
+
},
|
|
62
72
|
});
|
|
63
73
|
|
|
64
74
|
return new Proxy(baseResult, {
|
|
@@ -166,6 +176,7 @@ export class Transaction {
|
|
|
166
176
|
|
|
167
177
|
tx.#inputSection = tx.#data.inputs.slice();
|
|
168
178
|
tx.#commandSection = tx.#data.commands.slice();
|
|
179
|
+
tx.#availableResults = new Set(tx.#commandSection.map((_, i) => i));
|
|
169
180
|
|
|
170
181
|
return tx;
|
|
171
182
|
}
|
|
@@ -191,6 +202,7 @@ export class Transaction {
|
|
|
191
202
|
|
|
192
203
|
newTransaction.#inputSection = newTransaction.#data.inputs.slice();
|
|
193
204
|
newTransaction.#commandSection = newTransaction.#data.commands.slice();
|
|
205
|
+
newTransaction.#availableResults = new Set(newTransaction.#commandSection.map((_, i) => i));
|
|
194
206
|
|
|
195
207
|
return newTransaction;
|
|
196
208
|
}
|
|
@@ -452,6 +464,7 @@ export class Transaction {
|
|
|
452
464
|
name: 'AsyncTransactionThunk',
|
|
453
465
|
inputs: {},
|
|
454
466
|
data: {
|
|
467
|
+
resultIndex: this.#data.commands.length,
|
|
455
468
|
result: null as TransactionResult | null,
|
|
456
469
|
},
|
|
457
470
|
},
|
|
@@ -462,7 +475,7 @@ export class Transaction {
|
|
|
462
475
|
placeholder.$Intent.data.result = result;
|
|
463
476
|
}),
|
|
464
477
|
);
|
|
465
|
-
const txResult = createTransactionResult(
|
|
478
|
+
const txResult = createTransactionResult(() => placeholder.$Intent.data.resultIndex);
|
|
466
479
|
this.#added.set(command, txResult);
|
|
467
480
|
return txResult;
|
|
468
481
|
} else {
|
|
@@ -769,6 +782,7 @@ export class Transaction {
|
|
|
769
782
|
this.#data.inputs = orderedInputs;
|
|
770
783
|
this.#commandSection = filteredCommands;
|
|
771
784
|
this.#inputSection = orderedInputs;
|
|
785
|
+
this.#availableResults = new Set(filteredCommands.map((_, i) => i));
|
|
772
786
|
|
|
773
787
|
function getOriginalIndex(index: number): number {
|
|
774
788
|
const command = unorderedCommands[index];
|
|
@@ -812,6 +826,16 @@ export class Transaction {
|
|
|
812
826
|
|
|
813
827
|
return arg;
|
|
814
828
|
});
|
|
829
|
+
|
|
830
|
+
for (const [i, cmd] of unorderedCommands.entries()) {
|
|
831
|
+
if (cmd.$Intent?.name === 'AsyncTransactionThunk') {
|
|
832
|
+
try {
|
|
833
|
+
cmd.$Intent.data.resultIndex = getOriginalIndex(i);
|
|
834
|
+
} catch (e) {
|
|
835
|
+
// If async thunk did not return a result, this will error, but is safe to ignore
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
815
839
|
}
|
|
816
840
|
|
|
817
841
|
async prepareForSerialization(options: SerializeTransactionOptions) {
|
package/src/version.ts
CHANGED