@mysten/sui 1.30.3 → 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 +7 -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 +19 -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 +19 -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 +1 -1
- package/src/experimental/transports/jsonRPC.ts +2 -0
- package/src/transactions/Transaction.ts +25 -4
- package/src/version.ts +1 -1
package/package.json
CHANGED
|
@@ -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, {
|
|
@@ -454,6 +464,7 @@ export class Transaction {
|
|
|
454
464
|
name: 'AsyncTransactionThunk',
|
|
455
465
|
inputs: {},
|
|
456
466
|
data: {
|
|
467
|
+
resultIndex: this.#data.commands.length,
|
|
457
468
|
result: null as TransactionResult | null,
|
|
458
469
|
},
|
|
459
470
|
},
|
|
@@ -464,7 +475,7 @@ export class Transaction {
|
|
|
464
475
|
placeholder.$Intent.data.result = result;
|
|
465
476
|
}),
|
|
466
477
|
);
|
|
467
|
-
const txResult = createTransactionResult(
|
|
478
|
+
const txResult = createTransactionResult(() => placeholder.$Intent.data.resultIndex);
|
|
468
479
|
this.#added.set(command, txResult);
|
|
469
480
|
return txResult;
|
|
470
481
|
} else {
|
|
@@ -815,6 +826,16 @@ export class Transaction {
|
|
|
815
826
|
|
|
816
827
|
return arg;
|
|
817
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
|
+
}
|
|
818
839
|
}
|
|
819
840
|
|
|
820
841
|
async prepareForSerialization(options: SerializeTransactionOptions) {
|
package/src/version.ts
CHANGED