mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 10:35:50 +00:00
Add single asset vault (XLS-65d) (#5224)
- Specification: XRPLF/XRPL-Standards#239 - Amendment: `SingleAssetVault` - Implements a vault feature used to store a fungible asset (XRP, IOU, or MPT, but not NFT) and to receive shares in the vault (an MPT) in exchange. - A vault can be private or public. - A private vault can use permissioned domains, subject to the `PermissionedDomains` amendment. - Shares can be exchanged back into asset with `VaultWithdraw`. - Permissions on the asset in the vault are transitively applied on shares in the vault. - Issuer of the asset in the vault can clawback with `VaultClawback`. - Extended `MPTokenIssuance` with `DomainID`, used by the permissioned domain on the vault shares. Co-authored-by: John Freeman <jfreeman08@gmail.com>
This commit is contained in:
@@ -20,11 +20,13 @@
|
||||
#ifndef RIPPLE_JSON_JSON_VALUE_H_INCLUDED
|
||||
#define RIPPLE_JSON_JSON_VALUE_H_INCLUDED
|
||||
|
||||
#include <xrpl/basics/Number.h>
|
||||
#include <xrpl/json/json_forwards.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
/** \brief JSON (JavaScript Object Notation).
|
||||
@@ -216,6 +218,7 @@ public:
|
||||
Value(UInt value);
|
||||
Value(double value);
|
||||
Value(char const* value);
|
||||
Value(ripple::Number const& value);
|
||||
/** \brief Constructs a value from a static string.
|
||||
|
||||
* Like other value string constructor but do not duplicate the string for
|
||||
@@ -365,6 +368,8 @@ public:
|
||||
*/
|
||||
Value&
|
||||
operator[](StaticString const& key);
|
||||
Value const&
|
||||
operator[](StaticString const& key) const;
|
||||
|
||||
/// Return the member named key if it exist, defaultValue otherwise.
|
||||
Value
|
||||
@@ -436,6 +441,12 @@ private:
|
||||
int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
|
||||
};
|
||||
|
||||
inline Value
|
||||
to_json(ripple::Number const& number)
|
||||
{
|
||||
return to_string(number);
|
||||
}
|
||||
|
||||
bool
|
||||
operator==(Value const&, Value const&);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user