Skip to content

feat(account): introduce AccountDataKey and update related exports an… - #83

Merged
N-i-xx merged 1 commit into
Vero-protocol:mainfrom
D240021:fix/issue-67-export-account-module
Aug 25, 2026
Merged

feat(account): introduce AccountDataKey and update related exports an…#83
N-i-xx merged 1 commit into
Vero-protocol:mainfrom
D240021:fix/issue-67-export-account-module

Conversation

@D240021

@D240021 D240021 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Related issue

Closes #67

Summary

The account module (loader, data, balances, types) was compiled into dist but never re-exported from the package root, so consumers of @vero-protocol/sdk could not import AccountLoader. This PR adds the root export, renames the account-side DataKey to AccountDataKey to avoid colliding with the contract storage DataKey, and adds a root-barrel regression test so future modules cannot be omitted the same way.

Changes made

  • Re-exported the account module from src/index.ts (export * from './account/index.js'), so import { AccountLoader } from '@vero-protocol/sdk' type-checks and resolves.
  • Renamed the Horizon account data-entry map from DataKey to AccountDataKey in src/account/data.ts and updated the account barrel plus local tests, leaving the protocol DataKey in src/types unchanged.
  • Added src/__tests__/index.test.ts, which imports from the package root, asserts account symbols are present, keeps DataKey and AccountDataKey distinct, and checks that every module directory is reachable from the root barrel (contract remains excluded because export * would collide on Task / Vote / SubmitResult).
  • Extended scripts/smoke-test.mjs so CJS/ESM entry points and declaration files must expose AccountLoader and AccountDataKey.
  • Documented the account module in the README implemented-modules list.

Testing performed

  • npm test — 14 suites, 192 tests passed.
  • npm run test:coverage — coverage thresholds met (stmts 93.03%, branches 84.89%, funcs 95.23%, lines 95.37%).
  • npm run typecheck — no errors.
  • npm run lint — no errors.
  • npm run build — CJS + ESM succeeded with no duplicate-export error for DataKey.
  • npm run test:package — smoke-test OK; 13 exports verified in CJS and ESM, including AccountLoader and AccountDataKey.
  • npm run size — 4.75 kB / 6.5 kB budget.
  • npm run docs — TypeDoc generated without errors.

Checklist

  • npm test passes
  • npm run typecheck reports no errors
  • npm run lint reports no errors
  • PR description links the resolved issue with Closes #<issue-number>

…d tests

- Added AccountDataKey for horizon account data-entry names to avoid naming collisions.
- Updated exports in account module and index files to reflect the new naming.
- Modified smoke tests and other related tests to use AccountDataKey instead of the previous DataKey.
- Enhanced README to document the new account module features.
@D240021
D240021 requested review from N-i-xx and N-thnI as code owners August 24, 2026 21:54
@N-i-xx
N-i-xx merged commit 8370bef into Vero-protocol:main Aug 25, 2026
3 checks passed
@N-i-xx

N-i-xx commented Aug 25, 2026

Copy link
Copy Markdown

Merged — thanks for the contribution! If you've got a moment, a rating on GrantFox helps the project.

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.

Export the account module from the package root

2 participants