Skip to content

Commit

Permalink
feat(GET /api/state/get): add missing params
Browse files Browse the repository at this point in the history
  • Loading branch information
bludnic committed Aug 14, 2023
1 parent 0002ab9 commit 31f6665
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 43 deletions.
90 changes: 47 additions & 43 deletions specification/kvs/GetKVS/GetKVSParams.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
- name: key
in: query
required: false
schema:
type: string
example: eth:address
- name: keyIds
in: query
required: false
schema:
type: array
items:
type: string
example:
- eth:address
- doge:address
- dash:address
- btc:address
description: Array of keys, comma-separated in string format
- name: senderId
in: query
required: false
schema:
type: string
example: U14236667426471084862
- name: senderIds
in: query
required: false
schema:
type: array
items:
type: string
example:
- U3461022864428928223
- U17790659840463725618
- U43512412354440829
description: Array of ADAMANT addresses, comma-separated in string format
- name: orderBy
in: query
required: false
schema:
type: string
example: timestamp:desc
###############################
####### Common filters ########
###############################

# fromHeight
- $ref: '../../common/params/filters/fromHeight/fromHeight.yaml'
- $ref: '../../common/params/filters/fromHeight/andFromHeight.yaml'
- $ref: '../../common/params/filters/fromHeight/orFromHeight.yaml'

# toHeight
- $ref: '../../common/params/filters/toHeight/toHeight.yaml'
- $ref: '../../common/params/filters/toHeight/andToHeight.yaml'
- $ref: '../../common/params/filters/toHeight/orToHeight.yaml'

# senderId
- $ref: '../../common/params/filters/senderId/senderId.yaml'
- $ref: '../../common/params/filters/senderId/andSenderId.yaml'
- $ref: '../../common/params/filters/senderId/orSenderId.yaml'

# senderIds
- $ref: '../../common/params/filters/senderIds/senderIds.yaml'
- $ref: '../../common/params/filters/senderIds/andSenderIds.yaml'
- $ref: '../../common/params/filters/senderIds/orSenderIds.yaml'

###############################
######## Common params ########
###############################

# offset
- $ref: '../../common/params/offset.yaml'

# orderBy
- $ref: '../../common/params/orderBy.yaml'

###############################
## Endpoint specific filters ##
###############################

- $ref: './params/filters/key.yaml'
- $ref: './params/filters/keyIds.yaml'
- $ref: './params/filters/type.yaml'

###############################
### Endpoint specific params ##
###############################

- $ref: './params/limit.yaml'
7 changes: 7 additions & 0 deletions specification/kvs/GetKVS/params/filters/key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: key
in: query
required: false
schema:
type: string
example: eth:address
description: Get transactions of specified KVS key
13 changes: 13 additions & 0 deletions specification/kvs/GetKVS/params/filters/keyIds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: keyIds
in: query
required: false
schema:
type: array
items:
type: string
example:
- eth:address
- doge:address
- dash:address
- btc:address
description: Get transactions of specified KVS keys. Array of keys, comma-separated.
15 changes: 15 additions & 0 deletions specification/kvs/GetKVS/params/filters/type.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: type
in: query
description: |
When sending KVS transaction, type field of state object must be as follows:
- `0` for full re-writing of contents by specified key value
- `1` for incremental appending contents
For more details see [AIP 11: Behavior for KVS data](https://aips.adamant.im/AIPS/aip-11)
schema:
type: integer
example: 1
default: 0
enum: [1, 2]
required: false
8 changes: 8 additions & 0 deletions specification/kvs/GetKVS/params/limit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: limit
in: query
description: Limit number of transactions in the result
schema:
type: integer
example: 10
default: 100
required: false

0 comments on commit 31f6665

Please sign in to comment.