OSDN Git Service

add balances api doc
authorYongfeng LI <wliyongfeng@gmail.com>
Tue, 15 May 2018 10:34:31 +0000 (18:34 +0800)
committerYongfeng LI <wliyongfeng@gmail.com>
Tue, 15 May 2018 10:34:31 +0000 (18:34 +0800)
src/api/balances.js

index 4f5bb69..e7a776a 100644 (file)
@@ -1,5 +1,40 @@
+/**
+ * Any balance on the blockchain is simply a summation of unspent outputs.
+ *
+ * @typedef {Object} Balance
+ * @global
+ *
+ * @property {Number} amount
+ * Sum of the unspent outputs.
+ *
+ * @property {String} account_alias
+ * Account alias.
+ *
+ * @property {String} account_id
+ * Account id.
+ *
+ * @property {String} asset_id
+ * Asset id.
+ *
+ * @property {String} asset_alias
+ * Asset alias.
+ *
+ * @property {Object} asset_definition
+ * Asset definition
+ */
+
+/**
+ * API for interacting with {@link Balance balances}.
+ *
+ * @module BalancesApi
+ */
 const balancesApi = (connection) => {
   return {
+    /**
+     * Get all asset balances of all accounts.
+     *
+     * @returns {Promise<Array<Balance>>} The result balances.
+     */
     list: () => connection.request('/list-balances', {})
   }
 }