Skip to content

Implement cross-chain payment routing helpers with bridge fee estimation #426

Description

@Kingsman-99

Overview

Add SDK helpers for routing payments from non-Stellar chains (Ethereum, Solana) toward a StellarSplit invoice via a bridge. The SDK must estimate bridge fees, build the relay proof parameters, and submit the bridge payment to the contract.

Requirements

  • client.estimateBridgeFee(sourceChain: ChainId, amount: bigint): Promise<BridgeFeeEstimate>
  • BridgeFeeEstimate { bridgeFee: bigint, netAmount: bigint, estimatedTimeSeconds: number }
  • client.buildBridgePayment(params: BridgePaymentParams): BridgePaymentRequest — builds the unsigned relay proof struct
  • client.submitBridgePayment(proof: SignedBridgeProof): Promise<{ txHash: string }> — submits to contract
  • Support at minimum: Ethereum mainnet and Solana mainnet as source chains
  • Write tests with mock bridge fee APIs and mock contract responses

Acceptance Criteria

  • Fee estimation returns valid estimates for both chains
  • Bridge payment request builds correctly
  • Submission calls the contract's bridge_pay entry point
  • npm test passes with zero failures
  • TypeScript compiles with zero errors
  • ESLint passes with zero errors

Definition of Done

All CI checks must pass before the PR is reviewed.

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions