项目作者: near

项目描述 :
JavaScript library to interact with NEAR Protocol via RPC API
高级语言: TypeScript
项目地址: git://github.com/near/near-api-js.git
创建时间: 2019-05-04T06:33:50Z
项目社区:https://github.com/near/near-api-js

开源协议:Other

下载


NEAR JavaScript API

Build Status
Gitpod Ready-to-Code

NEAR JavaScript API is a complete library to interact with the NEAR blockchain. You can use it in the browser, or in Node.js runtime.

Documentation

Contribute to this library

  1. Install dependencies

    1. pnpm install
  2. Run continuous build with:

    1. pnpm -r compile -w

Publish

Prepare dist version by running:

  1. pnpm dist

Integration Test

Start the node by following instructions from nearcore, then

  1. pnpm test

Tests use sample contract from near-hello npm package, see https://github.com/nearprotocol/near-hello

E2E Test

From the root directory, run the following commands:

  1. cd e2e
  2. pnpm install --ignore-workspace
  3. pnpm test

The --ignore-workspace flag is required because the e2e project is intentionally excluded from the workspace.
This setup ensures that packages are installed just like a real application would — as standalone builds. Workspace linking would not allow this, as it forces symlinks instead of proper package installations.

Update error schema

Follow next steps:

  1. Optionally, set a specific hash for the commit with errors in the nearcore
  2. Fetch new schema: node fetch_error_schema.js
  3. pnpm build and pnpm test to check tests still work
  4. pnpm changeset to generate a changeset with a minor bump for the @near-js/utils package
  5. commit all changes and submit a PR on GitHub

Packages

Package Architecture in Onion Diagram

Example Templates

To help you get started quickly, we have prepared example templates for popular frameworks:

License

This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE and LICENSE-APACHE for details.