@mysten/sui 1.37.3 → 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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Mysten Labs <build@mystenlabs.com>",
4
4
  "description": "Sui TypeScript API",
5
5
  "homepage": "https://sdk.mystenlabs.com",
6
- "version": "1.37.3",
6
+ "version": "1.37.5",
7
7
  "license": "Apache-2.0",
8
8
  "sideEffects": false,
9
9
  "files": [
@@ -752,43 +752,45 @@ export class Transaction {
752
752
  }
753
753
 
754
754
  async #runPlugins(plugins: TransactionPlugin[], options: SerializeTransactionOptions) {
755
- const createNext = (i: number) => {
756
- if (i >= plugins.length) {
757
- return () => {};
758
- }
759
- const plugin = plugins[i];
755
+ try {
756
+ const createNext = (i: number) => {
757
+ if (i >= plugins.length) {
758
+ return () => {};
759
+ }
760
+ const plugin = plugins[i];
760
761
 
761
- return async () => {
762
- const next = createNext(i + 1);
763
- let calledNext = false;
764
- let nextResolved = false;
762
+ return async () => {
763
+ const next = createNext(i + 1);
764
+ let calledNext = false;
765
+ let nextResolved = false;
765
766
 
766
- await plugin(this.#data, options, async () => {
767
- if (calledNext) {
768
- throw new Error(`next() was call multiple times in TransactionPlugin ${i}`);
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
- calledNext = true;
772
+ calledNext = true;
772
773
 
773
- await next();
774
+ await next();
774
775
 
775
- nextResolved = true;
776
- });
776
+ nextResolved = true;
777
+ });
777
778
 
778
- if (!calledNext) {
779
- throw new Error(`next() was not called in TransactionPlugin ${i}`);
780
- }
779
+ if (!calledNext) {
780
+ throw new Error(`next() was not called in TransactionPlugin ${i}`);
781
+ }
781
782
 
782
- if (!nextResolved) {
783
- throw new Error(`next() was not awaited in TransactionPlugin ${i}`);
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
- this.#inputSection = this.#data.inputs.slice();
791
- this.#commandSection = this.#data.commands.slice();
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() {
@@ -242,6 +242,7 @@ export class ParallelTransactionExecutor {
242
242
  BigInt(gasUsed.storageCost) +
243
243
  BigInt(gasUsed.storageCost) -
244
244
  BigInt(gasUsed.storageRebate);
245
+ const remainingBalance = gasCoin.balance - totalUsed;
245
246
 
246
247
  let usesGasCoin = false;
247
248
  new TransactionDataBuilder(transaction.getData()).mapArguments((arg) => {
@@ -252,12 +253,12 @@ export class ParallelTransactionExecutor {
252
253
  return arg;
253
254
  });
254
255
 
255
- if (!usesGasCoin && gasCoin.balance >= this.#minimumCoinBalance) {
256
+ if (!usesGasCoin && remainingBalance >= this.#minimumCoinBalance) {
256
257
  this.#coinPool.push({
257
258
  id: gasResult.ref.objectId,
258
259
  version: gasResult.ref.version,
259
260
  digest: gasResult.ref.digest,
260
- balance: gasCoin.balance - totalUsed,
261
+ balance: remainingBalance,
261
262
  });
262
263
  } else {
263
264
  if (!this.#sourceCoins) {
package/src/version.ts CHANGED
@@ -3,5 +3,5 @@
3
3
 
4
4
  // This file is generated by genversion.mjs. Do not edit it directly.
5
5
 
6
- export const PACKAGE_VERSION = '1.37.3';
7
- export const TARGETED_RPC_VERSION = '1.55.0';
6
+ export const PACKAGE_VERSION = '1.37.5';
7
+ export const TARGETED_RPC_VERSION = '1.56.0';