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 🙏

© 2025 – Pkg Stats / Ryan Hefner

newbit-sdk

v1.3.3

Published

newbit sdk

Downloads

41

Readme

newbit-sdk

newbit sdk

Usage

NPM

$ npm install newbit-sdk --save

项目需要提前依赖jQuery.js

<head>
  <meta charset="utf-8">
  <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
import newbit from 'newbit-sdk';  //
import 'newbit-sdk/src/ newbit-sdk.css'; //load style
import 'font-awesome/css/font-awesome.min.css'; //load font-awesome

const userName = "felix1112222" //pwd asdfasdf
const lang = "zh" //zh 简中  vn 越南文
//开发环境
const dev_url = "https://dev.newotc.io"
const dev_token = "9bbe9be830b0d9d3a6cec091f3cec094"

//正式环境
const prod_url = "https://gotc.io"
const prod_token = "请公司申请"

 newbit.setCreateModal(dev_url, dev_token, (account) => {
          //返回创建成功的账号
          //这里拿到的账号只是在GOTC平台创建成功的,并没有上链
          //需要调取后台激活接口,激活后方可在链上查询
          console.log('ok--callback', account)
        }, () => {
          console.log('err--callback')
        },lang);

 newbit.setValidateModal(account,dev_url, dev_token, (account) => {
          //返回验证成功的账号
          console.log('ok--callback', account)
        }, () => {
          console.log('err--callback')
        },lang);

HTML

<!doctype html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, 
    user-scalable=no" dochead="1">

  <title>newbit</title>
  <link rel="stylesheet" href="https://unpkg.com/newbit-sdk.min.css">
  
  <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  <script src="https://unpkg.com/newbit-sdk.min.js"></script>
</head>

<body>
  <div
    style="width:300px;margin:0 auto;height: 280px;background-color: aqua;
    text-align: center;padding-top: 100px;margin-top: 20%;">
    <h2>SDK测试</h2>
    <div style="display:flex;justify-content:space-around;align-items: center;margin-top: 30px;">
      <a id="click-register"
        style="height: 45px;line-height:45px;width:30%;color:#fff;background-color: blue;border-radius: 5px;">
        创建帐号
        </a>
      <a style="height: 45px;line-height:45px;width:30%;color:#fff;background-color: green;border-radius: 5px;"
        id="click-validate">验证帐户</a>
    </div>
  </div>
  <script>
    //开发环境
    const userName = "felix1112222" //pwd asdfasdf
    var dev_url = "https://dev.newotc.io"
    var dev_token = "9bbe9be830b0d9d3a6cec091f3cec094"
    var lang = "zh" //zh 简中  vn 越南文

    $(document).ready(function () {
      $("#click-register").on("click", function (e) {
        e.preventDefault();
        newbit.setCreateModal(dev_url, dev_token, (account) => {
          //返回创建成功的账号
          //这里拿到的账号只是在GOTC平台创建成功的,并没有上链
          //需要调取后台激活接口,激活后方可在链上查询
          console.log('ok--callback', account)
        }, () => {
          console.log('err--callback')
        },lang);
      });
      $("#click-validate").on("click", function (e) {
        e.preventDefault();
        newbit.setValidateModal(userName,dev_url, dev_token, (account) => {
          //返回验证成功的账号
          console.log('ok--callback', account)
        }, () => {
          console.log('err--callback')
        },lang);
      });
    })
  </script>
</body>

</html>
        /**
         * @description 创建账号组件
         * @param {string} url - 开发/正式环境url           (必选参数)
         * @param {string} token - 公司向GOTC申请的token    (必选参数)
         * @param {function} success - 成功回调            (必选参数)
         * @param {function} error - 失败回调              (必选参数)
         * @param {string} lang - 语言                    (必选参数)
         */
        newbit.setCreateModal(url, token, success, error,lang);

必要参数

| 参数名 | 类型 | 说明 | | :-----| :-----| :----- | | url | string | 开发/正式环境url | | token | string | 公司向GOTC申请的token | | success | function | 成功回调,并且返回创建成功的账号 | | error | function | 失败回调 | | lang | string | 语言 |


        /**
         * @description 验证账号组件
         * @param {string} userName - 需要验证的帐户        (必选参数)
         * @param {string} url - 开发/正式环境url          (必选参数)
         * @param {string} token - 公司向GOTC申请的token   (必选参数)
         * @param {function} success - 成功回调           (必选参数)
         * @param {function} error - 失败回调             (必选参数)
         * @param {string} lang - 语言                    (必选参数)
         */
        newbit.setValidateModal(userName,url, token, success, error,lang);

必要参数

| 参数名 | 类型 | 说明 | | :-----| :-----| :----- | | userName | string | 需要验证的帐户 | | url | string | 开发/正式环境url | | token | string | 公司向GOTC申请的token | | success | function | 成功回调,并且返回验证成功的账号 | | error | function | 失败回调 | | lang | string | 语言 |