@mysten/sui 2.31.2 → 2.31.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 +6 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/index.d.mts +36 -36
- package/dist/cryptography/signature.d.mts +6 -6
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
- package/dist/transactions/Transaction.d.mts +9 -9
- package/dist/transactions/data/internal.d.mts +133 -133
- package/dist/transactions/data/internal.d.mts.map +1 -1
- package/dist/transactions/data/internal.mjs +24 -2
- package/dist/transactions/data/internal.mjs.map +1 -1
- package/dist/transactions/data/v1.d.mts +239 -239
- package/dist/transactions/data/v1.d.mts.map +1 -1
- package/dist/transactions/data/v2.d.mts +16 -16
- package/dist/transactions/data/v2.d.mts.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/package.json +1 -1
- package/src/transactions/data/internal.ts +43 -10
- package/src/version.ts +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EnumInputShape } from "@mysten/bcs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as valibot0 from "valibot";
|
|
3
3
|
import { GenericSchema, InferOutput } from "valibot";
|
|
4
4
|
|
|
5
5
|
//#region src/transactions/data/v2.d.ts
|
|
6
|
-
declare const SerializedTransactionDataV2Schema:
|
|
7
|
-
readonly version:
|
|
8
|
-
readonly sender:
|
|
9
|
-
readonly expiration:
|
|
6
|
+
declare const SerializedTransactionDataV2Schema: valibot0.ObjectSchema<{
|
|
7
|
+
readonly version: valibot0.LiteralSchema<2, undefined>;
|
|
8
|
+
readonly sender: valibot0.NullishSchema<valibot0.SchemaWithPipe<readonly [valibot0.StringSchema<undefined>, valibot0.TransformAction<string, string>, valibot0.CheckAction<string, undefined>]>, undefined>;
|
|
9
|
+
readonly expiration: valibot0.NullishSchema<GenericSchema<EnumInputShape<{
|
|
10
10
|
None: true;
|
|
11
11
|
Epoch: string | number;
|
|
12
12
|
ValidDuring: {
|
|
@@ -30,17 +30,17 @@ declare const SerializedTransactionDataV2Schema: valibot1369.ObjectSchema<{
|
|
|
30
30
|
nonce: number;
|
|
31
31
|
};
|
|
32
32
|
}>>, undefined>;
|
|
33
|
-
readonly gasData:
|
|
34
|
-
readonly budget:
|
|
35
|
-
readonly price:
|
|
36
|
-
readonly owner:
|
|
37
|
-
readonly payment:
|
|
38
|
-
readonly objectId:
|
|
39
|
-
readonly version:
|
|
40
|
-
readonly digest:
|
|
33
|
+
readonly gasData: valibot0.ObjectSchema<{
|
|
34
|
+
readonly budget: valibot0.NullableSchema<valibot0.SchemaWithPipe<readonly [valibot0.UnionSchema<[valibot0.StringSchema<undefined>, valibot0.SchemaWithPipe<readonly [valibot0.NumberSchema<undefined>, valibot0.IntegerAction<number, undefined>]>], undefined>, valibot0.CheckAction<string | number, "Invalid u64">]>, undefined>;
|
|
35
|
+
readonly price: valibot0.NullableSchema<valibot0.SchemaWithPipe<readonly [valibot0.UnionSchema<[valibot0.StringSchema<undefined>, valibot0.SchemaWithPipe<readonly [valibot0.NumberSchema<undefined>, valibot0.IntegerAction<number, undefined>]>], undefined>, valibot0.CheckAction<string | number, "Invalid u64">]>, undefined>;
|
|
36
|
+
readonly owner: valibot0.NullableSchema<valibot0.SchemaWithPipe<readonly [valibot0.StringSchema<undefined>, valibot0.TransformAction<string, string>, valibot0.CheckAction<string, undefined>]>, undefined>;
|
|
37
|
+
readonly payment: valibot0.NullableSchema<valibot0.ArraySchema<valibot0.ObjectSchema<{
|
|
38
|
+
readonly objectId: valibot0.SchemaWithPipe<readonly [valibot0.StringSchema<undefined>, valibot0.TransformAction<string, string>, valibot0.CheckAction<string, undefined>]>;
|
|
39
|
+
readonly version: valibot0.SchemaWithPipe<readonly [valibot0.UnionSchema<[valibot0.StringSchema<undefined>, valibot0.SchemaWithPipe<readonly [valibot0.NumberSchema<undefined>, valibot0.IntegerAction<number, undefined>]>], undefined>, valibot0.CheckAction<string | number, "Invalid u64">]>;
|
|
40
|
+
readonly digest: valibot0.StringSchema<undefined>;
|
|
41
41
|
}, undefined>, undefined>, undefined>;
|
|
42
42
|
}, undefined>;
|
|
43
|
-
readonly inputs:
|
|
43
|
+
readonly inputs: valibot0.ArraySchema<GenericSchema<EnumInputShape<{
|
|
44
44
|
Object: EnumInputShape<{
|
|
45
45
|
ImmOrOwnedObject: {
|
|
46
46
|
objectId: string;
|
|
@@ -90,7 +90,7 @@ declare const SerializedTransactionDataV2Schema: valibot1369.ObjectSchema<{
|
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
92
|
}>>, undefined>;
|
|
93
|
-
readonly commands:
|
|
93
|
+
readonly commands: valibot0.ArraySchema<GenericSchema<EnumInputShape<{
|
|
94
94
|
MoveCall: {
|
|
95
95
|
package: string;
|
|
96
96
|
module: string;
|
|
@@ -189,7 +189,7 @@ declare const SerializedTransactionDataV2Schema: valibot1369.ObjectSchema<{
|
|
|
189
189
|
};
|
|
190
190
|
};
|
|
191
191
|
}>>, undefined>;
|
|
192
|
-
readonly digest:
|
|
192
|
+
readonly digest: valibot0.OptionalSchema<valibot0.NullableSchema<valibot0.StringSchema<undefined>, undefined>, undefined>;
|
|
193
193
|
}, undefined>;
|
|
194
194
|
type SerializedTransactionDataV2 = InferOutput<typeof SerializedTransactionDataV2Schema>;
|
|
195
195
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2.d.mts","names":[],"sources":["../../../src/transactions/data/v2.ts"],"mappings":";;;;;cAqJa,iCAAA,
|
|
1
|
+
{"version":3,"file":"v2.d.mts","names":[],"sources":["../../../src/transactions/data/v2.ts"],"mappings":";;;;;cAqJa,iCAAA,WAAiC,YAAA;EAAA,kBAQ5C,QAAA,CAAA,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEU,2BAAA,GAA8B,WAAA,QAAmB,iCAAA"}
|
package/dist/version.mjs
CHANGED
package/dist/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"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 = '2.31.
|
|
1
|
+
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"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 = '2.31.3';\n"],"mappings":";AAKA,MAAa,kBAAkB"}
|
package/dist/zklogin/bcs.d.mts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _mysten_bcs1248 from "@mysten/bcs";
|
|
2
2
|
import { InferBcsInput } from "@mysten/bcs";
|
|
3
3
|
|
|
4
4
|
//#region src/zklogin/bcs.d.ts
|
|
5
|
-
declare const zkLoginSignature:
|
|
6
|
-
inputs:
|
|
7
|
-
proofPoints:
|
|
8
|
-
a:
|
|
5
|
+
declare const zkLoginSignature: _mysten_bcs1248.BcsStruct<{
|
|
6
|
+
inputs: _mysten_bcs1248.BcsStruct<{
|
|
7
|
+
proofPoints: _mysten_bcs1248.BcsStruct<{
|
|
8
|
+
a: _mysten_bcs1248.BcsType<string[], Iterable<string> & {
|
|
9
9
|
length: number;
|
|
10
10
|
}, string>;
|
|
11
|
-
b:
|
|
11
|
+
b: _mysten_bcs1248.BcsType<string[][], Iterable<Iterable<string> & {
|
|
12
12
|
length: number;
|
|
13
13
|
}> & {
|
|
14
14
|
length: number;
|
|
15
15
|
}, string>;
|
|
16
|
-
c:
|
|
16
|
+
c: _mysten_bcs1248.BcsType<string[], Iterable<string> & {
|
|
17
17
|
length: number;
|
|
18
18
|
}, string>;
|
|
19
19
|
}, string>;
|
|
20
|
-
issBase64Details:
|
|
21
|
-
value:
|
|
22
|
-
indexMod4:
|
|
20
|
+
issBase64Details: _mysten_bcs1248.BcsStruct<{
|
|
21
|
+
value: _mysten_bcs1248.BcsType<string, string, "string">;
|
|
22
|
+
indexMod4: _mysten_bcs1248.BcsType<number, number, "u8">;
|
|
23
23
|
}, string>;
|
|
24
|
-
headerBase64:
|
|
25
|
-
addressSeed:
|
|
24
|
+
headerBase64: _mysten_bcs1248.BcsType<string, string, "string">;
|
|
25
|
+
addressSeed: _mysten_bcs1248.BcsType<string, string, "string">;
|
|
26
26
|
}, string>;
|
|
27
|
-
maxEpoch:
|
|
28
|
-
userSignature:
|
|
27
|
+
maxEpoch: _mysten_bcs1248.BcsType<string, string | number | bigint, "u64">;
|
|
28
|
+
userSignature: _mysten_bcs1248.BcsType<Uint8Array<ArrayBufferLike>, Iterable<number>, "vector<u8>">;
|
|
29
29
|
}, string>;
|
|
30
30
|
type ZkLoginSignature = InferBcsInput<typeof zkLoginSignature>;
|
|
31
31
|
type ZkLoginSignatureInputs = ZkLoginSignature['inputs'];
|
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
tuple,
|
|
23
23
|
union,
|
|
24
24
|
unknown,
|
|
25
|
+
variant,
|
|
25
26
|
} from 'valibot';
|
|
26
27
|
|
|
27
28
|
import { isValidSuiAddress, normalizeSuiAddress } from '../../utils/sui-types.js';
|
|
@@ -46,17 +47,49 @@ type EnumSchema<T extends Record<string, GenericSchema<any>>> = GenericSchema<
|
|
|
46
47
|
>;
|
|
47
48
|
|
|
48
49
|
export function safeEnum<T extends Record<string, GenericSchema<any>>>(options: T): EnumSchema<T> {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
const schemas = Object.keys(options).map((key) =>
|
|
51
|
+
object({
|
|
52
|
+
[key]: options[key],
|
|
53
|
+
$kind: literal(key),
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
return pipe(
|
|
58
|
+
unknown(),
|
|
59
|
+
check(
|
|
60
|
+
(input) => unsupportedEnumVariantMessage(input, options) === undefined,
|
|
61
|
+
({ input, message }) => unsupportedEnumVariantMessage(input, options) ?? message,
|
|
58
62
|
),
|
|
59
|
-
|
|
63
|
+
transform(addMissingEnumKind),
|
|
64
|
+
variant('$kind', schemas),
|
|
65
|
+
) as unknown as EnumSchema<T>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getEnumKind(input: unknown) {
|
|
69
|
+
if (typeof input !== 'object' || input === null) return null;
|
|
70
|
+
if ('$kind' in input && typeof input.$kind === 'string') return input.$kind;
|
|
71
|
+
|
|
72
|
+
return Object.keys(input).find((key) => key !== '$kind') ?? null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function addMissingEnumKind(input: unknown) {
|
|
76
|
+
if (typeof input !== 'object' || input === null || '$kind' in input) return input;
|
|
77
|
+
|
|
78
|
+
const kind = getEnumKind(input);
|
|
79
|
+
return kind === null ? input : { ...input, $kind: kind };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function unsupportedEnumVariantMessage(
|
|
83
|
+
input: unknown,
|
|
84
|
+
options: Record<string, GenericSchema<any>>,
|
|
85
|
+
) {
|
|
86
|
+
const kind = getEnumKind(input);
|
|
87
|
+
if (kind === null || Object.hasOwn(options, kind)) return undefined;
|
|
88
|
+
|
|
89
|
+
const expected = Object.keys(options)
|
|
90
|
+
.map((key) => `"${key}"`)
|
|
91
|
+
.join(', ');
|
|
92
|
+
return `Unsupported enum variant "${kind}". Expected one of: ${expected}.`;
|
|
60
93
|
}
|
|
61
94
|
|
|
62
95
|
function withKind<K extends string, TEntries extends ObjectEntries>(
|
package/src/version.ts
CHANGED