Node.js SDK for Bytom protocol
修订版 | 4d454354e6e9c91d2bcf31a2aec36d01ed0dcd30 (tree) |
---|---|
时间 | 2018-05-15 19:34:31 |
作者 | Yongfeng LI <wliyongfeng@gmai...> |
Commiter | Yongfeng LI |
add balances api doc
@@ -1,5 +1,40 @@ | ||
1 | +/** | |
2 | + * Any balance on the blockchain is simply a summation of unspent outputs. | |
3 | + * | |
4 | + * @typedef {Object} Balance | |
5 | + * @global | |
6 | + * | |
7 | + * @property {Number} amount | |
8 | + * Sum of the unspent outputs. | |
9 | + * | |
10 | + * @property {String} account_alias | |
11 | + * Account alias. | |
12 | + * | |
13 | + * @property {String} account_id | |
14 | + * Account id. | |
15 | + * | |
16 | + * @property {String} asset_id | |
17 | + * Asset id. | |
18 | + * | |
19 | + * @property {String} asset_alias | |
20 | + * Asset alias. | |
21 | + * | |
22 | + * @property {Object} asset_definition | |
23 | + * Asset definition | |
24 | + */ | |
25 | + | |
26 | +/** | |
27 | + * API for interacting with {@link Balance balances}. | |
28 | + * | |
29 | + * @module BalancesApi | |
30 | + */ | |
1 | 31 | const balancesApi = (connection) => { |
2 | 32 | return { |
33 | + /** | |
34 | + * Get all asset balances of all accounts. | |
35 | + * | |
36 | + * @returns {Promise<Array<Balance>>} The result balances. | |
37 | + */ | |
3 | 38 | list: () => connection.request('/list-balances', {}) |
4 | 39 | } |
5 | 40 | } |