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 { 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 { type: 'AlphContractUpgrade'; module: M; newCode: Uint8Array; prevStateHash?: Uint8Array; newState?: Uint8Array; } export interface RegisterChain { 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 | 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): vaa is VAA; export declare function isGovernanceVAA(vaa: VAA): vaa is VAA; export declare class Signature { index: number; sig: Uint8Array; constructor(index: number, sig: Uint8Array); static from(data: Uint8Array): Signature; serialize(): Uint8Array; } export interface VAABody { timestamp: number; nonce: number; emitterChainId: ChainId; targetChainId: ChainId; emitterAddress: Uint8Array; sequence: bigint; consistencyLevel: number; payload: T; } export interface VAA { version: number; guardianSetIndex: number; signatures: Signature[]; body: VAABody; } 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; export declare function serializeTransferTokenVAA(vaa: VAA): 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; export declare function serializeTransferNFTPayload(payload: TransferNFT): Uint8Array; export declare function serializeTransferNFTVAA(vaa: VAA): Uint8Array; export declare function deserializeAttestTokenPayload(payload: Uint8Array): AttestToken; export declare function deserializeAttestTokenVAA(data: Uint8Array): VAA; export declare function serializeAttestTokenPayload(payload: AttestToken): Uint8Array; export declare function serializeAttestTokenVAA(vaa: VAA): Uint8Array; export declare function deserializeContractUpgradePayload(data: Uint8Array): ContractUpgrade; export declare function deserializeCoreContractUpgradeVAA(data: Uint8Array): VAA>; export declare function deserializeTokenBridgeContractUpgradeVAA(data: Uint8Array): VAA>; export declare function deserializeNFTBridgeContractUpgradeVAA(data: Uint8Array): VAA>; export declare function serializeContractUpgradePayload(payload: ContractUpgrade): Uint8Array; export declare function serializeContractUpgradeVAA(vaa: VAA>): Uint8Array; export declare function deserializeGuardianSetUpgradePayload(data: Uint8Array): GuardianSetUpgrade; export declare function deserializeGuardianSetUpgradeVAA(data: Uint8Array): VAA; export declare function serializeGuardianSetUpgradePayload(payload: GuardianSetUpgrade): Uint8Array; export declare function serializeGuardianSetUpgradeVAA(vaa: VAA): Uint8Array; export declare function deserializeUpdateMessageFeePayload(data: Uint8Array): UpdateMessageFee; export declare function deserializeUpdateMessageFeeVAA(data: Uint8Array): VAA; export declare function serializeUpdateMessageFeePayload(payload: UpdateMessageFee): Uint8Array; export declare function serializeUpdateMessageFeeVAA(vaa: VAA): Uint8Array; export declare function deserializeTransferFeePayload(data: Uint8Array): TransferFee; export declare function deserializeTransferFeeVAA(data: Uint8Array): VAA; export declare function serializeTransferFeePayload(payload: TransferFee): Uint8Array; export declare function serializeTransferFeeVAA(vaa: VAA): Uint8Array; export declare function deserializeAlphContractUpgradePayload(data: Uint8Array): AlphContractUpgrade<'Core' | 'TokenBridge'>; export declare function deserializeAlphCoreContractUpgradeVAA(data: Uint8Array): VAA>; export declare function deserializeAlphTokenBridgeContractUpgradeVAA(data: Uint8Array): VAA>; export declare function serializeAlphContractUpgradePayload(payload: AlphContractUpgrade<'Core' | 'TokenBridge'>): Uint8Array; export declare function serializeAlphContractUpgradeVAA(vaa: VAA>): Uint8Array; export declare function deserializeRegisterChainPayload(payload: Uint8Array): RegisterChain<'TokenBridge' | 'NFTBridge'>; export declare function deserializeTokenBridgeRegisterChainVAA(data: Uint8Array): VAA>; export declare function deserializeNFTBridgeRegisterChainVAA(data: Uint8Array): VAA>; export declare function serializeRegisterChainPayload(payload: RegisterChain<'NFTBridge' | 'TokenBridge'>): Uint8Array; export declare function serializeRegisterChainVAA(vaa: VAA>): Uint8Array; export declare function deserializeDestroyUnexecutedSequencesPayload(payload: Uint8Array): DestroyUnexecutedSequences; export declare function deserializeDestroyUnexecutedSequencesVAA(data: Uint8Array): VAA; export declare function serializeDestroyUnexecutedSequencesPayload(payload: DestroyUnexecutedSequences): Uint8Array; export declare function serializeDestroyUnexecutedSequencesVAA(vaa: VAA): Uint8Array; export declare function deserializeUpdateMinimalConsistencyLevelPayload(payload: Uint8Array): UpdateMinimalConsistencyLevel; export declare function deserializeUpdateMinimalConsistencyLevelVAA(data: Uint8Array): VAA; export declare function serializeUpdateMinimalConsistencyLevelPayload(payload: UpdateMinimalConsistencyLevel): Uint8Array; export declare function serializeUpdateMinimalConsistencyLevelVAA(vaa: VAA): Uint8Array; export declare function deserializeUpdateRefundAddressPayload(payload: Uint8Array): UpdateRefundAddress; export declare function deserializeUpdateRefundAddressVAA(data: Uint8Array): VAA; export declare function serializeUpdateRefundAddressPayload(payload: UpdateRefundAddress): Uint8Array; export declare function serializeUpdateRefundAddressVAA(vaa: VAA): Uint8Array; export declare function deserializeVAA(signedVAA: Uint8Array): VAA; 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(body: VAABody): Uint8Array; export declare function serializeVAA(vaa: VAA): Uint8Array; export declare function signVAABody(keys: string[], body: VAABody): Signature[];