Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/cjs/helper/task.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryParams, ProvingParams, DeployParams, Statistics, AddImageParams, WithSignature, UserQueryParams, PaymentParams, TxHistoryQueryParams, LogQuery, ResetImageParams, PaginationResult, Task, Image, TransactionInfo, AppConfig, OmitSignature, ModifyImageParams, SubscriptionRequest, ERC20DepositInfo, User, Subscription, PaginatedQuery, AutoSubmitProofQuery, Round1InfoQuery, Round1Info, Round2Info, Round2InfoQuery, AutoSubmitProof, ConciseTask, NodeStatistics, NodeStatisticsQueryParams, SetMaintenanceModeParams } from "../interface/interface.js";
import { QueryParams, ProvingParams, DeployParams, Statistics, AddImageParams, WithSignature, UserQueryParams, PaymentParams, TxHistoryQueryParams, LogQuery, ResetImageParams, PaginationResult, Task, Image, TransactionInfo, AppConfig, OmitSignature, ModifyImageParams, SubscriptionRequest, ERC20DepositInfo, User, Subscription, PaginatedQuery, AutoSubmitProofQuery, Round1InfoQuery, Round1Info, Round2Info, Round2InfoQuery, AutoSubmitProof, ConciseTask, NodeStatistics, NodeStatisticsQueryParams, SetMaintenanceModeParams, ProverNodesSummary } from "../interface/interface.js";
import { ZkWasmServiceEndpoint } from "./endpoint.js";
export declare class ZkWasmServiceHelper {
endpoint: ZkWasmServiceEndpoint;
Expand All @@ -12,6 +12,7 @@ export declare class ZkWasmServiceHelper {
queryConfig(): Promise<AppConfig>;
loadStatistics(): Promise<Statistics>;
queryNodeStatistics(query: NodeStatisticsQueryParams): Promise<PaginationResult<NodeStatistics[]>>;
queryProverNodeSummary(): Promise<ProverNodesSummary>;
loadTasks(query: QueryParams): Promise<PaginationResult<Task[]>>;
loadTaskList(query: QueryParams): Promise<PaginationResult<ConciseTask[]>>;
queryAutoSubmitProofs(query: PaginatedQuery<AutoSubmitProofQuery>): Promise<PaginationResult<AutoSubmitProof[]>>;
Expand Down
10 changes: 10 additions & 0 deletions dist/cjs/helper/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ class ZkWasmServiceHelper {
return res;
});
}
queryProverNodeSummary() {
return __awaiter(this, void 0, void 0, function* () {
let headers = { "Content-Type": "application/json" };
let res = yield this.endpoint.invokeRequest("GET", `/prover_node_summary`, JSON.parse("{}"));
if (this.endpoint.enable_logs) {
console.log("loading node summary");
}
return res;
});
}
loadTasks(query) {
return __awaiter(this, void 0, void 0, function* () {
let headers = { "Content-Type": "application/json" };
Expand Down
6 changes: 3 additions & 3 deletions dist/cjs/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Task, ConciseTask, ProvingParams, DeployParams, QueryParams, VerifyProofParams, VerifyData, StatusState, DeploymentInfo, Image, Statistics, AddImageParams, WithSignature, User, UserQueryParams, PaymentParams, SubscriptionParams, Subscription, SubscriptionType, SubscriptionRequest, TxHistoryQueryParams, TransactionInfo, TaskStatus, TaskType, AppConfig, PaginationResult, ResetImageParams, LogQuery, ModifyImageParams, ChainDetails, InputContextType, ContextHexString, WithCustomInputContextType, WithInitialContext, WithNonCustomInputContextType, WithResetContext, WithoutInitialContext, WithoutInputContextType, WithoutResetContext, AutoSubmitProofStatus, Round1Status, Round2Status, AutoSubmitProof, Round1Info, Round2Info, AutoSubmitProofQuery, Round1InfoQuery, Round2InfoQuery, PaginatedQuery, PaginationQuery, AutoSubmitStatus, VerifyBatchProofParams, AutoSubmitBatchMetadata, ProofSubmitMode, ProvePaymentSrc, NodeStatistics, NodeStatisticsQueryParams, MaintenanceModeType, SetMaintenanceModeParams, AdminRequestType, ServerVersionInfo } from "./interface/interface.js";
import { Task, ConciseTask, ProvingParams, DeployParams, QueryParams, VerifyProofParams, VerifyData, StatusState, DeploymentInfo, Image, Statistics, AddImageParams, WithSignature, User, UserQueryParams, PaymentParams, SubscriptionParams, Subscription, SubscriptionType, SubscriptionRequest, TxHistoryQueryParams, TransactionInfo, TaskStatus, TaskType, AppConfig, PaginationResult, ResetImageParams, LogQuery, ModifyImageParams, ChainDetails, InputContextType, ContextHexString, WithCustomInputContextType, WithInitialContext, WithNonCustomInputContextType, WithResetContext, WithoutInitialContext, WithoutInputContextType, WithoutResetContext, AutoSubmitProofStatus, Round1Status, Round2Status, AutoSubmitProof, Round1Info, Round2Info, AutoSubmitProofQuery, Round1InfoQuery, Round2InfoQuery, PaginatedQuery, PaginationQuery, AutoSubmitStatus, VerifyBatchProofParams, AutoSubmitBatchMetadata, ProofSubmitMode, ProvePaymentSrc, NodeStatistics, NodeStatisticsQueryParams, MaintenanceModeType, SetMaintenanceModeParams, AdminRequestType, ServerVersionInfo, ProverLevel, ProverNodesSummary } from "./interface/interface.js";
import { ZkWasmUtil } from "./helper/util.js";
import { ZkWasmServiceEndpoint } from "./helper/endpoint.js";
import { ZkWasmServiceHelper } from "./helper/task.js";
import { ERC20Lib } from "./abi/ERC20.js";
export { ZkWasmServiceEndpoint, ZkWasmServiceHelper, ZkWasmUtil, ERC20Lib, InputContextType, AutoSubmitStatus, AutoSubmitProofStatus, Round1Status, Round2Status, ProofSubmitMode, ProvePaymentSrc, MaintenanceModeType, AdminRequestType, };
export type { Task, ConciseTask, ProvingParams, DeployParams, QueryParams, VerifyProofParams, VerifyData, StatusState, DeploymentInfo, Image, Statistics, AddImageParams, TaskStatus, TaskType, WithSignature, User, UserQueryParams, Subscription, SubscriptionType, PaymentParams, SubscriptionParams, SubscriptionRequest, TxHistoryQueryParams, TransactionInfo, ResetImageParams, AppConfig, PaginationResult, LogQuery, ModifyImageParams, ChainDetails, ContextHexString, WithCustomInputContextType, WithInitialContext, WithNonCustomInputContextType, WithResetContext, WithoutInitialContext, WithoutInputContextType, WithoutResetContext, AutoSubmitProof, Round1Info, Round2Info, AutoSubmitProofQuery, Round1InfoQuery, Round2InfoQuery, PaginatedQuery, PaginationQuery, VerifyBatchProofParams, AutoSubmitBatchMetadata, NodeStatistics, NodeStatisticsQueryParams, SetMaintenanceModeParams, ServerVersionInfo, };
export { ZkWasmServiceEndpoint, ZkWasmServiceHelper, ZkWasmUtil, ERC20Lib, InputContextType, AutoSubmitStatus, AutoSubmitProofStatus, Round1Status, Round2Status, ProofSubmitMode, ProvePaymentSrc, MaintenanceModeType, AdminRequestType, ProverLevel, };
export type { Task, ConciseTask, ProvingParams, DeployParams, QueryParams, VerifyProofParams, VerifyData, StatusState, DeploymentInfo, Image, Statistics, AddImageParams, TaskStatus, TaskType, WithSignature, User, UserQueryParams, Subscription, SubscriptionType, PaymentParams, SubscriptionParams, SubscriptionRequest, TxHistoryQueryParams, TransactionInfo, ResetImageParams, AppConfig, PaginationResult, LogQuery, ModifyImageParams, ChainDetails, ContextHexString, WithCustomInputContextType, WithInitialContext, WithNonCustomInputContextType, WithResetContext, WithoutInitialContext, WithoutInputContextType, WithoutResetContext, AutoSubmitProof, Round1Info, Round2Info, AutoSubmitProofQuery, Round1InfoQuery, Round2InfoQuery, PaginatedQuery, PaginationQuery, VerifyBatchProofParams, AutoSubmitBatchMetadata, NodeStatistics, NodeStatisticsQueryParams, SetMaintenanceModeParams, ServerVersionInfo, ProverNodesSummary, };
3 changes: 2 additions & 1 deletion dist/cjs/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdminRequestType = exports.MaintenanceModeType = exports.ProvePaymentSrc = exports.ProofSubmitMode = exports.Round2Status = exports.Round1Status = exports.AutoSubmitProofStatus = exports.AutoSubmitStatus = exports.InputContextType = exports.ERC20Lib = exports.ZkWasmUtil = exports.ZkWasmServiceHelper = exports.ZkWasmServiceEndpoint = void 0;
exports.ProverLevel = exports.AdminRequestType = exports.MaintenanceModeType = exports.ProvePaymentSrc = exports.ProofSubmitMode = exports.Round2Status = exports.Round1Status = exports.AutoSubmitProofStatus = exports.AutoSubmitStatus = exports.InputContextType = exports.ERC20Lib = exports.ZkWasmUtil = exports.ZkWasmServiceHelper = exports.ZkWasmServiceEndpoint = void 0;
const interface_js_1 = require("./interface/interface.js");
Object.defineProperty(exports, "InputContextType", { enumerable: true, get: function () { return interface_js_1.InputContextType; } });
Object.defineProperty(exports, "AutoSubmitProofStatus", { enumerable: true, get: function () { return interface_js_1.AutoSubmitProofStatus; } });
Expand All @@ -11,6 +11,7 @@ Object.defineProperty(exports, "ProofSubmitMode", { enumerable: true, get: funct
Object.defineProperty(exports, "ProvePaymentSrc", { enumerable: true, get: function () { return interface_js_1.ProvePaymentSrc; } });
Object.defineProperty(exports, "MaintenanceModeType", { enumerable: true, get: function () { return interface_js_1.MaintenanceModeType; } });
Object.defineProperty(exports, "AdminRequestType", { enumerable: true, get: function () { return interface_js_1.AdminRequestType; } });
Object.defineProperty(exports, "ProverLevel", { enumerable: true, get: function () { return interface_js_1.ProverLevel; } });
const util_js_1 = require("./helper/util.js");
Object.defineProperty(exports, "ZkWasmUtil", { enumerable: true, get: function () { return util_js_1.ZkWasmUtil; } });
const endpoint_js_1 = require("./helper/endpoint.js");
Expand Down
22 changes: 21 additions & 1 deletion dist/cjs/interface/interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@ export interface NodeStatistics {
version_info?: {
version: string;
};
performance_track: string;
prover_level: ProverLevel;
last_attempted_task?: {
task_id: {
$oid: string;
};
timestamp: string;
};
}
export interface ProverNodesSummary {
certified_prover_count: number;
active_prover_count: number;
intern_prover_count: number;
inactive_prover_count: number;
}
export declare enum ProverLevel {
Inactive = "Inactive",
Intern = "Intern",
Active = "Active",
Certified = "Certified"
}
export interface NodeStatisticsQueryParams {
address?: string;
Expand Down Expand Up @@ -200,7 +220,7 @@ export type TaskType = "Setup" | "Prove" | "Reset";
* Verified: At least one of the proof task had been done successfully for the image.
**/
export type ImageStatus = "Received" | "Initialized" | "Verified";
export type TaskStatus = "Pending" | "Processing" | "DryRunSuccess" | "DryRunFailed" | "Done" | "Fail" | "Stale";
export type TaskStatus = "Pending" | "Processing" | "DryRunSuccess" | "DryRunFailed" | "Done" | "Fail" | "Unprovable" | "Stale";
export declare enum AutoSubmitStatus {
Round1 = "Round1",
Round2 = "Round2",
Expand Down
9 changes: 8 additions & 1 deletion dist/cjs/interface/interface.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdminRequestType = exports.MaintenanceModeType = exports.ProofSubmitMode = exports.ProvePaymentSrc = exports.AutoSubmitStatus = exports.Round2Status = exports.Round1Status = exports.AutoSubmitProofStatus = exports.InputContextType = void 0;
exports.AdminRequestType = exports.MaintenanceModeType = exports.ProofSubmitMode = exports.ProvePaymentSrc = exports.AutoSubmitStatus = exports.Round2Status = exports.Round1Status = exports.AutoSubmitProofStatus = exports.InputContextType = exports.ProverLevel = void 0;
var ProverLevel;
(function (ProverLevel) {
ProverLevel["Inactive"] = "Inactive";
ProverLevel["Intern"] = "Intern";
ProverLevel["Active"] = "Active";
ProverLevel["Certified"] = "Certified";
})(ProverLevel = exports.ProverLevel || (exports.ProverLevel = {}));
var InputContextType;
(function (InputContextType) {
InputContextType["Custom"] = "Custom";
Expand Down
3 changes: 2 additions & 1 deletion dist/mjs/helper/task.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryParams, ProvingParams, DeployParams, Statistics, AddImageParams, WithSignature, UserQueryParams, PaymentParams, TxHistoryQueryParams, LogQuery, ResetImageParams, PaginationResult, Task, Image, TransactionInfo, AppConfig, OmitSignature, ModifyImageParams, SubscriptionRequest, ERC20DepositInfo, User, Subscription, PaginatedQuery, AutoSubmitProofQuery, Round1InfoQuery, Round1Info, Round2Info, Round2InfoQuery, AutoSubmitProof, ConciseTask, NodeStatistics, NodeStatisticsQueryParams, SetMaintenanceModeParams } from "../interface/interface.js";
import { QueryParams, ProvingParams, DeployParams, Statistics, AddImageParams, WithSignature, UserQueryParams, PaymentParams, TxHistoryQueryParams, LogQuery, ResetImageParams, PaginationResult, Task, Image, TransactionInfo, AppConfig, OmitSignature, ModifyImageParams, SubscriptionRequest, ERC20DepositInfo, User, Subscription, PaginatedQuery, AutoSubmitProofQuery, Round1InfoQuery, Round1Info, Round2Info, Round2InfoQuery, AutoSubmitProof, ConciseTask, NodeStatistics, NodeStatisticsQueryParams, SetMaintenanceModeParams, ProverNodesSummary } from "../interface/interface.js";
import { ZkWasmServiceEndpoint } from "./endpoint.js";
export declare class ZkWasmServiceHelper {
endpoint: ZkWasmServiceEndpoint;
Expand All @@ -12,6 +12,7 @@ export declare class ZkWasmServiceHelper {
queryConfig(): Promise<AppConfig>;
loadStatistics(): Promise<Statistics>;
queryNodeStatistics(query: NodeStatisticsQueryParams): Promise<PaginationResult<NodeStatistics[]>>;
queryProverNodeSummary(): Promise<ProverNodesSummary>;
loadTasks(query: QueryParams): Promise<PaginationResult<Task[]>>;
loadTaskList(query: QueryParams): Promise<PaginationResult<ConciseTask[]>>;
queryAutoSubmitProofs(query: PaginatedQuery<AutoSubmitProofQuery>): Promise<PaginationResult<AutoSubmitProof[]>>;
Expand Down
8 changes: 8 additions & 0 deletions dist/mjs/helper/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ export class ZkWasmServiceHelper {
}
return res;
}
async queryProverNodeSummary() {
let headers = { "Content-Type": "application/json" };
let res = await this.endpoint.invokeRequest("GET", `/prover_node_summary`, JSON.parse("{}"));
if (this.endpoint.enable_logs) {
console.log("loading node summary");
}
return res;
}
async loadTasks(query) {
let headers = { "Content-Type": "application/json" };
let queryJson = JSON.parse("{}");
Expand Down
6 changes: 3 additions & 3 deletions dist/mjs/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Task, ConciseTask, ProvingParams, DeployParams, QueryParams, VerifyProofParams, VerifyData, StatusState, DeploymentInfo, Image, Statistics, AddImageParams, WithSignature, User, UserQueryParams, PaymentParams, SubscriptionParams, Subscription, SubscriptionType, SubscriptionRequest, TxHistoryQueryParams, TransactionInfo, TaskStatus, TaskType, AppConfig, PaginationResult, ResetImageParams, LogQuery, ModifyImageParams, ChainDetails, InputContextType, ContextHexString, WithCustomInputContextType, WithInitialContext, WithNonCustomInputContextType, WithResetContext, WithoutInitialContext, WithoutInputContextType, WithoutResetContext, AutoSubmitProofStatus, Round1Status, Round2Status, AutoSubmitProof, Round1Info, Round2Info, AutoSubmitProofQuery, Round1InfoQuery, Round2InfoQuery, PaginatedQuery, PaginationQuery, AutoSubmitStatus, VerifyBatchProofParams, AutoSubmitBatchMetadata, ProofSubmitMode, ProvePaymentSrc, NodeStatistics, NodeStatisticsQueryParams, MaintenanceModeType, SetMaintenanceModeParams, AdminRequestType, ServerVersionInfo } from "./interface/interface.js";
import { Task, ConciseTask, ProvingParams, DeployParams, QueryParams, VerifyProofParams, VerifyData, StatusState, DeploymentInfo, Image, Statistics, AddImageParams, WithSignature, User, UserQueryParams, PaymentParams, SubscriptionParams, Subscription, SubscriptionType, SubscriptionRequest, TxHistoryQueryParams, TransactionInfo, TaskStatus, TaskType, AppConfig, PaginationResult, ResetImageParams, LogQuery, ModifyImageParams, ChainDetails, InputContextType, ContextHexString, WithCustomInputContextType, WithInitialContext, WithNonCustomInputContextType, WithResetContext, WithoutInitialContext, WithoutInputContextType, WithoutResetContext, AutoSubmitProofStatus, Round1Status, Round2Status, AutoSubmitProof, Round1Info, Round2Info, AutoSubmitProofQuery, Round1InfoQuery, Round2InfoQuery, PaginatedQuery, PaginationQuery, AutoSubmitStatus, VerifyBatchProofParams, AutoSubmitBatchMetadata, ProofSubmitMode, ProvePaymentSrc, NodeStatistics, NodeStatisticsQueryParams, MaintenanceModeType, SetMaintenanceModeParams, AdminRequestType, ServerVersionInfo, ProverLevel, ProverNodesSummary } from "./interface/interface.js";
import { ZkWasmUtil } from "./helper/util.js";
import { ZkWasmServiceEndpoint } from "./helper/endpoint.js";
import { ZkWasmServiceHelper } from "./helper/task.js";
import { ERC20Lib } from "./abi/ERC20.js";
export { ZkWasmServiceEndpoint, ZkWasmServiceHelper, ZkWasmUtil, ERC20Lib, InputContextType, AutoSubmitStatus, AutoSubmitProofStatus, Round1Status, Round2Status, ProofSubmitMode, ProvePaymentSrc, MaintenanceModeType, AdminRequestType, };
export type { Task, ConciseTask, ProvingParams, DeployParams, QueryParams, VerifyProofParams, VerifyData, StatusState, DeploymentInfo, Image, Statistics, AddImageParams, TaskStatus, TaskType, WithSignature, User, UserQueryParams, Subscription, SubscriptionType, PaymentParams, SubscriptionParams, SubscriptionRequest, TxHistoryQueryParams, TransactionInfo, ResetImageParams, AppConfig, PaginationResult, LogQuery, ModifyImageParams, ChainDetails, ContextHexString, WithCustomInputContextType, WithInitialContext, WithNonCustomInputContextType, WithResetContext, WithoutInitialContext, WithoutInputContextType, WithoutResetContext, AutoSubmitProof, Round1Info, Round2Info, AutoSubmitProofQuery, Round1InfoQuery, Round2InfoQuery, PaginatedQuery, PaginationQuery, VerifyBatchProofParams, AutoSubmitBatchMetadata, NodeStatistics, NodeStatisticsQueryParams, SetMaintenanceModeParams, ServerVersionInfo, };
export { ZkWasmServiceEndpoint, ZkWasmServiceHelper, ZkWasmUtil, ERC20Lib, InputContextType, AutoSubmitStatus, AutoSubmitProofStatus, Round1Status, Round2Status, ProofSubmitMode, ProvePaymentSrc, MaintenanceModeType, AdminRequestType, ProverLevel, };
export type { Task, ConciseTask, ProvingParams, DeployParams, QueryParams, VerifyProofParams, VerifyData, StatusState, DeploymentInfo, Image, Statistics, AddImageParams, TaskStatus, TaskType, WithSignature, User, UserQueryParams, Subscription, SubscriptionType, PaymentParams, SubscriptionParams, SubscriptionRequest, TxHistoryQueryParams, TransactionInfo, ResetImageParams, AppConfig, PaginationResult, LogQuery, ModifyImageParams, ChainDetails, ContextHexString, WithCustomInputContextType, WithInitialContext, WithNonCustomInputContextType, WithResetContext, WithoutInitialContext, WithoutInputContextType, WithoutResetContext, AutoSubmitProof, Round1Info, Round2Info, AutoSubmitProofQuery, Round1InfoQuery, Round2InfoQuery, PaginatedQuery, PaginationQuery, VerifyBatchProofParams, AutoSubmitBatchMetadata, NodeStatistics, NodeStatisticsQueryParams, SetMaintenanceModeParams, ServerVersionInfo, ProverNodesSummary, };
4 changes: 2 additions & 2 deletions dist/mjs/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InputContextType, AutoSubmitProofStatus, Round1Status, Round2Status, AutoSubmitStatus, ProofSubmitMode, ProvePaymentSrc, MaintenanceModeType, AdminRequestType, } from "./interface/interface.js";
import { InputContextType, AutoSubmitProofStatus, Round1Status, Round2Status, AutoSubmitStatus, ProofSubmitMode, ProvePaymentSrc, MaintenanceModeType, AdminRequestType, ProverLevel, } from "./interface/interface.js";
import { ZkWasmUtil } from "./helper/util.js";
import { ZkWasmServiceEndpoint } from "./helper/endpoint.js";
import { ZkWasmServiceHelper } from "./helper/task.js";
import { ERC20Lib } from "./abi/ERC20.js";
export { ZkWasmServiceEndpoint, ZkWasmServiceHelper, ZkWasmUtil, ERC20Lib, InputContextType, AutoSubmitStatus, AutoSubmitProofStatus, Round1Status, Round2Status, ProofSubmitMode, ProvePaymentSrc, MaintenanceModeType, AdminRequestType, };
export { ZkWasmServiceEndpoint, ZkWasmServiceHelper, ZkWasmUtil, ERC20Lib, InputContextType, AutoSubmitStatus, AutoSubmitProofStatus, Round1Status, Round2Status, ProofSubmitMode, ProvePaymentSrc, MaintenanceModeType, AdminRequestType, ProverLevel, };
Loading