An open API service indexing awesome lists of open source software.

https://github.com/kelvv/gxs

gxs sdk for nodejs
https://github.com/kelvv/gxs

block gxs node

Last synced: 6 months ago
JSON representation

gxs sdk for nodejs

Awesome Lists containing this project

README

          

# gxssdk(公信宝sdk) for Nodejs

❤️gxs

## 说明

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

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

## 安装
```bash
npm install gxs --save
or
yarn add gxs
```

## 使用
``` javascript
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内容