From 0e1e1c54600b6faf4622fb31523ef96d92daa90d Mon Sep 17 00:00:00 2001 From: rhaoio Date: Mon, 20 May 2024 21:26:40 +1000 Subject: [PATCH 1/4] update types --- dist/cjs/interface/interface.d.ts | 7 ++++++- dist/mjs/interface/interface.d.ts | 7 ++++++- src/interface/interface.ts | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/dist/cjs/interface/interface.d.ts b/dist/cjs/interface/interface.d.ts index 701e06a8..08483f28 100644 --- a/dist/cjs/interface/interface.d.ts +++ b/dist/cjs/interface/interface.d.ts @@ -52,6 +52,7 @@ export interface Round1BatchProof { batch_finished?: string; internal_message?: string; static_files_verification_data: StaticFileVerificationData; + auto_submit_network_chain_id: number; status: Round1BatchProofStatus; } export interface StaticFileVerificationData { @@ -74,6 +75,8 @@ export interface Round2BatchProof { batch_started?: string; batch_finished?: string; internal_message?: string; + auto_submit_network_chain_id: number; + verifier_contracts: VerifierContracts; static_files_verification_data: StaticFileVerificationData; status: Round2BatchProofStatus; } @@ -94,7 +97,9 @@ export interface FinalBatchProof { batched_time?: string; internal_message?: string; static_files_verification_data: StaticFileVerificationData; - verifier_contracts: VerifierContracts[]; + auto_submit_network_chain_id: number; + verifier_contracts: VerifierContracts; + registered_tx_hash: string | null; status: FinalProofStatus; } export declare enum FinalProofStatus { diff --git a/dist/mjs/interface/interface.d.ts b/dist/mjs/interface/interface.d.ts index 701e06a8..08483f28 100644 --- a/dist/mjs/interface/interface.d.ts +++ b/dist/mjs/interface/interface.d.ts @@ -52,6 +52,7 @@ export interface Round1BatchProof { batch_finished?: string; internal_message?: string; static_files_verification_data: StaticFileVerificationData; + auto_submit_network_chain_id: number; status: Round1BatchProofStatus; } export interface StaticFileVerificationData { @@ -74,6 +75,8 @@ export interface Round2BatchProof { batch_started?: string; batch_finished?: string; internal_message?: string; + auto_submit_network_chain_id: number; + verifier_contracts: VerifierContracts; static_files_verification_data: StaticFileVerificationData; status: Round2BatchProofStatus; } @@ -94,7 +97,9 @@ export interface FinalBatchProof { batched_time?: string; internal_message?: string; static_files_verification_data: StaticFileVerificationData; - verifier_contracts: VerifierContracts[]; + auto_submit_network_chain_id: number; + verifier_contracts: VerifierContracts; + registered_tx_hash: string | null; status: FinalProofStatus; } export declare enum FinalProofStatus { diff --git a/src/interface/interface.ts b/src/interface/interface.ts index 39c15290..f9fdbe93 100644 --- a/src/interface/interface.ts +++ b/src/interface/interface.ts @@ -58,6 +58,7 @@ export interface Round1BatchProof { batch_finished?: string; internal_message?: string; static_files_verification_data: StaticFileVerificationData; + auto_submit_network_chain_id: number; status: Round1BatchProofStatus; } @@ -93,6 +94,8 @@ export interface Round2BatchProof { batch_started?: string; batch_finished?: string; internal_message?: string; + auto_submit_network_chain_id: number; + verifier_contracts: VerifierContracts; static_files_verification_data: StaticFileVerificationData; status: Round2BatchProofStatus; } @@ -120,7 +123,9 @@ export interface FinalBatchProof { batched_time?: string; internal_message?: string; static_files_verification_data: StaticFileVerificationData; - verifier_contracts: VerifierContracts[]; + auto_submit_network_chain_id: number; + verifier_contracts: VerifierContracts; + registered_tx_hash: string | null; status: FinalProofStatus; } From d7610c0e223707a9a183bae2961cf0048b46cc51 Mon Sep 17 00:00:00 2001 From: rhaoio Date: Mon, 20 May 2024 22:22:29 +1000 Subject: [PATCH 2/4] add chain id to query --- dist/cjs/interface/interface.d.ts | 3 +++ dist/mjs/interface/interface.d.ts | 3 +++ src/interface/interface.ts | 3 +++ 3 files changed, 9 insertions(+) diff --git a/dist/cjs/interface/interface.d.ts b/dist/cjs/interface/interface.d.ts index 08483f28..5acd2052 100644 --- a/dist/cjs/interface/interface.d.ts +++ b/dist/cjs/interface/interface.d.ts @@ -112,18 +112,21 @@ export interface Round1BatchProofQuery { task_id?: string; status?: Round1BatchProofStatus; circuit_size?: number; + chain_id?: number; } export interface Round2BatchProofQuery { id?: string; task_id?: string; status?: Round2BatchProofStatus; circuit_size?: number; + chain_id?: number; } export interface FinalBatchProofQuery { id?: string; round_2_id?: string; task_id?: string; status?: FinalProofStatus; + chain_id?: number; } export interface PaginationQuery { total?: number; diff --git a/dist/mjs/interface/interface.d.ts b/dist/mjs/interface/interface.d.ts index 08483f28..5acd2052 100644 --- a/dist/mjs/interface/interface.d.ts +++ b/dist/mjs/interface/interface.d.ts @@ -112,18 +112,21 @@ export interface Round1BatchProofQuery { task_id?: string; status?: Round1BatchProofStatus; circuit_size?: number; + chain_id?: number; } export interface Round2BatchProofQuery { id?: string; task_id?: string; status?: Round2BatchProofStatus; circuit_size?: number; + chain_id?: number; } export interface FinalBatchProofQuery { id?: string; round_2_id?: string; task_id?: string; status?: FinalProofStatus; + chain_id?: number; } export interface PaginationQuery { total?: number; diff --git a/src/interface/interface.ts b/src/interface/interface.ts index f9fdbe93..a2da396d 100644 --- a/src/interface/interface.ts +++ b/src/interface/interface.ts @@ -141,6 +141,7 @@ export interface Round1BatchProofQuery { task_id?: string; status?: Round1BatchProofStatus; circuit_size?: number; + chain_id?: number; } export interface Round2BatchProofQuery { @@ -148,6 +149,7 @@ export interface Round2BatchProofQuery { task_id?: string; status?: Round2BatchProofStatus; circuit_size?: number; + chain_id?: number; } export interface FinalBatchProofQuery { @@ -155,6 +157,7 @@ export interface FinalBatchProofQuery { round_2_id?: string; task_id?: string; status?: FinalProofStatus; + chain_id?: number; } export interface PaginationQuery { From e0f184fc0fcac5353ef0586311c696640f19a1f2 Mon Sep 17 00:00:00 2001 From: rhaoio Date: Tue, 21 May 2024 18:44:28 +1000 Subject: [PATCH 3/4] auto submit networks in config --- dist/cjs/interface/interface.d.ts | 1 + dist/mjs/interface/interface.d.ts | 1 + src/interface/interface.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/dist/cjs/interface/interface.d.ts b/dist/cjs/interface/interface.d.ts index 5acd2052..517b591f 100644 --- a/dist/cjs/interface/interface.d.ts +++ b/dist/cjs/interface/interface.d.ts @@ -311,6 +311,7 @@ export interface AppConfig { topup_token_data: TokenData; deployments: ContractDeployments[]; subscription_plans: SubscriptionParams[]; + supported_auto_submit_network_ids: number[]; } export interface ContractDeployments { chain_id: number; diff --git a/dist/mjs/interface/interface.d.ts b/dist/mjs/interface/interface.d.ts index 5acd2052..517b591f 100644 --- a/dist/mjs/interface/interface.d.ts +++ b/dist/mjs/interface/interface.d.ts @@ -311,6 +311,7 @@ export interface AppConfig { topup_token_data: TokenData; deployments: ContractDeployments[]; subscription_plans: SubscriptionParams[]; + supported_auto_submit_network_ids: number[]; } export interface ContractDeployments { chain_id: number; diff --git a/src/interface/interface.ts b/src/interface/interface.ts index a2da396d..44843c55 100644 --- a/src/interface/interface.ts +++ b/src/interface/interface.ts @@ -391,6 +391,7 @@ export interface AppConfig { topup_token_data: TokenData; deployments: ContractDeployments[]; subscription_plans: SubscriptionParams[]; + supported_auto_submit_network_ids: number[]; } export interface ContractDeployments { From 36db5f3829cb108b758145e445335b44eae999ae Mon Sep 17 00:00:00 2001 From: rhaoio Date: Wed, 22 May 2024 14:20:43 +1000 Subject: [PATCH 4/4] metadata type for batch data --- dist/cjs/index.d.ts | 4 ++-- dist/cjs/interface/interface.d.ts | 4 ++++ dist/mjs/index.d.ts | 4 ++-- dist/mjs/interface/interface.d.ts | 4 ++++ src/index.ts | 2 ++ src/interface/interface.ts | 5 +++++ 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/dist/cjs/index.d.ts b/dist/cjs/index.d.ts index 692b9afd..3e6be830 100644 --- a/dist/cjs/index.d.ts +++ b/dist/cjs/index.d.ts @@ -1,6 +1,6 @@ -import { Task, 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, ImageMetadataKeys, ImageMetadataValsProvePaymentSrc, TaskMetadataKeys, TaskMetadataValsProofSubmitMode, Round1BatchProof, Round2BatchProof, FinalBatchProof, Round1BatchProofStatus, Round2BatchProofStatus, Round1BatchProofQuery, Round2BatchProofQuery, FinalBatchProofQuery, PaginatedQuery, PaginationQuery, AutoSubmitStatus, TaskMetadata, VerifyBatchProofParams, FinalProofStatus } from "./interface/interface.js"; +import { Task, 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, ImageMetadataKeys, ImageMetadataValsProvePaymentSrc, TaskMetadataKeys, TaskMetadataValsProofSubmitMode, Round1BatchProof, Round2BatchProof, FinalBatchProof, Round1BatchProofStatus, Round2BatchProofStatus, Round1BatchProofQuery, Round2BatchProofQuery, FinalBatchProofQuery, PaginatedQuery, PaginationQuery, AutoSubmitStatus, TaskMetadata, VerifyBatchProofParams, FinalProofStatus, AutoSubmitBatchMetadata } from "./interface/interface.js"; import { ZkWasmUtil } from "./helper/util.js"; import { ZkWasmServiceEndpoint } from "./helper/endpoint.js"; import { ZkWasmServiceHelper } from "./helper/task.js"; export { ZkWasmServiceEndpoint, ZkWasmServiceHelper, ZkWasmUtil, InputContextType, ImageMetadataKeys, ImageMetadataValsProvePaymentSrc, TaskMetadataKeys, TaskMetadataValsProofSubmitMode, AutoSubmitStatus, Round1BatchProofStatus, Round2BatchProofStatus, FinalProofStatus, }; -export type { Task, 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, Round1BatchProof, Round2BatchProof, FinalBatchProof, Round1BatchProofQuery, Round2BatchProofQuery, FinalBatchProofQuery, PaginatedQuery, PaginationQuery, TaskMetadata, VerifyBatchProofParams, }; +export type { Task, 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, Round1BatchProof, Round2BatchProof, FinalBatchProof, Round1BatchProofQuery, Round2BatchProofQuery, FinalBatchProofQuery, PaginatedQuery, PaginationQuery, TaskMetadata, VerifyBatchProofParams, AutoSubmitBatchMetadata, }; diff --git a/dist/cjs/interface/interface.d.ts b/dist/cjs/interface/interface.d.ts index 517b591f..e5c9ab0d 100644 --- a/dist/cjs/interface/interface.d.ts +++ b/dist/cjs/interface/interface.d.ts @@ -40,6 +40,10 @@ export interface Task { metadata: TaskMetadata; auto_submit_status?: AutoSubmitStatus; } +export interface AutoSubmitBatchMetadata { + chain_id: number; + id: string; +} export interface Round1BatchProof { _id?: any; task_id: string; diff --git a/dist/mjs/index.d.ts b/dist/mjs/index.d.ts index 692b9afd..3e6be830 100644 --- a/dist/mjs/index.d.ts +++ b/dist/mjs/index.d.ts @@ -1,6 +1,6 @@ -import { Task, 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, ImageMetadataKeys, ImageMetadataValsProvePaymentSrc, TaskMetadataKeys, TaskMetadataValsProofSubmitMode, Round1BatchProof, Round2BatchProof, FinalBatchProof, Round1BatchProofStatus, Round2BatchProofStatus, Round1BatchProofQuery, Round2BatchProofQuery, FinalBatchProofQuery, PaginatedQuery, PaginationQuery, AutoSubmitStatus, TaskMetadata, VerifyBatchProofParams, FinalProofStatus } from "./interface/interface.js"; +import { Task, 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, ImageMetadataKeys, ImageMetadataValsProvePaymentSrc, TaskMetadataKeys, TaskMetadataValsProofSubmitMode, Round1BatchProof, Round2BatchProof, FinalBatchProof, Round1BatchProofStatus, Round2BatchProofStatus, Round1BatchProofQuery, Round2BatchProofQuery, FinalBatchProofQuery, PaginatedQuery, PaginationQuery, AutoSubmitStatus, TaskMetadata, VerifyBatchProofParams, FinalProofStatus, AutoSubmitBatchMetadata } from "./interface/interface.js"; import { ZkWasmUtil } from "./helper/util.js"; import { ZkWasmServiceEndpoint } from "./helper/endpoint.js"; import { ZkWasmServiceHelper } from "./helper/task.js"; export { ZkWasmServiceEndpoint, ZkWasmServiceHelper, ZkWasmUtil, InputContextType, ImageMetadataKeys, ImageMetadataValsProvePaymentSrc, TaskMetadataKeys, TaskMetadataValsProofSubmitMode, AutoSubmitStatus, Round1BatchProofStatus, Round2BatchProofStatus, FinalProofStatus, }; -export type { Task, 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, Round1BatchProof, Round2BatchProof, FinalBatchProof, Round1BatchProofQuery, Round2BatchProofQuery, FinalBatchProofQuery, PaginatedQuery, PaginationQuery, TaskMetadata, VerifyBatchProofParams, }; +export type { Task, 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, Round1BatchProof, Round2BatchProof, FinalBatchProof, Round1BatchProofQuery, Round2BatchProofQuery, FinalBatchProofQuery, PaginatedQuery, PaginationQuery, TaskMetadata, VerifyBatchProofParams, AutoSubmitBatchMetadata, }; diff --git a/dist/mjs/interface/interface.d.ts b/dist/mjs/interface/interface.d.ts index 517b591f..e5c9ab0d 100644 --- a/dist/mjs/interface/interface.d.ts +++ b/dist/mjs/interface/interface.d.ts @@ -40,6 +40,10 @@ export interface Task { metadata: TaskMetadata; auto_submit_status?: AutoSubmitStatus; } +export interface AutoSubmitBatchMetadata { + chain_id: number; + id: string; +} export interface Round1BatchProof { _id?: any; task_id: string; diff --git a/src/index.ts b/src/index.ts index 5513e6e4..da820ff8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,6 +56,7 @@ import { TaskMetadata, VerifyBatchProofParams, FinalProofStatus, + AutoSubmitBatchMetadata, } from "./interface/interface.js"; import { ZkWasmUtil } from "./helper/util.js"; @@ -125,4 +126,5 @@ export type { PaginationQuery, TaskMetadata, VerifyBatchProofParams, + AutoSubmitBatchMetadata, }; diff --git a/src/interface/interface.ts b/src/interface/interface.ts index 44843c55..e18b6e54 100644 --- a/src/interface/interface.ts +++ b/src/interface/interface.ts @@ -44,6 +44,11 @@ export interface Task { auto_submit_status?: AutoSubmitStatus; } +export interface AutoSubmitBatchMetadata { + chain_id: number; + id: string; +} + export interface Round1BatchProof { _id?: any; // The task id of the original aggregate proof task