Skip to content

Commit

Permalink
Merge pull request Qitmeer#65 from bCoder778/master
Browse files Browse the repository at this point in the history
modify wallet api parmas
  • Loading branch information
dindinw authored Oct 12, 2021
2 parents a8dd626 + dd6b56f commit b08304f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ None
2. `SpendAmount: (numeric)` spent amount, already confirmed
3. `UnspendAmount: (numeric)` spendable amount, not including frozen amount
4. `ConfirmAmount: (numeric)` frozen amount, waiting for conformation
...
5. `LockAmount: (numeric)` locked amount, waiting for unlock
.

#### Example
##### Request
```sh
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getAccountsAndBalance","params":[],"id":1}' http://127.0.0.1:8130/api |jq .
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getAccountsAndBalance","params":["MEER"],"id":1}' http://127.0.0.1:8130/api |jq .
```
##### Response
```json
Expand All @@ -32,12 +33,14 @@ None
"result": {
"default": {
"TotalAmount": 0,
"LockAmount": 0,
"SpendAmount": 0,
"UnspendAmount": 0,
"ConfirmAmount": 0
},
"imported": {
"TotalAmount": 676444792042,
"LockAmount": 0,
"SpendAmount": 1366909827084,
"UnspendAmount": 676444792042,
"ConfirmAmount": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Get balance by account
2. `SpendAmount: (numeric)` spent amount, already confirmed
3. `UnspendAmount: (numeric)` spendable amount, not including frozen amount
4. `ConfirmAmount: (numeric)` frozen amount, waiting for conformation
5. `LockAmount: (numeric)` locked amount, waiting for unlock

#### Example
##### Request
```sh
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAccount","params":["test"],"id":1}' http://127.0.0.1:8130/api |jq .
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAccount","params":["test", "MEER"],"id":1}' http://127.0.0.1:8130/api |jq .
```
##### Response
```json
Expand All @@ -28,6 +29,7 @@ Get balance by account
"result": {
"TotalAmount": 900000000,
"SpendAmount": 0,
"LockAmount": 0,
"UnspendAmount": 900000000,
"ConfirmAmount": 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ Get balance by address
2. `SpendAmount: (numeric)` spent amount, already confirmed
3. `UnspendAmount: (numeric)` spendable amount, not including frozen amount
4. `ConfirmAmount: (numeric)` frozen amount, waiting for conformation
5. `LockAmount: (numeric)` locked amount, waiting for unlock


#### Example
##### Request
```sh
$ curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAddr","params":["TmbC1Fx1UXNt7D6zpaj83UrAEW7MbcUWuQz"],"id":1}' http://127.0.0.1:8130/api
$ curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAddr","params":["TmbC1Fx1UXNt7D6zpaj83UrAEW7MbcUWuQz", "MEER"],"id":1}' http://127.0.0.1:8130/api

```
##### Response
Expand All @@ -31,6 +32,7 @@ $ curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"j
"result": {
"TotalAmount": 900000000,
"SpendAmount": 0,
"LockAmount": 0,
"UnspendAmount": 900000000,
"ConfirmAmount": 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sends the passed amount to the given address.
### Example
#### Request
```sh
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddress","params":["Tmdcmmo7JqxxwHy6r46Sx2ZRbVF2dSjG9mm", 1 ],"id":1}' http://127.0.0.1:8130/api |jq .
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddress","params":["Tmdcmmo7JqxxwHy6r46Sx2ZRbVF2dSjG9mm", 1 , "MEER"],"id":1}' http://127.0.0.1:8130/api |jq .
```

#### Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ send passed amount using specific account
### Example
#### Request
```sh
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddressByAccount","params":["test", "Tmb1dCAB8ixNC6d2VtdCYZuhXBVPbnRVi7y", 0.999, "", ""],"id":1}' http://127.0.0.1:8130/api |jq .
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddressByAccount","params":["test", "Tmb1dCAB8ixNC6d2VtdCYZuhXBVPbnRVi7y", 0.999, "MEER", "", ""],"id":1}' http://127.0.0.1:8130/api |jq .
```
#### Response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sends multiple amounts to multiple addresses using the provided account as a sou
### Example
#### Request
```sh
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToMany","params":[{"TmVLfSPy3NZY1uDjJka92hqpPJR9k2XztQb":0.9, "TmR1kwdfb6pyQRNoJJMU2M62qEqJzqXPNBw":0.99} ],"id":1}' http://127.0.0.1:8130/api |jq .
$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToMany","params":[{"TmVLfSPy3NZY1uDjJka92hqpPJR9k2XztQb":0.9, "TmR1kwdfb6pyQRNoJJMU2M62qEqJzqXPNBw":0.99}, "MEER" ],"id":1}' http://127.0.0.1:8130/api |jq .

```

Expand Down

0 comments on commit b08304f

Please sign in to comment.