import type { ContractTransaction } from "ethers"; import { type EthereumAddress, ExternalChain } from "../../../types/index.js"; import type { Address, Amount } from "../../../types/index.js"; import type { Call } from "starknet"; export interface LayerZeroQuoteFee { chainKey: string; type: string; description: string; amount: string; address: string; } export interface LayerZeroUserStep { type: string; description: string; chainKey: string; chainType: string; signerAddress: string; transaction: { encoded: ContractTransaction | StarknetEncodedTransaction; }; } export interface StarknetEncodedTransaction { calls: Call[]; } export interface LayerZeroQuote { id: string; routeSteps: { type: string; srcChainKey: string; description: string; duration: { estimated: string | null; }; fees: LayerZeroQuoteFee[]; }[]; fees: LayerZeroQuoteFee[]; duration: { estimated: string | null; }; feeUsd: string; feePercent: string; srcAmount: string; dstAmount: string; dstAmountMin: string; srcAmountUsd: string; dstAmountUsd: string; userSteps: LayerZeroUserStep[]; options: { dstNativeDropAmount: string; }; expiresAt: string; } interface LayerZeroApiConfig { externalTokenAddress: string; starknetTokenAddress: Address; externalChainKey: ExternalChain; apiKey: string; } interface QuoteRequestParams { srcWalletAddress: string; dstWalletAddress: string; amount: Amount; } export declare class LayerZeroApi { private readonly config; private readonly fetcher; constructor(config: LayerZeroApiConfig, fetcher?: typeof fetch); getDepositQuotes(params: QuoteRequestParams): Promise; /** * Get LayerZero quotes for a withdrawal from Starknet to the external chain. * * The resulting quotes contain a Starknet-chain user step that can be * converted to a `Call` via `getWithdrawCalls`. */ getWithdrawQuotes(params: QuoteRequestParams): Promise; getApprovalTransaction(quotes: LayerZeroQuote[]): ContractTransaction | null; getDepositTransaction(quotes: LayerZeroQuote[]): ContractTransaction | null; /** * Extract Starknet calls from withdraw quotes. * * The LayerZero API returns a Starknet-chain user step for withdrawals * whose encoded transaction contains the OFT `send` call data. This method * extracts those steps and casts them to starknet.js `Call` objects. */ getWithdrawCalls(quotes: LayerZeroQuote[]): Call[]; /** * Extract the allowance spender from an approval transaction's calldata. * Parses `approve(address,uint256)` to retrieve the spender argument. */ extractSpenderFromApprovalTx(approvalTx: ContractTransaction | null): EthereumAddress | null; private getQuotes; private extractUserStep; } export {}; //# sourceMappingURL=LayerZeroApi.d.ts.map