@nucypher/taco 0.7.0-alpha.2 → 0.7.0-alpha.4
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/cjs/conditions/base/context-variable.d.ts +10 -0
- package/dist/cjs/conditions/base/context-variable.js +19 -0
- package/dist/cjs/conditions/base/context-variable.js.map +1 -0
- package/dist/cjs/conditions/base/index.d.ts +2 -1
- package/dist/cjs/conditions/base/index.js +3 -2
- package/dist/cjs/conditions/base/index.js.map +1 -1
- package/dist/cjs/conditions/base/json.d.ts +7 -0
- package/dist/cjs/conditions/base/json.js +18 -0
- package/dist/cjs/conditions/base/json.js.map +1 -0
- package/dist/cjs/conditions/condition-factory.js +6 -3
- package/dist/cjs/conditions/condition-factory.js.map +1 -1
- package/dist/cjs/conditions/condition.d.ts +1 -0
- package/dist/cjs/conditions/condition.js +4 -3
- package/dist/cjs/conditions/condition.js.map +1 -1
- package/dist/cjs/conditions/predefined/address-allowlist.d.ts +11 -0
- package/dist/cjs/conditions/predefined/address-allowlist.js +31 -0
- package/dist/cjs/conditions/predefined/address-allowlist.js.map +1 -0
- package/dist/cjs/conditions/predefined/index.d.ts +1 -0
- package/dist/cjs/conditions/predefined/index.js +2 -1
- package/dist/cjs/conditions/predefined/index.js.map +1 -1
- package/dist/cjs/conditions/schemas/address-allowlist.d.ts +1 -14
- package/dist/cjs/conditions/schemas/address-allowlist.js +6 -15
- package/dist/cjs/conditions/schemas/address-allowlist.js.map +1 -1
- package/dist/cjs/conditions/schemas/context-variable.d.ts +91 -0
- package/dist/cjs/conditions/schemas/context-variable.js +17 -0
- package/dist/cjs/conditions/schemas/context-variable.js.map +1 -0
- package/dist/cjs/conditions/schemas/contract.d.ts +66 -12
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.d.ts +3 -0
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js +3 -0
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
- package/dist/cjs/conditions/schemas/json-api.d.ts +62 -8
- package/dist/cjs/conditions/schemas/json-rpc.d.ts +62 -8
- package/dist/cjs/conditions/schemas/json.d.ts +94 -0
- package/dist/cjs/conditions/schemas/json.js +17 -0
- package/dist/cjs/conditions/schemas/json.js.map +1 -0
- package/dist/cjs/conditions/schemas/return-value-test.d.ts +76 -0
- package/dist/cjs/conditions/schemas/return-value-test.js +4 -1
- package/dist/cjs/conditions/schemas/return-value-test.js.map +1 -1
- package/dist/cjs/conditions/schemas/rpc.d.ts +50 -4
- package/dist/cjs/conditions/schemas/sequential.js +6 -2
- package/dist/cjs/conditions/schemas/sequential.js.map +1 -1
- package/dist/cjs/conditions/schemas/time.d.ts +47 -1
- package/dist/cjs/conditions/schemas/utils.js +2 -2
- package/dist/cjs/conditions/schemas/utils.js.map +1 -1
- package/dist/cjs/conditions/schemas/variable-operation.d.ts +48 -0
- package/dist/cjs/conditions/schemas/variable-operation.js +81 -0
- package/dist/cjs/conditions/schemas/variable-operation.js.map +1 -0
- package/dist/cjs/sign.d.ts +2 -2
- package/dist/cjs/sign.js +73 -38
- package/dist/cjs/sign.js.map +1 -1
- package/dist/cjs/types.d.ts +1 -1
- package/dist/es/conditions/base/context-variable.d.ts +10 -0
- package/dist/es/conditions/base/context-variable.js +15 -0
- package/dist/es/conditions/base/context-variable.js.map +1 -0
- package/dist/es/conditions/base/index.d.ts +2 -1
- package/dist/es/conditions/base/index.js +2 -1
- package/dist/es/conditions/base/index.js.map +1 -1
- package/dist/es/conditions/base/json.d.ts +7 -0
- package/dist/es/conditions/base/json.js +12 -0
- package/dist/es/conditions/base/json.js.map +1 -0
- package/dist/es/conditions/condition-factory.js +6 -3
- package/dist/es/conditions/condition-factory.js.map +1 -1
- package/dist/es/conditions/condition.d.ts +1 -0
- package/dist/es/conditions/condition.js +1 -1
- package/dist/es/conditions/condition.js.map +1 -1
- package/dist/es/conditions/predefined/address-allowlist.d.ts +11 -0
- package/dist/es/conditions/predefined/address-allowlist.js +27 -0
- package/dist/es/conditions/predefined/address-allowlist.js.map +1 -0
- package/dist/es/conditions/predefined/index.d.ts +1 -0
- package/dist/es/conditions/predefined/index.js +1 -0
- package/dist/es/conditions/predefined/index.js.map +1 -1
- package/dist/es/conditions/schemas/address-allowlist.d.ts +1 -14
- package/dist/es/conditions/schemas/address-allowlist.js +5 -14
- package/dist/es/conditions/schemas/address-allowlist.js.map +1 -1
- package/dist/es/conditions/schemas/context-variable.d.ts +91 -0
- package/dist/es/conditions/schemas/context-variable.js +14 -0
- package/dist/es/conditions/schemas/context-variable.js.map +1 -0
- package/dist/es/conditions/schemas/contract.d.ts +66 -12
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.d.ts +3 -0
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.js +3 -0
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
- package/dist/es/conditions/schemas/json-api.d.ts +62 -8
- package/dist/es/conditions/schemas/json-rpc.d.ts +62 -8
- package/dist/es/conditions/schemas/json.d.ts +94 -0
- package/dist/es/conditions/schemas/json.js +14 -0
- package/dist/es/conditions/schemas/json.js.map +1 -0
- package/dist/es/conditions/schemas/return-value-test.d.ts +76 -0
- package/dist/es/conditions/schemas/return-value-test.js +4 -1
- package/dist/es/conditions/schemas/return-value-test.js.map +1 -1
- package/dist/es/conditions/schemas/rpc.d.ts +50 -4
- package/dist/es/conditions/schemas/sequential.js +6 -2
- package/dist/es/conditions/schemas/sequential.js.map +1 -1
- package/dist/es/conditions/schemas/time.d.ts +47 -1
- package/dist/es/conditions/schemas/utils.js +2 -2
- package/dist/es/conditions/schemas/utils.js.map +1 -1
- package/dist/es/conditions/schemas/variable-operation.d.ts +48 -0
- package/dist/es/conditions/schemas/variable-operation.js +78 -0
- package/dist/es/conditions/schemas/variable-operation.js.map +1 -0
- package/dist/es/sign.d.ts +2 -2
- package/dist/es/sign.js +74 -39
- package/dist/es/sign.js.map +1 -1
- package/dist/es/types.d.ts +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.es.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/cjs/conditions/base/address-allowlist.d.ts +0 -10
- package/dist/cjs/conditions/base/address-allowlist.js +0 -19
- package/dist/cjs/conditions/base/address-allowlist.js.map +0 -1
- package/dist/cjs/conditions/zod.d.ts +0 -3
- package/dist/cjs/conditions/zod.js +0 -19
- package/dist/cjs/conditions/zod.js.map +0 -1
- package/dist/es/conditions/base/address-allowlist.d.ts +0 -10
- package/dist/es/conditions/base/address-allowlist.js +0 -15
- package/dist/es/conditions/base/address-allowlist.js.map +0 -1
- package/dist/es/conditions/zod.d.ts +0 -3
- package/dist/es/conditions/zod.js +0 -17
- package/dist/es/conditions/zod.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Condition } from '../condition';
|
|
2
|
+
import { ContextVariableConditionProps, ContextVariableConditionType } from '../schemas/context-variable';
|
|
3
|
+
import { OmitConditionType } from '../shared';
|
|
4
|
+
export { ContextVariableConditionProps, ContextVariableConditionType };
|
|
5
|
+
/**
|
|
6
|
+
* A condition that performs comparison operations on context variable values.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ContextVariableCondition extends Condition {
|
|
9
|
+
constructor(value: OmitConditionType<ContextVariableConditionProps>);
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContextVariableCondition = exports.ContextVariableConditionType = void 0;
|
|
4
|
+
const condition_1 = require("../condition");
|
|
5
|
+
const context_variable_1 = require("../schemas/context-variable");
|
|
6
|
+
Object.defineProperty(exports, "ContextVariableConditionType", { enumerable: true, get: function () { return context_variable_1.ContextVariableConditionType; } });
|
|
7
|
+
/**
|
|
8
|
+
* A condition that performs comparison operations on context variable values.
|
|
9
|
+
*/
|
|
10
|
+
class ContextVariableCondition extends condition_1.Condition {
|
|
11
|
+
constructor(value) {
|
|
12
|
+
super(context_variable_1.contextVariableConditionSchema, {
|
|
13
|
+
conditionType: context_variable_1.ContextVariableConditionType,
|
|
14
|
+
...value,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ContextVariableCondition = ContextVariableCondition;
|
|
19
|
+
//# sourceMappingURL=context-variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-variable.js","sourceRoot":"","sources":["../../../../src/conditions/base/context-variable.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,kEAIqC;AAGG,6GAJtC,+CAA4B,OAIsC;AAEpE;;GAEG;AACH,MAAa,wBAAyB,SAAQ,qBAAS;IACrD,YAAY,KAAuD;QACjE,KAAK,CAAC,iDAA8B,EAAE;YACpC,aAAa,EAAE,+CAA4B;YAC3C,GAAG,KAAK;SACT,CAAC,CAAC;IACL,CAAC;CACF;AAPD,4DAOC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * as
|
|
1
|
+
export * as contextVariable from './context-variable';
|
|
2
2
|
export * as contract from './contract';
|
|
3
3
|
export * as ecdsa from './ecdsa';
|
|
4
|
+
export * as json from './json';
|
|
4
5
|
export * as jsonApi from './json-api';
|
|
5
6
|
export * as jsonRpc from './json-rpc';
|
|
6
7
|
export * as jwt from './jwt';
|
|
@@ -35,10 +35,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
};
|
|
36
36
|
})();
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.time = exports.signing = exports.rpc = exports.jwt = exports.jsonRpc = exports.jsonApi = exports.ecdsa = exports.contract = exports.
|
|
39
|
-
exports.
|
|
38
|
+
exports.time = exports.signing = exports.rpc = exports.jwt = exports.jsonRpc = exports.jsonApi = exports.json = exports.ecdsa = exports.contract = exports.contextVariable = void 0;
|
|
39
|
+
exports.contextVariable = __importStar(require("./context-variable"));
|
|
40
40
|
exports.contract = __importStar(require("./contract"));
|
|
41
41
|
exports.ecdsa = __importStar(require("./ecdsa"));
|
|
42
|
+
exports.json = __importStar(require("./json"));
|
|
42
43
|
exports.jsonApi = __importStar(require("./json-api"));
|
|
43
44
|
exports.jsonRpc = __importStar(require("./json-rpc"));
|
|
44
45
|
exports.jwt = __importStar(require("./jwt"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/base/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,gDAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/base/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,gDAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhD,sEAAsD;AACtD,uDAAuC;AACvC,iDAAiC;AACjC,+CAA+B;AAC/B,sDAAsC;AACtC,sDAAsC;AACtC,6CAA6B;AAC7B,6CAA6B;AAC7B,qDAAqC;AACrC,+CAA+B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Condition } from '../condition';
|
|
2
|
+
import { JsonConditionProps } from '../schemas/json';
|
|
3
|
+
import { OmitConditionType } from '../shared';
|
|
4
|
+
export { JsonConditionProps, jsonConditionSchema, JsonConditionType, } from '../schemas/json';
|
|
5
|
+
export declare class JsonCondition extends Condition {
|
|
6
|
+
constructor(value: OmitConditionType<JsonConditionProps>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsonCondition = exports.JsonConditionType = exports.jsonConditionSchema = void 0;
|
|
4
|
+
const condition_1 = require("../condition");
|
|
5
|
+
const json_1 = require("../schemas/json");
|
|
6
|
+
var json_2 = require("../schemas/json");
|
|
7
|
+
Object.defineProperty(exports, "jsonConditionSchema", { enumerable: true, get: function () { return json_2.jsonConditionSchema; } });
|
|
8
|
+
Object.defineProperty(exports, "JsonConditionType", { enumerable: true, get: function () { return json_2.JsonConditionType; } });
|
|
9
|
+
class JsonCondition extends condition_1.Condition {
|
|
10
|
+
constructor(value) {
|
|
11
|
+
super(json_1.jsonConditionSchema, {
|
|
12
|
+
conditionType: json_1.JsonConditionType,
|
|
13
|
+
...value,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.JsonCondition = JsonCondition;
|
|
18
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/conditions/base/json.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,0CAIyB;AAGzB,wCAIyB;AAFvB,2GAAA,mBAAmB,OAAA;AACnB,yGAAA,iBAAiB,OAAA;AAGnB,MAAa,aAAc,SAAQ,qBAAS;IAC1C,YAAY,KAA4C;QACtD,KAAK,CAAC,0BAAmB,EAAE;YACzB,aAAa,EAAE,wBAAiB;YAChC,GAAG,KAAK;SACT,CAAC,CAAC;IACL,CAAC;CACF;AAPD,sCAOC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConditionFactory = void 0;
|
|
4
|
-
const
|
|
4
|
+
const context_variable_1 = require("./base/context-variable");
|
|
5
5
|
const contract_1 = require("./base/contract");
|
|
6
6
|
const ecdsa_1 = require("./base/ecdsa");
|
|
7
|
+
const json_1 = require("./base/json");
|
|
7
8
|
const json_api_1 = require("./base/json-api");
|
|
8
9
|
const json_rpc_1 = require("./base/json-rpc");
|
|
9
10
|
const jwt_1 = require("./base/jwt");
|
|
@@ -26,18 +27,20 @@ class ConditionFactory {
|
|
|
26
27
|
return new contract_1.ContractCondition(props);
|
|
27
28
|
case ecdsa_1.ECDSAConditionType:
|
|
28
29
|
return new ecdsa_1.ECDSACondition(props);
|
|
30
|
+
case json_1.JsonConditionType:
|
|
31
|
+
return new json_1.JsonCondition(props);
|
|
29
32
|
case json_api_1.JsonApiConditionType:
|
|
30
33
|
return new json_api_1.JsonApiCondition(props);
|
|
31
34
|
case json_rpc_1.JsonRpcConditionType:
|
|
32
35
|
return new json_rpc_1.JsonRpcCondition(props);
|
|
33
36
|
case jwt_1.JWTConditionType:
|
|
34
37
|
return new jwt_1.JWTCondition(props);
|
|
35
|
-
case address_allowlist_1.AddressAllowlistConditionType:
|
|
36
|
-
return new address_allowlist_1.AddressAllowlistCondition(props);
|
|
37
38
|
case signing_1.SigningObjectAttributeConditionType:
|
|
38
39
|
return new signing_1.SigningObjectAttributeCondition(props);
|
|
39
40
|
case signing_1.SigningObjectAbiAttributeConditionType:
|
|
40
41
|
return new signing_1.SigningObjectAbiAttributeCondition(props);
|
|
42
|
+
case context_variable_1.ContextVariableConditionType:
|
|
43
|
+
return new context_variable_1.ContextVariableCondition(props);
|
|
41
44
|
// Logical Conditions
|
|
42
45
|
case compound_condition_1.CompoundConditionType:
|
|
43
46
|
return new compound_condition_1.CompoundCondition(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition-factory.js","sourceRoot":"","sources":["../../../src/conditions/condition-factory.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"condition-factory.js","sourceRoot":"","sources":["../../../src/conditions/condition-factory.ts"],"names":[],"mappings":";;;AAAA,8DAIiC;AACjC,8CAIyB;AACzB,wCAIsB;AACtB,sCAIqB;AACrB,8CAIyB;AACzB,8CAIyB;AACzB,oCAA+E;AAC/E,oCAA+E;AAC/E,4CAOwB;AACxB,sCAIqB;AACrB,6DAI8B;AAE9B,qEAIkC;AAClC,6CAIsB;AAEtB,MAAM,0BAA0B,GAAG,CAAC,IAAY,EAAE,EAAE,CAClD,2BAA2B,IAAI,EAAE,CAAC;AAEpC,MAAa,gBAAgB;IACpB,MAAM,CAAC,kBAAkB,CAAC,KAAqB;QACpD,QAAQ,KAAK,CAAC,aAAa,EAAE,CAAC;YAC5B,kBAAkB;YAClB,KAAK,sBAAgB;gBACnB,OAAO,IAAI,kBAAY,CAAC,KAA0B,CAAC,CAAC;YACtD,KAAK,wBAAiB;gBACpB,OAAO,IAAI,oBAAa,CAAC,KAA2B,CAAC,CAAC;YACxD,KAAK,gCAAqB;gBACxB,OAAO,IAAI,4BAAiB,CAAC,KAA+B,CAAC,CAAC;YAChE,KAAK,0BAAkB;gBACrB,OAAO,IAAI,sBAAc,CAAC,KAA4B,CAAC,CAAC;YAC1D,KAAK,wBAAiB;gBACpB,OAAO,IAAI,oBAAa,CAAC,KAA2B,CAAC,CAAC;YACxD,KAAK,+BAAoB;gBACvB,OAAO,IAAI,2BAAgB,CAAC,KAA8B,CAAC,CAAC;YAC9D,KAAK,+BAAoB;gBACvB,OAAO,IAAI,2BAAgB,CAAC,KAA8B,CAAC,CAAC;YAC9D,KAAK,sBAAgB;gBACnB,OAAO,IAAI,kBAAY,CAAC,KAA0B,CAAC,CAAC;YACtD,KAAK,6CAAmC;gBACtC,OAAO,IAAI,yCAA+B,CACxC,KAA6C,CAC9C,CAAC;YACJ,KAAK,gDAAsC;gBACzC,OAAO,IAAI,4CAAkC,CAC3C,KAAgD,CACjD,CAAC;YACJ,KAAK,+CAA4B;gBAC/B,OAAO,IAAI,2CAAwB,CACjC,KAAsC,CACvC,CAAC;YACJ,qBAAqB;YACrB,KAAK,0CAAqB;gBACxB,OAAO,IAAI,sCAAiB,CAAC,KAA+B,CAAC,CAAC;YAChE,KAAK,oCAAuB;gBAC1B,OAAO,IAAI,gCAAmB,CAAC,KAAiC,CAAC,CAAC;YACpE,KAAK,gDAAuB;gBAC1B,OAAO,IAAI,4CAAmB,CAAC,KAAiC,CAAC,CAAC;YACpE;gBACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;CACF;AA3CD,4CA2CC"}
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
export { baseConditionSchema } from './schemas/common';
|
|
3
3
|
type ConditionSchema = z.ZodSchema;
|
|
4
4
|
export type ConditionProps = z.infer<ConditionSchema>;
|
|
5
|
+
export declare const ERR_INVALID_CONDITION: (error: z.ZodError) => string;
|
|
5
6
|
export declare class Condition {
|
|
6
7
|
readonly schema: ConditionSchema;
|
|
7
8
|
readonly value: ConditionProps;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Condition = exports.baseConditionSchema = void 0;
|
|
3
|
+
exports.Condition = exports.ERR_INVALID_CONDITION = exports.baseConditionSchema = void 0;
|
|
4
4
|
const shared_1 = require("@nucypher/shared");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const const_1 = require("./const");
|
|
7
7
|
var common_1 = require("./schemas/common");
|
|
8
8
|
Object.defineProperty(exports, "baseConditionSchema", { enumerable: true, get: function () { return common_1.baseConditionSchema; } });
|
|
9
9
|
const ERR_INVALID_CONDITION = (error) => `Invalid condition: ${JSON.stringify(error.issues)}`;
|
|
10
|
+
exports.ERR_INVALID_CONDITION = ERR_INVALID_CONDITION;
|
|
10
11
|
class Condition {
|
|
11
12
|
schema;
|
|
12
13
|
value;
|
|
@@ -15,7 +16,7 @@ class Condition {
|
|
|
15
16
|
this.value = value;
|
|
16
17
|
const { data, error } = Condition.validate(schema, value);
|
|
17
18
|
if (error) {
|
|
18
|
-
throw new Error(ERR_INVALID_CONDITION(error));
|
|
19
|
+
throw new Error((0, exports.ERR_INVALID_CONDITION)(error));
|
|
19
20
|
}
|
|
20
21
|
this.value = data;
|
|
21
22
|
}
|
|
@@ -42,7 +43,7 @@ class Condition {
|
|
|
42
43
|
toObj() {
|
|
43
44
|
const { data, error } = Condition.validate(this.schema, this.value);
|
|
44
45
|
if (error) {
|
|
45
|
-
throw new Error(ERR_INVALID_CONDITION(error));
|
|
46
|
+
throw new Error((0, exports.ERR_INVALID_CONDITION)(error));
|
|
46
47
|
}
|
|
47
48
|
return data;
|
|
48
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../src/conditions/condition.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAGhD,oCAAkC;AAElC,mCAA8C;AAE9C,2CAAuD;AAA9C,6GAAA,mBAAmB,OAAA;
|
|
1
|
+
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../src/conditions/condition.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAGhD,oCAAkC;AAElC,mCAA8C;AAE9C,2CAAuD;AAA9C,6GAAA,mBAAmB,OAAA;AAKrB,MAAM,qBAAqB,GAAG,CAAC,KAAiB,EAAE,EAAE,CACzD,sBAAsB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;AAD1C,QAAA,qBAAqB,yBACqB;AAEvD,MAAa,SAAS;IAEF;IACA;IAFlB,YACkB,MAAuB,EACvB,KAAqB;QADrB,WAAM,GAAN,MAAM,CAAiB;QACvB,UAAK,GAAL,KAAK,CAAgB;QAErC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC1D,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,QAAQ,CACpB,MAAuB,EACvB,KAAqB;QAKrB,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAC/B,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED,8CAA8C;IACvC,2BAA2B;QAChC,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtC,KAAK,MAAM,KAAK,IAAI,2BAAmB,EAAE,CAAC;YACxC,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/B,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,sBAAsB;QAC3B,OAAO,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,CAAC;IACrD,CAAC;IAEM,KAAK;QACV,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACpE,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM,CAAC,KAAgB;QAC5B,OAAO,IAAA,qBAAY,EAAC,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;CACF;AApDD,8BAoDC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ContextVariableCondition } from '../base/context-variable';
|
|
2
|
+
import { AddressAllowlistConditionProps } from '../schemas/address-allowlist';
|
|
3
|
+
export { AddressAllowlistConditionProps } from '../schemas/address-allowlist';
|
|
4
|
+
/**
|
|
5
|
+
* A Client-side condition that checks if a user's address is in an allowlist and transforms the object into `ContextVariableCondition`.
|
|
6
|
+
* The nodes process this as a standard context variable that checks if the user's address is in the allowlist.
|
|
7
|
+
* @remark This condition doesn’t have a unique type of its own; it is simply a wrapper for creating a `ContextVariableCondition`.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AddressAllowlistCondition extends ContextVariableCondition {
|
|
10
|
+
constructor(value: AddressAllowlistConditionProps);
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressAllowlistCondition = void 0;
|
|
4
|
+
const taco_auth_1 = require("@nucypher/taco-auth");
|
|
5
|
+
const context_variable_1 = require("../base/context-variable");
|
|
6
|
+
const condition_1 = require("../condition");
|
|
7
|
+
const address_allowlist_1 = require("../schemas/address-allowlist");
|
|
8
|
+
/**
|
|
9
|
+
* A Client-side condition that checks if a user's address is in an allowlist and transforms the object into `ContextVariableCondition`.
|
|
10
|
+
* The nodes process this as a standard context variable that checks if the user's address is in the allowlist.
|
|
11
|
+
* @remark This condition doesn’t have a unique type of its own; it is simply a wrapper for creating a `ContextVariableCondition`.
|
|
12
|
+
*/
|
|
13
|
+
class AddressAllowlistCondition extends context_variable_1.ContextVariableCondition {
|
|
14
|
+
constructor(value) {
|
|
15
|
+
const { data, error } = AddressAllowlistCondition.validate(address_allowlist_1.addressAllowlistConditionSchema, value);
|
|
16
|
+
if (error) {
|
|
17
|
+
throw new Error((0, condition_1.ERR_INVALID_CONDITION)(error));
|
|
18
|
+
}
|
|
19
|
+
const contextVariableConditionProps = {
|
|
20
|
+
conditionType: context_variable_1.ContextVariableConditionType,
|
|
21
|
+
contextVariable: taco_auth_1.USER_ADDRESS_PARAM_DEFAULT,
|
|
22
|
+
returnValueTest: {
|
|
23
|
+
comparator: 'in',
|
|
24
|
+
value: data,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
super(contextVariableConditionProps);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.AddressAllowlistCondition = AddressAllowlistCondition;
|
|
31
|
+
//# sourceMappingURL=address-allowlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-allowlist.js","sourceRoot":"","sources":["../../../../src/conditions/predefined/address-allowlist.ts"],"names":[],"mappings":";;;AAAA,mDAAiE;AAEjE,+DAIkC;AAClC,4CAAqD;AACrD,oEAGsC;AAItC;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,2CAAwB;IACrE,YAAY,KAAqC;QAC/C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,yBAAyB,CAAC,QAAQ,CACxD,mDAA+B,EAC/B,KAAK,CACN,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,IAAA,iCAAqB,EAAC,KAAK,CAAC,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,6BAA6B,GAAkC;YACnE,aAAa,EAAE,+CAA4B;YAC3C,eAAe,EAAE,sCAA0B;YAC3C,eAAe,EAAE;gBACf,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,IAAI;aACZ;SACF,CAAC;QAEF,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACvC,CAAC;CACF;AArBD,8DAqBC"}
|
|
@@ -33,7 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.erc721 = exports.erc20 = void 0;
|
|
36
|
+
exports.erc721 = exports.erc20 = exports.addressAllowlist = void 0;
|
|
37
|
+
exports.addressAllowlist = __importStar(require("./address-allowlist"));
|
|
37
38
|
exports.erc20 = __importStar(require("./erc20"));
|
|
38
39
|
exports.erc721 = __importStar(require("./erc721"));
|
|
39
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/predefined/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAiC;AACjC,mDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/predefined/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wEAAwD;AACxD,iDAAiC;AACjC,mDAAmC"}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const addressAllowlistConditionSchema: z.ZodObject<{} & {
|
|
4
|
-
conditionType: z.ZodLiteral<"address-allowlist">;
|
|
5
|
-
userAddress: z.ZodLiteral<":userAddress">;
|
|
6
|
-
addresses: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
7
|
-
}, "strict", z.ZodTypeAny, {
|
|
8
|
-
conditionType: "address-allowlist";
|
|
9
|
-
userAddress: ":userAddress";
|
|
10
|
-
addresses: string[];
|
|
11
|
-
}, {
|
|
12
|
-
conditionType: "address-allowlist";
|
|
13
|
-
userAddress: ":userAddress";
|
|
14
|
-
addresses: string[];
|
|
15
|
-
}>;
|
|
2
|
+
export declare const addressAllowlistConditionSchema: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
16
3
|
export type AddressAllowlistConditionProps = z.infer<typeof addressAllowlistConditionSchema>;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addressAllowlistConditionSchema =
|
|
3
|
+
exports.addressAllowlistConditionSchema = void 0;
|
|
4
4
|
const shared_1 = require("@nucypher/shared");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
userAddress: common_1.UserAddressSchema,
|
|
12
|
-
addresses: zod_1.z
|
|
13
|
-
.array(shared_1.EthAddressSchemaStrict)
|
|
14
|
-
.min(1, 'At least one address must be provided')
|
|
15
|
-
.max(25, 'A maximum of 25 addresses is allowed')
|
|
16
|
-
.describe('List of wallet addresses allowed to decrypt. Addresses should be provided in checksummed form.'),
|
|
17
|
-
})
|
|
18
|
-
.strict()
|
|
19
|
-
.describe('Address Allowlist Condition for allowing decryption for specific wallet addresses. It is very handy when combined with other conditions.');
|
|
6
|
+
exports.addressAllowlistConditionSchema = zod_1.z
|
|
7
|
+
.array(shared_1.EthAddressSchemaStrict)
|
|
8
|
+
.min(1, 'At least one address must be provided')
|
|
9
|
+
.max(25, 'A maximum of 25 addresses is allowed')
|
|
10
|
+
.describe('List of allowed wallet addresses. Addresses should be provided in checksummed form.');
|
|
20
11
|
//# sourceMappingURL=address-allowlist.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-allowlist.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/address-allowlist.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAC1D,6BAAwB;
|
|
1
|
+
{"version":3,"file":"address-allowlist.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/address-allowlist.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAC1D,6BAAwB;AAEX,QAAA,+BAA+B,GAAG,OAAC;KAC7C,KAAK,CAAC,+BAAsB,CAAC;KAC7B,GAAG,CAAC,CAAC,EAAE,uCAAuC,CAAC;KAC/C,GAAG,CAAC,EAAE,EAAE,sCAAsC,CAAC;KAC/C,QAAQ,CACP,qFAAqF,CACtF,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ContextVariableConditionType = "context-variable";
|
|
3
|
+
export declare const contextVariableConditionSchema: z.ZodObject<{} & {
|
|
4
|
+
conditionType: z.ZodLiteral<"context-variable">;
|
|
5
|
+
contextVariable: z.ZodString;
|
|
6
|
+
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
7
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
9
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
10
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
11
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
14
|
+
value?: any;
|
|
15
|
+
}, {
|
|
16
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
17
|
+
value?: any;
|
|
18
|
+
}>, {
|
|
19
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
20
|
+
value?: any;
|
|
21
|
+
}, {
|
|
22
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
23
|
+
value?: any;
|
|
24
|
+
}>, {
|
|
25
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
26
|
+
value?: any;
|
|
27
|
+
}, {
|
|
28
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
29
|
+
value?: any;
|
|
30
|
+
}>, "many">>;
|
|
31
|
+
} & {
|
|
32
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
35
|
+
value?: any;
|
|
36
|
+
index?: number | undefined;
|
|
37
|
+
operations?: {
|
|
38
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
39
|
+
value?: any;
|
|
40
|
+
}[] | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
43
|
+
value?: any;
|
|
44
|
+
index?: number | undefined;
|
|
45
|
+
operations?: {
|
|
46
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
47
|
+
value?: any;
|
|
48
|
+
}[] | undefined;
|
|
49
|
+
}>, {
|
|
50
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
51
|
+
value?: any;
|
|
52
|
+
index?: number | undefined;
|
|
53
|
+
operations?: {
|
|
54
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
55
|
+
value?: any;
|
|
56
|
+
}[] | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
59
|
+
value?: any;
|
|
60
|
+
index?: number | undefined;
|
|
61
|
+
operations?: {
|
|
62
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
63
|
+
value?: any;
|
|
64
|
+
}[] | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
}, "strict", z.ZodTypeAny, {
|
|
67
|
+
conditionType: "context-variable";
|
|
68
|
+
contextVariable: string;
|
|
69
|
+
returnValueTest: {
|
|
70
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
71
|
+
value?: any;
|
|
72
|
+
index?: number | undefined;
|
|
73
|
+
operations?: {
|
|
74
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
75
|
+
value?: any;
|
|
76
|
+
}[] | undefined;
|
|
77
|
+
};
|
|
78
|
+
}, {
|
|
79
|
+
conditionType: "context-variable";
|
|
80
|
+
contextVariable: string;
|
|
81
|
+
returnValueTest: {
|
|
82
|
+
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
83
|
+
value?: any;
|
|
84
|
+
index?: number | undefined;
|
|
85
|
+
operations?: {
|
|
86
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
87
|
+
value?: any;
|
|
88
|
+
}[] | undefined;
|
|
89
|
+
};
|
|
90
|
+
}>;
|
|
91
|
+
export type ContextVariableConditionProps = z.infer<typeof contextVariableConditionSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contextVariableConditionSchema = exports.ContextVariableConditionType = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
const context_1 = require("./context");
|
|
7
|
+
const return_value_test_1 = require("./return-value-test");
|
|
8
|
+
exports.ContextVariableConditionType = 'context-variable';
|
|
9
|
+
exports.contextVariableConditionSchema = common_1.baseConditionSchema
|
|
10
|
+
.extend({
|
|
11
|
+
conditionType: zod_1.z.literal(exports.ContextVariableConditionType),
|
|
12
|
+
contextVariable: context_1.contextParamSchema.describe('The context variable to check (e.g., ":userAddress", ":customParam")'),
|
|
13
|
+
returnValueTest: return_value_test_1.returnValueTestSchema,
|
|
14
|
+
})
|
|
15
|
+
.strict()
|
|
16
|
+
.describe('Context Variable Condition for performing comparison operations on context variable values.');
|
|
17
|
+
//# sourceMappingURL=context-variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-variable.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/context-variable.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qCAA+C;AAC/C,uCAA+C;AAC/C,2DAA4D;AAE/C,QAAA,4BAA4B,GAAG,kBAAkB,CAAC;AAElD,QAAA,8BAA8B,GAAG,4BAAmB;KAC9D,MAAM,CAAC;IACN,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,oCAA4B,CAAC;IACtD,eAAe,EAAE,4BAAkB,CAAC,QAAQ,CAC1C,sEAAsE,CACvE;IACD,eAAe,EAAE,yCAAqB;CACvC,CAAC;KACD,MAAM,EAAE;KACR,QAAQ,CACP,6FAA6F,CAC9F,CAAC"}
|
|
@@ -158,24 +158,62 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
158
158
|
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
159
159
|
index: z.ZodOptional<z.ZodNumber>;
|
|
160
160
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
161
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
162
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
163
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
166
|
+
value?: any;
|
|
167
|
+
}, {
|
|
168
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
169
|
+
value?: any;
|
|
170
|
+
}>, {
|
|
171
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
172
|
+
value?: any;
|
|
173
|
+
}, {
|
|
174
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
175
|
+
value?: any;
|
|
176
|
+
}>, {
|
|
177
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
178
|
+
value?: any;
|
|
179
|
+
}, {
|
|
180
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
181
|
+
value?: any;
|
|
182
|
+
}>, "many">>;
|
|
161
183
|
} & {
|
|
162
184
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
163
185
|
}, "strip", z.ZodTypeAny, {
|
|
164
186
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
165
187
|
value?: any;
|
|
166
188
|
index?: number | undefined;
|
|
189
|
+
operations?: {
|
|
190
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
191
|
+
value?: any;
|
|
192
|
+
}[] | undefined;
|
|
167
193
|
}, {
|
|
168
194
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
169
195
|
value?: any;
|
|
170
196
|
index?: number | undefined;
|
|
197
|
+
operations?: {
|
|
198
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
199
|
+
value?: any;
|
|
200
|
+
}[] | undefined;
|
|
171
201
|
}>, {
|
|
172
202
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
173
203
|
value?: any;
|
|
174
204
|
index?: number | undefined;
|
|
205
|
+
operations?: {
|
|
206
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
207
|
+
value?: any;
|
|
208
|
+
}[] | undefined;
|
|
175
209
|
}, {
|
|
176
210
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
177
211
|
value?: any;
|
|
178
212
|
index?: number | undefined;
|
|
213
|
+
operations?: {
|
|
214
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
215
|
+
value?: any;
|
|
216
|
+
}[] | undefined;
|
|
179
217
|
}>;
|
|
180
218
|
} & {
|
|
181
219
|
conditionType: z.ZodDefault<z.ZodLiteral<"contract">>;
|
|
@@ -324,16 +362,19 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
324
362
|
parameters: z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">;
|
|
325
363
|
}, "strip", z.ZodTypeAny, {
|
|
326
364
|
conditionType: "contract";
|
|
327
|
-
method: string;
|
|
328
365
|
returnValueTest: {
|
|
329
366
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
330
367
|
value?: any;
|
|
331
368
|
index?: number | undefined;
|
|
369
|
+
operations?: {
|
|
370
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
371
|
+
value?: any;
|
|
372
|
+
}[] | undefined;
|
|
332
373
|
};
|
|
333
|
-
parameters: any[];
|
|
334
374
|
chain: number;
|
|
375
|
+
method: string;
|
|
376
|
+
parameters: any[];
|
|
335
377
|
contractAddress: string;
|
|
336
|
-
standardContractType?: "ERC20" | "ERC721" | undefined;
|
|
337
378
|
functionAbi?: {
|
|
338
379
|
type: "function";
|
|
339
380
|
name: string;
|
|
@@ -353,18 +394,22 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
353
394
|
}[]];
|
|
354
395
|
stateMutability: "view" | "pure";
|
|
355
396
|
} | undefined;
|
|
397
|
+
standardContractType?: "ERC20" | "ERC721" | undefined;
|
|
356
398
|
}, {
|
|
357
|
-
method: string;
|
|
358
399
|
returnValueTest: {
|
|
359
400
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
360
401
|
value?: any;
|
|
361
402
|
index?: number | undefined;
|
|
403
|
+
operations?: {
|
|
404
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
405
|
+
value?: any;
|
|
406
|
+
}[] | undefined;
|
|
362
407
|
};
|
|
363
|
-
parameters: any[];
|
|
364
408
|
chain: number;
|
|
409
|
+
method: string;
|
|
410
|
+
parameters: any[];
|
|
365
411
|
contractAddress: string;
|
|
366
412
|
conditionType?: "contract" | undefined;
|
|
367
|
-
standardContractType?: "ERC20" | "ERC721" | undefined;
|
|
368
413
|
functionAbi?: {
|
|
369
414
|
type: "function";
|
|
370
415
|
name: string;
|
|
@@ -384,18 +429,22 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
384
429
|
}[]];
|
|
385
430
|
stateMutability: "view" | "pure";
|
|
386
431
|
} | undefined;
|
|
432
|
+
standardContractType?: "ERC20" | "ERC721" | undefined;
|
|
387
433
|
}>, {
|
|
388
434
|
conditionType: "contract";
|
|
389
|
-
method: string;
|
|
390
435
|
returnValueTest: {
|
|
391
436
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
392
437
|
value?: any;
|
|
393
438
|
index?: number | undefined;
|
|
439
|
+
operations?: {
|
|
440
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
441
|
+
value?: any;
|
|
442
|
+
}[] | undefined;
|
|
394
443
|
};
|
|
395
|
-
parameters: any[];
|
|
396
444
|
chain: number;
|
|
445
|
+
method: string;
|
|
446
|
+
parameters: any[];
|
|
397
447
|
contractAddress: string;
|
|
398
|
-
standardContractType?: "ERC20" | "ERC721" | undefined;
|
|
399
448
|
functionAbi?: {
|
|
400
449
|
type: "function";
|
|
401
450
|
name: string;
|
|
@@ -415,18 +464,22 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
415
464
|
}[]];
|
|
416
465
|
stateMutability: "view" | "pure";
|
|
417
466
|
} | undefined;
|
|
467
|
+
standardContractType?: "ERC20" | "ERC721" | undefined;
|
|
418
468
|
}, {
|
|
419
|
-
method: string;
|
|
420
469
|
returnValueTest: {
|
|
421
470
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
422
471
|
value?: any;
|
|
423
472
|
index?: number | undefined;
|
|
473
|
+
operations?: {
|
|
474
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
475
|
+
value?: any;
|
|
476
|
+
}[] | undefined;
|
|
424
477
|
};
|
|
425
|
-
parameters: any[];
|
|
426
478
|
chain: number;
|
|
479
|
+
method: string;
|
|
480
|
+
parameters: any[];
|
|
427
481
|
contractAddress: string;
|
|
428
482
|
conditionType?: "contract" | undefined;
|
|
429
|
-
standardContractType?: "ERC20" | "ERC721" | undefined;
|
|
430
483
|
functionAbi?: {
|
|
431
484
|
type: "function";
|
|
432
485
|
name: string;
|
|
@@ -446,5 +499,6 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
446
499
|
}[]];
|
|
447
500
|
stateMutability: "view" | "pure";
|
|
448
501
|
} | undefined;
|
|
502
|
+
standardContractType?: "ERC20" | "ERC721" | undefined;
|
|
449
503
|
}>;
|
|
450
504
|
export type ContractConditionProps = z.infer<typeof contractConditionSchema>;
|