Skip to content

Commit

Permalink
Merge pull request #90 from oracleNetworkProtocol/http-api
Browse files Browse the repository at this point in the history
http-api docs : prc-20 docs url bug
  • Loading branch information
seedlings-calm authored Mar 1, 2023
2 parents e977d04 + e7d96d0 commit 47599ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 32 deletions.
23 changes: 7 additions & 16 deletions docs/http-api/account_balance_prc20.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,30 @@ order: 4
`GET`

### URL
`/server/v1/account/balance/prc10`
`/server/v1/account/balance/prc20`

### Request example

```
/server/v1/account/balance/prc10?addr=gx1sqyqeef3ym6q9x7anlgxmxh6u7sjfx6ccc3d4m&denom=uplugcn
/server/v1/account/balance/prc20?addr=gx1sqyqeef3ym6q9x7anlgxmxh6u7sjfx6ccc3d4m&contract=gx1ay6eqcf0crujlkkvvzkrzd8e8fayh85yl6qgcl
```


#### Request parameters
- `addr string Required` :Address
- `denom string Required`:Currency, please fill in min_ unit in the token information to query, such as min_ unit of PC is uplugcn
- `contract string Required`: Contract address

### Return value
- `code int64 ` : 0 or field does not exist is success, others are failures
- `message string` : Response information
- `balances object` : Data returned successfully
- `denom` : Query currency
- `amount`: Balance, which is normal only after dividing decimal places
- `data float64` : Balance of


#### Return to example
```json
{
"balances": [
{
"denom": "uplugcn",
"amount": "22919755"
}
],
"pagination": {
"next_key": null,
"total": "1"
}
"code": 0,
"data": 1999,
"message": "ok"
}
```
23 changes: 7 additions & 16 deletions docs/zh/http-api/account_balance_prc20.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,29 @@ order: 4
`GET`

### URL
`/server/v1/account/balance/prc10`
`/server/v1/account/balance/prc20`

### 请求示例

```
/server/v1/account/balance/prc10?addr=gx1sqyqeef3ym6q9x7anlgxmxh6u7sjfx6ccc3d4m&denom=uplugcn
/server/v1/account/balance/prc20?addr=gx1sqyqeef3ym6q9x7anlgxmxh6u7sjfx6ccc3d4m&contract=gx1ay6eqcf0crujlkkvvzkrzd8e8fayh85yl6qgcl
```


#### 请求参数
- `addr string 必填` :地址
- `denom string 必填`:币种,请填写代币信息中的min_unit进行查询,例如pc的min_unit为uplugcn
- `contract string 必填`:合约地址

### 返回值
- `code int64 ` : 0或字段不存在为成功,其他均为失败
- `message string` : 响应信息
- `balances object` : 成功返回数据
- `denom` : 查询币种
- `amount`: 余额,需要除小数位后才是正常数值
- `balances float64` : 余额

#### 返回示例
```json
{
"balances": [
{
"denom": "uplugcn",
"amount": "22919755"
}
],
"pagination": {
"next_key": null,
"total": "1"
}
"code": 0,
"data": 1999,
"message": "ok"
}
```

0 comments on commit 47599ee

Please sign in to comment.