@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 @@
|
|
|
1
|
+
{"version":3,"file":"context-variable.js","sourceRoot":"","sources":["../../../../src/conditions/base/context-variable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAEL,8BAA8B,EAC9B,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAiC,4BAA4B,EAAE,CAAC;AAEvE;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,SAAS;IACrD,YAAY,KAAuD;QACjE,KAAK,CAAC,8BAA8B,EAAE;YACpC,aAAa,EAAE,4BAA4B;YAC3C,GAAG,KAAK;SACT,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -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';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Exporting classes here instead of their respective schema files to
|
|
2
2
|
// avoid circular dependency on Condition class.
|
|
3
|
-
export * as
|
|
3
|
+
export * as contextVariable from './context-variable';
|
|
4
4
|
export * as contract from './contract';
|
|
5
5
|
export * as ecdsa from './ecdsa';
|
|
6
|
+
export * as json from './json';
|
|
6
7
|
export * as jsonApi from './json-api';
|
|
7
8
|
export * as jsonRpc from './json-rpc';
|
|
8
9
|
export * as jwt from './jwt';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/base/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,gDAAgD;AAEhD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/base/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,gDAAgD;AAEhD,OAAO,KAAK,eAAe,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
|
|
@@ -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,12 @@
|
|
|
1
|
+
import { Condition } from '../condition';
|
|
2
|
+
import { jsonConditionSchema, JsonConditionType, } from '../schemas/json';
|
|
3
|
+
export { jsonConditionSchema, JsonConditionType, } from '../schemas/json';
|
|
4
|
+
export class JsonCondition extends Condition {
|
|
5
|
+
constructor(value) {
|
|
6
|
+
super(jsonConditionSchema, {
|
|
7
|
+
conditionType: JsonConditionType,
|
|
8
|
+
...value,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/conditions/base/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAEL,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAEL,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,OAAO,aAAc,SAAQ,SAAS;IAC1C,YAAY,KAA4C;QACtD,KAAK,CAAC,mBAAmB,EAAE;YACzB,aAAa,EAAE,iBAAiB;YAChC,GAAG,KAAK;SACT,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ContextVariableCondition, ContextVariableConditionType, } from './base/context-variable';
|
|
2
2
|
import { ContractCondition, ContractConditionType, } from './base/contract';
|
|
3
3
|
import { ECDSACondition, ECDSAConditionType, } from './base/ecdsa';
|
|
4
|
+
import { JsonCondition, JsonConditionType, } from './base/json';
|
|
4
5
|
import { JsonApiCondition, JsonApiConditionType, } from './base/json-api';
|
|
5
6
|
import { JsonRpcCondition, JsonRpcConditionType, } from './base/json-rpc';
|
|
6
7
|
import { JWTCondition, JWTConditionType } from './base/jwt';
|
|
@@ -23,18 +24,20 @@ export class ConditionFactory {
|
|
|
23
24
|
return new ContractCondition(props);
|
|
24
25
|
case ECDSAConditionType:
|
|
25
26
|
return new ECDSACondition(props);
|
|
27
|
+
case JsonConditionType:
|
|
28
|
+
return new JsonCondition(props);
|
|
26
29
|
case JsonApiConditionType:
|
|
27
30
|
return new JsonApiCondition(props);
|
|
28
31
|
case JsonRpcConditionType:
|
|
29
32
|
return new JsonRpcCondition(props);
|
|
30
33
|
case JWTConditionType:
|
|
31
34
|
return new JWTCondition(props);
|
|
32
|
-
case AddressAllowlistConditionType:
|
|
33
|
-
return new AddressAllowlistCondition(props);
|
|
34
35
|
case SigningObjectAttributeConditionType:
|
|
35
36
|
return new SigningObjectAttributeCondition(props);
|
|
36
37
|
case SigningObjectAbiAttributeConditionType:
|
|
37
38
|
return new SigningObjectAbiAttributeCondition(props);
|
|
39
|
+
case ContextVariableConditionType:
|
|
40
|
+
return new ContextVariableCondition(props);
|
|
38
41
|
// Logical Conditions
|
|
39
42
|
case CompoundConditionType:
|
|
40
43
|
return new CompoundCondition(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition-factory.js","sourceRoot":"","sources":["../../../src/conditions/condition-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"condition-factory.js","sourceRoot":"","sources":["../../../src/conditions/condition-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EAExB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,EAEjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EAEd,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EAEb,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAqB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAqB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EACL,kCAAkC,EAElC,sCAAsC,EACtC,+BAA+B,EAE/B,mCAAmC,GACpC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EAEb,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EAEjB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,mBAAmB,EAEnB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EAEnB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,MAAM,0BAA0B,GAAG,CAAC,IAAY,EAAE,EAAE,CAClD,2BAA2B,IAAI,EAAE,CAAC;AAEpC,MAAM,OAAO,gBAAgB;IACpB,MAAM,CAAC,kBAAkB,CAAC,KAAqB;QACpD,QAAQ,KAAK,CAAC,aAAa,EAAE,CAAC;YAC5B,kBAAkB;YAClB,KAAK,gBAAgB;gBACnB,OAAO,IAAI,YAAY,CAAC,KAA0B,CAAC,CAAC;YACtD,KAAK,iBAAiB;gBACpB,OAAO,IAAI,aAAa,CAAC,KAA2B,CAAC,CAAC;YACxD,KAAK,qBAAqB;gBACxB,OAAO,IAAI,iBAAiB,CAAC,KAA+B,CAAC,CAAC;YAChE,KAAK,kBAAkB;gBACrB,OAAO,IAAI,cAAc,CAAC,KAA4B,CAAC,CAAC;YAC1D,KAAK,iBAAiB;gBACpB,OAAO,IAAI,aAAa,CAAC,KAA2B,CAAC,CAAC;YACxD,KAAK,oBAAoB;gBACvB,OAAO,IAAI,gBAAgB,CAAC,KAA8B,CAAC,CAAC;YAC9D,KAAK,oBAAoB;gBACvB,OAAO,IAAI,gBAAgB,CAAC,KAA8B,CAAC,CAAC;YAC9D,KAAK,gBAAgB;gBACnB,OAAO,IAAI,YAAY,CAAC,KAA0B,CAAC,CAAC;YACtD,KAAK,mCAAmC;gBACtC,OAAO,IAAI,+BAA+B,CACxC,KAA6C,CAC9C,CAAC;YACJ,KAAK,sCAAsC;gBACzC,OAAO,IAAI,kCAAkC,CAC3C,KAAgD,CACjD,CAAC;YACJ,KAAK,4BAA4B;gBAC/B,OAAO,IAAI,wBAAwB,CACjC,KAAsC,CACvC,CAAC;YACJ,qBAAqB;YACrB,KAAK,qBAAqB;gBACxB,OAAO,IAAI,iBAAiB,CAAC,KAA+B,CAAC,CAAC;YAChE,KAAK,uBAAuB;gBAC1B,OAAO,IAAI,mBAAmB,CAAC,KAAiC,CAAC,CAAC;YACpE,KAAK,uBAAuB;gBAC1B,OAAO,IAAI,mBAAmB,CAAC,KAAiC,CAAC,CAAC;YACpE;gBACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -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;
|
|
@@ -2,7 +2,7 @@ import { objectEquals } from '@nucypher/shared';
|
|
|
2
2
|
import { toJSON } from '../utils';
|
|
3
3
|
import { USER_ADDRESS_PARAMS } from './const';
|
|
4
4
|
export { baseConditionSchema } from './schemas/common';
|
|
5
|
-
const ERR_INVALID_CONDITION = (error) => `Invalid condition: ${JSON.stringify(error.issues)}`;
|
|
5
|
+
export const ERR_INVALID_CONDITION = (error) => `Invalid condition: ${JSON.stringify(error.issues)}`;
|
|
6
6
|
export class Condition {
|
|
7
7
|
schema;
|
|
8
8
|
value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../src/conditions/condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvD,MAAM,qBAAqB,GAAG,CAAC,KAAiB,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../src/conditions/condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAiB,EAAE,EAAE,CACzD,sBAAsB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;AAEvD,MAAM,OAAO,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,qBAAqB,CAAC,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,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtC,KAAK,MAAM,KAAK,IAAI,mBAAmB,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,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM,CAAC,KAAgB;QAC5B,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;CACF"}
|
|
@@ -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,27 @@
|
|
|
1
|
+
import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth';
|
|
2
|
+
import { ContextVariableCondition, ContextVariableConditionType, } from '../base/context-variable';
|
|
3
|
+
import { ERR_INVALID_CONDITION } from '../condition';
|
|
4
|
+
import { addressAllowlistConditionSchema, } from '../schemas/address-allowlist';
|
|
5
|
+
/**
|
|
6
|
+
* A Client-side condition that checks if a user's address is in an allowlist and transforms the object into `ContextVariableCondition`.
|
|
7
|
+
* The nodes process this as a standard context variable that checks if the user's address is in the allowlist.
|
|
8
|
+
* @remark This condition doesn’t have a unique type of its own; it is simply a wrapper for creating a `ContextVariableCondition`.
|
|
9
|
+
*/
|
|
10
|
+
export class AddressAllowlistCondition extends ContextVariableCondition {
|
|
11
|
+
constructor(value) {
|
|
12
|
+
const { data, error } = AddressAllowlistCondition.validate(addressAllowlistConditionSchema, value);
|
|
13
|
+
if (error) {
|
|
14
|
+
throw new Error(ERR_INVALID_CONDITION(error));
|
|
15
|
+
}
|
|
16
|
+
const contextVariableConditionProps = {
|
|
17
|
+
conditionType: ContextVariableConditionType,
|
|
18
|
+
contextVariable: USER_ADDRESS_PARAM_DEFAULT,
|
|
19
|
+
returnValueTest: {
|
|
20
|
+
comparator: 'in',
|
|
21
|
+
value: data,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
super(contextVariableConditionProps);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# 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,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EACL,wBAAwB,EAExB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAEL,+BAA+B,GAChC,MAAM,8BAA8B,CAAC;AAItC;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,wBAAwB;IACrE,YAAY,KAAqC;QAC/C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,yBAAyB,CAAC,QAAQ,CACxD,+BAA+B,EAC/B,KAAK,CACN,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,6BAA6B,GAAkC;YACnE,aAAa,EAAE,4BAA4B;YAC3C,eAAe,EAAE,0BAA0B;YAC3C,eAAe,EAAE;gBACf,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,IAAI;aACZ;SACF,CAAC;QAEF,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/predefined/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/predefined/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC"}
|
|
@@ -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,17 +1,8 @@
|
|
|
1
1
|
import { EthAddressSchemaStrict } from '@nucypher/shared';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
userAddress: UserAddressSchema,
|
|
9
|
-
addresses: z
|
|
10
|
-
.array(EthAddressSchemaStrict)
|
|
11
|
-
.min(1, 'At least one address must be provided')
|
|
12
|
-
.max(25, 'A maximum of 25 addresses is allowed')
|
|
13
|
-
.describe('List of wallet addresses allowed to decrypt. Addresses should be provided in checksummed form.'),
|
|
14
|
-
})
|
|
15
|
-
.strict()
|
|
16
|
-
.describe('Address Allowlist Condition for allowing decryption for specific wallet addresses. It is very handy when combined with other conditions.');
|
|
3
|
+
export const addressAllowlistConditionSchema = z
|
|
4
|
+
.array(EthAddressSchemaStrict)
|
|
5
|
+
.min(1, 'At least one address must be provided')
|
|
6
|
+
.max(25, 'A maximum of 25 addresses is allowed')
|
|
7
|
+
.describe('List of allowed wallet addresses. Addresses should be provided in checksummed form.');
|
|
17
8
|
//# 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,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,
|
|
1
|
+
{"version":3,"file":"address-allowlist.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/address-allowlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC;KAC7C,KAAK,CAAC,sBAAsB,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,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { baseConditionSchema } from './common';
|
|
3
|
+
import { contextParamSchema } from './context';
|
|
4
|
+
import { returnValueTestSchema } from './return-value-test';
|
|
5
|
+
export const ContextVariableConditionType = 'context-variable';
|
|
6
|
+
export const contextVariableConditionSchema = baseConditionSchema
|
|
7
|
+
.extend({
|
|
8
|
+
conditionType: z.literal(ContextVariableConditionType),
|
|
9
|
+
contextVariable: contextParamSchema.describe('The context variable to check (e.g., ":userAddress", ":customParam")'),
|
|
10
|
+
returnValueTest: returnValueTestSchema,
|
|
11
|
+
})
|
|
12
|
+
.strict()
|
|
13
|
+
.describe('Context Variable Condition for performing comparison operations on context variable values.');
|
|
14
|
+
//# 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,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAAkB,CAAC;AAE/D,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAAmB;KAC9D,MAAM,CAAC;IACN,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAAC;IACtD,eAAe,EAAE,kBAAkB,CAAC,QAAQ,CAC1C,sEAAsE,CACvE;IACD,eAAe,EAAE,qBAAqB;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>;
|
|
@@ -7,9 +7,11 @@ export * from './utils';
|
|
|
7
7
|
export * from './common';
|
|
8
8
|
export * from './context';
|
|
9
9
|
export * from './compound';
|
|
10
|
+
export * from './context-variable';
|
|
10
11
|
export * from './contract';
|
|
11
12
|
export * from './ecdsa';
|
|
12
13
|
export * from './if-then-else';
|
|
14
|
+
export * from './json';
|
|
13
15
|
export * from './json-api';
|
|
14
16
|
export * from './json-rpc';
|
|
15
17
|
export * from './jwt';
|
|
@@ -18,4 +20,5 @@ export * from './rpc';
|
|
|
18
20
|
export * from './sequential';
|
|
19
21
|
export * from './signing';
|
|
20
22
|
export * from './time';
|
|
23
|
+
export * from './variable-operation';
|
|
21
24
|
export * from './address-allowlist';
|
|
@@ -9,9 +9,11 @@ export * from './common';
|
|
|
9
9
|
export * from './context';
|
|
10
10
|
// ts-unused-exports:disable-next-line - this comment line is added to prevent lint from changing or objecting the export order.
|
|
11
11
|
export * from './compound';
|
|
12
|
+
export * from './context-variable';
|
|
12
13
|
export * from './contract';
|
|
13
14
|
export * from './ecdsa';
|
|
14
15
|
export * from './if-then-else';
|
|
16
|
+
export * from './json';
|
|
15
17
|
export * from './json-api';
|
|
16
18
|
export * from './json-rpc';
|
|
17
19
|
export * from './jwt';
|
|
@@ -20,6 +22,7 @@ export * from './rpc';
|
|
|
20
22
|
export * from './sequential';
|
|
21
23
|
export * from './signing';
|
|
22
24
|
export * from './time';
|
|
25
|
+
export * from './variable-operation';
|
|
23
26
|
// ts-unused-exports:disable-next-line - this comment line is added to prevent lint from changing or objecting the export order.
|
|
24
27
|
export * from './address-allowlist';
|
|
25
28
|
//# sourceMappingURL=export-for-zod-doc-gen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-for-zod-doc-gen.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/export-for-zod-doc-gen.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,gIAAgI;AAChI,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,gIAAgI;AAChI,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,gIAAgI;AAChI,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"export-for-zod-doc-gen.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/export-for-zod-doc-gen.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,gIAAgI;AAChI,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,gIAAgI;AAChI,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,gIAAgI;AAChI,cAAc,qBAAqB,CAAC"}
|