import { type Address } from '@solana/kit';
import { type RawWarpArtifactConfig } from '@hyperlane-xyz/provider-sdk/warp';
import type { SvmSigner } from '../clients/signer.js';
import { type TokenInitInstructionData } from '../instructions/token.js';
import type { AnnotatedSvmTransaction, SvmInstruction, SvmReceipt, SvmRpc } from '../types.js';
/**
 * Asserts that `localDecimals` does not exceed the SVM maximum of 9.
 * The on-chain program stores decimals as u8 and the decimal-conversion math
 * overflows for values > 9. Mirrors the Rust client's `assert_decimals_max`.
 */
export declare function assertLocalDecimals(localDecimals: number): void;
/**
 * Derives `remoteDecimals` from `localDecimals` and the optional `scale` factor.
 * scale = 10^(remoteDecimals - localDecimals), so
 * remoteDecimals = localDecimals + log10(scale).
 * Falls back to localDecimals when scale is absent or 1.
 * Supports both upscaling (scale >= 1, e.g. 1e9) and downscaling
 * (scale < 1, e.g. 1e-4) to match the on-chain program which stores
 * decimals and remote_decimals as independent u8 values.
 * Asserts that scale is an exact power of 10.
 */
export declare function scaleToRemoteDecimals(localDecimals: number, scale?: number): number;
/**
 * Derives the `scale` factor from on-chain `localDecimals` and `remoteDecimals`.
 * Returns undefined when there is no scaling (remoteDecimals === localDecimals).
 */
export declare function remoteDecimalsToScale(localDecimals: number, remoteDecimals: number): number | undefined;
/**
 * Builds the TokenInitInstructionData shared by all warp token types.
 * The caller is responsible for passing the token-type-specific decimals.
 */
export declare function buildBaseInitData(config: Pick<RawWarpArtifactConfig, 'mailbox' | 'interchainSecurityModule' | 'hook'>, decimals: number, remoteDecimals: number): Promise<TokenInitInstructionData>;
export declare const MAX_GAS_CONFIGS_PER_TX = 60;
/**
 * Sends post-init configuration (remote routers + destination gas) in
 * separate, batched transactions — matching the Rust CLI behaviour — to
 * stay within Solana's 1232-byte transaction size limit.
 *
 * Router enrollments and gas configs are issued as independent instruction
 * streams so each can use its full per-tx budget.
 */
export declare function applyPostInitConfig(signer: SvmSigner, programId: Address, config: Pick<RawWarpArtifactConfig, 'remoteRouters' | 'destinationGas'>): Promise<SvmReceipt[]>;
/**
 * Returns a System Program transfer instruction to top up the ATA payer PDA
 * to at least `targetLamports`, or undefined if already sufficiently funded.
 * For synthetic and collateral tokens the ATA payer funds recipient ATA
 * creation on transfer_out.
 */
export declare function buildFundAtaPayerInstruction(rpc: SvmRpc, payer: Address, programId: Address, targetLamports: bigint): Promise<SvmInstruction | undefined>;
/**
 * Diffs current vs expected config and returns the minimal set of annotated
 * update transactions needed to reconcile them, batched to stay within
 * Solana's 1232-byte transaction size limit.
 *
 * Transaction grouping:
 *   1. ISM + IGP hook changes (combined, both are small)
 *   2. Router unenroll/enroll batches (MAX_ROUTERS_PER_TX each)
 *   3. Gas config unenroll/enroll batches (MAX_GAS_CONFIGS_PER_TX each)
 *   4. Ownership transfer (always last, own tx)
 *
 * @param label - Prefix used for transaction annotations,
 *                e.g. "native token <programId>"
 */
export declare function computeWarpTokenUpdateInstructions(current: RawWarpArtifactConfig, expected: RawWarpArtifactConfig, programId: Address, ownerAddress: Address, rpc: SvmRpc, label: string): Promise<AnnotatedSvmTransaction[]>;
//# sourceMappingURL=warp-tx.d.ts.map