Giter Club home page Giter Club logo

bcjs's Introduction

BC RPC SDK

Tests

Tests are written in Jest framework. Run them using yarn run test.

Examples

examples/get-balance.ts:

import RpcClient from '../src/client';
import {
    GetBalanceRequest
} from '@overline/proto/proto/bc_pb';

const address = process.env.BC_RPC_ADDRESS || 'https://localhost:3000'
const scookie = process.env.BC_RPC_SCOOKIE

const client = new RpcClient(address, scookie);
const req = new GetBalanceRequest();
req.setAddress('<your address>');
client.getBalance(req).then(balance => {
    console.log(balance);
})

Before running install ts-node with yarn global add ts-node

Then run like NODE_TLS_REJECT_UNAUTHORIZED=0 BC_RPC_ADDRESS=https://localhost:3001 BC_RPC_SCOOKIE=trololo ts-node examples/get-balance.ts

And you should get response similar to this:

{ confirmed: '7536',
  unconfirmed: '0',
  collateralized: '96',
  collateralizedspendable: '0',
  unit: 'nrg' }

Releasing

  • releases are done only from master branch
  • double check that CI checks ran successfully before releasing (or manually run yarn && yarn lint && yarn test && yarn compile )
  • test new release with ./node_modules/.bin/release-it --dry-run
  • if everything looks as expected, run ./node_modules/.bin/release-it

bcjs's People

Contributors

akloboucnik avatar goblueping avatar mmpmm avatar dependabot[bot] avatar

Stargazers

Nicholas Reich avatar Eman azad m avatar Halil avatar  avatar  avatar Arjun Raj Jain avatar

Watchers

 avatar James Cloos avatar Arjun Raj Jain avatar Jozef Repan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.