xrpld
Loading...
Searching...
No Matches
xrpl::LedgerEntryHelpers Namespace Reference

Functions

std::unexpected< json::ValuemissingFieldError (json::StaticString const field, std::optional< std::string > err=std::nullopt)
std::unexpected< json::ValueinvalidFieldError (std::string const &err, json::StaticString const field, std::string const &type)
std::unexpected< json::ValuemalformedError (std::string const &err, std::string const &message)
std::expected< bool, json::ValuehasRequired (json::Value const &params, std::initializer_list< json::StaticString > fields, std::optional< std::string > err=std::nullopt)
template<class T>
std::optional< T > parse (json::Value const &param)
template<class T>
std::expected< T, json::Valuerequired (json::Value const &params, json::StaticString const fieldName, std::string const &err, std::string const &expectedType)
template<>
std::optional< AccountIDparse (json::Value const &param)
std::expected< AccountID, json::ValuerequiredAccountID (json::Value const &params, json::StaticString const fieldName, std::string const &err)
std::optional< BlobparseHexBlob (json::Value const &param, std::size_t maxLength)
std::expected< Blob, json::ValuerequiredHexBlob (json::Value const &params, json::StaticString const fieldName, std::size_t maxLength, std::string const &err)
template<>
std::optional< std::uint32_tparse (json::Value const &param)
std::expected< std::uint32_t, json::ValuerequiredUInt32 (json::Value const &params, json::StaticString const fieldName, std::string const &err)
template<>
std::optional< uint256parse (json::Value const &param)
std::expected< uint256, json::ValuerequiredUInt256 (json::Value const &params, json::StaticString const fieldName, std::string const &err)
template<>
std::optional< uint192parse (json::Value const &param)
std::expected< uint192, json::ValuerequiredUInt192 (json::Value const &params, json::StaticString const fieldName, std::string const &err)
template<>
std::optional< Assetparse (json::Value const &param)
std::expected< Asset, json::ValuerequiredAsset (json::Value const &params, json::StaticString const fieldName, std::string const &err)
std::expected< STXChainBridge, json::ValueparseBridgeFields (json::Value const &params)

Function Documentation

◆ missingFieldError()

std::unexpected< json::Value > xrpl::LedgerEntryHelpers::missingFieldError ( json::StaticString const field,
std::optional< std::string > err = std::nullopt )

Definition at line 21 of file LedgerEntryHelpers.h.

◆ invalidFieldError()

std::unexpected< json::Value > xrpl::LedgerEntryHelpers::invalidFieldError ( std::string const & err,
json::StaticString const field,
std::string const & type )

Definition at line 31 of file LedgerEntryHelpers.h.

◆ malformedError()

std::unexpected< json::Value > xrpl::LedgerEntryHelpers::malformedError ( std::string const & err,
std::string const & message )

Definition at line 41 of file LedgerEntryHelpers.h.

◆ hasRequired()

std::expected< bool, json::Value > xrpl::LedgerEntryHelpers::hasRequired ( json::Value const & params,
std::initializer_list< json::StaticString > fields,
std::optional< std::string > err = std::nullopt )

Definition at line 51 of file LedgerEntryHelpers.h.

◆ parse() [1/6]

template<class T>
std::optional< T > xrpl::LedgerEntryHelpers::parse ( json::Value const & param)

◆ required()

template<class T>
std::expected< T, json::Value > xrpl::LedgerEntryHelpers::required ( json::Value const & params,
json::StaticString const fieldName,
std::string const & err,
std::string const & expectedType )

Definition at line 72 of file LedgerEntryHelpers.h.

◆ parse() [2/6]

template<>
std::optional< AccountID > xrpl::LedgerEntryHelpers::parse ( json::Value const & param)

Definition at line 91 of file LedgerEntryHelpers.h.

◆ requiredAccountID()

std::expected< AccountID, json::Value > xrpl::LedgerEntryHelpers::requiredAccountID ( json::Value const & params,
json::StaticString const fieldName,
std::string const & err )

Definition at line 106 of file LedgerEntryHelpers.h.

◆ parseHexBlob()

std::optional< Blob > xrpl::LedgerEntryHelpers::parseHexBlob ( json::Value const & param,
std::size_t maxLength )

Definition at line 115 of file LedgerEntryHelpers.h.

◆ requiredHexBlob()

std::expected< Blob, json::Value > xrpl::LedgerEntryHelpers::requiredHexBlob ( json::Value const & params,
json::StaticString const fieldName,
std::size_t maxLength,
std::string const & err )

Definition at line 128 of file LedgerEntryHelpers.h.

◆ parse() [3/6]

template<>
std::optional< std::uint32_t > xrpl::LedgerEntryHelpers::parse ( json::Value const & param)

Definition at line 147 of file LedgerEntryHelpers.h.

◆ requiredUInt32()

std::expected< std::uint32_t, json::Value > xrpl::LedgerEntryHelpers::requiredUInt32 ( json::Value const & params,
json::StaticString const fieldName,
std::string const & err )

Definition at line 163 of file LedgerEntryHelpers.h.

◆ parse() [4/6]

template<>
std::optional< uint256 > xrpl::LedgerEntryHelpers::parse ( json::Value const & param)

Definition at line 173 of file LedgerEntryHelpers.h.

◆ requiredUInt256()

std::expected< uint256, json::Value > xrpl::LedgerEntryHelpers::requiredUInt256 ( json::Value const & params,
json::StaticString const fieldName,
std::string const & err )

Definition at line 185 of file LedgerEntryHelpers.h.

◆ parse() [5/6]

template<>
std::optional< uint192 > xrpl::LedgerEntryHelpers::parse ( json::Value const & param)

Definition at line 195 of file LedgerEntryHelpers.h.

◆ requiredUInt192()

std::expected< uint192, json::Value > xrpl::LedgerEntryHelpers::requiredUInt192 ( json::Value const & params,
json::StaticString const fieldName,
std::string const & err )

Definition at line 207 of file LedgerEntryHelpers.h.

◆ parse() [6/6]

template<>
std::optional< Asset > xrpl::LedgerEntryHelpers::parse ( json::Value const & param)

Definition at line 217 of file LedgerEntryHelpers.h.

◆ requiredAsset()

std::expected< Asset, json::Value > xrpl::LedgerEntryHelpers::requiredAsset ( json::Value const & params,
json::StaticString const fieldName,
std::string const & err )

Definition at line 230 of file LedgerEntryHelpers.h.

◆ parseBridgeFields()

std::expected< STXChainBridge, json::Value > xrpl::LedgerEntryHelpers::parseBridgeFields ( json::Value const & params)

Definition at line 236 of file LedgerEntryHelpers.h.