Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update endpoint name to /operations/latest #7

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Description

Relayer service that makes calls to the smart contracts. Now it is used to work with such endpoints:
- `/integrations/voting-relayer/v1/register` - it takes calldata in hex encoided format from Rarime mobile applications and makes call to the smart contract.
- POST `/integrations/voting-relayer/v1/register` - it takes calldata in hex encoided format from Rarime mobile applications and makes call to the smart contract.

Request body example:
```json
Expand All @@ -15,6 +15,46 @@ Relayer service that makes calls to the smart contracts. Now it is used to work
}
```

- GET `/integrations/voting-relayer/v1/operations/latest` - it returnes info about latest transited root
Response body example

```json
{
"data": {
"id": "",
"type": "",
"attributes": {
"block_height": 0,
"destination_chain": "",
"operation_id": "",
"proof": "",
"tx_hash": ""
}
},
"included": []
}
```

- GET `/integrations/voting-relayer/v1/operations/{root}` - it returnes info about transited root, where root is lower case hex string with 0x prefix
Response body example

```json
{
"data": {
"id": "",
"type": "",
"attributes": {
"block_height": 0,
"destination_chain": "",
"operation_id": "",
"proof": "",
"tx_hash": ""
}
},
"included": []
}
```

## Install

```
Expand Down
2 changes: 1 addition & 1 deletion internal/service/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (s *service) router() chi.Router {
})
r.Route("/operations", func(r chi.Router) {
r.Get("/{root}", handlers.GetOperationByRoot)
r.Get("/", handlers.GetLastOperation)
r.Get("/latest", handlers.GetLastOperation)
})
})
})
Expand Down
Loading