Description
Deliver a complete transaction-construction module with tests.
Problem Statement
Transaction building is duplicated in vero-relayer-service/src/services/stellar.js and vero-guardian-dashboard/src/lib/stellar-interact.ts, each with its own defaults for fee, timeout, and network passphrase — divergent defaults are how a transaction succeeds in one service and fails in another for non-obvious reasons. Fee handling also needs bounds: the relayer shipped without them until vero-relayer-service#134, and an unbounded fee read from a network spike is a real fund-loss risk.
Proposed Changes
Technical Implementation Scaffolding
- Target Repository: vero-sdk
- Target Path: src/transaction/
- Branch Naming: feat/issue--transaction-module
- Authority Context: Security-sensitive — constructs what users and services sign
Acceptance Criteria
Definition of Done
This issue is self-contained. Everything it needs already exists on main; it does not wait on any other issue. Deliver the module and its tests in one PR.
Description
Deliver a complete transaction-construction module with tests.
Problem Statement
Transaction building is duplicated in
vero-relayer-service/src/services/stellar.jsandvero-guardian-dashboard/src/lib/stellar-interact.ts, each with its own defaults for fee, timeout, and network passphrase — divergent defaults are how a transaction succeeds in one service and fails in another for non-obvious reasons. Fee handling also needs bounds: the relayer shipped without them until vero-relayer-service#134, and an unbounded fee read from a network spike is a real fund-loss risk.Proposed Changes
src/transaction/builder.ts— accept aNetworkConfigso passphrase and endpoint can never mismatch; provide amanageDatahelper using theDataKeynames fromsrc/typessrc/transaction/fees.ts—estimateFee(rpc, opts)clamped to a required[minFee, maxFee], throwing aVeroErrorwhen the bounds are inverted rather than producing nonsensebuildFeeBump()reusing the original sequence — a fee bump must not consume a new onesrc/__tests__/transaction.test.tsasserting on decoded XDR, not string equalitysrc/index.tsTechnical Implementation Scaffolding
Acceptance Criteria
manageDataentry names matchDataKeyexactlynpm test,npm run typecheck,npm run lint, andnpm run buildall passDefinition of Done
This issue is self-contained. Everything it needs already exists on
main; it does not wait on any other issue. Deliver the module and its tests in one PR.