5 releases (3 breaking)

new 0.4.0 Dec 19, 2024
0.3.0 Nov 19, 2024
0.2.1 Oct 25, 2024
0.2.0 Oct 16, 2024
0.1.0 Oct 4, 2021

#9 in #user-key

Download history 2/week @ 2024-09-23 153/week @ 2024-10-14 121/week @ 2024-10-21 31/week @ 2024-10-28 113/week @ 2024-11-04 35/week @ 2024-11-11 190/week @ 2024-11-18 7/week @ 2024-11-25 10/week @ 2024-12-02 33/week @ 2024-12-09

243 downloads per month

MIT/Apache and maybe GPL-3.0-or-later

180KB
4K SLoC

near-api

The near-api is a simple Rust library that helps developers interact easily with the NEAR blockchain. The library was highly inspired by the API of the near-cli-rs library. The library extensively utilizes builder patterns, this way we guide the users through the user flow, preventing most of the errors and focusing on each step.

Currently, the library provides:

  • Account management
  • Contract deployment and interaction
  • NEAR, FT, NFT transfers
  • Storage deposit management
  • Stake management
  • Ability to create custom transactions
  • Several ways to sign transactions (SecretKey, Seedphrase, File, Ledger, Secure keychain).
  • Account key pool support to sign transaction with different user keys to avoid nonce issues.

Current issues

The library is already usable and might be used for rapid prototyping, it lacks some points to make it production-ready:

  • documentation + examples
  • integration tests for all API calls
  • CI
  • anyhow -> thiserror
  • ledger is blocking and it's not good in the async runtime
  • secure keychain is not that straightforward to use
  • storage deposit manager for FT calls
  • basic logging with tracing for querying/signing/sending transactions

Examples

The crate provides examples that contain detailed information on using the library.

Dependencies

~30–54MB
~841K SLoC