@arcblock/validator 1.29.26 → 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.
@@ -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 };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "type": "module",
7
- "version": "1.29.26",
7
+ "version": "1.30.0",
8
8
  "description": "",
9
9
  "sideEffects": false,
10
10
  "main": "./lib/index.cjs",
@@ -41,12 +41,11 @@
41
41
  "clean": "rm -rf lib esm"
42
42
  },
43
43
  "dependencies": {
44
- "@arcblock/did": "1.29.26",
45
- "@ocap/mcrypto": "1.29.26",
46
- "@ocap/util": "1.29.26",
44
+ "@arcblock/did": "1.30.0",
45
+ "@ocap/mcrypto": "1.30.0",
46
+ "@ocap/util": "1.30.0",
47
47
  "bn.js": "5.2.3",
48
- "joi": "^17.7.0",
49
- "lodash": "^4.17.23"
48
+ "valibot": "^1.3.1"
50
49
  },
51
50
  "resolutions": {
52
51
  "bn.js": "5.2.3"
@@ -1,100 +0,0 @@
1
- import { AnySchema, Root } from "joi";
2
- import BN from "bn.js";
3
-
4
- //#region src/extension/bn.d.ts
5
- interface BNSchema extends AnySchema {
6
- min(threshold: any): this;
7
- gte(threshold: any): this;
8
- max(threshold: any): this;
9
- lte(threshold: any): this;
10
- greater(threshold: any): this;
11
- gt(threshold: any): this;
12
- less(threshold: any): this;
13
- lt(threshold: any): this;
14
- positive(): this;
15
- negative(): this;
16
- }
17
- declare function BNExtension(root: Root): {
18
- type: string;
19
- base: AnySchema<any>;
20
- messages: {
21
- 'bn.nan': string;
22
- 'bn.max': string;
23
- 'bn.min': string;
24
- 'bn.less': string;
25
- 'bn.greater': string;
26
- 'bn.positive': string;
27
- 'bn.negative': string;
28
- };
29
- prepare(value: any, helpers: any): {
30
- value: BN;
31
- errors?: undefined;
32
- } | {
33
- errors: any;
34
- value?: undefined;
35
- };
36
- coerce(value: BN): {
37
- value: string;
38
- };
39
- validate(value: any): {
40
- value: any;
41
- };
42
- rules: {
43
- gt: {
44
- args: ({
45
- name: string;
46
- ref: boolean;
47
- assert: (v: any) => v is BN;
48
- message: string;
49
- normalize: (v: any) => BN;
50
- } | {
51
- name: string;
52
- assert: (v: any) => v is boolean;
53
- message: string;
54
- ref?: undefined;
55
- normalize?: undefined;
56
- })[];
57
- validate(value: any, helpers: any, args: any): any;
58
- };
59
- lt: {
60
- args: ({
61
- name: string;
62
- ref: boolean;
63
- assert: (v: any) => v is BN;
64
- message: string;
65
- normalize: (v: any) => BN;
66
- } | {
67
- name: string;
68
- assert: (v: any) => v is boolean;
69
- message: string;
70
- ref?: undefined;
71
- normalize?: undefined;
72
- })[];
73
- validate(value: any, helpers: any, args: any): any;
74
- };
75
- min: {
76
- alias: string;
77
- method(threshold: any): BNSchema;
78
- };
79
- max: {
80
- alias: string;
81
- method(threshold: any): BNSchema;
82
- };
83
- greater: {
84
- alias: string;
85
- method(threshold: any): BNSchema;
86
- };
87
- less: {
88
- alias: string;
89
- method(threshold: any): BNSchema;
90
- };
91
- positive: {
92
- method(): BNSchema;
93
- };
94
- negative: {
95
- method(): BNSchema;
96
- };
97
- };
98
- };
99
- //#endregion
100
- export { BNExtension, BNSchema };
@@ -1,140 +0,0 @@
1
- import BN from "bn.js";
2
-
3
- //#region src/extension/bn.ts
4
- function BNExtension(root) {
5
- return {
6
- type: "BN",
7
- base: root.any(),
8
- messages: {
9
- "bn.nan": "{{#label}} is not a big number",
10
- "bn.max": "{{#label}} needs to be less than or equal to \"{{#threshold}}\"",
11
- "bn.min": "{{#label}} needs to be greater than or equal to \"{{#threshold}}\"",
12
- "bn.less": "{{#label}} needs to be less than \"{{#threshold}}\"",
13
- "bn.greater": "{{#label}} needs to be greater than \"{{#threshold}}\"",
14
- "bn.positive": "{{#label}} needs to be positive",
15
- "bn.negative": "{{#label}} needs to be negative"
16
- },
17
- prepare(value, helpers) {
18
- try {
19
- return { value: new BN(value) };
20
- } catch (_err) {
21
- return { errors: helpers.error("bn.nan") };
22
- }
23
- },
24
- coerce(value) {
25
- return { value: value.toString(10) };
26
- },
27
- validate(value) {
28
- return { value };
29
- },
30
- rules: {
31
- gt: {
32
- args: [{
33
- name: "threshold",
34
- ref: true,
35
- assert: (v) => BN.isBN(v),
36
- message: "must be a big number",
37
- normalize: (v) => new BN(v)
38
- }, {
39
- name: "equal",
40
- assert: (v) => typeof v === "boolean",
41
- message: "must be a boolean"
42
- }],
43
- validate(value, helpers, args) {
44
- const v = new BN(value);
45
- if (args.equal && v.lt(args.threshold)) return helpers.error("bn.min", args);
46
- if (!args.equal && v.lte(args.threshold)) return helpers.error("bn.greater", args);
47
- return value;
48
- }
49
- },
50
- lt: {
51
- args: [{
52
- name: "threshold",
53
- ref: true,
54
- assert: (v) => BN.isBN(v),
55
- message: "must be a big number",
56
- normalize: (v) => new BN(v)
57
- }, {
58
- name: "equal",
59
- assert: (v) => typeof v === "boolean",
60
- message: "must be a boolean"
61
- }],
62
- validate(value, helpers, args) {
63
- const v = new BN(value);
64
- if (args.equal && v.gt(args.threshold)) return helpers.error("bn.max", args);
65
- if (!args.equal && v.gte(args.threshold)) return helpers.error("bn.less", args);
66
- return value;
67
- }
68
- },
69
- min: {
70
- alias: "gte",
71
- method(threshold) {
72
- return this.$_addRule({
73
- name: "gt",
74
- args: {
75
- threshold,
76
- equal: true
77
- }
78
- });
79
- }
80
- },
81
- max: {
82
- alias: "lte",
83
- method(threshold) {
84
- return this.$_addRule({
85
- name: "lt",
86
- args: {
87
- threshold,
88
- equal: true
89
- }
90
- });
91
- }
92
- },
93
- greater: {
94
- alias: "gt",
95
- method(threshold) {
96
- return this.$_addRule({
97
- name: "gt",
98
- args: {
99
- threshold,
100
- equal: false
101
- }
102
- });
103
- }
104
- },
105
- less: {
106
- alias: "lt",
107
- method(threshold) {
108
- return this.$_addRule({
109
- name: "lt",
110
- args: {
111
- threshold,
112
- equal: false
113
- }
114
- });
115
- }
116
- },
117
- positive: { method() {
118
- return this.$_addRule({
119
- name: "gt",
120
- args: {
121
- threshold: 0,
122
- equal: false
123
- }
124
- });
125
- } },
126
- negative: { method() {
127
- return this.$_addRule({
128
- name: "lt",
129
- args: {
130
- threshold: 0,
131
- equal: false
132
- }
133
- });
134
- } }
135
- }
136
- };
137
- }
138
-
139
- //#endregion
140
- export { BNExtension };
@@ -1,81 +0,0 @@
1
- import { Root, StringSchema } from "joi";
2
- import { DIDTypeShortcut } from "@arcblock/did";
3
- import { HashType, KeyType, RoleType } from "@ocap/mcrypto";
4
-
5
- //#region src/extension/did.d.ts
6
- interface DIDSchema extends StringSchema {
7
- wallet(type: DIDTypeShortcut): this;
8
- pk(type: KeyType): this;
9
- hash(type: HashType): this;
10
- role(type: RoleType): this;
11
- prefix(str?: string): this;
12
- }
13
- declare function DIDExtension(root: Root): {
14
- type: string;
15
- base: StringSchema<string>;
16
- messages: {
17
- 'did.empty': string;
18
- 'did.invalid': string;
19
- 'did.wallet': string;
20
- 'did.pk': string;
21
- 'did.hash': string;
22
- 'did.role': string;
23
- 'did.prefix': string;
24
- };
25
- validate(value: any, helpers: any): {
26
- errors: any;
27
- value?: undefined;
28
- } | {
29
- value: string;
30
- errors?: undefined;
31
- };
32
- rules: {
33
- type: {
34
- args: ({
35
- name: string;
36
- ref: boolean;
37
- assert: (v: string) => boolean;
38
- message: string;
39
- } | {
40
- name: string;
41
- assert: (v: string) => boolean;
42
- message: string;
43
- ref?: undefined;
44
- })[];
45
- validate(value: string, helpers: any, args: any): any;
46
- };
47
- pk: {
48
- method(type: KeyType): DIDSchema;
49
- };
50
- hash: {
51
- method(type: HashType): DIDSchema;
52
- };
53
- role: {
54
- method(type: RoleType): DIDSchema;
55
- };
56
- wallet: {
57
- method(type: DIDTypeShortcut): DIDSchema;
58
- args: {
59
- name: string;
60
- ref: boolean;
61
- assert: (v: any) => boolean;
62
- message: string;
63
- normalize: (v: any) => any;
64
- }[];
65
- validate(value: any, helpers: any, args?: any): any;
66
- };
67
- prefix: {
68
- method(str?: string): DIDSchema;
69
- args: {
70
- name: string;
71
- ref: boolean;
72
- assert: (v: any) => boolean;
73
- message: string;
74
- normalize: (v: any) => any;
75
- }[];
76
- validate(value: any, helpers: any, args?: any): any;
77
- };
78
- };
79
- };
80
- //#endregion
81
- export { DIDExtension, DIDSchema };