import { Address } from 'viem'; import { BridgeData } from '../api/teller.js'; import { ChainId } from '../api/vault-config.js'; import { TellerAbi } from '../contracts/teller-abi.js'; import { VaultKey } from './config.js'; import 'viem/chains'; /** * @file Bridge functionality for cross-chain operations * @module vaults/bridge */ /** * Parameters for preparing bridge contract arguments * @interface PrepareBridgeContractArgParams * @property {number} bridgeChainIdentifier - Chain identifier for the bridge protocol * @property {Address} userAddress - Ethereum address of the user initiating the bridge * @property {Address} [nativeTokenForBridgeFee] - Optional address of the native token used for bridge fees */ interface PrepareBridgeContractArgParams { bridgeChainIdentifier: number; userAddress: Address; nativeTokenForBridgeFee?: Address; } declare const prepareBridgeContractArg: ({ bridgeChainIdentifier, userAddress, nativeTokenForBridgeFee, }: PrepareBridgeContractArgParams) => BridgeData; /** * Parameters for preparing a cross-chain bridge transaction * @interface PrepareBridgeTransactionParams * @property {VaultKey} vaultKey - Unique identifier for the vault * @property {bigint} bridgeAmount - Amount of shares to bridge (in base units) * @property {ChainId} sourceChainId - Chain ID where shares currently exist * @property {ChainId} destinationChainId - Chain ID where shares will be bridged to * @property {Address} userAddress - Ethereum address of the user initiating the bridge */ interface PrepareBridgeTransactionParams { vaultKey: VaultKey; bridgeAmount: bigint; sourceChainId: ChainId; destinationChainId: ChainId; userAddress: Address; } /** * Transaction data for executing a cross-chain bridge operation * @interface BridgeTransactionData * @property {typeof TellerAbi} abi - ABI for the CrossChainTeller contract * @property {Address} address - Address of the CrossChainTeller contract * @property {string} functionName - Name of the function to call on the contract * @property {[bigint, BridgeData]} args - Arguments for the bridge function: * [amount, bridgeArgs] * @property {number} chainId - ID of the chain where the transaction should be executed * @property {bigint} value - Amount of native token to send with the transaction */ interface BridgeTransactionData { abi: typeof TellerAbi; address: Address; functionName: "bridge"; args: [bigint, BridgeData]; chainId: number; value: bigint; } declare const prepareBridgeTransactionData: ({ vaultKey, bridgeAmount, sourceChainId, destinationChainId, userAddress, }: PrepareBridgeTransactionParams) => Promise; export { type BridgeTransactionData, prepareBridgeContractArg, prepareBridgeTransactionData };