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:
|
// MPTokenIssuanceCreate flags:
|
||||||
// NOTE - there is intentionally no flag here for lsfMPTLocked, which this transaction cannot mutate.
|
// NOTE - there is intentionally no flag here for lsfMPTLocked, which this transaction cannot mutate.
|
||||||
constexpr std::uint32_t const tfMPTCanLock = lsfMPTCanLock;
|
enum MPTokenIssuanceCreateFlags : uint32_t {
|
||||||
constexpr std::uint32_t const tfMPTRequireAuth = lsfMPTRequireAuth;
|
tfMPTCanLock = lsfMPTCanLock,
|
||||||
constexpr std::uint32_t const tfMPTCanEscrow = lsfMPTCanEscrow;
|
tfMPTRequireAuth = lsfMPTRequireAuth,
|
||||||
constexpr std::uint32_t const tfMPTCanTrade = lsfMPTCanTrade;
|
tfMPTCanEscrow = lsfMPTCanEscrow,
|
||||||
constexpr std::uint32_t const tfMPTCanTransfer = lsfMPTCanTransfer;
|
tfMPTCanTrade = lsfMPTCanTrade,
|
||||||
constexpr std::uint32_t const tfMPTCanClawback = lsfMPTCanClawback;
|
tfMPTCanTransfer = lsfMPTCanTransfer,
|
||||||
|
tfMPTCanClawback = lsfMPTCanClawback,
|
||||||
|
};
|
||||||
constexpr std::uint32_t const tfMPTokenIssuanceCreateMask =
|
constexpr std::uint32_t const tfMPTokenIssuanceCreateMask =
|
||||||
~(tfUniversal | tfMPTCanLock | tfMPTRequireAuth | tfMPTCanEscrow | tfMPTCanTrade | tfMPTCanTransfer | tfMPTCanClawback);
|
~(tfUniversal | tfMPTCanLock | tfMPTRequireAuth | tfMPTCanEscrow | tfMPTCanTrade | tfMPTCanTransfer | tfMPTCanClawback);
|
||||||
|
|
||||||
// MPTokenAuthorize flags:
|
// MPTokenAuthorize flags:
|
||||||
constexpr std::uint32_t const tfMPTUnauthorize = 0x00000001;
|
enum MPTokenAuthorizeFlags : uint32_t {
|
||||||
|
tfMPTUnauthorize = 0x00000001,
|
||||||
|
};
|
||||||
constexpr std::uint32_t const tfMPTokenAuthorizeMask = ~(tfUniversal | tfMPTUnauthorize);
|
constexpr std::uint32_t const tfMPTokenAuthorizeMask = ~(tfUniversal | tfMPTUnauthorize);
|
||||||
|
|
||||||
// MPTokenIssuanceSet flags:
|
// MPTokenIssuanceSet flags:
|
||||||
constexpr std::uint32_t const tfMPTLock = 0x00000001;
|
enum MPTokenIssuanceSetFlags : uint32_t {
|
||||||
constexpr std::uint32_t const tfMPTUnlock = 0x00000002;
|
tfMPTLock = 0x00000001,
|
||||||
|
tfMPTUnlock = 0x00000002,
|
||||||
|
};
|
||||||
constexpr std::uint32_t const tfMPTokenIssuanceSetMask = ~(tfUniversal | tfMPTLock | tfMPTUnlock);
|
constexpr std::uint32_t const tfMPTokenIssuanceSetMask = ~(tfUniversal | tfMPTLock | tfMPTUnlock);
|
||||||
|
|
||||||
// MPTokenIssuanceDestroy flags:
|
// MPTokenIssuanceDestroy flags:
|
||||||
@@ -243,11 +249,15 @@ constexpr std::uint32_t tfWithdrawMask = ~(tfUniversal | tfWithdrawSubTx);
|
|||||||
constexpr std::uint32_t tfDepositMask = ~(tfUniversal | tfDepositSubTx);
|
constexpr std::uint32_t tfDepositMask = ~(tfUniversal | tfDepositSubTx);
|
||||||
|
|
||||||
// AMMClawback flags:
|
// AMMClawback flags:
|
||||||
constexpr std::uint32_t tfClawTwoAssets = 0x00000001;
|
enum AMMClawbackFlags : uint32_t {
|
||||||
|
tfClawTwoAssets = 0x00000001,
|
||||||
|
};
|
||||||
constexpr std::uint32_t tfAMMClawbackMask = ~(tfUniversal | tfClawTwoAssets);
|
constexpr std::uint32_t tfAMMClawbackMask = ~(tfUniversal | tfClawTwoAssets);
|
||||||
|
|
||||||
// BridgeModify flags:
|
// BridgeModify flags:
|
||||||
constexpr std::uint32_t tfClearAccountCreateAmount = 0x00010000;
|
enum BridgeModifyFlags : uint32_t {
|
||||||
|
tfClearAccountCreateAmount = 0x00010000,
|
||||||
|
};
|
||||||
constexpr std::uint32_t tfBridgeModifyMask = ~(tfUniversal | tfClearAccountCreateAmount);
|
constexpr std::uint32_t tfBridgeModifyMask = ~(tfUniversal | tfClearAccountCreateAmount);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ private:
|
|||||||
|
|
||||||
if (find("UINT"))
|
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");
|
return replace("UINT", "Hash");
|
||||||
else
|
else
|
||||||
return replace("UINT", "UInt");
|
return replace("UINT", "UInt");
|
||||||
@@ -158,7 +158,9 @@ private:
|
|||||||
{"ID", "ID"},
|
{"ID", "ID"},
|
||||||
{"AMM", "AMM"},
|
{"AMM", "AMM"},
|
||||||
{"URITOKEN", "URIToken"},
|
{"URITOKEN", "URIToken"},
|
||||||
{"URI", "URI"}};
|
{"URI", "URI"},
|
||||||
|
{"DID", "DID"},
|
||||||
|
{"MPTOKEN", "MPToken"}};
|
||||||
|
|
||||||
std::string out;
|
std::string out;
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
@@ -385,6 +387,10 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto const translate_tt = [](std::string inp) -> std::string {
|
auto const translate_tt = [](std::string inp) -> std::string {
|
||||||
|
if (inp == "Amendment")
|
||||||
|
return "EnableAmendment";
|
||||||
|
if (inp == "Fee")
|
||||||
|
return "SetFee";
|
||||||
if (inp == "PaychanClaim")
|
if (inp == "PaychanClaim")
|
||||||
return "PaymentChannelClaim";
|
return "PaymentChannelClaim";
|
||||||
if (inp == "PaychanCreate")
|
if (inp == "PaychanCreate")
|
||||||
@@ -422,17 +428,50 @@ private:
|
|||||||
addFlagsToJson<NFTokenMintFlags>(ret, "NFTokenMint");
|
addFlagsToJson<NFTokenMintFlags>(ret, "NFTokenMint");
|
||||||
addFlagsToJson<NFTokenCreateOfferFlags>(ret, "NFTokenCreateOffer");
|
addFlagsToJson<NFTokenCreateOfferFlags>(ret, "NFTokenCreateOffer");
|
||||||
addFlagsToJson<ClaimRewardFlags>(ret, "ClaimReward");
|
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
|
struct FlagData
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
std::uint32_t value;
|
std::uint32_t value;
|
||||||
};
|
};
|
||||||
|
// URITokenMint
|
||||||
std::array<FlagData, 1> uriTokenMintFlags{{{"tfBurnable", tfBurnable}}};
|
std::array<FlagData, 1> uriTokenMintFlags{{{"tfBurnable", tfBurnable}}};
|
||||||
for (auto const& entry : uriTokenMintFlags)
|
for (auto const& entry : uriTokenMintFlags)
|
||||||
{
|
{
|
||||||
ret[jss::TRANSACTION_FLAGS]["URITokenMint"][entry.name] =
|
ret[jss::TRANSACTION_FLAGS]["URITokenMint"][entry.name] =
|
||||||
static_cast<uint32_t>(entry.value);
|
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:
|
// Transaction Indicies Flags:
|
||||||
ret[jss::TRANSACTION_FLAGS_INDICES] = Json::objectValue;
|
ret[jss::TRANSACTION_FLAGS_INDICES] = Json::objectValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user