-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
68 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package query | ||
|
||
// Type is an enum that represents the type of query to be made to the Pythnet Hermes API. | ||
type Type string | ||
|
||
const ( | ||
// LatestSync is a query type that fetches all latest prices together & synchronously. | ||
LatestSync Type = "latest-sync" | ||
// LatestAsync is a query type that fetches all latest prices individually, in parallel. | ||
LatestAsync Type = "latest-async" | ||
// Stream is a query type that subscribes to price updates and returns the latest cached price. | ||
StreamCached Type = "stream" | ||
) | ||
|
||
// Settings is a struct that holds the settings for querying Hermes using the Pythnet client. | ||
type Settings struct { | ||
UseEma bool | ||
DesiredPrecision int | ||
RequestType Type | ||
SingleUpdateFee uint | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters