mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Update ServerDefinition
This commit is contained in:
@@ -157,22 +157,28 @@ constexpr std::uint32_t const tfNFTokenMintOldMask =
|
||||
|
||||
// MPTokenIssuanceCreate flags:
|
||||
// NOTE - there is intentionally no flag here for lsfMPTLocked, which this transaction cannot mutate.
|
||||
constexpr std::uint32_t const tfMPTCanLock = lsfMPTCanLock;
|
||||
constexpr std::uint32_t const tfMPTRequireAuth = lsfMPTRequireAuth;
|
||||
constexpr std::uint32_t const tfMPTCanEscrow = lsfMPTCanEscrow;
|
||||
constexpr std::uint32_t const tfMPTCanTrade = lsfMPTCanTrade;
|
||||
constexpr std::uint32_t const tfMPTCanTransfer = lsfMPTCanTransfer;
|
||||
constexpr std::uint32_t const tfMPTCanClawback = lsfMPTCanClawback;
|
||||
enum MPTokenIssuanceCreateFlags : uint32_t {
|
||||
tfMPTCanLock = lsfMPTCanLock,
|
||||
tfMPTRequireAuth = lsfMPTRequireAuth,
|
||||
tfMPTCanEscrow = lsfMPTCanEscrow,
|
||||
tfMPTCanTrade = lsfMPTCanTrade,
|
||||
tfMPTCanTransfer = lsfMPTCanTransfer,
|
||||
tfMPTCanClawback = lsfMPTCanClawback,
|
||||
};
|
||||
constexpr std::uint32_t const tfMPTokenIssuanceCreateMask =
|
||||
~(tfUniversal | tfMPTCanLock | tfMPTRequireAuth | tfMPTCanEscrow | tfMPTCanTrade | tfMPTCanTransfer | tfMPTCanClawback);
|
||||
|
||||
// MPTokenAuthorize flags:
|
||||
constexpr std::uint32_t const tfMPTUnauthorize = 0x00000001;
|
||||
enum MPTokenAuthorizeFlags : uint32_t {
|
||||
tfMPTUnauthorize = 0x00000001,
|
||||
};
|
||||
constexpr std::uint32_t const tfMPTokenAuthorizeMask = ~(tfUniversal | tfMPTUnauthorize);
|
||||
|
||||
// MPTokenIssuanceSet flags:
|
||||
constexpr std::uint32_t const tfMPTLock = 0x00000001;
|
||||
constexpr std::uint32_t const tfMPTUnlock = 0x00000002;
|
||||
enum MPTokenIssuanceSetFlags : uint32_t {
|
||||
tfMPTLock = 0x00000001,
|
||||
tfMPTUnlock = 0x00000002,
|
||||
};
|
||||
constexpr std::uint32_t const tfMPTokenIssuanceSetMask = ~(tfUniversal | tfMPTLock | tfMPTUnlock);
|
||||
|
||||
// MPTokenIssuanceDestroy flags:
|
||||
@@ -243,11 +249,15 @@ constexpr std::uint32_t tfWithdrawMask = ~(tfUniversal | tfWithdrawSubTx);
|
||||
constexpr std::uint32_t tfDepositMask = ~(tfUniversal | tfDepositSubTx);
|
||||
|
||||
// AMMClawback flags:
|
||||
constexpr std::uint32_t tfClawTwoAssets = 0x00000001;
|
||||
enum AMMClawbackFlags : uint32_t {
|
||||
tfClawTwoAssets = 0x00000001,
|
||||
};
|
||||
constexpr std::uint32_t tfAMMClawbackMask = ~(tfUniversal | tfClawTwoAssets);
|
||||
|
||||
// BridgeModify flags:
|
||||
constexpr std::uint32_t tfClearAccountCreateAmount = 0x00010000;
|
||||
enum BridgeModifyFlags : uint32_t {
|
||||
tfClearAccountCreateAmount = 0x00010000,
|
||||
};
|
||||
constexpr std::uint32_t tfBridgeModifyMask = ~(tfUniversal | tfClearAccountCreateAmount);
|
||||
// clang-format on
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ private:
|
||||
|
||||
if (find("UINT"))
|
||||
{
|
||||
if (find("256") || find("192") || find("160") || find("128"))
|
||||
if (find("512") || find("384") || find("256") || find("192") || find("160") || find("128"))
|
||||
return replace("UINT", "Hash");
|
||||
else
|
||||
return replace("UINT", "UInt");
|
||||
@@ -158,7 +158,9 @@ private:
|
||||
{"ID", "ID"},
|
||||
{"AMM", "AMM"},
|
||||
{"URITOKEN", "URIToken"},
|
||||
{"URI", "URI"}};
|
||||
{"URI", "URI"},
|
||||
{"DID", "DID"},
|
||||
{"MPTOKEN", "MPToken"}};
|
||||
|
||||
std::string out;
|
||||
size_t pos = 0;
|
||||
@@ -385,6 +387,10 @@ private:
|
||||
}
|
||||
|
||||
auto const translate_tt = [](std::string inp) -> std::string {
|
||||
if (inp == "Amendment")
|
||||
return "EnableAmendment";
|
||||
if (inp == "Fee")
|
||||
return "SetFee";
|
||||
if (inp == "PaychanClaim")
|
||||
return "PaymentChannelClaim";
|
||||
if (inp == "PaychanCreate")
|
||||
@@ -422,17 +428,50 @@ private:
|
||||
addFlagsToJson<NFTokenMintFlags>(ret, "NFTokenMint");
|
||||
addFlagsToJson<NFTokenCreateOfferFlags>(ret, "NFTokenCreateOffer");
|
||||
addFlagsToJson<ClaimRewardFlags>(ret, "ClaimReward");
|
||||
addFlagsToJson<BridgeModifyFlags>(ret, "XChainModifyBridge");
|
||||
addFlagsToJson<MPTokenIssuanceCreateFlags>(ret, "MPTokenIssuanceCreate");
|
||||
addFlagsToJson<MPTokenAuthorizeFlags>(ret, "MPTokenAuthorize");
|
||||
addFlagsToJson<MPTokenIssuanceSetFlags>(ret, "MPTokenIssuanceSet");
|
||||
addFlagsToJson<AMMClawbackFlags>(ret, "AMMClawback");
|
||||
struct FlagData
|
||||
{
|
||||
std::string name;
|
||||
std::uint32_t value;
|
||||
};
|
||||
// URITokenMint
|
||||
std::array<FlagData, 1> uriTokenMintFlags{{{"tfBurnable", tfBurnable}}};
|
||||
for (auto const& entry : uriTokenMintFlags)
|
||||
{
|
||||
ret[jss::TRANSACTION_FLAGS]["URITokenMint"][entry.name] =
|
||||
static_cast<uint32_t>(entry.value);
|
||||
}
|
||||
// AMMWithdraw
|
||||
std::array<FlagData, 7> ammWithdrawFlags{{
|
||||
{"tfLPToken", tfLPToken},
|
||||
{"tfSingleAsset", tfSingleAsset},
|
||||
{"tfTwoAsset", tfTwoAsset},
|
||||
{"tfOneAssetLPToken", tfOneAssetLPToken},
|
||||
{"tfLimitLPToken", tfLimitLPToken},
|
||||
{"tfWithdrawAll", tfWithdrawAll},
|
||||
{"tfOneAssetWithdrawAll", tfOneAssetWithdrawAll}}};
|
||||
for (auto const& entry : ammWithdrawFlags)
|
||||
{
|
||||
ret[jss::TRANSACTION_FLAGS]["AMMWithdraw"][entry.name] =
|
||||
static_cast<uint32_t>(entry.value);
|
||||
}
|
||||
// AMM Deposit
|
||||
std::array<FlagData, 6> ammDepositFlags{{
|
||||
{"tfLPToken", tfLPToken},
|
||||
{"tfSingleAsset", tfSingleAsset},
|
||||
{"tfTwoAsset", tfTwoAsset},
|
||||
{"tfOneAssetLPToken", tfOneAssetLPToken},
|
||||
{"tfLimitLPToken", tfLimitLPToken},
|
||||
{"tfTwoAssetIfEmpty", tfTwoAssetIfEmpty}}};
|
||||
for (auto const& entry : ammDepositFlags)
|
||||
{
|
||||
ret[jss::TRANSACTION_FLAGS]["AMMDeposit"][entry.name] =
|
||||
static_cast<uint32_t>(entry.value);
|
||||
}
|
||||
|
||||
// Transaction Indicies Flags:
|
||||
ret[jss::TRANSACTION_FLAGS_INDICES] = Json::objectValue;
|
||||
|
||||
Reference in New Issue
Block a user