npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@33cn/chain33-rpc-api

v1.5.30

Published

chain33 rpc 接口封装

Downloads

149

Readme

chain33 接口调用工具

  • 封装了chain33 rpc接口除Wallet接口和挖矿接口外的所有系统接口(不兼容低于6.0.2的版本),Token和Trade系统合约接口。[2018/12/10]

  • chain33 rpc接口文档

  • http://114.55.101.159:8801 是测试链的一个节点

  • http://120.79.156.149:8801 是正式链的一个节点

开始使用

npm i @33cn/chain33-rpc-api -S

工具中不包含promise和fetch的pollyfill, 请根据使用环境自行引入

https://github.com/matthew-andrews/isomorphic-fetch

npm install --save isomorphic-fetch es6-promise

#####使用示例:获取节点的最新高度:

import BtyBaseSdk from 'chain33-rpc-api'
// 新建一个BtyBaseSdk实例,设置默认请求节点和请求错误处理函数(可选,如果不设置可以在方法返回的promise用catch捕获到错误)
let chain33Rpc = new BtyBaseSdk('https://testnet.bityuan.com/api', (error) => {
   console.log('catch error ' + error)
})
// 获取节点的最新高度
chain33Rpc.getLasterHeader().then(res => {
   if (res.error) throw new Error(res.error)
   const { height } = res.result
   console.log('height', height)
})
// 传入url参数指定请求节点
chain33Rpc.getLasterHeader('https://mainnet.bityuan.com/api').then(res => {
   if (res.error) throw new Error(res.error)
   const { height } = res.result
   console.log('height', height)
})

其它工具

  • 正式链区块链浏览器: https://mainnet.bityuan.com
  • 通用版区块链浏览器: http://parallel.bityuan.com

测试用例

  • 创建地址

    • 18jUpfSuYCk2iQu8ZqB3d6hNWNWA4ty3Xs
    • 154fdmaKJHawbKzzbXJFXN4Uq5iCHuYFgW
  • 多重签名账户地址

    • "3Ko3NXqnc7HbKVzX7CmHh1hxaT2HyyGb6k",
    • "3N6xUeeo2CghiYhGZNeVfGs4ZVU7Q23WQj",
    • "35bZddFf69H8h4Ww7BnZWsPtWETu5MHyBQ", (有交易)
    • "3AAmTZighdcpputVjXTeTL7co27vfVyBLy",
    • "3DiR3zRtTRjJqxHdsGEob7zUor9qvSZaES" (有交易)
  • owner地址

    • "1QqKdsXqX8movNcMVQWibyxArMf56iaE1"
    • "1UXJBrGKBEbVAqThg6ZhhRNVxgpw19FQ8"
  • 多重签名下交易hash

    • "1e306aa0a2cf0467a8beea3d7b24efba11261e8dfa6be5c998bb740142d0cbde"
    • "e14bcb5e1e5a1fe52c6181330480a49508f30aa46f41cd8741295e947b48bded"