@mysten/sui 1.14.2 → 1.14.3

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @mysten/sui.js
2
2
 
3
+ ## 1.14.3
4
+
5
+ ### Patch Changes
6
+
7
+ - d5a23d7: Add tx.object.option for creatnig object options in transaction builder
8
+
3
9
  ## 1.14.2
4
10
 
5
11
  ### Patch Changes
@@ -979,6 +979,10 @@ export declare const Arguments: {
979
979
  Input: number;
980
980
  type?: "object";
981
981
  };
982
+ option({ type, value }: {
983
+ type: string;
984
+ value: TransactionObjectInput | null;
985
+ }): (tx: Transaction) => import("./Transaction.js").TransactionResult;
982
986
  };
983
987
  sharedObjectRef: (args_0: {
984
988
  objectId: string;
@@ -624,6 +624,10 @@ export declare class Transaction {
624
624
  Input: number;
625
625
  type?: "object";
626
626
  };
627
+ option({ type, value }: {
628
+ type: string;
629
+ value: TransactionObjectInput | null;
630
+ }): (tx: Transaction) => TransactionResult;
627
631
  };
628
632
  /**
629
633
  * Add a new object input to the transaction using the fully-resolved object reference.
@@ -1,8 +1,12 @@
1
- import type { TransactionObjectInput } from './Transaction.js';
1
+ import type { Transaction, TransactionObjectInput } from './Transaction.js';
2
2
  export declare function createObjectMethods<T>(makeObject: (value: TransactionObjectInput) => T): {
3
3
  (value: TransactionObjectInput): T;
4
4
  system(): T;
5
5
  clock(): T;
6
6
  random(): T;
7
7
  denyList(): T;
8
+ option({ type, value }: {
9
+ type: string;
10
+ value: TransactionObjectInput | null;
11
+ }): (tx: Transaction) => import("./Transaction.js").TransactionResult;
8
12
  };
@@ -29,6 +29,11 @@ function createObjectMethods(makeObject) {
29
29
  object.clock = () => object("0x6");
30
30
  object.random = () => object("0x8");
31
31
  object.denyList = () => object("0x403");
32
+ object.option = ({ type, value }) => (tx) => tx.moveCall({
33
+ typeArguments: [type],
34
+ target: `0x1::option::${value === null ? "none" : "some"}`,
35
+ arguments: value === null ? [] : [tx.object(value)]
36
+ });
32
37
  return object;
33
38
  }
34
39
  //# sourceMappingURL=object.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/transactions/object.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TransactionObjectInput } from './Transaction.js';\n\nexport function createObjectMethods<T>(makeObject: (value: TransactionObjectInput) => T) {\n\tfunction object(value: TransactionObjectInput) {\n\t\treturn makeObject(value);\n\t}\n\n\tobject.system = () => object('0x5');\n\tobject.clock = () => object('0x6');\n\tobject.random = () => object('0x8');\n\tobject.denyList = () => object('0x403');\n\n\treturn object;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,SAAS,oBAAuB,YAAkD;AACxF,WAAS,OAAO,OAA+B;AAC9C,WAAO,WAAW,KAAK;AAAA,EACxB;AAEA,SAAO,SAAS,MAAM,OAAO,KAAK;AAClC,SAAO,QAAQ,MAAM,OAAO,KAAK;AACjC,SAAO,SAAS,MAAM,OAAO,KAAK;AAClC,SAAO,WAAW,MAAM,OAAO,OAAO;AAEtC,SAAO;AACR;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Transaction, TransactionObjectInput } from './Transaction.js';\n\nexport function createObjectMethods<T>(makeObject: (value: TransactionObjectInput) => T) {\n\tfunction object(value: TransactionObjectInput) {\n\t\treturn makeObject(value);\n\t}\n\n\tobject.system = () => object('0x5');\n\tobject.clock = () => object('0x6');\n\tobject.random = () => object('0x8');\n\tobject.denyList = () => object('0x403');\n\tobject.option =\n\t\t({ type, value }: { type: string; value: TransactionObjectInput | null }) =>\n\t\t(tx: Transaction) =>\n\t\t\ttx.moveCall({\n\t\t\t\ttypeArguments: [type],\n\t\t\t\ttarget: `0x1::option::${value === null ? 'none' : 'some'}`,\n\t\t\t\targuments: value === null ? [] : [tx.object(value)],\n\t\t\t});\n\n\treturn object;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,SAAS,oBAAuB,YAAkD;AACxF,WAAS,OAAO,OAA+B;AAC9C,WAAO,WAAW,KAAK;AAAA,EACxB;AAEA,SAAO,SAAS,MAAM,OAAO,KAAK;AAClC,SAAO,QAAQ,MAAM,OAAO,KAAK;AACjC,SAAO,SAAS,MAAM,OAAO,KAAK;AAClC,SAAO,WAAW,MAAM,OAAO,OAAO;AACtC,SAAO,SACN,CAAC,EAAE,MAAM,MAAM,MACf,CAAC,OACA,GAAG,SAAS;AAAA,IACX,eAAe,CAAC,IAAI;AAAA,IACpB,QAAQ,gBAAgB,UAAU,OAAO,SAAS,MAAM;AAAA,IACxD,WAAW,UAAU,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,KAAK,CAAC;AAAA,EACnD,CAAC;AAEH,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- export declare const PACKAGE_VERSION = "1.14.2";
1
+ export declare const PACKAGE_VERSION = "1.14.3";
2
2
  export declare const TARGETED_RPC_VERSION = "1.38.0";
@@ -22,6 +22,6 @@ __export(version_exports, {
22
22
  TARGETED_RPC_VERSION: () => TARGETED_RPC_VERSION
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- const PACKAGE_VERSION = "1.14.2";
25
+ const PACKAGE_VERSION = "1.14.3";
26
26
  const TARGETED_RPC_VERSION = "1.38.0";
27
27
  //# sourceMappingURL=version.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/version.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '1.14.2';\nexport const TARGETED_RPC_VERSION = '1.38.0';\n"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '1.14.3';\nexport const TARGETED_RPC_VERSION = '1.38.0';\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,kBAAkB;AACxB,MAAM,uBAAuB;",
6
6
  "names": []
7
7
  }
@@ -979,6 +979,10 @@ export declare const Arguments: {
979
979
  Input: number;
980
980
  type?: "object";
981
981
  };
982
+ option({ type, value }: {
983
+ type: string;
984
+ value: TransactionObjectInput | null;
985
+ }): (tx: Transaction) => import("./Transaction.js").TransactionResult;
982
986
  };
983
987
  sharedObjectRef: (args_0: {
984
988
  objectId: string;
@@ -624,6 +624,10 @@ export declare class Transaction {
624
624
  Input: number;
625
625
  type?: "object";
626
626
  };
627
+ option({ type, value }: {
628
+ type: string;
629
+ value: TransactionObjectInput | null;
630
+ }): (tx: Transaction) => TransactionResult;
627
631
  };
628
632
  /**
629
633
  * Add a new object input to the transaction using the fully-resolved object reference.
@@ -1,8 +1,12 @@
1
- import type { TransactionObjectInput } from './Transaction.js';
1
+ import type { Transaction, TransactionObjectInput } from './Transaction.js';
2
2
  export declare function createObjectMethods<T>(makeObject: (value: TransactionObjectInput) => T): {
3
3
  (value: TransactionObjectInput): T;
4
4
  system(): T;
5
5
  clock(): T;
6
6
  random(): T;
7
7
  denyList(): T;
8
+ option({ type, value }: {
9
+ type: string;
10
+ value: TransactionObjectInput | null;
11
+ }): (tx: Transaction) => import("./Transaction.js").TransactionResult;
8
12
  };
@@ -6,6 +6,11 @@ function createObjectMethods(makeObject) {
6
6
  object.clock = () => object("0x6");
7
7
  object.random = () => object("0x8");
8
8
  object.denyList = () => object("0x403");
9
+ object.option = ({ type, value }) => (tx) => tx.moveCall({
10
+ typeArguments: [type],
11
+ target: `0x1::option::${value === null ? "none" : "some"}`,
12
+ arguments: value === null ? [] : [tx.object(value)]
13
+ });
9
14
  return object;
10
15
  }
11
16
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/transactions/object.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TransactionObjectInput } from './Transaction.js';\n\nexport function createObjectMethods<T>(makeObject: (value: TransactionObjectInput) => T) {\n\tfunction object(value: TransactionObjectInput) {\n\t\treturn makeObject(value);\n\t}\n\n\tobject.system = () => object('0x5');\n\tobject.clock = () => object('0x6');\n\tobject.random = () => object('0x8');\n\tobject.denyList = () => object('0x403');\n\n\treturn object;\n}\n"],
5
- "mappings": "AAKO,SAAS,oBAAuB,YAAkD;AACxF,WAAS,OAAO,OAA+B;AAC9C,WAAO,WAAW,KAAK;AAAA,EACxB;AAEA,SAAO,SAAS,MAAM,OAAO,KAAK;AAClC,SAAO,QAAQ,MAAM,OAAO,KAAK;AACjC,SAAO,SAAS,MAAM,OAAO,KAAK;AAClC,SAAO,WAAW,MAAM,OAAO,OAAO;AAEtC,SAAO;AACR;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Transaction, TransactionObjectInput } from './Transaction.js';\n\nexport function createObjectMethods<T>(makeObject: (value: TransactionObjectInput) => T) {\n\tfunction object(value: TransactionObjectInput) {\n\t\treturn makeObject(value);\n\t}\n\n\tobject.system = () => object('0x5');\n\tobject.clock = () => object('0x6');\n\tobject.random = () => object('0x8');\n\tobject.denyList = () => object('0x403');\n\tobject.option =\n\t\t({ type, value }: { type: string; value: TransactionObjectInput | null }) =>\n\t\t(tx: Transaction) =>\n\t\t\ttx.moveCall({\n\t\t\t\ttypeArguments: [type],\n\t\t\t\ttarget: `0x1::option::${value === null ? 'none' : 'some'}`,\n\t\t\t\targuments: value === null ? [] : [tx.object(value)],\n\t\t\t});\n\n\treturn object;\n}\n"],
5
+ "mappings": "AAKO,SAAS,oBAAuB,YAAkD;AACxF,WAAS,OAAO,OAA+B;AAC9C,WAAO,WAAW,KAAK;AAAA,EACxB;AAEA,SAAO,SAAS,MAAM,OAAO,KAAK;AAClC,SAAO,QAAQ,MAAM,OAAO,KAAK;AACjC,SAAO,SAAS,MAAM,OAAO,KAAK;AAClC,SAAO,WAAW,MAAM,OAAO,OAAO;AACtC,SAAO,SACN,CAAC,EAAE,MAAM,MAAM,MACf,CAAC,OACA,GAAG,SAAS;AAAA,IACX,eAAe,CAAC,IAAI;AAAA,IACpB,QAAQ,gBAAgB,UAAU,OAAO,SAAS,MAAM;AAAA,IACxD,WAAW,UAAU,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,KAAK,CAAC;AAAA,EACnD,CAAC;AAEH,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- export declare const PACKAGE_VERSION = "1.14.2";
1
+ export declare const PACKAGE_VERSION = "1.14.3";
2
2
  export declare const TARGETED_RPC_VERSION = "1.38.0";
@@ -1,4 +1,4 @@
1
- const PACKAGE_VERSION = "1.14.2";
1
+ const PACKAGE_VERSION = "1.14.3";
2
2
  const TARGETED_RPC_VERSION = "1.38.0";
3
3
  export {
4
4
  PACKAGE_VERSION,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/version.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '1.14.2';\nexport const TARGETED_RPC_VERSION = '1.38.0';\n"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '1.14.3';\nexport const TARGETED_RPC_VERSION = '1.38.0';\n"],
5
5
  "mappings": "AAKO,MAAM,kBAAkB;AACxB,MAAM,uBAAuB;",
6
6
  "names": []
7
7
  }