import { Method } from 'mppx'; /** * Bridge MPP server — verifies bridged cross-chain payments. * * The client pays on a source chain and calls the bridge settle endpoint. * The settle endpoint executes the cross-chain swap and pays the merchant * on the target chain. This server method verifies the target chain tx. * * Usage: * ```ts * import { Mppx } from 'mppx/server' * import { bridgeCharge } from '@relai-fi/x402/mpp/bridge-server' * import { evmCharge } from '@relai-fi/x402/mpp/evm-server' * * const mppx = Mppx.create({ * secretKey: process.env.MPP_SECRET_KEY, * methods: [ * // Direct payment on SKALE * evmCharge({ recipient: '0x...', tokenAddress: '0x...', chainId: 1187947933, rpcUrl: '...' }), * // Cross-chain bridge to SKALE * bridgeCharge({ recipient: '0x...', tokenAddress: '0x...', chainId: 1187947933, rpcUrl: '...' }), * ], * }) * ``` */ interface BridgeChargeConfig { /** Target chain: recipient (merchant) EVM address */ recipient: string; /** Target chain: ERC-20 token contract address */ tokenAddress: string; /** Target chain: EVM chain ID */ chainId: number; /** Target chain: RPC URL for verification */ rpcUrl: string; /** Target chain: token decimals (default 6) */ decimals?: number; /** Target chain: human-readable network name (e.g. "skale-base") */ network?: string; /** Bridge settle endpoint (auto-discovered from /bridge/info if not set) */ settleEndpoint?: string; /** Supported source chains in CAIP-2 (auto-discovered if not set) */ supportedSourceChains?: string[]; /** Supported source token addresses (auto-discovered if not set) */ supportedSourceAssets?: string[]; /** Bridge payTo map: { [caip2]: bridgeReceiverAddress } (auto-discovered if not set) */ payTo?: Record; /** Solana fee payer address (auto-discovered if not set) */ feePayerSvm?: string; /** Bridge fee in basis points (auto-discovered if not set) */ feeBps?: number; /** Payment facilitator URL (auto-discovered if not set) */ paymentFacilitator?: string; /** RelAI API base URL for auto-discovery (default: https://api.relai.fi) */ baseUrl?: string; /** Service key hash for tracking */ serviceKeyHash?: string; } declare function bridgeCharge(config: BridgeChargeConfig): Method.AnyServer; export { type BridgeChargeConfig, bridgeCharge };