Skip to content

Commit

Permalink
Deploying to gh-pages from @ 981335b 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrynenko committed Dec 5, 2024
1 parent 7dfe2f6 commit 130aee6
Show file tree
Hide file tree
Showing 2 changed files with 231 additions and 0 deletions.
138 changes: 138 additions & 0 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,90 @@
}
],
"paths": {
"/integrations/proof-verification-relayer/v1/state": {
"get": {
"tags": [
"State"
],
"summary": "Get signed root state",
"description": "Endpoint to get transited root state. \nThe service listens for the new `RootUpdated` event and fetches them. By request it might return any root by \nits block number or root hex string if none of them provided last signed root returned. \nResponse contain signature of root signed by relayer private key.\n",
"operationId": "GetState",
"parameters": [
{
"in": "query",
"name": "filter[block]",
"required": false,
"description": "Block number to filter root by",
"example": "666",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "filter[root]",
"required": false,
"description": "Transited root in hex format stated to filter root by.",
"example": "0x234693c352a217d95c3a0e2e7ea17a340ac1b2290e9ab573ef97c2a86b1a5a6e",
"schema": {
"type": "string",
"pattern": "^0x([0-9a-fA-F]+)$"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/State"
}
}
}
}
}
},
"400": {
"description": "Bad Request Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
},
"404": {
"description": "Not Found Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
},
"500": {
"description": "Internal Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
}
}
}
},
"/integrations/proof-verification-relayer/v1/transit-state": {
"post": {
"tags": [
Expand Down Expand Up @@ -315,6 +399,60 @@
}
}
},
"State": {
"allOf": [
{
"$ref": "#/components/schemas/StateKey"
},
{
"type": "object",
"required": [
"attributes"
],
"properties": {
"attributes": {
"type": "object",
"required": [
"signature",
"timestamp"
],
"properties": {
"signature": {
"example": "0xd0bf2f6c2270874d8870a1081b67fcb0280b61db000778f159ba39c38fb2595639c2e1d81d085916ba6ec77f2bd4c4a2ae6dfbdbaf8703da7d9fe629b2e1218a00",
"type": "string",
"pattern": "^0x([0-9a-fA-F]+)$",
"description": "Signature of root state signed by relayer private key."
},
"timestamp": {
"example": "1733395652",
"type": "integer",
"format": "int64",
"description": "Time indicates when the event was caught, a.k.a state transition timestamp"
}
}
}
}
}
]
},
"StateKey": {
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"state"
]
}
}
},
"Tx": {
"allOf": [
{
Expand Down
93 changes: 93 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,64 @@ servers:
- url: 'https://api.demo.tokend.io'
description: TokenD Developer Environment
paths:
/integrations/proof-verification-relayer/v1/state:
get:
tags:
- State
summary: Get signed root state
description: |
Endpoint to get transited root state.
The service listens for the new `RootUpdated` event and fetches them. By request it might return any root by
its block number or root hex string if none of them provided last signed root returned.
Response contain signature of root signed by relayer private key.
operationId: GetState
parameters:
- in: query
name: 'filter[block]'
required: false
description: Block number to filter root by
example: '666'
schema:
type: integer
format: int64
- in: query
name: 'filter[root]'
required: false
description: Transited root in hex format stated to filter root by.
example: '0x234693c352a217d95c3a0e2e7ea17a340ac1b2290e9ab573ef97c2a86b1a5a6e'
schema:
type: string
pattern: '^0x([0-9a-fA-F]+)$'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/State'
'400':
description: Bad Request Error
content:
application/json:
schema:
$ref: '#/components/schemas/Errors'
'404':
description: Not Found Error
content:
application/json:
schema:
$ref: '#/components/schemas/Errors'
'500':
description: Internal Error
content:
application/json:
schema:
$ref: '#/components/schemas/Errors'
/integrations/proof-verification-relayer/v1/transit-state:
post:
tags:
Expand Down Expand Up @@ -200,6 +258,41 @@ components:
- 409
- 429
- 500
State:
allOf:
- $ref: '#/components/schemas/StateKey'
- type: object
required:
- attributes
properties:
attributes:
type: object
required:
- signature
- timestamp
properties:
signature:
example: '0xd0bf2f6c2270874d8870a1081b67fcb0280b61db000778f159ba39c38fb2595639c2e1d81d085916ba6ec77f2bd4c4a2ae6dfbdbaf8703da7d9fe629b2e1218a00'
type: string
pattern: '^0x([0-9a-fA-F]+)$'
description: Signature of root state signed by relayer private key.
timestamp:
example: '1733395652'
type: integer
format: int64
description: 'Time indicates when the event was caught, a.k.a state transition timestamp'
StateKey:
type: object
required:
- id
- type
properties:
id:
type: string
type:
type: string
enum:
- state
Tx:
allOf:
- $ref: '#/components/schemas/TxKey'
Expand Down

0 comments on commit 130aee6

Please sign in to comment.