@mysten/sui 1.37.4 → 1.37.5
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 +6 -0
- package/dist/cjs/transactions/Transaction.js +30 -27
- package/dist/cjs/transactions/Transaction.js.map +2 -2
- package/dist/cjs/version.d.ts +2 -2
- package/dist/cjs/version.js +2 -2
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/transactions/Transaction.js +30 -27
- package/dist/esm/transactions/Transaction.js.map +2 -2
- package/dist/esm/version.d.ts +2 -2
- package/dist/esm/version.js +2 -2
- 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/transactions/Transaction.ts +30 -28
- package/src/version.ts +2 -2
package/package.json
CHANGED
|
@@ -752,43 +752,45 @@ export class Transaction {
|
|
|
752
752
|
}
|
|
753
753
|
|
|
754
754
|
async #runPlugins(plugins: TransactionPlugin[], options: SerializeTransactionOptions) {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
755
|
+
try {
|
|
756
|
+
const createNext = (i: number) => {
|
|
757
|
+
if (i >= plugins.length) {
|
|
758
|
+
return () => {};
|
|
759
|
+
}
|
|
760
|
+
const plugin = plugins[i];
|
|
760
761
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
762
|
+
return async () => {
|
|
763
|
+
const next = createNext(i + 1);
|
|
764
|
+
let calledNext = false;
|
|
765
|
+
let nextResolved = false;
|
|
765
766
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
767
|
+
await plugin(this.#data, options, async () => {
|
|
768
|
+
if (calledNext) {
|
|
769
|
+
throw new Error(`next() was call multiple times in TransactionPlugin ${i}`);
|
|
770
|
+
}
|
|
770
771
|
|
|
771
|
-
|
|
772
|
+
calledNext = true;
|
|
772
773
|
|
|
773
|
-
|
|
774
|
+
await next();
|
|
774
775
|
|
|
775
|
-
|
|
776
|
-
|
|
776
|
+
nextResolved = true;
|
|
777
|
+
});
|
|
777
778
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
779
|
+
if (!calledNext) {
|
|
780
|
+
throw new Error(`next() was not called in TransactionPlugin ${i}`);
|
|
781
|
+
}
|
|
781
782
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
783
|
+
if (!nextResolved) {
|
|
784
|
+
throw new Error(`next() was not awaited in TransactionPlugin ${i}`);
|
|
785
|
+
}
|
|
786
|
+
};
|
|
785
787
|
};
|
|
786
|
-
};
|
|
787
|
-
|
|
788
|
-
await createNext(0)();
|
|
789
788
|
|
|
790
|
-
|
|
791
|
-
|
|
789
|
+
await createNext(0)();
|
|
790
|
+
} finally {
|
|
791
|
+
this.#inputSection = this.#data.inputs.slice();
|
|
792
|
+
this.#commandSection = this.#data.commands.slice();
|
|
793
|
+
}
|
|
792
794
|
}
|
|
793
795
|
|
|
794
796
|
async #waitForPendingTasks() {
|
package/src/version.ts
CHANGED