@t2000/cli 5.5.0 → 5.6.0
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/dist/{chunk-YKME3ZZ5.js → chunk-64M2IV26.js} +5 -5
- package/dist/{chunk-V6MPPVOY.js → chunk-D6WAQS6U.js} +3 -3
- package/dist/{chunk-HRGEZK3M.js → chunk-I2DCISQP.js} +3 -3
- package/dist/{chunk-ZIKS3DOX.js → chunk-ITIKLNK5.js} +3 -3
- package/dist/{chunk-FORXEDQJ.js → chunk-MPXYF2CX.js} +1449 -1449
- package/dist/chunk-MPXYF2CX.js.map +1 -0
- package/dist/{dist-4JZ33TE5.js → dist-ULTRYNV7.js} +1977 -1899
- package/dist/dist-ULTRYNV7.js.map +1 -0
- package/dist/{dist-OPR66FUQ.js → dist-VXJH2WYL.js} +6 -6
- package/dist/{esm-EIRCX523.js → esm-RF62MWQV.js} +2 -2
- package/dist/{grpc-IINTSDGR.js → grpc-UMZJXRGY.js} +4 -4
- package/dist/index.js +127 -48
- package/dist/index.js.map +1 -1
- package/dist/{transactions-JPL6KL3D.js → transactions-FSCAFG5Z.js} +4 -4
- package/dist/{x402-TTLPDM7N.js → x402-EMQGKUTK.js} +4 -4
- package/package.json +3 -3
- package/dist/chunk-FORXEDQJ.js.map +0 -1
- package/dist/dist-4JZ33TE5.js.map +0 -1
- /package/dist/{chunk-YKME3ZZ5.js.map → chunk-64M2IV26.js.map} +0 -0
- /package/dist/{chunk-V6MPPVOY.js.map → chunk-D6WAQS6U.js.map} +0 -0
- /package/dist/{chunk-HRGEZK3M.js.map → chunk-I2DCISQP.js.map} +0 -0
- /package/dist/{chunk-ZIKS3DOX.js.map → chunk-ITIKLNK5.js.map} +0 -0
- /package/dist/{dist-OPR66FUQ.js.map → dist-VXJH2WYL.js.map} +0 -0
- /package/dist/{esm-EIRCX523.js.map → esm-RF62MWQV.js.map} +0 -0
- /package/dist/{grpc-IINTSDGR.js.map → grpc-UMZJXRGY.js.map} +0 -0
- /package/dist/{transactions-JPL6KL3D.js.map → transactions-FSCAFG5Z.js.map} +0 -0
- /package/dist/{x402-TTLPDM7N.js.map → x402-EMQGKUTK.js.map} +0 -0
|
@@ -16,521 +16,846 @@ import {
|
|
|
16
16
|
toBase58,
|
|
17
17
|
toBase64,
|
|
18
18
|
toHex
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-I2DCISQP.js";
|
|
20
20
|
|
|
21
|
-
// ../../node_modules/.pnpm
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
received,
|
|
65
|
-
message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
|
|
66
|
-
requirement: context.requirement,
|
|
67
|
-
path: other?.path,
|
|
68
|
-
issues: other?.issues,
|
|
69
|
-
lang: config$1.lang,
|
|
70
|
-
abortEarly: config$1.abortEarly,
|
|
71
|
-
abortPipeEarly: config$1.abortPipeEarly
|
|
72
|
-
};
|
|
73
|
-
const isSchema = context.kind === "schema";
|
|
74
|
-
const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
|
|
75
|
-
if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
|
|
76
|
-
if (isSchema) dataset.typed = false;
|
|
77
|
-
if (dataset.issues) dataset.issues.push(issue);
|
|
78
|
-
else dataset.issues = [issue];
|
|
79
|
-
}
|
|
80
|
-
// @__NO_SIDE_EFFECTS__
|
|
81
|
-
function _getStandardProps(context) {
|
|
82
|
-
return {
|
|
83
|
-
version: 1,
|
|
84
|
-
vendor: "valibot",
|
|
85
|
-
validate(value$1) {
|
|
86
|
-
return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
|
|
21
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/bcs/type-tag-serializer.mjs
|
|
22
|
+
var VECTOR_REGEX = /^vector<(.+)>$/;
|
|
23
|
+
var STRUCT_REGEX = /^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;
|
|
24
|
+
var TypeTagSerializer = class TypeTagSerializer2 {
|
|
25
|
+
static parseFromStr(str, normalizeAddress = false) {
|
|
26
|
+
if (str === "address") return { address: null };
|
|
27
|
+
else if (str === "bool") return { bool: null };
|
|
28
|
+
else if (str === "u8") return { u8: null };
|
|
29
|
+
else if (str === "u16") return { u16: null };
|
|
30
|
+
else if (str === "u32") return { u32: null };
|
|
31
|
+
else if (str === "u64") return { u64: null };
|
|
32
|
+
else if (str === "u128") return { u128: null };
|
|
33
|
+
else if (str === "u256") return { u256: null };
|
|
34
|
+
else if (str === "signer") return { signer: null };
|
|
35
|
+
const vectorMatch = str.match(VECTOR_REGEX);
|
|
36
|
+
if (vectorMatch) return { vector: TypeTagSerializer2.parseFromStr(vectorMatch[1], normalizeAddress) };
|
|
37
|
+
const structMatch = str.match(STRUCT_REGEX);
|
|
38
|
+
if (structMatch) return { struct: {
|
|
39
|
+
address: normalizeAddress ? normalizeSuiAddress(structMatch[1]) : structMatch[1],
|
|
40
|
+
module: structMatch[2],
|
|
41
|
+
name: structMatch[3],
|
|
42
|
+
typeParams: structMatch[5] === void 0 ? [] : TypeTagSerializer2.parseStructTypeArgs(structMatch[5], normalizeAddress)
|
|
43
|
+
} };
|
|
44
|
+
throw new Error(`Encountered unexpected token when parsing type args for ${str}`);
|
|
45
|
+
}
|
|
46
|
+
static parseStructTypeArgs(str, normalizeAddress = false) {
|
|
47
|
+
return splitGenericParameters(str).map((tok) => TypeTagSerializer2.parseFromStr(tok, normalizeAddress));
|
|
48
|
+
}
|
|
49
|
+
static tagToString(tag) {
|
|
50
|
+
if ("bool" in tag) return "bool";
|
|
51
|
+
if ("u8" in tag) return "u8";
|
|
52
|
+
if ("u16" in tag) return "u16";
|
|
53
|
+
if ("u32" in tag) return "u32";
|
|
54
|
+
if ("u64" in tag) return "u64";
|
|
55
|
+
if ("u128" in tag) return "u128";
|
|
56
|
+
if ("u256" in tag) return "u256";
|
|
57
|
+
if ("address" in tag) return "address";
|
|
58
|
+
if ("signer" in tag) return "signer";
|
|
59
|
+
if ("vector" in tag) return `vector<${TypeTagSerializer2.tagToString(tag.vector)}>`;
|
|
60
|
+
if ("struct" in tag) {
|
|
61
|
+
const struct = tag.struct;
|
|
62
|
+
const typeParams = struct.typeParams.map(TypeTagSerializer2.tagToString).join(", ");
|
|
63
|
+
return `${struct.address}::${struct.module}::${struct.name}${typeParams ? `<${typeParams}>` : ""}`;
|
|
87
64
|
}
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
// @__NO_SIDE_EFFECTS__
|
|
91
|
-
function _isValidObjectKey(object$1, key) {
|
|
92
|
-
return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
|
|
93
|
-
}
|
|
94
|
-
// @__NO_SIDE_EFFECTS__
|
|
95
|
-
function _joinExpects(values$1, separator) {
|
|
96
|
-
const list = [...new Set(values$1)];
|
|
97
|
-
if (list.length > 1) return `(${list.join(` ${separator} `)})`;
|
|
98
|
-
return list[0] ?? "never";
|
|
99
|
-
}
|
|
100
|
-
var ValiError = class extends Error {
|
|
101
|
-
/**
|
|
102
|
-
* Creates a Valibot error with useful information.
|
|
103
|
-
*
|
|
104
|
-
* @param issues The error issues.
|
|
105
|
-
*/
|
|
106
|
-
constructor(issues) {
|
|
107
|
-
super(issues[0].message);
|
|
108
|
-
this.name = "ValiError";
|
|
109
|
-
this.issues = issues;
|
|
65
|
+
throw new Error("Invalid TypeTag");
|
|
110
66
|
}
|
|
111
67
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"~run"(dataset, config$1) {
|
|
123
|
-
if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1);
|
|
124
|
-
return dataset;
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
// @__NO_SIDE_EFFECTS__
|
|
129
|
-
function integer(message$1) {
|
|
130
|
-
return {
|
|
131
|
-
kind: "validation",
|
|
132
|
-
type: "integer",
|
|
133
|
-
reference: integer,
|
|
134
|
-
async: false,
|
|
135
|
-
expects: null,
|
|
136
|
-
requirement: Number.isInteger,
|
|
137
|
-
message: message$1,
|
|
138
|
-
"~run"(dataset, config$1) {
|
|
139
|
-
if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1);
|
|
140
|
-
return dataset;
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
// @__NO_SIDE_EFFECTS__
|
|
145
|
-
function transform(operation) {
|
|
146
|
-
return {
|
|
147
|
-
kind: "transformation",
|
|
148
|
-
type: "transform",
|
|
149
|
-
reference: transform,
|
|
150
|
-
async: false,
|
|
151
|
-
operation,
|
|
152
|
-
"~run"(dataset) {
|
|
153
|
-
dataset.value = this.operation(dataset.value);
|
|
154
|
-
return dataset;
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
// @__NO_SIDE_EFFECTS__
|
|
159
|
-
function getFallback(schema, dataset, config$1) {
|
|
160
|
-
return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
|
|
161
|
-
}
|
|
162
|
-
// @__NO_SIDE_EFFECTS__
|
|
163
|
-
function getDefault(schema, dataset, config$1) {
|
|
164
|
-
return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
|
|
165
|
-
}
|
|
166
|
-
// @__NO_SIDE_EFFECTS__
|
|
167
|
-
function is(schema, input) {
|
|
168
|
-
return !schema["~run"]({ value: input }, { abortEarly: true }).issues;
|
|
68
|
+
|
|
69
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/bcs/bcs.mjs
|
|
70
|
+
function unsafe_u64(options) {
|
|
71
|
+
return bcs.u64({
|
|
72
|
+
name: "unsafe_u64",
|
|
73
|
+
...options
|
|
74
|
+
}).transform({
|
|
75
|
+
input: (val) => val,
|
|
76
|
+
output: (val) => Number(val)
|
|
77
|
+
});
|
|
169
78
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
reference: array,
|
|
176
|
-
expects: "Array",
|
|
177
|
-
async: false,
|
|
178
|
-
item,
|
|
179
|
-
message: message$1,
|
|
180
|
-
get "~standard"() {
|
|
181
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
182
|
-
},
|
|
183
|
-
"~run"(dataset, config$1) {
|
|
184
|
-
const input = dataset.value;
|
|
185
|
-
if (Array.isArray(input)) {
|
|
186
|
-
dataset.typed = true;
|
|
187
|
-
dataset.value = [];
|
|
188
|
-
for (let key = 0; key < input.length; key++) {
|
|
189
|
-
const value$1 = input[key];
|
|
190
|
-
const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
|
|
191
|
-
if (itemDataset.issues) {
|
|
192
|
-
const pathItem = {
|
|
193
|
-
type: "array",
|
|
194
|
-
origin: "value",
|
|
195
|
-
input,
|
|
196
|
-
key,
|
|
197
|
-
value: value$1
|
|
198
|
-
};
|
|
199
|
-
for (const issue of itemDataset.issues) {
|
|
200
|
-
if (issue.path) issue.path.unshift(pathItem);
|
|
201
|
-
else issue.path = [pathItem];
|
|
202
|
-
dataset.issues?.push(issue);
|
|
203
|
-
}
|
|
204
|
-
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
205
|
-
if (config$1.abortEarly) {
|
|
206
|
-
dataset.typed = false;
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
if (!itemDataset.typed) dataset.typed = false;
|
|
211
|
-
dataset.value.push(itemDataset.value);
|
|
212
|
-
}
|
|
213
|
-
} else _addIssue(this, "type", dataset, config$1);
|
|
214
|
-
return dataset;
|
|
215
|
-
}
|
|
216
|
-
};
|
|
79
|
+
function optionEnum(type) {
|
|
80
|
+
return bcs.enum("Option", {
|
|
81
|
+
None: null,
|
|
82
|
+
Some: type
|
|
83
|
+
});
|
|
217
84
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
85
|
+
var Address = bcs.bytes(SUI_ADDRESS_LENGTH).transform({
|
|
86
|
+
validate: (val) => {
|
|
87
|
+
const address = typeof val === "string" ? val : toHex(val);
|
|
88
|
+
if (!address || !isValidSuiAddress(normalizeSuiAddress(address))) throw new Error(`Invalid Sui address ${address}`);
|
|
89
|
+
},
|
|
90
|
+
input: (val) => typeof val === "string" ? fromHex(normalizeSuiAddress(val)) : val,
|
|
91
|
+
output: (val) => normalizeSuiAddress(toHex(val))
|
|
92
|
+
});
|
|
93
|
+
var ObjectDigest = bcs.byteVector().transform({
|
|
94
|
+
name: "ObjectDigest",
|
|
95
|
+
input: (value) => fromBase58(value),
|
|
96
|
+
output: (value) => toBase58(new Uint8Array(value)),
|
|
97
|
+
validate: (value) => {
|
|
98
|
+
if (fromBase58(value).length !== 32) throw new Error("ObjectDigest must be 32 bytes");
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
var SuiObjectRef = bcs.struct("SuiObjectRef", {
|
|
102
|
+
objectId: Address,
|
|
103
|
+
version: bcs.u64(),
|
|
104
|
+
digest: ObjectDigest
|
|
105
|
+
});
|
|
106
|
+
var SharedObjectRef = bcs.struct("SharedObjectRef", {
|
|
107
|
+
objectId: Address,
|
|
108
|
+
initialSharedVersion: bcs.u64(),
|
|
109
|
+
mutable: bcs.bool()
|
|
110
|
+
});
|
|
111
|
+
var ObjectArg = bcs.enum("ObjectArg", {
|
|
112
|
+
ImmOrOwnedObject: SuiObjectRef,
|
|
113
|
+
SharedObject: SharedObjectRef,
|
|
114
|
+
Receiving: SuiObjectRef
|
|
115
|
+
});
|
|
116
|
+
var Owner = bcs.enum("Owner", {
|
|
117
|
+
AddressOwner: Address,
|
|
118
|
+
ObjectOwner: Address,
|
|
119
|
+
Shared: bcs.struct("Shared", { initialSharedVersion: bcs.u64() }),
|
|
120
|
+
Immutable: null,
|
|
121
|
+
ConsensusAddressOwner: bcs.struct("ConsensusAddressOwner", {
|
|
122
|
+
startVersion: bcs.u64(),
|
|
123
|
+
owner: Address
|
|
124
|
+
})
|
|
125
|
+
});
|
|
126
|
+
var Reservation = bcs.enum("Reservation", { MaxAmountU64: bcs.u64() });
|
|
127
|
+
var WithdrawalType = bcs.enum("WithdrawalType", { Balance: bcs.lazy(() => TypeTag) });
|
|
128
|
+
var WithdrawFrom = bcs.enum("WithdrawFrom", {
|
|
129
|
+
Sender: null,
|
|
130
|
+
Sponsor: null
|
|
131
|
+
});
|
|
132
|
+
var FundsWithdrawal = bcs.struct("FundsWithdrawal", {
|
|
133
|
+
reservation: Reservation,
|
|
134
|
+
typeArg: WithdrawalType,
|
|
135
|
+
withdrawFrom: WithdrawFrom
|
|
136
|
+
});
|
|
137
|
+
var CallArg = bcs.enum("CallArg", {
|
|
138
|
+
Pure: bcs.struct("Pure", { bytes: bcs.byteVector().transform({
|
|
139
|
+
input: (val) => typeof val === "string" ? fromBase64(val) : val,
|
|
140
|
+
output: (val) => toBase64(new Uint8Array(val))
|
|
141
|
+
}) }),
|
|
142
|
+
Object: ObjectArg,
|
|
143
|
+
FundsWithdrawal
|
|
144
|
+
});
|
|
145
|
+
var InnerTypeTag = bcs.enum("TypeTag", {
|
|
146
|
+
bool: null,
|
|
147
|
+
u8: null,
|
|
148
|
+
u64: null,
|
|
149
|
+
u128: null,
|
|
150
|
+
address: null,
|
|
151
|
+
signer: null,
|
|
152
|
+
vector: bcs.lazy(() => InnerTypeTag),
|
|
153
|
+
struct: bcs.lazy(() => StructTag),
|
|
154
|
+
u16: null,
|
|
155
|
+
u32: null,
|
|
156
|
+
u256: null
|
|
157
|
+
});
|
|
158
|
+
var TypeTag = InnerTypeTag.transform({
|
|
159
|
+
input: (typeTag) => typeof typeTag === "string" ? TypeTagSerializer.parseFromStr(typeTag, true) : typeTag,
|
|
160
|
+
output: (typeTag) => TypeTagSerializer.tagToString(typeTag)
|
|
161
|
+
});
|
|
162
|
+
var Argument = bcs.enum("Argument", {
|
|
163
|
+
GasCoin: null,
|
|
164
|
+
Input: bcs.u16(),
|
|
165
|
+
Result: bcs.u16(),
|
|
166
|
+
NestedResult: bcs.tuple([bcs.u16(), bcs.u16()])
|
|
167
|
+
});
|
|
168
|
+
var ProgrammableMoveCall = bcs.struct("ProgrammableMoveCall", {
|
|
169
|
+
package: Address,
|
|
170
|
+
module: bcs.string(),
|
|
171
|
+
function: bcs.string(),
|
|
172
|
+
typeArguments: bcs.vector(TypeTag),
|
|
173
|
+
arguments: bcs.vector(Argument)
|
|
174
|
+
});
|
|
175
|
+
var Command = bcs.enum("Command", {
|
|
176
|
+
MoveCall: ProgrammableMoveCall,
|
|
177
|
+
TransferObjects: bcs.struct("TransferObjects", {
|
|
178
|
+
objects: bcs.vector(Argument),
|
|
179
|
+
address: Argument
|
|
180
|
+
}),
|
|
181
|
+
SplitCoins: bcs.struct("SplitCoins", {
|
|
182
|
+
coin: Argument,
|
|
183
|
+
amounts: bcs.vector(Argument)
|
|
184
|
+
}),
|
|
185
|
+
MergeCoins: bcs.struct("MergeCoins", {
|
|
186
|
+
destination: Argument,
|
|
187
|
+
sources: bcs.vector(Argument)
|
|
188
|
+
}),
|
|
189
|
+
Publish: bcs.struct("Publish", {
|
|
190
|
+
modules: bcs.vector(bcs.byteVector().transform({
|
|
191
|
+
input: (val) => typeof val === "string" ? fromBase64(val) : val,
|
|
192
|
+
output: (val) => toBase64(new Uint8Array(val))
|
|
193
|
+
})),
|
|
194
|
+
dependencies: bcs.vector(Address)
|
|
195
|
+
}),
|
|
196
|
+
MakeMoveVec: bcs.struct("MakeMoveVec", {
|
|
197
|
+
type: optionEnum(TypeTag).transform({
|
|
198
|
+
input: (val) => val === null ? { None: true } : { Some: val },
|
|
199
|
+
output: (val) => val.Some ?? null
|
|
200
|
+
}),
|
|
201
|
+
elements: bcs.vector(Argument)
|
|
202
|
+
}),
|
|
203
|
+
Upgrade: bcs.struct("Upgrade", {
|
|
204
|
+
modules: bcs.vector(bcs.byteVector().transform({
|
|
205
|
+
input: (val) => typeof val === "string" ? fromBase64(val) : val,
|
|
206
|
+
output: (val) => toBase64(new Uint8Array(val))
|
|
207
|
+
})),
|
|
208
|
+
dependencies: bcs.vector(Address),
|
|
209
|
+
package: Address,
|
|
210
|
+
ticket: Argument
|
|
211
|
+
})
|
|
212
|
+
});
|
|
213
|
+
var ProgrammableTransaction = bcs.struct("ProgrammableTransaction", {
|
|
214
|
+
inputs: bcs.vector(CallArg),
|
|
215
|
+
commands: bcs.vector(Command)
|
|
216
|
+
});
|
|
217
|
+
var TransactionKind = bcs.enum("TransactionKind", {
|
|
218
|
+
ProgrammableTransaction,
|
|
219
|
+
ChangeEpoch: null,
|
|
220
|
+
Genesis: null,
|
|
221
|
+
ConsensusCommitPrologue: null
|
|
222
|
+
});
|
|
223
|
+
var ValidDuring = bcs.struct("ValidDuring", {
|
|
224
|
+
minEpoch: bcs.option(bcs.u64()),
|
|
225
|
+
maxEpoch: bcs.option(bcs.u64()),
|
|
226
|
+
minTimestamp: bcs.option(bcs.u64()),
|
|
227
|
+
maxTimestamp: bcs.option(bcs.u64()),
|
|
228
|
+
chain: ObjectDigest,
|
|
229
|
+
nonce: bcs.u32()
|
|
230
|
+
});
|
|
231
|
+
var TransactionExpiration = bcs.enum("TransactionExpiration", {
|
|
232
|
+
None: null,
|
|
233
|
+
Epoch: unsafe_u64(),
|
|
234
|
+
ValidDuring
|
|
235
|
+
});
|
|
236
|
+
var StructTag = bcs.struct("StructTag", {
|
|
237
|
+
address: Address,
|
|
238
|
+
module: bcs.string(),
|
|
239
|
+
name: bcs.string(),
|
|
240
|
+
typeParams: bcs.vector(InnerTypeTag)
|
|
241
|
+
});
|
|
242
|
+
var GasData = bcs.struct("GasData", {
|
|
243
|
+
payment: bcs.vector(SuiObjectRef),
|
|
244
|
+
owner: Address,
|
|
245
|
+
price: bcs.u64(),
|
|
246
|
+
budget: bcs.u64()
|
|
247
|
+
});
|
|
248
|
+
var TransactionDataV1 = bcs.struct("TransactionDataV1", {
|
|
249
|
+
kind: TransactionKind,
|
|
250
|
+
sender: Address,
|
|
251
|
+
gasData: GasData,
|
|
252
|
+
expiration: TransactionExpiration
|
|
253
|
+
});
|
|
254
|
+
var TransactionData = bcs.enum("TransactionData", { V1: TransactionDataV1 });
|
|
255
|
+
var IntentScope = bcs.enum("IntentScope", {
|
|
256
|
+
TransactionData: null,
|
|
257
|
+
TransactionEffects: null,
|
|
258
|
+
CheckpointSummary: null,
|
|
259
|
+
PersonalMessage: null
|
|
260
|
+
});
|
|
261
|
+
var IntentVersion = bcs.enum("IntentVersion", { V0: null });
|
|
262
|
+
var AppId = bcs.enum("AppId", { Sui: null });
|
|
263
|
+
var Intent = bcs.struct("Intent", {
|
|
264
|
+
scope: IntentScope,
|
|
265
|
+
version: IntentVersion,
|
|
266
|
+
appId: AppId
|
|
267
|
+
});
|
|
268
|
+
function IntentMessage(T) {
|
|
269
|
+
return bcs.struct(`IntentMessage<${T.name}>`, {
|
|
270
|
+
intent: Intent,
|
|
271
|
+
value: T
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
var CompressedSignature = bcs.enum("CompressedSignature", {
|
|
275
|
+
ED25519: bcs.bytes(64),
|
|
276
|
+
Secp256k1: bcs.bytes(64),
|
|
277
|
+
Secp256r1: bcs.bytes(64),
|
|
278
|
+
ZkLogin: bcs.byteVector(),
|
|
279
|
+
Passkey: bcs.byteVector()
|
|
280
|
+
});
|
|
281
|
+
var PublicKey = bcs.enum("PublicKey", {
|
|
282
|
+
ED25519: bcs.bytes(32),
|
|
283
|
+
Secp256k1: bcs.bytes(33),
|
|
284
|
+
Secp256r1: bcs.bytes(33),
|
|
285
|
+
ZkLogin: bcs.byteVector(),
|
|
286
|
+
Passkey: bcs.bytes(33)
|
|
287
|
+
});
|
|
288
|
+
var MultiSigPkMap = bcs.struct("MultiSigPkMap", {
|
|
289
|
+
pubKey: PublicKey,
|
|
290
|
+
weight: bcs.u8()
|
|
291
|
+
});
|
|
292
|
+
var MultiSigPublicKey = bcs.struct("MultiSigPublicKey", {
|
|
293
|
+
pk_map: bcs.vector(MultiSigPkMap),
|
|
294
|
+
threshold: bcs.u16()
|
|
295
|
+
});
|
|
296
|
+
var MultiSig = bcs.struct("MultiSig", {
|
|
297
|
+
sigs: bcs.vector(CompressedSignature),
|
|
298
|
+
bitmap: bcs.u16(),
|
|
299
|
+
multisig_pk: MultiSigPublicKey
|
|
300
|
+
});
|
|
301
|
+
var base64String = bcs.byteVector().transform({
|
|
302
|
+
input: (val) => typeof val === "string" ? fromBase64(val) : val,
|
|
303
|
+
output: (val) => toBase64(new Uint8Array(val))
|
|
304
|
+
});
|
|
305
|
+
var SenderSignedTransaction = bcs.struct("SenderSignedTransaction", {
|
|
306
|
+
intentMessage: IntentMessage(TransactionData),
|
|
307
|
+
txSignatures: bcs.vector(base64String)
|
|
308
|
+
});
|
|
309
|
+
var SenderSignedData = bcs.vector(SenderSignedTransaction, { name: "SenderSignedData" });
|
|
310
|
+
var PasskeyAuthenticator = bcs.struct("PasskeyAuthenticator", {
|
|
311
|
+
authenticatorData: bcs.byteVector(),
|
|
312
|
+
clientDataJson: bcs.string(),
|
|
313
|
+
userSignature: bcs.byteVector()
|
|
314
|
+
});
|
|
315
|
+
var MoveObjectType = bcs.enum("MoveObjectType", {
|
|
316
|
+
Other: StructTag,
|
|
317
|
+
GasCoin: null,
|
|
318
|
+
StakedSui: null,
|
|
319
|
+
Coin: TypeTag,
|
|
320
|
+
AccumulatorBalanceWrapper: null
|
|
321
|
+
});
|
|
322
|
+
var TypeOrigin = bcs.struct("TypeOrigin", {
|
|
323
|
+
moduleName: bcs.string(),
|
|
324
|
+
datatypeName: bcs.string(),
|
|
325
|
+
package: Address
|
|
326
|
+
});
|
|
327
|
+
var UpgradeInfo = bcs.struct("UpgradeInfo", {
|
|
328
|
+
upgradedId: Address,
|
|
329
|
+
upgradedVersion: bcs.u64()
|
|
330
|
+
});
|
|
331
|
+
var MovePackage = bcs.struct("MovePackage", {
|
|
332
|
+
id: Address,
|
|
333
|
+
version: bcs.u64(),
|
|
334
|
+
moduleMap: bcs.map(bcs.string(), bcs.byteVector()),
|
|
335
|
+
typeOriginTable: bcs.vector(TypeOrigin),
|
|
336
|
+
linkageTable: bcs.map(Address, UpgradeInfo)
|
|
337
|
+
});
|
|
338
|
+
var MoveObject = bcs.struct("MoveObject", {
|
|
339
|
+
type: MoveObjectType,
|
|
340
|
+
hasPublicTransfer: bcs.bool(),
|
|
341
|
+
version: bcs.u64(),
|
|
342
|
+
contents: bcs.byteVector()
|
|
343
|
+
});
|
|
344
|
+
var Data = bcs.enum("Data", {
|
|
345
|
+
Move: MoveObject,
|
|
346
|
+
Package: MovePackage
|
|
347
|
+
});
|
|
348
|
+
var ObjectInner = bcs.struct("ObjectInner", {
|
|
349
|
+
data: Data,
|
|
350
|
+
owner: Owner,
|
|
351
|
+
previousTransaction: ObjectDigest,
|
|
352
|
+
storageRebate: bcs.u64()
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/bcs/effects.mjs
|
|
356
|
+
var PackageUpgradeError = bcs.enum("PackageUpgradeError", {
|
|
357
|
+
UnableToFetchPackage: bcs.struct("UnableToFetchPackage", { packageId: Address }),
|
|
358
|
+
NotAPackage: bcs.struct("NotAPackage", { objectId: Address }),
|
|
359
|
+
IncompatibleUpgrade: null,
|
|
360
|
+
DigestDoesNotMatch: bcs.struct("DigestDoesNotMatch", { digest: bcs.byteVector() }),
|
|
361
|
+
UnknownUpgradePolicy: bcs.struct("UnknownUpgradePolicy", { policy: bcs.u8() }),
|
|
362
|
+
PackageIDDoesNotMatch: bcs.struct("PackageIDDoesNotMatch", {
|
|
363
|
+
packageId: Address,
|
|
364
|
+
ticketId: Address
|
|
365
|
+
})
|
|
366
|
+
});
|
|
367
|
+
var ModuleId = bcs.struct("ModuleId", {
|
|
368
|
+
address: Address,
|
|
369
|
+
name: bcs.string()
|
|
370
|
+
});
|
|
371
|
+
var MoveLocation = bcs.struct("MoveLocation", {
|
|
372
|
+
module: ModuleId,
|
|
373
|
+
function: bcs.u16(),
|
|
374
|
+
instruction: bcs.u16(),
|
|
375
|
+
functionName: bcs.option(bcs.string())
|
|
376
|
+
});
|
|
377
|
+
var CommandArgumentError = bcs.enum("CommandArgumentError", {
|
|
378
|
+
TypeMismatch: null,
|
|
379
|
+
InvalidBCSBytes: null,
|
|
380
|
+
InvalidUsageOfPureArg: null,
|
|
381
|
+
InvalidArgumentToPrivateEntryFunction: null,
|
|
382
|
+
IndexOutOfBounds: bcs.struct("IndexOutOfBounds", { idx: bcs.u16() }),
|
|
383
|
+
SecondaryIndexOutOfBounds: bcs.struct("SecondaryIndexOutOfBounds", {
|
|
384
|
+
resultIdx: bcs.u16(),
|
|
385
|
+
secondaryIdx: bcs.u16()
|
|
386
|
+
}),
|
|
387
|
+
InvalidResultArity: bcs.struct("InvalidResultArity", { resultIdx: bcs.u16() }),
|
|
388
|
+
InvalidGasCoinUsage: null,
|
|
389
|
+
InvalidValueUsage: null,
|
|
390
|
+
InvalidObjectByValue: null,
|
|
391
|
+
InvalidObjectByMutRef: null,
|
|
392
|
+
SharedObjectOperationNotAllowed: null,
|
|
393
|
+
InvalidArgumentArity: null,
|
|
394
|
+
InvalidTransferObject: null,
|
|
395
|
+
InvalidMakeMoveVecNonObjectArgument: null,
|
|
396
|
+
ArgumentWithoutValue: null,
|
|
397
|
+
CannotMoveBorrowedValue: null,
|
|
398
|
+
CannotWriteToExtendedReference: null,
|
|
399
|
+
InvalidReferenceArgument: null
|
|
400
|
+
});
|
|
401
|
+
var TypeArgumentError = bcs.enum("TypeArgumentError", {
|
|
402
|
+
TypeNotFound: null,
|
|
403
|
+
ConstraintNotSatisfied: null
|
|
404
|
+
});
|
|
405
|
+
var ExecutionFailureStatus = bcs.enum("ExecutionFailureStatus", {
|
|
406
|
+
InsufficientGas: null,
|
|
407
|
+
InvalidGasObject: null,
|
|
408
|
+
InvariantViolation: null,
|
|
409
|
+
FeatureNotYetSupported: null,
|
|
410
|
+
MoveObjectTooBig: bcs.struct("MoveObjectTooBig", {
|
|
411
|
+
objectSize: bcs.u64(),
|
|
412
|
+
maxObjectSize: bcs.u64()
|
|
413
|
+
}),
|
|
414
|
+
MovePackageTooBig: bcs.struct("MovePackageTooBig", {
|
|
415
|
+
objectSize: bcs.u64(),
|
|
416
|
+
maxObjectSize: bcs.u64()
|
|
417
|
+
}),
|
|
418
|
+
CircularObjectOwnership: bcs.struct("CircularObjectOwnership", { object: Address }),
|
|
419
|
+
InsufficientCoinBalance: null,
|
|
420
|
+
CoinBalanceOverflow: null,
|
|
421
|
+
PublishErrorNonZeroAddress: null,
|
|
422
|
+
SuiMoveVerificationError: null,
|
|
423
|
+
MovePrimitiveRuntimeError: bcs.option(MoveLocation),
|
|
424
|
+
MoveAbort: bcs.tuple([MoveLocation, bcs.u64()]),
|
|
425
|
+
VMVerificationOrDeserializationError: null,
|
|
426
|
+
VMInvariantViolation: null,
|
|
427
|
+
FunctionNotFound: null,
|
|
428
|
+
ArityMismatch: null,
|
|
429
|
+
TypeArityMismatch: null,
|
|
430
|
+
NonEntryFunctionInvoked: null,
|
|
431
|
+
CommandArgumentError: bcs.struct("CommandArgumentError", {
|
|
432
|
+
argIdx: bcs.u16(),
|
|
433
|
+
kind: CommandArgumentError
|
|
434
|
+
}),
|
|
435
|
+
TypeArgumentError: bcs.struct("TypeArgumentError", {
|
|
436
|
+
argumentIdx: bcs.u16(),
|
|
437
|
+
kind: TypeArgumentError
|
|
438
|
+
}),
|
|
439
|
+
UnusedValueWithoutDrop: bcs.struct("UnusedValueWithoutDrop", {
|
|
440
|
+
resultIdx: bcs.u16(),
|
|
441
|
+
secondaryIdx: bcs.u16()
|
|
442
|
+
}),
|
|
443
|
+
InvalidPublicFunctionReturnType: bcs.struct("InvalidPublicFunctionReturnType", { idx: bcs.u16() }),
|
|
444
|
+
InvalidTransferObject: null,
|
|
445
|
+
EffectsTooLarge: bcs.struct("EffectsTooLarge", {
|
|
446
|
+
currentSize: bcs.u64(),
|
|
447
|
+
maxSize: bcs.u64()
|
|
448
|
+
}),
|
|
449
|
+
PublishUpgradeMissingDependency: null,
|
|
450
|
+
PublishUpgradeDependencyDowngrade: null,
|
|
451
|
+
PackageUpgradeError: bcs.struct("PackageUpgradeError", { upgradeError: PackageUpgradeError }),
|
|
452
|
+
WrittenObjectsTooLarge: bcs.struct("WrittenObjectsTooLarge", {
|
|
453
|
+
currentSize: bcs.u64(),
|
|
454
|
+
maxSize: bcs.u64()
|
|
455
|
+
}),
|
|
456
|
+
CertificateDenied: null,
|
|
457
|
+
SuiMoveVerificationTimedout: null,
|
|
458
|
+
SharedObjectOperationNotAllowed: null,
|
|
459
|
+
InputObjectDeleted: null,
|
|
460
|
+
ExecutionCancelledDueToSharedObjectCongestion: bcs.struct("ExecutionCancelledDueToSharedObjectCongestion", { congested_objects: bcs.vector(Address) }),
|
|
461
|
+
AddressDeniedForCoin: bcs.struct("AddressDeniedForCoin", {
|
|
462
|
+
address: Address,
|
|
463
|
+
coinType: bcs.string()
|
|
464
|
+
}),
|
|
465
|
+
CoinTypeGlobalPause: bcs.struct("CoinTypeGlobalPause", { coinType: bcs.string() }),
|
|
466
|
+
ExecutionCancelledDueToRandomnessUnavailable: null,
|
|
467
|
+
MoveVectorElemTooBig: bcs.struct("MoveVectorElemTooBig", {
|
|
468
|
+
valueSize: bcs.u64(),
|
|
469
|
+
maxScaledSize: bcs.u64()
|
|
470
|
+
}),
|
|
471
|
+
MoveRawValueTooBig: bcs.struct("MoveRawValueTooBig", {
|
|
472
|
+
valueSize: bcs.u64(),
|
|
473
|
+
maxScaledSize: bcs.u64()
|
|
474
|
+
}),
|
|
475
|
+
InvalidLinkage: null,
|
|
476
|
+
InsufficientBalanceForWithdraw: null,
|
|
477
|
+
NonExclusiveWriteInputObjectModified: bcs.struct("NonExclusiveWriteInputObjectModified", { id: Address })
|
|
478
|
+
});
|
|
479
|
+
var ExecutionStatus = bcs.enum("ExecutionStatus", {
|
|
480
|
+
Success: null,
|
|
481
|
+
Failure: bcs.struct("Failure", {
|
|
482
|
+
error: ExecutionFailureStatus,
|
|
483
|
+
command: bcs.option(bcs.u64())
|
|
484
|
+
})
|
|
485
|
+
});
|
|
486
|
+
var GasCostSummary = bcs.struct("GasCostSummary", {
|
|
487
|
+
computationCost: bcs.u64(),
|
|
488
|
+
storageCost: bcs.u64(),
|
|
489
|
+
storageRebate: bcs.u64(),
|
|
490
|
+
nonRefundableStorageFee: bcs.u64()
|
|
491
|
+
});
|
|
492
|
+
var TransactionEffectsV1 = bcs.struct("TransactionEffectsV1", {
|
|
493
|
+
status: ExecutionStatus,
|
|
494
|
+
executedEpoch: bcs.u64(),
|
|
495
|
+
gasUsed: GasCostSummary,
|
|
496
|
+
modifiedAtVersions: bcs.vector(bcs.tuple([Address, bcs.u64()])),
|
|
497
|
+
sharedObjects: bcs.vector(SuiObjectRef),
|
|
498
|
+
transactionDigest: ObjectDigest,
|
|
499
|
+
created: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),
|
|
500
|
+
mutated: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),
|
|
501
|
+
unwrapped: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),
|
|
502
|
+
deleted: bcs.vector(SuiObjectRef),
|
|
503
|
+
unwrappedThenDeleted: bcs.vector(SuiObjectRef),
|
|
504
|
+
wrapped: bcs.vector(SuiObjectRef),
|
|
505
|
+
gasObject: bcs.tuple([SuiObjectRef, Owner]),
|
|
506
|
+
eventsDigest: bcs.option(ObjectDigest),
|
|
507
|
+
dependencies: bcs.vector(ObjectDigest)
|
|
508
|
+
});
|
|
509
|
+
var VersionDigest = bcs.tuple([bcs.u64(), ObjectDigest]);
|
|
510
|
+
var ObjectIn = bcs.enum("ObjectIn", {
|
|
511
|
+
NotExist: null,
|
|
512
|
+
Exist: bcs.tuple([VersionDigest, Owner])
|
|
513
|
+
});
|
|
514
|
+
var AccumulatorAddress = bcs.struct("AccumulatorAddress", {
|
|
515
|
+
address: Address,
|
|
516
|
+
ty: TypeTag
|
|
517
|
+
});
|
|
518
|
+
var AccumulatorOperation = bcs.enum("AccumulatorOperation", {
|
|
519
|
+
Merge: null,
|
|
520
|
+
Split: null
|
|
521
|
+
});
|
|
522
|
+
var AccumulatorValue = bcs.enum("AccumulatorValue", {
|
|
523
|
+
Integer: bcs.u64(),
|
|
524
|
+
IntegerTuple: bcs.tuple([bcs.u64(), bcs.u64()]),
|
|
525
|
+
EventDigest: bcs.vector(bcs.tuple([bcs.u64(), ObjectDigest]))
|
|
526
|
+
});
|
|
527
|
+
var AccumulatorWriteV1 = bcs.struct("AccumulatorWriteV1", {
|
|
528
|
+
address: AccumulatorAddress,
|
|
529
|
+
operation: AccumulatorOperation,
|
|
530
|
+
value: AccumulatorValue
|
|
531
|
+
});
|
|
532
|
+
var ObjectOut = bcs.enum("ObjectOut", {
|
|
533
|
+
NotExist: null,
|
|
534
|
+
ObjectWrite: bcs.tuple([ObjectDigest, Owner]),
|
|
535
|
+
PackageWrite: VersionDigest,
|
|
536
|
+
AccumulatorWriteV1
|
|
537
|
+
});
|
|
538
|
+
var IDOperation = bcs.enum("IDOperation", {
|
|
539
|
+
None: null,
|
|
540
|
+
Created: null,
|
|
541
|
+
Deleted: null
|
|
542
|
+
});
|
|
543
|
+
var EffectsObjectChange = bcs.struct("EffectsObjectChange", {
|
|
544
|
+
inputState: ObjectIn,
|
|
545
|
+
outputState: ObjectOut,
|
|
546
|
+
idOperation: IDOperation
|
|
547
|
+
});
|
|
548
|
+
var UnchangedConsensusKind = bcs.enum("UnchangedConsensusKind", {
|
|
549
|
+
ReadOnlyRoot: VersionDigest,
|
|
550
|
+
MutateConsensusStreamEnded: bcs.u64(),
|
|
551
|
+
ReadConsensusStreamEnded: bcs.u64(),
|
|
552
|
+
Cancelled: bcs.u64(),
|
|
553
|
+
PerEpochConfig: null
|
|
554
|
+
});
|
|
555
|
+
var TransactionEffectsV2 = bcs.struct("TransactionEffectsV2", {
|
|
556
|
+
status: ExecutionStatus,
|
|
557
|
+
executedEpoch: bcs.u64(),
|
|
558
|
+
gasUsed: GasCostSummary,
|
|
559
|
+
transactionDigest: ObjectDigest,
|
|
560
|
+
gasObjectIndex: bcs.option(bcs.u32()),
|
|
561
|
+
eventsDigest: bcs.option(ObjectDigest),
|
|
562
|
+
dependencies: bcs.vector(ObjectDigest),
|
|
563
|
+
lamportVersion: bcs.u64(),
|
|
564
|
+
changedObjects: bcs.vector(bcs.tuple([Address, EffectsObjectChange])),
|
|
565
|
+
unchangedConsensusObjects: bcs.vector(bcs.tuple([Address, UnchangedConsensusKind])),
|
|
566
|
+
auxDataDigest: bcs.option(ObjectDigest)
|
|
567
|
+
});
|
|
568
|
+
var TransactionEffects = bcs.enum("TransactionEffects", {
|
|
569
|
+
V1: TransactionEffectsV1,
|
|
570
|
+
V2: TransactionEffectsV2
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/bcs/pure.mjs
|
|
574
|
+
function pureBcsSchemaFromTypeName(name) {
|
|
575
|
+
switch (name) {
|
|
576
|
+
case "u8":
|
|
577
|
+
return bcs.u8();
|
|
578
|
+
case "u16":
|
|
579
|
+
return bcs.u16();
|
|
580
|
+
case "u32":
|
|
581
|
+
return bcs.u32();
|
|
582
|
+
case "u64":
|
|
583
|
+
return bcs.u64();
|
|
584
|
+
case "u128":
|
|
585
|
+
return bcs.u128();
|
|
586
|
+
case "u256":
|
|
587
|
+
return bcs.u256();
|
|
588
|
+
case "bool":
|
|
589
|
+
return bcs.bool();
|
|
590
|
+
case "string":
|
|
591
|
+
return bcs.string();
|
|
592
|
+
case "id":
|
|
593
|
+
case "address":
|
|
594
|
+
return Address;
|
|
595
|
+
}
|
|
596
|
+
const generic = name.match(/^(vector|option)<(.+)>$/);
|
|
597
|
+
if (generic) {
|
|
598
|
+
const [kind, inner] = generic.slice(1);
|
|
599
|
+
if (kind === "vector") return bcs.vector(pureBcsSchemaFromTypeName(inner));
|
|
600
|
+
else return bcs.option(pureBcsSchemaFromTypeName(inner));
|
|
601
|
+
}
|
|
602
|
+
throw new Error(`Invalid Pure type name: ${name}`);
|
|
236
603
|
}
|
|
604
|
+
|
|
605
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/bcs/index.mjs
|
|
606
|
+
var suiBcs = {
|
|
607
|
+
...bcs,
|
|
608
|
+
U8: bcs.u8(),
|
|
609
|
+
U16: bcs.u16(),
|
|
610
|
+
U32: bcs.u32(),
|
|
611
|
+
U64: bcs.u64(),
|
|
612
|
+
U128: bcs.u128(),
|
|
613
|
+
U256: bcs.u256(),
|
|
614
|
+
ULEB128: bcs.uleb128(),
|
|
615
|
+
Bool: bcs.bool(),
|
|
616
|
+
String: bcs.string(),
|
|
617
|
+
Address,
|
|
618
|
+
AppId,
|
|
619
|
+
Argument,
|
|
620
|
+
CallArg,
|
|
621
|
+
Command,
|
|
622
|
+
CompressedSignature,
|
|
623
|
+
Data,
|
|
624
|
+
GasData,
|
|
625
|
+
Intent,
|
|
626
|
+
IntentMessage,
|
|
627
|
+
IntentScope,
|
|
628
|
+
IntentVersion,
|
|
629
|
+
MoveObject,
|
|
630
|
+
MoveObjectType,
|
|
631
|
+
MovePackage,
|
|
632
|
+
MultiSig,
|
|
633
|
+
MultiSigPkMap,
|
|
634
|
+
MultiSigPublicKey,
|
|
635
|
+
Object: ObjectInner,
|
|
636
|
+
ObjectArg,
|
|
637
|
+
ObjectDigest,
|
|
638
|
+
Owner,
|
|
639
|
+
PasskeyAuthenticator,
|
|
640
|
+
ProgrammableMoveCall,
|
|
641
|
+
ProgrammableTransaction,
|
|
642
|
+
PublicKey,
|
|
643
|
+
SenderSignedData,
|
|
644
|
+
SenderSignedTransaction,
|
|
645
|
+
SharedObjectRef,
|
|
646
|
+
StructTag,
|
|
647
|
+
SuiObjectRef,
|
|
648
|
+
TransactionData,
|
|
649
|
+
TransactionDataV1,
|
|
650
|
+
TransactionEffects,
|
|
651
|
+
TransactionExpiration,
|
|
652
|
+
TransactionKind,
|
|
653
|
+
TypeOrigin,
|
|
654
|
+
TypeTag,
|
|
655
|
+
UpgradeInfo
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/utils/constants.mjs
|
|
659
|
+
var MIST_PER_SUI = BigInt(1e9);
|
|
660
|
+
var MOVE_STDLIB_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000001";
|
|
661
|
+
var SUI_FRAMEWORK_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
662
|
+
var SUI_CLOCK_OBJECT_ID = "0x0000000000000000000000000000000000000000000000000000000000000006";
|
|
663
|
+
var SUI_TYPE_ARG = `${SUI_FRAMEWORK_ADDRESS}::sui::SUI`;
|
|
664
|
+
var SUI_SYSTEM_STATE_OBJECT_ID = "0x0000000000000000000000000000000000000000000000000000000000000005";
|
|
665
|
+
var SUI_RANDOM_OBJECT_ID = "0x0000000000000000000000000000000000000000000000000000000000000008";
|
|
666
|
+
var SUI_DENY_LIST_OBJECT_ID = "0x0000000000000000000000000000000000000000000000000000000000000403";
|
|
667
|
+
|
|
668
|
+
// ../../node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.mjs
|
|
669
|
+
var store$4;
|
|
237
670
|
// @__NO_SIDE_EFFECTS__
|
|
238
|
-
function
|
|
671
|
+
function getGlobalConfig(config$1) {
|
|
239
672
|
return {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
async: false,
|
|
245
|
-
message: message$1,
|
|
246
|
-
get "~standard"() {
|
|
247
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
248
|
-
},
|
|
249
|
-
"~run"(dataset, config$1) {
|
|
250
|
-
if (typeof dataset.value === "boolean") dataset.typed = true;
|
|
251
|
-
else _addIssue(this, "type", dataset, config$1);
|
|
252
|
-
return dataset;
|
|
253
|
-
}
|
|
673
|
+
lang: config$1?.lang ?? store$4?.lang,
|
|
674
|
+
message: config$1?.message,
|
|
675
|
+
abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
|
|
676
|
+
abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
|
|
254
677
|
};
|
|
255
678
|
}
|
|
679
|
+
var store$3;
|
|
256
680
|
// @__NO_SIDE_EFFECTS__
|
|
257
|
-
function
|
|
258
|
-
return
|
|
259
|
-
kind: "schema",
|
|
260
|
-
type: "lazy",
|
|
261
|
-
reference: lazy,
|
|
262
|
-
expects: "unknown",
|
|
263
|
-
async: false,
|
|
264
|
-
getter,
|
|
265
|
-
get "~standard"() {
|
|
266
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
267
|
-
},
|
|
268
|
-
"~run"(dataset, config$1) {
|
|
269
|
-
return this.getter(dataset.value)["~run"](dataset, config$1);
|
|
270
|
-
}
|
|
271
|
-
};
|
|
681
|
+
function getGlobalMessage(lang) {
|
|
682
|
+
return store$3?.get(lang);
|
|
272
683
|
}
|
|
684
|
+
var store$2;
|
|
273
685
|
// @__NO_SIDE_EFFECTS__
|
|
274
|
-
function
|
|
275
|
-
return
|
|
276
|
-
kind: "schema",
|
|
277
|
-
type: "literal",
|
|
278
|
-
reference: literal,
|
|
279
|
-
expects: /* @__PURE__ */ _stringify(literal_),
|
|
280
|
-
async: false,
|
|
281
|
-
literal: literal_,
|
|
282
|
-
message: message$1,
|
|
283
|
-
get "~standard"() {
|
|
284
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
285
|
-
},
|
|
286
|
-
"~run"(dataset, config$1) {
|
|
287
|
-
if (dataset.value === this.literal) dataset.typed = true;
|
|
288
|
-
else _addIssue(this, "type", dataset, config$1);
|
|
289
|
-
return dataset;
|
|
290
|
-
}
|
|
291
|
-
};
|
|
686
|
+
function getSchemaMessage(lang) {
|
|
687
|
+
return store$2?.get(lang);
|
|
292
688
|
}
|
|
689
|
+
var store$1;
|
|
293
690
|
// @__NO_SIDE_EFFECTS__
|
|
294
|
-
function
|
|
295
|
-
return
|
|
296
|
-
kind: "schema",
|
|
297
|
-
type: "nullable",
|
|
298
|
-
reference: nullable,
|
|
299
|
-
expects: `(${wrapped.expects} | null)`,
|
|
300
|
-
async: false,
|
|
301
|
-
wrapped,
|
|
302
|
-
default: default_,
|
|
303
|
-
get "~standard"() {
|
|
304
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
305
|
-
},
|
|
306
|
-
"~run"(dataset, config$1) {
|
|
307
|
-
if (dataset.value === null) {
|
|
308
|
-
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
309
|
-
if (dataset.value === null) {
|
|
310
|
-
dataset.typed = true;
|
|
311
|
-
return dataset;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return this.wrapped["~run"](dataset, config$1);
|
|
315
|
-
}
|
|
316
|
-
};
|
|
691
|
+
function getSpecificMessage(reference, lang) {
|
|
692
|
+
return store$1?.get(reference)?.get(lang);
|
|
317
693
|
}
|
|
318
694
|
// @__NO_SIDE_EFFECTS__
|
|
319
|
-
function
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
695
|
+
function _stringify(input) {
|
|
696
|
+
const type = typeof input;
|
|
697
|
+
if (type === "string") return `"${input}"`;
|
|
698
|
+
if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
|
|
699
|
+
if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
|
|
700
|
+
return type;
|
|
701
|
+
}
|
|
702
|
+
function _addIssue(context, label, dataset, config$1, other) {
|
|
703
|
+
const input = other && "input" in other ? other.input : dataset.value;
|
|
704
|
+
const expected = other?.expected ?? context.expects ?? null;
|
|
705
|
+
const received = other?.received ?? /* @__PURE__ */ _stringify(input);
|
|
706
|
+
const issue = {
|
|
707
|
+
kind: context.kind,
|
|
708
|
+
type: context.type,
|
|
709
|
+
input,
|
|
710
|
+
expected,
|
|
711
|
+
received,
|
|
712
|
+
message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
|
|
713
|
+
requirement: context.requirement,
|
|
714
|
+
path: other?.path,
|
|
715
|
+
issues: other?.issues,
|
|
716
|
+
lang: config$1.lang,
|
|
717
|
+
abortEarly: config$1.abortEarly,
|
|
718
|
+
abortPipeEarly: config$1.abortPipeEarly
|
|
341
719
|
};
|
|
720
|
+
const isSchema = context.kind === "schema";
|
|
721
|
+
const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
|
|
722
|
+
if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
|
|
723
|
+
if (isSchema) dataset.typed = false;
|
|
724
|
+
if (dataset.issues) dataset.issues.push(issue);
|
|
725
|
+
else dataset.issues = [issue];
|
|
342
726
|
}
|
|
343
727
|
// @__NO_SIDE_EFFECTS__
|
|
344
|
-
function
|
|
728
|
+
function _getStandardProps(context) {
|
|
345
729
|
return {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
async: false,
|
|
351
|
-
message: message$1,
|
|
352
|
-
get "~standard"() {
|
|
353
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
354
|
-
},
|
|
355
|
-
"~run"(dataset, config$1) {
|
|
356
|
-
if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
|
|
357
|
-
else _addIssue(this, "type", dataset, config$1);
|
|
358
|
-
return dataset;
|
|
730
|
+
version: 1,
|
|
731
|
+
vendor: "valibot",
|
|
732
|
+
validate(value$1) {
|
|
733
|
+
return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
|
|
359
734
|
}
|
|
360
735
|
};
|
|
361
736
|
}
|
|
362
737
|
// @__NO_SIDE_EFFECTS__
|
|
363
|
-
function object
|
|
738
|
+
function _isValidObjectKey(object$1, key) {
|
|
739
|
+
return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
|
|
740
|
+
}
|
|
741
|
+
// @__NO_SIDE_EFFECTS__
|
|
742
|
+
function _joinExpects(values$1, separator) {
|
|
743
|
+
const list = [...new Set(values$1)];
|
|
744
|
+
if (list.length > 1) return `(${list.join(` ${separator} `)})`;
|
|
745
|
+
return list[0] ?? "never";
|
|
746
|
+
}
|
|
747
|
+
var ValiError = class extends Error {
|
|
748
|
+
/**
|
|
749
|
+
* Creates a Valibot error with useful information.
|
|
750
|
+
*
|
|
751
|
+
* @param issues The error issues.
|
|
752
|
+
*/
|
|
753
|
+
constructor(issues) {
|
|
754
|
+
super(issues[0].message);
|
|
755
|
+
this.name = "ValiError";
|
|
756
|
+
this.issues = issues;
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
// @__NO_SIDE_EFFECTS__
|
|
760
|
+
function check(requirement, message$1) {
|
|
364
761
|
return {
|
|
365
|
-
kind: "
|
|
366
|
-
type: "
|
|
367
|
-
reference:
|
|
368
|
-
expects: "Object",
|
|
762
|
+
kind: "validation",
|
|
763
|
+
type: "check",
|
|
764
|
+
reference: check,
|
|
369
765
|
async: false,
|
|
370
|
-
|
|
766
|
+
expects: null,
|
|
767
|
+
requirement,
|
|
371
768
|
message: message$1,
|
|
372
|
-
get "~standard"() {
|
|
373
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
374
|
-
},
|
|
375
769
|
"~run"(dataset, config$1) {
|
|
376
|
-
|
|
377
|
-
if (input && typeof input === "object") {
|
|
378
|
-
dataset.typed = true;
|
|
379
|
-
dataset.value = {};
|
|
380
|
-
for (const key in this.entries) {
|
|
381
|
-
const valueSchema = this.entries[key];
|
|
382
|
-
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
383
|
-
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
384
|
-
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
385
|
-
if (valueDataset.issues) {
|
|
386
|
-
const pathItem = {
|
|
387
|
-
type: "object",
|
|
388
|
-
origin: "value",
|
|
389
|
-
input,
|
|
390
|
-
key,
|
|
391
|
-
value: value$1
|
|
392
|
-
};
|
|
393
|
-
for (const issue of valueDataset.issues) {
|
|
394
|
-
if (issue.path) issue.path.unshift(pathItem);
|
|
395
|
-
else issue.path = [pathItem];
|
|
396
|
-
dataset.issues?.push(issue);
|
|
397
|
-
}
|
|
398
|
-
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
399
|
-
if (config$1.abortEarly) {
|
|
400
|
-
dataset.typed = false;
|
|
401
|
-
break;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
if (!valueDataset.typed) dataset.typed = false;
|
|
405
|
-
dataset.value[key] = valueDataset.value;
|
|
406
|
-
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
407
|
-
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
408
|
-
_addIssue(this, "key", dataset, config$1, {
|
|
409
|
-
input: void 0,
|
|
410
|
-
expected: `"${key}"`,
|
|
411
|
-
path: [{
|
|
412
|
-
type: "object",
|
|
413
|
-
origin: "key",
|
|
414
|
-
input,
|
|
415
|
-
key,
|
|
416
|
-
value: input[key]
|
|
417
|
-
}]
|
|
418
|
-
});
|
|
419
|
-
if (config$1.abortEarly) break;
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
} else _addIssue(this, "type", dataset, config$1);
|
|
770
|
+
if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1);
|
|
423
771
|
return dataset;
|
|
424
772
|
}
|
|
425
773
|
};
|
|
426
774
|
}
|
|
427
775
|
// @__NO_SIDE_EFFECTS__
|
|
428
|
-
function
|
|
776
|
+
function integer(message$1) {
|
|
429
777
|
return {
|
|
430
|
-
kind: "
|
|
431
|
-
type: "
|
|
432
|
-
reference:
|
|
433
|
-
expects: `(${wrapped.expects} | undefined)`,
|
|
778
|
+
kind: "validation",
|
|
779
|
+
type: "integer",
|
|
780
|
+
reference: integer,
|
|
434
781
|
async: false,
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
439
|
-
},
|
|
782
|
+
expects: null,
|
|
783
|
+
requirement: Number.isInteger,
|
|
784
|
+
message: message$1,
|
|
440
785
|
"~run"(dataset, config$1) {
|
|
441
|
-
if (dataset.value
|
|
442
|
-
|
|
443
|
-
if (dataset.value === void 0) {
|
|
444
|
-
dataset.typed = true;
|
|
445
|
-
return dataset;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
return this.wrapped["~run"](dataset, config$1);
|
|
786
|
+
if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1);
|
|
787
|
+
return dataset;
|
|
449
788
|
}
|
|
450
789
|
};
|
|
451
790
|
}
|
|
452
791
|
// @__NO_SIDE_EFFECTS__
|
|
453
|
-
function
|
|
792
|
+
function transform(operation) {
|
|
454
793
|
return {
|
|
455
|
-
kind: "
|
|
456
|
-
type: "
|
|
457
|
-
reference:
|
|
458
|
-
expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"),
|
|
794
|
+
kind: "transformation",
|
|
795
|
+
type: "transform",
|
|
796
|
+
reference: transform,
|
|
459
797
|
async: false,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
464
|
-
},
|
|
465
|
-
"~run"(dataset, config$1) {
|
|
466
|
-
if (this.options.includes(dataset.value)) dataset.typed = true;
|
|
467
|
-
else _addIssue(this, "type", dataset, config$1);
|
|
798
|
+
operation,
|
|
799
|
+
"~run"(dataset) {
|
|
800
|
+
dataset.value = this.operation(dataset.value);
|
|
468
801
|
return dataset;
|
|
469
802
|
}
|
|
470
803
|
};
|
|
471
804
|
}
|
|
472
805
|
// @__NO_SIDE_EFFECTS__
|
|
473
|
-
function
|
|
806
|
+
function getFallback(schema, dataset, config$1) {
|
|
807
|
+
return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
|
|
808
|
+
}
|
|
809
|
+
// @__NO_SIDE_EFFECTS__
|
|
810
|
+
function getDefault(schema, dataset, config$1) {
|
|
811
|
+
return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
|
|
812
|
+
}
|
|
813
|
+
// @__NO_SIDE_EFFECTS__
|
|
814
|
+
function is(schema, input) {
|
|
815
|
+
return !schema["~run"]({ value: input }, { abortEarly: true }).issues;
|
|
816
|
+
}
|
|
817
|
+
// @__NO_SIDE_EFFECTS__
|
|
818
|
+
function array(item, message$1) {
|
|
474
819
|
return {
|
|
475
820
|
kind: "schema",
|
|
476
|
-
type: "
|
|
477
|
-
reference:
|
|
478
|
-
expects: "
|
|
821
|
+
type: "array",
|
|
822
|
+
reference: array,
|
|
823
|
+
expects: "Array",
|
|
479
824
|
async: false,
|
|
480
|
-
|
|
481
|
-
value: value$1,
|
|
825
|
+
item,
|
|
482
826
|
message: message$1,
|
|
483
827
|
get "~standard"() {
|
|
484
828
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
485
829
|
},
|
|
486
830
|
"~run"(dataset, config$1) {
|
|
487
831
|
const input = dataset.value;
|
|
488
|
-
if (input
|
|
832
|
+
if (Array.isArray(input)) {
|
|
489
833
|
dataset.typed = true;
|
|
490
|
-
dataset.value =
|
|
491
|
-
for (
|
|
492
|
-
const
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
495
|
-
const pathItem = {
|
|
496
|
-
type: "object",
|
|
497
|
-
origin: "key",
|
|
498
|
-
input,
|
|
499
|
-
key: entryKey,
|
|
500
|
-
value: entryValue
|
|
501
|
-
};
|
|
502
|
-
for (const issue of keyDataset.issues) {
|
|
503
|
-
issue.path = [pathItem];
|
|
504
|
-
dataset.issues?.push(issue);
|
|
505
|
-
}
|
|
506
|
-
if (!dataset.issues) dataset.issues = keyDataset.issues;
|
|
507
|
-
if (config$1.abortEarly) {
|
|
508
|
-
dataset.typed = false;
|
|
509
|
-
break;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
const valueDataset = this.value["~run"]({ value: entryValue }, config$1);
|
|
513
|
-
if (valueDataset.issues) {
|
|
834
|
+
dataset.value = [];
|
|
835
|
+
for (let key = 0; key < input.length; key++) {
|
|
836
|
+
const value$1 = input[key];
|
|
837
|
+
const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
|
|
838
|
+
if (itemDataset.issues) {
|
|
514
839
|
const pathItem = {
|
|
515
|
-
type: "
|
|
840
|
+
type: "array",
|
|
516
841
|
origin: "value",
|
|
517
842
|
input,
|
|
518
|
-
key
|
|
519
|
-
value:
|
|
843
|
+
key,
|
|
844
|
+
value: value$1
|
|
520
845
|
};
|
|
521
|
-
for (const issue of
|
|
846
|
+
for (const issue of itemDataset.issues) {
|
|
522
847
|
if (issue.path) issue.path.unshift(pathItem);
|
|
523
848
|
else issue.path = [pathItem];
|
|
524
849
|
dataset.issues?.push(issue);
|
|
525
850
|
}
|
|
526
|
-
if (!dataset.issues) dataset.issues =
|
|
851
|
+
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
527
852
|
if (config$1.abortEarly) {
|
|
528
853
|
dataset.typed = false;
|
|
529
854
|
break;
|
|
530
855
|
}
|
|
531
856
|
}
|
|
532
|
-
if (!
|
|
533
|
-
|
|
857
|
+
if (!itemDataset.typed) dataset.typed = false;
|
|
858
|
+
dataset.value.push(itemDataset.value);
|
|
534
859
|
}
|
|
535
860
|
} else _addIssue(this, "type", dataset, config$1);
|
|
536
861
|
return dataset;
|
|
@@ -538,1066 +863,751 @@ function record(key, value$1, message$1) {
|
|
|
538
863
|
};
|
|
539
864
|
}
|
|
540
865
|
// @__NO_SIDE_EFFECTS__
|
|
541
|
-
function
|
|
866
|
+
function bigint(message$1) {
|
|
542
867
|
return {
|
|
543
868
|
kind: "schema",
|
|
544
|
-
type: "
|
|
545
|
-
reference:
|
|
546
|
-
expects: "
|
|
869
|
+
type: "bigint",
|
|
870
|
+
reference: bigint,
|
|
871
|
+
expects: "bigint",
|
|
547
872
|
async: false,
|
|
548
873
|
message: message$1,
|
|
549
874
|
get "~standard"() {
|
|
550
875
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
551
876
|
},
|
|
552
877
|
"~run"(dataset, config$1) {
|
|
553
|
-
if (typeof dataset.value === "
|
|
878
|
+
if (typeof dataset.value === "bigint") dataset.typed = true;
|
|
554
879
|
else _addIssue(this, "type", dataset, config$1);
|
|
555
880
|
return dataset;
|
|
556
881
|
}
|
|
557
882
|
};
|
|
558
883
|
}
|
|
559
884
|
// @__NO_SIDE_EFFECTS__
|
|
560
|
-
function
|
|
885
|
+
function boolean(message$1) {
|
|
561
886
|
return {
|
|
562
887
|
kind: "schema",
|
|
563
|
-
type: "
|
|
564
|
-
reference:
|
|
565
|
-
expects: "
|
|
888
|
+
type: "boolean",
|
|
889
|
+
reference: boolean,
|
|
890
|
+
expects: "boolean",
|
|
566
891
|
async: false,
|
|
567
|
-
items,
|
|
568
892
|
message: message$1,
|
|
569
893
|
get "~standard"() {
|
|
570
894
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
571
895
|
},
|
|
572
896
|
"~run"(dataset, config$1) {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
dataset.typed = true;
|
|
576
|
-
dataset.value = [];
|
|
577
|
-
for (let key = 0; key < this.items.length; key++) {
|
|
578
|
-
const value$1 = input[key];
|
|
579
|
-
const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1);
|
|
580
|
-
if (itemDataset.issues) {
|
|
581
|
-
const pathItem = {
|
|
582
|
-
type: "array",
|
|
583
|
-
origin: "value",
|
|
584
|
-
input,
|
|
585
|
-
key,
|
|
586
|
-
value: value$1
|
|
587
|
-
};
|
|
588
|
-
for (const issue of itemDataset.issues) {
|
|
589
|
-
if (issue.path) issue.path.unshift(pathItem);
|
|
590
|
-
else issue.path = [pathItem];
|
|
591
|
-
dataset.issues?.push(issue);
|
|
592
|
-
}
|
|
593
|
-
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
594
|
-
if (config$1.abortEarly) {
|
|
595
|
-
dataset.typed = false;
|
|
596
|
-
break;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
if (!itemDataset.typed) dataset.typed = false;
|
|
600
|
-
dataset.value.push(itemDataset.value);
|
|
601
|
-
}
|
|
602
|
-
} else _addIssue(this, "type", dataset, config$1);
|
|
897
|
+
if (typeof dataset.value === "boolean") dataset.typed = true;
|
|
898
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
603
899
|
return dataset;
|
|
604
900
|
}
|
|
605
901
|
};
|
|
606
902
|
}
|
|
607
903
|
// @__NO_SIDE_EFFECTS__
|
|
608
|
-
function
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
904
|
+
function lazy(getter) {
|
|
905
|
+
return {
|
|
906
|
+
kind: "schema",
|
|
907
|
+
type: "lazy",
|
|
908
|
+
reference: lazy,
|
|
909
|
+
expects: "unknown",
|
|
910
|
+
async: false,
|
|
911
|
+
getter,
|
|
912
|
+
get "~standard"() {
|
|
913
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
914
|
+
},
|
|
915
|
+
"~run"(dataset, config$1) {
|
|
916
|
+
return this.getter(dataset.value)["~run"](dataset, config$1);
|
|
917
|
+
}
|
|
918
|
+
};
|
|
613
919
|
}
|
|
614
920
|
// @__NO_SIDE_EFFECTS__
|
|
615
|
-
function
|
|
921
|
+
function literal(literal_, message$1) {
|
|
616
922
|
return {
|
|
617
923
|
kind: "schema",
|
|
618
|
-
type: "
|
|
619
|
-
reference:
|
|
620
|
-
expects: /* @__PURE__ */
|
|
924
|
+
type: "literal",
|
|
925
|
+
reference: literal,
|
|
926
|
+
expects: /* @__PURE__ */ _stringify(literal_),
|
|
621
927
|
async: false,
|
|
622
|
-
|
|
928
|
+
literal: literal_,
|
|
623
929
|
message: message$1,
|
|
624
930
|
get "~standard"() {
|
|
625
931
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
626
932
|
},
|
|
627
933
|
"~run"(dataset, config$1) {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
934
|
+
if (dataset.value === this.literal) dataset.typed = true;
|
|
935
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
936
|
+
return dataset;
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
// @__NO_SIDE_EFFECTS__
|
|
941
|
+
function nullable(wrapped, default_) {
|
|
942
|
+
return {
|
|
943
|
+
kind: "schema",
|
|
944
|
+
type: "nullable",
|
|
945
|
+
reference: nullable,
|
|
946
|
+
expects: `(${wrapped.expects} | null)`,
|
|
947
|
+
async: false,
|
|
948
|
+
wrapped,
|
|
949
|
+
default: default_,
|
|
950
|
+
get "~standard"() {
|
|
951
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
952
|
+
},
|
|
953
|
+
"~run"(dataset, config$1) {
|
|
954
|
+
if (dataset.value === null) {
|
|
955
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
956
|
+
if (dataset.value === null) {
|
|
957
|
+
dataset.typed = true;
|
|
958
|
+
return dataset;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
// @__NO_SIDE_EFFECTS__
|
|
966
|
+
function nullish(wrapped, default_) {
|
|
967
|
+
return {
|
|
968
|
+
kind: "schema",
|
|
969
|
+
type: "nullish",
|
|
970
|
+
reference: nullish,
|
|
971
|
+
expects: `(${wrapped.expects} | null | undefined)`,
|
|
972
|
+
async: false,
|
|
973
|
+
wrapped,
|
|
974
|
+
default: default_,
|
|
975
|
+
get "~standard"() {
|
|
976
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
977
|
+
},
|
|
978
|
+
"~run"(dataset, config$1) {
|
|
979
|
+
if (dataset.value === null || dataset.value === void 0) {
|
|
980
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
981
|
+
if (dataset.value === null || dataset.value === void 0) {
|
|
982
|
+
dataset.typed = true;
|
|
983
|
+
return dataset;
|
|
638
984
|
}
|
|
639
|
-
else if (untypedDatasets) untypedDatasets.push(optionDataset);
|
|
640
|
-
else untypedDatasets = [optionDataset];
|
|
641
985
|
}
|
|
642
|
-
|
|
643
|
-
if (typedDatasets) {
|
|
644
|
-
if (typedDatasets.length === 1) return typedDatasets[0];
|
|
645
|
-
_addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
|
|
646
|
-
dataset.typed = true;
|
|
647
|
-
} else if (untypedDatasets?.length === 1) return untypedDatasets[0];
|
|
648
|
-
else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
|
|
649
|
-
return dataset;
|
|
986
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
650
987
|
}
|
|
651
988
|
};
|
|
652
989
|
}
|
|
653
990
|
// @__NO_SIDE_EFFECTS__
|
|
654
|
-
function
|
|
991
|
+
function number(message$1) {
|
|
655
992
|
return {
|
|
656
993
|
kind: "schema",
|
|
657
|
-
type: "
|
|
658
|
-
reference:
|
|
659
|
-
expects: "
|
|
994
|
+
type: "number",
|
|
995
|
+
reference: number,
|
|
996
|
+
expects: "number",
|
|
660
997
|
async: false,
|
|
998
|
+
message: message$1,
|
|
661
999
|
get "~standard"() {
|
|
662
1000
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
663
1001
|
},
|
|
664
|
-
"~run"(dataset) {
|
|
665
|
-
dataset.typed = true;
|
|
1002
|
+
"~run"(dataset, config$1) {
|
|
1003
|
+
if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
|
|
1004
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
666
1005
|
return dataset;
|
|
667
1006
|
}
|
|
668
1007
|
};
|
|
669
1008
|
}
|
|
670
|
-
function parse(schema, input, config$1) {
|
|
671
|
-
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
|
|
672
|
-
if (dataset.issues) throw new ValiError(dataset.issues);
|
|
673
|
-
return dataset.value;
|
|
674
|
-
}
|
|
675
1009
|
// @__NO_SIDE_EFFECTS__
|
|
676
|
-
function
|
|
1010
|
+
function object(entries$1, message$1) {
|
|
677
1011
|
return {
|
|
678
|
-
|
|
679
|
-
|
|
1012
|
+
kind: "schema",
|
|
1013
|
+
type: "object",
|
|
1014
|
+
reference: object,
|
|
1015
|
+
expects: "Object",
|
|
1016
|
+
async: false,
|
|
1017
|
+
entries: entries$1,
|
|
1018
|
+
message: message$1,
|
|
680
1019
|
get "~standard"() {
|
|
681
1020
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
682
|
-
},
|
|
683
|
-
"~run"(dataset, config$1) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
]))
|
|
735
|
-
})),
|
|
736
|
-
withKind("Result", object({ Result: pipe(number(), integer()) })),
|
|
737
|
-
withKind("NestedResult", object({ NestedResult: tuple([pipe(number(), integer()), pipe(number(), integer())]) }))
|
|
738
|
-
]);
|
|
739
|
-
var GasDataSchema = object({
|
|
740
|
-
budget: nullable(JsonU64),
|
|
741
|
-
price: nullable(JsonU64),
|
|
742
|
-
owner: nullable(SuiAddress),
|
|
743
|
-
payment: nullable(array(ObjectRefSchema))
|
|
744
|
-
});
|
|
745
|
-
var StructTagSchema = object({
|
|
746
|
-
address: string(),
|
|
747
|
-
module: string(),
|
|
748
|
-
name: string(),
|
|
749
|
-
typeParams: array(string())
|
|
750
|
-
});
|
|
751
|
-
var OpenSignatureBodySchema = union([
|
|
752
|
-
object({ $kind: literal("address") }),
|
|
753
|
-
object({ $kind: literal("bool") }),
|
|
754
|
-
object({ $kind: literal("u8") }),
|
|
755
|
-
object({ $kind: literal("u16") }),
|
|
756
|
-
object({ $kind: literal("u32") }),
|
|
757
|
-
object({ $kind: literal("u64") }),
|
|
758
|
-
object({ $kind: literal("u128") }),
|
|
759
|
-
object({ $kind: literal("u256") }),
|
|
760
|
-
object({ $kind: literal("unknown") }),
|
|
761
|
-
object({
|
|
762
|
-
$kind: literal("vector"),
|
|
763
|
-
vector: lazy(() => OpenSignatureBodySchema)
|
|
764
|
-
}),
|
|
765
|
-
object({
|
|
766
|
-
$kind: literal("datatype"),
|
|
767
|
-
datatype: object({
|
|
768
|
-
typeName: string(),
|
|
769
|
-
typeParameters: array(lazy(() => OpenSignatureBodySchema))
|
|
770
|
-
})
|
|
771
|
-
}),
|
|
772
|
-
object({
|
|
773
|
-
$kind: literal("typeParameter"),
|
|
774
|
-
index: pipe(number(), integer())
|
|
775
|
-
})
|
|
776
|
-
]);
|
|
777
|
-
var OpenSignatureSchema = object({
|
|
778
|
-
reference: nullable(union([
|
|
779
|
-
literal("mutable"),
|
|
780
|
-
literal("immutable"),
|
|
781
|
-
literal("unknown")
|
|
782
|
-
])),
|
|
783
|
-
body: OpenSignatureBodySchema
|
|
784
|
-
});
|
|
785
|
-
var ProgrammableMoveCallSchema = object({
|
|
786
|
-
package: ObjectID,
|
|
787
|
-
module: string(),
|
|
788
|
-
function: string(),
|
|
789
|
-
typeArguments: array(string()),
|
|
790
|
-
arguments: array(ArgumentSchema),
|
|
791
|
-
_argumentTypes: optional(nullable(array(OpenSignatureSchema)))
|
|
792
|
-
});
|
|
793
|
-
var $Intent = object({
|
|
794
|
-
name: string(),
|
|
795
|
-
inputs: record(string(), union([ArgumentSchema, array(ArgumentSchema)])),
|
|
796
|
-
data: record(string(), unknown())
|
|
797
|
-
});
|
|
798
|
-
var CommandSchema = safeEnum({
|
|
799
|
-
MoveCall: ProgrammableMoveCallSchema,
|
|
800
|
-
TransferObjects: object({
|
|
801
|
-
objects: array(ArgumentSchema),
|
|
802
|
-
address: ArgumentSchema
|
|
803
|
-
}),
|
|
804
|
-
SplitCoins: object({
|
|
805
|
-
coin: ArgumentSchema,
|
|
806
|
-
amounts: array(ArgumentSchema)
|
|
807
|
-
}),
|
|
808
|
-
MergeCoins: object({
|
|
809
|
-
destination: ArgumentSchema,
|
|
810
|
-
sources: array(ArgumentSchema)
|
|
811
|
-
}),
|
|
812
|
-
Publish: object({
|
|
813
|
-
modules: array(BCSBytes),
|
|
814
|
-
dependencies: array(ObjectID)
|
|
815
|
-
}),
|
|
816
|
-
MakeMoveVec: object({
|
|
817
|
-
type: nullable(string()),
|
|
818
|
-
elements: array(ArgumentSchema)
|
|
819
|
-
}),
|
|
820
|
-
Upgrade: object({
|
|
821
|
-
modules: array(BCSBytes),
|
|
822
|
-
dependencies: array(ObjectID),
|
|
823
|
-
package: ObjectID,
|
|
824
|
-
ticket: ArgumentSchema
|
|
825
|
-
}),
|
|
826
|
-
$Intent
|
|
827
|
-
});
|
|
828
|
-
var ObjectArgSchema = safeEnum({
|
|
829
|
-
ImmOrOwnedObject: ObjectRefSchema,
|
|
830
|
-
SharedObject: object({
|
|
831
|
-
objectId: ObjectID,
|
|
832
|
-
initialSharedVersion: JsonU64,
|
|
833
|
-
mutable: boolean()
|
|
834
|
-
}),
|
|
835
|
-
Receiving: ObjectRefSchema
|
|
836
|
-
});
|
|
837
|
-
var ReservationSchema = safeEnum({ MaxAmountU64: JsonU64 });
|
|
838
|
-
var WithdrawalTypeArgSchema = safeEnum({ Balance: string() });
|
|
839
|
-
var WithdrawFromSchema = safeEnum({
|
|
840
|
-
Sender: literal(true),
|
|
841
|
-
Sponsor: literal(true)
|
|
842
|
-
});
|
|
843
|
-
var FundsWithdrawalArgSchema = object({
|
|
844
|
-
reservation: ReservationSchema,
|
|
845
|
-
typeArg: WithdrawalTypeArgSchema,
|
|
846
|
-
withdrawFrom: WithdrawFromSchema
|
|
847
|
-
});
|
|
848
|
-
var CallArgSchema = safeEnum({
|
|
849
|
-
Object: ObjectArgSchema,
|
|
850
|
-
Pure: object({ bytes: BCSBytes }),
|
|
851
|
-
UnresolvedPure: object({ value: unknown() }),
|
|
852
|
-
UnresolvedObject: object({
|
|
853
|
-
objectId: ObjectID,
|
|
854
|
-
version: optional(nullable(JsonU64)),
|
|
855
|
-
digest: optional(nullable(string())),
|
|
856
|
-
initialSharedVersion: optional(nullable(JsonU64)),
|
|
857
|
-
mutable: optional(nullable(boolean()))
|
|
858
|
-
}),
|
|
859
|
-
FundsWithdrawal: FundsWithdrawalArgSchema
|
|
860
|
-
});
|
|
861
|
-
var NormalizedCallArg = safeEnum({
|
|
862
|
-
Object: ObjectArgSchema,
|
|
863
|
-
Pure: object({ bytes: BCSBytes })
|
|
864
|
-
});
|
|
865
|
-
var ValidDuringSchema = object({
|
|
866
|
-
minEpoch: nullable(JsonU64),
|
|
867
|
-
maxEpoch: nullable(JsonU64),
|
|
868
|
-
minTimestamp: nullable(JsonU64),
|
|
869
|
-
maxTimestamp: nullable(JsonU64),
|
|
870
|
-
chain: string(),
|
|
871
|
-
nonce: U32
|
|
872
|
-
});
|
|
873
|
-
var TransactionExpiration = safeEnum({
|
|
874
|
-
None: literal(true),
|
|
875
|
-
Epoch: JsonU64,
|
|
876
|
-
ValidDuring: ValidDuringSchema
|
|
877
|
-
});
|
|
878
|
-
var TransactionDataSchema = object({
|
|
879
|
-
version: literal(2),
|
|
880
|
-
sender: nullish(SuiAddress),
|
|
881
|
-
expiration: nullish(TransactionExpiration),
|
|
882
|
-
gasData: GasDataSchema,
|
|
883
|
-
inputs: array(CallArgSchema),
|
|
884
|
-
commands: array(CommandSchema)
|
|
885
|
-
});
|
|
886
|
-
|
|
887
|
-
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/transactions/utils.mjs
|
|
888
|
-
function getIdFromCallArg(arg) {
|
|
889
|
-
if (typeof arg === "string") return normalizeSuiAddress(arg);
|
|
890
|
-
if (arg.Object) {
|
|
891
|
-
if (arg.Object.ImmOrOwnedObject) return normalizeSuiAddress(arg.Object.ImmOrOwnedObject.objectId);
|
|
892
|
-
if (arg.Object.Receiving) return normalizeSuiAddress(arg.Object.Receiving.objectId);
|
|
893
|
-
return normalizeSuiAddress(arg.Object.SharedObject.objectId);
|
|
894
|
-
}
|
|
895
|
-
if (arg.UnresolvedObject) return normalizeSuiAddress(arg.UnresolvedObject.objectId);
|
|
896
|
-
}
|
|
897
|
-
function isArgument(value) {
|
|
898
|
-
return is(ArgumentSchema, value);
|
|
1021
|
+
},
|
|
1022
|
+
"~run"(dataset, config$1) {
|
|
1023
|
+
const input = dataset.value;
|
|
1024
|
+
if (input && typeof input === "object") {
|
|
1025
|
+
dataset.typed = true;
|
|
1026
|
+
dataset.value = {};
|
|
1027
|
+
for (const key in this.entries) {
|
|
1028
|
+
const valueSchema = this.entries[key];
|
|
1029
|
+
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
1030
|
+
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
1031
|
+
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
1032
|
+
if (valueDataset.issues) {
|
|
1033
|
+
const pathItem = {
|
|
1034
|
+
type: "object",
|
|
1035
|
+
origin: "value",
|
|
1036
|
+
input,
|
|
1037
|
+
key,
|
|
1038
|
+
value: value$1
|
|
1039
|
+
};
|
|
1040
|
+
for (const issue of valueDataset.issues) {
|
|
1041
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1042
|
+
else issue.path = [pathItem];
|
|
1043
|
+
dataset.issues?.push(issue);
|
|
1044
|
+
}
|
|
1045
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1046
|
+
if (config$1.abortEarly) {
|
|
1047
|
+
dataset.typed = false;
|
|
1048
|
+
break;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
if (!valueDataset.typed) dataset.typed = false;
|
|
1052
|
+
dataset.value[key] = valueDataset.value;
|
|
1053
|
+
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
1054
|
+
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
1055
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
1056
|
+
input: void 0,
|
|
1057
|
+
expected: `"${key}"`,
|
|
1058
|
+
path: [{
|
|
1059
|
+
type: "object",
|
|
1060
|
+
origin: "key",
|
|
1061
|
+
input,
|
|
1062
|
+
key,
|
|
1063
|
+
value: input[key]
|
|
1064
|
+
}]
|
|
1065
|
+
});
|
|
1066
|
+
if (config$1.abortEarly) break;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1070
|
+
return dataset;
|
|
1071
|
+
}
|
|
1072
|
+
};
|
|
899
1073
|
}
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
const newCommandIndex = commandMapping.get(arg.NestedResult[0]);
|
|
921
|
-
if (newCommandIndex !== void 0) return {
|
|
922
|
-
...arg,
|
|
923
|
-
NestedResult: [newCommandIndex, arg.NestedResult[1]]
|
|
924
|
-
};
|
|
925
|
-
return arg;
|
|
1074
|
+
// @__NO_SIDE_EFFECTS__
|
|
1075
|
+
function optional(wrapped, default_) {
|
|
1076
|
+
return {
|
|
1077
|
+
kind: "schema",
|
|
1078
|
+
type: "optional",
|
|
1079
|
+
reference: optional,
|
|
1080
|
+
expects: `(${wrapped.expects} | undefined)`,
|
|
1081
|
+
async: false,
|
|
1082
|
+
wrapped,
|
|
1083
|
+
default: default_,
|
|
1084
|
+
get "~standard"() {
|
|
1085
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1086
|
+
},
|
|
1087
|
+
"~run"(dataset, config$1) {
|
|
1088
|
+
if (dataset.value === void 0) {
|
|
1089
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
1090
|
+
if (dataset.value === void 0) {
|
|
1091
|
+
dataset.typed = true;
|
|
1092
|
+
return dataset;
|
|
1093
|
+
}
|
|
926
1094
|
}
|
|
927
|
-
|
|
928
|
-
return arg;
|
|
1095
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
929
1096
|
}
|
|
930
1097
|
};
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
break;
|
|
950
|
-
case "Upgrade":
|
|
951
|
-
command.Upgrade.ticket = remapArg(command.Upgrade.ticket);
|
|
952
|
-
break;
|
|
953
|
-
case "$Intent": {
|
|
954
|
-
const inputs = command.$Intent.inputs;
|
|
955
|
-
command.$Intent.inputs = {};
|
|
956
|
-
for (const [key, value] of Object.entries(inputs)) command.$Intent.inputs[key] = Array.isArray(value) ? value.map(remapArg) : remapArg(value);
|
|
957
|
-
break;
|
|
1098
|
+
}
|
|
1099
|
+
// @__NO_SIDE_EFFECTS__
|
|
1100
|
+
function picklist(options, message$1) {
|
|
1101
|
+
return {
|
|
1102
|
+
kind: "schema",
|
|
1103
|
+
type: "picklist",
|
|
1104
|
+
reference: picklist,
|
|
1105
|
+
expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"),
|
|
1106
|
+
async: false,
|
|
1107
|
+
options,
|
|
1108
|
+
message: message$1,
|
|
1109
|
+
get "~standard"() {
|
|
1110
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1111
|
+
},
|
|
1112
|
+
"~run"(dataset, config$1) {
|
|
1113
|
+
if (this.options.includes(dataset.value)) dataset.typed = true;
|
|
1114
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1115
|
+
return dataset;
|
|
958
1116
|
}
|
|
959
|
-
|
|
960
|
-
break;
|
|
961
|
-
}
|
|
1117
|
+
};
|
|
962
1118
|
}
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1119
|
+
// @__NO_SIDE_EFFECTS__
|
|
1120
|
+
function record(key, value$1, message$1) {
|
|
1121
|
+
return {
|
|
1122
|
+
kind: "schema",
|
|
1123
|
+
type: "record",
|
|
1124
|
+
reference: record,
|
|
1125
|
+
expects: "Object",
|
|
1126
|
+
async: false,
|
|
1127
|
+
key,
|
|
1128
|
+
value: value$1,
|
|
1129
|
+
message: message$1,
|
|
1130
|
+
get "~standard"() {
|
|
1131
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1132
|
+
},
|
|
1133
|
+
"~run"(dataset, config$1) {
|
|
1134
|
+
const input = dataset.value;
|
|
1135
|
+
if (input && typeof input === "object") {
|
|
1136
|
+
dataset.typed = true;
|
|
1137
|
+
dataset.value = {};
|
|
1138
|
+
for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {
|
|
1139
|
+
const entryValue = input[entryKey];
|
|
1140
|
+
const keyDataset = this.key["~run"]({ value: entryKey }, config$1);
|
|
1141
|
+
if (keyDataset.issues) {
|
|
1142
|
+
const pathItem = {
|
|
1143
|
+
type: "object",
|
|
1144
|
+
origin: "key",
|
|
1145
|
+
input,
|
|
1146
|
+
key: entryKey,
|
|
1147
|
+
value: entryValue
|
|
1148
|
+
};
|
|
1149
|
+
for (const issue of keyDataset.issues) {
|
|
1150
|
+
issue.path = [pathItem];
|
|
1151
|
+
dataset.issues?.push(issue);
|
|
1152
|
+
}
|
|
1153
|
+
if (!dataset.issues) dataset.issues = keyDataset.issues;
|
|
1154
|
+
if (config$1.abortEarly) {
|
|
1155
|
+
dataset.typed = false;
|
|
1156
|
+
break;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
const valueDataset = this.value["~run"]({ value: entryValue }, config$1);
|
|
1160
|
+
if (valueDataset.issues) {
|
|
1161
|
+
const pathItem = {
|
|
1162
|
+
type: "object",
|
|
1163
|
+
origin: "value",
|
|
1164
|
+
input,
|
|
1165
|
+
key: entryKey,
|
|
1166
|
+
value: entryValue
|
|
1167
|
+
};
|
|
1168
|
+
for (const issue of valueDataset.issues) {
|
|
1169
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1170
|
+
else issue.path = [pathItem];
|
|
1171
|
+
dataset.issues?.push(issue);
|
|
1172
|
+
}
|
|
1173
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1174
|
+
if (config$1.abortEarly) {
|
|
1175
|
+
dataset.typed = false;
|
|
1176
|
+
break;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;
|
|
1180
|
+
if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;
|
|
1181
|
+
}
|
|
1182
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1183
|
+
return dataset;
|
|
1007
1184
|
}
|
|
1008
|
-
|
|
1009
|
-
}
|
|
1010
|
-
};
|
|
1011
|
-
|
|
1012
|
-
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/bcs/bcs.mjs
|
|
1013
|
-
function unsafe_u64(options) {
|
|
1014
|
-
return bcs.u64({
|
|
1015
|
-
name: "unsafe_u64",
|
|
1016
|
-
...options
|
|
1017
|
-
}).transform({
|
|
1018
|
-
input: (val) => val,
|
|
1019
|
-
output: (val) => Number(val)
|
|
1020
|
-
});
|
|
1185
|
+
};
|
|
1021
1186
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1187
|
+
// @__NO_SIDE_EFFECTS__
|
|
1188
|
+
function string(message$1) {
|
|
1189
|
+
return {
|
|
1190
|
+
kind: "schema",
|
|
1191
|
+
type: "string",
|
|
1192
|
+
reference: string,
|
|
1193
|
+
expects: "string",
|
|
1194
|
+
async: false,
|
|
1195
|
+
message: message$1,
|
|
1196
|
+
get "~standard"() {
|
|
1197
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1198
|
+
},
|
|
1199
|
+
"~run"(dataset, config$1) {
|
|
1200
|
+
if (typeof dataset.value === "string") dataset.typed = true;
|
|
1201
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1202
|
+
return dataset;
|
|
1203
|
+
}
|
|
1204
|
+
};
|
|
1027
1205
|
}
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
});
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
});
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
Genesis: null,
|
|
1164
|
-
ConsensusCommitPrologue: null
|
|
1165
|
-
});
|
|
1166
|
-
var ValidDuring = bcs.struct("ValidDuring", {
|
|
1167
|
-
minEpoch: bcs.option(bcs.u64()),
|
|
1168
|
-
maxEpoch: bcs.option(bcs.u64()),
|
|
1169
|
-
minTimestamp: bcs.option(bcs.u64()),
|
|
1170
|
-
maxTimestamp: bcs.option(bcs.u64()),
|
|
1171
|
-
chain: ObjectDigest,
|
|
1172
|
-
nonce: bcs.u32()
|
|
1173
|
-
});
|
|
1174
|
-
var TransactionExpiration2 = bcs.enum("TransactionExpiration", {
|
|
1175
|
-
None: null,
|
|
1176
|
-
Epoch: unsafe_u64(),
|
|
1177
|
-
ValidDuring
|
|
1178
|
-
});
|
|
1179
|
-
var StructTag = bcs.struct("StructTag", {
|
|
1180
|
-
address: Address,
|
|
1181
|
-
module: bcs.string(),
|
|
1182
|
-
name: bcs.string(),
|
|
1183
|
-
typeParams: bcs.vector(InnerTypeTag)
|
|
1184
|
-
});
|
|
1185
|
-
var GasData = bcs.struct("GasData", {
|
|
1186
|
-
payment: bcs.vector(SuiObjectRef),
|
|
1187
|
-
owner: Address,
|
|
1188
|
-
price: bcs.u64(),
|
|
1189
|
-
budget: bcs.u64()
|
|
1190
|
-
});
|
|
1191
|
-
var TransactionDataV1 = bcs.struct("TransactionDataV1", {
|
|
1192
|
-
kind: TransactionKind,
|
|
1193
|
-
sender: Address,
|
|
1194
|
-
gasData: GasData,
|
|
1195
|
-
expiration: TransactionExpiration2
|
|
1196
|
-
});
|
|
1197
|
-
var TransactionData = bcs.enum("TransactionData", { V1: TransactionDataV1 });
|
|
1198
|
-
var IntentScope = bcs.enum("IntentScope", {
|
|
1199
|
-
TransactionData: null,
|
|
1200
|
-
TransactionEffects: null,
|
|
1201
|
-
CheckpointSummary: null,
|
|
1202
|
-
PersonalMessage: null
|
|
1203
|
-
});
|
|
1204
|
-
var IntentVersion = bcs.enum("IntentVersion", { V0: null });
|
|
1205
|
-
var AppId = bcs.enum("AppId", { Sui: null });
|
|
1206
|
-
var Intent = bcs.struct("Intent", {
|
|
1207
|
-
scope: IntentScope,
|
|
1208
|
-
version: IntentVersion,
|
|
1209
|
-
appId: AppId
|
|
1210
|
-
});
|
|
1211
|
-
function IntentMessage(T) {
|
|
1212
|
-
return bcs.struct(`IntentMessage<${T.name}>`, {
|
|
1213
|
-
intent: Intent,
|
|
1214
|
-
value: T
|
|
1215
|
-
});
|
|
1206
|
+
// @__NO_SIDE_EFFECTS__
|
|
1207
|
+
function tuple(items, message$1) {
|
|
1208
|
+
return {
|
|
1209
|
+
kind: "schema",
|
|
1210
|
+
type: "tuple",
|
|
1211
|
+
reference: tuple,
|
|
1212
|
+
expects: "Array",
|
|
1213
|
+
async: false,
|
|
1214
|
+
items,
|
|
1215
|
+
message: message$1,
|
|
1216
|
+
get "~standard"() {
|
|
1217
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1218
|
+
},
|
|
1219
|
+
"~run"(dataset, config$1) {
|
|
1220
|
+
const input = dataset.value;
|
|
1221
|
+
if (Array.isArray(input)) {
|
|
1222
|
+
dataset.typed = true;
|
|
1223
|
+
dataset.value = [];
|
|
1224
|
+
for (let key = 0; key < this.items.length; key++) {
|
|
1225
|
+
const value$1 = input[key];
|
|
1226
|
+
const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1);
|
|
1227
|
+
if (itemDataset.issues) {
|
|
1228
|
+
const pathItem = {
|
|
1229
|
+
type: "array",
|
|
1230
|
+
origin: "value",
|
|
1231
|
+
input,
|
|
1232
|
+
key,
|
|
1233
|
+
value: value$1
|
|
1234
|
+
};
|
|
1235
|
+
for (const issue of itemDataset.issues) {
|
|
1236
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1237
|
+
else issue.path = [pathItem];
|
|
1238
|
+
dataset.issues?.push(issue);
|
|
1239
|
+
}
|
|
1240
|
+
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
1241
|
+
if (config$1.abortEarly) {
|
|
1242
|
+
dataset.typed = false;
|
|
1243
|
+
break;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
if (!itemDataset.typed) dataset.typed = false;
|
|
1247
|
+
dataset.value.push(itemDataset.value);
|
|
1248
|
+
}
|
|
1249
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1250
|
+
return dataset;
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
// @__NO_SIDE_EFFECTS__
|
|
1255
|
+
function _subIssues(datasets) {
|
|
1256
|
+
let issues;
|
|
1257
|
+
if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);
|
|
1258
|
+
else issues = dataset.issues;
|
|
1259
|
+
return issues;
|
|
1260
|
+
}
|
|
1261
|
+
// @__NO_SIDE_EFFECTS__
|
|
1262
|
+
function union(options, message$1) {
|
|
1263
|
+
return {
|
|
1264
|
+
kind: "schema",
|
|
1265
|
+
type: "union",
|
|
1266
|
+
reference: union,
|
|
1267
|
+
expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
|
|
1268
|
+
async: false,
|
|
1269
|
+
options,
|
|
1270
|
+
message: message$1,
|
|
1271
|
+
get "~standard"() {
|
|
1272
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1273
|
+
},
|
|
1274
|
+
"~run"(dataset, config$1) {
|
|
1275
|
+
let validDataset;
|
|
1276
|
+
let typedDatasets;
|
|
1277
|
+
let untypedDatasets;
|
|
1278
|
+
for (const schema of this.options) {
|
|
1279
|
+
const optionDataset = schema["~run"]({ value: dataset.value }, config$1);
|
|
1280
|
+
if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
|
|
1281
|
+
else typedDatasets = [optionDataset];
|
|
1282
|
+
else {
|
|
1283
|
+
validDataset = optionDataset;
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1286
|
+
else if (untypedDatasets) untypedDatasets.push(optionDataset);
|
|
1287
|
+
else untypedDatasets = [optionDataset];
|
|
1288
|
+
}
|
|
1289
|
+
if (validDataset) return validDataset;
|
|
1290
|
+
if (typedDatasets) {
|
|
1291
|
+
if (typedDatasets.length === 1) return typedDatasets[0];
|
|
1292
|
+
_addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
|
|
1293
|
+
dataset.typed = true;
|
|
1294
|
+
} else if (untypedDatasets?.length === 1) return untypedDatasets[0];
|
|
1295
|
+
else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
|
|
1296
|
+
return dataset;
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
// @__NO_SIDE_EFFECTS__
|
|
1301
|
+
function unknown() {
|
|
1302
|
+
return {
|
|
1303
|
+
kind: "schema",
|
|
1304
|
+
type: "unknown",
|
|
1305
|
+
reference: unknown,
|
|
1306
|
+
expects: "unknown",
|
|
1307
|
+
async: false,
|
|
1308
|
+
get "~standard"() {
|
|
1309
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1310
|
+
},
|
|
1311
|
+
"~run"(dataset) {
|
|
1312
|
+
dataset.typed = true;
|
|
1313
|
+
return dataset;
|
|
1314
|
+
}
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
function parse(schema, input, config$1) {
|
|
1318
|
+
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
|
|
1319
|
+
if (dataset.issues) throw new ValiError(dataset.issues);
|
|
1320
|
+
return dataset.value;
|
|
1321
|
+
}
|
|
1322
|
+
// @__NO_SIDE_EFFECTS__
|
|
1323
|
+
function pipe(...pipe$1) {
|
|
1324
|
+
return {
|
|
1325
|
+
...pipe$1[0],
|
|
1326
|
+
pipe: pipe$1,
|
|
1327
|
+
get "~standard"() {
|
|
1328
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1329
|
+
},
|
|
1330
|
+
"~run"(dataset, config$1) {
|
|
1331
|
+
for (const item of pipe$1) if (item.kind !== "metadata") {
|
|
1332
|
+
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
1333
|
+
dataset.typed = false;
|
|
1334
|
+
break;
|
|
1335
|
+
}
|
|
1336
|
+
if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
|
|
1337
|
+
}
|
|
1338
|
+
return dataset;
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1216
1341
|
}
|
|
1217
|
-
var CompressedSignature = bcs.enum("CompressedSignature", {
|
|
1218
|
-
ED25519: bcs.bytes(64),
|
|
1219
|
-
Secp256k1: bcs.bytes(64),
|
|
1220
|
-
Secp256r1: bcs.bytes(64),
|
|
1221
|
-
ZkLogin: bcs.byteVector(),
|
|
1222
|
-
Passkey: bcs.byteVector()
|
|
1223
|
-
});
|
|
1224
|
-
var PublicKey = bcs.enum("PublicKey", {
|
|
1225
|
-
ED25519: bcs.bytes(32),
|
|
1226
|
-
Secp256k1: bcs.bytes(33),
|
|
1227
|
-
Secp256r1: bcs.bytes(33),
|
|
1228
|
-
ZkLogin: bcs.byteVector(),
|
|
1229
|
-
Passkey: bcs.bytes(33)
|
|
1230
|
-
});
|
|
1231
|
-
var MultiSigPkMap = bcs.struct("MultiSigPkMap", {
|
|
1232
|
-
pubKey: PublicKey,
|
|
1233
|
-
weight: bcs.u8()
|
|
1234
|
-
});
|
|
1235
|
-
var MultiSigPublicKey = bcs.struct("MultiSigPublicKey", {
|
|
1236
|
-
pk_map: bcs.vector(MultiSigPkMap),
|
|
1237
|
-
threshold: bcs.u16()
|
|
1238
|
-
});
|
|
1239
|
-
var MultiSig = bcs.struct("MultiSig", {
|
|
1240
|
-
sigs: bcs.vector(CompressedSignature),
|
|
1241
|
-
bitmap: bcs.u16(),
|
|
1242
|
-
multisig_pk: MultiSigPublicKey
|
|
1243
|
-
});
|
|
1244
|
-
var base64String = bcs.byteVector().transform({
|
|
1245
|
-
input: (val) => typeof val === "string" ? fromBase64(val) : val,
|
|
1246
|
-
output: (val) => toBase64(new Uint8Array(val))
|
|
1247
|
-
});
|
|
1248
|
-
var SenderSignedTransaction = bcs.struct("SenderSignedTransaction", {
|
|
1249
|
-
intentMessage: IntentMessage(TransactionData),
|
|
1250
|
-
txSignatures: bcs.vector(base64String)
|
|
1251
|
-
});
|
|
1252
|
-
var SenderSignedData = bcs.vector(SenderSignedTransaction, { name: "SenderSignedData" });
|
|
1253
|
-
var PasskeyAuthenticator = bcs.struct("PasskeyAuthenticator", {
|
|
1254
|
-
authenticatorData: bcs.byteVector(),
|
|
1255
|
-
clientDataJson: bcs.string(),
|
|
1256
|
-
userSignature: bcs.byteVector()
|
|
1257
|
-
});
|
|
1258
|
-
var MoveObjectType = bcs.enum("MoveObjectType", {
|
|
1259
|
-
Other: StructTag,
|
|
1260
|
-
GasCoin: null,
|
|
1261
|
-
StakedSui: null,
|
|
1262
|
-
Coin: TypeTag,
|
|
1263
|
-
AccumulatorBalanceWrapper: null
|
|
1264
|
-
});
|
|
1265
|
-
var TypeOrigin = bcs.struct("TypeOrigin", {
|
|
1266
|
-
moduleName: bcs.string(),
|
|
1267
|
-
datatypeName: bcs.string(),
|
|
1268
|
-
package: Address
|
|
1269
|
-
});
|
|
1270
|
-
var UpgradeInfo = bcs.struct("UpgradeInfo", {
|
|
1271
|
-
upgradedId: Address,
|
|
1272
|
-
upgradedVersion: bcs.u64()
|
|
1273
|
-
});
|
|
1274
|
-
var MovePackage = bcs.struct("MovePackage", {
|
|
1275
|
-
id: Address,
|
|
1276
|
-
version: bcs.u64(),
|
|
1277
|
-
moduleMap: bcs.map(bcs.string(), bcs.byteVector()),
|
|
1278
|
-
typeOriginTable: bcs.vector(TypeOrigin),
|
|
1279
|
-
linkageTable: bcs.map(Address, UpgradeInfo)
|
|
1280
|
-
});
|
|
1281
|
-
var MoveObject = bcs.struct("MoveObject", {
|
|
1282
|
-
type: MoveObjectType,
|
|
1283
|
-
hasPublicTransfer: bcs.bool(),
|
|
1284
|
-
version: bcs.u64(),
|
|
1285
|
-
contents: bcs.byteVector()
|
|
1286
|
-
});
|
|
1287
|
-
var Data = bcs.enum("Data", {
|
|
1288
|
-
Move: MoveObject,
|
|
1289
|
-
Package: MovePackage
|
|
1290
|
-
});
|
|
1291
|
-
var ObjectInner = bcs.struct("ObjectInner", {
|
|
1292
|
-
data: Data,
|
|
1293
|
-
owner: Owner,
|
|
1294
|
-
previousTransaction: ObjectDigest,
|
|
1295
|
-
storageRebate: bcs.u64()
|
|
1296
|
-
});
|
|
1297
1342
|
|
|
1298
|
-
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
});
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
var
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
resultIdx: bcs.u16(),
|
|
1328
|
-
secondaryIdx: bcs.u16()
|
|
1329
|
-
}),
|
|
1330
|
-
InvalidResultArity: bcs.struct("InvalidResultArity", { resultIdx: bcs.u16() }),
|
|
1331
|
-
InvalidGasCoinUsage: null,
|
|
1332
|
-
InvalidValueUsage: null,
|
|
1333
|
-
InvalidObjectByValue: null,
|
|
1334
|
-
InvalidObjectByMutRef: null,
|
|
1335
|
-
SharedObjectOperationNotAllowed: null,
|
|
1336
|
-
InvalidArgumentArity: null,
|
|
1337
|
-
InvalidTransferObject: null,
|
|
1338
|
-
InvalidMakeMoveVecNonObjectArgument: null,
|
|
1339
|
-
ArgumentWithoutValue: null,
|
|
1340
|
-
CannotMoveBorrowedValue: null,
|
|
1341
|
-
CannotWriteToExtendedReference: null,
|
|
1342
|
-
InvalidReferenceArgument: null
|
|
1343
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/transactions/data/internal.mjs
|
|
1344
|
+
function safeEnum(options) {
|
|
1345
|
+
return union(Object.keys(options).map((key) => withKind(key, object({ [key]: options[key] }))));
|
|
1346
|
+
}
|
|
1347
|
+
function withKind(key, schema) {
|
|
1348
|
+
return pipe(object({
|
|
1349
|
+
...schema.entries,
|
|
1350
|
+
$kind: optional(literal(key))
|
|
1351
|
+
}), transform((value) => ({
|
|
1352
|
+
...value,
|
|
1353
|
+
$kind: key
|
|
1354
|
+
})));
|
|
1355
|
+
}
|
|
1356
|
+
var SuiAddress = pipe(string(), transform((value) => normalizeSuiAddress(value)), check(isValidSuiAddress));
|
|
1357
|
+
var ObjectID = SuiAddress;
|
|
1358
|
+
var BCSBytes = string();
|
|
1359
|
+
var JsonU64 = pipe(union([string(), pipe(number(), integer())]), check((val) => {
|
|
1360
|
+
try {
|
|
1361
|
+
BigInt(val);
|
|
1362
|
+
return BigInt(val) >= 0 && BigInt(val) <= 18446744073709551615n;
|
|
1363
|
+
} catch {
|
|
1364
|
+
return false;
|
|
1365
|
+
}
|
|
1366
|
+
}, "Invalid u64"));
|
|
1367
|
+
var U32 = pipe(number(), integer(), check((val) => val >= 0 && val < 2 ** 32, "Invalid u32"));
|
|
1368
|
+
var ObjectRefSchema = object({
|
|
1369
|
+
objectId: SuiAddress,
|
|
1370
|
+
version: JsonU64,
|
|
1371
|
+
digest: string()
|
|
1343
1372
|
});
|
|
1344
|
-
var
|
|
1345
|
-
|
|
1346
|
-
|
|
1373
|
+
var ArgumentSchema = union([
|
|
1374
|
+
withKind("GasCoin", object({ GasCoin: literal(true) })),
|
|
1375
|
+
withKind("Input", object({
|
|
1376
|
+
Input: pipe(number(), integer()),
|
|
1377
|
+
type: optional(union([
|
|
1378
|
+
literal("pure"),
|
|
1379
|
+
literal("object"),
|
|
1380
|
+
literal("withdrawal")
|
|
1381
|
+
]))
|
|
1382
|
+
})),
|
|
1383
|
+
withKind("Result", object({ Result: pipe(number(), integer()) })),
|
|
1384
|
+
withKind("NestedResult", object({ NestedResult: tuple([pipe(number(), integer()), pipe(number(), integer())]) }))
|
|
1385
|
+
]);
|
|
1386
|
+
var GasDataSchema = object({
|
|
1387
|
+
budget: nullable(JsonU64),
|
|
1388
|
+
price: nullable(JsonU64),
|
|
1389
|
+
owner: nullable(SuiAddress),
|
|
1390
|
+
payment: nullable(array(ObjectRefSchema))
|
|
1347
1391
|
});
|
|
1348
|
-
var
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
}),
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
}),
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
MoveAbort: bcs.tuple([MoveLocation, bcs.u64()]),
|
|
1368
|
-
VMVerificationOrDeserializationError: null,
|
|
1369
|
-
VMInvariantViolation: null,
|
|
1370
|
-
FunctionNotFound: null,
|
|
1371
|
-
ArityMismatch: null,
|
|
1372
|
-
TypeArityMismatch: null,
|
|
1373
|
-
NonEntryFunctionInvoked: null,
|
|
1374
|
-
CommandArgumentError: bcs.struct("CommandArgumentError", {
|
|
1375
|
-
argIdx: bcs.u16(),
|
|
1376
|
-
kind: CommandArgumentError
|
|
1392
|
+
var StructTagSchema = object({
|
|
1393
|
+
address: string(),
|
|
1394
|
+
module: string(),
|
|
1395
|
+
name: string(),
|
|
1396
|
+
typeParams: array(string())
|
|
1397
|
+
});
|
|
1398
|
+
var OpenSignatureBodySchema = union([
|
|
1399
|
+
object({ $kind: literal("address") }),
|
|
1400
|
+
object({ $kind: literal("bool") }),
|
|
1401
|
+
object({ $kind: literal("u8") }),
|
|
1402
|
+
object({ $kind: literal("u16") }),
|
|
1403
|
+
object({ $kind: literal("u32") }),
|
|
1404
|
+
object({ $kind: literal("u64") }),
|
|
1405
|
+
object({ $kind: literal("u128") }),
|
|
1406
|
+
object({ $kind: literal("u256") }),
|
|
1407
|
+
object({ $kind: literal("unknown") }),
|
|
1408
|
+
object({
|
|
1409
|
+
$kind: literal("vector"),
|
|
1410
|
+
vector: lazy(() => OpenSignatureBodySchema)
|
|
1377
1411
|
}),
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1412
|
+
object({
|
|
1413
|
+
$kind: literal("datatype"),
|
|
1414
|
+
datatype: object({
|
|
1415
|
+
typeName: string(),
|
|
1416
|
+
typeParameters: array(lazy(() => OpenSignatureBodySchema))
|
|
1417
|
+
})
|
|
1381
1418
|
}),
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1419
|
+
object({
|
|
1420
|
+
$kind: literal("typeParameter"),
|
|
1421
|
+
index: pipe(number(), integer())
|
|
1422
|
+
})
|
|
1423
|
+
]);
|
|
1424
|
+
var OpenSignatureSchema = object({
|
|
1425
|
+
reference: nullable(union([
|
|
1426
|
+
literal("mutable"),
|
|
1427
|
+
literal("immutable"),
|
|
1428
|
+
literal("unknown")
|
|
1429
|
+
])),
|
|
1430
|
+
body: OpenSignatureBodySchema
|
|
1431
|
+
});
|
|
1432
|
+
var ProgrammableMoveCallSchema = object({
|
|
1433
|
+
package: ObjectID,
|
|
1434
|
+
module: string(),
|
|
1435
|
+
function: string(),
|
|
1436
|
+
typeArguments: array(string()),
|
|
1437
|
+
arguments: array(ArgumentSchema),
|
|
1438
|
+
_argumentTypes: optional(nullable(array(OpenSignatureSchema)))
|
|
1439
|
+
});
|
|
1440
|
+
var $Intent = object({
|
|
1441
|
+
name: string(),
|
|
1442
|
+
inputs: record(string(), union([ArgumentSchema, array(ArgumentSchema)])),
|
|
1443
|
+
data: record(string(), unknown())
|
|
1444
|
+
});
|
|
1445
|
+
var CommandSchema = safeEnum({
|
|
1446
|
+
MoveCall: ProgrammableMoveCallSchema,
|
|
1447
|
+
TransferObjects: object({
|
|
1448
|
+
objects: array(ArgumentSchema),
|
|
1449
|
+
address: ArgumentSchema
|
|
1385
1450
|
}),
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
currentSize: bcs.u64(),
|
|
1390
|
-
maxSize: bcs.u64()
|
|
1451
|
+
SplitCoins: object({
|
|
1452
|
+
coin: ArgumentSchema,
|
|
1453
|
+
amounts: array(ArgumentSchema)
|
|
1391
1454
|
}),
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
WrittenObjectsTooLarge: bcs.struct("WrittenObjectsTooLarge", {
|
|
1396
|
-
currentSize: bcs.u64(),
|
|
1397
|
-
maxSize: bcs.u64()
|
|
1455
|
+
MergeCoins: object({
|
|
1456
|
+
destination: ArgumentSchema,
|
|
1457
|
+
sources: array(ArgumentSchema)
|
|
1398
1458
|
}),
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
InputObjectDeleted: null,
|
|
1403
|
-
ExecutionCancelledDueToSharedObjectCongestion: bcs.struct("ExecutionCancelledDueToSharedObjectCongestion", { congested_objects: bcs.vector(Address) }),
|
|
1404
|
-
AddressDeniedForCoin: bcs.struct("AddressDeniedForCoin", {
|
|
1405
|
-
address: Address,
|
|
1406
|
-
coinType: bcs.string()
|
|
1459
|
+
Publish: object({
|
|
1460
|
+
modules: array(BCSBytes),
|
|
1461
|
+
dependencies: array(ObjectID)
|
|
1407
1462
|
}),
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
valueSize: bcs.u64(),
|
|
1412
|
-
maxScaledSize: bcs.u64()
|
|
1463
|
+
MakeMoveVec: object({
|
|
1464
|
+
type: nullable(string()),
|
|
1465
|
+
elements: array(ArgumentSchema)
|
|
1413
1466
|
}),
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1467
|
+
Upgrade: object({
|
|
1468
|
+
modules: array(BCSBytes),
|
|
1469
|
+
dependencies: array(ObjectID),
|
|
1470
|
+
package: ObjectID,
|
|
1471
|
+
ticket: ArgumentSchema
|
|
1417
1472
|
}),
|
|
1418
|
-
|
|
1419
|
-
InsufficientBalanceForWithdraw: null,
|
|
1420
|
-
NonExclusiveWriteInputObjectModified: bcs.struct("NonExclusiveWriteInputObjectModified", { id: Address })
|
|
1421
|
-
});
|
|
1422
|
-
var ExecutionStatus = bcs.enum("ExecutionStatus", {
|
|
1423
|
-
Success: null,
|
|
1424
|
-
Failure: bcs.struct("Failure", {
|
|
1425
|
-
error: ExecutionFailureStatus,
|
|
1426
|
-
command: bcs.option(bcs.u64())
|
|
1427
|
-
})
|
|
1428
|
-
});
|
|
1429
|
-
var GasCostSummary = bcs.struct("GasCostSummary", {
|
|
1430
|
-
computationCost: bcs.u64(),
|
|
1431
|
-
storageCost: bcs.u64(),
|
|
1432
|
-
storageRebate: bcs.u64(),
|
|
1433
|
-
nonRefundableStorageFee: bcs.u64()
|
|
1434
|
-
});
|
|
1435
|
-
var TransactionEffectsV1 = bcs.struct("TransactionEffectsV1", {
|
|
1436
|
-
status: ExecutionStatus,
|
|
1437
|
-
executedEpoch: bcs.u64(),
|
|
1438
|
-
gasUsed: GasCostSummary,
|
|
1439
|
-
modifiedAtVersions: bcs.vector(bcs.tuple([Address, bcs.u64()])),
|
|
1440
|
-
sharedObjects: bcs.vector(SuiObjectRef),
|
|
1441
|
-
transactionDigest: ObjectDigest,
|
|
1442
|
-
created: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),
|
|
1443
|
-
mutated: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),
|
|
1444
|
-
unwrapped: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),
|
|
1445
|
-
deleted: bcs.vector(SuiObjectRef),
|
|
1446
|
-
unwrappedThenDeleted: bcs.vector(SuiObjectRef),
|
|
1447
|
-
wrapped: bcs.vector(SuiObjectRef),
|
|
1448
|
-
gasObject: bcs.tuple([SuiObjectRef, Owner]),
|
|
1449
|
-
eventsDigest: bcs.option(ObjectDigest),
|
|
1450
|
-
dependencies: bcs.vector(ObjectDigest)
|
|
1451
|
-
});
|
|
1452
|
-
var VersionDigest = bcs.tuple([bcs.u64(), ObjectDigest]);
|
|
1453
|
-
var ObjectIn = bcs.enum("ObjectIn", {
|
|
1454
|
-
NotExist: null,
|
|
1455
|
-
Exist: bcs.tuple([VersionDigest, Owner])
|
|
1456
|
-
});
|
|
1457
|
-
var AccumulatorAddress = bcs.struct("AccumulatorAddress", {
|
|
1458
|
-
address: Address,
|
|
1459
|
-
ty: TypeTag
|
|
1460
|
-
});
|
|
1461
|
-
var AccumulatorOperation = bcs.enum("AccumulatorOperation", {
|
|
1462
|
-
Merge: null,
|
|
1463
|
-
Split: null
|
|
1464
|
-
});
|
|
1465
|
-
var AccumulatorValue = bcs.enum("AccumulatorValue", {
|
|
1466
|
-
Integer: bcs.u64(),
|
|
1467
|
-
IntegerTuple: bcs.tuple([bcs.u64(), bcs.u64()]),
|
|
1468
|
-
EventDigest: bcs.vector(bcs.tuple([bcs.u64(), ObjectDigest]))
|
|
1473
|
+
$Intent
|
|
1469
1474
|
});
|
|
1470
|
-
var
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1475
|
+
var ObjectArgSchema = safeEnum({
|
|
1476
|
+
ImmOrOwnedObject: ObjectRefSchema,
|
|
1477
|
+
SharedObject: object({
|
|
1478
|
+
objectId: ObjectID,
|
|
1479
|
+
initialSharedVersion: JsonU64,
|
|
1480
|
+
mutable: boolean()
|
|
1481
|
+
}),
|
|
1482
|
+
Receiving: ObjectRefSchema
|
|
1474
1483
|
});
|
|
1475
|
-
var
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1484
|
+
var ReservationSchema = safeEnum({ MaxAmountU64: JsonU64 });
|
|
1485
|
+
var WithdrawalTypeArgSchema = safeEnum({ Balance: string() });
|
|
1486
|
+
var WithdrawFromSchema = safeEnum({
|
|
1487
|
+
Sender: literal(true),
|
|
1488
|
+
Sponsor: literal(true)
|
|
1480
1489
|
});
|
|
1481
|
-
var
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1490
|
+
var FundsWithdrawalArgSchema = object({
|
|
1491
|
+
reservation: ReservationSchema,
|
|
1492
|
+
typeArg: WithdrawalTypeArgSchema,
|
|
1493
|
+
withdrawFrom: WithdrawFromSchema
|
|
1485
1494
|
});
|
|
1486
|
-
var
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1495
|
+
var CallArgSchema = safeEnum({
|
|
1496
|
+
Object: ObjectArgSchema,
|
|
1497
|
+
Pure: object({ bytes: BCSBytes }),
|
|
1498
|
+
UnresolvedPure: object({ value: unknown() }),
|
|
1499
|
+
UnresolvedObject: object({
|
|
1500
|
+
objectId: ObjectID,
|
|
1501
|
+
version: optional(nullable(JsonU64)),
|
|
1502
|
+
digest: optional(nullable(string())),
|
|
1503
|
+
initialSharedVersion: optional(nullable(JsonU64)),
|
|
1504
|
+
mutable: optional(nullable(boolean()))
|
|
1505
|
+
}),
|
|
1506
|
+
FundsWithdrawal: FundsWithdrawalArgSchema
|
|
1490
1507
|
});
|
|
1491
|
-
var
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
ReadConsensusStreamEnded: bcs.u64(),
|
|
1495
|
-
Cancelled: bcs.u64(),
|
|
1496
|
-
PerEpochConfig: null
|
|
1508
|
+
var NormalizedCallArg = safeEnum({
|
|
1509
|
+
Object: ObjectArgSchema,
|
|
1510
|
+
Pure: object({ bytes: BCSBytes })
|
|
1497
1511
|
});
|
|
1498
|
-
var
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
dependencies: bcs.vector(ObjectDigest),
|
|
1506
|
-
lamportVersion: bcs.u64(),
|
|
1507
|
-
changedObjects: bcs.vector(bcs.tuple([Address, EffectsObjectChange])),
|
|
1508
|
-
unchangedConsensusObjects: bcs.vector(bcs.tuple([Address, UnchangedConsensusKind])),
|
|
1509
|
-
auxDataDigest: bcs.option(ObjectDigest)
|
|
1512
|
+
var ValidDuringSchema = object({
|
|
1513
|
+
minEpoch: nullable(JsonU64),
|
|
1514
|
+
maxEpoch: nullable(JsonU64),
|
|
1515
|
+
minTimestamp: nullable(JsonU64),
|
|
1516
|
+
maxTimestamp: nullable(JsonU64),
|
|
1517
|
+
chain: string(),
|
|
1518
|
+
nonce: U32
|
|
1510
1519
|
});
|
|
1511
|
-
var
|
|
1512
|
-
|
|
1513
|
-
|
|
1520
|
+
var TransactionExpiration2 = safeEnum({
|
|
1521
|
+
None: literal(true),
|
|
1522
|
+
Epoch: JsonU64,
|
|
1523
|
+
ValidDuring: ValidDuringSchema
|
|
1524
|
+
});
|
|
1525
|
+
var TransactionDataSchema = object({
|
|
1526
|
+
version: literal(2),
|
|
1527
|
+
sender: nullish(SuiAddress),
|
|
1528
|
+
expiration: nullish(TransactionExpiration2),
|
|
1529
|
+
gasData: GasDataSchema,
|
|
1530
|
+
inputs: array(CallArgSchema),
|
|
1531
|
+
commands: array(CommandSchema)
|
|
1514
1532
|
});
|
|
1515
1533
|
|
|
1516
|
-
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/
|
|
1517
|
-
function
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
case "u32":
|
|
1524
|
-
return bcs.u32();
|
|
1525
|
-
case "u64":
|
|
1526
|
-
return bcs.u64();
|
|
1527
|
-
case "u128":
|
|
1528
|
-
return bcs.u128();
|
|
1529
|
-
case "u256":
|
|
1530
|
-
return bcs.u256();
|
|
1531
|
-
case "bool":
|
|
1532
|
-
return bcs.bool();
|
|
1533
|
-
case "string":
|
|
1534
|
-
return bcs.string();
|
|
1535
|
-
case "id":
|
|
1536
|
-
case "address":
|
|
1537
|
-
return Address;
|
|
1534
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/transactions/utils.mjs
|
|
1535
|
+
function getIdFromCallArg(arg) {
|
|
1536
|
+
if (typeof arg === "string") return normalizeSuiAddress(arg);
|
|
1537
|
+
if (arg.Object) {
|
|
1538
|
+
if (arg.Object.ImmOrOwnedObject) return normalizeSuiAddress(arg.Object.ImmOrOwnedObject.objectId);
|
|
1539
|
+
if (arg.Object.Receiving) return normalizeSuiAddress(arg.Object.Receiving.objectId);
|
|
1540
|
+
return normalizeSuiAddress(arg.Object.SharedObject.objectId);
|
|
1538
1541
|
}
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1542
|
+
if (arg.UnresolvedObject) return normalizeSuiAddress(arg.UnresolvedObject.objectId);
|
|
1543
|
+
}
|
|
1544
|
+
function isArgument(value) {
|
|
1545
|
+
return is(ArgumentSchema, value);
|
|
1546
|
+
}
|
|
1547
|
+
function remapCommandArguments(command, inputMapping, commandMapping) {
|
|
1548
|
+
const remapArg = (arg) => {
|
|
1549
|
+
switch (arg.$kind) {
|
|
1550
|
+
case "Input": {
|
|
1551
|
+
const newInputIndex = inputMapping.get(arg.Input);
|
|
1552
|
+
if (newInputIndex === void 0) throw new Error(`Input ${arg.Input} not found in input mapping`);
|
|
1553
|
+
return {
|
|
1554
|
+
...arg,
|
|
1555
|
+
Input: newInputIndex
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
case "Result": {
|
|
1559
|
+
const newCommandIndex = commandMapping.get(arg.Result);
|
|
1560
|
+
if (newCommandIndex !== void 0) return {
|
|
1561
|
+
...arg,
|
|
1562
|
+
Result: newCommandIndex
|
|
1563
|
+
};
|
|
1564
|
+
return arg;
|
|
1565
|
+
}
|
|
1566
|
+
case "NestedResult": {
|
|
1567
|
+
const newCommandIndex = commandMapping.get(arg.NestedResult[0]);
|
|
1568
|
+
if (newCommandIndex !== void 0) return {
|
|
1569
|
+
...arg,
|
|
1570
|
+
NestedResult: [newCommandIndex, arg.NestedResult[1]]
|
|
1571
|
+
};
|
|
1572
|
+
return arg;
|
|
1573
|
+
}
|
|
1574
|
+
default:
|
|
1575
|
+
return arg;
|
|
1576
|
+
}
|
|
1577
|
+
};
|
|
1578
|
+
switch (command.$kind) {
|
|
1579
|
+
case "MoveCall":
|
|
1580
|
+
command.MoveCall.arguments = command.MoveCall.arguments.map(remapArg);
|
|
1581
|
+
break;
|
|
1582
|
+
case "TransferObjects":
|
|
1583
|
+
command.TransferObjects.objects = command.TransferObjects.objects.map(remapArg);
|
|
1584
|
+
command.TransferObjects.address = remapArg(command.TransferObjects.address);
|
|
1585
|
+
break;
|
|
1586
|
+
case "SplitCoins":
|
|
1587
|
+
command.SplitCoins.coin = remapArg(command.SplitCoins.coin);
|
|
1588
|
+
command.SplitCoins.amounts = command.SplitCoins.amounts.map(remapArg);
|
|
1589
|
+
break;
|
|
1590
|
+
case "MergeCoins":
|
|
1591
|
+
command.MergeCoins.destination = remapArg(command.MergeCoins.destination);
|
|
1592
|
+
command.MergeCoins.sources = command.MergeCoins.sources.map(remapArg);
|
|
1593
|
+
break;
|
|
1594
|
+
case "MakeMoveVec":
|
|
1595
|
+
command.MakeMoveVec.elements = command.MakeMoveVec.elements.map(remapArg);
|
|
1596
|
+
break;
|
|
1597
|
+
case "Upgrade":
|
|
1598
|
+
command.Upgrade.ticket = remapArg(command.Upgrade.ticket);
|
|
1599
|
+
break;
|
|
1600
|
+
case "$Intent": {
|
|
1601
|
+
const inputs = command.$Intent.inputs;
|
|
1602
|
+
command.$Intent.inputs = {};
|
|
1603
|
+
for (const [key, value] of Object.entries(inputs)) command.$Intent.inputs[key] = Array.isArray(value) ? value.map(remapArg) : remapArg(value);
|
|
1604
|
+
break;
|
|
1605
|
+
}
|
|
1606
|
+
case "Publish":
|
|
1607
|
+
break;
|
|
1544
1608
|
}
|
|
1545
|
-
throw new Error(`Invalid Pure type name: ${name}`);
|
|
1546
1609
|
}
|
|
1547
1610
|
|
|
1548
|
-
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/bcs/index.mjs
|
|
1549
|
-
var suiBcs = {
|
|
1550
|
-
...bcs,
|
|
1551
|
-
U8: bcs.u8(),
|
|
1552
|
-
U16: bcs.u16(),
|
|
1553
|
-
U32: bcs.u32(),
|
|
1554
|
-
U64: bcs.u64(),
|
|
1555
|
-
U128: bcs.u128(),
|
|
1556
|
-
U256: bcs.u256(),
|
|
1557
|
-
ULEB128: bcs.uleb128(),
|
|
1558
|
-
Bool: bcs.bool(),
|
|
1559
|
-
String: bcs.string(),
|
|
1560
|
-
Address,
|
|
1561
|
-
AppId,
|
|
1562
|
-
Argument,
|
|
1563
|
-
CallArg,
|
|
1564
|
-
Command,
|
|
1565
|
-
CompressedSignature,
|
|
1566
|
-
Data,
|
|
1567
|
-
GasData,
|
|
1568
|
-
Intent,
|
|
1569
|
-
IntentMessage,
|
|
1570
|
-
IntentScope,
|
|
1571
|
-
IntentVersion,
|
|
1572
|
-
MoveObject,
|
|
1573
|
-
MoveObjectType,
|
|
1574
|
-
MovePackage,
|
|
1575
|
-
MultiSig,
|
|
1576
|
-
MultiSigPkMap,
|
|
1577
|
-
MultiSigPublicKey,
|
|
1578
|
-
Object: ObjectInner,
|
|
1579
|
-
ObjectArg,
|
|
1580
|
-
ObjectDigest,
|
|
1581
|
-
Owner,
|
|
1582
|
-
PasskeyAuthenticator,
|
|
1583
|
-
ProgrammableMoveCall,
|
|
1584
|
-
ProgrammableTransaction,
|
|
1585
|
-
PublicKey,
|
|
1586
|
-
SenderSignedData,
|
|
1587
|
-
SenderSignedTransaction,
|
|
1588
|
-
SharedObjectRef,
|
|
1589
|
-
StructTag,
|
|
1590
|
-
SuiObjectRef,
|
|
1591
|
-
TransactionData,
|
|
1592
|
-
TransactionDataV1,
|
|
1593
|
-
TransactionEffects,
|
|
1594
|
-
TransactionExpiration: TransactionExpiration2,
|
|
1595
|
-
TransactionKind,
|
|
1596
|
-
TypeOrigin,
|
|
1597
|
-
TypeTag,
|
|
1598
|
-
UpgradeInfo
|
|
1599
|
-
};
|
|
1600
|
-
|
|
1601
1611
|
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/transactions/data/v1.mjs
|
|
1602
1612
|
var ObjectRef = object({
|
|
1603
1613
|
digest: string(),
|
|
@@ -2233,15 +2243,19 @@ var TransactionDataBuilder = class TransactionDataBuilder2 {
|
|
|
2233
2243
|
}
|
|
2234
2244
|
};
|
|
2235
2245
|
|
|
2236
|
-
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/utils/
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2246
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/utils/dynamic-fields.mjs
|
|
2247
|
+
function deriveDynamicFieldID(parentId, typeTag, key) {
|
|
2248
|
+
const address = suiBcs.Address.serialize(parentId).toBytes();
|
|
2249
|
+
const tag = suiBcs.TypeTag.serialize(typeTag).toBytes();
|
|
2250
|
+
const keyLength = suiBcs.u64().serialize(key.length).toBytes();
|
|
2251
|
+
const hash = blake2b.create({ dkLen: 32 });
|
|
2252
|
+
hash.update(new Uint8Array([240]));
|
|
2253
|
+
hash.update(address);
|
|
2254
|
+
hash.update(keyLength);
|
|
2255
|
+
hash.update(key);
|
|
2256
|
+
hash.update(tag);
|
|
2257
|
+
return `0x${toHex(hash.digest().slice(0, 32))}`;
|
|
2258
|
+
}
|
|
2245
2259
|
|
|
2246
2260
|
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/client/errors.mjs
|
|
2247
2261
|
var SuiClientError = class extends Error {
|
|
@@ -2274,20 +2288,6 @@ var ObjectError = class ObjectError2 extends SuiClientError {
|
|
|
2274
2288
|
}
|
|
2275
2289
|
};
|
|
2276
2290
|
|
|
2277
|
-
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/utils/dynamic-fields.mjs
|
|
2278
|
-
function deriveDynamicFieldID(parentId, typeTag, key) {
|
|
2279
|
-
const address = suiBcs.Address.serialize(parentId).toBytes();
|
|
2280
|
-
const tag = suiBcs.TypeTag.serialize(typeTag).toBytes();
|
|
2281
|
-
const keyLength = suiBcs.u64().serialize(key.length).toBytes();
|
|
2282
|
-
const hash = blake2b.create({ dkLen: 32 });
|
|
2283
|
-
hash.update(new Uint8Array([240]));
|
|
2284
|
-
hash.update(address);
|
|
2285
|
-
hash.update(keyLength);
|
|
2286
|
-
hash.update(key);
|
|
2287
|
-
hash.update(tag);
|
|
2288
|
-
return `0x${toHex(hash.digest().slice(0, 32))}`;
|
|
2289
|
-
}
|
|
2290
|
-
|
|
2291
2291
|
// ../../node_modules/.pnpm/@mysten+utils@0.3.3/node_modules/@mysten/utils/dist/b64.mjs
|
|
2292
2292
|
function fromBase642(base64String2) {
|
|
2293
2293
|
return Uint8Array.from(atob(base64String2), (char) => char.charCodeAt(0));
|
|
@@ -2777,6 +2777,18 @@ function getNamesFromTypeList(types) {
|
|
|
2777
2777
|
}
|
|
2778
2778
|
|
|
2779
2779
|
export {
|
|
2780
|
+
TypeTagSerializer,
|
|
2781
|
+
ExecutionStatus,
|
|
2782
|
+
pureBcsSchemaFromTypeName,
|
|
2783
|
+
suiBcs,
|
|
2784
|
+
deriveDynamicFieldID,
|
|
2785
|
+
MOVE_STDLIB_ADDRESS,
|
|
2786
|
+
SUI_FRAMEWORK_ADDRESS,
|
|
2787
|
+
SUI_CLOCK_OBJECT_ID,
|
|
2788
|
+
SUI_TYPE_ARG,
|
|
2789
|
+
SUI_SYSTEM_STATE_OBJECT_ID,
|
|
2790
|
+
SUI_RANDOM_OBJECT_ID,
|
|
2791
|
+
SUI_DENY_LIST_OBJECT_ID,
|
|
2780
2792
|
integer,
|
|
2781
2793
|
is,
|
|
2782
2794
|
array,
|
|
@@ -2805,25 +2817,13 @@ export {
|
|
|
2805
2817
|
FundsWithdrawalArgSchema,
|
|
2806
2818
|
NormalizedCallArg,
|
|
2807
2819
|
ValidDuringSchema,
|
|
2808
|
-
TransactionExpiration,
|
|
2820
|
+
TransactionExpiration2 as TransactionExpiration,
|
|
2809
2821
|
getIdFromCallArg,
|
|
2810
2822
|
isArgument,
|
|
2811
|
-
TypeTagSerializer,
|
|
2812
|
-
ExecutionStatus,
|
|
2813
|
-
pureBcsSchemaFromTypeName,
|
|
2814
|
-
suiBcs,
|
|
2815
2823
|
serializeV1TransactionData,
|
|
2816
2824
|
TransactionDataBuilder,
|
|
2817
|
-
MOVE_STDLIB_ADDRESS,
|
|
2818
|
-
SUI_FRAMEWORK_ADDRESS,
|
|
2819
|
-
SUI_CLOCK_OBJECT_ID,
|
|
2820
|
-
SUI_TYPE_ARG,
|
|
2821
|
-
SUI_SYSTEM_STATE_OBJECT_ID,
|
|
2822
|
-
SUI_RANDOM_OBJECT_ID,
|
|
2823
|
-
SUI_DENY_LIST_OBJECT_ID,
|
|
2824
2825
|
SimulationError,
|
|
2825
2826
|
ObjectError,
|
|
2826
|
-
deriveDynamicFieldID,
|
|
2827
2827
|
fromBase642 as fromBase64,
|
|
2828
2828
|
toBase642 as toBase64,
|
|
2829
2829
|
chunk,
|
|
@@ -2832,4 +2832,4 @@ export {
|
|
|
2832
2832
|
findNamesInTransaction,
|
|
2833
2833
|
replaceNames
|
|
2834
2834
|
};
|
|
2835
|
-
//# sourceMappingURL=chunk-
|
|
2835
|
+
//# sourceMappingURL=chunk-MPXYF2CX.js.map
|