@energyweb/node-red-contrib-green-proof-worker
Version:
## Peer dependencies
634 lines (633 loc) • 22.3 kB
TypeScript
import * as z from 'zod';
import type { Api } from '../api';
declare const InputMessage: z.ZodUnion<[z.ZodObject<{
topic: z.ZodLiteral<"tx_correct">;
payload: z.ZodObject<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, z.ZodTypeAny, "passthrough">>;
}, "strip", z.ZodTypeAny, {
topic: "tx_correct";
payload: {
type: import("../input-message").MessageType;
txLog: {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
};
} & {
[k: string]: unknown;
};
}, {
topic: "tx_correct";
payload: {
type: import("../input-message").MessageType;
txLog: {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
};
} & {
[k: string]: unknown;
};
}>, z.ZodObject<{
topic: z.ZodLiteral<"tx_wrong">;
payload: z.ZodObject<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, z.ZodTypeAny, "passthrough">>;
}, "strip", z.ZodTypeAny, {
topic: "tx_wrong";
payload: {
type: import("../input-message").MessageType;
txLog: {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
};
} & {
[k: string]: unknown;
};
}, {
topic: "tx_wrong";
payload: {
type: import("../input-message").MessageType;
txLog: {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
};
} & {
[k: string]: unknown;
};
}>]>;
export declare const Config: z.ZodObject<{
workerSeed: z.ZodString;
votingUrl: z.ZodString;
indexerUrl: z.ZodString;
workerAddress: z.ZodString;
solutionNamespace: z.ZodString;
}, "strip", z.ZodTypeAny, {
indexerUrl: string;
solutionNamespace: string;
workerAddress: string;
workerSeed: string;
votingUrl: string;
}, {
indexerUrl: string;
solutionNamespace: string;
workerAddress: string;
workerSeed: string;
votingUrl: string;
}>;
export declare const VotingServiceConfig: (api: Api) => {
new (rawConfig: any): {
config: Promise<z.infer<typeof Config>>;
onInput(_message: z.infer<typeof InputMessage>): Promise<void>;
api: Api;
nodeConfig: unknown;
messageZod: z.ZodUnion<[z.ZodObject<{
topic: z.ZodLiteral<"tx_correct">;
payload: z.ZodObject<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, z.ZodTypeAny, "passthrough">>;
}, "strip", z.ZodTypeAny, {
topic: "tx_correct";
payload: {
type: import("../input-message").MessageType;
txLog: {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
};
} & {
[k: string]: unknown;
};
}, {
topic: "tx_correct";
payload: {
type: import("../input-message").MessageType;
txLog: {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
};
} & {
[k: string]: unknown;
};
}>, z.ZodObject<{
topic: z.ZodLiteral<"tx_wrong">;
payload: z.ZodObject<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
type: z.ZodLiteral<import("../input-message").MessageType>;
txLog: z.ZodObject<{
rootUnitId: z.ZodString;
changes: z.ZodArray<z.ZodObject<{
prevOwner: z.ZodNullable<z.ZodString>;
owner: z.ZodString;
volume: z.ZodNumber;
unitId: z.ZodString;
}, "strip", z.ZodTypeAny, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}, {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}, {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
}>;
}, z.ZodTypeAny, "passthrough">>;
}, "strip", z.ZodTypeAny, {
topic: "tx_wrong";
payload: {
type: import("../input-message").MessageType;
txLog: {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
};
} & {
[k: string]: unknown;
};
}, {
topic: "tx_wrong";
payload: {
type: import("../input-message").MessageType;
txLog: {
rootUnitId: string;
changes: {
prevOwner: string | null;
owner: string;
volume: number;
unitId: string;
}[];
};
} & {
[k: string]: unknown;
};
}>]>;
getBaseUrls(): Promise<{
kafka_url?: string | string[] | undefined;
kafka_proxy_url?: string | undefined;
indexer_url?: string | undefined;
rpc_url?: string | undefined;
}>;
getNodeEnvConfig(): {
BASE_URL_CDN?: string | undefined;
EWX_SOLUTION_ID?: string | undefined;
EWX_SOLUTION_GROUP_ID?: string | undefined;
EWX_WORKLOGIC_ID?: string | undefined;
EWX_SQLITE_PATH?: string | undefined;
EWX_WORKER_ADDRESS?: string | undefined;
};
sendBuilder(inputMessage: import("../types").NodeMessage<any>): import("../node").SendBuilder;
onDestroy?(): void | Promise<void>;
handleMaybePromise<T>(maybePromiseCb: () => T | Promise<T>, done: (err?: Error | undefined) => void): void;
};
};
export {};