@t2000/cli 5.5.1 → 5.6.1
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-V6MPPVOY.js → chunk-5AD7I65O.js} +3 -3
- package/dist/{chunk-HRGEZK3M.js → chunk-I2DCISQP.js} +3 -3
- package/dist/{chunk-YKME3ZZ5.js → chunk-SC3LZKLE.js} +5 -5
- package/dist/{chunk-ZIKS3DOX.js → chunk-TP3M7BAU.js} +67 -837
- package/dist/chunk-TP3M7BAU.js.map +1 -0
- package/dist/{chunk-FORXEDQJ.js → chunk-X6ON6NN5.js} +1447 -1466
- package/dist/chunk-X6ON6NN5.js.map +1 -0
- package/dist/{dist-OMYCTHXH.js → dist-5TKR5HBZ.js} +2027 -2770
- package/dist/dist-5TKR5HBZ.js.map +1 -0
- package/dist/{dist-OPR66FUQ.js → dist-PLJ2M72I.js} +6 -7
- package/dist/{esm-EIRCX523.js → esm-RF62MWQV.js} +2 -2
- package/dist/{grpc-IINTSDGR.js → grpc-OLWNGPHN.js} +4 -4
- package/dist/index.js +146 -42
- package/dist/index.js.map +1 -1
- package/dist/{x402-TTLPDM7N.js → x402-UYN72OS3.js} +4 -5
- package/dist/{x402-TTLPDM7N.js.map → x402-UYN72OS3.js.map} +1 -1
- package/package.json +3 -3
- package/dist/chunk-FORXEDQJ.js.map +0 -1
- package/dist/chunk-OCLKPYUU.js +0 -2
- package/dist/chunk-ZIKS3DOX.js.map +0 -1
- package/dist/dist-OMYCTHXH.js.map +0 -1
- package/dist/grpc-IINTSDGR.js.map +0 -1
- package/dist/transactions-JPL6KL3D.js +0 -40
- package/dist/transactions-JPL6KL3D.js.map +0 -1
- /package/dist/{chunk-V6MPPVOY.js.map → chunk-5AD7I65O.js.map} +0 -0
- /package/dist/{chunk-HRGEZK3M.js.map → chunk-I2DCISQP.js.map} +0 -0
- /package/dist/{chunk-YKME3ZZ5.js.map → chunk-SC3LZKLE.js.map} +0 -0
- /package/dist/{chunk-OCLKPYUU.js.map → dist-PLJ2M72I.js.map} +0 -0
- /package/dist/{esm-EIRCX523.js.map → esm-RF62MWQV.js.map} +0 -0
- /package/dist/{dist-OPR66FUQ.js.map → grpc-OLWNGPHN.js.map} +0 -0
|
@@ -16,521 +16,860 @@ 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}`);
|
|
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/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/utils/dynamic-fields.mjs
|
|
669
|
+
function deriveDynamicFieldID(parentId, typeTag, key) {
|
|
670
|
+
const address = suiBcs.Address.serialize(parentId).toBytes();
|
|
671
|
+
const tag = suiBcs.TypeTag.serialize(typeTag).toBytes();
|
|
672
|
+
const keyLength = suiBcs.u64().serialize(key.length).toBytes();
|
|
673
|
+
const hash = blake2b.create({ dkLen: 32 });
|
|
674
|
+
hash.update(new Uint8Array([240]));
|
|
675
|
+
hash.update(address);
|
|
676
|
+
hash.update(keyLength);
|
|
677
|
+
hash.update(key);
|
|
678
|
+
hash.update(tag);
|
|
679
|
+
return `0x${toHex(hash.digest().slice(0, 32))}`;
|
|
236
680
|
}
|
|
681
|
+
|
|
682
|
+
// ../../node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.mjs
|
|
683
|
+
var store$4;
|
|
237
684
|
// @__NO_SIDE_EFFECTS__
|
|
238
|
-
function
|
|
685
|
+
function getGlobalConfig(config$1) {
|
|
239
686
|
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
|
-
}
|
|
687
|
+
lang: config$1?.lang ?? store$4?.lang,
|
|
688
|
+
message: config$1?.message,
|
|
689
|
+
abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
|
|
690
|
+
abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
|
|
254
691
|
};
|
|
255
692
|
}
|
|
693
|
+
var store$3;
|
|
256
694
|
// @__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
|
-
};
|
|
695
|
+
function getGlobalMessage(lang) {
|
|
696
|
+
return store$3?.get(lang);
|
|
272
697
|
}
|
|
698
|
+
var store$2;
|
|
273
699
|
// @__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
|
-
};
|
|
700
|
+
function getSchemaMessage(lang) {
|
|
701
|
+
return store$2?.get(lang);
|
|
292
702
|
}
|
|
703
|
+
var store$1;
|
|
293
704
|
// @__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
|
-
};
|
|
705
|
+
function getSpecificMessage(reference, lang) {
|
|
706
|
+
return store$1?.get(reference)?.get(lang);
|
|
317
707
|
}
|
|
318
708
|
// @__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
|
-
|
|
709
|
+
function _stringify(input) {
|
|
710
|
+
const type = typeof input;
|
|
711
|
+
if (type === "string") return `"${input}"`;
|
|
712
|
+
if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
|
|
713
|
+
if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
|
|
714
|
+
return type;
|
|
715
|
+
}
|
|
716
|
+
function _addIssue(context, label, dataset, config$1, other) {
|
|
717
|
+
const input = other && "input" in other ? other.input : dataset.value;
|
|
718
|
+
const expected = other?.expected ?? context.expects ?? null;
|
|
719
|
+
const received = other?.received ?? /* @__PURE__ */ _stringify(input);
|
|
720
|
+
const issue = {
|
|
721
|
+
kind: context.kind,
|
|
722
|
+
type: context.type,
|
|
723
|
+
input,
|
|
724
|
+
expected,
|
|
725
|
+
received,
|
|
726
|
+
message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
|
|
727
|
+
requirement: context.requirement,
|
|
728
|
+
path: other?.path,
|
|
729
|
+
issues: other?.issues,
|
|
730
|
+
lang: config$1.lang,
|
|
731
|
+
abortEarly: config$1.abortEarly,
|
|
732
|
+
abortPipeEarly: config$1.abortPipeEarly
|
|
341
733
|
};
|
|
734
|
+
const isSchema = context.kind === "schema";
|
|
735
|
+
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);
|
|
736
|
+
if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
|
|
737
|
+
if (isSchema) dataset.typed = false;
|
|
738
|
+
if (dataset.issues) dataset.issues.push(issue);
|
|
739
|
+
else dataset.issues = [issue];
|
|
342
740
|
}
|
|
343
741
|
// @__NO_SIDE_EFFECTS__
|
|
344
|
-
function
|
|
742
|
+
function _getStandardProps(context) {
|
|
345
743
|
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;
|
|
744
|
+
version: 1,
|
|
745
|
+
vendor: "valibot",
|
|
746
|
+
validate(value$1) {
|
|
747
|
+
return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
|
|
359
748
|
}
|
|
360
749
|
};
|
|
361
750
|
}
|
|
362
751
|
// @__NO_SIDE_EFFECTS__
|
|
363
|
-
function object
|
|
364
|
-
return
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
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);
|
|
752
|
+
function _isValidObjectKey(object$1, key) {
|
|
753
|
+
return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
|
|
754
|
+
}
|
|
755
|
+
// @__NO_SIDE_EFFECTS__
|
|
756
|
+
function _joinExpects(values$1, separator) {
|
|
757
|
+
const list = [...new Set(values$1)];
|
|
758
|
+
if (list.length > 1) return `(${list.join(` ${separator} `)})`;
|
|
759
|
+
return list[0] ?? "never";
|
|
760
|
+
}
|
|
761
|
+
var ValiError = class extends Error {
|
|
762
|
+
/**
|
|
763
|
+
* Creates a Valibot error with useful information.
|
|
764
|
+
*
|
|
765
|
+
* @param issues The error issues.
|
|
766
|
+
*/
|
|
767
|
+
constructor(issues) {
|
|
768
|
+
super(issues[0].message);
|
|
769
|
+
this.name = "ValiError";
|
|
770
|
+
this.issues = issues;
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
// @__NO_SIDE_EFFECTS__
|
|
774
|
+
function check(requirement, message$1) {
|
|
775
|
+
return {
|
|
776
|
+
kind: "validation",
|
|
777
|
+
type: "check",
|
|
778
|
+
reference: check,
|
|
779
|
+
async: false,
|
|
780
|
+
expects: null,
|
|
781
|
+
requirement,
|
|
782
|
+
message: message$1,
|
|
783
|
+
"~run"(dataset, config$1) {
|
|
784
|
+
if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1);
|
|
423
785
|
return dataset;
|
|
424
786
|
}
|
|
425
787
|
};
|
|
426
788
|
}
|
|
427
789
|
// @__NO_SIDE_EFFECTS__
|
|
428
|
-
function
|
|
790
|
+
function integer(message$1) {
|
|
429
791
|
return {
|
|
430
|
-
kind: "
|
|
431
|
-
type: "
|
|
432
|
-
reference:
|
|
433
|
-
expects: `(${wrapped.expects} | undefined)`,
|
|
792
|
+
kind: "validation",
|
|
793
|
+
type: "integer",
|
|
794
|
+
reference: integer,
|
|
434
795
|
async: false,
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
439
|
-
},
|
|
796
|
+
expects: null,
|
|
797
|
+
requirement: Number.isInteger,
|
|
798
|
+
message: message$1,
|
|
440
799
|
"~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);
|
|
800
|
+
if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1);
|
|
801
|
+
return dataset;
|
|
449
802
|
}
|
|
450
803
|
};
|
|
451
804
|
}
|
|
452
805
|
// @__NO_SIDE_EFFECTS__
|
|
453
|
-
function
|
|
806
|
+
function transform(operation) {
|
|
454
807
|
return {
|
|
455
|
-
kind: "
|
|
456
|
-
type: "
|
|
457
|
-
reference:
|
|
458
|
-
expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"),
|
|
808
|
+
kind: "transformation",
|
|
809
|
+
type: "transform",
|
|
810
|
+
reference: transform,
|
|
459
811
|
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);
|
|
812
|
+
operation,
|
|
813
|
+
"~run"(dataset) {
|
|
814
|
+
dataset.value = this.operation(dataset.value);
|
|
468
815
|
return dataset;
|
|
469
816
|
}
|
|
470
817
|
};
|
|
471
818
|
}
|
|
472
819
|
// @__NO_SIDE_EFFECTS__
|
|
473
|
-
function
|
|
820
|
+
function getFallback(schema, dataset, config$1) {
|
|
821
|
+
return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
|
|
822
|
+
}
|
|
823
|
+
// @__NO_SIDE_EFFECTS__
|
|
824
|
+
function getDefault(schema, dataset, config$1) {
|
|
825
|
+
return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
|
|
826
|
+
}
|
|
827
|
+
// @__NO_SIDE_EFFECTS__
|
|
828
|
+
function is(schema, input) {
|
|
829
|
+
return !schema["~run"]({ value: input }, { abortEarly: true }).issues;
|
|
830
|
+
}
|
|
831
|
+
// @__NO_SIDE_EFFECTS__
|
|
832
|
+
function array(item, message$1) {
|
|
474
833
|
return {
|
|
475
834
|
kind: "schema",
|
|
476
|
-
type: "
|
|
477
|
-
reference:
|
|
478
|
-
expects: "
|
|
835
|
+
type: "array",
|
|
836
|
+
reference: array,
|
|
837
|
+
expects: "Array",
|
|
479
838
|
async: false,
|
|
480
|
-
|
|
481
|
-
value: value$1,
|
|
839
|
+
item,
|
|
482
840
|
message: message$1,
|
|
483
841
|
get "~standard"() {
|
|
484
842
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
485
843
|
},
|
|
486
844
|
"~run"(dataset, config$1) {
|
|
487
845
|
const input = dataset.value;
|
|
488
|
-
if (input
|
|
846
|
+
if (Array.isArray(input)) {
|
|
489
847
|
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) {
|
|
848
|
+
dataset.value = [];
|
|
849
|
+
for (let key = 0; key < input.length; key++) {
|
|
850
|
+
const value$1 = input[key];
|
|
851
|
+
const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
|
|
852
|
+
if (itemDataset.issues) {
|
|
514
853
|
const pathItem = {
|
|
515
|
-
type: "
|
|
854
|
+
type: "array",
|
|
516
855
|
origin: "value",
|
|
517
856
|
input,
|
|
518
|
-
key
|
|
519
|
-
value:
|
|
857
|
+
key,
|
|
858
|
+
value: value$1
|
|
520
859
|
};
|
|
521
|
-
for (const issue of
|
|
860
|
+
for (const issue of itemDataset.issues) {
|
|
522
861
|
if (issue.path) issue.path.unshift(pathItem);
|
|
523
862
|
else issue.path = [pathItem];
|
|
524
863
|
dataset.issues?.push(issue);
|
|
525
864
|
}
|
|
526
|
-
if (!dataset.issues) dataset.issues =
|
|
865
|
+
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
527
866
|
if (config$1.abortEarly) {
|
|
528
867
|
dataset.typed = false;
|
|
529
868
|
break;
|
|
530
869
|
}
|
|
531
870
|
}
|
|
532
|
-
if (!
|
|
533
|
-
|
|
871
|
+
if (!itemDataset.typed) dataset.typed = false;
|
|
872
|
+
dataset.value.push(itemDataset.value);
|
|
534
873
|
}
|
|
535
874
|
} else _addIssue(this, "type", dataset, config$1);
|
|
536
875
|
return dataset;
|
|
@@ -538,1066 +877,748 @@ function record(key, value$1, message$1) {
|
|
|
538
877
|
};
|
|
539
878
|
}
|
|
540
879
|
// @__NO_SIDE_EFFECTS__
|
|
541
|
-
function
|
|
880
|
+
function bigint(message$1) {
|
|
542
881
|
return {
|
|
543
882
|
kind: "schema",
|
|
544
|
-
type: "
|
|
545
|
-
reference:
|
|
546
|
-
expects: "
|
|
883
|
+
type: "bigint",
|
|
884
|
+
reference: bigint,
|
|
885
|
+
expects: "bigint",
|
|
547
886
|
async: false,
|
|
548
887
|
message: message$1,
|
|
549
888
|
get "~standard"() {
|
|
550
889
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
551
890
|
},
|
|
552
891
|
"~run"(dataset, config$1) {
|
|
553
|
-
if (typeof dataset.value === "
|
|
892
|
+
if (typeof dataset.value === "bigint") dataset.typed = true;
|
|
554
893
|
else _addIssue(this, "type", dataset, config$1);
|
|
555
894
|
return dataset;
|
|
556
895
|
}
|
|
557
896
|
};
|
|
558
897
|
}
|
|
559
898
|
// @__NO_SIDE_EFFECTS__
|
|
560
|
-
function
|
|
899
|
+
function boolean(message$1) {
|
|
561
900
|
return {
|
|
562
901
|
kind: "schema",
|
|
563
|
-
type: "
|
|
564
|
-
reference:
|
|
565
|
-
expects: "
|
|
902
|
+
type: "boolean",
|
|
903
|
+
reference: boolean,
|
|
904
|
+
expects: "boolean",
|
|
566
905
|
async: false,
|
|
567
|
-
items,
|
|
568
906
|
message: message$1,
|
|
569
907
|
get "~standard"() {
|
|
570
908
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
571
909
|
},
|
|
572
910
|
"~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);
|
|
911
|
+
if (typeof dataset.value === "boolean") dataset.typed = true;
|
|
912
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
603
913
|
return dataset;
|
|
604
914
|
}
|
|
605
915
|
};
|
|
606
916
|
}
|
|
607
917
|
// @__NO_SIDE_EFFECTS__
|
|
608
|
-
function
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
918
|
+
function lazy(getter) {
|
|
919
|
+
return {
|
|
920
|
+
kind: "schema",
|
|
921
|
+
type: "lazy",
|
|
922
|
+
reference: lazy,
|
|
923
|
+
expects: "unknown",
|
|
924
|
+
async: false,
|
|
925
|
+
getter,
|
|
926
|
+
get "~standard"() {
|
|
927
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
928
|
+
},
|
|
929
|
+
"~run"(dataset, config$1) {
|
|
930
|
+
return this.getter(dataset.value)["~run"](dataset, config$1);
|
|
931
|
+
}
|
|
932
|
+
};
|
|
613
933
|
}
|
|
614
934
|
// @__NO_SIDE_EFFECTS__
|
|
615
|
-
function
|
|
935
|
+
function literal(literal_, message$1) {
|
|
616
936
|
return {
|
|
617
937
|
kind: "schema",
|
|
618
|
-
type: "
|
|
619
|
-
reference:
|
|
620
|
-
expects: /* @__PURE__ */
|
|
938
|
+
type: "literal",
|
|
939
|
+
reference: literal,
|
|
940
|
+
expects: /* @__PURE__ */ _stringify(literal_),
|
|
621
941
|
async: false,
|
|
622
|
-
|
|
942
|
+
literal: literal_,
|
|
623
943
|
message: message$1,
|
|
624
944
|
get "~standard"() {
|
|
625
945
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
626
946
|
},
|
|
627
947
|
"~run"(dataset, config$1) {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
let untypedDatasets;
|
|
631
|
-
for (const schema of this.options) {
|
|
632
|
-
const optionDataset = schema["~run"]({ value: dataset.value }, config$1);
|
|
633
|
-
if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
|
|
634
|
-
else typedDatasets = [optionDataset];
|
|
635
|
-
else {
|
|
636
|
-
validDataset = optionDataset;
|
|
637
|
-
break;
|
|
638
|
-
}
|
|
639
|
-
else if (untypedDatasets) untypedDatasets.push(optionDataset);
|
|
640
|
-
else untypedDatasets = [optionDataset];
|
|
641
|
-
}
|
|
642
|
-
if (validDataset) return validDataset;
|
|
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) });
|
|
948
|
+
if (dataset.value === this.literal) dataset.typed = true;
|
|
949
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
649
950
|
return dataset;
|
|
650
951
|
}
|
|
651
952
|
};
|
|
652
953
|
}
|
|
653
954
|
// @__NO_SIDE_EFFECTS__
|
|
654
|
-
function
|
|
955
|
+
function nullable(wrapped, default_) {
|
|
956
|
+
return {
|
|
957
|
+
kind: "schema",
|
|
958
|
+
type: "nullable",
|
|
959
|
+
reference: nullable,
|
|
960
|
+
expects: `(${wrapped.expects} | null)`,
|
|
961
|
+
async: false,
|
|
962
|
+
wrapped,
|
|
963
|
+
default: default_,
|
|
964
|
+
get "~standard"() {
|
|
965
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
966
|
+
},
|
|
967
|
+
"~run"(dataset, config$1) {
|
|
968
|
+
if (dataset.value === null) {
|
|
969
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
970
|
+
if (dataset.value === null) {
|
|
971
|
+
dataset.typed = true;
|
|
972
|
+
return dataset;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
976
|
+
}
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
// @__NO_SIDE_EFFECTS__
|
|
980
|
+
function nullish(wrapped, default_) {
|
|
655
981
|
return {
|
|
656
982
|
kind: "schema",
|
|
657
|
-
type: "
|
|
658
|
-
reference:
|
|
659
|
-
expects:
|
|
983
|
+
type: "nullish",
|
|
984
|
+
reference: nullish,
|
|
985
|
+
expects: `(${wrapped.expects} | null | undefined)`,
|
|
660
986
|
async: false,
|
|
987
|
+
wrapped,
|
|
988
|
+
default: default_,
|
|
661
989
|
get "~standard"() {
|
|
662
990
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
663
991
|
},
|
|
664
|
-
"~run"(dataset) {
|
|
665
|
-
dataset.
|
|
666
|
-
|
|
992
|
+
"~run"(dataset, config$1) {
|
|
993
|
+
if (dataset.value === null || dataset.value === void 0) {
|
|
994
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
995
|
+
if (dataset.value === null || dataset.value === void 0) {
|
|
996
|
+
dataset.typed = true;
|
|
997
|
+
return dataset;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
667
1001
|
}
|
|
668
1002
|
};
|
|
669
1003
|
}
|
|
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
1004
|
// @__NO_SIDE_EFFECTS__
|
|
676
|
-
function
|
|
1005
|
+
function number(message$1) {
|
|
677
1006
|
return {
|
|
678
|
-
|
|
679
|
-
|
|
1007
|
+
kind: "schema",
|
|
1008
|
+
type: "number",
|
|
1009
|
+
reference: number,
|
|
1010
|
+
expects: "number",
|
|
1011
|
+
async: false,
|
|
1012
|
+
message: message$1,
|
|
680
1013
|
get "~standard"() {
|
|
681
1014
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
682
1015
|
},
|
|
683
1016
|
"~run"(dataset, config$1) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
|
|
690
|
-
}
|
|
691
|
-
return dataset;
|
|
692
|
-
}
|
|
693
|
-
};
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/transactions/data/internal.mjs
|
|
697
|
-
function safeEnum(options) {
|
|
698
|
-
return union(Object.keys(options).map((key) => withKind(key, object({ [key]: options[key] }))));
|
|
699
|
-
}
|
|
700
|
-
function withKind(key, schema) {
|
|
701
|
-
return pipe(object({
|
|
702
|
-
...schema.entries,
|
|
703
|
-
$kind: optional(literal(key))
|
|
704
|
-
}), transform((value) => ({
|
|
705
|
-
...value,
|
|
706
|
-
$kind: key
|
|
707
|
-
})));
|
|
708
|
-
}
|
|
709
|
-
var SuiAddress = pipe(string(), transform((value) => normalizeSuiAddress(value)), check(isValidSuiAddress));
|
|
710
|
-
var ObjectID = SuiAddress;
|
|
711
|
-
var BCSBytes = string();
|
|
712
|
-
var JsonU64 = pipe(union([string(), pipe(number(), integer())]), check((val) => {
|
|
713
|
-
try {
|
|
714
|
-
BigInt(val);
|
|
715
|
-
return BigInt(val) >= 0 && BigInt(val) <= 18446744073709551615n;
|
|
716
|
-
} catch {
|
|
717
|
-
return false;
|
|
718
|
-
}
|
|
719
|
-
}, "Invalid u64"));
|
|
720
|
-
var U32 = pipe(number(), integer(), check((val) => val >= 0 && val < 2 ** 32, "Invalid u32"));
|
|
721
|
-
var ObjectRefSchema = object({
|
|
722
|
-
objectId: SuiAddress,
|
|
723
|
-
version: JsonU64,
|
|
724
|
-
digest: string()
|
|
725
|
-
});
|
|
726
|
-
var ArgumentSchema = union([
|
|
727
|
-
withKind("GasCoin", object({ GasCoin: literal(true) })),
|
|
728
|
-
withKind("Input", object({
|
|
729
|
-
Input: pipe(number(), integer()),
|
|
730
|
-
type: optional(union([
|
|
731
|
-
literal("pure"),
|
|
732
|
-
literal("object"),
|
|
733
|
-
literal("withdrawal")
|
|
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);
|
|
1017
|
+
if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
|
|
1018
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1019
|
+
return dataset;
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
896
1022
|
}
|
|
897
|
-
|
|
898
|
-
|
|
1023
|
+
// @__NO_SIDE_EFFECTS__
|
|
1024
|
+
function object(entries$1, message$1) {
|
|
1025
|
+
return {
|
|
1026
|
+
kind: "schema",
|
|
1027
|
+
type: "object",
|
|
1028
|
+
reference: object,
|
|
1029
|
+
expects: "Object",
|
|
1030
|
+
async: false,
|
|
1031
|
+
entries: entries$1,
|
|
1032
|
+
message: message$1,
|
|
1033
|
+
get "~standard"() {
|
|
1034
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1035
|
+
},
|
|
1036
|
+
"~run"(dataset, config$1) {
|
|
1037
|
+
const input = dataset.value;
|
|
1038
|
+
if (input && typeof input === "object") {
|
|
1039
|
+
dataset.typed = true;
|
|
1040
|
+
dataset.value = {};
|
|
1041
|
+
for (const key in this.entries) {
|
|
1042
|
+
const valueSchema = this.entries[key];
|
|
1043
|
+
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
1044
|
+
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
1045
|
+
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
1046
|
+
if (valueDataset.issues) {
|
|
1047
|
+
const pathItem = {
|
|
1048
|
+
type: "object",
|
|
1049
|
+
origin: "value",
|
|
1050
|
+
input,
|
|
1051
|
+
key,
|
|
1052
|
+
value: value$1
|
|
1053
|
+
};
|
|
1054
|
+
for (const issue of valueDataset.issues) {
|
|
1055
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1056
|
+
else issue.path = [pathItem];
|
|
1057
|
+
dataset.issues?.push(issue);
|
|
1058
|
+
}
|
|
1059
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1060
|
+
if (config$1.abortEarly) {
|
|
1061
|
+
dataset.typed = false;
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
if (!valueDataset.typed) dataset.typed = false;
|
|
1066
|
+
dataset.value[key] = valueDataset.value;
|
|
1067
|
+
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
1068
|
+
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
1069
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
1070
|
+
input: void 0,
|
|
1071
|
+
expected: `"${key}"`,
|
|
1072
|
+
path: [{
|
|
1073
|
+
type: "object",
|
|
1074
|
+
origin: "key",
|
|
1075
|
+
input,
|
|
1076
|
+
key,
|
|
1077
|
+
value: input[key]
|
|
1078
|
+
}]
|
|
1079
|
+
});
|
|
1080
|
+
if (config$1.abortEarly) break;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1084
|
+
return dataset;
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
899
1087
|
}
|
|
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;
|
|
1088
|
+
// @__NO_SIDE_EFFECTS__
|
|
1089
|
+
function optional(wrapped, default_) {
|
|
1090
|
+
return {
|
|
1091
|
+
kind: "schema",
|
|
1092
|
+
type: "optional",
|
|
1093
|
+
reference: optional,
|
|
1094
|
+
expects: `(${wrapped.expects} | undefined)`,
|
|
1095
|
+
async: false,
|
|
1096
|
+
wrapped,
|
|
1097
|
+
default: default_,
|
|
1098
|
+
get "~standard"() {
|
|
1099
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1100
|
+
},
|
|
1101
|
+
"~run"(dataset, config$1) {
|
|
1102
|
+
if (dataset.value === void 0) {
|
|
1103
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
1104
|
+
if (dataset.value === void 0) {
|
|
1105
|
+
dataset.typed = true;
|
|
1106
|
+
return dataset;
|
|
1107
|
+
}
|
|
926
1108
|
}
|
|
927
|
-
|
|
928
|
-
return arg;
|
|
1109
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
929
1110
|
}
|
|
930
1111
|
};
|
|
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;
|
|
1112
|
+
}
|
|
1113
|
+
// @__NO_SIDE_EFFECTS__
|
|
1114
|
+
function picklist(options, message$1) {
|
|
1115
|
+
return {
|
|
1116
|
+
kind: "schema",
|
|
1117
|
+
type: "picklist",
|
|
1118
|
+
reference: picklist,
|
|
1119
|
+
expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"),
|
|
1120
|
+
async: false,
|
|
1121
|
+
options,
|
|
1122
|
+
message: message$1,
|
|
1123
|
+
get "~standard"() {
|
|
1124
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1125
|
+
},
|
|
1126
|
+
"~run"(dataset, config$1) {
|
|
1127
|
+
if (this.options.includes(dataset.value)) dataset.typed = true;
|
|
1128
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1129
|
+
return dataset;
|
|
958
1130
|
}
|
|
959
|
-
|
|
960
|
-
break;
|
|
961
|
-
}
|
|
1131
|
+
};
|
|
962
1132
|
}
|
|
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
|
-
|
|
1133
|
+
// @__NO_SIDE_EFFECTS__
|
|
1134
|
+
function record(key, value$1, message$1) {
|
|
1135
|
+
return {
|
|
1136
|
+
kind: "schema",
|
|
1137
|
+
type: "record",
|
|
1138
|
+
reference: record,
|
|
1139
|
+
expects: "Object",
|
|
1140
|
+
async: false,
|
|
1141
|
+
key,
|
|
1142
|
+
value: value$1,
|
|
1143
|
+
message: message$1,
|
|
1144
|
+
get "~standard"() {
|
|
1145
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1146
|
+
},
|
|
1147
|
+
"~run"(dataset, config$1) {
|
|
1148
|
+
const input = dataset.value;
|
|
1149
|
+
if (input && typeof input === "object") {
|
|
1150
|
+
dataset.typed = true;
|
|
1151
|
+
dataset.value = {};
|
|
1152
|
+
for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {
|
|
1153
|
+
const entryValue = input[entryKey];
|
|
1154
|
+
const keyDataset = this.key["~run"]({ value: entryKey }, config$1);
|
|
1155
|
+
if (keyDataset.issues) {
|
|
1156
|
+
const pathItem = {
|
|
1157
|
+
type: "object",
|
|
1158
|
+
origin: "key",
|
|
1159
|
+
input,
|
|
1160
|
+
key: entryKey,
|
|
1161
|
+
value: entryValue
|
|
1162
|
+
};
|
|
1163
|
+
for (const issue of keyDataset.issues) {
|
|
1164
|
+
issue.path = [pathItem];
|
|
1165
|
+
dataset.issues?.push(issue);
|
|
1166
|
+
}
|
|
1167
|
+
if (!dataset.issues) dataset.issues = keyDataset.issues;
|
|
1168
|
+
if (config$1.abortEarly) {
|
|
1169
|
+
dataset.typed = false;
|
|
1170
|
+
break;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
const valueDataset = this.value["~run"]({ value: entryValue }, config$1);
|
|
1174
|
+
if (valueDataset.issues) {
|
|
1175
|
+
const pathItem = {
|
|
1176
|
+
type: "object",
|
|
1177
|
+
origin: "value",
|
|
1178
|
+
input,
|
|
1179
|
+
key: entryKey,
|
|
1180
|
+
value: entryValue
|
|
1181
|
+
};
|
|
1182
|
+
for (const issue of valueDataset.issues) {
|
|
1183
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1184
|
+
else issue.path = [pathItem];
|
|
1185
|
+
dataset.issues?.push(issue);
|
|
1186
|
+
}
|
|
1187
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1188
|
+
if (config$1.abortEarly) {
|
|
1189
|
+
dataset.typed = false;
|
|
1190
|
+
break;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;
|
|
1194
|
+
if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;
|
|
1195
|
+
}
|
|
1196
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1197
|
+
return dataset;
|
|
1007
1198
|
}
|
|
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
|
-
});
|
|
1199
|
+
};
|
|
1021
1200
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1201
|
+
// @__NO_SIDE_EFFECTS__
|
|
1202
|
+
function string(message$1) {
|
|
1203
|
+
return {
|
|
1204
|
+
kind: "schema",
|
|
1205
|
+
type: "string",
|
|
1206
|
+
reference: string,
|
|
1207
|
+
expects: "string",
|
|
1208
|
+
async: false,
|
|
1209
|
+
message: message$1,
|
|
1210
|
+
get "~standard"() {
|
|
1211
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1212
|
+
},
|
|
1213
|
+
"~run"(dataset, config$1) {
|
|
1214
|
+
if (typeof dataset.value === "string") dataset.typed = true;
|
|
1215
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1216
|
+
return dataset;
|
|
1217
|
+
}
|
|
1218
|
+
};
|
|
1027
1219
|
}
|
|
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
|
-
});
|
|
1220
|
+
// @__NO_SIDE_EFFECTS__
|
|
1221
|
+
function tuple(items, message$1) {
|
|
1222
|
+
return {
|
|
1223
|
+
kind: "schema",
|
|
1224
|
+
type: "tuple",
|
|
1225
|
+
reference: tuple,
|
|
1226
|
+
expects: "Array",
|
|
1227
|
+
async: false,
|
|
1228
|
+
items,
|
|
1229
|
+
message: message$1,
|
|
1230
|
+
get "~standard"() {
|
|
1231
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1232
|
+
},
|
|
1233
|
+
"~run"(dataset, config$1) {
|
|
1234
|
+
const input = dataset.value;
|
|
1235
|
+
if (Array.isArray(input)) {
|
|
1236
|
+
dataset.typed = true;
|
|
1237
|
+
dataset.value = [];
|
|
1238
|
+
for (let key = 0; key < this.items.length; key++) {
|
|
1239
|
+
const value$1 = input[key];
|
|
1240
|
+
const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1);
|
|
1241
|
+
if (itemDataset.issues) {
|
|
1242
|
+
const pathItem = {
|
|
1243
|
+
type: "array",
|
|
1244
|
+
origin: "value",
|
|
1245
|
+
input,
|
|
1246
|
+
key,
|
|
1247
|
+
value: value$1
|
|
1248
|
+
};
|
|
1249
|
+
for (const issue of itemDataset.issues) {
|
|
1250
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1251
|
+
else issue.path = [pathItem];
|
|
1252
|
+
dataset.issues?.push(issue);
|
|
1253
|
+
}
|
|
1254
|
+
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
1255
|
+
if (config$1.abortEarly) {
|
|
1256
|
+
dataset.typed = false;
|
|
1257
|
+
break;
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
if (!itemDataset.typed) dataset.typed = false;
|
|
1261
|
+
dataset.value.push(itemDataset.value);
|
|
1262
|
+
}
|
|
1263
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1264
|
+
return dataset;
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
// @__NO_SIDE_EFFECTS__
|
|
1269
|
+
function _subIssues(datasets) {
|
|
1270
|
+
let issues;
|
|
1271
|
+
if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);
|
|
1272
|
+
else issues = dataset.issues;
|
|
1273
|
+
return issues;
|
|
1274
|
+
}
|
|
1275
|
+
// @__NO_SIDE_EFFECTS__
|
|
1276
|
+
function union(options, message$1) {
|
|
1277
|
+
return {
|
|
1278
|
+
kind: "schema",
|
|
1279
|
+
type: "union",
|
|
1280
|
+
reference: union,
|
|
1281
|
+
expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
|
|
1282
|
+
async: false,
|
|
1283
|
+
options,
|
|
1284
|
+
message: message$1,
|
|
1285
|
+
get "~standard"() {
|
|
1286
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1287
|
+
},
|
|
1288
|
+
"~run"(dataset, config$1) {
|
|
1289
|
+
let validDataset;
|
|
1290
|
+
let typedDatasets;
|
|
1291
|
+
let untypedDatasets;
|
|
1292
|
+
for (const schema of this.options) {
|
|
1293
|
+
const optionDataset = schema["~run"]({ value: dataset.value }, config$1);
|
|
1294
|
+
if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
|
|
1295
|
+
else typedDatasets = [optionDataset];
|
|
1296
|
+
else {
|
|
1297
|
+
validDataset = optionDataset;
|
|
1298
|
+
break;
|
|
1299
|
+
}
|
|
1300
|
+
else if (untypedDatasets) untypedDatasets.push(optionDataset);
|
|
1301
|
+
else untypedDatasets = [optionDataset];
|
|
1302
|
+
}
|
|
1303
|
+
if (validDataset) return validDataset;
|
|
1304
|
+
if (typedDatasets) {
|
|
1305
|
+
if (typedDatasets.length === 1) return typedDatasets[0];
|
|
1306
|
+
_addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
|
|
1307
|
+
dataset.typed = true;
|
|
1308
|
+
} else if (untypedDatasets?.length === 1) return untypedDatasets[0];
|
|
1309
|
+
else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
|
|
1310
|
+
return dataset;
|
|
1311
|
+
}
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
// @__NO_SIDE_EFFECTS__
|
|
1315
|
+
function unknown() {
|
|
1316
|
+
return {
|
|
1317
|
+
kind: "schema",
|
|
1318
|
+
type: "unknown",
|
|
1319
|
+
reference: unknown,
|
|
1320
|
+
expects: "unknown",
|
|
1321
|
+
async: false,
|
|
1322
|
+
get "~standard"() {
|
|
1323
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1324
|
+
},
|
|
1325
|
+
"~run"(dataset) {
|
|
1326
|
+
dataset.typed = true;
|
|
1327
|
+
return dataset;
|
|
1328
|
+
}
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
function parse(schema, input, config$1) {
|
|
1332
|
+
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
|
|
1333
|
+
if (dataset.issues) throw new ValiError(dataset.issues);
|
|
1334
|
+
return dataset.value;
|
|
1335
|
+
}
|
|
1336
|
+
// @__NO_SIDE_EFFECTS__
|
|
1337
|
+
function pipe(...pipe$1) {
|
|
1338
|
+
return {
|
|
1339
|
+
...pipe$1[0],
|
|
1340
|
+
pipe: pipe$1,
|
|
1341
|
+
get "~standard"() {
|
|
1342
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
1343
|
+
},
|
|
1344
|
+
"~run"(dataset, config$1) {
|
|
1345
|
+
for (const item of pipe$1) if (item.kind !== "metadata") {
|
|
1346
|
+
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
1347
|
+
dataset.typed = false;
|
|
1348
|
+
break;
|
|
1349
|
+
}
|
|
1350
|
+
if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
|
|
1351
|
+
}
|
|
1352
|
+
return dataset;
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1216
1355
|
}
|
|
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
1356
|
|
|
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
|
-
|
|
1357
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/transactions/data/internal.mjs
|
|
1358
|
+
function safeEnum(options) {
|
|
1359
|
+
return union(Object.keys(options).map((key) => withKind(key, object({ [key]: options[key] }))));
|
|
1360
|
+
}
|
|
1361
|
+
function withKind(key, schema) {
|
|
1362
|
+
return pipe(object({
|
|
1363
|
+
...schema.entries,
|
|
1364
|
+
$kind: optional(literal(key))
|
|
1365
|
+
}), transform((value) => ({
|
|
1366
|
+
...value,
|
|
1367
|
+
$kind: key
|
|
1368
|
+
})));
|
|
1369
|
+
}
|
|
1370
|
+
var SuiAddress = pipe(string(), transform((value) => normalizeSuiAddress(value)), check(isValidSuiAddress));
|
|
1371
|
+
var ObjectID = SuiAddress;
|
|
1372
|
+
var BCSBytes = string();
|
|
1373
|
+
var JsonU64 = pipe(union([string(), pipe(number(), integer())]), check((val) => {
|
|
1374
|
+
try {
|
|
1375
|
+
BigInt(val);
|
|
1376
|
+
return BigInt(val) >= 0 && BigInt(val) <= 18446744073709551615n;
|
|
1377
|
+
} catch {
|
|
1378
|
+
return false;
|
|
1379
|
+
}
|
|
1380
|
+
}, "Invalid u64"));
|
|
1381
|
+
var U32 = pipe(number(), integer(), check((val) => val >= 0 && val < 2 ** 32, "Invalid u32"));
|
|
1382
|
+
var ObjectRefSchema = object({
|
|
1383
|
+
objectId: SuiAddress,
|
|
1384
|
+
version: JsonU64,
|
|
1385
|
+
digest: string()
|
|
1309
1386
|
});
|
|
1310
|
-
var
|
|
1311
|
-
|
|
1312
|
-
|
|
1387
|
+
var ArgumentSchema = union([
|
|
1388
|
+
withKind("GasCoin", object({ GasCoin: literal(true) })),
|
|
1389
|
+
withKind("Input", object({
|
|
1390
|
+
Input: pipe(number(), integer()),
|
|
1391
|
+
type: optional(union([
|
|
1392
|
+
literal("pure"),
|
|
1393
|
+
literal("object"),
|
|
1394
|
+
literal("withdrawal")
|
|
1395
|
+
]))
|
|
1396
|
+
})),
|
|
1397
|
+
withKind("Result", object({ Result: pipe(number(), integer()) })),
|
|
1398
|
+
withKind("NestedResult", object({ NestedResult: tuple([pipe(number(), integer()), pipe(number(), integer())]) }))
|
|
1399
|
+
]);
|
|
1400
|
+
var GasDataSchema = object({
|
|
1401
|
+
budget: nullable(JsonU64),
|
|
1402
|
+
price: nullable(JsonU64),
|
|
1403
|
+
owner: nullable(SuiAddress),
|
|
1404
|
+
payment: nullable(array(ObjectRefSchema))
|
|
1313
1405
|
});
|
|
1314
|
-
var
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1406
|
+
var StructTagSchema = object({
|
|
1407
|
+
address: string(),
|
|
1408
|
+
module: string(),
|
|
1409
|
+
name: string(),
|
|
1410
|
+
typeParams: array(string())
|
|
1319
1411
|
});
|
|
1320
|
-
var
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1412
|
+
var OpenSignatureBodySchema = union([
|
|
1413
|
+
object({ $kind: literal("address") }),
|
|
1414
|
+
object({ $kind: literal("bool") }),
|
|
1415
|
+
object({ $kind: literal("u8") }),
|
|
1416
|
+
object({ $kind: literal("u16") }),
|
|
1417
|
+
object({ $kind: literal("u32") }),
|
|
1418
|
+
object({ $kind: literal("u64") }),
|
|
1419
|
+
object({ $kind: literal("u128") }),
|
|
1420
|
+
object({ $kind: literal("u256") }),
|
|
1421
|
+
object({ $kind: literal("unknown") }),
|
|
1422
|
+
object({
|
|
1423
|
+
$kind: literal("vector"),
|
|
1424
|
+
vector: lazy(() => OpenSignatureBodySchema)
|
|
1329
1425
|
}),
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1426
|
+
object({
|
|
1427
|
+
$kind: literal("datatype"),
|
|
1428
|
+
datatype: object({
|
|
1429
|
+
typeName: string(),
|
|
1430
|
+
typeParameters: array(lazy(() => OpenSignatureBodySchema))
|
|
1431
|
+
})
|
|
1432
|
+
}),
|
|
1433
|
+
object({
|
|
1434
|
+
$kind: literal("typeParameter"),
|
|
1435
|
+
index: pipe(number(), integer())
|
|
1436
|
+
})
|
|
1437
|
+
]);
|
|
1438
|
+
var OpenSignatureSchema = object({
|
|
1439
|
+
reference: nullable(union([
|
|
1440
|
+
literal("mutable"),
|
|
1441
|
+
literal("immutable"),
|
|
1442
|
+
literal("unknown")
|
|
1443
|
+
])),
|
|
1444
|
+
body: OpenSignatureBodySchema
|
|
1343
1445
|
});
|
|
1344
|
-
var
|
|
1345
|
-
|
|
1346
|
-
|
|
1446
|
+
var ProgrammableMoveCallSchema = object({
|
|
1447
|
+
package: ObjectID,
|
|
1448
|
+
module: string(),
|
|
1449
|
+
function: string(),
|
|
1450
|
+
typeArguments: array(string()),
|
|
1451
|
+
arguments: array(ArgumentSchema),
|
|
1452
|
+
_argumentTypes: optional(nullable(array(OpenSignatureSchema)))
|
|
1347
1453
|
});
|
|
1348
|
-
var
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
objectSize: bcs.u64(),
|
|
1359
|
-
maxObjectSize: bcs.u64()
|
|
1360
|
-
}),
|
|
1361
|
-
CircularObjectOwnership: bcs.struct("CircularObjectOwnership", { object: Address }),
|
|
1362
|
-
InsufficientCoinBalance: null,
|
|
1363
|
-
CoinBalanceOverflow: null,
|
|
1364
|
-
PublishErrorNonZeroAddress: null,
|
|
1365
|
-
SuiMoveVerificationError: null,
|
|
1366
|
-
MovePrimitiveRuntimeError: bcs.option(MoveLocation),
|
|
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
|
|
1377
|
-
}),
|
|
1378
|
-
TypeArgumentError: bcs.struct("TypeArgumentError", {
|
|
1379
|
-
argumentIdx: bcs.u16(),
|
|
1380
|
-
kind: TypeArgumentError
|
|
1381
|
-
}),
|
|
1382
|
-
UnusedValueWithoutDrop: bcs.struct("UnusedValueWithoutDrop", {
|
|
1383
|
-
resultIdx: bcs.u16(),
|
|
1384
|
-
secondaryIdx: bcs.u16()
|
|
1454
|
+
var $Intent = object({
|
|
1455
|
+
name: string(),
|
|
1456
|
+
inputs: record(string(), union([ArgumentSchema, array(ArgumentSchema)])),
|
|
1457
|
+
data: record(string(), unknown())
|
|
1458
|
+
});
|
|
1459
|
+
var CommandSchema = safeEnum({
|
|
1460
|
+
MoveCall: ProgrammableMoveCallSchema,
|
|
1461
|
+
TransferObjects: object({
|
|
1462
|
+
objects: array(ArgumentSchema),
|
|
1463
|
+
address: ArgumentSchema
|
|
1385
1464
|
}),
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
currentSize: bcs.u64(),
|
|
1390
|
-
maxSize: bcs.u64()
|
|
1465
|
+
SplitCoins: object({
|
|
1466
|
+
coin: ArgumentSchema,
|
|
1467
|
+
amounts: array(ArgumentSchema)
|
|
1391
1468
|
}),
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
WrittenObjectsTooLarge: bcs.struct("WrittenObjectsTooLarge", {
|
|
1396
|
-
currentSize: bcs.u64(),
|
|
1397
|
-
maxSize: bcs.u64()
|
|
1469
|
+
MergeCoins: object({
|
|
1470
|
+
destination: ArgumentSchema,
|
|
1471
|
+
sources: array(ArgumentSchema)
|
|
1398
1472
|
}),
|
|
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()
|
|
1473
|
+
Publish: object({
|
|
1474
|
+
modules: array(BCSBytes),
|
|
1475
|
+
dependencies: array(ObjectID)
|
|
1407
1476
|
}),
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
valueSize: bcs.u64(),
|
|
1412
|
-
maxScaledSize: bcs.u64()
|
|
1477
|
+
MakeMoveVec: object({
|
|
1478
|
+
type: nullable(string()),
|
|
1479
|
+
elements: array(ArgumentSchema)
|
|
1413
1480
|
}),
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1481
|
+
Upgrade: object({
|
|
1482
|
+
modules: array(BCSBytes),
|
|
1483
|
+
dependencies: array(ObjectID),
|
|
1484
|
+
package: ObjectID,
|
|
1485
|
+
ticket: ArgumentSchema
|
|
1417
1486
|
}),
|
|
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
|
|
1487
|
+
$Intent
|
|
1464
1488
|
});
|
|
1465
|
-
var
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1489
|
+
var ObjectArgSchema = safeEnum({
|
|
1490
|
+
ImmOrOwnedObject: ObjectRefSchema,
|
|
1491
|
+
SharedObject: object({
|
|
1492
|
+
objectId: ObjectID,
|
|
1493
|
+
initialSharedVersion: JsonU64,
|
|
1494
|
+
mutable: boolean()
|
|
1495
|
+
}),
|
|
1496
|
+
Receiving: ObjectRefSchema
|
|
1469
1497
|
});
|
|
1470
|
-
var
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1498
|
+
var ReservationSchema = safeEnum({ MaxAmountU64: JsonU64 });
|
|
1499
|
+
var WithdrawalTypeArgSchema = safeEnum({ Balance: string() });
|
|
1500
|
+
var WithdrawFromSchema = safeEnum({
|
|
1501
|
+
Sender: literal(true),
|
|
1502
|
+
Sponsor: literal(true)
|
|
1474
1503
|
});
|
|
1475
|
-
var
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
AccumulatorWriteV1
|
|
1504
|
+
var FundsWithdrawalArgSchema = object({
|
|
1505
|
+
reservation: ReservationSchema,
|
|
1506
|
+
typeArg: WithdrawalTypeArgSchema,
|
|
1507
|
+
withdrawFrom: WithdrawFromSchema
|
|
1480
1508
|
});
|
|
1481
|
-
var
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1509
|
+
var CallArgSchema = safeEnum({
|
|
1510
|
+
Object: ObjectArgSchema,
|
|
1511
|
+
Pure: object({ bytes: BCSBytes }),
|
|
1512
|
+
UnresolvedPure: object({ value: unknown() }),
|
|
1513
|
+
UnresolvedObject: object({
|
|
1514
|
+
objectId: ObjectID,
|
|
1515
|
+
version: optional(nullable(JsonU64)),
|
|
1516
|
+
digest: optional(nullable(string())),
|
|
1517
|
+
initialSharedVersion: optional(nullable(JsonU64)),
|
|
1518
|
+
mutable: optional(nullable(boolean()))
|
|
1519
|
+
}),
|
|
1520
|
+
FundsWithdrawal: FundsWithdrawalArgSchema
|
|
1485
1521
|
});
|
|
1486
|
-
var
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
idOperation: IDOperation
|
|
1522
|
+
var NormalizedCallArg = safeEnum({
|
|
1523
|
+
Object: ObjectArgSchema,
|
|
1524
|
+
Pure: object({ bytes: BCSBytes })
|
|
1490
1525
|
});
|
|
1491
|
-
var
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1526
|
+
var ValidDuringSchema = object({
|
|
1527
|
+
minEpoch: nullable(JsonU64),
|
|
1528
|
+
maxEpoch: nullable(JsonU64),
|
|
1529
|
+
minTimestamp: nullable(JsonU64),
|
|
1530
|
+
maxTimestamp: nullable(JsonU64),
|
|
1531
|
+
chain: string(),
|
|
1532
|
+
nonce: U32
|
|
1497
1533
|
});
|
|
1498
|
-
var
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
transactionDigest: ObjectDigest,
|
|
1503
|
-
gasObjectIndex: bcs.option(bcs.u32()),
|
|
1504
|
-
eventsDigest: bcs.option(ObjectDigest),
|
|
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)
|
|
1534
|
+
var TransactionExpiration2 = safeEnum({
|
|
1535
|
+
None: literal(true),
|
|
1536
|
+
Epoch: JsonU64,
|
|
1537
|
+
ValidDuring: ValidDuringSchema
|
|
1510
1538
|
});
|
|
1511
|
-
var
|
|
1512
|
-
|
|
1513
|
-
|
|
1539
|
+
var TransactionDataSchema = object({
|
|
1540
|
+
version: literal(2),
|
|
1541
|
+
sender: nullish(SuiAddress),
|
|
1542
|
+
expiration: nullish(TransactionExpiration2),
|
|
1543
|
+
gasData: GasDataSchema,
|
|
1544
|
+
inputs: array(CallArgSchema),
|
|
1545
|
+
commands: array(CommandSchema)
|
|
1514
1546
|
});
|
|
1515
1547
|
|
|
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;
|
|
1548
|
+
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/transactions/utils.mjs
|
|
1549
|
+
function getIdFromCallArg(arg) {
|
|
1550
|
+
if (typeof arg === "string") return normalizeSuiAddress(arg);
|
|
1551
|
+
if (arg.Object) {
|
|
1552
|
+
if (arg.Object.ImmOrOwnedObject) return normalizeSuiAddress(arg.Object.ImmOrOwnedObject.objectId);
|
|
1553
|
+
if (arg.Object.Receiving) return normalizeSuiAddress(arg.Object.Receiving.objectId);
|
|
1554
|
+
return normalizeSuiAddress(arg.Object.SharedObject.objectId);
|
|
1538
1555
|
}
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1556
|
+
if (arg.UnresolvedObject) return normalizeSuiAddress(arg.UnresolvedObject.objectId);
|
|
1557
|
+
}
|
|
1558
|
+
function remapCommandArguments(command, inputMapping, commandMapping) {
|
|
1559
|
+
const remapArg = (arg) => {
|
|
1560
|
+
switch (arg.$kind) {
|
|
1561
|
+
case "Input": {
|
|
1562
|
+
const newInputIndex = inputMapping.get(arg.Input);
|
|
1563
|
+
if (newInputIndex === void 0) throw new Error(`Input ${arg.Input} not found in input mapping`);
|
|
1564
|
+
return {
|
|
1565
|
+
...arg,
|
|
1566
|
+
Input: newInputIndex
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
case "Result": {
|
|
1570
|
+
const newCommandIndex = commandMapping.get(arg.Result);
|
|
1571
|
+
if (newCommandIndex !== void 0) return {
|
|
1572
|
+
...arg,
|
|
1573
|
+
Result: newCommandIndex
|
|
1574
|
+
};
|
|
1575
|
+
return arg;
|
|
1576
|
+
}
|
|
1577
|
+
case "NestedResult": {
|
|
1578
|
+
const newCommandIndex = commandMapping.get(arg.NestedResult[0]);
|
|
1579
|
+
if (newCommandIndex !== void 0) return {
|
|
1580
|
+
...arg,
|
|
1581
|
+
NestedResult: [newCommandIndex, arg.NestedResult[1]]
|
|
1582
|
+
};
|
|
1583
|
+
return arg;
|
|
1584
|
+
}
|
|
1585
|
+
default:
|
|
1586
|
+
return arg;
|
|
1587
|
+
}
|
|
1588
|
+
};
|
|
1589
|
+
switch (command.$kind) {
|
|
1590
|
+
case "MoveCall":
|
|
1591
|
+
command.MoveCall.arguments = command.MoveCall.arguments.map(remapArg);
|
|
1592
|
+
break;
|
|
1593
|
+
case "TransferObjects":
|
|
1594
|
+
command.TransferObjects.objects = command.TransferObjects.objects.map(remapArg);
|
|
1595
|
+
command.TransferObjects.address = remapArg(command.TransferObjects.address);
|
|
1596
|
+
break;
|
|
1597
|
+
case "SplitCoins":
|
|
1598
|
+
command.SplitCoins.coin = remapArg(command.SplitCoins.coin);
|
|
1599
|
+
command.SplitCoins.amounts = command.SplitCoins.amounts.map(remapArg);
|
|
1600
|
+
break;
|
|
1601
|
+
case "MergeCoins":
|
|
1602
|
+
command.MergeCoins.destination = remapArg(command.MergeCoins.destination);
|
|
1603
|
+
command.MergeCoins.sources = command.MergeCoins.sources.map(remapArg);
|
|
1604
|
+
break;
|
|
1605
|
+
case "MakeMoveVec":
|
|
1606
|
+
command.MakeMoveVec.elements = command.MakeMoveVec.elements.map(remapArg);
|
|
1607
|
+
break;
|
|
1608
|
+
case "Upgrade":
|
|
1609
|
+
command.Upgrade.ticket = remapArg(command.Upgrade.ticket);
|
|
1610
|
+
break;
|
|
1611
|
+
case "$Intent": {
|
|
1612
|
+
const inputs = command.$Intent.inputs;
|
|
1613
|
+
command.$Intent.inputs = {};
|
|
1614
|
+
for (const [key, value] of Object.entries(inputs)) command.$Intent.inputs[key] = Array.isArray(value) ? value.map(remapArg) : remapArg(value);
|
|
1615
|
+
break;
|
|
1616
|
+
}
|
|
1617
|
+
case "Publish":
|
|
1618
|
+
break;
|
|
1544
1619
|
}
|
|
1545
|
-
throw new Error(`Invalid Pure type name: ${name}`);
|
|
1546
1620
|
}
|
|
1547
1621
|
|
|
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
1622
|
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/transactions/data/v1.mjs
|
|
1602
1623
|
var ObjectRef = object({
|
|
1603
1624
|
digest: string(),
|
|
@@ -2233,16 +2254,6 @@ var TransactionDataBuilder = class TransactionDataBuilder2 {
|
|
|
2233
2254
|
}
|
|
2234
2255
|
};
|
|
2235
2256
|
|
|
2236
|
-
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/utils/constants.mjs
|
|
2237
|
-
var MIST_PER_SUI = BigInt(1e9);
|
|
2238
|
-
var MOVE_STDLIB_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000001";
|
|
2239
|
-
var SUI_FRAMEWORK_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
2240
|
-
var SUI_CLOCK_OBJECT_ID = "0x0000000000000000000000000000000000000000000000000000000000000006";
|
|
2241
|
-
var SUI_TYPE_ARG = `${SUI_FRAMEWORK_ADDRESS}::sui::SUI`;
|
|
2242
|
-
var SUI_SYSTEM_STATE_OBJECT_ID = "0x0000000000000000000000000000000000000000000000000000000000000005";
|
|
2243
|
-
var SUI_RANDOM_OBJECT_ID = "0x0000000000000000000000000000000000000000000000000000000000000008";
|
|
2244
|
-
var SUI_DENY_LIST_OBJECT_ID = "0x0000000000000000000000000000000000000000000000000000000000000403";
|
|
2245
|
-
|
|
2246
2257
|
// ../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/client/errors.mjs
|
|
2247
2258
|
var SuiClientError = class extends Error {
|
|
2248
2259
|
};
|
|
@@ -2274,20 +2285,6 @@ var ObjectError = class ObjectError2 extends SuiClientError {
|
|
|
2274
2285
|
}
|
|
2275
2286
|
};
|
|
2276
2287
|
|
|
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
2288
|
// ../../node_modules/.pnpm/@mysten+utils@0.3.3/node_modules/@mysten/utils/dist/b64.mjs
|
|
2292
2289
|
function fromBase642(base64String2) {
|
|
2293
2290
|
return Uint8Array.from(atob(base64String2), (char) => char.charCodeAt(0));
|
|
@@ -2310,20 +2307,6 @@ function chunk(array2, size) {
|
|
|
2310
2307
|
});
|
|
2311
2308
|
}
|
|
2312
2309
|
|
|
2313
|
-
// ../../node_modules/.pnpm/@mysten+utils@0.3.3/node_modules/@mysten/utils/dist/with-resolver.mjs
|
|
2314
|
-
function promiseWithResolvers() {
|
|
2315
|
-
let resolver;
|
|
2316
|
-
let rejecter;
|
|
2317
|
-
return {
|
|
2318
|
-
promise: new Promise((resolve, reject) => {
|
|
2319
|
-
resolver = resolve;
|
|
2320
|
-
rejecter = reject;
|
|
2321
|
-
}),
|
|
2322
|
-
resolve: resolver,
|
|
2323
|
-
reject: rejecter
|
|
2324
|
-
};
|
|
2325
|
-
}
|
|
2326
|
-
|
|
2327
2310
|
// ../../node_modules/.pnpm/@mysten+utils@0.3.3/node_modules/@mysten/utils/dist/dataloader.mjs
|
|
2328
2311
|
var DataLoader = class {
|
|
2329
2312
|
constructor(batchLoadFn, options) {
|
|
@@ -2777,6 +2760,18 @@ function getNamesFromTypeList(types) {
|
|
|
2777
2760
|
}
|
|
2778
2761
|
|
|
2779
2762
|
export {
|
|
2763
|
+
TypeTagSerializer,
|
|
2764
|
+
ExecutionStatus,
|
|
2765
|
+
pureBcsSchemaFromTypeName,
|
|
2766
|
+
suiBcs,
|
|
2767
|
+
deriveDynamicFieldID,
|
|
2768
|
+
MOVE_STDLIB_ADDRESS,
|
|
2769
|
+
SUI_FRAMEWORK_ADDRESS,
|
|
2770
|
+
SUI_CLOCK_OBJECT_ID,
|
|
2771
|
+
SUI_TYPE_ARG,
|
|
2772
|
+
SUI_SYSTEM_STATE_OBJECT_ID,
|
|
2773
|
+
SUI_RANDOM_OBJECT_ID,
|
|
2774
|
+
SUI_DENY_LIST_OBJECT_ID,
|
|
2780
2775
|
integer,
|
|
2781
2776
|
is,
|
|
2782
2777
|
array,
|
|
@@ -2805,31 +2800,17 @@ export {
|
|
|
2805
2800
|
FundsWithdrawalArgSchema,
|
|
2806
2801
|
NormalizedCallArg,
|
|
2807
2802
|
ValidDuringSchema,
|
|
2808
|
-
TransactionExpiration,
|
|
2803
|
+
TransactionExpiration2 as TransactionExpiration,
|
|
2809
2804
|
getIdFromCallArg,
|
|
2810
|
-
isArgument,
|
|
2811
|
-
TypeTagSerializer,
|
|
2812
|
-
ExecutionStatus,
|
|
2813
|
-
pureBcsSchemaFromTypeName,
|
|
2814
|
-
suiBcs,
|
|
2815
2805
|
serializeV1TransactionData,
|
|
2816
2806
|
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
2807
|
SimulationError,
|
|
2825
2808
|
ObjectError,
|
|
2826
|
-
deriveDynamicFieldID,
|
|
2827
2809
|
fromBase642 as fromBase64,
|
|
2828
2810
|
toBase642 as toBase64,
|
|
2829
2811
|
chunk,
|
|
2830
|
-
promiseWithResolvers,
|
|
2831
2812
|
MvrClient,
|
|
2832
2813
|
findNamesInTransaction,
|
|
2833
2814
|
replaceNames
|
|
2834
2815
|
};
|
|
2835
|
-
//# sourceMappingURL=chunk-
|
|
2816
|
+
//# sourceMappingURL=chunk-X6ON6NN5.js.map
|