133 lines
5.9 KiB
TypeScript
133 lines
5.9 KiB
TypeScript
|
import { NetIdType, TornadoWithdrawParams, TovarishEventsQuery } from '@tornado/core';
|
||
|
export declare const idParamsSchema: {
|
||
|
readonly params: {
|
||
|
readonly type: "object";
|
||
|
readonly properties: {
|
||
|
readonly id: {
|
||
|
readonly type: "string";
|
||
|
readonly format: "uuid";
|
||
|
};
|
||
|
};
|
||
|
readonly required: readonly ["id"];
|
||
|
readonly additionalProperties: false;
|
||
|
};
|
||
|
};
|
||
|
export declare const withdrawBodySchema: {
|
||
|
readonly body: {
|
||
|
readonly type: "object";
|
||
|
readonly properties: {
|
||
|
readonly proof: {
|
||
|
readonly type: "string";
|
||
|
readonly pattern: "^0x[a-fA-F0-9]{512}$";
|
||
|
};
|
||
|
readonly contract: {
|
||
|
readonly type: "string";
|
||
|
readonly pattern: "^0x[a-fA-F0-9]{40}$";
|
||
|
readonly isAddress: true;
|
||
|
};
|
||
|
readonly args: {
|
||
|
readonly type: "array";
|
||
|
readonly maxItems: 6;
|
||
|
readonly minItems: 6;
|
||
|
readonly items: readonly [{
|
||
|
readonly type: "string";
|
||
|
readonly pattern: "^0x[a-fA-F0-9]{64}$";
|
||
|
}, {
|
||
|
readonly type: "string";
|
||
|
readonly pattern: "^0x[a-fA-F0-9]{64}$";
|
||
|
}, {
|
||
|
readonly type: "string";
|
||
|
readonly pattern: "^0x[a-fA-F0-9]{40}$";
|
||
|
readonly isAddress: true;
|
||
|
}, {
|
||
|
readonly type: "string";
|
||
|
readonly pattern: "^0x[a-fA-F0-9]{40}$";
|
||
|
readonly isAddress: true;
|
||
|
}, {
|
||
|
readonly BN: true;
|
||
|
readonly type: "string";
|
||
|
readonly pattern: "^0x[a-fA-F0-9]{64}$";
|
||
|
}, {
|
||
|
readonly BN: true;
|
||
|
readonly type: "string";
|
||
|
readonly pattern: "^0x[a-fA-F0-9]{64}$";
|
||
|
}];
|
||
|
};
|
||
|
};
|
||
|
readonly additionalProperties: false;
|
||
|
readonly required: readonly ["proof", "contract", "args"];
|
||
|
};
|
||
|
};
|
||
|
export declare const eventsSchema: {
|
||
|
readonly body: {
|
||
|
readonly type: "object";
|
||
|
readonly properties: {
|
||
|
readonly type: {
|
||
|
readonly type: "string";
|
||
|
readonly minLength: 1;
|
||
|
readonly maxLength: 30;
|
||
|
};
|
||
|
readonly currency: {
|
||
|
readonly type: "string";
|
||
|
readonly minLength: 1;
|
||
|
readonly maxLength: 30;
|
||
|
};
|
||
|
readonly amount: {
|
||
|
readonly type: "string";
|
||
|
readonly minLength: 1;
|
||
|
readonly maxLength: 30;
|
||
|
};
|
||
|
readonly fromBlock: {
|
||
|
readonly type: "number";
|
||
|
};
|
||
|
readonly recent: {
|
||
|
readonly type: "boolean";
|
||
|
};
|
||
|
};
|
||
|
readonly additionalProperties: false;
|
||
|
readonly required: readonly ["type", "fromBlock"];
|
||
|
};
|
||
|
};
|
||
|
export declare const treeNameSchema: {
|
||
|
readonly params: {
|
||
|
readonly type: "object";
|
||
|
readonly properties: {
|
||
|
readonly treeName: {
|
||
|
readonly type: "string";
|
||
|
readonly minLength: 1;
|
||
|
readonly maxLength: 60;
|
||
|
readonly TreeName: true;
|
||
|
};
|
||
|
};
|
||
|
readonly additionalProperties: false;
|
||
|
readonly required: readonly ["treeName"];
|
||
|
};
|
||
|
};
|
||
|
export declare function getWithdrawSchema(netId: NetIdType): typeof withdrawBodySchema & { [key in number | typeof Symbol.iterator | "length" | "toString" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "includes" | "at" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" | "codePointAt" | "endsWith" | "normalize" | "repeat" | "startsWith" | "anchor" | "big" | "blink" | "bold" | "fixed" | "fontcolor" | "fontsize" | "italics" | "link" | "small" | "strike" | "sub" | "sup" | "padStart" | "padEnd" | "trimEnd" | "trimStart" | "trimLeft" | "trimRight" | "matchAll" | "replaceAll" | "isWellFormed" | "toWellFormed" | "valueOf"]: boolean; };
|
||
|
export declare function getEventsSchema(netId: NetIdType): typeof eventsSchema & { [key in number | typeof Symbol.iterator | "length" | "toString" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "includes" | "at" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" | "codePointAt" | "endsWith" | "normalize" | "repeat" | "startsWith" | "anchor" | "big" | "blink" | "bold" | "fixed" | "fontcolor" | "fontsize" | "italics" | "link" | "small" | "strike" | "sub" | "sup" | "padStart" | "padEnd" | "trimEnd" | "trimStart" | "trimLeft" | "trimRight" | "matchAll" | "replaceAll" | "isWellFormed" | "toWellFormed" | "valueOf"]: boolean; };
|
||
|
export declare function getWithdrawKeyword(netId: NetIdType, rewardAccount: string): {
|
||
|
keyword: string;
|
||
|
validate: (schema: string, data: TornadoWithdrawParams) => boolean;
|
||
|
errors: boolean;
|
||
|
};
|
||
|
export declare function getEventsKeyword(netId: NetIdType): {
|
||
|
keyword: string;
|
||
|
validate: (schema: string, data: TovarishEventsQuery) => boolean;
|
||
|
errors: boolean;
|
||
|
};
|
||
|
export declare function getTreeNameKeyword(): {
|
||
|
keyword: string;
|
||
|
validate: (schema: string, data: string) => boolean;
|
||
|
errors: boolean;
|
||
|
};
|
||
|
export declare function getAllWithdrawKeyword(rewardAccount: string): {
|
||
|
keyword: string;
|
||
|
validate: (schema: string, data: TornadoWithdrawParams) => boolean;
|
||
|
errors: boolean;
|
||
|
}[];
|
||
|
export declare function getAllEventsKeyword(): {
|
||
|
keyword: string;
|
||
|
validate: (schema: string, data: TovarishEventsQuery) => boolean;
|
||
|
errors: boolean;
|
||
|
}[];
|