mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
The projection these were generated from was a month old and predated the compute migration, so every one of them described /v1/visor — which the API serves at zero paths now. That is why a hand-written console client and a generated one had drifted the same way at the same time. No /v1/visor path survives here. The word still appears as a source-plane value and inside gvisor and supervisor, which are not this rename.
196 lines
6.9 KiB
C++
196 lines
6.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.
|
|
*/
|
|
|
|
/*
|
|
* Receipt.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_MODEL_Receipt_H_
|
|
#define HANZO_MODEL_Receipt_H_
|
|
|
|
#include <boost/optional.hpp>
|
|
|
|
#include "hanzo/ModelBase.h"
|
|
|
|
#include <cpprest/details/basic_types.h>
|
|
|
|
namespace hanzo {
|
|
namespace model {
|
|
|
|
|
|
|
|
class Receipt
|
|
: public ModelBase
|
|
{
|
|
public:
|
|
Receipt();
|
|
virtual ~Receipt();
|
|
|
|
/////////////////////////////////////////////
|
|
/// ModelBase overrides
|
|
|
|
void validate() override;
|
|
|
|
web::json::value toJson() const override;
|
|
bool fromJson(const web::json::value& json) override;
|
|
|
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
/// Receipt members
|
|
|
|
|
|
/// <summary>
|
|
/// Amount is what actually moved, as an exact 18-decimal-place USD string. It is NOT the atomic-unit figure the client signed: the challenge quotes the asset's own units (USDC's 6 dp) and truncates to fit them, while the ledger moves this exact value.
|
|
/// </summary>
|
|
utility::string_t getAmount() const;
|
|
bool amountIsSet() const;
|
|
void unsetAmount();
|
|
void setAmount(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// From is the payer's EVM address: the account that signed the EIP-3009 authorization, recovered from the signature rather than taken on trust.
|
|
/// </summary>
|
|
utility::string_t getFrom() const;
|
|
bool fromIsSet() const;
|
|
void unsetFrom();
|
|
void setFrom(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// ID is the settle-once key: \"x402_\" + keccak(from|nonce) in hex. It is DERIVED, not minted, so a client that re-submits the same authorization addresses the same settlement and is served again for free rather than charged twice. It is also the id GET /v1/x402/settlements/:id takes.
|
|
/// </summary>
|
|
utility::string_t getId() const;
|
|
bool idIsSet() const;
|
|
void unsetId();
|
|
void setId(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Network is the CAIP-2 identifier the payment was settled under, e.g. \"eip155:36963\". Its eip155 reference is the chain id in the EIP-712 domain the payer signed, so it is not a label — changing it invalidates the signature.
|
|
/// </summary>
|
|
utility::string_t getNetwork() const;
|
|
bool networkIsSet() const;
|
|
void unsetNetwork();
|
|
void setNetwork(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Nonce is the client-chosen nonce from the authorization, hex — up to 32 bytes, left-padded to the contract's bytes32. It is the replay anchor: the token contract refuses a second on-chain transfer for one (from, nonce), and this rail refuses a second settlement for the same pair, so a ledger settlement inherits the identical guarantee.
|
|
/// </summary>
|
|
utility::string_t getNonce() const;
|
|
bool nonceIsSet() const;
|
|
void unsetNonce();
|
|
void setNonce(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Payee is the recipient's EVM address — the `payTo` the challenge advertised and the authorization named. A payment to any other address never settles.
|
|
/// </summary>
|
|
utility::string_t getPayee() const;
|
|
bool payeeIsSet() const;
|
|
void unsetPayee();
|
|
void setPayee(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// PayeeOrg is the tenant that owns the recipient wallet, resolved at settlement. It is who got PAID, as Payer is who paid.
|
|
/// </summary>
|
|
utility::string_t getPayeeOrg() const;
|
|
bool payeeOrgIsSet() const;
|
|
void unsetPayeeOrg();
|
|
void setPayeeOrg(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Payer is the payer ORG — the tenant whose ledger was debited — and not an address. It is the org the request was authenticated as, so it answers who is billed, which the payer address alone cannot.
|
|
/// </summary>
|
|
utility::string_t getPayer() const;
|
|
bool payerIsSet() const;
|
|
void unsetPayer();
|
|
void setPayer(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Resource is what was paid for, in the same spelling the price table and the challenge used: the request path for a priced route, \"tool:<id>\" for a priced tool.
|
|
/// </summary>
|
|
utility::string_t getResource() const;
|
|
bool resourceIsSet() const;
|
|
void unsetResource();
|
|
void setResource(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// SettledAt is when this settlement was CLAIMED, in unix seconds — the moment the authorization was accepted, which is also the moment the time window it carried stopped applying. A settlement finished later by reconciliation keeps this instant.
|
|
/// </summary>
|
|
int64_t getSettledAt() const;
|
|
bool settledAtIsSet() const;
|
|
void unsetSettledAt();
|
|
void setSettledAt(int64_t value);
|
|
|
|
/// <summary>
|
|
/// SettledVia is which rail moved the money: \"ledger\", the live default, or \"chain\" when the authorization is broadcast. Those two values and no others.
|
|
/// </summary>
|
|
utility::string_t getSettledVia() const;
|
|
bool settledViaIsSet() const;
|
|
void unsetSettledVia();
|
|
void setSettledVia(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// TxHash is the chain transaction hash, present only for a \"chain\" settlement. Empty on a ledger settlement — that is the normal case today, and it means the money moved without a chain, not that it failed. The wire's PAYMENT-RESPONSE `transaction` falls back to ID when this is empty.
|
|
/// </summary>
|
|
utility::string_t getTxHash() const;
|
|
bool txHashIsSet() const;
|
|
void unsetTxHash();
|
|
void setTxHash(const utility::string_t& value);
|
|
|
|
|
|
protected:
|
|
utility::string_t m_Amount;
|
|
bool m_AmountIsSet;
|
|
|
|
utility::string_t m_From;
|
|
bool m_FromIsSet;
|
|
|
|
utility::string_t m_Id;
|
|
bool m_IdIsSet;
|
|
|
|
utility::string_t m_Network;
|
|
bool m_NetworkIsSet;
|
|
|
|
utility::string_t m_Nonce;
|
|
bool m_NonceIsSet;
|
|
|
|
utility::string_t m_Payee;
|
|
bool m_PayeeIsSet;
|
|
|
|
utility::string_t m_PayeeOrg;
|
|
bool m_PayeeOrgIsSet;
|
|
|
|
utility::string_t m_Payer;
|
|
bool m_PayerIsSet;
|
|
|
|
utility::string_t m_Resource;
|
|
bool m_ResourceIsSet;
|
|
|
|
int64_t m_SettledAt;
|
|
bool m_SettledAtIsSet;
|
|
|
|
utility::string_t m_SettledVia;
|
|
bool m_SettledViaIsSet;
|
|
|
|
utility::string_t m_TxHash;
|
|
bool m_TxHashIsSet;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_MODEL_Receipt_H_ */
|