Skip to content

Commit

Permalink
docs: Rosetta openapi specification (#14061)
Browse files Browse the repository at this point in the history
* add: openapi documentation

* fix

* CHANGELOG
  • Loading branch information
JulianToledano authored Nov 29, 2022
1 parent b25908b commit 8bb4521
Show file tree
Hide file tree
Showing 4 changed files with 1,257 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tools/rosetta/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
## [Unreleased]

### Improvements

* [#13832](https://github.com/cosmos/cosmos-sdk/pull/13832) Correctly populates rosetta's `/network/status` endpoint response. Roseta data api is divided into its own go files (account, block, mempool, network).
* [#14061](https://github.com/cosmos/cosmos-sdk/pull/14061) Adds openapi specification.
* [#13832](https://github.com/cosmos/cosmos-sdk/pull/13832) Correctly populates rosetta's `/network/status` endpoint response. Rosetta's data api is divided into its own go files (account, block, mempool, network).

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/internal/service/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ func (on OnlineNetwork) AccountBalance(ctx context.Context, request *types.Accou

// AccountsCoins - relevant only for UTXO based chain
// see https://www.rosetta-api.org/docs/AccountApi.html#accountcoins
func (o OnlineNetwork) AccountCoins(_ context.Context, _ *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error) {
func (on OnlineNetwork) AccountCoins(_ context.Context, _ *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error) {
return nil, errors.ToRosetta(errors.ErrOffline)
}
27 changes: 27 additions & 0 deletions tools/rosetta/openapi/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Rosetta API</title>
<link rel="stylesheet" type="text/css" href="//unpkg.com/[email protected]/swagger-ui.css">
<link rel="icon" type="image/png" href="//unpkg.com/[email protected]/favicon-16x16.png" />
<script src="//unpkg.com/[email protected]/swagger-ui-bundle.js"></script>
</head>

<body>
<div id="swagger-ui"></div>
<script>
window.onload = function () {
window.ui = SwaggerUIBundle({
url: "./openapi.yaml",
dom_id: '#swagger-ui',
deepLinking: true,
layout: "BaseLayout"
});
}
</script>
</body>

</html>
Loading

0 comments on commit 8bb4521

Please sign in to comment.