0.1.1 • Published 3 years ago

aleo-js-sdk v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Aleo Client Javascript SDK

This is a NodeJS client SDK that allows you to interact with the public rpc endpoints and private rpc endpoints of Aleo network. The project is developed using typescript.

Install

yarn add aleo-js-sdk
# or with npm:
npm install --save aleo-js-sdk

Usage

Typescript:

import { AleoClient, AleoAuthClient } from 'aleo-js-sdk';
//public rpc
const aleoClient = new AleoClient('http://127.0.0.1:3030/');
//private rpc
const aleoAuthClient = new AleoAuthClient(
  'http://127.0.0.1:3030/',
  'username',
  'password'
);

const transaction_id = 'xxxxxxx';
aleoClient.get_transaction_info(transaction_id).then(console.log);

aleoAuthClient.create_account().then(console.log);

NodeJS:

const { AleoClient, AleoAuthClient } = require('aleo-js-sdk');
//public rpc
const aleoClient = new AleoClient('http://127.0.0.1:3030/');
//private rpc
const aleoAuthClient = new AleoAuthClient(
  'http://127.0.0.1:3030/',
  'username',
  'password'
);

const transaction_id = 'xxxxxxx';
aleoClient.get_transaction_info(transaction_id).then(console.log);

aleoAuthClient.create_account().then(console.log);

API Reference