import { JsonObject } from './json'; import { PodSpecifier } from './podTypes'; import { TransactionTransport } from './utils/index'; import { PodResultDetail, SubmitTransactionParams, WeilWalletCommon } from './walletCommon'; interface WeilWalletRequestData { request_id: string; category: 'ClusterManagement'; request_type: string; } interface WeilWalletResponseData { requestId: string; status: string; } export interface PodRequestData extends WeilWalletRequestData { request_type: 'GetPodInfo'; } export interface PodResultNode { host: string; port: number; } export interface PodResponseData extends WeilWalletResponseData { result: { podDetails: PodResultDetail[]; totalPods: number; }; } export interface WeilWalletConstructorOptions { privateKey: string; sentinelEndpoint: string; transport?: TransactionTransport; accountAddress: string; } type WeilWalletConfig = WeilWalletConstructorOptions & { transport: TransactionTransport; }; export interface OrgContext { org: string; subgroup?: string; } export interface TransactionRequestData { transaction: { is_xpod: boolean; txn_header: { nonce: number; public_key: string; from_addr: string; org?: OrgContext; signature: string; to_addr: string; weilpod_counter: number; creation_time: number; salt: string; }; user_txn: T; verifier: { type: 'DefaultVerifier'; }; }; } interface TransactionResult { batch_author: string; batch_id: string; block_height: string; contract_address: string; creation_time: string; method_kind: string; txn_result: string; tx_idx: number; transaction_id: string; } export interface SuccessResult extends TransactionResult { status: 'Finalized'; } export interface FailedResult extends TransactionResult { status: 'Failed'; } export type TransactionResponseData = SuccessResult | FailedResult; export interface ExecuteOptions { stream?: boolean; headers?: Record; shouldHideArgs?: boolean; isNonBlocking?: boolean; org?: OrgContext; } type CreateOnlyOptions = { upgrade?: false; /** * Applet name registered on chain. Required — the platform stores * `contract_name` as a mandatory field on every `TransactionSchema` * / `TransactionSummary` and rejects deploys that omit it. Pick a * short, human-readable identifier (`"Ledger"`, `"Counter"`, …); * it flows into the block indexer, RPC responses, and every * downstream UI that lists contracts. */ name: string; }; type UpgradeOnlyOptions = { upgrade: true; } & ({ address: string; name: string; } | { address: undefined; name: string; }); export type DeployOptions = { pods?: PodSpecifier; config?: string; context?: string; initArgs?: JsonObject; logo?: string; author?: string; description?: string; organization?: string; outcall?: boolean; auditLog?: boolean; org?: OrgContext; } & (CreateOnlyOptions | UpgradeOnlyOptions); export declare const isAsyncIterable: (value: any) => value is AsyncIterable; export declare class WeilWallet extends WeilWalletCommon { config: WeilWalletConfig; constructor(options: WeilWalletConstructorOptions); getAxiosInstance(): Promise; private getTransactionId; submitTransaction(params: SubmitTransactionParams): Promise; transactions: { submit: (params: SubmitTransactionParams) => Promise; }; } export {};