Label: complexity: high
Points: 200
Description
Before letting a user attempt to pay/create an invoice, check whether their account exists and has sufficient balance for the operation plus fees, surfacing a clear "fund your account first" UX hook rather than a late on-chain failure.
Technical Context
New src/preflightChecker.ts. Uses server.getAccount plus balance checks against the required token, called proactively by UI integrators before invoking client.pay/client.createInvoice.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
Before letting a user attempt to pay/create an invoice, check whether their account exists and has sufficient balance for the operation plus fees, surfacing a clear "fund your account first" UX hook rather than a late on-chain failure.
Technical Context
New
src/preflightChecker.ts. Usesserver.getAccountplus balance checks against the required token, called proactively by UI integrators before invokingclient.pay/client.createInvoice.Acceptance Criteria
checkPayerReadiness(address, requiredAmount, token)returns{ ready: boolean, reason?: "account_not_found"|"insufficient_balance"|"no_trustline" }src/index.tsready: truewith no reason