@mysten/sui 1.36.1 → 1.36.2
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 -6
- package/dist/cjs/bcs/pure.d.ts +2 -2
- package/dist/cjs/bcs/pure.js.map +2 -2
- package/dist/cjs/transactions/pure.d.ts +3 -3
- package/dist/cjs/transactions/pure.js.map +1 -1
- 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/bcs/pure.d.ts +2 -2
- package/dist/esm/bcs/pure.js.map +2 -2
- package/dist/esm/transactions/pure.d.ts +3 -3
- package/dist/esm/transactions/pure.js.map +1 -1
- 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 +11 -11
- package/src/bcs/pure.ts +4 -3
- package/src/transactions/pure.ts +5 -5
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @mysten/sui.js
|
|
2
2
|
|
|
3
|
+
## 1.36.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 44354ab: Fix tx.pure return type when used with a typename
|
|
8
|
+
|
|
3
9
|
## 1.36.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -390,7 +396,6 @@
|
|
|
390
396
|
|
|
391
397
|
All existing methods will continue to work, but the following methods have been deprecated and
|
|
392
398
|
replaced with methods with improved names:
|
|
393
|
-
|
|
394
399
|
- `toHEX` -> `toHEX`
|
|
395
400
|
- `fromHEX` -> `fromHex`
|
|
396
401
|
- `toB64` -> `toBase64`
|
|
@@ -429,7 +434,6 @@
|
|
|
429
434
|
### Minor Changes
|
|
430
435
|
|
|
431
436
|
- 143cd9d: Add new tx.object methods for defining inputs for well known object ids:
|
|
432
|
-
|
|
433
437
|
- `tx.object.system()`: `0x5`
|
|
434
438
|
- `tx.object.clock()`: `0x6`
|
|
435
439
|
- `tx.object.random()`: `0x8`
|
|
@@ -789,7 +793,6 @@
|
|
|
789
793
|
|
|
790
794
|
- 781d073d9: Update getFaucetRequestStatus to GET request
|
|
791
795
|
- e4484852b: Improve APIs for building transaction inputs
|
|
792
|
-
|
|
793
796
|
- txb.splitCoins now accepts `amounts`` as raw JavaScript number
|
|
794
797
|
- txb.transferObjects now accepts `address` as JavaScript string
|
|
795
798
|
- All single objects, or lists of objects, now also accepts object IDs as JavaScript strings
|
|
@@ -805,7 +808,6 @@
|
|
|
805
808
|
- 3764c464f: - add support for basic parsing of zkLogin signatures
|
|
806
809
|
- new zklogin package
|
|
807
810
|
- 71e0a3197: zklogin improvements
|
|
808
|
-
|
|
809
811
|
- use new bcs api
|
|
810
812
|
- rename `toBufferBE` to `toBigEndianBytes`
|
|
811
813
|
- stop exporting `ZkLoginSignatureInputs` and `extractClaimValue`
|
|
@@ -873,7 +875,6 @@
|
|
|
873
875
|
- 6d41059c7: Deprecate imports from the root path which can be imported from a modular export
|
|
874
876
|
- cc6441f46: The Sui TS SDK has been broken up into a set of modular exports, and all exports from
|
|
875
877
|
the root of the package have been deprecated. The following export paths have been added:
|
|
876
|
-
|
|
877
878
|
- `@mysten/sui.js/client` - A client for interacting with Sui RPC nodes.
|
|
878
879
|
- `@mysten/sui.js/bcs` - A BCS builder with pre-defined types for Sui.
|
|
879
880
|
- `@mysten/sui.js/transaction` - Utilities for building and interacting with transactions.
|
|
@@ -885,7 +886,6 @@
|
|
|
885
886
|
- `@mysten/sui.js/faucet`- Methods for requesting sui from a faucet.
|
|
886
887
|
|
|
887
888
|
As part of this refactor we are deprecating a number of existing APIs:
|
|
888
|
-
|
|
889
889
|
- `JsonRPCProvider` - This Provider pattern is being replaced by a new `SuiClient`
|
|
890
890
|
- `SignerWithProver` and `RawSigner` - The Concept of Signers is being removed from the SDK.
|
|
891
891
|
Signing in verifying has been moved to the KeyPair classes, and the
|
package/dist/cjs/bcs/pure.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ interface PureShapeByType {
|
|
|
15
15
|
export type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`;
|
|
16
16
|
export type ValidPureTypeName<T extends string> = T extends BasePureType ? PureTypeName : T extends `vector<${infer U}>` ? ValidPureTypeName<U> : T extends `option<${infer U}>` ? ValidPureTypeName<U> : PureTypeValidationError<T>;
|
|
17
17
|
export type ShapeFromPureTypeName<T extends PureTypeName> = T extends BasePureType ? PureShapeByType[T] : T extends `vector<${infer U extends PureTypeName}>` ? ShapeFromPureTypeName<U>[] : T extends `option<${infer U extends PureTypeName}>` ? ShapeFromPureTypeName<U> | null : never;
|
|
18
|
-
type PureTypeValidationError<T extends string> =
|
|
18
|
+
type PureTypeValidationError<T extends string> = {
|
|
19
19
|
error: `Invalid Pure type name: ${T}`;
|
|
20
|
-
};
|
|
20
|
+
} & {};
|
|
21
21
|
export declare function pureBcsSchemaFromTypeName<T extends PureTypeName>(name: T extends PureTypeName ? ValidPureTypeName<T> : T): BcsType<ShapeFromPureTypeName<T>>;
|
|
22
22
|
export {};
|
package/dist/cjs/bcs/pure.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bcs/pure.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bcs } from '@mysten/bcs';\nimport type { BcsType } from '@mysten/bcs';\n\nimport { Address } from './bcs.js';\n\nexport type BasePureType =\n\t| 'u8'\n\t| 'u16'\n\t| 'u32'\n\t| 'u64'\n\t| 'u128'\n\t| 'u256'\n\t| 'bool'\n\t| 'id'\n\t| 'string'\n\t| 'address';\n\ninterface PureShapeByType {\n\tu8: number;\n\tu16: number;\n\tu32: number;\n\tu64: bigint | string | number;\n\tu128: bigint | string | number;\n\tu256: bigint | string | number;\n\tbool: boolean;\n\tstring: string;\n\tid: string | Uint8Array;\n\taddress: string | Uint8Array;\n}\n\nexport type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`;\nexport type ValidPureTypeName<T extends string> = T extends BasePureType\n\t? PureTypeName\n\t: T extends `vector<${infer U}>`\n\t\t? ValidPureTypeName<U>\n\t\t: T extends `option<${infer U}>`\n\t\t\t? ValidPureTypeName<U>\n\t\t\t: PureTypeValidationError<T>;\n\nexport type ShapeFromPureTypeName<T extends PureTypeName> = T extends BasePureType\n\t? PureShapeByType[T]\n\t: T extends `vector<${infer U extends PureTypeName}>`\n\t\t? ShapeFromPureTypeName<U>[]\n\t\t: T extends `option<${infer U extends PureTypeName}>`\n\t\t\t? ShapeFromPureTypeName<U> | null\n\t\t\t: never;\n\ntype PureTypeValidationError<T extends string> =
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAoB;AAGpB,IAAAA,cAAwB;
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bcs } from '@mysten/bcs';\nimport type { BcsType } from '@mysten/bcs';\n\nimport { Address } from './bcs.js';\n\nexport type BasePureType =\n\t| 'u8'\n\t| 'u16'\n\t| 'u32'\n\t| 'u64'\n\t| 'u128'\n\t| 'u256'\n\t| 'bool'\n\t| 'id'\n\t| 'string'\n\t| 'address';\n\ninterface PureShapeByType {\n\tu8: number;\n\tu16: number;\n\tu32: number;\n\tu64: bigint | string | number;\n\tu128: bigint | string | number;\n\tu256: bigint | string | number;\n\tbool: boolean;\n\tstring: string;\n\tid: string | Uint8Array;\n\taddress: string | Uint8Array;\n}\n\nexport type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`;\nexport type ValidPureTypeName<T extends string> = T extends BasePureType\n\t? PureTypeName\n\t: T extends `vector<${infer U}>`\n\t\t? ValidPureTypeName<U>\n\t\t: T extends `option<${infer U}>`\n\t\t\t? ValidPureTypeName<U>\n\t\t\t: PureTypeValidationError<T>;\n\nexport type ShapeFromPureTypeName<T extends PureTypeName> = T extends BasePureType\n\t? PureShapeByType[T]\n\t: T extends `vector<${infer U extends PureTypeName}>`\n\t\t? ShapeFromPureTypeName<U>[]\n\t\t: T extends `option<${infer U extends PureTypeName}>`\n\t\t\t? ShapeFromPureTypeName<U> | null\n\t\t\t: never;\n\ntype PureTypeValidationError<T extends string> = {\n\terror: `Invalid Pure type name: ${T}`;\n\t// eslint-disable-next-line @typescript-eslint/ban-types\n} & {};\n\nexport function pureBcsSchemaFromTypeName<T extends PureTypeName>(\n\tname: T extends PureTypeName ? ValidPureTypeName<T> : T,\n): BcsType<ShapeFromPureTypeName<T>> {\n\tswitch (name) {\n\t\tcase 'u8':\n\t\t\treturn bcs.u8() as never;\n\t\tcase 'u16':\n\t\t\treturn bcs.u16() as never;\n\t\tcase 'u32':\n\t\t\treturn bcs.u32() as never;\n\t\tcase 'u64':\n\t\t\treturn bcs.u64() as never;\n\t\tcase 'u128':\n\t\t\treturn bcs.u128() as never;\n\t\tcase 'u256':\n\t\t\treturn bcs.u256() as never;\n\t\tcase 'bool':\n\t\t\treturn bcs.bool() as never;\n\t\tcase 'string':\n\t\t\treturn bcs.string() as never;\n\t\tcase 'id':\n\t\tcase 'address':\n\t\t\treturn Address as never;\n\t}\n\n\tconst generic = (name as string).match(/^(vector|option)<(.+)>$/);\n\tif (generic) {\n\t\tconst [kind, inner] = generic.slice(1);\n\t\tif (kind === 'vector') {\n\t\t\treturn bcs.vector(pureBcsSchemaFromTypeName(inner as PureTypeName)) as never;\n\t\t} else {\n\t\t\treturn bcs.option(pureBcsSchemaFromTypeName(inner as PureTypeName)) as never;\n\t\t}\n\t}\n\n\tthrow new Error(`Invalid Pure type name: ${name}`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAoB;AAGpB,IAAAA,cAAwB;AAiDjB,SAAS,0BACf,MACoC;AACpC,UAAQ,MAAM;AAAA,IACb,KAAK;AACJ,aAAO,eAAI,GAAG;AAAA,IACf,KAAK;AACJ,aAAO,eAAI,IAAI;AAAA,IAChB,KAAK;AACJ,aAAO,eAAI,IAAI;AAAA,IAChB,KAAK;AACJ,aAAO,eAAI,IAAI;AAAA,IAChB,KAAK;AACJ,aAAO,eAAI,KAAK;AAAA,IACjB,KAAK;AACJ,aAAO,eAAI,KAAK;AAAA,IACjB,KAAK;AACJ,aAAO,eAAI,KAAK;AAAA,IACjB,KAAK;AACJ,aAAO,eAAI,OAAO;AAAA,IACnB,KAAK;AAAA,IACL,KAAK;AACJ,aAAO;AAAA,EACT;AAEA,QAAM,UAAW,KAAgB,MAAM,yBAAyB;AAChE,MAAI,SAAS;AACZ,UAAM,CAAC,MAAM,KAAK,IAAI,QAAQ,MAAM,CAAC;AACrC,QAAI,SAAS,UAAU;AACtB,aAAO,eAAI,OAAO,0BAA0B,KAAqB,CAAC;AAAA,IACnE,OAAO;AACN,aAAO,eAAI,OAAO,0BAA0B,KAAqB,CAAC;AAAA,IACnE;AAAA,EACD;AAEA,QAAM,IAAI,MAAM,2BAA2B,IAAI,EAAE;AAClD;",
|
|
6
6
|
"names": ["import_bcs"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SerializedBcs } from '@mysten/bcs';
|
|
2
2
|
import type { PureTypeName, ShapeFromPureTypeName, ValidPureTypeName } from '../bcs/pure.js';
|
|
3
3
|
export declare function createPure<T>(makePure: (value: SerializedBcs<any, any> | Uint8Array) => T): {
|
|
4
|
-
<
|
|
4
|
+
<Type extends PureTypeName>(type: Type extends PureTypeName ? ValidPureTypeName<Type> : Type, value: ShapeFromPureTypeName<Type>): T;
|
|
5
5
|
(value: SerializedBcs<any, any> | Uint8Array): T;
|
|
6
6
|
u8(value: number): T;
|
|
7
7
|
u16(value: number): T;
|
|
@@ -13,8 +13,8 @@ export declare function createPure<T>(makePure: (value: SerializedBcs<any, any>
|
|
|
13
13
|
string(value: string): T;
|
|
14
14
|
address(value: string): T;
|
|
15
15
|
id: (value: string) => T;
|
|
16
|
-
vector<Type extends PureTypeName>(type:
|
|
16
|
+
vector<Type extends PureTypeName>(type: Type extends PureTypeName ? ValidPureTypeName<Type> : Type, value: Iterable<ShapeFromPureTypeName<Type>> & {
|
|
17
17
|
length: number;
|
|
18
18
|
}): T;
|
|
19
|
-
option<Type extends PureTypeName>(type:
|
|
19
|
+
option<Type extends PureTypeName>(type: Type extends PureTypeName ? ValidPureTypeName<Type> : Type, value: ShapeFromPureTypeName<Type> | null | undefined): T;
|
|
20
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/transactions/pure.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { isSerializedBcs } from '@mysten/bcs';\nimport type { SerializedBcs } from '@mysten/bcs';\n\nimport { bcs } from '../bcs/index.js';\nimport { pureBcsSchemaFromTypeName } from '../bcs/pure.js';\nimport type { PureTypeName, ShapeFromPureTypeName, ValidPureTypeName } from '../bcs/pure.js';\n\nexport function createPure<T>(makePure: (value: SerializedBcs<any, any> | Uint8Array) => T) {\n\tfunction pure<
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { isSerializedBcs } from '@mysten/bcs';\nimport type { SerializedBcs } from '@mysten/bcs';\n\nimport { bcs } from '../bcs/index.js';\nimport { pureBcsSchemaFromTypeName } from '../bcs/pure.js';\nimport type { PureTypeName, ShapeFromPureTypeName, ValidPureTypeName } from '../bcs/pure.js';\n\nexport function createPure<T>(makePure: (value: SerializedBcs<any, any> | Uint8Array) => T) {\n\tfunction pure<Type extends PureTypeName>(\n\t\ttype: Type extends PureTypeName ? ValidPureTypeName<Type> : Type,\n\t\tvalue: ShapeFromPureTypeName<Type>,\n\t): T;\n\n\tfunction pure(\n\t\t/**\n\t\t * The pure value, serialized to BCS. If this is a Uint8Array, then the value\n\t\t * is assumed to be raw bytes, and will be used directly.\n\t\t */\n\t\tvalue: SerializedBcs<any, any> | Uint8Array,\n\t): T;\n\n\tfunction pure(\n\t\ttypeOrSerializedValue?: PureTypeName | SerializedBcs<any, any> | Uint8Array,\n\t\tvalue?: unknown,\n\t): T {\n\t\tif (typeof typeOrSerializedValue === 'string') {\n\t\t\treturn makePure(pureBcsSchemaFromTypeName(typeOrSerializedValue).serialize(value as never));\n\t\t}\n\n\t\tif (typeOrSerializedValue instanceof Uint8Array || isSerializedBcs(typeOrSerializedValue)) {\n\t\t\treturn makePure(typeOrSerializedValue);\n\t\t}\n\n\t\tthrow new Error('tx.pure must be called either a bcs type name, or a serialized bcs value');\n\t}\n\n\tpure.u8 = (value: number) => makePure(bcs.U8.serialize(value));\n\tpure.u16 = (value: number) => makePure(bcs.U16.serialize(value));\n\tpure.u32 = (value: number) => makePure(bcs.U32.serialize(value));\n\tpure.u64 = (value: bigint | number | string) => makePure(bcs.U64.serialize(value));\n\tpure.u128 = (value: bigint | number | string) => makePure(bcs.U128.serialize(value));\n\tpure.u256 = (value: bigint | number | string) => makePure(bcs.U256.serialize(value));\n\tpure.bool = (value: boolean) => makePure(bcs.Bool.serialize(value));\n\tpure.string = (value: string) => makePure(bcs.String.serialize(value));\n\tpure.address = (value: string) => makePure(bcs.Address.serialize(value));\n\tpure.id = pure.address;\n\tpure.vector = <Type extends PureTypeName>(\n\t\ttype: Type extends PureTypeName ? ValidPureTypeName<Type> : Type,\n\t\tvalue: Iterable<ShapeFromPureTypeName<Type>> & { length: number },\n\t) => {\n\t\treturn makePure(\n\t\t\tbcs.vector(pureBcsSchemaFromTypeName(type as PureTypeName)).serialize(value as never),\n\t\t);\n\t};\n\tpure.option = <Type extends PureTypeName>(\n\t\ttype: Type extends PureTypeName ? ValidPureTypeName<Type> : Type,\n\t\tvalue: ShapeFromPureTypeName<Type> | null | undefined,\n\t) => {\n\t\treturn makePure(bcs.option(pureBcsSchemaFromTypeName(type)).serialize(value as never));\n\t};\n\n\treturn pure;\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAgC;AAGhC,IAAAA,cAAoB;AACpB,kBAA0C;AAGnC,SAAS,WAAc,UAA8D;AAc3F,WAAS,KACR,uBACA,OACI;AACJ,QAAI,OAAO,0BAA0B,UAAU;AAC9C,aAAO,aAAS,uCAA0B,qBAAqB,EAAE,UAAU,KAAc,CAAC;AAAA,IAC3F;AAEA,QAAI,iCAAiC,kBAAc,4BAAgB,qBAAqB,GAAG;AAC1F,aAAO,SAAS,qBAAqB;AAAA,IACtC;AAEA,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC3F;AAEA,OAAK,KAAK,CAAC,UAAkB,SAAS,gBAAI,GAAG,UAAU,KAAK,CAAC;AAC7D,OAAK,MAAM,CAAC,UAAkB,SAAS,gBAAI,IAAI,UAAU,KAAK,CAAC;AAC/D,OAAK,MAAM,CAAC,UAAkB,SAAS,gBAAI,IAAI,UAAU,KAAK,CAAC;AAC/D,OAAK,MAAM,CAAC,UAAoC,SAAS,gBAAI,IAAI,UAAU,KAAK,CAAC;AACjF,OAAK,OAAO,CAAC,UAAoC,SAAS,gBAAI,KAAK,UAAU,KAAK,CAAC;AACnF,OAAK,OAAO,CAAC,UAAoC,SAAS,gBAAI,KAAK,UAAU,KAAK,CAAC;AACnF,OAAK,OAAO,CAAC,UAAmB,SAAS,gBAAI,KAAK,UAAU,KAAK,CAAC;AAClE,OAAK,SAAS,CAAC,UAAkB,SAAS,gBAAI,OAAO,UAAU,KAAK,CAAC;AACrE,OAAK,UAAU,CAAC,UAAkB,SAAS,gBAAI,QAAQ,UAAU,KAAK,CAAC;AACvE,OAAK,KAAK,KAAK;AACf,OAAK,SAAS,CACb,MACA,UACI;AACJ,WAAO;AAAA,MACN,gBAAI,WAAO,uCAA0B,IAAoB,CAAC,EAAE,UAAU,KAAc;AAAA,IACrF;AAAA,EACD;AACA,OAAK,SAAS,CACb,MACA,UACI;AACJ,WAAO,SAAS,gBAAI,WAAO,uCAA0B,IAAI,CAAC,EAAE,UAAU,KAAc,CAAC;AAAA,EACtF;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": ["import_bcs"]
|
|
7
7
|
}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "1.36.
|
|
1
|
+
export declare const PACKAGE_VERSION = "1.36.2";
|
|
2
2
|
export declare const TARGETED_RPC_VERSION = "1.53.0";
|
package/dist/cjs/version.js
CHANGED
|
@@ -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.36.
|
|
25
|
+
const PACKAGE_VERSION = "1.36.2";
|
|
26
26
|
const TARGETED_RPC_VERSION = "1.53.0";
|
|
27
27
|
//# sourceMappingURL=version.js.map
|
package/dist/cjs/version.js.map
CHANGED
|
@@ -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.36.
|
|
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.36.2';\nexport const TARGETED_RPC_VERSION = '1.53.0';\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,kBAAkB;AACxB,MAAM,uBAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/bcs/pure.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ interface PureShapeByType {
|
|
|
15
15
|
export type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`;
|
|
16
16
|
export type ValidPureTypeName<T extends string> = T extends BasePureType ? PureTypeName : T extends `vector<${infer U}>` ? ValidPureTypeName<U> : T extends `option<${infer U}>` ? ValidPureTypeName<U> : PureTypeValidationError<T>;
|
|
17
17
|
export type ShapeFromPureTypeName<T extends PureTypeName> = T extends BasePureType ? PureShapeByType[T] : T extends `vector<${infer U extends PureTypeName}>` ? ShapeFromPureTypeName<U>[] : T extends `option<${infer U extends PureTypeName}>` ? ShapeFromPureTypeName<U> | null : never;
|
|
18
|
-
type PureTypeValidationError<T extends string> =
|
|
18
|
+
type PureTypeValidationError<T extends string> = {
|
|
19
19
|
error: `Invalid Pure type name: ${T}`;
|
|
20
|
-
};
|
|
20
|
+
} & {};
|
|
21
21
|
export declare function pureBcsSchemaFromTypeName<T extends PureTypeName>(name: T extends PureTypeName ? ValidPureTypeName<T> : T): BcsType<ShapeFromPureTypeName<T>>;
|
|
22
22
|
export {};
|
package/dist/esm/bcs/pure.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bcs/pure.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bcs } from '@mysten/bcs';\nimport type { BcsType } from '@mysten/bcs';\n\nimport { Address } from './bcs.js';\n\nexport type BasePureType =\n\t| 'u8'\n\t| 'u16'\n\t| 'u32'\n\t| 'u64'\n\t| 'u128'\n\t| 'u256'\n\t| 'bool'\n\t| 'id'\n\t| 'string'\n\t| 'address';\n\ninterface PureShapeByType {\n\tu8: number;\n\tu16: number;\n\tu32: number;\n\tu64: bigint | string | number;\n\tu128: bigint | string | number;\n\tu256: bigint | string | number;\n\tbool: boolean;\n\tstring: string;\n\tid: string | Uint8Array;\n\taddress: string | Uint8Array;\n}\n\nexport type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`;\nexport type ValidPureTypeName<T extends string> = T extends BasePureType\n\t? PureTypeName\n\t: T extends `vector<${infer U}>`\n\t\t? ValidPureTypeName<U>\n\t\t: T extends `option<${infer U}>`\n\t\t\t? ValidPureTypeName<U>\n\t\t\t: PureTypeValidationError<T>;\n\nexport type ShapeFromPureTypeName<T extends PureTypeName> = T extends BasePureType\n\t? PureShapeByType[T]\n\t: T extends `vector<${infer U extends PureTypeName}>`\n\t\t? ShapeFromPureTypeName<U>[]\n\t\t: T extends `option<${infer U extends PureTypeName}>`\n\t\t\t? ShapeFromPureTypeName<U> | null\n\t\t\t: never;\n\ntype PureTypeValidationError<T extends string> =
|
|
5
|
-
"mappings": "AAGA,SAAS,WAAW;AAGpB,SAAS,eAAe;
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bcs } from '@mysten/bcs';\nimport type { BcsType } from '@mysten/bcs';\n\nimport { Address } from './bcs.js';\n\nexport type BasePureType =\n\t| 'u8'\n\t| 'u16'\n\t| 'u32'\n\t| 'u64'\n\t| 'u128'\n\t| 'u256'\n\t| 'bool'\n\t| 'id'\n\t| 'string'\n\t| 'address';\n\ninterface PureShapeByType {\n\tu8: number;\n\tu16: number;\n\tu32: number;\n\tu64: bigint | string | number;\n\tu128: bigint | string | number;\n\tu256: bigint | string | number;\n\tbool: boolean;\n\tstring: string;\n\tid: string | Uint8Array;\n\taddress: string | Uint8Array;\n}\n\nexport type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`;\nexport type ValidPureTypeName<T extends string> = T extends BasePureType\n\t? PureTypeName\n\t: T extends `vector<${infer U}>`\n\t\t? ValidPureTypeName<U>\n\t\t: T extends `option<${infer U}>`\n\t\t\t? ValidPureTypeName<U>\n\t\t\t: PureTypeValidationError<T>;\n\nexport type ShapeFromPureTypeName<T extends PureTypeName> = T extends BasePureType\n\t? PureShapeByType[T]\n\t: T extends `vector<${infer U extends PureTypeName}>`\n\t\t? ShapeFromPureTypeName<U>[]\n\t\t: T extends `option<${infer U extends PureTypeName}>`\n\t\t\t? ShapeFromPureTypeName<U> | null\n\t\t\t: never;\n\ntype PureTypeValidationError<T extends string> = {\n\terror: `Invalid Pure type name: ${T}`;\n\t// eslint-disable-next-line @typescript-eslint/ban-types\n} & {};\n\nexport function pureBcsSchemaFromTypeName<T extends PureTypeName>(\n\tname: T extends PureTypeName ? ValidPureTypeName<T> : T,\n): BcsType<ShapeFromPureTypeName<T>> {\n\tswitch (name) {\n\t\tcase 'u8':\n\t\t\treturn bcs.u8() as never;\n\t\tcase 'u16':\n\t\t\treturn bcs.u16() as never;\n\t\tcase 'u32':\n\t\t\treturn bcs.u32() as never;\n\t\tcase 'u64':\n\t\t\treturn bcs.u64() as never;\n\t\tcase 'u128':\n\t\t\treturn bcs.u128() as never;\n\t\tcase 'u256':\n\t\t\treturn bcs.u256() as never;\n\t\tcase 'bool':\n\t\t\treturn bcs.bool() as never;\n\t\tcase 'string':\n\t\t\treturn bcs.string() as never;\n\t\tcase 'id':\n\t\tcase 'address':\n\t\t\treturn Address as never;\n\t}\n\n\tconst generic = (name as string).match(/^(vector|option)<(.+)>$/);\n\tif (generic) {\n\t\tconst [kind, inner] = generic.slice(1);\n\t\tif (kind === 'vector') {\n\t\t\treturn bcs.vector(pureBcsSchemaFromTypeName(inner as PureTypeName)) as never;\n\t\t} else {\n\t\t\treturn bcs.option(pureBcsSchemaFromTypeName(inner as PureTypeName)) as never;\n\t\t}\n\t}\n\n\tthrow new Error(`Invalid Pure type name: ${name}`);\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,WAAW;AAGpB,SAAS,eAAe;AAiDjB,SAAS,0BACf,MACoC;AACpC,UAAQ,MAAM;AAAA,IACb,KAAK;AACJ,aAAO,IAAI,GAAG;AAAA,IACf,KAAK;AACJ,aAAO,IAAI,IAAI;AAAA,IAChB,KAAK;AACJ,aAAO,IAAI,IAAI;AAAA,IAChB,KAAK;AACJ,aAAO,IAAI,IAAI;AAAA,IAChB,KAAK;AACJ,aAAO,IAAI,KAAK;AAAA,IACjB,KAAK;AACJ,aAAO,IAAI,KAAK;AAAA,IACjB,KAAK;AACJ,aAAO,IAAI,KAAK;AAAA,IACjB,KAAK;AACJ,aAAO,IAAI,OAAO;AAAA,IACnB,KAAK;AAAA,IACL,KAAK;AACJ,aAAO;AAAA,EACT;AAEA,QAAM,UAAW,KAAgB,MAAM,yBAAyB;AAChE,MAAI,SAAS;AACZ,UAAM,CAAC,MAAM,KAAK,IAAI,QAAQ,MAAM,CAAC;AACrC,QAAI,SAAS,UAAU;AACtB,aAAO,IAAI,OAAO,0BAA0B,KAAqB,CAAC;AAAA,IACnE,OAAO;AACN,aAAO,IAAI,OAAO,0BAA0B,KAAqB,CAAC;AAAA,IACnE;AAAA,EACD;AAEA,QAAM,IAAI,MAAM,2BAA2B,IAAI,EAAE;AAClD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SerializedBcs } from '@mysten/bcs';
|
|
2
2
|
import type { PureTypeName, ShapeFromPureTypeName, ValidPureTypeName } from '../bcs/pure.js';
|
|
3
3
|
export declare function createPure<T>(makePure: (value: SerializedBcs<any, any> | Uint8Array) => T): {
|
|
4
|
-
<
|
|
4
|
+
<Type extends PureTypeName>(type: Type extends PureTypeName ? ValidPureTypeName<Type> : Type, value: ShapeFromPureTypeName<Type>): T;
|
|
5
5
|
(value: SerializedBcs<any, any> | Uint8Array): T;
|
|
6
6
|
u8(value: number): T;
|
|
7
7
|
u16(value: number): T;
|
|
@@ -13,8 +13,8 @@ export declare function createPure<T>(makePure: (value: SerializedBcs<any, any>
|
|
|
13
13
|
string(value: string): T;
|
|
14
14
|
address(value: string): T;
|
|
15
15
|
id: (value: string) => T;
|
|
16
|
-
vector<Type extends PureTypeName>(type:
|
|
16
|
+
vector<Type extends PureTypeName>(type: Type extends PureTypeName ? ValidPureTypeName<Type> : Type, value: Iterable<ShapeFromPureTypeName<Type>> & {
|
|
17
17
|
length: number;
|
|
18
18
|
}): T;
|
|
19
|
-
option<Type extends PureTypeName>(type:
|
|
19
|
+
option<Type extends PureTypeName>(type: Type extends PureTypeName ? ValidPureTypeName<Type> : Type, value: ShapeFromPureTypeName<Type> | null | undefined): T;
|
|
20
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/transactions/pure.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { isSerializedBcs } from '@mysten/bcs';\nimport type { SerializedBcs } from '@mysten/bcs';\n\nimport { bcs } from '../bcs/index.js';\nimport { pureBcsSchemaFromTypeName } from '../bcs/pure.js';\nimport type { PureTypeName, ShapeFromPureTypeName, ValidPureTypeName } from '../bcs/pure.js';\n\nexport function createPure<T>(makePure: (value: SerializedBcs<any, any> | Uint8Array) => T) {\n\tfunction pure<
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { isSerializedBcs } from '@mysten/bcs';\nimport type { SerializedBcs } from '@mysten/bcs';\n\nimport { bcs } from '../bcs/index.js';\nimport { pureBcsSchemaFromTypeName } from '../bcs/pure.js';\nimport type { PureTypeName, ShapeFromPureTypeName, ValidPureTypeName } from '../bcs/pure.js';\n\nexport function createPure<T>(makePure: (value: SerializedBcs<any, any> | Uint8Array) => T) {\n\tfunction pure<Type extends PureTypeName>(\n\t\ttype: Type extends PureTypeName ? ValidPureTypeName<Type> : Type,\n\t\tvalue: ShapeFromPureTypeName<Type>,\n\t): T;\n\n\tfunction pure(\n\t\t/**\n\t\t * The pure value, serialized to BCS. If this is a Uint8Array, then the value\n\t\t * is assumed to be raw bytes, and will be used directly.\n\t\t */\n\t\tvalue: SerializedBcs<any, any> | Uint8Array,\n\t): T;\n\n\tfunction pure(\n\t\ttypeOrSerializedValue?: PureTypeName | SerializedBcs<any, any> | Uint8Array,\n\t\tvalue?: unknown,\n\t): T {\n\t\tif (typeof typeOrSerializedValue === 'string') {\n\t\t\treturn makePure(pureBcsSchemaFromTypeName(typeOrSerializedValue).serialize(value as never));\n\t\t}\n\n\t\tif (typeOrSerializedValue instanceof Uint8Array || isSerializedBcs(typeOrSerializedValue)) {\n\t\t\treturn makePure(typeOrSerializedValue);\n\t\t}\n\n\t\tthrow new Error('tx.pure must be called either a bcs type name, or a serialized bcs value');\n\t}\n\n\tpure.u8 = (value: number) => makePure(bcs.U8.serialize(value));\n\tpure.u16 = (value: number) => makePure(bcs.U16.serialize(value));\n\tpure.u32 = (value: number) => makePure(bcs.U32.serialize(value));\n\tpure.u64 = (value: bigint | number | string) => makePure(bcs.U64.serialize(value));\n\tpure.u128 = (value: bigint | number | string) => makePure(bcs.U128.serialize(value));\n\tpure.u256 = (value: bigint | number | string) => makePure(bcs.U256.serialize(value));\n\tpure.bool = (value: boolean) => makePure(bcs.Bool.serialize(value));\n\tpure.string = (value: string) => makePure(bcs.String.serialize(value));\n\tpure.address = (value: string) => makePure(bcs.Address.serialize(value));\n\tpure.id = pure.address;\n\tpure.vector = <Type extends PureTypeName>(\n\t\ttype: Type extends PureTypeName ? ValidPureTypeName<Type> : Type,\n\t\tvalue: Iterable<ShapeFromPureTypeName<Type>> & { length: number },\n\t) => {\n\t\treturn makePure(\n\t\t\tbcs.vector(pureBcsSchemaFromTypeName(type as PureTypeName)).serialize(value as never),\n\t\t);\n\t};\n\tpure.option = <Type extends PureTypeName>(\n\t\ttype: Type extends PureTypeName ? ValidPureTypeName<Type> : Type,\n\t\tvalue: ShapeFromPureTypeName<Type> | null | undefined,\n\t) => {\n\t\treturn makePure(bcs.option(pureBcsSchemaFromTypeName(type)).serialize(value as never));\n\t};\n\n\treturn pure;\n}\n"],
|
|
5
5
|
"mappings": "AAGA,SAAS,uBAAuB;AAGhC,SAAS,WAAW;AACpB,SAAS,iCAAiC;AAGnC,SAAS,WAAc,UAA8D;AAc3F,WAAS,KACR,uBACA,OACI;AACJ,QAAI,OAAO,0BAA0B,UAAU;AAC9C,aAAO,SAAS,0BAA0B,qBAAqB,EAAE,UAAU,KAAc,CAAC;AAAA,IAC3F;AAEA,QAAI,iCAAiC,cAAc,gBAAgB,qBAAqB,GAAG;AAC1F,aAAO,SAAS,qBAAqB;AAAA,IACtC;AAEA,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC3F;AAEA,OAAK,KAAK,CAAC,UAAkB,SAAS,IAAI,GAAG,UAAU,KAAK,CAAC;AAC7D,OAAK,MAAM,CAAC,UAAkB,SAAS,IAAI,IAAI,UAAU,KAAK,CAAC;AAC/D,OAAK,MAAM,CAAC,UAAkB,SAAS,IAAI,IAAI,UAAU,KAAK,CAAC;AAC/D,OAAK,MAAM,CAAC,UAAoC,SAAS,IAAI,IAAI,UAAU,KAAK,CAAC;AACjF,OAAK,OAAO,CAAC,UAAoC,SAAS,IAAI,KAAK,UAAU,KAAK,CAAC;AACnF,OAAK,OAAO,CAAC,UAAoC,SAAS,IAAI,KAAK,UAAU,KAAK,CAAC;AACnF,OAAK,OAAO,CAAC,UAAmB,SAAS,IAAI,KAAK,UAAU,KAAK,CAAC;AAClE,OAAK,SAAS,CAAC,UAAkB,SAAS,IAAI,OAAO,UAAU,KAAK,CAAC;AACrE,OAAK,UAAU,CAAC,UAAkB,SAAS,IAAI,QAAQ,UAAU,KAAK,CAAC;AACvE,OAAK,KAAK,KAAK;AACf,OAAK,SAAS,CACb,MACA,UACI;AACJ,WAAO;AAAA,MACN,IAAI,OAAO,0BAA0B,IAAoB,CAAC,EAAE,UAAU,KAAc;AAAA,IACrF;AAAA,EACD;AACA,OAAK,SAAS,CACb,MACA,UACI;AACJ,WAAO,SAAS,IAAI,OAAO,0BAA0B,IAAI,CAAC,EAAE,UAAU,KAAc,CAAC;AAAA,EACtF;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "1.36.
|
|
1
|
+
export declare const PACKAGE_VERSION = "1.36.2";
|
|
2
2
|
export declare const TARGETED_RPC_VERSION = "1.53.0";
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -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.36.
|
|
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.36.2';\nexport const TARGETED_RPC_VERSION = '1.53.0';\n"],
|
|
5
5
|
"mappings": "AAKO,MAAM,kBAAkB;AACxB,MAAM,uBAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|