@arcblock/validator 1.29.27 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.d.mts +7 -49
- package/esm/index.mjs +7 -135
- package/esm/v/bn.d.mts +16 -0
- package/esm/v/bn.mjs +54 -0
- package/esm/v/did.d.mts +14 -0
- package/esm/v/did.mjs +41 -0
- package/esm/v/helpers.d.mts +15 -0
- package/esm/v/helpers.mjs +61 -0
- package/esm/v/index.d.mts +6 -0
- package/esm/v/index.mjs +8 -0
- package/esm/v/schemas.d.mts +245 -0
- package/esm/v/schemas.mjs +194 -0
- package/lib/index.cjs +31 -137
- package/lib/index.d.cts +6 -49
- package/lib/v/bn.cjs +67 -0
- package/lib/v/bn.d.cts +16 -0
- package/lib/v/did.cjs +43 -0
- package/lib/v/did.d.cts +14 -0
- package/lib/v/helpers.cjs +67 -0
- package/lib/v/helpers.d.cts +15 -0
- package/lib/v/index.cjs +30 -0
- package/lib/v/index.d.cts +6 -0
- package/lib/v/schemas.cjs +196 -0
- package/lib/v/schemas.d.cts +245 -0
- package/package.json +5 -6
- package/esm/extension/bn.d.mts +0 -100
- package/esm/extension/bn.mjs +0 -140
- package/esm/extension/did.d.mts +0 -81
- package/esm/extension/did.mjs +0 -155
- package/lib/extension/bn.cjs +0 -142
- package/lib/extension/bn.d.cts +0 -100
- package/lib/extension/did.cjs +0 -157
- package/lib/extension/did.d.cts +0 -81
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
|
|
3
|
+
//#region src/v/schemas.d.ts
|
|
4
|
+
declare const schemas: {
|
|
5
|
+
context: v.ObjectSchema<{
|
|
6
|
+
readonly genesisTime: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Must be valid ISO date">]>;
|
|
7
|
+
readonly genesisTx: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Must match tx hash pattern or be empty">]>;
|
|
8
|
+
readonly renaissanceTime: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Must be valid ISO date">]>;
|
|
9
|
+
readonly renaissanceTx: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Must match tx hash pattern or be empty">]>;
|
|
10
|
+
}, undefined>;
|
|
11
|
+
tokenInput: v.ObjectSchema<{
|
|
12
|
+
readonly address: any;
|
|
13
|
+
readonly value: any;
|
|
14
|
+
}, undefined>;
|
|
15
|
+
multiInput: v.ArraySchema<v.ObjectSchema<{
|
|
16
|
+
readonly owner: v.UnionSchema<[any, any, any, any, any], undefined>;
|
|
17
|
+
readonly tokensList: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
18
|
+
readonly address: any;
|
|
19
|
+
readonly value: any;
|
|
20
|
+
}, undefined>, undefined>, readonly []>;
|
|
21
|
+
readonly assetsList: v.OptionalSchema<v.ArraySchema<any, undefined>, readonly []>;
|
|
22
|
+
}, undefined>, undefined>;
|
|
23
|
+
multiSig: v.ArraySchema<v.ObjectSchema<{
|
|
24
|
+
readonly signer: any;
|
|
25
|
+
readonly pk: v.AnySchema;
|
|
26
|
+
readonly signature: v.AnySchema;
|
|
27
|
+
readonly delegator: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"", undefined>, any], undefined>, undefined>;
|
|
28
|
+
readonly data: v.OptionalSchema<v.AnySchema, undefined>;
|
|
29
|
+
}, undefined>, undefined>;
|
|
30
|
+
foreignToken: v.ObjectSchema<{
|
|
31
|
+
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 32, undefined>]>;
|
|
32
|
+
readonly contractAddress: any;
|
|
33
|
+
readonly chainType: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 32, undefined>]>;
|
|
34
|
+
readonly chainName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 32, undefined>]>;
|
|
35
|
+
readonly chainId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.CheckAction<number, "Must be positive">]>;
|
|
36
|
+
}, undefined>;
|
|
37
|
+
variableInput: v.ObjectSchema<{
|
|
38
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
|
|
39
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 1024, undefined>]>;
|
|
40
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 256, undefined>]>, "">;
|
|
41
|
+
readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
42
|
+
}, undefined>;
|
|
43
|
+
nftDisplay: v.UnionSchema<[v.ObjectSchema<{
|
|
44
|
+
readonly type: v.LiteralSchema<"uri", undefined>;
|
|
45
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 20480, undefined>, v.CheckAction<string, "Must be a data URI">]>;
|
|
46
|
+
}, undefined>, v.ObjectSchema<{
|
|
47
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
48
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
49
|
+
}, undefined>, v.ObjectSchema<{
|
|
50
|
+
readonly type: v.LiteralSchema<"svg", undefined>;
|
|
51
|
+
readonly content: v.StringSchema<undefined>;
|
|
52
|
+
}, undefined>], undefined>;
|
|
53
|
+
nftEndpoint: v.ObjectSchema<{
|
|
54
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
55
|
+
readonly scope: v.OptionalSchema<v.PicklistSchema<["public", "private"], undefined>, "public">;
|
|
56
|
+
}, undefined>;
|
|
57
|
+
nftIssuer: v.ObjectSchema<{
|
|
58
|
+
readonly id: any;
|
|
59
|
+
readonly pk: v.StringSchema<undefined>;
|
|
60
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
|
|
61
|
+
}, undefined>;
|
|
62
|
+
tokenHolder: v.UnionSchema<[any, any, any, any, any], undefined>;
|
|
63
|
+
assetProps: {
|
|
64
|
+
address: any;
|
|
65
|
+
moniker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
66
|
+
data: v.AnySchema;
|
|
67
|
+
readonly: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
68
|
+
transferrable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
69
|
+
ttl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, 0>;
|
|
70
|
+
parent: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"", undefined>, any], undefined>, undefined>;
|
|
71
|
+
issuer: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"", undefined>, any], undefined>, undefined>;
|
|
72
|
+
endpoint: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
73
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
74
|
+
readonly scope: v.OptionalSchema<v.PicklistSchema<["public", "private"], undefined>, "public">;
|
|
75
|
+
}, undefined>, undefined>, null>;
|
|
76
|
+
display: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
77
|
+
readonly type: v.LiteralSchema<"uri", undefined>;
|
|
78
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 20480, undefined>, v.CheckAction<string, "Must be a data URI">]>;
|
|
79
|
+
}, undefined>, v.ObjectSchema<{
|
|
80
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
81
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
82
|
+
}, undefined>, v.ObjectSchema<{
|
|
83
|
+
readonly type: v.LiteralSchema<"svg", undefined>;
|
|
84
|
+
readonly content: v.StringSchema<undefined>;
|
|
85
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
86
|
+
tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>, v.MaxLengthAction<string[], 4, undefined>]>, undefined>;
|
|
87
|
+
};
|
|
88
|
+
assetSchema: v.ObjectSchema<{
|
|
89
|
+
address: any;
|
|
90
|
+
moniker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
91
|
+
data: v.AnySchema;
|
|
92
|
+
readonly: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
93
|
+
transferrable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
94
|
+
ttl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, 0>;
|
|
95
|
+
parent: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"", undefined>, any], undefined>, undefined>;
|
|
96
|
+
issuer: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"", undefined>, any], undefined>, undefined>;
|
|
97
|
+
endpoint: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
98
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
99
|
+
readonly scope: v.OptionalSchema<v.PicklistSchema<["public", "private"], undefined>, "public">;
|
|
100
|
+
}, undefined>, undefined>, null>;
|
|
101
|
+
display: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
102
|
+
readonly type: v.LiteralSchema<"uri", undefined>;
|
|
103
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 20480, undefined>, v.CheckAction<string, "Must be a data URI">]>;
|
|
104
|
+
}, undefined>, v.ObjectSchema<{
|
|
105
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
106
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
107
|
+
}, undefined>, v.ObjectSchema<{
|
|
108
|
+
readonly type: v.LiteralSchema<"svg", undefined>;
|
|
109
|
+
readonly content: v.StringSchema<undefined>;
|
|
110
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
111
|
+
tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>, v.MaxLengthAction<string[], 4, undefined>]>, undefined>;
|
|
112
|
+
}, undefined>;
|
|
113
|
+
factoryProps: {
|
|
114
|
+
address: any;
|
|
115
|
+
name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
116
|
+
description: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
117
|
+
settlement: v.OptionalSchema<v.PicklistSchema<["instant", "periodic"], undefined>, "instant">;
|
|
118
|
+
limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, 0>;
|
|
119
|
+
trustedIssuers: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<any, undefined>, v.MaxLengthAction<any[], 8, undefined>]>, undefined>;
|
|
120
|
+
data: v.OptionalSchema<v.NullableSchema<v.AnySchema, undefined>, null>;
|
|
121
|
+
display: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
122
|
+
readonly type: v.LiteralSchema<"uri", undefined>;
|
|
123
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 20480, undefined>, v.CheckAction<string, "Must be a data URI">]>;
|
|
124
|
+
}, undefined>, v.ObjectSchema<{
|
|
125
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
126
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
127
|
+
}, undefined>, v.ObjectSchema<{
|
|
128
|
+
readonly type: v.LiteralSchema<"svg", undefined>;
|
|
129
|
+
readonly content: v.StringSchema<undefined>;
|
|
130
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
131
|
+
input: v.ObjectSchema<{
|
|
132
|
+
readonly value: v.OptionalSchema<any, "0">;
|
|
133
|
+
readonly tokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
134
|
+
readonly address: any;
|
|
135
|
+
readonly value: any;
|
|
136
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
137
|
+
readonly address?: any;
|
|
138
|
+
readonly value?: any;
|
|
139
|
+
}[], 8, undefined>]>, undefined>;
|
|
140
|
+
readonly assets: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[any, any], undefined>, undefined>, v.MaxLengthAction<any[], 8, undefined>]>, undefined>;
|
|
141
|
+
readonly variables: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
142
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
143
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, "">;
|
|
144
|
+
readonly required: v.BooleanSchema<undefined>;
|
|
145
|
+
}, undefined>, undefined>, undefined>;
|
|
146
|
+
}, undefined>;
|
|
147
|
+
output: v.ObjectSchema<{
|
|
148
|
+
readonly moniker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
149
|
+
readonly data: v.AnySchema;
|
|
150
|
+
readonly readonly: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
151
|
+
readonly transferrable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
152
|
+
readonly ttl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, 0>;
|
|
153
|
+
readonly parent: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
154
|
+
readonly issuer: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
155
|
+
readonly endpoint: v.OptionalSchema<v.ObjectSchema<{
|
|
156
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
157
|
+
readonly scope: v.OptionalSchema<v.PicklistSchema<["public", "private"], undefined>, "public">;
|
|
158
|
+
}, undefined>, undefined>;
|
|
159
|
+
readonly display: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
160
|
+
readonly type: v.LiteralSchema<"uri", undefined>;
|
|
161
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 20480, undefined>, v.CheckAction<string, "Must be a data URI">]>;
|
|
162
|
+
}, undefined>, v.ObjectSchema<{
|
|
163
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
164
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
165
|
+
}, undefined>, v.ObjectSchema<{
|
|
166
|
+
readonly type: v.LiteralSchema<"svg", undefined>;
|
|
167
|
+
readonly content: v.StringSchema<undefined>;
|
|
168
|
+
}, undefined>], undefined>, undefined>;
|
|
169
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>, v.MaxLengthAction<string[], 4, undefined>]>, undefined>;
|
|
170
|
+
}, undefined>;
|
|
171
|
+
hooks: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
172
|
+
readonly name: v.PicklistSchema<["mint", "postMint", "preMint"], undefined>;
|
|
173
|
+
readonly type: v.PicklistSchema<["url", "contract"], undefined>;
|
|
174
|
+
readonly hook: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 4096, undefined>]>;
|
|
175
|
+
readonly compiled: v.OptionalSchema<v.ArraySchema<v.LooseObjectSchema<{}, undefined>, undefined>, undefined>;
|
|
176
|
+
}, undefined>, undefined>, undefined>;
|
|
177
|
+
};
|
|
178
|
+
factorySchema: v.ObjectSchema<{
|
|
179
|
+
address: any;
|
|
180
|
+
name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
181
|
+
description: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
182
|
+
settlement: v.OptionalSchema<v.PicklistSchema<["instant", "periodic"], undefined>, "instant">;
|
|
183
|
+
limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, 0>;
|
|
184
|
+
trustedIssuers: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<any, undefined>, v.MaxLengthAction<any[], 8, undefined>]>, undefined>;
|
|
185
|
+
data: v.OptionalSchema<v.NullableSchema<v.AnySchema, undefined>, null>;
|
|
186
|
+
display: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
187
|
+
readonly type: v.LiteralSchema<"uri", undefined>;
|
|
188
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 20480, undefined>, v.CheckAction<string, "Must be a data URI">]>;
|
|
189
|
+
}, undefined>, v.ObjectSchema<{
|
|
190
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
191
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
192
|
+
}, undefined>, v.ObjectSchema<{
|
|
193
|
+
readonly type: v.LiteralSchema<"svg", undefined>;
|
|
194
|
+
readonly content: v.StringSchema<undefined>;
|
|
195
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
196
|
+
input: v.ObjectSchema<{
|
|
197
|
+
readonly value: v.OptionalSchema<any, "0">;
|
|
198
|
+
readonly tokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
199
|
+
readonly address: any;
|
|
200
|
+
readonly value: any;
|
|
201
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
202
|
+
readonly address?: any;
|
|
203
|
+
readonly value?: any;
|
|
204
|
+
}[], 8, undefined>]>, undefined>;
|
|
205
|
+
readonly assets: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[any, any], undefined>, undefined>, v.MaxLengthAction<any[], 8, undefined>]>, undefined>;
|
|
206
|
+
readonly variables: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
207
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
208
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, "">;
|
|
209
|
+
readonly required: v.BooleanSchema<undefined>;
|
|
210
|
+
}, undefined>, undefined>, undefined>;
|
|
211
|
+
}, undefined>;
|
|
212
|
+
output: v.ObjectSchema<{
|
|
213
|
+
readonly moniker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
214
|
+
readonly data: v.AnySchema;
|
|
215
|
+
readonly readonly: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
216
|
+
readonly transferrable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
217
|
+
readonly ttl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, 0>;
|
|
218
|
+
readonly parent: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
219
|
+
readonly issuer: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
220
|
+
readonly endpoint: v.OptionalSchema<v.ObjectSchema<{
|
|
221
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
222
|
+
readonly scope: v.OptionalSchema<v.PicklistSchema<["public", "private"], undefined>, "public">;
|
|
223
|
+
}, undefined>, undefined>;
|
|
224
|
+
readonly display: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
225
|
+
readonly type: v.LiteralSchema<"uri", undefined>;
|
|
226
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 20480, undefined>, v.CheckAction<string, "Must be a data URI">]>;
|
|
227
|
+
}, undefined>, v.ObjectSchema<{
|
|
228
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
229
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.CheckAction<string, "Must be a valid HTTP/HTTPS URL">]>;
|
|
230
|
+
}, undefined>, v.ObjectSchema<{
|
|
231
|
+
readonly type: v.LiteralSchema<"svg", undefined>;
|
|
232
|
+
readonly content: v.StringSchema<undefined>;
|
|
233
|
+
}, undefined>], undefined>, undefined>;
|
|
234
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>, v.MaxLengthAction<string[], 4, undefined>]>, undefined>;
|
|
235
|
+
}, undefined>;
|
|
236
|
+
hooks: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
237
|
+
readonly name: v.PicklistSchema<["mint", "postMint", "preMint"], undefined>;
|
|
238
|
+
readonly type: v.PicklistSchema<["url", "contract"], undefined>;
|
|
239
|
+
readonly hook: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 4096, undefined>]>;
|
|
240
|
+
readonly compiled: v.OptionalSchema<v.ArraySchema<v.LooseObjectSchema<{}, undefined>, undefined>, undefined>;
|
|
241
|
+
}, undefined>, undefined>, undefined>;
|
|
242
|
+
}, undefined>;
|
|
243
|
+
};
|
|
244
|
+
//#endregion
|
|
245
|
+
export { schemas };
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { vDID } from "./did.mjs";
|
|
2
|
+
import { vBN, vBNMin } from "./bn.mjs";
|
|
3
|
+
import * as v from "valibot";
|
|
4
|
+
|
|
5
|
+
//#region src/v/schemas.ts
|
|
6
|
+
const txHash = /^(0x)?([A-Fa-f0-9]{64})$/;
|
|
7
|
+
const ISO_DATE_RE = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;
|
|
8
|
+
const isIsoDateString = (s) => ISO_DATE_RE.test(s) && !Number.isNaN(new Date(s).getTime());
|
|
9
|
+
const isoDateString = v.pipe(v.string(), v.check(isIsoDateString, "Must be valid ISO date"));
|
|
10
|
+
const txHashOrEmpty = v.pipe(v.string(), v.check((s) => s === "" || txHash.test(s), "Must match tx hash pattern or be empty"));
|
|
11
|
+
const context = v.object({
|
|
12
|
+
genesisTime: isoDateString,
|
|
13
|
+
genesisTx: txHashOrEmpty,
|
|
14
|
+
renaissanceTime: isoDateString,
|
|
15
|
+
renaissanceTx: txHashOrEmpty
|
|
16
|
+
});
|
|
17
|
+
const tokenInput = v.object({
|
|
18
|
+
address: vDID({
|
|
19
|
+
prefix: true,
|
|
20
|
+
role: "ROLE_TOKEN"
|
|
21
|
+
}),
|
|
22
|
+
value: vBN(vBNMin(0))
|
|
23
|
+
});
|
|
24
|
+
const variableInput = v.object({
|
|
25
|
+
name: v.pipe(v.string(), v.minLength(1), v.maxLength(256)),
|
|
26
|
+
value: v.pipe(v.string(), v.minLength(1), v.maxLength(1024)),
|
|
27
|
+
description: v.optional(v.pipe(v.string(), v.maxLength(256)), ""),
|
|
28
|
+
required: v.optional(v.boolean(), false)
|
|
29
|
+
});
|
|
30
|
+
const tokenHolder = v.union([
|
|
31
|
+
vDID({
|
|
32
|
+
prefix: true,
|
|
33
|
+
role: "ROLE_ACCOUNT"
|
|
34
|
+
}),
|
|
35
|
+
vDID({
|
|
36
|
+
prefix: true,
|
|
37
|
+
role: "ROLE_APPLICATION"
|
|
38
|
+
}),
|
|
39
|
+
vDID({
|
|
40
|
+
prefix: true,
|
|
41
|
+
role: "ROLE_BLOCKLET"
|
|
42
|
+
}),
|
|
43
|
+
vDID({
|
|
44
|
+
prefix: true,
|
|
45
|
+
wallet: "ethereum"
|
|
46
|
+
}),
|
|
47
|
+
vDID({
|
|
48
|
+
prefix: true,
|
|
49
|
+
wallet: "passkey"
|
|
50
|
+
})
|
|
51
|
+
]);
|
|
52
|
+
const multiInput = v.array(v.object({
|
|
53
|
+
owner: tokenHolder,
|
|
54
|
+
tokensList: v.optional(v.array(tokenInput), []),
|
|
55
|
+
assetsList: v.optional(v.array(vDID({
|
|
56
|
+
prefix: true,
|
|
57
|
+
role: "ROLE_ASSET"
|
|
58
|
+
})), [])
|
|
59
|
+
}));
|
|
60
|
+
const multiSig = v.array(v.object({
|
|
61
|
+
signer: vDID({ prefix: true }),
|
|
62
|
+
pk: v.any(),
|
|
63
|
+
signature: v.any(),
|
|
64
|
+
delegator: v.optional(v.union([v.literal(""), vDID({ prefix: true })])),
|
|
65
|
+
data: v.optional(v.any())
|
|
66
|
+
}));
|
|
67
|
+
const foreignToken = v.object({
|
|
68
|
+
type: v.pipe(v.string(), v.minLength(1), v.maxLength(32)),
|
|
69
|
+
contractAddress: vDID({
|
|
70
|
+
prefix: true,
|
|
71
|
+
wallet: "ethereum"
|
|
72
|
+
}),
|
|
73
|
+
chainType: v.pipe(v.string(), v.minLength(1), v.maxLength(32)),
|
|
74
|
+
chainName: v.pipe(v.string(), v.minLength(1), v.maxLength(32)),
|
|
75
|
+
chainId: v.pipe(v.number(), v.check((n) => n > 0, "Must be positive"))
|
|
76
|
+
});
|
|
77
|
+
const isDataUri = (s) => /^data:[^;]*;base64,/.test(s) || /^data:[^,]*,/.test(s);
|
|
78
|
+
const isHttpUrl = (s) => {
|
|
79
|
+
try {
|
|
80
|
+
const url = new URL(s);
|
|
81
|
+
return ["http:", "https:"].includes(url.protocol);
|
|
82
|
+
} catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const nftDisplay = v.union([
|
|
87
|
+
v.object({
|
|
88
|
+
type: v.literal("uri"),
|
|
89
|
+
content: v.pipe(v.string(), v.maxLength(20480), v.check(isDataUri, "Must be a data URI"))
|
|
90
|
+
}),
|
|
91
|
+
v.object({
|
|
92
|
+
type: v.literal("url"),
|
|
93
|
+
content: v.pipe(v.string(), v.maxLength(2048), v.check(isHttpUrl, "Must be a valid HTTP/HTTPS URL"))
|
|
94
|
+
}),
|
|
95
|
+
v.object({
|
|
96
|
+
type: v.literal("svg"),
|
|
97
|
+
content: v.string()
|
|
98
|
+
})
|
|
99
|
+
]);
|
|
100
|
+
const nftEndpoint = v.object({
|
|
101
|
+
id: v.pipe(v.string(), v.maxLength(2048), v.check(isHttpUrl, "Must be a valid HTTP/HTTPS URL")),
|
|
102
|
+
scope: v.optional(v.picklist(["public", "private"]), "public")
|
|
103
|
+
});
|
|
104
|
+
const nftIssuer = v.object({
|
|
105
|
+
id: vDID({ prefix: true }),
|
|
106
|
+
pk: v.string(),
|
|
107
|
+
name: v.pipe(v.string(), v.minLength(1), v.maxLength(256))
|
|
108
|
+
});
|
|
109
|
+
const assetProps = {
|
|
110
|
+
address: vDID({
|
|
111
|
+
prefix: true,
|
|
112
|
+
role: "ROLE_ASSET"
|
|
113
|
+
}),
|
|
114
|
+
moniker: v.pipe(v.string(), v.minLength(2), v.maxLength(255)),
|
|
115
|
+
data: v.any(),
|
|
116
|
+
readonly: v.optional(v.boolean(), false),
|
|
117
|
+
transferrable: v.optional(v.boolean(), false),
|
|
118
|
+
ttl: v.optional(v.pipe(v.number(), v.minValue(0)), 0),
|
|
119
|
+
parent: v.optional(v.union([v.literal(""), vDID({ prefix: true })])),
|
|
120
|
+
issuer: v.optional(v.union([v.literal(""), vDID({ prefix: true })])),
|
|
121
|
+
endpoint: v.optional(v.nullable(nftEndpoint), null),
|
|
122
|
+
display: v.optional(v.nullable(nftDisplay), null),
|
|
123
|
+
tags: v.optional(v.pipe(v.array(v.pipe(v.string(), v.minLength(1), v.maxLength(64))), v.maxLength(4)))
|
|
124
|
+
};
|
|
125
|
+
const factoryProps = {
|
|
126
|
+
address: vDID({
|
|
127
|
+
prefix: true,
|
|
128
|
+
role: "ROLE_FACTORY"
|
|
129
|
+
}),
|
|
130
|
+
name: v.pipe(v.string(), v.minLength(2), v.maxLength(255)),
|
|
131
|
+
description: v.pipe(v.string(), v.minLength(2), v.maxLength(255)),
|
|
132
|
+
settlement: v.optional(v.picklist(["instant", "periodic"]), "instant"),
|
|
133
|
+
limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0)), 0),
|
|
134
|
+
trustedIssuers: v.optional(v.pipe(v.array(vDID({ prefix: true })), v.maxLength(8))),
|
|
135
|
+
data: v.optional(v.nullable(v.any()), null),
|
|
136
|
+
display: v.optional(v.nullable(nftDisplay), null),
|
|
137
|
+
input: v.object({
|
|
138
|
+
value: v.optional(vBN(vBNMin("0")), "0"),
|
|
139
|
+
tokens: v.optional(v.pipe(v.array(tokenInput), v.maxLength(8))),
|
|
140
|
+
assets: v.optional(v.pipe(v.array(v.union([vDID({
|
|
141
|
+
prefix: true,
|
|
142
|
+
role: "ROLE_ASSET"
|
|
143
|
+
}), vDID({
|
|
144
|
+
prefix: true,
|
|
145
|
+
role: "ROLE_FACTORY"
|
|
146
|
+
})])), v.maxLength(8))),
|
|
147
|
+
variables: v.optional(v.array(v.object({
|
|
148
|
+
name: v.pipe(v.string(), v.minLength(1), v.maxLength(255)),
|
|
149
|
+
description: v.optional(v.pipe(v.string(), v.maxLength(255)), ""),
|
|
150
|
+
required: v.boolean()
|
|
151
|
+
})))
|
|
152
|
+
}),
|
|
153
|
+
output: v.object({
|
|
154
|
+
moniker: v.pipe(v.string(), v.minLength(2), v.maxLength(255)),
|
|
155
|
+
data: v.any(),
|
|
156
|
+
readonly: v.optional(v.boolean(), false),
|
|
157
|
+
transferrable: v.optional(v.boolean(), false),
|
|
158
|
+
ttl: v.optional(v.pipe(v.number(), v.minValue(0)), 0),
|
|
159
|
+
parent: v.pipe(v.string(), v.maxLength(255)),
|
|
160
|
+
issuer: v.pipe(v.string(), v.maxLength(255)),
|
|
161
|
+
endpoint: v.optional(nftEndpoint),
|
|
162
|
+
display: v.optional(nftDisplay),
|
|
163
|
+
tags: v.optional(v.pipe(v.array(v.pipe(v.string(), v.minLength(1), v.maxLength(64))), v.maxLength(4)))
|
|
164
|
+
}),
|
|
165
|
+
hooks: v.optional(v.array(v.object({
|
|
166
|
+
name: v.picklist([
|
|
167
|
+
"mint",
|
|
168
|
+
"postMint",
|
|
169
|
+
"preMint"
|
|
170
|
+
]),
|
|
171
|
+
type: v.picklist(["url", "contract"]),
|
|
172
|
+
hook: v.pipe(v.string(), v.minLength(1), v.maxLength(4096)),
|
|
173
|
+
compiled: v.optional(v.array(v.looseObject({})))
|
|
174
|
+
})))
|
|
175
|
+
};
|
|
176
|
+
const schemas = {
|
|
177
|
+
context,
|
|
178
|
+
tokenInput,
|
|
179
|
+
multiInput,
|
|
180
|
+
multiSig,
|
|
181
|
+
foreignToken,
|
|
182
|
+
variableInput,
|
|
183
|
+
nftDisplay,
|
|
184
|
+
nftEndpoint,
|
|
185
|
+
nftIssuer,
|
|
186
|
+
tokenHolder,
|
|
187
|
+
assetProps,
|
|
188
|
+
assetSchema: v.object(assetProps),
|
|
189
|
+
factoryProps,
|
|
190
|
+
factorySchema: v.object(factoryProps)
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
//#endregion
|
|
194
|
+
export { schemas };
|
package/lib/index.cjs
CHANGED
|
@@ -1,143 +1,37 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const require_v_did = require('./v/did.cjs');
|
|
3
|
+
const require_v_bn = require('./v/bn.cjs');
|
|
4
|
+
const require_v_helpers = require('./v/helpers.cjs');
|
|
5
|
+
const require_v_schemas = require('./v/schemas.cjs');
|
|
6
|
+
let valibot = require("valibot");
|
|
7
|
+
valibot = require_rolldown_runtime.__toESM(valibot);
|
|
6
8
|
|
|
7
9
|
//#region src/index.ts
|
|
8
|
-
const
|
|
9
|
-
const txHash = /^(0x)?([A-Fa-f0-9]{64})$/;
|
|
10
|
-
const context = Joi.object({
|
|
11
|
-
genesisTime: Joi.date().iso().required().raw(),
|
|
12
|
-
genesisTx: Joi.string().regex(txHash).required().allow(""),
|
|
13
|
-
renaissanceTime: Joi.date().iso().required().raw(),
|
|
14
|
-
renaissanceTx: Joi.string().regex(txHash).required().allow("")
|
|
15
|
-
});
|
|
16
|
-
const tokenInput = Joi.object({
|
|
17
|
-
address: Joi.DID().prefix().role("ROLE_TOKEN").required(),
|
|
18
|
-
value: Joi.BN().min(0).required()
|
|
19
|
-
});
|
|
20
|
-
const variableInput = Joi.object({
|
|
21
|
-
name: Joi.string().min(1).max(256).required(),
|
|
22
|
-
value: Joi.string().min(1).max(1024).required(),
|
|
23
|
-
description: Joi.string().min(1).max(256).optional().allow(""),
|
|
24
|
-
required: Joi.boolean().optional().default(false)
|
|
25
|
-
});
|
|
26
|
-
const tokenHolder = Joi.alternatives().try(Joi.DID().prefix().role("ROLE_ACCOUNT"), Joi.DID().prefix().role("ROLE_APPLICATION"), Joi.DID().prefix().role("ROLE_BLOCKLET"), Joi.DID().prefix().wallet("ethereum"), Joi.DID().prefix().wallet("passkey"));
|
|
27
|
-
const multiInput = Joi.array().items(Joi.object({
|
|
28
|
-
owner: tokenHolder.required(),
|
|
29
|
-
tokensList: Joi.array().items(tokenInput).default([]),
|
|
30
|
-
assetsList: Joi.array().items(Joi.DID().prefix().role("ROLE_ASSET")).default([])
|
|
31
|
-
}));
|
|
32
|
-
const multiSig = Joi.array().items({
|
|
33
|
-
signer: Joi.DID().prefix().required(),
|
|
34
|
-
pk: Joi.any().required(),
|
|
35
|
-
signature: Joi.any().required(),
|
|
36
|
-
delegator: Joi.DID().prefix().valid("").optional(),
|
|
37
|
-
data: Joi.any().optional()
|
|
38
|
-
});
|
|
39
|
-
const foreignToken = Joi.object({
|
|
40
|
-
type: Joi.string().min(1).max(32).required(),
|
|
41
|
-
contractAddress: Joi.DID().prefix().wallet("ethereum").required(),
|
|
42
|
-
chainType: Joi.string().min(1).max(32).required(),
|
|
43
|
-
chainName: Joi.string().min(1).max(32).required(),
|
|
44
|
-
chainId: Joi.number().positive().required()
|
|
45
|
-
});
|
|
46
|
-
const nftDisplay = Joi.object({
|
|
47
|
-
type: Joi.string().valid("svg", "url", "uri").required(),
|
|
48
|
-
content: Joi.string().when("type", {
|
|
49
|
-
is: "uri",
|
|
50
|
-
then: Joi.string().max(20480).dataUri().required()
|
|
51
|
-
}).when("type", {
|
|
52
|
-
is: "url",
|
|
53
|
-
then: Joi.string().max(2048).uri({ scheme: ["http", "https"] }).required()
|
|
54
|
-
})
|
|
55
|
-
});
|
|
56
|
-
const nftEndpoint = Joi.object({
|
|
57
|
-
id: Joi.string().max(2048).uri({ scheme: ["http", "https"] }).required(),
|
|
58
|
-
scope: Joi.string().valid("public", "private").default("public")
|
|
59
|
-
});
|
|
60
|
-
const nftIssuer = Joi.object({
|
|
61
|
-
id: Joi.DID().prefix().required(),
|
|
62
|
-
pk: Joi.string().required(),
|
|
63
|
-
name: Joi.string().min(1).max(256).required()
|
|
64
|
-
});
|
|
65
|
-
const assetProps = {
|
|
66
|
-
address: Joi.DID().prefix().role("ROLE_ASSET").required(),
|
|
67
|
-
moniker: Joi.string().min(2).max(255).required(),
|
|
68
|
-
data: Joi.any().required(),
|
|
69
|
-
readonly: Joi.boolean().default(false),
|
|
70
|
-
transferrable: Joi.boolean().default(false),
|
|
71
|
-
ttl: Joi.number().min(0).default(0),
|
|
72
|
-
parent: Joi.DID().prefix().optional().allow(""),
|
|
73
|
-
issuer: Joi.DID().prefix().optional().allow(""),
|
|
74
|
-
endpoint: nftEndpoint.optional().allow(null).default(null),
|
|
75
|
-
display: nftDisplay.optional().allow(null).default(null),
|
|
76
|
-
tags: Joi.array().items(Joi.string().min(1).max(64)).max(4).optional()
|
|
77
|
-
};
|
|
78
|
-
const factoryProps = {
|
|
79
|
-
address: Joi.DID().prefix().role("ROLE_FACTORY").required(),
|
|
80
|
-
name: Joi.string().min(2).max(255).required(),
|
|
81
|
-
description: Joi.string().min(2).max(255).required(),
|
|
82
|
-
settlement: Joi.string().valid("instant", "periodic").default("instant"),
|
|
83
|
-
limit: Joi.number().integer().min(0).default(0),
|
|
84
|
-
trustedIssuers: Joi.array().items(Joi.DID().prefix()).max(8).optional(),
|
|
85
|
-
data: Joi.any().optional().allow(null).default(null),
|
|
86
|
-
display: nftDisplay.optional().allow(null).default(null),
|
|
87
|
-
input: Joi.object({
|
|
88
|
-
value: Joi.BN().positive().min("0").default("0"),
|
|
89
|
-
tokens: Joi.array().items(tokenInput).max(8).optional(),
|
|
90
|
-
assets: Joi.array().items(Joi.alternatives().try(Joi.DID().prefix().role("ROLE_ASSET"), Joi.DID().prefix().role("ROLE_FACTORY"))).max(8).optional(),
|
|
91
|
-
variables: Joi.array().items(Joi.object({
|
|
92
|
-
name: Joi.string().min(1).max(255).required(),
|
|
93
|
-
description: Joi.string().max(255).optional().allow(""),
|
|
94
|
-
required: Joi.boolean().required()
|
|
95
|
-
})).optional()
|
|
96
|
-
}),
|
|
97
|
-
output: Joi.object({
|
|
98
|
-
moniker: Joi.string().min(2).max(255).required(),
|
|
99
|
-
data: Joi.any().required(),
|
|
100
|
-
readonly: Joi.boolean().default(false),
|
|
101
|
-
transferrable: Joi.boolean().default(false),
|
|
102
|
-
ttl: Joi.number().min(0).default(0),
|
|
103
|
-
parent: Joi.string().max(255).required(),
|
|
104
|
-
issuer: Joi.string().max(255).required(),
|
|
105
|
-
endpoint: nftEndpoint.optional(),
|
|
106
|
-
display: nftDisplay.optional(),
|
|
107
|
-
tags: Joi.array().items(Joi.string().min(1).max(64)).max(4).optional()
|
|
108
|
-
}),
|
|
109
|
-
hooks: Joi.array().items(Joi.object({
|
|
110
|
-
name: Joi.string().valid("mint", "postMint", "preMint").required(),
|
|
111
|
-
type: Joi.string().valid("url", "contract").required(),
|
|
112
|
-
hook: Joi.string().min(1).max(4096).required(),
|
|
113
|
-
compiled: Joi.array().items(Joi.object()).optional()
|
|
114
|
-
})).optional()
|
|
115
|
-
};
|
|
116
|
-
const schemas = {
|
|
117
|
-
context,
|
|
118
|
-
tokenInput,
|
|
119
|
-
multiInput,
|
|
120
|
-
multiSig,
|
|
121
|
-
foreignToken,
|
|
122
|
-
variableInput,
|
|
123
|
-
nftDisplay,
|
|
124
|
-
nftEndpoint,
|
|
125
|
-
nftIssuer,
|
|
126
|
-
tokenHolder,
|
|
127
|
-
assetProps,
|
|
128
|
-
assetSchema: Joi.object(assetProps).options({
|
|
129
|
-
stripUnknown: true,
|
|
130
|
-
noDefaults: false
|
|
131
|
-
}),
|
|
132
|
-
factoryProps,
|
|
133
|
-
factorySchema: Joi.object(factoryProps).options({
|
|
134
|
-
stripUnknown: true,
|
|
135
|
-
noDefaults: false
|
|
136
|
-
})
|
|
137
|
-
};
|
|
138
|
-
const patterns = { txHash };
|
|
10
|
+
const patterns = { txHash: /^(0x)?([A-Fa-f0-9]{64})$/ };
|
|
139
11
|
|
|
140
12
|
//#endregion
|
|
141
|
-
exports.Joi = Joi;
|
|
142
13
|
exports.patterns = patterns;
|
|
143
|
-
exports.schemas = schemas;
|
|
14
|
+
exports.schemas = require_v_schemas.schemas;
|
|
15
|
+
Object.defineProperty(exports, 'v', {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return valibot;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
exports.vBN = require_v_bn.vBN;
|
|
22
|
+
exports.vBNGreater = require_v_bn.vBNGreater;
|
|
23
|
+
exports.vBNGt = require_v_bn.vBNGt;
|
|
24
|
+
exports.vBNGte = require_v_bn.vBNGte;
|
|
25
|
+
exports.vBNLess = require_v_bn.vBNLess;
|
|
26
|
+
exports.vBNLt = require_v_bn.vBNLt;
|
|
27
|
+
exports.vBNLte = require_v_bn.vBNLte;
|
|
28
|
+
exports.vBNMax = require_v_bn.vBNMax;
|
|
29
|
+
exports.vBNMin = require_v_bn.vBNMin;
|
|
30
|
+
exports.vBNNegative = require_v_bn.vBNNegative;
|
|
31
|
+
exports.vBNPositive = require_v_bn.vBNPositive;
|
|
32
|
+
exports.vDID = require_v_did.vDID;
|
|
33
|
+
exports.vFilteredRecord = require_v_helpers.vFilteredRecord;
|
|
34
|
+
exports.vForbidden = require_v_helpers.vForbidden;
|
|
35
|
+
exports.vStripUnknown = require_v_helpers.vStripUnknown;
|
|
36
|
+
exports.vValidate = require_v_helpers.vValidate;
|
|
37
|
+
exports.vWhen = require_v_helpers.vWhen;
|