Skip to content

Commit

Permalink
Merge pull request #13 from Adamant-im/fix/minor-fixes
Browse files Browse the repository at this point in the history
Fix/minor fixes
  • Loading branch information
bludnic authored Sep 9, 2023
2 parents 9e4da35 + 01f9608 commit ae55fe0
Show file tree
Hide file tree
Showing 92 changed files with 923 additions and 100 deletions.
6 changes: 3 additions & 3 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
<title>ADAMANT OpenAPI Specification</title>
<link
rel="stylesheet"
href="https://unpkg.com/swagger-ui-dist@4.15.2/swagger-ui.css"
href="https://unpkg.com/swagger-ui-dist@5.3.1/swagger-ui.css"
/>
</head>
<body>
<div id="swagger-ui"></div>
<script
src="https://unpkg.com/swagger-ui-dist@4.15.2/swagger-ui-bundle.js"
src="https://unpkg.com/swagger-ui-dist@5.3.1/swagger-ui-bundle.js"
crossorigin
></script>
<script
src="https://unpkg.com/swagger-ui-dist@4.15.2/swagger-ui-standalone-preset.js"
src="https://unpkg.com/swagger-ui-dist@5.3.1/swagger-ui-standalone-preset.js"
crossorigin
></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@
- name: limit
in: query
description: Limit number of messages.
default: 100
required: false
schema:
type: integer
format: int32
maximum: 100
default: 100
- name: offset
in: query
description: Skips **n** messages. Used for pagination
default: 0
required: false
schema:
type: integer
format: int32
default: 0
- name: orderBy
in: query
description: Order by field
required: false
default: timestamp:desc
schema:
type: string
example: timestamp:desc
default: timestamp:desc
- name: type
in: query
description: Filter by `asset.chat.type`. See [Message Types](https://github.com/Adamant-im/adamant/wiki/Message-Types)
Expand Down
47 changes: 47 additions & 0 deletions specification/chats/GetChatRooms/GetChatRoomsParams.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,54 @@
###############################
######## Path params ##########
###############################

- name: address
in: path
description: ADAMANT address
required: true
schema:
type: string
example: U839357947177758191

###############################
####### Common filters ########
###############################

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

# recipientId
- $ref: '../../common/params/filters/recipientId/recipientId.yaml'
- $ref: '../../common/params/filters/recipientId/andRecipientId.yaml'
- $ref: '../../common/params/filters/recipientId/orRecipientId.yaml'

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

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

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

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

# userId
- $ref: './params/filters/userId/userId.yaml'
- $ref: './params/filters/userId/andUserId.yaml'
- $ref: './params/filters/userId/orUserId.yaml'

# withoutDirectTransfers
- $ref: './params/filters/withoutDirectTransfers/withoutDirectTransfers.yaml'

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

# limit
- $ref: './params/limit.yaml'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: and:userId
in: query
description: |
Filter by senderId/recipientId (`and` operator).
The query will look like `tx.senderId = {userId} OR tx.recipientId = {userId}`.
schema:
type: string
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: or:userId
in: query
description: |
Filter by senderId/recipientId (`or` operator).
The query will look like `tx.senderId = {userId} OR tx.recipientId = {userId}`.
schema:
type: string
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: userId
in: query
description: |
Filter by senderId/recipientId.
The query will look like `tx.senderId = {userId} OR tx.recipientId = {userId}`.
schema:
type: string
example: U14236667426471084862
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: withoutDirectTransfers
in: query
description: When set to `true`, excludes type `0` transactions (direct token transfers) from results. Default is `false`.
schema:
type: boolean
default: false
required: false
8 changes: 8 additions & 0 deletions specification/chats/GetChatRooms/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: 25
required: false
Original file line number Diff line number Diff line change
@@ -1,21 +1,50 @@
- name: address
in: query
description: ADAMANT address
required: true
schema:
type: string
example: U839357947177758191
- name: orderBy
in: query
description: Order by field
required: false
schema:
type: string
example: timestamp:desc
- name: fromHeight
in: query
description: Filter transactions starting from specified block `height`
required: false
schema:
type: number
example: 6184187
###############################
####### 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'

# recipientId
- $ref: '../../common/params/filters/recipientId/recipientId.yaml'
- $ref: '../../common/params/filters/recipientId/andRecipientId.yaml'
- $ref: '../../common/params/filters/recipientId/orRecipientId.yaml'

# inId
- $ref: '../../common/params/filters/inId/inId.yaml'
- $ref: '../../common/params/filters/inId/andInId.yaml'
- $ref: '../../common/params/filters/inId/orInId.yaml'

# type
- $ref: '../../common/params/filters/messageType/type.yaml'
- $ref: '../../common/params/filters/messageType/andType.yaml'
- $ref: '../../common/params/filters/messageType/orType.yaml'

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

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

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

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

# limit
- $ref: './params/limit.yaml'
8 changes: 8 additions & 0 deletions specification/chats/GetChatTransactions/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
6 changes: 6 additions & 0 deletions specification/common/params/filters/blockId/andBlockId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: and:blockId
in: query
description: Filter by specific block (`and` condition)
schema:
type: number
required: false
7 changes: 7 additions & 0 deletions specification/common/params/filters/blockId/blockId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: blockId
in: query
description: Filter by specific block
schema:
type: number
example: 7917597195203393333
required: false
6 changes: 6 additions & 0 deletions specification/common/params/filters/blockId/orBlockId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: or:blockId
in: query
description: Filter by specific block (`or` condition)
schema:
type: number
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: and:fromHeight
in: query
description: Filter starting from specific height (`and` operator)
schema:
type: integer
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: fromHeight
in: query
description: Filter starting from specific `height`
schema:
type: integer
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: or:fromHeight
in: query
description: Filter starting from specific height (`or` operator)
schema:
type: integer
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: and:fromTimestamp
in: query
description: Filter by timestamp (`and` operator)
schema:
type: number
example: 37059538
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: fromTimestamp
in: query
description: Filter by timestamp
schema:
type: number
example: 37059538
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: or:fromTimestamp
in: query
description: Filter by timestamp (`or` operator)
schema:
type: number
example: 37059538
required: false
6 changes: 6 additions & 0 deletions specification/common/params/filters/inId/andInId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: and:inId
in: query
description: Filter by recipientId/senderId `("recipientId" = ${inId} OR "senderId" = ${inId})` with `and` operator
schema:
type: string
required: false
7 changes: 7 additions & 0 deletions specification/common/params/filters/inId/inId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: inId
in: query
description: Filter by recipientId/senderId `("recipientId" = ${inId} OR "senderId" = ${inId})`
schema:
type: string
example: U14236667426471084862
required: false
6 changes: 6 additions & 0 deletions specification/common/params/filters/inId/orInId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: or:inId
in: query
description: Filter by recipientId/senderId `("recipientId" = ${inId} OR "senderId" = ${inId})` with `or` operator
schema:
type: string
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: and:maxAmount
in: query
description: |
Filter results with `amount` not more than specified Integer value of 1/10^8 tokens (1 ADM = 100000000).
schema:
type: integer
required: false
8 changes: 8 additions & 0 deletions specification/common/params/filters/maxAmount/maxAmount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: maxAmount
in: query
description: |
Filter results with `amount` not more than specified Integer value of 1/10^8 tokens (1 ADM = 100000000).
schema:
type: integer
example: 50000000
required: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: or:maxAmount
in: query
description: |
Filter results with `amount` not more than specified Integer value of 1/10^8 tokens (1 ADM = 100000000).
schema:
type: integer
required: false
6 changes: 6 additions & 0 deletions specification/common/params/filters/maxFee/andMaxFee.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: and:maxFee
in: query
description: Filter by `fee` (`and` operator)
schema:
type: integer
required: false
7 changes: 7 additions & 0 deletions specification/common/params/filters/maxFee/maxFee.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: maxFee
in: query
description: Filter by `fee`
schema:
type: integer
example: 100000
required: false
6 changes: 6 additions & 0 deletions specification/common/params/filters/maxFee/orMaxFee.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: or:maxFee
in: query
description: Filter by `fee` (`or` operator)
schema:
type: integer
required: false
8 changes: 8 additions & 0 deletions specification/common/params/filters/messageType/andType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: and:type
in: query
description: |
Get messages of specified type. See [Message Types](https://github.com/Adamant-im/adamant/wiki/Message-Types).
If `type` is not set, all types of transactions will be returned.
schema:
type: integer
required: false
8 changes: 8 additions & 0 deletions specification/common/params/filters/messageType/orType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: or:type
in: query
description: |
Get messages of specified type. See [Message Types](https://github.com/Adamant-im/adamant/wiki/Message-Types).
If `type` is not set, all types of transactions will be returned.
schema:
type: integer
required: false
9 changes: 9 additions & 0 deletions specification/common/params/filters/messageType/type.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: type
in: query
description: |
Get messages of specified type. See [Message Types](https://github.com/Adamant-im/adamant/wiki/Message-Types).
If `type` is not set, all types of transactions will be returned.
schema:
type: integer
example: 2
required: false
Loading

0 comments on commit ae55fe0

Please sign in to comment.