Skip to content

feat(sdk): build validation, unit tests, and npm publish prep #20

@Depo-dev

Description

@Depo-dev

Summary

The SDK has no tests and npm run build has not been validated end-to-end. This issue covers test coverage, build output verification, and npm publish readiness.

Acceptance Criteria

Build

  • npm run build produces valid dist/index.cjs, dist/index.mjs, dist/index.d.ts
  • CJS and ESM imports both work in a Node.js smoke test script

Tests (Vitest)

  • Unit test: queryEvents serialises params correctly and calls the right URL
  • Unit test: getEventById returns parsed event on 200
  • Unit test: 404 response throws TridentError with NOT_FOUND code
  • Unit test: 401 response throws TridentError with UNAUTHORIZED code
  • Mock fetch / WebSocket in tests (no real network calls)

npm publish prep

  • package.json name: @trident-indexer/sdk, version 0.1.0
  • "files" field: ["dist"]
  • README.md with install + usage example
  • npm pack dry run succeeds

Files

sdk/typescript/src/, sdk/typescript/tests/ (new), sdk/typescript/package.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase-1MVP phase 1 scopetypescriptTypeScript SDK work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions