@0xpolygonid/js-sdk 1.20.1 → 1.20.2

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