Socket
Socket
Sign inDemoInstall

@mysten/sui

Package Overview
Dependencies
Maintainers
7
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mysten/sui - npm Package Compare versions

Comparing version 0.0.0-experimental-20240529195942 to 0.0.0-experimental-20240529213642

8

CHANGELOG.md
# @mysten/sui.js
## 0.0.0-experimental-20240529195942
## 0.0.0-experimental-20240529213642
### Patch Changes
- 1f20580841: Fix parsing of object refs from v1 json
## 1.0.2
### Patch Changes
- f0a839f874: Fix serialization bug when converting object inputs to v1 JSON

@@ -8,0 +14,0 @@

2

dist/cjs/transactions/data/internal.js

@@ -173,3 +173,3 @@ "use strict";

initialSharedVersion: JsonU64,
mutable: (0, import_valibot.nullable)((0, import_valibot.boolean)())
mutable: (0, import_valibot.boolean)()
}),

@@ -176,0 +176,0 @@ Receiving: ObjectRef

import type { BaseSchema, Output } from 'valibot';
import type { StructTag as StructTagType, TypeTag as TypeTagType } from '../../bcs/types.js';
import { TransactionData } from './internal.js';
export declare const ObjectRef: import("valibot").ObjectSchema<{
digest: import("valibot").StringSchema<string>;
objectId: import("valibot").StringSchema<string>;
version: import("valibot").UnionSchema<(import("valibot").StringSchema<string> | import("valibot").NumberSchema<number> | import("valibot").BigintSchema<bigint>)[], string | number | bigint>;
}, undefined, {
objectId: string;
version: string | number | bigint;
digest: string;
}>;
export declare const NormalizedCallArg: {

@@ -8,18 +17,18 @@ async: false;

Object: import("@mysten/bcs").EnumOutputShapeWithKeys<{
ImmOrOwnedObject: {
ImmOrOwned: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
SharedObject: {
Shared: {
objectId: string;
initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};
Receiving: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
}, "Receiving" | "Shared" | "ImmOrOwned">;
Pure: number[];

@@ -30,15 +39,15 @@ }, "Pure" | "Object">>;

Object: import("@mysten/bcs").EnumInputShape<{
ImmOrOwnedObject: {
ImmOrOwned: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
SharedObject: {
Shared: {
objectId: string;
initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};
Receiving: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;

@@ -51,18 +60,18 @@ };

Object: import("@mysten/bcs").EnumOutputShapeWithKeys<{
ImmOrOwnedObject: {
ImmOrOwned: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
SharedObject: {
Shared: {
objectId: string;
initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};
Receiving: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
}, "Receiving" | "Shared" | "ImmOrOwned">;
Pure: number[];

@@ -72,11 +81,2 @@ }, "Pure" | "Object">;

};
export declare const ObjectRef: import("valibot").ObjectSchema<{
digest: import("valibot").StringSchema<string>;
objectId: import("valibot").StringSchema<string>;
version: import("valibot").UnionSchema<(import("valibot").StringSchema<string> | import("valibot").NumberSchema<number> | import("valibot").BigintSchema<bigint>)[], string | number | bigint>;
}, undefined, {
objectId: string;
version: string | number | bigint;
digest: string;
}>;
export declare const TypeTag: BaseSchema<TypeTagType>;

@@ -83,0 +83,0 @@ export declare const StructTag: BaseSchema<StructTagType>;

@@ -35,6 +35,2 @@ "use strict";

var import_internal = require("./internal.js");
const NormalizedCallArg = (0, import_internal.safeEnum)({
Object: import_internal.ObjectArg,
Pure: (0, import_valibot.array)((0, import_valibot.number)([(0, import_valibot.integer)()]))
});
const ObjectRef = (0, import_valibot.object)({

@@ -45,2 +41,15 @@ digest: (0, import_valibot.string)(),

});
const ObjectArg = (0, import_internal.safeEnum)({
ImmOrOwned: ObjectRef,
Shared: (0, import_valibot.object)({
objectId: import_internal.ObjectID,
initialSharedVersion: import_internal.JsonU64,
mutable: (0, import_valibot.boolean)()
}),
Receiving: ObjectRef
});
const NormalizedCallArg = (0, import_internal.safeEnum)({
Object: ObjectArg,
Pure: (0, import_valibot.array)((0, import_valibot.number)([(0, import_valibot.integer)()]))
});
const TransactionInput = (0, import_valibot.union)([

@@ -181,3 +190,3 @@ (0, import_valibot.object)({

Object: input.Object.ImmOrOwnedObject ? {
ImmOrOwnedObject: input.Object.ImmOrOwnedObject
ImmOrOwned: input.Object.ImmOrOwnedObject
} : input.Object.Receiving ? {

@@ -190,3 +199,3 @@ Receiving: {

} : {
SharedObject: {
Shared: {
mutable: input.Object.SharedObject.mutable,

@@ -338,5 +347,36 @@ initialSharedVersion: input.Object.SharedObject.initialSharedVersion,

if (value.Object) {
return {
Object: value.Object
};
if (value.Object.ImmOrOwned) {
return {
Object: {
ImmOrOwnedObject: {
objectId: value.Object.ImmOrOwned.objectId,
version: String(value.Object.ImmOrOwned.version),
digest: value.Object.ImmOrOwned.digest
}
}
};
}
if (value.Object.Shared) {
return {
Object: {
SharedObject: {
mutable: value.Object.Shared.mutable ?? null,
initialSharedVersion: value.Object.Shared.initialSharedVersion,
objectId: value.Object.Shared.objectId
}
}
};
}
if (value.Object.Receiving) {
return {
Object: {
Receiving: {
digest: value.Object.Receiving.digest,
version: String(value.Object.Receiving.version),
objectId: value.Object.Receiving.objectId
}
}
};
}
throw new Error("Invalid object input");
}

@@ -343,0 +383,0 @@ return {

@@ -54,3 +54,3 @@ import type { EnumInputShape } from '@mysten/bcs';

initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};

@@ -85,3 +85,3 @@ Receiving: {

initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};

@@ -316,3 +316,3 @@ Receiving: {

initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};

@@ -319,0 +319,0 @@ Receiving: {

@@ -92,3 +92,3 @@ "use strict";

initialSharedVersion: import_internal.JsonU64,
mutable: (0, import_valibot.nullable)((0, import_valibot.boolean)())
mutable: (0, import_valibot.boolean)()
}),

@@ -95,0 +95,0 @@ Receiving: import_internal.ObjectRef

@@ -311,3 +311,3 @@ import type { SerializedBcs } from '@mysten/bcs';

initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};

@@ -314,0 +314,0 @@ Receiving: {

@@ -1,2 +0,2 @@

export declare const PACKAGE_VERSION = "0.0.0-experimental-20240529195942";
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240529213642";
export declare const TARGETED_RPC_VERSION = "1.27.0";

@@ -25,4 +25,4 @@ "use strict";

module.exports = __toCommonJS(version_exports);
const PACKAGE_VERSION = "0.0.0-experimental-20240529195942";
const PACKAGE_VERSION = "0.0.0-experimental-20240529213642";
const TARGETED_RPC_VERSION = "1.27.0";
//# sourceMappingURL=version.js.map

@@ -152,3 +152,3 @@ import {

initialSharedVersion: JsonU64,
mutable: nullable(boolean())
mutable: boolean()
}),

@@ -155,0 +155,0 @@ Receiving: ObjectRef

import type { BaseSchema, Output } from 'valibot';
import type { StructTag as StructTagType, TypeTag as TypeTagType } from '../../bcs/types.js';
import { TransactionData } from './internal.js';
export declare const ObjectRef: import("valibot").ObjectSchema<{
digest: import("valibot").StringSchema<string>;
objectId: import("valibot").StringSchema<string>;
version: import("valibot").UnionSchema<(import("valibot").StringSchema<string> | import("valibot").NumberSchema<number> | import("valibot").BigintSchema<bigint>)[], string | number | bigint>;
}, undefined, {
objectId: string;
version: string | number | bigint;
digest: string;
}>;
export declare const NormalizedCallArg: {

@@ -8,18 +17,18 @@ async: false;

Object: import("@mysten/bcs").EnumOutputShapeWithKeys<{
ImmOrOwnedObject: {
ImmOrOwned: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
SharedObject: {
Shared: {
objectId: string;
initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};
Receiving: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
}, "Receiving" | "Shared" | "ImmOrOwned">;
Pure: number[];

@@ -30,15 +39,15 @@ }, "Pure" | "Object">>;

Object: import("@mysten/bcs").EnumInputShape<{
ImmOrOwnedObject: {
ImmOrOwned: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
SharedObject: {
Shared: {
objectId: string;
initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};
Receiving: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;

@@ -51,18 +60,18 @@ };

Object: import("@mysten/bcs").EnumOutputShapeWithKeys<{
ImmOrOwnedObject: {
ImmOrOwned: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
SharedObject: {
Shared: {
objectId: string;
initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};
Receiving: {
objectId: string;
version: string | number;
version: string | number | bigint;
digest: string;
};
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
}, "Receiving" | "Shared" | "ImmOrOwned">;
Pure: number[];

@@ -72,11 +81,2 @@ }, "Pure" | "Object">;

};
export declare const ObjectRef: import("valibot").ObjectSchema<{
digest: import("valibot").StringSchema<string>;
objectId: import("valibot").StringSchema<string>;
version: import("valibot").UnionSchema<(import("valibot").StringSchema<string> | import("valibot").NumberSchema<number> | import("valibot").BigintSchema<bigint>)[], string | number | bigint>;
}, undefined, {
objectId: string;
version: string | number | bigint;
digest: string;
}>;
export declare const TypeTag: BaseSchema<TypeTagType>;

@@ -83,0 +83,0 @@ export declare const StructTag: BaseSchema<StructTagType>;

@@ -5,2 +5,3 @@ import { fromB64, toB64 } from "@mysten/bcs";

bigint,
boolean,
custom,

@@ -22,7 +23,3 @@ integer,

import { TypeTagSerializer } from "../../bcs/index.js";
import { ObjectArg, safeEnum, TransactionData } from "./internal.js";
const NormalizedCallArg = safeEnum({
Object: ObjectArg,
Pure: array(number([integer()]))
});
import { JsonU64, ObjectID, safeEnum, TransactionData } from "./internal.js";
const ObjectRef = object({

@@ -33,2 +30,15 @@ digest: string(),

});
const ObjectArg = safeEnum({
ImmOrOwned: ObjectRef,
Shared: object({
objectId: ObjectID,
initialSharedVersion: JsonU64,
mutable: boolean()
}),
Receiving: ObjectRef
});
const NormalizedCallArg = safeEnum({
Object: ObjectArg,
Pure: array(number([integer()]))
});
const TransactionInput = union([

@@ -169,3 +179,3 @@ object({

Object: input.Object.ImmOrOwnedObject ? {
ImmOrOwnedObject: input.Object.ImmOrOwnedObject
ImmOrOwned: input.Object.ImmOrOwnedObject
} : input.Object.Receiving ? {

@@ -178,3 +188,3 @@ Receiving: {

} : {
SharedObject: {
Shared: {
mutable: input.Object.SharedObject.mutable,

@@ -326,5 +336,36 @@ initialSharedVersion: input.Object.SharedObject.initialSharedVersion,

if (value.Object) {
return {
Object: value.Object
};
if (value.Object.ImmOrOwned) {
return {
Object: {
ImmOrOwnedObject: {
objectId: value.Object.ImmOrOwned.objectId,
version: String(value.Object.ImmOrOwned.version),
digest: value.Object.ImmOrOwned.digest
}
}
};
}
if (value.Object.Shared) {
return {
Object: {
SharedObject: {
mutable: value.Object.Shared.mutable ?? null,
initialSharedVersion: value.Object.Shared.initialSharedVersion,
objectId: value.Object.Shared.objectId
}
}
};
}
if (value.Object.Receiving) {
return {
Object: {
Receiving: {
digest: value.Object.Receiving.digest,
version: String(value.Object.Receiving.version),
objectId: value.Object.Receiving.objectId
}
}
};
}
throw new Error("Invalid object input");
}

@@ -331,0 +372,0 @@ return {

@@ -54,3 +54,3 @@ import type { EnumInputShape } from '@mysten/bcs';

initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};

@@ -85,3 +85,3 @@ Receiving: {

initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};

@@ -316,3 +316,3 @@ Receiving: {

initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};

@@ -319,0 +319,0 @@ Receiving: {

@@ -84,3 +84,3 @@ import {

initialSharedVersion: JsonU64,
mutable: nullable(boolean())
mutable: boolean()
}),

@@ -87,0 +87,0 @@ Receiving: ObjectRef

@@ -311,3 +311,3 @@ import type { SerializedBcs } from '@mysten/bcs';

initialSharedVersion: string | number;
mutable: boolean | null;
mutable: boolean;
};

@@ -314,0 +314,0 @@ Receiving: {

@@ -1,2 +0,2 @@

export declare const PACKAGE_VERSION = "0.0.0-experimental-20240529195942";
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240529213642";
export declare const TARGETED_RPC_VERSION = "1.27.0";

@@ -1,2 +0,2 @@

const PACKAGE_VERSION = "0.0.0-experimental-20240529195942";
const PACKAGE_VERSION = "0.0.0-experimental-20240529213642";
const TARGETED_RPC_VERSION = "1.27.0";

@@ -3,0 +3,0 @@ export {

@@ -6,3 +6,3 @@ {

"homepage": "https://sdk.mystenlabs.com",
"version": "0.0.0-experimental-20240529195942",
"version": "0.0.0-experimental-20240529213642",
"license": "Apache-2.0",

@@ -9,0 +9,0 @@ "sideEffects": false,

@@ -276,3 +276,3 @@ // Copyright (c) Mysten Labs, Inc.

initialSharedVersion: JsonU64,
mutable: nullable(boolean()),
mutable: boolean(),
}),

@@ -279,0 +279,0 @@ Receiving: ObjectRef,

@@ -9,2 +9,3 @@ // Copyright (c) Mysten Labs, Inc.

bigint,
boolean,
custom,

@@ -28,10 +29,5 @@ integer,

import type { StructTag as StructTagType, TypeTag as TypeTagType } from '../../bcs/types.js';
import { ObjectArg, safeEnum, TransactionData } from './internal.js';
import { JsonU64, ObjectID, safeEnum, TransactionData } from './internal.js';
import type { Argument } from './internal.js';
export const NormalizedCallArg = safeEnum({
Object: ObjectArg,
Pure: array(number([integer()])),
});
export const ObjectRef = object({

@@ -43,2 +39,17 @@ digest: string(),

const ObjectArg = safeEnum({
ImmOrOwned: ObjectRef,
Shared: object({
objectId: ObjectID,
initialSharedVersion: JsonU64,
mutable: boolean(),
}),
Receiving: ObjectRef,
});
export const NormalizedCallArg = safeEnum({
Object: ObjectArg,
Pure: array(number([integer()])),
});
const TransactionInput = union([

@@ -204,3 +215,3 @@ object({

? {
ImmOrOwnedObject: input.Object.ImmOrOwnedObject,
ImmOrOwned: input.Object.ImmOrOwnedObject,
}

@@ -216,3 +227,3 @@ : input.Object.Receiving

: {
SharedObject: {
Shared: {
mutable: input.Object.SharedObject.mutable,

@@ -390,5 +401,37 @@ initialSharedVersion: input.Object.SharedObject.initialSharedVersion,

if (value.Object) {
return {
Object: value.Object,
};
if (value.Object.ImmOrOwned) {
return {
Object: {
ImmOrOwnedObject: {
objectId: value.Object.ImmOrOwned.objectId,
version: String(value.Object.ImmOrOwned.version),
digest: value.Object.ImmOrOwned.digest,
},
},
};
}
if (value.Object.Shared) {
return {
Object: {
SharedObject: {
mutable: value.Object.Shared.mutable ?? null,
initialSharedVersion: value.Object.Shared.initialSharedVersion,
objectId: value.Object.Shared.objectId,
},
},
};
}
if (value.Object.Receiving) {
return {
Object: {
Receiving: {
digest: value.Object.Receiving.digest,
version: String(value.Object.Receiving.version),
objectId: value.Object.Receiving.objectId,
},
},
};
}
throw new Error('Invalid object input');
}

@@ -395,0 +438,0 @@

@@ -110,3 +110,3 @@ // Copyright (c) Mysten Labs, Inc.

initialSharedVersion: JsonU64,
mutable: nullable(boolean()),
mutable: boolean(),
}),

@@ -113,0 +113,0 @@ Receiving: ObjectRef,

@@ -6,3 +6,3 @@ // Copyright (c) Mysten Labs, Inc.

export const PACKAGE_VERSION = '0.0.0-experimental-20240529195942';
export const PACKAGE_VERSION = '0.0.0-experimental-20240529213642';
export const TARGETED_RPC_VERSION = '1.27.0';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc