Skip to content

Commit

Permalink
feat: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpiotzh committed Jul 9, 2024
1 parent 73fc6c3 commit 51c1c27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 8 additions & 4 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ batch get .bit DOBs
* host: `indexer-v1.did.id`
* path: `/v1/did/list`
* param:
* did_type:
* did_type: 0-all DOBs, 1-normal DOBs, 2-recyclable DOBs
```json
{
"type": "blockchain",
Expand All @@ -293,9 +293,7 @@ batch get .bit DOBs
"outpoint": "",
"account_id": "",
"account": "",
"args": "",
"expired_at": 0,
"did_cell_status": 1
"expired_at": 0
}
]
}
Expand All @@ -308,6 +306,12 @@ batch get .bit DOBs
curl -X POST https://indexer-v1.did.id/v1/did/list -d '{"type": "blockchain","key_info": {"coin_type": "", "key": ""},"page": 1,"size": 10,"did_type": 1}'
```

or json rpc style:

```shell
curl -X POST https://indexer-v1.did.id -d '{"jsonrpc": "2.0","id": 1,"method": "das_didCellList","params": [{"type": "blockchain","key_info": {"coin_type": "", "key": ""},"page": 1,"size": 10,"did_type": 1}]}'
```

### Get Record List

batch get account register info, currently can only check whether the account can be registered
Expand Down
20 changes: 8 additions & 12 deletions http_server/handle/did_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ type RespDidList struct {
}

type DidData struct {
Outpoint string `json:"outpoint"`
AccountId string `json:"account_id"`
Account string `json:"account"`
Args string `json:"args"`
ExpiredAt uint64 `json:"expired_at"`
DidCellStatus tables.DidCellStatus `json:"did_cell_status"`
Outpoint string `json:"outpoint"`
AccountId string `json:"account_id"`
Account string `json:"account"`
ExpiredAt uint64 `json:"expired_at"`
}

func (h *HttpHandle) JsonRpcDidList(ctx *gin.Context, p json.RawMessage, apiResp *http_api.ApiResp) {
Expand Down Expand Up @@ -97,12 +95,10 @@ func (h *HttpHandle) doDidList(ctx context.Context, req *ReqDidList, apiResp *ht
}
for _, v := range res {
temp := DidData{
Outpoint: v.Outpoint,
Account: v.Account,
AccountId: v.AccountId,
Args: v.Args,
ExpiredAt: v.ExpiredAt,
DidCellStatus: req.DidType,
Outpoint: v.Outpoint,
Account: v.Account,
AccountId: v.AccountId,
ExpiredAt: v.ExpiredAt,
}
data = append(data, temp)
}
Expand Down

0 comments on commit 51c1c27

Please sign in to comment.