Repository navigation
feat(stellar): add Stellar network and account display helpers (closes #496) - #505
Merged
Lakes41 merged 1 commit intoSep 17, 2026
Conversation
Closes Adamantine-guild#496 - Define canonical StellarNetwork type ('testnet', 'public', 'futurenet', 'standalone'). - Centralize SUPPORTED_STELLAR_NETWORKS and STELLAR_NETWORK_PASSPHRASES constants. - Implement isStellarNetwork, normalizeStellarNetwork, getStellarNetworkPassphrase, and isTestNetwork helpers to distinguish mainnet and development networks. - Add truncateStellarAccountId for safe and consistent account display. - Add comprehensive Vitest unit test suite covering valid/invalid networks and accounts.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves #496 by introducing lightweight, zero-dependency Stellar network and account formatting helpers to GuildPass SDK V2.
Changes
src/stellar/network.ts:StellarNetworkunion type ('testnet' | 'public' | 'futurenet' | 'standalone').SUPPORTED_STELLAR_NETWORKSarray andSTELLAR_NETWORK_PASSPHRASESmapping.isStellarNetworktype guard.normalizeStellarNetwork(handles common aliases like"mainnet"->"public"and"local"->"standalone").getStellarNetworkPassphrasefor retrieving the standard network passphrase string.isTestNetworkfor predictably distinguishing development networks from public mainnet.src/stellar/accountId.ts:truncateStellarAccountId(account, prefixLength = 4, suffixLength = 4)for safe UI display (e.g.GAAZ...CWN7).src/stellar/index.ts:tests/stellar/network.test.ts:Verification
pnpm typecheck(tsc --noEmit): Passed with 0 errorspnpm build(tsup): ESM and DTS bundles generated successfullypnpm test(vitest): 24 test files passed, 691 tests passed, 0 failuresCloses #496