import { BN } from "@coral-xyz/anchor"; import { Keypair, PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js"; import { BaseClient, BaseTxBuilder, ProtocolPolicyClient, ProtocolPolicyTxBuilder, TxOptions } from "./base"; import { LayerzeroOftRouteProfile } from "./bridgeRegistry"; import { LayerzeroOftPolicy, LayerzeroOftRoute, RouteManagementMode } from "../deser/integrationPolicies"; type BufferLike = Uint8Array | number[] | Buffer; type RouteManagementModeArg = RouteManagementMode | number | { unmanagedOnly: Record; } | { managedOnly: Record; } | { either: Record; }; export type LayerzeroOftRouteInput = Omit & { managementMode: RouteManagementModeArg; }; export type OftTransferParams = { transferId: PublicKey; sourceMint: PublicKey; sourceAmount: BN; providerInstructions: TransactionInstruction[]; providerReceipt: PublicKey; managed?: boolean; providerSigners?: Keypair[]; }; export type LayerzeroOftSendParams = { transferId?: PublicKey; sourceMint: PublicKey; sourceAmount: BN; destinationChain: number; destinationRecipient: PublicKey; nativeFeeLamports: BN; minAmountLd?: BN; lzTokenFee?: BN; options?: BufferLike; composeMsg?: BufferLike | null; sourceTokenAccount?: PublicKey; nonceAccount?: PublicKey; managed?: boolean; providerProgram?: PublicKey; }; type BridgeTransferStatusAccount = { committed: Record; } | { validated: Record; } | { settled: Record; }; type BridgeTransferRecordAccount = { glamState: PublicKey; transferId: PublicKey; protocol: number; status: BridgeTransferStatusAccount; managed: true; receiptVerified: true; sourceMint: PublicKey; sourceDecimals: number; providerProgram: PublicKey; providerConfig: PublicKey; sourceAmount: BN; quotedOutAmount: BN; destinationChain: number; destinationRecipient: PublicKey; providerEmitter: PublicKey; providerSequence: BN; committedSlot: BN; }; export declare function getActiveRegistryTransfers(registry: { managedTransferCount: BN | number; transfers: any[]; }): any[]; export declare function deriveLayerzeroNoncePda(endpointProgram: PublicKey, sender: PublicKey, destinationChain: number, destinationRecipient: PublicKey): PublicKey; export declare function deriveOftAuxiliaryAccountSeed(glamState: PublicKey, transferId: PublicKey): Promise; export declare function deriveOftAuxiliaryAccount(glamSigner: PublicKey, glamState: PublicKey, transferId: PublicKey, tokenProgram: PublicKey): Promise<{ address: PublicKey; seed: string; }>; declare class TxBuilder extends BaseTxBuilder implements ProtocolPolicyTxBuilder { setPolicyIx(policy: LayerzeroOftPolicy, signer?: PublicKey): Promise; setPolicyTx(policy: LayerzeroOftPolicy, txOptions?: TxOptions): Promise; clearPolicyIx(signer?: PublicKey): Promise; clearPolicyTx(txOptions?: TxOptions): Promise; addLayerzeroOftRouteIx(route: LayerzeroOftRouteInput, signer?: PublicKey): Promise; updateLayerzeroOftRouteIx(route: LayerzeroOftRouteInput, signer?: PublicKey): Promise; deleteLayerzeroOftRouteIx(route: LayerzeroOftRouteInput, signer?: PublicKey): Promise; buildOftTransferTx(params: OftTransferParams, txOptions?: TxOptions): Promise<{ tx: VersionedTransaction; additionalSigners: Keypair[]; sessionPda: PublicKey; auxiliaryTokenAccount: PublicKey; sourceTokenAccount: PublicKey; }>; } declare class LayerzeroOftBridgeProtocolClient { readonly bridge: BridgeClient; constructor(bridge: BridgeClient); buildSendTx(params: LayerzeroOftSendParams, txOptions?: TxOptions): Promise<{ auxiliaryTokenAccount: PublicKey; nonceAccount: PublicKey; routeProfile: LayerzeroOftRouteProfile; sendInstruction: TransactionInstruction; tx: VersionedTransaction; additionalSigners: Keypair[]; sessionPda: PublicKey; sourceTokenAccount: PublicKey; }>; send(params: LayerzeroOftSendParams, txOptions?: TxOptions): Promise; } export declare class BridgeClient implements ProtocolPolicyClient { readonly base: BaseClient; readonly txBuilder: TxBuilder; readonly oft: LayerzeroOftBridgeProtocolClient; constructor(base: BaseClient); getRegistryPda(): PublicKey; getSessionPda(transferId: PublicKey): PublicKey; getLayerzeroNoncePda(endpointProgram: PublicKey, sender: PublicKey, destinationChain: number, destinationRecipient: PublicKey): PublicKey; deriveOftAuxiliaryTokenAccount(transferId: PublicKey, sourceMint: PublicKey, signer?: PublicKey): Promise<{ tokenProgram: PublicKey; address: PublicKey; seed: string; }>; private resolveLayerzeroOftRouteProfile; private resolveLayerzeroOftNonceAccount; private materializeLayerzeroOftRemainingAccounts; private buildLayerzeroOftInstructionBaseAccounts; private buildLayerzeroOftSendInstruction; fetchPolicy(): Promise; fetchLayerzeroOftPolicy(): Promise; setPolicy(policy: LayerzeroOftPolicy, txOptions?: TxOptions): Promise; clearPolicy(txOptions?: TxOptions): Promise; fetchRegistry(): Promise<{ glamState: PublicKey; managedTransferCount: number; reserved: number[]; transfers: { transferId: PublicKey; sourceMint: PublicKey; destinationRecipient: PublicKey; providerProgram: PublicKey; providerConfig: PublicKey; providerEmitter: PublicKey; sourceAmount: BN; quotedOutAmount: BN; providerSequence: BN; committedSlot: BN; protocol: number; destinationChain: number; sourceDecimals: number; status: number; reserved: number[]; }[]; } | null>; fetchSession(transferId: PublicKey): Promise<{ glamState: PublicKey; signer: PublicKey; transferId: PublicKey; protocol: number; managed: boolean; sourceMint: PublicKey; sourceDecimals: number; sourceTokenAccount: PublicKey; providerProgram: PublicKey; providerConfig: PublicKey; providerSender: PublicKey; providerDelegate: PublicKey; providerReceipt: PublicKey; providerInstructionHash: number[]; providerInstructionCount: number; sourceAmount: BN; quotedOutAmount: BN; initialSourceBalance: BN; initialProviderSequence: BN; destinationChain: number; destinationRecipient: PublicKey; quoteExpiresAt: BN; preparedSlot: BN; bump: number; } | null>; fetchTransferRecordNullable(transferId: PublicKey): Promise; addLayerzeroOftRoute(route: LayerzeroOftRouteInput, txOptions?: TxOptions): Promise; updateLayerzeroOftRoute(route: LayerzeroOftRouteInput, txOptions?: TxOptions): Promise; deleteLayerzeroOftRoute(route: LayerzeroOftRouteInput, txOptions?: TxOptions): Promise; buildOftTransferTx(params: OftTransferParams, txOptions?: TxOptions): Promise<{ tx: VersionedTransaction; additionalSigners: Keypair[]; sessionPda: PublicKey; auxiliaryTokenAccount: PublicKey; sourceTokenAccount: PublicKey; }>; buildLayerzeroOftSendTx(params: LayerzeroOftSendParams, txOptions?: TxOptions): Promise<{ auxiliaryTokenAccount: PublicKey; nonceAccount: PublicKey; routeProfile: LayerzeroOftRouteProfile; sendInstruction: TransactionInstruction; tx: VersionedTransaction; additionalSigners: Keypair[]; sessionPda: PublicKey; sourceTokenAccount: PublicKey; }>; sendOft(params: OftTransferParams, txOptions?: TxOptions): Promise; private extendLookupTables; settleManagedTransfer(transferId: PublicKey, txOptions?: TxOptions): Promise; validateManagedTransfer(transferId: PublicKey, txOptions?: TxOptions): Promise; } export {};