Giter Club home page Giter Club logo

gxs's Introduction

gxssdk(公信宝sdk) for Nodejs

❤️gxs

说明

  1. 区块链api : 提供区块链查询功能(交易、用户资料、区块信息等)
  2. 商业api : 提供商业性的查询功能(新闻、合作伙伴等)

gxssdk会不定时更新、添加功能,请放心使用,有任何疑问和问题,请提issues ~

安装

npm install gxs --save
or 
yarn add gxs

使用

const gxs = require('gxs');
const BlockAPI = gxs.BlockAPI
const BusinessAPI = gxs.BusinessAPI

async function test () {
  let news = await BusinessAPI.GetNews() //获取新闻列表
  console.log(news)
  let blockInfo = await BlockAPI.GetBlockHeight('4718752') //获取区块信息
  console.log(blockInfo) 
}

test()

API

约定: 数据均为JSON格式

BlockAPI

  • GetSupply 获取供应量

    /**
     * GetSupply 
    */
    GetSupply = function() 
    
    
  • GetBlockHeight 区块信息查询

    /**
     * GetBlockHeight
     * @params blockId 区块Id
    */
    GetBlockHeight = function(blockId) 
    
    
  • GetTransaction 交易查询

    /**
     * GetTransaction
     * @params txId 交易Id
    */
    GetTransaction = function(txId) 
    
    
  • GetAccount 账号查询

    /**
     * GetAccount
     * @params idOrName 账号的id或者名称
    */
    GetAccount = function(idOrName) 
    
    
  • GetBalance 余额查询

    /**
     * GetBalance
     * @params idOrName 账号的id或者名称
    */
    GetBalance = function(idOrName) 
    
    
  • GetUserHeader 账户头像查询

    /**
     * GetUserHeader
     * @params idOrName 账号的id或者名称
    */
    GetUserHeader = function(idOrName) 
    
    

BusinessAPI

  • GetNews 获取新闻列表

    /**
     * GetNews 
    */
    GetNews = function() 
    
    
  • GetPartners 获取合作伙伴列表

    /**
     * GetPartners 
    */
    GetPartners = function() 
    
    

TodoList

  1. 优化新闻查询,增加稳定性
  2. 添加BusinessAPI内容

gxs's People

Contributors

kelvv avatar

Stargazers

liaojian avatar Levin CG avatar Kai avatar leec avatar David Lan avatar coinevernote avatar  avatar Regnate avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

hzzouyh

gxs's Issues

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.