Skip to content

Commit

Permalink
docs: adjust README and v2 swagger for /names endpoint (#768)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyeshe committed Jul 5, 2022
1 parent af41a5c commit 18c6e3b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 81 deletions.
119 changes: 39 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1672,59 +1672,34 @@ $ curl -s "https://mainnet.aeternity.io/mdw/v2/names?state=active&by=name&limit=
Additionally, this endpoint allows you to filter by name owner using the query param `owned_by`:

```
$ curl -s "https://mainnet.aeternity.io/mdw/v2/names?owned_by=ak_25BWMx4An9mmQJNPSwJisiENek3bAGadze31Eetj4K4JJC8VQN" | jq '.'
$ curl -s "https://mainnet.aeternity.io/mdw/v2/names?owned_by=ak_25BWMx4An9mmQJNPSwJisiENek3bAGadze31Eetj4K4JJC8VQN&by=name" | jq '.'
{
"active": [
{
"active": true,
"hash": "nm_8oH11atX3dnEsqnhhuFzRkxVdZfkkKSKxtKZQcYFudmgqcVmT",
"auction": null,
"hash": "nm_ekASCb5VvGYg8tcdA93A4dsMRNCsBVrv8b5kozYNjr2ofBbga",
"info": {
"active_from": 162213,
"active_from": 440894,
"auction_timeout": 0,
"claims": [
4748820
23101974
],
"expire_height": 365074,
"expire_height": 630903,
"ownership": {
"current": "ak_25BWMx4An9mmQJNPSwJisiENek3bAGadze31Eetj4K4JJC8VQN",
"original": "ak_2tACpi3fVoP5kGo7aXw4riDNwifU2UR3AxxKzTs7FiCPi4iBa8"
"current": "ak_VxVK5wdL2MbRZBFi8DHfTcnz19BMKAR51iTeqY8nNRJ3b3RSq",
"original": "ak_VxVK5wdL2MbRZBFi8DHfTcnz19BMKAR51iTeqY8nNRJ3b3RSq"
},
"pointers": {
"account_pubkey": "ak_25BWMx4An9mmQJNPSwJisiENek3bAGadze31Eetj4K4JJC8VQN"
"account_pubkey": "ak_VxVK5wdL2MbRZBFi8DHfTcnz19BMKAR51iTeqY8nNRJ3b3RSq"
},
"revoke": null,
"transfers": [
15227905,
15227448
],
"transfers": [],
"updates": [
15736349,
15698826,
15662790,
15626051,
15590987,
15555002,
15518890,
15481239,
15446118,
15410282,
15374086,
15338216,
15301733,
15300975,
15265489,
15227850,
11490573,
8946568,
5770445,
5561653,
5561576,
4776331,
4771609,
4748827
23579316
]
},
"name": "0000000000000.chain",
"name": "zzzzzzzzzzzzz.chain",
"previous": [],
"status": "name"
},
Expand Down Expand Up @@ -1776,52 +1751,36 @@ Prefix searching of names is possible via `/v2/names/search` endpoint.
By default, the prefix search will find names in any of the lifecycle states - `auction`, `active`, `inactive`.

```
$ curl -s "https://mainnet.aeternity.io/mdw/names/search?prefix=xxxxxx" | jq '.'
$ curl -s "https://mainnet.aeternity.io/mdw/v2/names/search?prefix=xxxxxx" | jq '.'
[
{
"active": false,
"auction": null,
"info": {
"active_from": 80806,
"auction_timeout": 0,
"claims": [
1793852
],
"expire_height": 130806,
"ownership": {
"current": "ak_pANDBzM259a9UgZFeiCJyWjXSeRhqrBQ6UCBBeXfbCQyP33Tf",
"original": "ak_pANDBzM259a9UgZFeiCJyWjXSeRhqrBQ6UCBBeXfbCQyP33Tf"
[
{
"payload": {
"active": true,
"auction": null,
"hash": "nm_n6mE2D37D5vEbLVSwvLr7haCbKt1Rtk8vczCywMRXFss3cPLs",
"info": {
"active_from": 513559,
"auction_timeout": 0,
"claims": [
27875299
],
"expire_height": 693559,
"ownership": {
"current": "ak_2fxRQ2STRnBdhu7XR1Q7amotX7FSaC1z73bwAuJX7nf8JDQ4PS",
"original": "ak_2fxRQ2STRnBdhu7XR1Q7amotX7FSaC1z73bwAuJX7nf8JDQ4PS"
},
"pointers": {},
"revoke": null,
"transfers": [],
"updates": []
},
"name": "xxxxxxxxxxxxx.chain",
"previous": [],
"status": "name"
},
"pointers": {},
"revoke": null,
"transfers": [],
"updates": []
"type": "name"
},
"name": "xxxxxx.test",
"previous": [
{
"active_from": 23181,
"auction_timeout": 0,
"claims": [
390494
],
"expire_height": 73247,
"ownership": {
"current": "ak_pANDBzM259a9UgZFeiCJyWjXSeRhqrBQ6UCBBeXfbCQyP33Tf",
"original": "ak_pANDBzM259a9UgZFeiCJyWjXSeRhqrBQ6UCBBeXfbCQyP33Tf"
},
"pointers": {
"account_pubkey": "ak_2A8SNUmHvB7LKAN9MjTi6ebvxqo68uztCwRuJ4jM3tcVJFzs8r"
},
"revoke": null,
"transfers": [],
"updates": [
392606
]
}
],
"status": "name"
},
...
]
```
Expand Down
22 changes: 21 additions & 1 deletion priv/static/swagger_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1708,8 +1708,28 @@ paths:
description: Get multiple names.
operationId: get_names
parameters:
- name: by
in: query
description: Sorting by deactivation, activation or name
required: false
schema:
type: string
example: activation
- name: owned_by
in: query
description: Account that owns the name
required: false
schema:
type: string
example: ak_25BWMx4An9mmQJNPSwJisiENek3bAGadze31Eetj4K4JJC8VQN
- name: state
in: query
description: Activation state of the name (active or inactive)
required: false
schema:
type: string
example: inactive
- $ref: '#/components/parameters/LimitParam'
- $ref: '#/components/parameters/ScopeParam'
- $ref: '#/components/parameters/DirectionParam'
responses:
'200':
Expand Down

0 comments on commit 18c6e3b

Please sign in to comment.