public static CryptoKeyType Decode(XdrDataInputStream stream)
        {
            int value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(CryptoKeyTypeEnum.KEY_TYPE_ED25519));

            case 1: return(Create(CryptoKeyTypeEnum.KEY_TYPE_PRE_AUTH_TX));

            case 2: return(Create(CryptoKeyTypeEnum.KEY_TYPE_HASH_X));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static ManageOfferEffect Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(ManageOfferEffectEnum.MANAGE_OFFER_CREATED));

            case 1: return(Create(ManageOfferEffectEnum.MANAGE_OFFER_UPDATED));

            case 2: return(Create(ManageOfferEffectEnum.MANAGE_OFFER_DELETED));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
Exemple #3
0
        public static AssetType Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(AssetTypeEnum.ASSET_TYPE_NATIVE));

            case 1: return(Create(AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM4));

            case 2: return(Create(AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM12));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static AccountFlags Decode(XdrDataInputStream stream)
        {
            int value = stream.ReadInt();

            switch (value)
            {
            case 1: return(Create(AccountFlagsEnum.AUTH_REQUIRED_FLAG));

            case 2: return(Create(AccountFlagsEnum.AUTH_REVOCABLE_FLAG));

            case 4: return(Create(AccountFlagsEnum.AUTH_IMMUTABLE_FLAG));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static OperationResultCode Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(OperationResultCodeEnum.opINNER));

            case -1: return(Create(OperationResultCodeEnum.opBAD_AUTH));

            case -2: return(Create(OperationResultCodeEnum.opNO_ACCOUNT));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static LedgerUpgradeType Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 1: return(Create(LedgerUpgradeTypeEnum.LEDGER_UPGRADE_VERSION));

            case 2: return(Create(LedgerUpgradeTypeEnum.LEDGER_UPGRADE_BASE_FEE));

            case 3: return(Create(LedgerUpgradeTypeEnum.LEDGER_UPGRADE_MAX_TX_SET_SIZE));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static EnvelopeType Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 1: return(Create(EnvelopeTypeEnum.ENVELOPE_TYPE_SCP));

            case 2: return(Create(EnvelopeTypeEnum.ENVELOPE_TYPE_TX));

            case 3: return(Create(EnvelopeTypeEnum.ENVELOPE_TYPE_AUTH));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static LedgerEntryChangeType Decode(XdrDataInputStream stream)
        {
            int value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(LedgerEntryChangeTypeEnum.LEDGER_ENTRY_CREATED));

            case 1: return(Create(LedgerEntryChangeTypeEnum.LEDGER_ENTRY_UPDATED));

            case 2: return(Create(LedgerEntryChangeTypeEnum.LEDGER_ENTRY_REMOVED));

            case 3: return(Create(LedgerEntryChangeTypeEnum.LEDGER_ENTRY_STATE));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
Exemple #9
0
        public static SCPStatementType Decode(XdrDataInputStream stream)
        {
            int value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(SCPStatementTypeEnum.SCP_ST_PREPARE));

            case 1: return(Create(SCPStatementTypeEnum.SCP_ST_CONFIRM));

            case 2: return(Create(SCPStatementTypeEnum.SCP_ST_EXTERNALIZE));

            case 3: return(Create(SCPStatementTypeEnum.SCP_ST_NOMINATE));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
Exemple #10
0
        public static LedgerEntryType Decode(XdrDataInputStream stream)
        {
            int value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(LedgerEntryTypeEnum.ACCOUNT));

            case 1: return(Create(LedgerEntryTypeEnum.TRUSTLINE));

            case 2: return(Create(LedgerEntryTypeEnum.OFFER));

            case 3: return(Create(LedgerEntryTypeEnum.DATA));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static ThresholdIndexes Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(ThresholdIndexesEnum.THRESHOLD_MASTER_WEIGHT));

            case 1: return(Create(ThresholdIndexesEnum.THRESHOLD_LOW));

            case 2: return(Create(ThresholdIndexesEnum.THRESHOLD_MED));

            case 3: return(Create(ThresholdIndexesEnum.THRESHOLD_HIGH));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static CreateAccountResultCode Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(CreateAccountResultCodeEnum.CREATE_ACCOUNT_SUCCESS));

            case -1: return(Create(CreateAccountResultCodeEnum.CREATE_ACCOUNT_MALFORMED));

            case -2: return(Create(CreateAccountResultCodeEnum.CREATE_ACCOUNT_UNDERFUNDED));

            case -3: return(Create(CreateAccountResultCodeEnum.CREATE_ACCOUNT_LOW_RESERVE));

            case -4: return(Create(CreateAccountResultCodeEnum.CREATE_ACCOUNT_ALREADY_EXIST));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static ManageDataResultCode Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(ManageDataResultCodeEnum.MANAGE_DATA_SUCCESS));

            case -1: return(Create(ManageDataResultCodeEnum.MANAGE_DATA_NOT_SUPPORTED_YET));

            case -2: return(Create(ManageDataResultCodeEnum.MANAGE_DATA_NAME_NOT_FOUND));

            case -3: return(Create(ManageDataResultCodeEnum.MANAGE_DATA_LOW_RESERVE));

            case -4: return(Create(ManageDataResultCodeEnum.MANAGE_DATA_INVALID_NAME));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static ErrorCode Decode(XdrDataInputStream stream)
        {
            int value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(ErrorCodeEnum.ERR_MISC));

            case 1: return(Create(ErrorCodeEnum.ERR_DATA));

            case 2: return(Create(ErrorCodeEnum.ERR_CONF));

            case 3: return(Create(ErrorCodeEnum.ERR_AUTH));

            case 4: return(Create(ErrorCodeEnum.ERR_LOAD));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
