@hristolimechain.near [Posted on DevHub](/devgovgigs.near/widget/Post?id=2765) ## Solution: Near-api-js improvements phase 2 ###### Requested amount: 50000 USDT ###### Requested sponsor: @neardevdao.near ###### Requested amount: 50000 USDT paid in NEAR ###### Requested sponsor: @neardevgov.near **About us:** LimeChain is a blockchain software development service company with 180+ successfully executed projects. We are a team of more than 130 enthusiasts and can proudly place ourselves among the prominent builders of Web3, constantly seeking ways to innovate and revolutionize the ecosystem. We are blockchain agnostic and our long-term goal is to further expand our heavy-lifting experience in core protocol development across the leading blockchain networks, such as NEAR. We already successfully made our first two contributions within the NEAR ecosystem by implementing [Local execution of view calls](https://near.social/devgovgigs.near/widget/gigs-board.pages.Post?id=455) and [NAJ Improvements](https://near.social/devhub.near/widget/app?page=post&id=1749). ## **Proposition: NAJ improvements Phase 2** [NAJ (near-api-js)](https://github.com/near/near-api-js) serves as the backbone of most NEAR dApps, making it vital to have a dedicated developer team to ensure its continued success. The initial set of tasks aimed to groom existing GitHub Issues and PRs, working on outstanding ones, and improving documentation. For this phase, our team proposes to continue working on issues and PRs and put emphasis on security and Developer Experience (DX), as well as on creating beginner-friendly templates for interacting with NAJ. LimeChain is committed to assuming long-term responsibility for the ongoing maintenance of this project. ## **Proposal Benefits** Our proposed milestones offer several key benefits. Milestone 1 focuses on further improving NAJ's: - Security - Reliability - Bundle size - Developer Experience (DX) - Features Milestone 2 focuses on creating templates for other front-end frameworks to encourage users from different ecosystems to take the step and try out Near. The frameworks we have in mind are: - Angular - Vue ## **Development roadmap** ### **Milestone 1. NAJ Improvements (8 weeks)** **Error handling & Reliability** - Improve error handling. - Implement structured error handling (as mentioned in [this TODO](https://github.com/LimeChain/near-api-js/blob/master/packages/providers/src/json-rpc-provider.ts#L362-L363)). - Improve error handling in JsonRpcProvider based on [this PR](https://github.com/near/near-api-js/pull/1028). - Configure NAJ to run tests in the browser environment (instead of or together with Node). - Catches JS runtime-related bugs. - Increase code coverage with more unit tests. **Security & Bundle size** - Integrate [LavaMoat](https://github.com/LavaMoat/LavaMoat) to increase resilience against supply chain attacks. - Replace `AJV` with `superstruct` (or another library). - `AJV` is currently the largest dependency (around 30% of the bundle size) and can be replaced with a 90% smaller library. **Features & DX** - Reimplement wallet sign-in callbacks based on [this PR](https://github.com/near/near-api-js/pull/1025) - Reimplement export more TypeScript types at package root level based on [this PR](https://github.com/near/near-api-js/issues/590) - Add support for `secp256k1` keys using the newly integrated [noble/curves](https://github.com/paulmillr/noble-curves) library inside NAJ - Bundle size won't be affected, in contrast to [the currently open PR](https://github.com/near/near-api-js/pull/985). ### **Milestone 2. Developer Guides (4 weeks)** - Create NAJ dapp template using Angular. - Create NAJ dapp template using Vue. - Upload templates to GitHub. - Link templates to NAJ README. ## **Project Timeline** The timeline for completing these activities would be 12 weeks. ## **Team setup** - 1 Full-time Senior Blockchain Developer - 1 Part-time Blockchain Architect - 1 Part-time Project Manager