OSDN Git Service

add number to index.md
[bytom/bytom-java-sdk.git] / doc / index.md
index 1dabefd..4e9c657 100644 (file)
@@ -122,13 +122,12 @@ Transaction.SubmitResponse txs = Transaction.submit(client, singer);
 * [`Wallet API`](#wallet-api)
 * [`Access Token API`](#access-token-api)
 * [`Block API`](#block-api)
-* [`Mining API`](#mining-api)
 * [`Other API`](#other-api)
 
 ## Key API
 
 
-#### createKey
+#### 1.createKey
 
 ```java
 Key create(Client client, Builder builder);
@@ -145,7 +144,7 @@ Key create(Client client, Builder builder);
 
 ----
 
-#### listKeys
+#### 2.listKeys
 
 ```java
 List<Key> list(Client client);
@@ -161,7 +160,7 @@ List<Key> list(Client client);
 
 ----
 
-#### deleteKey
+#### 3.deleteKey
 
 ```java
 void delete(Client client, String xpub, String password);
@@ -179,7 +178,7 @@ none if the key is deleted successfully.
 
 ----
 
-#### resetKeyPassword
+#### 4.resetKeyPassword
 
 ```java
 void resetPwd(Client client, String xpub, String oldPwd, String newPwd);
@@ -200,7 +199,7 @@ none if the key password is reset successfully.
 ## Account API
 
 
-#### createAccount
+#### 1.createAccount
 
 ```java
 Account create(Client client, Builder builder);
@@ -216,7 +215,7 @@ Account create(Client client, Builder builder);
 
 ----
 
-#### listAccounts
+#### 2.listAccounts
 
 ```java
 List<Account> list(Client client);
@@ -232,7 +231,7 @@ List<Account> list(Client client);
 
 ----
 
-#### deleteAccount
+#### 3.deleteAccount
 
 ```java
 void delete(Client client, String account_info);
@@ -249,7 +248,7 @@ none if the account is deleted successfully.
 
 ----
 
-#### createAccountReceiver
+#### 4.createAccountReceiver
 
 ```java
 Receiver create(Client client);
@@ -266,7 +265,7 @@ Receiver create(Client client);
 
 ----
 
-#### listAddresses
+#### 5.listAddresses
 
 ```java
 List<Address> list(Client client);
@@ -282,7 +281,7 @@ List<Address> list(Client client);
 
 ----
 
-#### validateAddress
+#### 6.validateAddress
 
 ```java
 Address validate(Client client, String address);
@@ -301,7 +300,7 @@ Address validate(Client client, String address);
 ## Asset API
 
 
-#### createAsset
+#### 1.createAsset
 
 ```java
 Asset create(Client client);
@@ -317,7 +316,7 @@ Asset create(Client client);
 
 ----
 
-#### getAsset
+#### 2.getAsset
 
 ```java
 Asset get(Client client);
@@ -333,7 +332,7 @@ Asset get(Client client);
 
 ----
 
-#### listAssets
+#### 3.listAssets
 
 ```java
 List<Asset> list(Client client);
@@ -349,7 +348,7 @@ List<Asset> list(Client client);
 
 ----
 
-#### updateAssetAlias
+#### 4.updateAssetAlias
 
 ```java
 void update(Client client);
@@ -365,7 +364,7 @@ none if the asset alias is updated success.
 
 ----
 
-#### listBalances
+#### 5.listBalances
 
 ```java
 List<Balance> list(Client client);
@@ -381,7 +380,7 @@ List<Balance> list(Client client);
 
 ----
 
-#### listUnspentOutPuts
+#### 6.listUnspentOutPuts
 
 ```java
 List<UnspentOutput> list(Client client);
@@ -399,7 +398,7 @@ List<UnspentOutput> list(Client client);
 ## Transaction API
 
 
-#### buildTransaction
+#### 1.buildTransaction
 
 ```java
 Template build(Client client);
@@ -415,7 +414,7 @@ Template build(Client client);
 
 ----
 
-#### signTransaction
+#### 2.signTransaction
 
 ```java
 Template sign(Client client, Template template, String password);
@@ -435,7 +434,7 @@ Template sign(Client client, Template template, String password);
 
 ----
 
-#### submitTransaction
+#### 3.submitTransaction
 
 ```java
 SubmitResponse submit(Client client, Template template);
@@ -452,7 +451,7 @@ SubmitResponse submit(Client client, Template template);
 
 ----
 
-#### estimateTransactionGas
+#### 4.estimateTransactionGas
 
 ```java
 TransactionGas estimateGas(Client client, Template template);
@@ -469,7 +468,7 @@ TransactionGas estimateGas(Client client, Template template);
 
 ----
 
-#### getTransaction
+#### 5.getTransaction
 
 ```java
 Transaction get(Client client);
@@ -485,7 +484,7 @@ Transaction get(Client client);
 
 ----
 
-#### listTransactions
+#### 6.listTransactions
 
 ```java
 List<Transaction> list(Client client);
@@ -499,10 +498,65 @@ List<Transaction> list(Client client);
 
 - `List of Transaction`, *List<Transaction>*, an ArrayList object contains Transaction objects.
 
+##### Example
+
+```java
+//list all transactions
+List<Transaction> transactionList = new Transaction.QueryBuilder().list(client);
+```
+
+----
+
+#### 7.listTransactionsById
+
+```java
+List<Transaction> listById(Client client);
+```
+
+##### Parameters
+
+- `Client` - *Client*, Client object that makes requests to the core.
+
+##### Returns
+
+- `List of Transaction`, *List<Transaction>*, an ArrayList object contains Transaction objects.
+
+##### Example
+
+```java
+String tx_id = "f04d4d9b2580ff6496f9f08d903de5a2365975fb8d65b66ca4259f152c5dd134";
+//list all transactions by tx_id
+List<Transaction> transactionList = new Transaction.QueryBuilder().setTxId(tx_id).list(client);
+```
+
+----
+
+#### 8.listTransactionsByAccountId
+
+```java
+List<Transaction> listByAccountId(Client client);
+```
+
+##### Parameters
+
+- `Client` - *Client*, Client object that makes requests to the core.
+
+##### Returns
+
+- `List of Transaction`, *List<Transaction>*, an ArrayList object contains Transaction objects.
+
+##### Example
+
+```java
+String account_id = "0E6KP8C100A02";
+//list all transactions by account_id
+List<Transaction> transactionList = new Transaction.QueryBuilder().setAccountId(account_id).list(client);
+```
+
 ## Wallet API
 
 
-#### backupWallet
+#### 1.backupWallet
 
 ```java
 Wallet backupWallet(Client client);
@@ -518,7 +572,7 @@ Wallet backupWallet(Client client);
 
 ----
 
-#### restoreWallet
+#### 2.restoreWallet
 
 ```java
 void restoreWallet(Client client ,Object accountImage, Object assetImage , Object keyImages);
@@ -549,7 +603,7 @@ String secret = "5e37378eb59de6b10e60f2247ebf71c4955002e75e0cd31ede3bf48813a0a79
 AccessToken.check(client, "sheng", secret);
 ```
 
-#### createAccessToken
+#### 1.createAccessToken
 
 ```java
 AccessToken create(Client client);
@@ -565,7 +619,7 @@ AccessToken create(Client client);
 
 ----
 
-#### listAccessTokens
+#### 2.listAccessTokens
 
 ```java
 List<AccessToken> list(Client client);
@@ -581,7 +635,7 @@ List<AccessToken> list(Client client);
 
 ----
 
-#### deleteAccessToken
+#### 3.deleteAccessToken
 
 ```java
 void delete(Client client, String id);
@@ -598,7 +652,7 @@ none if the access token is deleted successfully.
 
 ----
 
-#### checkAccessToken
+#### 4.checkAccessToken
 
 ```java
 void check(Client client, String id, String secret);
@@ -618,7 +672,7 @@ none if the access token is checked valid.
 ## Block API
 
 
-#### getBlockCount
+#### 1.getBlockCount
 
 ```java
 Integer getBlockCount(Client client);
@@ -634,7 +688,7 @@ none
 
 ----
 
-#### getBlockHash
+#### 2.getBlockHash
 
 ```java
 String getBlockHash(Client client);
@@ -650,8 +704,8 @@ none
 
 ----
 
-#### getBlock
-```php
+#### 3.getBlock
+```java
 Block getBlock(Client client);
 ```
 
@@ -665,7 +719,7 @@ Block getBlock(Client client);
 
 ----
 
-#### getBlockHeader
+#### 4.getBlockHeader
 
 ```java
 BlockHeader getBlockHeader(Client client);
@@ -681,7 +735,7 @@ BlockHeader getBlockHeader(Client client);
 
 ----
 
-#### getDifficulty
+#### 5.getDifficulty
 
 ```java
 BlockDifficulty getBlockDifficulty(Client client);
@@ -697,7 +751,7 @@ BlockDifficulty getBlockDifficulty(Client client);
 
 ----
 
-#### getHashRate
+#### 6.getHashRate
 
 ```java
 BlockHashRate getHashRate(Client client);
@@ -711,41 +765,11 @@ BlockHashRate getHashRate(Client client);
 
 - `BlockHashRate` - *blockHashRate*, a BlockHashRate object
 
-## Mining API
-
-
-#### isMining
-
-```java
-Boolean isMining(Client client);
-```
-
-##### Parameters
-
-- `Client` - *Client*, Client object that makes requests to the core.
-
-##### Returns
-
-- `Boolean` - *is_mining*, whether the node is mining.
-
-----
-
-#### setMining
-
-```java
-void setMining(Client client, Boolean isMining);
-```
-
-##### Parameters
-
-- `Client` - *Client*, Client object that makes requests to the core.
-- `Boolean` - *is_mining*, whether the node is mining.
-
 
 ## Other API
 
 
-#### netInfo
+#### 1.netInfo
 
 ```java
 NetInfo getNetInfo(Client client);
@@ -761,7 +785,7 @@ NetInfo getNetInfo(Client client);
 
 ----
 
-#### gasRate
+#### 2.gasRate
 
 ```java
 Gas gasRate(Client client);
@@ -777,7 +801,7 @@ Gas gasRate(Client client);
 
 ----
 
-#### verifyMessage
+#### 3.verifyMessage
 
 ```java
 Boolean verifyMessage(Client client);
@@ -791,35 +815,3 @@ Boolean verifyMessage(Client client);
 
 - `Boolean` - *result*, verify result.
 
-----
-
-#### getWork
-
-```java
-MinerWork getWork(Client client);
-```
-
-##### Parameters
-
-- `Client` - *Client*, Client object that makes requests to the core.
-
-##### Returns
-
-- `MinerWork` - *minerWork*, a MinerWork object.
-
-----
-
-#### submitWork
-
-```java
-void submiWork(Client client, String blockHeader);
-```
-
-##### Parameters
-
-- `Client` - *Client*, Client object that makes requests to the core.
-- `String` - *block_header*, raw block header.
-
-##### Returns
-
-none if the work is submitted successfully.