OSDN Git Service

improve apis name
authorYongfeng LI <wliyongfeng@gmail.com>
Mon, 14 May 2018 11:17:14 +0000 (19:17 +0800)
committerYongfeng LI <wliyongfeng@gmail.com>
Mon, 14 May 2018 11:17:14 +0000 (19:17 +0800)
src/api/accounts.js
src/api/assets.js
src/api/balances.js
src/api/keys.js
src/api/transactions.js
src/client.js

index 8df5446..624fd7f 100644 (file)
@@ -24,7 +24,7 @@
  *
  * @module AccountsApi
  */
-const AccountsApi = (connection) => {
+const accountsApi = (connection) => {
   /**
    * @typedef {String[]} xpubs
    * The list of keys used to create control programs under the account.
@@ -91,4 +91,4 @@ const AccountsApi = (connection) => {
   }
 }
 
-export default AccountsApi
+export default accountsApi
index 19558a8..10e2256 100644 (file)
@@ -35,7 +35,7 @@
  *
  * @module AssetsApi
  */
-const AssetsApi = (connection) => {
+const assetsApi = (connection) => {
   /**
    * @typedef {String[]} xpubs
    * The list of keys used to issue units of the asset.
@@ -104,4 +104,4 @@ const AssetsApi = (connection) => {
   }
 }
 
-export default AssetsApi
+export default assetsApi
index 2eb7431..4f5bb69 100644 (file)
@@ -1,7 +1,7 @@
-const BalancesApi = (connection) => {
+const balancesApi = (connection) => {
   return {
     list: () => connection.request('/list-balances', {})
   }
 }
 
-export default BalancesApi
+export default balancesApi
index 63d5f20..285931c 100644 (file)
@@ -1,4 +1,4 @@
-const KeysApi = connection => {
+const keysApi = connection => {
   return {
     create: (alias, password) => connection.request('/create-key', {alias, password}),
     list: () => connection.request('/list-keys'),
@@ -11,4 +11,4 @@ const KeysApi = connection => {
   }
 }
 
-export default KeysApi
+export default keysApi
index 773c484..551df87 100644 (file)
@@ -1,4 +1,4 @@
-const TransactionsApi = connection => {
+const transactionsApi = connection => {
   return {
     build: (baseTransaction = null, actions, ttl = 0) => connection.request('/build-transaction', {
       base_transaction: baseTransaction,
@@ -22,4 +22,4 @@ const TransactionsApi = connection => {
   }
 }
 
-export default TransactionsApi
+export default transactionsApi
index bfe1f95..e8e5d14 100644 (file)
@@ -1,20 +1,20 @@
 import Connection from 'connection'
-import AccountsApi from 'api/account'
-import AssetApi from 'api/assets'
-import KeysApi from 'api/keys'
-import TransactionApi from 'api/transactions'
-import BalancesApi from 'api/balances'
+import accountsApi from 'api/account'
+import assetApi from 'api/assets'
+import keysApi from 'api/keys'
+import transactionApi from 'api/transactions'
+import balancesApi from 'api/balances'
 import unspentOutputsAPI from 'api/unspentOutputs'
 
 class Client {
   constructor(baseUrl, token) {
     this.connection = new Connection(baseUrl, token)
 
-    this.accounts = new AccountsApi(this.connection)
-    this.assets = new AssetApi(this.connection)
-    this.keys = new KeysApi(this.connection)
-    this.transactions = new TransactionApi(this.connection)
-    this.balances = new BalancesApi(this.connection)
+    this.accounts = new accountsApi(this.connection)
+    this.assets = new assetApi(this.connection)
+    this.keys = new keysApi(this.connection)
+    this.transactions = new transactionApi(this.connection)
+    this.balances = new balancesApi(this.connection)
     this.unspentOutputs = new unspentOutputsAPI(this.connection)
   }
 }