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.
149 lines
7.9 KiB
C++
149 lines
7.9 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.
|
|
*/
|
|
|
|
/*
|
|
* WalletApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_WalletApi_H_
|
|
#define HANZO_API_WalletApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/AccountList.h"
|
|
#include "hanzo/model/CreateAccountIn.h"
|
|
#include "hanzo/model/CreateWalletIn.h"
|
|
#include "hanzo/model/SafeProposal.h"
|
|
#include "hanzo/model/SafeTxIn.h"
|
|
#include "hanzo/model/SignIn.h"
|
|
#include "hanzo/model/Signature.h"
|
|
#include "hanzo/model/Wallet.h"
|
|
#include "hanzo/model/WalletAccount.h"
|
|
#include "hanzo/model/WalletList.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class WalletApi
|
|
{
|
|
public:
|
|
|
|
explicit WalletApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~WalletApi();
|
|
|
|
/// <summary>
|
|
/// Returns the caller org's wallets, newest first, optionally NARROWED within the org by project, agent or account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's wallets, newest first, optionally NARROWED within the org by project, agent or account. The org is always the bound isolation boundary — the filters only ever narrow inside it, so a caller can never widen past its own org.
|
|
/// </remarks>
|
|
/// <param name="project">Project narrows to wallets scoped to one project. Must be a url-safe segment. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="agent">Agent narrows to wallets scoped to one agent. Must be a url-safe segment. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="account">Account narrows to wallets under one account id. Must be a url-safe segment. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<WalletList>> getWallet(
|
|
boost::optional<utility::string_t> project,
|
|
boost::optional<utility::string_t> agent,
|
|
boost::optional<utility::string_t> account
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's wallet accounts, newest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's wallet accounts, newest first. Accounts are physically org-scoped, so another tenant's are not reachable from here.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<AccountList>> getWalletAccounts(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns one of the caller org's wallets: its scope, custody kind, tier, chain and on-chain address.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns one of the caller org's wallets: its scope, custody kind, tier, chain and on-chain address. The custody handle to the signing material is never part of the answer. A wallet id another org owns reads as not found, so the response cannot confirm that it exists.
|
|
/// </remarks>
|
|
/// <param name="id"></param>
|
|
pplx::task<std::shared_ptr<Wallet>> getWalletById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Provisions a new signing identity under one of the caller org's accounts and answers the stored wallet including its on-chain address.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Provisions a new signing identity under one of the caller org's accounts and answers the stored wallet including its on-chain address. The custody backend generates the key material — a KMS-sealed secp256k1 key, an MPC threshold key on the ring, or a Safe smart wallet owned by one — and the HANDLE to it is kept server-side and never returned. A custody kind the deployment has not wired fails CLOSED with 503: a signature is never fabricated. The wallet is scoped to the org, the caller's ambient project, and optionally an agent and the named account; those narrowings are what its key ref is derived from, so each must be a url-safe segment.
|
|
/// </remarks>
|
|
/// <param name="createWalletIn"></param>
|
|
pplx::task<std::shared_ptr<Wallet>> postWallet(
|
|
std::shared_ptr<CreateWalletIn> createWalletIn
|
|
) const;
|
|
/// <summary>
|
|
/// Opens a named wallet account for the caller's org.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Opens a named wallet account for the caller's org. An account is a GROUPING of wallets, not a key or a balance: wallets are created under one and can be listed by it. The org is stamped by the server from the validated principal, so a request can never open an account in another tenant.
|
|
/// </remarks>
|
|
/// <param name="createAccountIn"></param>
|
|
pplx::task<std::shared_ptr<WalletAccount>> postWalletAccounts(
|
|
std::shared_ptr<CreateAccountIn> createAccountIn
|
|
) const;
|
|
/// <summary>
|
|
/// Rolls one wallet's signing material through its own custody backend and answers the wallet with whatever address that produced.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Rolls one wallet's signing material through its own custody backend and answers the wallet with whatever address that produced. For KMS custody a fresh secp256k1 key is generated and sealed, which CHANGES the address — funds and approvals at the old address do not move. For a Safe the address is counterfactual and the owner shares are ring-managed, so rotation is a no-op and the address is unchanged. A backend that is not configured fails closed with 503 rather than leaving the wallet half-rotated.
|
|
/// </remarks>
|
|
/// <param name="id"></param>
|
|
pplx::task<std::shared_ptr<Wallet>> postWalletByIdKeys(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Produces a secp256k1 signature from one of the caller org's wallets over a 32-byte digest, through whichever custody backend that wallet uses.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Produces a secp256k1 signature from one of the caller org's wallets over a 32-byte digest, through whichever custody backend that wallet uses. Give it either a `digest` (32 bytes as hex, signed verbatim) or a `message` (hashed with Keccak256 first) — exactly one is required. The private key never leaves its backend: KMS custody opens the sealed key in-process, MPC custody produces a threshold signature on the ring. The answer carries the digest that was signed alongside the signature, so a caller can verify what it got.
|
|
/// </remarks>
|
|
/// <param name="id"></param>
|
|
/// <param name="signIn"></param>
|
|
pplx::task<std::shared_ptr<Signature>> postWalletByIdSign(
|
|
utility::string_t id,
|
|
std::shared_ptr<SignIn> signIn
|
|
) const;
|
|
/// <summary>
|
|
/// Composes a Safe transaction on the MPC ring and answers its EIP-712 hash together with the owner approval the ring's threshold signature produced.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Composes a Safe transaction on the MPC ring and answers its EIP-712 hash together with the owner approval the ring's threshold signature produced. Only a wallet whose custody is \"safe\" can do this — any other custody is a 400, because the backend itself is asked whether it can propose rather than the kind being switched on. The ring computes the Safe-tx hash bound to the Safe contract and the chain id, so the hash a caller gets back is the one the Safe will verify. This PROPOSES: it does not execute the transaction.
|
|
/// </remarks>
|
|
/// <param name="id"></param>
|
|
/// <param name="safeTxIn"></param>
|
|
pplx::task<std::shared_ptr<SafeProposal>> postWalletByIdTransactions(
|
|
utility::string_t id,
|
|
std::shared_ptr<SafeTxIn> safeTxIn
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_WalletApi_H_ */
|
|
|