import { type Address, type Instruction, type TransactionSigner } from '@solana/kit';
import type { SvmReceipt, SvmRpc } from '../types.js';
export interface DeployProgramPlan {
    programAddress: Address;
    programDataAddress: Address;
    stages: DeployStage[];
}
export declare const DeployStageKind: {
    readonly Init: "init";
    readonly Write: "write";
    readonly Finalize: "finalize";
};
export type DeployStageKind = (typeof DeployStageKind)[keyof typeof DeployStageKind];
export interface DeployStage {
    label: string;
    kind: DeployStageKind;
    instructions: Instruction[];
    additionalSigners?: TransactionSigner[];
}
export interface DeployProgramPlanArgs {
    payer: TransactionSigner;
    authority?: TransactionSigner;
    programBytes: Uint8Array;
    getMinimumBalanceForRentExemption: (size: number) => Promise<bigint>;
    writeChunkSize?: number;
    maxDataLen?: bigint;
    programSigner?: TransactionSigner;
    bufferSigner?: TransactionSigner;
}
export interface ExecutePlanArgs {
    plan: DeployProgramPlan;
    executeStage: (stage: DeployStage) => Promise<SvmReceipt>;
    /** Max write transactions to send concurrently. Defaults to 10. */
    writeBatchSize?: number;
}
export interface UpgradeProgramPlanArgs {
    payer: TransactionSigner;
    authority: TransactionSigner;
    programAddress: Address;
    newProgramBytes: Uint8Array;
    getMinimumBalanceForRentExemption: (size: number) => Promise<bigint>;
    writeChunkSize?: number;
    bufferSigner?: TransactionSigner;
}
export declare function createDeployProgramPlan(args: DeployProgramPlanArgs): Promise<DeployProgramPlan>;
export declare function createUpgradeProgramPlan(args: UpgradeProgramPlanArgs): Promise<DeployProgramPlan>;
export declare function executeDeployPlan(args: ExecutePlanArgs): Promise<SvmReceipt[]>;
export declare function deriveProgramDataAddress(programAddress: Address): Promise<Address>;
/**
 * Reads the BPF loader upgradeable ProgramData account to return the current
 * upgrade authority, or null if the program is immutable or not found.
 *
 * ProgramData binary layout:
 *   [0-3]  u32 discriminant (= 3)
 *   [4-11] u64 slot
 *   [12]   u8  option tag (0 = None, 1 = Some)
 *   [13-44] [u8; 32] upgrade authority pubkey (only when tag = 1)
 */
export declare function getProgramUpgradeAuthority(rpc: SvmRpc, programAddress: Address): Promise<Address | null>;
//# sourceMappingURL=program-deployer.d.ts.map