mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
The lock sat at 574d1f1d while the product moved on. The team surface stopped at rooms — no messages path, no way to open one — so anything built on this client had to reach past it with its own HTTP calls, which is the duplication a generated client exists to prevent.
108 lines
6.4 KiB
C++
108 lines
6.4 KiB
C++
/**
|
|
* Hanzo Cloud API
|
|
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
*
|
|
* The version of the OpenAPI document: v1
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI-Generator 7.14.0.
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
/*
|
|
* MarketApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_MarketApi_H_
|
|
#define HANZO_API_MarketApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/History.h"
|
|
#include "hanzo/model/Pools.h"
|
|
#include "hanzo/model/Roster.h"
|
|
#include "hanzo/model/Survey.h"
|
|
#include "hanzo/model/Tokens.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class MarketApi
|
|
{
|
|
public:
|
|
|
|
explicit MarketApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~MarketApi();
|
|
|
|
/// <summary>
|
|
/// Answers every chain this deployment can read, what is deployed on each, and what its automated market maker amounts to.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers every chain this deployment can read, what is deployed on each, and what its automated market maker amounts to. One call. It reads the chain registry, then every chain's indexer for its figures and its most recent active day, all at once — where a client doing it itself makes one registry request and two more per chain. THE ROW IS THE UNIT OF TRUTH. Each carries its own reach, so one indexer being unreachable costs one row its figures and leaves the rest answered. A chain with no market maker deployed — the registry names no factory for it — answers `read` with totals of nothing, which is a fact about that chain and is not the same as a chain nobody could ask.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<Roster>> getMarketChains(
|
|
) const;
|
|
/// <summary>
|
|
/// Answers the automated market makers on one chain: their two tokens, their fee tier, and what has moved through each.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers the automated market makers on one chain: their two tokens, their fee tier, and what has moved through each. The two price fields on a pool are the ratio its own reserves stand at, as the indexer computed them. They are not a price ON either token and not a mark: nothing here derives one, ranks the pools, or names a route through them. A chain with no market maker deployed answers `read` with no pools. That is the chain's real condition, and it is deliberately not the same answer as an indexer that could not be asked.
|
|
/// </remarks>
|
|
/// <param name="chain">Chain is the chain's slug — `cchain`, `zoo` — as `chains` reports it. It is the indexer's word for the chain and NOT the chain id: `96369`, `C` and `c-chain` all name nothing. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<Pools>> getMarketPools(
|
|
boost::optional<utility::string_t> chain
|
|
) const;
|
|
/// <summary>
|
|
/// Answers which of the four settlement precompiles carry code on one chain.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers which of the four settlement precompiles carry code on one chain. An address with no code answers a call with empty data rather than an error, so \"this chain has no view precompile\" and \"this market was never opened\" reach a caller as the same silence — and only the second is a fact about a market. This says which it is, by asking the node for the code at each address. It reads presence and nothing else. No market, no quote, no depth and no order is requested here, and `eth_getCode` is the only method this operation ever sends.
|
|
/// </remarks>
|
|
/// <param name="chain">Chain is the chain's slug — `cchain`, `zoo` — as `chains` reports it. It is the indexer's word for the chain and NOT the chain id: `96369`, `C` and `c-chain` all name nothing. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<Survey>> getMarketSurvey(
|
|
boost::optional<utility::string_t> chain
|
|
) const;
|
|
/// <summary>
|
|
/// Answers one token's daily history — open, high, low, close, price and volume per UTC day, oldest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers one token's daily history — open, high, low, close, price and volume per UTC day, oldest first. Every figure is the indexer's own arithmetic, passed through as the decimal string it computed. Nothing here rounds one, converts one, or fills a gap: a day the indexer holds no figure for arrives with that field absent, which says \"not indexed\" where a zero would say \"worth nothing\".
|
|
/// </remarks>
|
|
/// <param name="chain"> (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="at">At is the token's contract address. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<History>> getMarketToken(
|
|
boost::optional<utility::string_t> chain,
|
|
boost::optional<utility::string_t> at
|
|
) const;
|
|
/// <summary>
|
|
/// Answers the tokens one chain's indexer has seen, with the decimals a caller needs to read any amount of one correctly.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers the tokens one chain's indexer has seen, with the decimals a caller needs to read any amount of one correctly. This is what the indexer INGESTED, which is not the same as what exists on the chain: a token nothing has traded has no row here, and this is not a registry of what is permitted or listed.
|
|
/// </remarks>
|
|
/// <param name="chain">Chain is the chain's slug — `cchain`, `zoo` — as `chains` reports it. It is the indexer's word for the chain and NOT the chain id: `96369`, `C` and `c-chain` all name nothing. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<Tokens>> getMarketTokens(
|
|
boost::optional<utility::string_t> chain
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_MarketApi_H_ */
|
|
|