@mysten/sui 1.37.2 → 1.37.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/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.2",
6
+ "version": "1.37.4",
7
7
  "license": "Apache-2.0",
8
8
  "sideEffects": false,
9
9
  "files": [
@@ -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) {
@@ -2,16 +2,71 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import type { Transaction, TransactionObjectInput } from './Transaction.js';
5
+ import { Inputs } from './Inputs.js';
5
6
 
6
7
  export function createObjectMethods<T>(makeObject: (value: TransactionObjectInput) => T) {
7
8
  function object(value: TransactionObjectInput) {
8
9
  return makeObject(value);
9
10
  }
10
11
 
11
- object.system = () => object('0x5');
12
- object.clock = () => object('0x6');
13
- object.random = () => object('0x8');
14
- object.denyList = () => object('0x403');
12
+ object.system = (options?: { mutable?: boolean }) => {
13
+ const mutable = options?.mutable;
14
+
15
+ if (mutable !== undefined) {
16
+ return object(
17
+ Inputs.SharedObjectRef({
18
+ objectId: '0x5',
19
+ initialSharedVersion: 1,
20
+ mutable,
21
+ }),
22
+ );
23
+ }
24
+
25
+ return object({
26
+ $kind: 'UnresolvedObject',
27
+ UnresolvedObject: {
28
+ objectId: '0x5',
29
+ initialSharedVersion: 1,
30
+ },
31
+ });
32
+ };
33
+ object.clock = () =>
34
+ object(
35
+ Inputs.SharedObjectRef({
36
+ objectId: '0x6',
37
+ initialSharedVersion: 1,
38
+ mutable: false,
39
+ }),
40
+ );
41
+ object.random = () =>
42
+ object(
43
+ Inputs.SharedObjectRef({
44
+ objectId: '0x8',
45
+ initialSharedVersion: 1,
46
+ mutable: false,
47
+ }),
48
+ );
49
+ object.denyList = (options?: { mutable?: boolean }) => {
50
+ const mutable = options?.mutable;
51
+
52
+ if (mutable !== undefined) {
53
+ return object(
54
+ Inputs.SharedObjectRef({
55
+ objectId: '0x403',
56
+ initialSharedVersion: 1,
57
+ mutable,
58
+ }),
59
+ );
60
+ }
61
+
62
+ return object({
63
+ $kind: 'UnresolvedObject',
64
+ UnresolvedObject: {
65
+ objectId: '0x403',
66
+ initialSharedVersion: 1,
67
+ },
68
+ });
69
+ };
15
70
  object.option =
16
71
  ({ type, value }: { type: string; value: TransactionObjectInput | null }) =>
17
72
  (tx: Transaction) =>
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.2';
6
+ export const PACKAGE_VERSION = '1.37.4';
7
7
  export const TARGETED_RPC_VERSION = '1.55.0';