@0xpolygonid/js-sdk 1.20.0 → 1.20.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/browser/esm/index.js +318 -341
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +1 -1
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/storage/blockchain/onchain-zkp-verifier.js +1 -1
- package/dist/node/esm/storage/blockchain/onchain-zkp-verifier.js +1 -1
- package/package.json +1 -1
|
@@ -21038,169 +21038,162 @@ var codegen = {};
|
|
|
21038
21038
|
|
|
21039
21039
|
var code$1 = {};
|
|
21040
21040
|
|
|
21041
|
-
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
|
|
21055
|
-
|
|
21056
|
-
|
|
21057
|
-
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
|
|
21067
|
-
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
|
|
21071
|
-
|
|
21072
|
-
|
|
21073
|
-
|
|
21074
|
-
|
|
21075
|
-
|
|
21076
|
-
|
|
21077
|
-
|
|
21078
|
-
|
|
21079
|
-
|
|
21080
|
-
|
|
21081
|
-
|
|
21082
|
-
|
|
21083
|
-
|
|
21084
|
-
|
|
21085
|
-
|
|
21086
|
-
|
|
21087
|
-
|
|
21088
|
-
|
|
21089
|
-
|
|
21090
|
-
|
|
21091
|
-
|
|
21092
|
-
|
|
21093
|
-
|
|
21094
|
-
|
|
21095
|
-
|
|
21096
|
-
|
|
21097
|
-
|
|
21098
|
-
|
|
21099
|
-
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
21105
|
-
|
|
21106
|
-
|
|
21107
|
-
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
|
|
21112
|
-
|
|
21113
|
-
|
|
21114
|
-
|
|
21115
|
-
|
|
21116
|
-
|
|
21117
|
-
|
|
21118
|
-
|
|
21119
|
-
|
|
21120
|
-
|
|
21121
|
-
|
|
21122
|
-
|
|
21123
|
-
|
|
21124
|
-
|
|
21125
|
-
|
|
21126
|
-
|
|
21127
|
-
|
|
21128
|
-
|
|
21129
|
-
|
|
21130
|
-
|
|
21131
|
-
|
|
21132
|
-
|
|
21133
|
-
|
|
21134
|
-
|
|
21135
|
-
|
|
21136
|
-
|
|
21137
|
-
|
|
21138
|
-
|
|
21139
|
-
|
|
21140
|
-
|
|
21141
|
-
|
|
21142
|
-
|
|
21143
|
-
|
|
21144
|
-
|
|
21145
|
-
|
|
21146
|
-
|
|
21147
|
-
|
|
21148
|
-
|
|
21149
|
-
|
|
21150
|
-
|
|
21151
|
-
|
|
21152
|
-
|
|
21153
|
-
|
|
21154
|
-
|
|
21155
|
-
|
|
21156
|
-
|
|
21157
|
-
|
|
21158
|
-
|
|
21159
|
-
|
|
21160
|
-
|
|
21161
|
-
|
|
21162
|
-
|
|
21163
|
-
|
|
21164
|
-
|
|
21165
|
-
|
|
21166
|
-
|
|
21167
|
-
|
|
21168
|
-
|
|
21169
|
-
|
|
21170
|
-
|
|
21171
|
-
|
|
21172
|
-
|
|
21173
|
-
|
|
21174
|
-
|
|
21175
|
-
|
|
21176
|
-
|
|
21177
|
-
|
|
21178
|
-
|
|
21179
|
-
|
|
21180
|
-
|
|
21181
|
-
|
|
21182
|
-
|
|
21183
|
-
|
|
21184
|
-
|
|
21185
|
-
|
|
21186
|
-
|
|
21187
|
-
|
|
21188
|
-
|
|
21189
|
-
|
|
21190
|
-
|
|
21191
|
-
|
|
21192
|
-
|
|
21193
|
-
|
|
21194
|
-
|
|
21195
|
-
|
|
21196
|
-
|
|
21197
|
-
return new _Code(rx.toString());
|
|
21198
|
-
}
|
|
21199
|
-
exports.regexpCode = regexpCode;
|
|
21200
|
-
|
|
21201
|
-
} (code$1));
|
|
21202
|
-
return code$1;
|
|
21203
|
-
}
|
|
21041
|
+
(function (exports) {
|
|
21042
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21043
|
+
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
21044
|
+
class _CodeOrName {
|
|
21045
|
+
}
|
|
21046
|
+
exports._CodeOrName = _CodeOrName;
|
|
21047
|
+
exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
21048
|
+
class Name extends _CodeOrName {
|
|
21049
|
+
constructor(s) {
|
|
21050
|
+
super();
|
|
21051
|
+
if (!exports.IDENTIFIER.test(s))
|
|
21052
|
+
throw new Error("CodeGen: name must be a valid identifier");
|
|
21053
|
+
this.str = s;
|
|
21054
|
+
}
|
|
21055
|
+
toString() {
|
|
21056
|
+
return this.str;
|
|
21057
|
+
}
|
|
21058
|
+
emptyStr() {
|
|
21059
|
+
return false;
|
|
21060
|
+
}
|
|
21061
|
+
get names() {
|
|
21062
|
+
return { [this.str]: 1 };
|
|
21063
|
+
}
|
|
21064
|
+
}
|
|
21065
|
+
exports.Name = Name;
|
|
21066
|
+
class _Code extends _CodeOrName {
|
|
21067
|
+
constructor(code) {
|
|
21068
|
+
super();
|
|
21069
|
+
this._items = typeof code === "string" ? [code] : code;
|
|
21070
|
+
}
|
|
21071
|
+
toString() {
|
|
21072
|
+
return this.str;
|
|
21073
|
+
}
|
|
21074
|
+
emptyStr() {
|
|
21075
|
+
if (this._items.length > 1)
|
|
21076
|
+
return false;
|
|
21077
|
+
const item = this._items[0];
|
|
21078
|
+
return item === "" || item === '""';
|
|
21079
|
+
}
|
|
21080
|
+
get str() {
|
|
21081
|
+
var _a;
|
|
21082
|
+
return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, "")));
|
|
21083
|
+
}
|
|
21084
|
+
get names() {
|
|
21085
|
+
var _a;
|
|
21086
|
+
return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {
|
|
21087
|
+
if (c instanceof Name)
|
|
21088
|
+
names[c.str] = (names[c.str] || 0) + 1;
|
|
21089
|
+
return names;
|
|
21090
|
+
}, {})));
|
|
21091
|
+
}
|
|
21092
|
+
}
|
|
21093
|
+
exports._Code = _Code;
|
|
21094
|
+
exports.nil = new _Code("");
|
|
21095
|
+
function _(strs, ...args) {
|
|
21096
|
+
const code = [strs[0]];
|
|
21097
|
+
let i = 0;
|
|
21098
|
+
while (i < args.length) {
|
|
21099
|
+
addCodeArg(code, args[i]);
|
|
21100
|
+
code.push(strs[++i]);
|
|
21101
|
+
}
|
|
21102
|
+
return new _Code(code);
|
|
21103
|
+
}
|
|
21104
|
+
exports._ = _;
|
|
21105
|
+
const plus = new _Code("+");
|
|
21106
|
+
function str(strs, ...args) {
|
|
21107
|
+
const expr = [safeStringify(strs[0])];
|
|
21108
|
+
let i = 0;
|
|
21109
|
+
while (i < args.length) {
|
|
21110
|
+
expr.push(plus);
|
|
21111
|
+
addCodeArg(expr, args[i]);
|
|
21112
|
+
expr.push(plus, safeStringify(strs[++i]));
|
|
21113
|
+
}
|
|
21114
|
+
optimize(expr);
|
|
21115
|
+
return new _Code(expr);
|
|
21116
|
+
}
|
|
21117
|
+
exports.str = str;
|
|
21118
|
+
function addCodeArg(code, arg) {
|
|
21119
|
+
if (arg instanceof _Code)
|
|
21120
|
+
code.push(...arg._items);
|
|
21121
|
+
else if (arg instanceof Name)
|
|
21122
|
+
code.push(arg);
|
|
21123
|
+
else
|
|
21124
|
+
code.push(interpolate(arg));
|
|
21125
|
+
}
|
|
21126
|
+
exports.addCodeArg = addCodeArg;
|
|
21127
|
+
function optimize(expr) {
|
|
21128
|
+
let i = 1;
|
|
21129
|
+
while (i < expr.length - 1) {
|
|
21130
|
+
if (expr[i] === plus) {
|
|
21131
|
+
const res = mergeExprItems(expr[i - 1], expr[i + 1]);
|
|
21132
|
+
if (res !== undefined) {
|
|
21133
|
+
expr.splice(i - 1, 3, res);
|
|
21134
|
+
continue;
|
|
21135
|
+
}
|
|
21136
|
+
expr[i++] = "+";
|
|
21137
|
+
}
|
|
21138
|
+
i++;
|
|
21139
|
+
}
|
|
21140
|
+
}
|
|
21141
|
+
function mergeExprItems(a, b) {
|
|
21142
|
+
if (b === '""')
|
|
21143
|
+
return a;
|
|
21144
|
+
if (a === '""')
|
|
21145
|
+
return b;
|
|
21146
|
+
if (typeof a == "string") {
|
|
21147
|
+
if (b instanceof Name || a[a.length - 1] !== '"')
|
|
21148
|
+
return;
|
|
21149
|
+
if (typeof b != "string")
|
|
21150
|
+
return `${a.slice(0, -1)}${b}"`;
|
|
21151
|
+
if (b[0] === '"')
|
|
21152
|
+
return a.slice(0, -1) + b.slice(1);
|
|
21153
|
+
return;
|
|
21154
|
+
}
|
|
21155
|
+
if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
|
|
21156
|
+
return `"${a}${b.slice(1)}`;
|
|
21157
|
+
return;
|
|
21158
|
+
}
|
|
21159
|
+
function strConcat(c1, c2) {
|
|
21160
|
+
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;
|
|
21161
|
+
}
|
|
21162
|
+
exports.strConcat = strConcat;
|
|
21163
|
+
// TODO do not allow arrays here
|
|
21164
|
+
function interpolate(x) {
|
|
21165
|
+
return typeof x == "number" || typeof x == "boolean" || x === null
|
|
21166
|
+
? x
|
|
21167
|
+
: safeStringify(Array.isArray(x) ? x.join(",") : x);
|
|
21168
|
+
}
|
|
21169
|
+
function stringify(x) {
|
|
21170
|
+
return new _Code(safeStringify(x));
|
|
21171
|
+
}
|
|
21172
|
+
exports.stringify = stringify;
|
|
21173
|
+
function safeStringify(x) {
|
|
21174
|
+
return JSON.stringify(x)
|
|
21175
|
+
.replace(/\u2028/g, "\\u2028")
|
|
21176
|
+
.replace(/\u2029/g, "\\u2029");
|
|
21177
|
+
}
|
|
21178
|
+
exports.safeStringify = safeStringify;
|
|
21179
|
+
function getProperty(key) {
|
|
21180
|
+
return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;
|
|
21181
|
+
}
|
|
21182
|
+
exports.getProperty = getProperty;
|
|
21183
|
+
//Does best effort to format the name properly
|
|
21184
|
+
function getEsmExportName(key) {
|
|
21185
|
+
if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
|
|
21186
|
+
return new _Code(`${key}`);
|
|
21187
|
+
}
|
|
21188
|
+
throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
|
|
21189
|
+
}
|
|
21190
|
+
exports.getEsmExportName = getEsmExportName;
|
|
21191
|
+
function regexpCode(rx) {
|
|
21192
|
+
return new _Code(rx.toString());
|
|
21193
|
+
}
|
|
21194
|
+
exports.regexpCode = regexpCode;
|
|
21195
|
+
|
|
21196
|
+
} (code$1));
|
|
21204
21197
|
|
|
21205
21198
|
var scope = {};
|
|
21206
21199
|
|
|
@@ -21212,7 +21205,7 @@ function requireScope () {
|
|
|
21212
21205
|
(function (exports) {
|
|
21213
21206
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21214
21207
|
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
|
|
21215
|
-
const code_1 =
|
|
21208
|
+
const code_1 = code$1;
|
|
21216
21209
|
class ValueError extends Error {
|
|
21217
21210
|
constructor(name) {
|
|
21218
21211
|
super(`CodeGen: "code" for ${name} not defined`);
|
|
@@ -21364,9 +21357,9 @@ function requireCodegen () {
|
|
|
21364
21357
|
(function (exports) {
|
|
21365
21358
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21366
21359
|
exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;
|
|
21367
|
-
const code_1 =
|
|
21360
|
+
const code_1 = code$1;
|
|
21368
21361
|
const scope_1 = requireScope();
|
|
21369
|
-
var code_2 =
|
|
21362
|
+
var code_2 = code$1;
|
|
21370
21363
|
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return code_2._; } });
|
|
21371
21364
|
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return code_2.str; } });
|
|
21372
21365
|
Object.defineProperty(exports, "strConcat", { enumerable: true, get: function () { return code_2.strConcat; } });
|
|
@@ -22068,7 +22061,7 @@ var util = {};
|
|
|
22068
22061
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22069
22062
|
exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;
|
|
22070
22063
|
const codegen_1 = requireCodegen();
|
|
22071
|
-
const code_1 =
|
|
22064
|
+
const code_1 = code$1;
|
|
22072
22065
|
// TODO refactor to use Set
|
|
22073
22066
|
function toHash(arr) {
|
|
22074
22067
|
const hash = {};
|
|
@@ -22501,37 +22494,29 @@ rules.getRules = getRules;
|
|
|
22501
22494
|
|
|
22502
22495
|
var applicability = {};
|
|
22503
22496
|
|
|
22504
|
-
|
|
22505
|
-
|
|
22506
|
-
function
|
|
22507
|
-
|
|
22508
|
-
|
|
22509
|
-
|
|
22510
|
-
|
|
22511
|
-
|
|
22512
|
-
|
|
22513
|
-
|
|
22514
|
-
|
|
22515
|
-
|
|
22516
|
-
|
|
22517
|
-
|
|
22518
|
-
|
|
22519
|
-
applicability.shouldUseGroup = shouldUseGroup;
|
|
22520
|
-
function shouldUseRule(schema, rule) {
|
|
22521
|
-
var _a;
|
|
22522
|
-
return (schema[rule.keyword] !== undefined ||
|
|
22523
|
-
((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));
|
|
22524
|
-
}
|
|
22525
|
-
applicability.shouldUseRule = shouldUseRule;
|
|
22526
|
-
|
|
22527
|
-
return applicability;
|
|
22497
|
+
Object.defineProperty(applicability, "__esModule", { value: true });
|
|
22498
|
+
applicability.shouldUseRule = applicability.shouldUseGroup = applicability.schemaHasRulesForType = void 0;
|
|
22499
|
+
function schemaHasRulesForType({ schema, self }, type) {
|
|
22500
|
+
const group = self.RULES.types[type];
|
|
22501
|
+
return group && group !== true && shouldUseGroup(schema, group);
|
|
22502
|
+
}
|
|
22503
|
+
applicability.schemaHasRulesForType = schemaHasRulesForType;
|
|
22504
|
+
function shouldUseGroup(schema, group) {
|
|
22505
|
+
return group.rules.some((rule) => shouldUseRule(schema, rule));
|
|
22506
|
+
}
|
|
22507
|
+
applicability.shouldUseGroup = shouldUseGroup;
|
|
22508
|
+
function shouldUseRule(schema, rule) {
|
|
22509
|
+
var _a;
|
|
22510
|
+
return (schema[rule.keyword] !== undefined ||
|
|
22511
|
+
((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));
|
|
22528
22512
|
}
|
|
22513
|
+
applicability.shouldUseRule = shouldUseRule;
|
|
22529
22514
|
|
|
22530
22515
|
(function (exports) {
|
|
22531
22516
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22532
22517
|
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
|
|
22533
22518
|
const rules_1 = rules;
|
|
22534
|
-
const applicability_1 =
|
|
22519
|
+
const applicability_1 = applicability;
|
|
22535
22520
|
const errors_1 = requireErrors();
|
|
22536
22521
|
const codegen_1 = requireCodegen();
|
|
22537
22522
|
const util_1 = util;
|
|
@@ -22779,143 +22764,135 @@ var keyword = {};
|
|
|
22779
22764
|
|
|
22780
22765
|
var code = {};
|
|
22781
22766
|
|
|
22782
|
-
|
|
22783
|
-
|
|
22784
|
-
|
|
22785
|
-
|
|
22786
|
-
|
|
22787
|
-
|
|
22788
|
-
|
|
22789
|
-
|
|
22790
|
-
|
|
22791
|
-
|
|
22792
|
-
|
|
22793
|
-
|
|
22794
|
-
|
|
22795
|
-
|
|
22796
|
-
|
|
22797
|
-
|
|
22798
|
-
|
|
22799
|
-
|
|
22800
|
-
|
|
22801
|
-
|
|
22802
|
-
|
|
22803
|
-
|
|
22804
|
-
|
|
22805
|
-
|
|
22806
|
-
|
|
22807
|
-
|
|
22808
|
-
|
|
22809
|
-
|
|
22810
|
-
|
|
22811
|
-
|
|
22812
|
-
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
22816
|
-
|
|
22817
|
-
|
|
22818
|
-
|
|
22819
|
-
|
|
22820
|
-
|
|
22821
|
-
|
|
22822
|
-
|
|
22823
|
-
|
|
22824
|
-
|
|
22825
|
-
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
22829
|
-
|
|
22830
|
-
|
|
22831
|
-
|
|
22832
|
-
|
|
22833
|
-
|
|
22834
|
-
|
|
22835
|
-
|
|
22836
|
-
|
|
22837
|
-
|
|
22838
|
-
|
|
22839
|
-
|
|
22840
|
-
|
|
22841
|
-
|
|
22842
|
-
|
|
22843
|
-
|
|
22844
|
-
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
22848
|
-
|
|
22849
|
-
|
|
22850
|
-
|
|
22851
|
-
|
|
22852
|
-
|
|
22853
|
-
|
|
22854
|
-
|
|
22855
|
-
|
|
22856
|
-
|
|
22857
|
-
|
|
22858
|
-
|
|
22859
|
-
|
|
22860
|
-
|
|
22861
|
-
|
|
22862
|
-
|
|
22863
|
-
|
|
22864
|
-
|
|
22865
|
-
|
|
22866
|
-
|
|
22867
|
-
|
|
22868
|
-
|
|
22869
|
-
|
|
22870
|
-
|
|
22871
|
-
|
|
22872
|
-
|
|
22873
|
-
|
|
22874
|
-
|
|
22875
|
-
|
|
22876
|
-
|
|
22877
|
-
|
|
22878
|
-
|
|
22879
|
-
|
|
22880
|
-
|
|
22881
|
-
|
|
22882
|
-
|
|
22883
|
-
|
|
22884
|
-
|
|
22885
|
-
|
|
22886
|
-
|
|
22887
|
-
|
|
22888
|
-
|
|
22889
|
-
|
|
22890
|
-
|
|
22891
|
-
|
|
22892
|
-
|
|
22893
|
-
|
|
22894
|
-
|
|
22895
|
-
|
|
22896
|
-
|
|
22897
|
-
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
|
|
22903
|
-
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
// or if all properties and items were evaluated (it.props === true && it.items === true)
|
|
22910
|
-
if (!merged)
|
|
22911
|
-
gen.if((0, codegen_1.not)(valid));
|
|
22912
|
-
}));
|
|
22913
|
-
cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
|
|
22914
|
-
}
|
|
22915
|
-
code.validateUnion = validateUnion;
|
|
22916
|
-
|
|
22917
|
-
return code;
|
|
22767
|
+
Object.defineProperty(code, "__esModule", { value: true });
|
|
22768
|
+
code.validateUnion = code.validateArray = code.usePattern = code.callValidateCode = code.schemaProperties = code.allSchemaProperties = code.noPropertyInData = code.propertyInData = code.isOwnProperty = code.hasPropFunc = code.reportMissingProp = code.checkMissingProp = code.checkReportMissingProp = void 0;
|
|
22769
|
+
const codegen_1$r = requireCodegen();
|
|
22770
|
+
const util_1$q = util;
|
|
22771
|
+
const names_1$6 = requireNames();
|
|
22772
|
+
const util_2$1 = util;
|
|
22773
|
+
function checkReportMissingProp(cxt, prop) {
|
|
22774
|
+
const { gen, data, it } = cxt;
|
|
22775
|
+
gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
|
|
22776
|
+
cxt.setParams({ missingProperty: (0, codegen_1$r._) `${prop}` }, true);
|
|
22777
|
+
cxt.error();
|
|
22778
|
+
});
|
|
22779
|
+
}
|
|
22780
|
+
code.checkReportMissingProp = checkReportMissingProp;
|
|
22781
|
+
function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
|
|
22782
|
+
return (0, codegen_1$r.or)(...properties.map((prop) => (0, codegen_1$r.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1$r._) `${missing} = ${prop}`)));
|
|
22783
|
+
}
|
|
22784
|
+
code.checkMissingProp = checkMissingProp;
|
|
22785
|
+
function reportMissingProp(cxt, missing) {
|
|
22786
|
+
cxt.setParams({ missingProperty: missing }, true);
|
|
22787
|
+
cxt.error();
|
|
22788
|
+
}
|
|
22789
|
+
code.reportMissingProp = reportMissingProp;
|
|
22790
|
+
function hasPropFunc(gen) {
|
|
22791
|
+
return gen.scopeValue("func", {
|
|
22792
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
22793
|
+
ref: Object.prototype.hasOwnProperty,
|
|
22794
|
+
code: (0, codegen_1$r._) `Object.prototype.hasOwnProperty`,
|
|
22795
|
+
});
|
|
22796
|
+
}
|
|
22797
|
+
code.hasPropFunc = hasPropFunc;
|
|
22798
|
+
function isOwnProperty(gen, data, property) {
|
|
22799
|
+
return (0, codegen_1$r._) `${hasPropFunc(gen)}.call(${data}, ${property})`;
|
|
22800
|
+
}
|
|
22801
|
+
code.isOwnProperty = isOwnProperty;
|
|
22802
|
+
function propertyInData(gen, data, property, ownProperties) {
|
|
22803
|
+
const cond = (0, codegen_1$r._) `${data}${(0, codegen_1$r.getProperty)(property)} !== undefined`;
|
|
22804
|
+
return ownProperties ? (0, codegen_1$r._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond;
|
|
22805
|
+
}
|
|
22806
|
+
code.propertyInData = propertyInData;
|
|
22807
|
+
function noPropertyInData(gen, data, property, ownProperties) {
|
|
22808
|
+
const cond = (0, codegen_1$r._) `${data}${(0, codegen_1$r.getProperty)(property)} === undefined`;
|
|
22809
|
+
return ownProperties ? (0, codegen_1$r.or)(cond, (0, codegen_1$r.not)(isOwnProperty(gen, data, property))) : cond;
|
|
22810
|
+
}
|
|
22811
|
+
code.noPropertyInData = noPropertyInData;
|
|
22812
|
+
function allSchemaProperties(schemaMap) {
|
|
22813
|
+
return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
|
|
22814
|
+
}
|
|
22815
|
+
code.allSchemaProperties = allSchemaProperties;
|
|
22816
|
+
function schemaProperties(it, schemaMap) {
|
|
22817
|
+
return allSchemaProperties(schemaMap).filter((p) => !(0, util_1$q.alwaysValidSchema)(it, schemaMap[p]));
|
|
22818
|
+
}
|
|
22819
|
+
code.schemaProperties = schemaProperties;
|
|
22820
|
+
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
|
|
22821
|
+
const dataAndSchema = passSchema ? (0, codegen_1$r._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
|
|
22822
|
+
const valCxt = [
|
|
22823
|
+
[names_1$6.default.instancePath, (0, codegen_1$r.strConcat)(names_1$6.default.instancePath, errorPath)],
|
|
22824
|
+
[names_1$6.default.parentData, it.parentData],
|
|
22825
|
+
[names_1$6.default.parentDataProperty, it.parentDataProperty],
|
|
22826
|
+
[names_1$6.default.rootData, names_1$6.default.rootData],
|
|
22827
|
+
];
|
|
22828
|
+
if (it.opts.dynamicRef)
|
|
22829
|
+
valCxt.push([names_1$6.default.dynamicAnchors, names_1$6.default.dynamicAnchors]);
|
|
22830
|
+
const args = (0, codegen_1$r._) `${dataAndSchema}, ${gen.object(...valCxt)}`;
|
|
22831
|
+
return context !== codegen_1$r.nil ? (0, codegen_1$r._) `${func}.call(${context}, ${args})` : (0, codegen_1$r._) `${func}(${args})`;
|
|
22832
|
+
}
|
|
22833
|
+
code.callValidateCode = callValidateCode;
|
|
22834
|
+
const newRegExp = (0, codegen_1$r._) `new RegExp`;
|
|
22835
|
+
function usePattern({ gen, it: { opts } }, pattern) {
|
|
22836
|
+
const u = opts.unicodeRegExp ? "u" : "";
|
|
22837
|
+
const { regExp } = opts.code;
|
|
22838
|
+
const rx = regExp(pattern, u);
|
|
22839
|
+
return gen.scopeValue("pattern", {
|
|
22840
|
+
key: rx.toString(),
|
|
22841
|
+
ref: rx,
|
|
22842
|
+
code: (0, codegen_1$r._) `${regExp.code === "new RegExp" ? newRegExp : (0, util_2$1.useFunc)(gen, regExp)}(${pattern}, ${u})`,
|
|
22843
|
+
});
|
|
22844
|
+
}
|
|
22845
|
+
code.usePattern = usePattern;
|
|
22846
|
+
function validateArray(cxt) {
|
|
22847
|
+
const { gen, data, keyword, it } = cxt;
|
|
22848
|
+
const valid = gen.name("valid");
|
|
22849
|
+
if (it.allErrors) {
|
|
22850
|
+
const validArr = gen.let("valid", true);
|
|
22851
|
+
validateItems(() => gen.assign(validArr, false));
|
|
22852
|
+
return validArr;
|
|
22853
|
+
}
|
|
22854
|
+
gen.var(valid, true);
|
|
22855
|
+
validateItems(() => gen.break());
|
|
22856
|
+
return valid;
|
|
22857
|
+
function validateItems(notValid) {
|
|
22858
|
+
const len = gen.const("len", (0, codegen_1$r._) `${data}.length`);
|
|
22859
|
+
gen.forRange("i", 0, len, (i) => {
|
|
22860
|
+
cxt.subschema({
|
|
22861
|
+
keyword,
|
|
22862
|
+
dataProp: i,
|
|
22863
|
+
dataPropType: util_1$q.Type.Num,
|
|
22864
|
+
}, valid);
|
|
22865
|
+
gen.if((0, codegen_1$r.not)(valid), notValid);
|
|
22866
|
+
});
|
|
22867
|
+
}
|
|
22868
|
+
}
|
|
22869
|
+
code.validateArray = validateArray;
|
|
22870
|
+
function validateUnion(cxt) {
|
|
22871
|
+
const { gen, schema, keyword, it } = cxt;
|
|
22872
|
+
/* istanbul ignore if */
|
|
22873
|
+
if (!Array.isArray(schema))
|
|
22874
|
+
throw new Error("ajv implementation error");
|
|
22875
|
+
const alwaysValid = schema.some((sch) => (0, util_1$q.alwaysValidSchema)(it, sch));
|
|
22876
|
+
if (alwaysValid && !it.opts.unevaluated)
|
|
22877
|
+
return;
|
|
22878
|
+
const valid = gen.let("valid", false);
|
|
22879
|
+
const schValid = gen.name("_valid");
|
|
22880
|
+
gen.block(() => schema.forEach((_sch, i) => {
|
|
22881
|
+
const schCxt = cxt.subschema({
|
|
22882
|
+
keyword,
|
|
22883
|
+
schemaProp: i,
|
|
22884
|
+
compositeRule: true,
|
|
22885
|
+
}, schValid);
|
|
22886
|
+
gen.assign(valid, (0, codegen_1$r._) `${valid} || ${schValid}`);
|
|
22887
|
+
const merged = cxt.mergeValidEvaluated(schCxt, schValid);
|
|
22888
|
+
// can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)
|
|
22889
|
+
// or if all properties and items were evaluated (it.props === true && it.items === true)
|
|
22890
|
+
if (!merged)
|
|
22891
|
+
gen.if((0, codegen_1$r.not)(valid));
|
|
22892
|
+
}));
|
|
22893
|
+
cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
|
|
22918
22894
|
}
|
|
22895
|
+
code.validateUnion = validateUnion;
|
|
22919
22896
|
|
|
22920
22897
|
var hasRequiredKeyword;
|
|
22921
22898
|
|
|
@@ -22926,7 +22903,7 @@ function requireKeyword () {
|
|
|
22926
22903
|
keyword.validateKeywordUsage = keyword.validSchemaType = keyword.funcKeywordCode = keyword.macroKeywordCode = void 0;
|
|
22927
22904
|
const codegen_1 = requireCodegen();
|
|
22928
22905
|
const names_1 = requireNames();
|
|
22929
|
-
const code_1 =
|
|
22906
|
+
const code_1 = code;
|
|
22930
22907
|
const errors_1 = requireErrors();
|
|
22931
22908
|
function macroKeywordCode(cxt, def) {
|
|
22932
22909
|
const { gen, keyword, schema, parentSchema, it } = cxt;
|
|
@@ -23444,7 +23421,7 @@ function requireValidate () {
|
|
|
23444
23421
|
validate.getData = validate.KeywordCxt = validate.validateFunctionCode = void 0;
|
|
23445
23422
|
const boolSchema_1 = requireBoolSchema();
|
|
23446
23423
|
const dataType_1 = dataType;
|
|
23447
|
-
const applicability_1 =
|
|
23424
|
+
const applicability_1 = applicability;
|
|
23448
23425
|
const dataType_2 = dataType;
|
|
23449
23426
|
const defaults_1 = requireDefaults();
|
|
23450
23427
|
const keyword_1 = requireKeyword();
|
|
@@ -26330,7 +26307,7 @@ var ref = {};
|
|
|
26330
26307
|
Object.defineProperty(ref, "__esModule", { value: true });
|
|
26331
26308
|
ref.callRef = ref.getValidate = void 0;
|
|
26332
26309
|
const ref_error_1 = requireRef_error();
|
|
26333
|
-
const code_1$8 =
|
|
26310
|
+
const code_1$8 = code;
|
|
26334
26311
|
const codegen_1$p = requireCodegen();
|
|
26335
26312
|
const names_1$4 = requireNames();
|
|
26336
26313
|
const compile_1$2 = compile;
|
|
@@ -26576,7 +26553,7 @@ limitLength.default = def$x;
|
|
|
26576
26553
|
var pattern = {};
|
|
26577
26554
|
|
|
26578
26555
|
Object.defineProperty(pattern, "__esModule", { value: true });
|
|
26579
|
-
const code_1$7 =
|
|
26556
|
+
const code_1$7 = code;
|
|
26580
26557
|
const codegen_1$l = requireCodegen();
|
|
26581
26558
|
const error$h = {
|
|
26582
26559
|
message: ({ schemaCode }) => (0, codegen_1$l.str) `must match pattern "${schemaCode}"`,
|
|
@@ -26626,7 +26603,7 @@ limitProperties.default = def$v;
|
|
|
26626
26603
|
var required = {};
|
|
26627
26604
|
|
|
26628
26605
|
Object.defineProperty(required, "__esModule", { value: true });
|
|
26629
|
-
const code_1$6 =
|
|
26606
|
+
const code_1$6 = code;
|
|
26630
26607
|
const codegen_1$j = requireCodegen();
|
|
26631
26608
|
const util_1$l = util;
|
|
26632
26609
|
const error$f = {
|
|
@@ -26968,7 +26945,7 @@ Object.defineProperty(items, "__esModule", { value: true });
|
|
|
26968
26945
|
items.validateTuple = void 0;
|
|
26969
26946
|
const codegen_1$d = requireCodegen();
|
|
26970
26947
|
const util_1$g = util;
|
|
26971
|
-
const code_1$5 =
|
|
26948
|
+
const code_1$5 = code;
|
|
26972
26949
|
const def$o = {
|
|
26973
26950
|
keyword: "items",
|
|
26974
26951
|
type: "array",
|
|
@@ -27031,7 +27008,7 @@ var items2020 = {};
|
|
|
27031
27008
|
Object.defineProperty(items2020, "__esModule", { value: true });
|
|
27032
27009
|
const codegen_1$c = requireCodegen();
|
|
27033
27010
|
const util_1$f = util;
|
|
27034
|
-
const code_1$4 =
|
|
27011
|
+
const code_1$4 = code;
|
|
27035
27012
|
const additionalItems_1$1 = additionalItems;
|
|
27036
27013
|
const error$9 = {
|
|
27037
27014
|
message: ({ params: { len } }) => (0, codegen_1$c.str) `must NOT have more than ${len} items`,
|
|
@@ -27160,7 +27137,7 @@ var dependencies = {};
|
|
|
27160
27137
|
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
|
|
27161
27138
|
const codegen_1 = requireCodegen();
|
|
27162
27139
|
const util_1 = util;
|
|
27163
|
-
const code_1 =
|
|
27140
|
+
const code_1 = code;
|
|
27164
27141
|
exports.error = {
|
|
27165
27142
|
message: ({ params: { property, depsCount, deps } }) => {
|
|
27166
27143
|
const property_ies = depsCount === 1 ? "property" : "properties";
|
|
@@ -27284,7 +27261,7 @@ propertyNames.default = def$k;
|
|
|
27284
27261
|
var additionalProperties = {};
|
|
27285
27262
|
|
|
27286
27263
|
Object.defineProperty(additionalProperties, "__esModule", { value: true });
|
|
27287
|
-
const code_1$3 =
|
|
27264
|
+
const code_1$3 = code;
|
|
27288
27265
|
const codegen_1$9 = requireCodegen();
|
|
27289
27266
|
const names_1$3 = requireNames();
|
|
27290
27267
|
const util_1$c = util;
|
|
@@ -27392,7 +27369,7 @@ var properties$g = {};
|
|
|
27392
27369
|
|
|
27393
27370
|
Object.defineProperty(properties$g, "__esModule", { value: true });
|
|
27394
27371
|
const validate_1 = requireValidate();
|
|
27395
|
-
const code_1$2 =
|
|
27372
|
+
const code_1$2 = code;
|
|
27396
27373
|
const util_1$b = util;
|
|
27397
27374
|
const additionalProperties_1$1 = additionalProperties;
|
|
27398
27375
|
const def$i = {
|
|
@@ -27446,7 +27423,7 @@ properties$g.default = def$i;
|
|
|
27446
27423
|
var patternProperties = {};
|
|
27447
27424
|
|
|
27448
27425
|
Object.defineProperty(patternProperties, "__esModule", { value: true });
|
|
27449
|
-
const code_1$1 =
|
|
27426
|
+
const code_1$1 = code;
|
|
27450
27427
|
const codegen_1$8 = requireCodegen();
|
|
27451
27428
|
const util_1$a = util;
|
|
27452
27429
|
const util_2 = util;
|
|
@@ -27549,7 +27526,7 @@ not.default = def$g;
|
|
|
27549
27526
|
var anyOf = {};
|
|
27550
27527
|
|
|
27551
27528
|
Object.defineProperty(anyOf, "__esModule", { value: true });
|
|
27552
|
-
const code_1 =
|
|
27529
|
+
const code_1 = code;
|
|
27553
27530
|
const def$f = {
|
|
27554
27531
|
keyword: "anyOf",
|
|
27555
27532
|
schemaType: "array",
|
|
@@ -53601,7 +53578,7 @@ class OnChainZKPVerifier {
|
|
|
53601
53578
|
});
|
|
53602
53579
|
}
|
|
53603
53580
|
}
|
|
53604
|
-
const metadata = this.packMetadatas(metadataArr);
|
|
53581
|
+
const metadata = metadataArr.length ? this.packMetadatas(metadataArr) : '0x';
|
|
53605
53582
|
payload.push({
|
|
53606
53583
|
requestId: requestID,
|
|
53607
53584
|
zkProof: zkProofEncoded,
|