import type { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
import { Registry } from '@cosmjs/proto-signing';
import type { DeliverTxResponse } from '@cosmjs/stargate';
import type { ChunkedArtifact, ChunkInfo } from '@agoric/cosmic-proto/codegen/agoric/swingset/swingset.js';
export interface BundleJson {
    moduleFormat: 'endoZipBase64';
    endoZipBase64: string;
    endoZipBase64Sha512: string;
    [key: string]: unknown;
}
export type Sha512 = (bytes: Uint8Array) => Promise<Uint8Array>;
export type Gzip = (bytes: Uint8Array) => Promise<Uint8Array>;
export declare const bundleRegistryTypes: [string, GeneratedType][];
export declare const makeBundleRegistry: (baseTypes?: readonly [string, GeneratedType][]) => Registry;
export declare const encodeBundle: (bundleJson: string) => Uint8Array<ArrayBuffer>;
export declare const defaultSha512: Sha512;
export declare const getSha512Hex: (bytes: Uint8Array, { sha512 }?: {
    sha512?: Sha512;
}) => Promise<string>;
export declare const validateBundleJson: (bundleString: string) => BundleJson;
export declare const chunkBundle: (bytes: Uint8Array, chunkSizeLimit: number, { sha512 }?: {
    sha512?: Sha512;
}) => Promise<{
    chunks: Uint8Array<ArrayBufferLike>[];
    manifest: {
        sha512: string;
        sizeBytes: bigint;
        chunks: ChunkInfo[];
    };
}>;
export interface MsgInstallArgs {
    uncompressedSize: bigint;
    compressedBundle?: Uint8Array;
    chunkedArtifact?: ChunkedArtifact;
    submitter: string;
}
export declare const makeInstallBundleMsg: ({ compressedBundle, uncompressedSize, chunkedArtifact, submitter, }: MsgInstallArgs) => EncodeObject;
export interface MsgSendChunkArgs {
    chunkedArtifactId: bigint;
    chunkIndex: bigint;
    chunkData: Uint8Array;
    submitter: string;
}
export declare const makeSendChunkMsg: ({ chunkedArtifactId, chunkIndex, chunkData, submitter, }: MsgSendChunkArgs) => EncodeObject;
export type InstallBundleProgress = {
    type: 'preflight';
    bundleHash: string;
    uncompressedSize: number;
    compressedSize: number;
    chunked: boolean;
    chunkCount?: number;
} | {
    type: 'bundle-submitted';
    bundleHash: string;
    height: number;
} | {
    type: 'manifest-submitted';
    bundleHash: string;
    height: number;
    chunkCount: number;
    chunkedArtifactId: bigint;
} | {
    type: 'chunk-submitted';
    bundleHash: string;
    height: number;
    index: number;
    total: number;
} | {
    type: 'watching';
    bundleHash: string;
    height: number;
};
export interface InstallBundleParams {
    bundleJson: string;
    chunkSizeLimit: number;
    submitter: string;
    gzip: Gzip;
    signAndBroadcast: (msg: EncodeObject) => Promise<DeliverTxResponse | undefined>;
    sha512?: Sha512;
    makeInstallBundleMsg?: (args: MsgInstallArgs) => EncodeObject;
    makeSendChunkMsg?: (args: MsgSendChunkArgs) => EncodeObject;
    watchBundle?: (bundleHash: string, height: number) => Promise<void>;
    onProgress?: (event: InstallBundleProgress) => void;
}
export interface InstallBundleResult {
    bundleHash: string;
    blockHeight: number;
    chunked: boolean;
    chunkCount?: number;
    compressedSize: number;
    uncompressedSize: number;
    chunkedArtifactId?: bigint;
}
export declare const installBundle: (params: InstallBundleParams) => Promise<InstallBundleResult>;
//# sourceMappingURL=bundle-utils.d.ts.map