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

@xjshutu/baip-sdk-js

v1.0.31

Published

BAIP javascript sdk

Downloads

5

Readme

baip-sdk-js

应用集成平台BAIP,提供JS SDK开发接口,开发者在JS应用中通过调用JS SDK接口,进行区块链能力集成。

安装

npm install @xjshutu/baip-sdk-js

使用方法

const { Conflux } = require('baip-sdk-js');
const PRIVATE_KEY = '0xb05b55c6b7623803eb228f054574fb79fb54c2cb58d370552976fe48b1ac78e0';

const appKey = '4c6323ec72d24dd38c475719916de8e6';
const secret = '240b93c71e0f42f099b59f518b1862d9';

//初始化
const cfx = new Conflux({
    url: 'http://192.168.1.24:16666',
    contractId: '7701ce54-e02c-4236-a1c3-7d76083f3b4e',
    blockchainId: '1074998491917058048',
    appKey,
    secret
  });
//通过私钥获取用户信息
  const account = cfx.Account(PRIVATE_KEY);

  //获取合约信息同时也会获取token
  const contract = cfx.Contract();

  // 交易签名并发送签名后的交易
  const promise = await cfx.sendTransaction({
    data: contract.name().data,
    from: account,
  });
  const txHash = await promise;

API介绍

Conflux

创建Conflux 实例

参数
  • url BAIP地址
  • to 交易方地址
  • contractId 使用的合约id
  • blockchainId 使用的区块链Id
  • appKey 开发者的appKey
  • cert 开发者证书
方法
  • Account(String privateKey) 账户构造函数 传入私钥获取。
  • Contract() 返回合约信息
  • sendTransaction(data,from,...other) 签名并且发送交易信息