Skip to content

feat(sdk,shared): add SDK README usage example and network/address helpers - #20

Merged
Mona-i merged 1 commit into
lumio-network:mainfrom
starfishkrq:feature/10-11-sdk-readme-and-network-helpers
Sep 10, 2026
Merged

Mona-i merged 1 commit into
lumio-network:mainfrom
starfishkrq:feature/10-11-sdk-readme-and-network-helpers

Conversation

@starfishkrq

Copy link
Copy Markdown
Contributor

Summary

closes #10
closes #11


Issue #10docs(sdk): add packages/sdk/README.md usage example

  • Full LumioClient construction example using NETWORKS.testnet and a ContractIds map (mirrors the real shape from sdk.test.ts)
  • Read methods section showing mock return values for all four clients
  • Write methods section showing NotImplementedError handling
  • Individual contract client direct-use example
  • Types section documenting @lumio/shared re-exports
  • Scaffold/stub caveat stated prominently at the top
  • Root README.md package table now links to packages/sdk/README.md, packages/shared/README.md, and packages/ui/README.md

Issue #11feat(shared): add getNetwork() and isValidAddress()

packages/shared/src/utils.ts

  • getNetwork(name: NetworkName): NetworkConfig — resolves a well-known network config by name
  • isValidAddress(value: string): boolean — lightweight format guard for Stellar strkeys (56 chars, G/C prefix, base32 A–Z/2–7 charset); documents that it is a shape check only, not a checksum or on-chain verification

Both functions are automatically exported via the existing export * from "./utils" in index.ts.

packages/shared/src/utils.test.ts

  • 4 tests for getNetwork (testnet/futurenet/mainnet configs, same reference as NETWORKS)
  • 7 tests for isValidAddress (valid G and C keys, too short, too long, wrong prefix, non-base32 chars, empty string)

Validation

  • pnpm lint
  • pnpm typecheck
  • pnpm build
  • pnpm test ✅ — 36 tests in @lumio/shared (up from 25), all passing

…lpers

Issue lumio-network#10 — add packages/sdk/README.md usage example:
- Full LumioClient construction example using NETWORKS.testnet and a
  ContractIds map, mirroring the shape from sdk.test.ts
- Shows read methods (mock return values) and write methods (NotImplementedError)
- Documents individual client exports and @lumio/shared type re-exports
- States scaffold/stub caveat prominently
- Links README from root README.md package table (also links shared + ui)

Issue lumio-network#11 — add getNetwork() and isValidAddress() to @lumio/shared:
- getNetwork(name: NetworkName): NetworkConfig — resolves a config by name
- isValidAddress(value: string): boolean — format guard for Stellar strkeys
  (56 chars, G/C prefix, base32 A-Z/2-7 charset); documents shape-check limitation
- Both functions exported via existing index re-export (export * from './utils')
- Updated import in utils.ts to bring in NetworkConfig, NetworkName, NETWORKS
- Added 11 new tests (4 getNetwork + 7 isValidAddress); all 36 pass
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 000ec218-019e-4cad-bf51-02bafa81639c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Mona-i
Mona-i merged commit 8be0a0b into lumio-network:main Sep 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(shared): add getNetwork() and an isValidAddress() format guard docs(sdk): add a package README with a LumioClient usage example

2 participants