Libra gRPC
A lightweight JavaScript library for Libra
Node.js
To install Libra gRPC on Node.js, open your terminal and run:
npm install libra-grpc --save
Usage
var libra = ; // Init gRPC clientvar client = 'ac.testnet.libra.org:8000'; // Get account statevar params = address: Buffer;client; // If a callback is not provided, a Promise is returnedclient;
API
Get account state
Get the latest state for an account.
var params = address: Buffer;client;
Get account transaction
Get the committed transaction by account and sequence number.
var params = account: Buffer sequence_number: 1 fetch_events: true;client;
Get events
Get event by account and path.
var params = access_path: address: Buffer start_event_seq_num: 2 ascending: true limit: 10;client;
Get transactions
Get the committed transaction by range
var params = start_version: 1 limit: 10 fetch_events: true;client;
Getting help
If you believe you're experiencing a bug with or want to report incorrect documentation, open an issue on our issue tracker. For a more real-time avenue of communication, check out the Discord or Telegram servers. There you'll find community members who can help answer about development questions.
License
MIT.