Skip to content

feat: add Rust client for Hermes price service #2686

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
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
41 changes: 41 additions & 0 deletions .github/workflows/ci-hermes-client-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check Hermes Rust Client

on:
pull_request:
paths:
- .github/workflows/ci-hermes-client-rust.yml
- apps/hermes/client/rust/**
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/hermes/client/rust
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
with:
workspaces: "apps/hermes/client/rust -> target"
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.82.0
components: rustfmt, clippy
override: true
- name: Format check
run: cargo fmt --all -- --check
if: success() || failure()
- name: Clippy check
run: cargo clippy --tests -- --deny warnings
if: success() || failure()
- name: Build check
run: cargo build
if: success() || failure()
- name: Run tests
run: cargo test
if: success() || failure()
- name: Build examples
run: cargo build --examples
if: success() || failure()
18 changes: 18 additions & 0 deletions .github/workflows/publish-rust-hermes-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Rust package hermes-client to crates.io

on:
push:
tags:
- hermes-client-rust-v*
jobs:
publish-hermes-client:
name: Publish Rust package hermes-client to crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
working-directory: "apps/hermes/client/rust"
30 changes: 30 additions & 0 deletions apps/hermes/client/rust/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

# Exclude the autogenerated SSE client implementation
# This will be replaced with a custom implementation that properly handles streaming
src/apis/rest_api.rs:price_stream_sse_handler

# Exclude examples directory to prevent overwriting custom examples
examples/
46 changes: 46 additions & 0 deletions apps/hermes/client/rust/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.gitignore
.openapi-generator-ignore
.travis.yml
Cargo.toml
README.md
docs/AssetType.md
docs/BinaryUpdate.md
docs/EncodingType.md
docs/GetVaaCcipResponse.md
docs/GetVaaResponse.md
docs/LatestPublisherStakeCapsUpdateDataResponse.md
docs/ParsedPriceFeedTwap.md
docs/ParsedPriceUpdate.md
docs/ParsedPublisherStakeCap.md
docs/ParsedPublisherStakeCapsUpdate.md
docs/PriceFeedMetadata.md
docs/PriceUpdate.md
docs/RestApi.md
docs/RpcPrice.md
docs/RpcPriceFeed.md
docs/RpcPriceFeedMetadata.md
docs/RpcPriceFeedMetadataV2.md
docs/TwapsResponse.md
git_push.sh
src/apis/configuration.rs
src/apis/mod.rs
src/apis/rest_api.rs
src/lib.rs
src/models/asset_type.rs
src/models/binary_update.rs
src/models/encoding_type.rs
src/models/get_vaa_ccip_response.rs
src/models/get_vaa_response.rs
src/models/latest_publisher_stake_caps_update_data_response.rs
src/models/mod.rs
src/models/parsed_price_feed_twap.rs
src/models/parsed_price_update.rs
src/models/parsed_publisher_stake_cap.rs
src/models/parsed_publisher_stake_caps_update.rs
src/models/price_feed_metadata.rs
src/models/price_update.rs
src/models/rpc_price.rs
src/models/rpc_price_feed.rs
src/models/rpc_price_feed_metadata.rs
src/models/rpc_price_feed_metadata_v2.rs
src/models/twaps_response.rs
1 change: 1 addition & 0 deletions apps/hermes/client/rust/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.13.0
Loading
Loading