mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
The projection was 113 commits behind the document it claims to describe, and `generate.py --all --check` reported every one of the thirteen clients DRIFTED — the same +19 models in each, because they all fell behind the same emission. Regenerated in place from hanzo-inc/cloud openapi.yaml at 939b09d4 (sha256 087024f6…), which is the only description of this API that cannot name a route the binary does not serve. `--check` is clean across all thirteen after. .spec-lock moved with the code. The generator READS that file and never writes it — hanzoai/ci`s lane does — so a hand run leaves every lock naming the previous document. A lock that disagrees with the tree beside it is worse than no lock: the next `--check` without `--spec` fetches what production serves, compares it to a digest that was already wrong, and reports drift that is really staleness.
100 lines
3.6 KiB
C++
100 lines
3.6 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.
|
|
*/
|
|
|
|
/*
|
|
* Web3Api.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_Web3Api_H_
|
|
#define HANZO_API_Web3Api_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/Balances.h"
|
|
#include "hanzo/model/ChainList.h"
|
|
#include "hanzo/model/ChainStatus.h"
|
|
#include "hanzo/model/RpcIn.h"
|
|
#include "hanzo/model/RpcOut.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class Web3Api
|
|
{
|
|
public:
|
|
|
|
explicit Web3Api( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~Web3Api();
|
|
|
|
/// <summary>
|
|
/// Reports the chains this deployment can reach.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reports the chains this deployment can reach. The list is the declared registry, so it is exactly what /v1/web3/rpc will accept — a chain that appears here is one this deployment actually has an upstream for.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<ChainList>> getWeb3Chains(
|
|
) const;
|
|
/// <summary>
|
|
/// Reports one chain and whether its upstream is answering.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reports one chain and whether its upstream is answering. An unreachable chain is still a 200 with live:false — the chain is configured, which is a different fact from the chain being up, and a 502 here would make a console page error rather than show the outage.
|
|
/// </remarks>
|
|
/// <param name="chain">Chain is the registry id, as in /v1/web3/chains/lux.</param>
|
|
pplx::task<std::shared_ptr<ChainStatus>> getWeb3ChainsByChain(
|
|
utility::string_t chain
|
|
) const;
|
|
/// <summary>
|
|
/// Reads an address's native balance on a chain.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reads an address's native balance on a chain. ERC-20 positions are NOT enumerated here: eth_getBalance answers the native one, but \"every token this address holds\" is an indexer question — there is no RPC call that answers it, and walking a token list would return a number that silently omits whatever the list missed. explorer owns the indexer relationship; this returns the balance the chain itself can prove.
|
|
/// </remarks>
|
|
/// <param name="chain">Chain is the registry id.</param>
|
|
/// <param name="address">Address is the account, 0x-prefixed.</param>
|
|
pplx::task<std::shared_ptr<Balances>> getWeb3TokensByChainByAddress(
|
|
utility::string_t chain,
|
|
utility::string_t address
|
|
) const;
|
|
/// <summary>
|
|
/// Forwards a JSON-RPC call to the named chain and returns its answer unchanged.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Forwards a JSON-RPC call to the named chain and returns its answer unchanged. Only declared chains are reachable, and only to a caller with a validated principal — this is the deployment's upstream, not an open relay.
|
|
/// </remarks>
|
|
/// <param name="chain">Chain is the registry id, from the URL.</param>
|
|
/// <param name="rpcIn"></param>
|
|
pplx::task<std::shared_ptr<RpcOut>> postWeb3RpcByChain(
|
|
utility::string_t chain,
|
|
std::shared_ptr<RpcIn> rpcIn
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_Web3Api_H_ */
|
|
|