Skip to content

Instantly share code, notes, and snippets.

@ubinix-warun
Last active July 20, 2025 15:25
Show Gist options
  • Select an option

  • Save ubinix-warun/84b398b481ebed64f5e93cb6d76c3d50 to your computer and use it in GitHub Desktop.

Select an option

Save ubinix-warun/84b398b481ebed64f5e93cb6d76c3d50 to your computer and use it in GitHub Desktop.

near-api-ts

near-api-ts is An Auto-Generated, Type-Safe TypeScript Client for the NEAR JSON-RPC API.

Bridging the gap in the NEAR ecosystem by providing a high-quality, developer-friendly, and consistently up-to-date TypeScript client, automatically generated from the official nearcore OpenAPI specification.

Weekly Breakdown

  • Weeks 1-2: Core Implementation & Workflow Automation (65%)
  • Week 3: Documentation & Repository Finalization
  • Week 4: Review, Feedback & Final Handoff

Progress

Week 2 - Workflow Automation 50%


Over the last four days, our focus has shifted to enhancing the project's long-term maintainability and reliability. We have successfully implemented an advanced automation workflow that proactively keeps the client up-to-date. This completes a significant portion of our automation goals.

Scheduled Client Generation and Testing

We've set up a new GitHub Action that runs on a nightly schedule. This automated workflow performs two key tasks:

  • It checks for any updates to the official NEAR RPC specification.
  • If changes are detected, it automatically regenerates the TypeScript client and its associated types.

Automated Pull Request Creation

After the client is regenerated, the same workflow automatically runs the entire test suite (including our integration tests) against the new code. If all tests pass, the action creates a new Pull Request with the updated client packages.

Week 1 - TypeScript RPC Client 80%


The first week of the project concluded with exceptional progress, moving faster than initially planned. We have successfully established the entire foundational infrastructure, from development and testing to automated publishing.

Key achievements this week include:

  • Foundation & Automation: A scalable monorepo was set up using Turborepo. We developed the initial client generator script, established a robust testing environment with Jest, and fully automated the generation and publishing workflows using GitHub Actions. This ensures any future updates to the NEAR API can be integrated quickly and reliably.
  • Packaging & Distribution: The project was strategically organized into two distinct packages: @near-api-ts/jsonrpc-types for the data structures and @near-api-ts/jsonrpc-client for the main client logic. Both packages have been successfully published to the public NPM registry, making them available for use.

In summary, the core technical goals for the initial phase are now complete. The project is in a strong position, with a fully automated, testable, and distributable TypeScript client ready for the next steps of documentation and refinement.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment