Summary
The Stellar public-key regex /^G[A-Z2-7]{55}$/ is defined three times:
contracts/resolve-method-args.ts:6 (STELLAR_ADDRESS_REGEX)
contracts/resolve-source-address.ts:6
stellar-cli/recover-deploy-contract-id.ts:28-30 (isLikelyPublicKeySource)
Additionally, contracts/validate-source-shape.ts:2 imports isLikelyPublicKeySource from the deploy-recovery module, coupling source validation to a recovery-specific file.
Why it matters
The strkey alphabet rule is already a documented footgun (#135); three copies invite divergence, and the cross-module import is a design smell.
Suggested fix
Centralize STELLAR_ADDRESS_REGEX/isLikelyPublicKeySource in a single module (e.g. stellar-cli/strkeys.ts) and re-export from there.
Priority: Medium | Release impact: Patch | Breaking: No
Summary
The Stellar public-key regex
/^G[A-Z2-7]{55}$/is defined three times:contracts/resolve-method-args.ts:6(STELLAR_ADDRESS_REGEX)contracts/resolve-source-address.ts:6stellar-cli/recover-deploy-contract-id.ts:28-30(isLikelyPublicKeySource)Additionally,
contracts/validate-source-shape.ts:2importsisLikelyPublicKeySourcefrom the deploy-recovery module, coupling source validation to a recovery-specific file.Why it matters
The strkey alphabet rule is already a documented footgun (#135); three copies invite divergence, and the cross-module import is a design smell.
Suggested fix
Centralize
STELLAR_ADDRESS_REGEX/isLikelyPublicKeySourcein a single module (e.g.stellar-cli/strkeys.ts) and re-export from there.Priority: Medium | Release impact: Patch | Breaking: No