Exemple #15
0
        public static MemoType Decode(XdrDataInputStream stream)
        {
            int value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(MemoTypeEnum.MEMO_NONE));

            case 1: return(Create(MemoTypeEnum.MEMO_TEXT));

            case 2: return(Create(MemoTypeEnum.MEMO_ID));

            case 3: return(Create(MemoTypeEnum.MEMO_HASH));

            case 4: return(Create(MemoTypeEnum.MEMO_RETURN));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
Exemple #16
0
        public static AccountMergeResultCode Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(AccountMergeResultCodeEnum.ACCOUNT_MERGE_SUCCESS));

            case -1: return(Create(AccountMergeResultCodeEnum.ACCOUNT_MERGE_MALFORMED));

            case -2: return(Create(AccountMergeResultCodeEnum.ACCOUNT_MERGE_NO_ACCOUNT));

            case -3: return(Create(AccountMergeResultCodeEnum.ACCOUNT_MERGE_IMMUTABLE_SET));

            case -4: return(Create(AccountMergeResultCodeEnum.ACCOUNT_MERGE_HAS_SUB_ENTRIES));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
Exemple #17
0
        public static AllowTrustResultCode Decode(XdrDataInputStream stream)
        {
            int value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(AllowTrustResultCodeEnum.ALLOW_TRUST_SUCCESS));

            case -1: return(Create(AllowTrustResultCodeEnum.ALLOW_TRUST_MALFORMED));

            case -2: return(Create(AllowTrustResultCodeEnum.ALLOW_TRUST_NO_TRUST_LINE));

            case -3: return(Create(AllowTrustResultCodeEnum.ALLOW_TRUST_TRUST_NOT_REQUIRED));

            case -4: return(Create(AllowTrustResultCodeEnum.ALLOW_TRUST_CANT_REVOKE));

            case -5: return(Create(AllowTrustResultCodeEnum.ALLOW_TRUST_SELF_NOT_ALLOWED));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
Exemple #18
0
        public static ChangeTrustResultCode Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(ChangeTrustResultCodeEnum.CHANGE_TRUST_SUCCESS));

            case -1: return(Create(ChangeTrustResultCodeEnum.CHANGE_TRUST_MALFORMED));

            case -2: return(Create(ChangeTrustResultCodeEnum.CHANGE_TRUST_NO_ISSUER));

            case -3: return(Create(ChangeTrustResultCodeEnum.CHANGE_TRUST_INVALID_LIMIT));

            case -4: return(Create(ChangeTrustResultCodeEnum.CHANGE_TRUST_LOW_RESERVE));

            case -5: return(Create(ChangeTrustResultCodeEnum.CHANGE_TRUST_SELF_NOT_ALLOWED));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static ManageOfferResultCode Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_SUCCESS));

            case -1: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_MALFORMED));

            case -2: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_SELL_NO_TRUST));

            case -3: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_BUY_NO_TRUST));

            case -4: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_SELL_NOT_AUTHORIZED));

            case -5: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_BUY_NOT_AUTHORIZED));

            case -6: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_LINE_FULL));

            case -7: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_UNDERFUNDED));

            case -8: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_CROSS_SELF));

            case -9: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_SELL_NO_ISSUER));

            case -10: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_BUY_NO_ISSUER));

            case -11: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_NOT_FOUND));

            case -12: return(Create(ManageOfferResultCodeEnum.MANAGE_OFFER_LOW_RESERVE));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
Exemple #20
0
        public static MessageType Decode(XdrDataInputStream stream)
        {
            int value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(MessageTypeEnum.ERROR_MSG));

            case 2: return(Create(MessageTypeEnum.AUTH));

            case 3: return(Create(MessageTypeEnum.DONT_HAVE));

            case 4: return(Create(MessageTypeEnum.GET_PEERS));

            case 5: return(Create(MessageTypeEnum.PEERS));

            case 6: return(Create(MessageTypeEnum.GET_TX_SET));

            case 7: return(Create(MessageTypeEnum.TX_SET));

            case 8: return(Create(MessageTypeEnum.TRANSACTION));

            case 9: return(Create(MessageTypeEnum.GET_SCP_QUORUMSET));

            case 10: return(Create(MessageTypeEnum.SCP_QUORUMSET));

            case 11: return(Create(MessageTypeEnum.SCP_MESSAGE));

            case 12: return(Create(MessageTypeEnum.GET_SCP_STATE));

            case 13: return(Create(MessageTypeEnum.HELLO));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }
        public static PathPaymentResultCode Decode(XdrDataInputStream stream)
        {
            var value = stream.ReadInt();

            switch (value)
            {
            case 0: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_SUCCESS));

            case -1: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_MALFORMED));

            case -2: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_UNDERFUNDED));

            case -3: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_SRC_NO_TRUST));

            case -4: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_SRC_NOT_AUTHORIZED));

            case -5: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_NO_DESTINATION));

            case -6: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_NO_TRUST));

            case -7: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_NOT_AUTHORIZED));

            case -8: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_LINE_FULL));

            case -9: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_NO_ISSUER));

            case -10: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_TOO_FEW_OFFERS));

            case -11: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_OFFER_CROSS_SELF));

            case -12: return(Create(PathPaymentResultCodeEnum.PATH_PAYMENT_OVER_SENDMAX));

            default:
                throw new Exception("Unknown enum value: " + value);
            }
        }