import { ChainId } from "./consts";
export declare const METADATA_REPLACE: RegExp;
export declare const CoreModule = "00000000000000000000000000000000000000000000000000000000436f7265";
export declare const TokenBridgeModule = "000000000000000000000000000000000000000000546f6b656e427269646765";
export declare const NFTBridgeModule = "00000000000000000000000000000000000000000000004e4654427269646765";
export declare const TransferTokenPayloadId = 1;
export declare const AttestTokenPayloadId = 2;
export declare const TransferNFTPayloadId = 3;
export declare const CoreContractUpgradeActionId = 1;
export declare const GuardianSetUpgradeActionId = 2;
export declare const UpdateMessageFeeActionId = 3;
export declare const TransferFeeActionId = 4;
export declare const RegisterChainActionId = 1;
export declare const AppContractUpgradeActionId = 2;
export declare const DestroyUnexecutedSequencesActionId = 240;
export declare const UpdateMinimalConsistencyLevelActionId = 241;
export declare const UpdateRefundAddressActionId = 242;
export interface TransferNFT {
    type: 'TransferNFT';
    originAddress: Uint8Array;
    originChain: ChainId;
    symbol: string;
    name: string;
    tokenId: bigint;
    uri: Uint8Array;
    targetAddress: Uint8Array;
}
export interface TransferToken {
    type: 'TransferToken';
    amount: bigint;
    originAddress: Uint8Array;
    originChain: ChainId;
    targetAddress: Uint8Array;
    fee: bigint;
}
export interface AttestToken {
    type: 'AttestToken';
    tokenId: Uint8Array;
    tokenChainId: ChainId;
    decimals: number;
    symbol: string;
    name: string;
}
export declare type Module = 'Core' | 'TokenBridge' | 'NFTBridge';
export interface ContractUpgrade<M extends Module> {
    type: 'ContractUpgrade';
    module: M;
    newContractAddress: Uint8Array;
}
export interface GuardianSetUpgrade {
    type: 'GuardianSetUpgrade';
    module: 'Core';
    newGuardianSetIndex: number;
    newGuardianSet: Uint8Array[];
}
export interface UpdateMessageFee {
    type: 'UpdateMessageFee';
    module: 'Core';
    newMessageFee: bigint;
}
export interface TransferFee {
    type: 'TransferFee';
    module: 'Core';
    amount: bigint;
    recipient: Uint8Array;
}
export interface AlphContractUpgrade<M extends 'Core' | 'TokenBridge'> {
    type: 'AlphContractUpgrade';
    module: M;
    newCode: Uint8Array;
    prevStateHash?: Uint8Array;
    newState?: Uint8Array;
}
export interface RegisterChain<M extends 'TokenBridge' | 'NFTBridge'> {
    type: 'RegisterChain';
    module: M;
    emitterChainId: ChainId;
    emitterAddress: Uint8Array;
}
export interface DestroyUnexecutedSequences {
    type: 'DestroyUnexecutedSequences';
    module: 'TokenBridge';
    emitterChainId: ChainId;
    indexes: bigint[];
}
export interface UpdateMinimalConsistencyLevel {
    type: 'UpdateMinimalConsistencyLevel';
    module: 'TokenBridge';
    newConsistencyLevel: number;
}
export interface UpdateRefundAddress {
    type: 'UpdateRefundAddress';
    module: 'TokenBridge';
    newRefundAddress: Uint8Array;
}
export declare type ApplicationPayload = TransferToken | TransferNFT | AttestToken;
export declare type GovernancePayload = ContractUpgrade<Module> | GuardianSetUpgrade | UpdateMessageFee | TransferFee | AlphContractUpgrade<'Core' | 'TokenBridge'> | RegisterChain<'TokenBridge' | 'NFTBridge'> | DestroyUnexecutedSequences | UpdateMinimalConsistencyLevel | UpdateRefundAddress;
export declare type VAAPayload = ApplicationPayload | GovernancePayload;
export declare type PayloadName = VAAPayload['type'];
export declare function isApplicationVAA(vaa: VAA<VAAPayload>): vaa is VAA<ApplicationPayload>;
export declare function isGovernanceVAA(vaa: VAA<VAAPayload>): vaa is VAA<GovernancePayload>;
export declare class Signature {
    index: number;
    sig: Uint8Array;
    constructor(index: number, sig: Uint8Array);
    static from(data: Uint8Array): Signature;
    serialize(): Uint8Array;
}
export interface VAABody<T extends VAAPayload> {
    timestamp: number;
    nonce: number;
    emitterChainId: ChainId;
    targetChainId: ChainId;
    emitterAddress: Uint8Array;
    sequence: bigint;
    consistencyLevel: number;
    payload: T;
}
export interface VAA<T extends VAAPayload> {
    version: number;
    guardianSetIndex: number;
    signatures: Signature[];
    body: VAABody<T>;
}
export declare function extractBodyFromVAA(signedVAA: Uint8Array): Uint8Array;
export declare function extractPayloadFromVAA(signedVAA: Uint8Array): Uint8Array;
export declare function extractSequenceFromVAA(signedVAA: Uint8Array): bigint;
export declare function deserializeTransferTokenPayload(payload: Uint8Array): TransferToken;
export declare function serializeTransferTokenPayload(payload: TransferToken): Uint8Array;
export declare function deserializeTransferTokenVAA(data: Uint8Array): VAA<TransferToken>;
export declare function serializeTransferTokenVAA(vaa: VAA<TransferToken>): Uint8Array;
export declare function bytes32ToUtf8String(bytes: Uint8Array): string;
export declare function utf8StringTo32Bytes(str: string): Uint8Array;
export declare function deserializeTransferNFTPayload(payload: Uint8Array): TransferNFT;
export declare function deserializeTransferNFTVAA(data: Uint8Array): VAA<TransferNFT>;
export declare function serializeTransferNFTPayload(payload: TransferNFT): Uint8Array;
export declare function serializeTransferNFTVAA(vaa: VAA<TransferNFT>): Uint8Array;
export declare function deserializeAttestTokenPayload(payload: Uint8Array): AttestToken;
export declare function deserializeAttestTokenVAA(data: Uint8Array): VAA<AttestToken>;
export declare function serializeAttestTokenPayload(payload: AttestToken): Uint8Array;
export declare function serializeAttestTokenVAA(vaa: VAA<AttestToken>): Uint8Array;
export declare function deserializeContractUpgradePayload(data: Uint8Array): ContractUpgrade<Module>;
export declare function deserializeCoreContractUpgradeVAA(data: Uint8Array): VAA<ContractUpgrade<'Core'>>;
export declare function deserializeTokenBridgeContractUpgradeVAA(data: Uint8Array): VAA<ContractUpgrade<'TokenBridge'>>;
export declare function deserializeNFTBridgeContractUpgradeVAA(data: Uint8Array): VAA<ContractUpgrade<'NFTBridge'>>;
export declare function serializeContractUpgradePayload(payload: ContractUpgrade<Module>): Uint8Array;
export declare function serializeContractUpgradeVAA(vaa: VAA<ContractUpgrade<Module>>): Uint8Array;
export declare function deserializeGuardianSetUpgradePayload(data: Uint8Array): GuardianSetUpgrade;
export declare function deserializeGuardianSetUpgradeVAA(data: Uint8Array): VAA<GuardianSetUpgrade>;
export declare function serializeGuardianSetUpgradePayload(payload: GuardianSetUpgrade): Uint8Array;
export declare function serializeGuardianSetUpgradeVAA(vaa: VAA<GuardianSetUpgrade>): Uint8Array;
export declare function deserializeUpdateMessageFeePayload(data: Uint8Array): UpdateMessageFee;
export declare function deserializeUpdateMessageFeeVAA(data: Uint8Array): VAA<UpdateMessageFee>;
export declare function serializeUpdateMessageFeePayload(payload: UpdateMessageFee): Uint8Array;
export declare function serializeUpdateMessageFeeVAA(vaa: VAA<UpdateMessageFee>): Uint8Array;
export declare function deserializeTransferFeePayload(data: Uint8Array): TransferFee;
export declare function deserializeTransferFeeVAA(data: Uint8Array): VAA<TransferFee>;
export declare function serializeTransferFeePayload(payload: TransferFee): Uint8Array;
export declare function serializeTransferFeeVAA(vaa: VAA<TransferFee>): Uint8Array;
export declare function deserializeAlphContractUpgradePayload(data: Uint8Array): AlphContractUpgrade<'Core' | 'TokenBridge'>;
export declare function deserializeAlphCoreContractUpgradeVAA(data: Uint8Array): VAA<AlphContractUpgrade<'Core'>>;
export declare function deserializeAlphTokenBridgeContractUpgradeVAA(data: Uint8Array): VAA<AlphContractUpgrade<'TokenBridge'>>;
export declare function serializeAlphContractUpgradePayload(payload: AlphContractUpgrade<'Core' | 'TokenBridge'>): Uint8Array;
export declare function serializeAlphContractUpgradeVAA(vaa: VAA<AlphContractUpgrade<'Core' | 'TokenBridge'>>): Uint8Array;
export declare function deserializeRegisterChainPayload(payload: Uint8Array): RegisterChain<'TokenBridge' | 'NFTBridge'>;
export declare function deserializeTokenBridgeRegisterChainVAA(data: Uint8Array): VAA<RegisterChain<'TokenBridge'>>;
export declare function deserializeNFTBridgeRegisterChainVAA(data: Uint8Array): VAA<RegisterChain<'NFTBridge'>>;
export declare function serializeRegisterChainPayload(payload: RegisterChain<'NFTBridge' | 'TokenBridge'>): Uint8Array;
export declare function serializeRegisterChainVAA(vaa: VAA<RegisterChain<'NFTBridge' | 'TokenBridge'>>): Uint8Array;
export declare function deserializeDestroyUnexecutedSequencesPayload(payload: Uint8Array): DestroyUnexecutedSequences;
export declare function deserializeDestroyUnexecutedSequencesVAA(data: Uint8Array): VAA<DestroyUnexecutedSequences>;
export declare function serializeDestroyUnexecutedSequencesPayload(payload: DestroyUnexecutedSequences): Uint8Array;
export declare function serializeDestroyUnexecutedSequencesVAA(vaa: VAA<DestroyUnexecutedSequences>): Uint8Array;
export declare function deserializeUpdateMinimalConsistencyLevelPayload(payload: Uint8Array): UpdateMinimalConsistencyLevel;
export declare function deserializeUpdateMinimalConsistencyLevelVAA(data: Uint8Array): VAA<UpdateMinimalConsistencyLevel>;
export declare function serializeUpdateMinimalConsistencyLevelPayload(payload: UpdateMinimalConsistencyLevel): Uint8Array;
export declare function serializeUpdateMinimalConsistencyLevelVAA(vaa: VAA<UpdateMinimalConsistencyLevel>): Uint8Array;
export declare function deserializeUpdateRefundAddressPayload(payload: Uint8Array): UpdateRefundAddress;
export declare function deserializeUpdateRefundAddressVAA(data: Uint8Array): VAA<UpdateRefundAddress>;
export declare function serializeUpdateRefundAddressPayload(payload: UpdateRefundAddress): Uint8Array;
export declare function serializeUpdateRefundAddressVAA(vaa: VAA<UpdateRefundAddress>): Uint8Array;
export declare function deserializeVAA(signedVAA: Uint8Array): VAA<VAAPayload>;
export declare const VAAPayloadSerializers: {
    [k in PayloadName]: (v: VAAPayload & {
        type: k;
    }) => Uint8Array;
};
export declare const VAAPayloadDeserializers: {
    [k in PayloadName]: (payload: Uint8Array) => VAAPayload & {
        type: k;
    };
};
export declare function serializeVAABody<T extends VAAPayload>(body: VAABody<T>): Uint8Array;
export declare function serializeVAA<T extends VAAPayload>(vaa: VAA<T>): Uint8Array;
export declare function signVAABody<T extends VAAPayload>(keys: string[], body: VAABody<T>): Signature[];
