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 🙏

© 2026 – Pkg Stats / Ryan Hefner

dbx-js-sdk

v1.0.8

Published

DBX Wallet JS SDK

Readme

dbx-js-sdk

DBX Wallet h5 js sdk

使用方式

  • script 引入

    <script src="path/to/dbx-js-sdk.js"></script>
  • nodejs

    // ES5
    const DBX = require('dbx-js-sdk').default;
    
    // ES6
    import DBX from 'dbx-js-sdk';
        
    DBX.ready(function() {
      DBX.getAssets({
        success: function(assets) {
          console.log(assets);
        }
      });
    });

API文档

API列表

API | 说明 :-----------------------------------------------------|:----------------------- DBX.ready | 初始化回调 DBX.back | 后退 DBX.forward | 前进 DBX.close | 关闭 DBX.reload | 重新加载 DBX.refresh | 刷新 DBX.enablePullToRefresh | 开启下拉刷新 DBX.disablePullToRefresh | 关闭下拉刷新 DBX.startPullToRefresh | 开始下拉刷新 DBX.stopPullToRefresh | 结束下拉刷新 DBX.getAccount | 获取钱包账户 DBX.getAssets | 获取当前钱包账户的资产列表 DBX.getBalance | 获取余额 DBX.getFee | 获取手续费 DBX.transaction | 发起交易

DBX.ready(CALLBACK)

初始化函数,所有的API必须在ready之后方可调用

示例

DBX.read(function() {
  DBX.getAccount({
    success: function(account) {
      console.log(account.id);
      console.log(account.name);
    }
  });
});

DBX.back()

后退。

参数说明

无参数

示例

DBX.back();

DBX.forward()

前进。

参数说明

无参数

示例

DBX.forward();

DBX.close()

关闭当前窗口。

参数说明

无参数

示例

DBX.close();

DBX.reload()

重新加载。

参数说明

无参数

示例

DBX.reload();

DBX.refresh()

刷新。

参数说明

无参数

示例

DBX.refresh();

DBX.enablePullToRefresh()

开启下拉刷新。

参数说明

无参数

示例

DBX.enablePullToRefresh();

DBX.disablePullToRefresh()

关闭下拉刷新。

参数说明

无参数

示例

DBX.disablePullToRefresh();

DBX.startPullToRefresh()

开始下拉刷新。

参数说明

无参数

示例

DBX.startPullToRefresh();

DBX.stopPullToRefresh()

结束下拉刷新。

参数说明

无参数

示例

DBX.stopPullToRefresh();

DBX.getAccount(OBJECT)

获取当前钱包账户的资产列表

OBJECT 参数说明

参数名 | 类型 | 必填 | 说明 --------|----------|------|--------------------- success | Function | 是 | 成功回调 error | Function | 否 | 失败回调(参数为错误提示)

success 返回参数

参数名 | 类型 | 说明 --------|---------|--------------------- id | String | 账户ID name | String | 账户名

示例

DBX.getAccount({
  success: function(account) {
    console.log(account.id);
    console.log(account.name);
  }
});

DBX.getAssets(OBJECT)

获取当前钱包账户的资产列表

OBJECT 参数说明

参数名 | 类型 | 必填 | 说明 --------|----------|------|--------------------- success | Function | 是 | 成功回调 error | Function | 否 | 失败回调(参数为错误提示)

示例

DBX.getAssets({
  success: function(assets) {
    console.log(assets)
  }
});

DBX.getBalance(OBJECT)

获取对应币种的余额

OBJECT 参数说明

参数名 | 类型 | 必填 | 说明 --------|----------|------|--------------------- assetId | String | 是 | 币种ID success | Function | 是 | 成功回调 error | Function | 否 | 失败回调(参数为错误提示)

示例

DBX.getBalance({
  assetId: '1.3.0',
  success: function(balance) {
    console.log(balance)
  }
});

DBX.getFee(OBJECT)

获取手续费

仅用于展示

OBJECT 参数说明

参数名 | 类型 | 必填 | 说明 --------|----------|------|--------------------- amount | Number | 是 | 金额 assetId | String | 是 | 币种ID success | Function | 是 | 成功回调 error | Function | 否 | 失败回调(参数为错误提示)

示例

DBX.getFee({
  amount: 100,
  assetId: '1.3.0',
  success: function(fee) {
    console.log(fee)
  }
});

DBX.transaction(OBJECT)

发起交易

OBJECT 参数说明

参数名 | 类型 | 必填 | 说明 --------|----------|------|--------------------- amount | Number | 是 | 交易金额 assetId | String | 是 | 币种ID target | String | 是 | 收款账户 success | Function | 是 | 成功回调 error | Function | 否 | 失败回调(参数为错误提示)

示例

DBX.transaction({
  amount: 100,
  assetId: '1.3.0',
  target: 'target',
  success: function(fee) {
    console.log(fee)
  }
});