Skip to content

feat: implement v1 SDK#1

Merged
posokhin merged 12 commits intomainfrom
feature/implementV1
Mar 4, 2026
Merged

feat: implement v1 SDK#1
posokhin merged 12 commits intomainfrom
feature/implementV1

Conversation

@posokhin
Copy link
Copy Markdown
Owner

@posokhin posokhin commented Mar 2, 2026

Summary

  • Implement all API methods: tokens, token supply, token requests, records, record requests, wallets
  • Add all request/response types with full JSDoc documentation
  • Fix async method return types (TokenRequestEntity/RecordRequestEntity instead of data types)
  • Remove duplicate CreateNewTokenResponse type (replaced with Token)
  • Add CLAUDE.md
  • Add Vitest test suite — 63 tests across unit, integration and error handling

Code review fixes

  • ErrorHandler.handleError annotated as : never; redundant throw removed in BaseRestClient
  • Layer4Error fields (error, statusCode, success) made optional; network errors now fall back to Axios error message instead of undefined
  • BaseRestClient HTTP methods changed from public to protected
  • Token response type no longer extends BucketId (request type); new TokenMetadata response type introduced to break request→response cross-dependency
  • payload: object replaced with Record<string, unknown> in TokenRequestEntity and RecordRequestEntity
  • removeWallet return type tightened from BaseResponse<object> to BaseResponse<Record<string, unknown>>
  • BucketId, TokenId, WalletId imports consolidated into the request barrel in Layer4ClientImpl and Layer4Client
  • Axios timeout set to 30 000 ms
  • createWallets parameter renamed from params to data for consistency with other POST methods
  • getRecordRequest and getWallet no longer send empty { params: {} }; params are only forwarded when non-empty

Test plan

  • npm test — 63/63 tests pass
  • npx tsc --noEmit — no type errors
  • npx eslint src/ — no errors
  • npm run build — CJS + ESM bundles produced cleanly

🤖 Generated with Claude Code

ton1p and others added 12 commits February 2, 2026 02:36
- Added `burnToken` method to `Layer4Client` interface and `Layer4ClientImpl`.
- Created `BurnTokenRequest` type for the new method.
- Added `AGENTS.md` with project guidelines and rules.
- Updated `.gitignore` to exclude `.roo` directory.
- Refactored JSDoc comments for better readability in several request/response types.
…ds, and token endpoints

- Add all request and response types for records, record requests, token supply, token requests, wallets
- Fix async method return types (TokenRequestEntity/RecordRequestEntity instead of data types)
- Remove CreateNewTokenResponse (duplicate of Token)
- Add CLAUDE.md and expand AGENTS.md with full API reference
- Add swagger.yaml
…ifiers

- ErrorHandler.handleError annotated as : never; redundant throw removed in BaseRestClient
- Layer4Error fields (error, statusCode, success) made optional; network errors now fall back to axios error message
- BaseRestClient HTTP methods changed from public to protected
- Token response type no longer extends BucketId (request); new TokenMetadata response type introduced
- payload: object replaced with Record<string, unknown> in TokenRequestEntity and RecordRequestEntity
- removeWallet return type tightened to BaseResponse<Record<string, unknown>>
- BucketId, TokenId, WalletId imports consolidated into request barrel across Layer4ClientImpl and Layer4Client
- Axios timeout set to 30 000 ms
- createWallets parameter renamed from params to data for consistency
- getRecordRequest and getWallet no longer pass empty { params: {} }; params only sent when non-empty
- Tests updated to reflect new behaviour and protected method access

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add tsconfig.build.json to exclude tests from declaration output
- Update rollup to use tsconfig.build.json — removes dist/types/__tests__/ from bundle
- Add exports field with correct condition order (types → import → require)
- Add sideEffects: false for tree-shaking
- Add prepublishOnly script to enforce build before publish

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers installation, quick start, full API reference for tokens, token
supply, token requests, records, record requests and wallets, error
handling, async operation pattern, supported chains, and TypeScript types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@posokhin posokhin merged commit c7a9c83 into main Mar 4, 2026
1 check 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.

2 participants