public static OperationBody Decode(XdrDataInputStream stream) { OperationBody decodedOperationBody = new OperationBody(); OperationType discriminant = OperationType.Decode(stream); decodedOperationBody.Discriminant = discriminant; switch (decodedOperationBody.Discriminant.InnerValue) { case OperationType.OperationTypeEnum.CREATE_ACCOUNT: decodedOperationBody.CreateAccountOp = CreateAccountOp.Decode(stream); break; case OperationType.OperationTypeEnum.PAYMENT: decodedOperationBody.PaymentOp = PaymentOp.Decode(stream); break; case OperationType.OperationTypeEnum.PATH_PAYMENT: decodedOperationBody.PathPaymentOp = PathPaymentOp.Decode(stream); break; case OperationType.OperationTypeEnum.MANAGE_OFFER: decodedOperationBody.ManageOfferOp = ManageOfferOp.Decode(stream); break; case OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER: decodedOperationBody.CreatePassiveOfferOp = CreatePassiveOfferOp.Decode(stream); break; case OperationType.OperationTypeEnum.SET_OPTIONS: decodedOperationBody.SetOptionsOp = SetOptionsOp.Decode(stream); break; case OperationType.OperationTypeEnum.CHANGE_TRUST: decodedOperationBody.ChangeTrustOp = ChangeTrustOp.Decode(stream); break; case OperationType.OperationTypeEnum.ALLOW_TRUST: decodedOperationBody.AllowTrustOp = AllowTrustOp.Decode(stream); break; case OperationType.OperationTypeEnum.ACCOUNT_MERGE: decodedOperationBody.Destination = AccountID.Decode(stream); break; case OperationType.OperationTypeEnum.INFLATION: break; case OperationType.OperationTypeEnum.MANAGE_DATA: decodedOperationBody.ManageDataOp = ManageDataOp.Decode(stream); break; case OperationType.OperationTypeEnum.BUMP_SEQUENCE: decodedOperationBody.BumpSequenceOp = BumpSequenceOp.Decode(stream); break; } return(decodedOperationBody); }
public static SetOptionsOp Decode(IByteReader stream) { SetOptionsOp decodedSetOptionsOp = new SetOptionsOp(); int inflationDestPresent = XdrEncoding.DecodeInt32(stream); if (inflationDestPresent != 0) { decodedSetOptionsOp.InflationDest = AccountID.Decode(stream); } int clearFlagsPresent = XdrEncoding.DecodeInt32(stream); if (clearFlagsPresent != 0) { decodedSetOptionsOp.ClearFlags = Uint32.Decode(stream); } int setFlagsPresent = XdrEncoding.DecodeInt32(stream); if (setFlagsPresent != 0) { decodedSetOptionsOp.SetFlags = Uint32.Decode(stream); } int masterWeightPresent = XdrEncoding.DecodeInt32(stream); if (masterWeightPresent != 0) { decodedSetOptionsOp.MasterWeight = Uint32.Decode(stream); } int lowThresholdPresent = XdrEncoding.DecodeInt32(stream); if (lowThresholdPresent != 0) { decodedSetOptionsOp.LowThreshold = Uint32.Decode(stream); } int medThresholdPresent = XdrEncoding.DecodeInt32(stream); if (medThresholdPresent != 0) { decodedSetOptionsOp.MedThreshold = Uint32.Decode(stream); } int highThresholdPresent = XdrEncoding.DecodeInt32(stream); if (highThresholdPresent != 0) { decodedSetOptionsOp.HighThreshold = Uint32.Decode(stream); } int homeDomainPresent = XdrEncoding.DecodeInt32(stream); if (homeDomainPresent != 0) { decodedSetOptionsOp.HomeDomain = String32.Decode(stream); } int signerPresent = XdrEncoding.DecodeInt32(stream); if (signerPresent != 0) { decodedSetOptionsOp.Signer = Signer.Decode(stream); } return(decodedSetOptionsOp); }
public static SetOptionsOp Decode(XdrDataInputStream stream) { var decodedSetOptionsOp = new SetOptionsOp(); var InflationDestPresent = stream.ReadInt(); if (InflationDestPresent != 0) { decodedSetOptionsOp.InflationDest = AccountID.Decode(stream); } var ClearFlagsPresent = stream.ReadInt(); if (ClearFlagsPresent != 0) { decodedSetOptionsOp.ClearFlags = Uint32.Decode(stream); } var SetFlagsPresent = stream.ReadInt(); if (SetFlagsPresent != 0) { decodedSetOptionsOp.SetFlags = Uint32.Decode(stream); } var MasterWeightPresent = stream.ReadInt(); if (MasterWeightPresent != 0) { decodedSetOptionsOp.MasterWeight = Uint32.Decode(stream); } var LowThresholdPresent = stream.ReadInt(); if (LowThresholdPresent != 0) { decodedSetOptionsOp.LowThreshold = Uint32.Decode(stream); } var MedThresholdPresent = stream.ReadInt(); if (MedThresholdPresent != 0) { decodedSetOptionsOp.MedThreshold = Uint32.Decode(stream); } var HighThresholdPresent = stream.ReadInt(); if (HighThresholdPresent != 0) { decodedSetOptionsOp.HighThreshold = Uint32.Decode(stream); } var HomeDomainPresent = stream.ReadInt(); if (HomeDomainPresent != 0) { decodedSetOptionsOp.HomeDomain = String32.Decode(stream); } var SignerPresent = stream.ReadInt(); if (SignerPresent != 0) { decodedSetOptionsOp.Signer = Signer.Decode(stream); } return(decodedSetOptionsOp); }
public static void Encode(IByteWriter stream, SetOptionsOp encodedSetOptionsOp) { if (encodedSetOptionsOp.InflationDest != null) { XdrEncoding.EncodeInt32(1, stream); AccountID.Encode(stream, encodedSetOptionsOp.InflationDest); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.ClearFlags != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.ClearFlags); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.SetFlags != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.SetFlags); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.MasterWeight != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.MasterWeight); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.LowThreshold != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.LowThreshold); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.MedThreshold != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.MedThreshold); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.HighThreshold != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.HighThreshold); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.HomeDomain != null) { XdrEncoding.EncodeInt32(1, stream); String32.Encode(stream, encodedSetOptionsOp.HomeDomain); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.Signer != null) { XdrEncoding.EncodeInt32(1, stream); Signer.Encode(stream, encodedSetOptionsOp.Signer); } else { XdrEncoding.EncodeInt32(0, stream); } }
public static void Encode(XdrDataOutputStream stream, OperationBody encodedOperationBody) { stream.WriteInt((int)encodedOperationBody.Discriminant.InnerValue); switch (encodedOperationBody.Discriminant.InnerValue) { case OperationType.OperationTypeEnum.CREATE_ACCOUNT: CreateAccountOp.Encode(stream, encodedOperationBody.CreateAccountOp); break; case OperationType.OperationTypeEnum.PAYMENT: PaymentOp.Encode(stream, encodedOperationBody.PaymentOp); break; case OperationType.OperationTypeEnum.PATH_PAYMENT: PathPaymentOp.Encode(stream, encodedOperationBody.PathPaymentOp); break; case OperationType.OperationTypeEnum.MANAGE_OFFER: ManageOfferOp.Encode(stream, encodedOperationBody.ManageOfferOp); break; case OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER: CreatePassiveOfferOp.Encode(stream, encodedOperationBody.CreatePassiveOfferOp); break; case OperationType.OperationTypeEnum.SET_OPTIONS: SetOptionsOp.Encode(stream, encodedOperationBody.SetOptionsOp); break; case OperationType.OperationTypeEnum.CHANGE_TRUST: ChangeTrustOp.Encode(stream, encodedOperationBody.ChangeTrustOp); break; case OperationType.OperationTypeEnum.ALLOW_TRUST: AllowTrustOp.Encode(stream, encodedOperationBody.AllowTrustOp); break; case OperationType.OperationTypeEnum.ACCOUNT_MERGE: AccountID.Encode(stream, encodedOperationBody.Destination); break; case OperationType.OperationTypeEnum.INFLATION: break; case OperationType.OperationTypeEnum.MANAGE_DATA: ManageDataOp.Encode(stream, encodedOperationBody.ManageDataOp); break; case OperationType.OperationTypeEnum.BUMP_SEQUENCE: BumpSequenceOp.Encode(stream, encodedOperationBody.BumpSequenceOp); break; } }
public static void Encode(XdrDataOutputStream stream, SetOptionsOp encodedSetOptionsOp) { if (encodedSetOptionsOp.InflationDest != null) { stream.WriteInt(1); AccountID.Encode(stream, encodedSetOptionsOp.InflationDest); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.ClearFlags != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.ClearFlags); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.SetFlags != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.SetFlags); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.MasterWeight != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.MasterWeight); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.LowThreshold != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.LowThreshold); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.MedThreshold != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.MedThreshold); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.HighThreshold != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.HighThreshold); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.HomeDomain != null) { stream.WriteInt(1); String32.Encode(stream, encodedSetOptionsOp.HomeDomain); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.Signer != null) { stream.WriteInt(1); Signer.Encode(stream, encodedSetOptionsOp.Signer); } else { stream.WriteInt(0); } }
public static SetOptionsOp Decode(IByteReader stream) { SetOptionsOp decodedSetOptionsOp = new SetOptionsOp(); int inflationDestPresent = XdrEncoding.DecodeInt32(stream); if (inflationDestPresent != 0) { decodedSetOptionsOp.InflationDest = AccountID.Decode(stream); } int clearFlagsPresent = XdrEncoding.DecodeInt32(stream); if (clearFlagsPresent != 0) { decodedSetOptionsOp.ClearFlags = Uint32.Decode(stream); } int setFlagsPresent = XdrEncoding.DecodeInt32(stream); if (setFlagsPresent != 0) { decodedSetOptionsOp.SetFlags = Uint32.Decode(stream); } int masterWeightPresent = XdrEncoding.DecodeInt32(stream); if (masterWeightPresent != 0) { decodedSetOptionsOp.MasterWeight = Uint32.Decode(stream); } int lowThresholdPresent = XdrEncoding.DecodeInt32(stream); if (lowThresholdPresent != 0) { decodedSetOptionsOp.LowThreshold = Uint32.Decode(stream); } int medThresholdPresent = XdrEncoding.DecodeInt32(stream); if (medThresholdPresent != 0) { decodedSetOptionsOp.MedThreshold = Uint32.Decode(stream); } int highThresholdPresent = XdrEncoding.DecodeInt32(stream); if (highThresholdPresent != 0) { decodedSetOptionsOp.HighThreshold = Uint32.Decode(stream); } int homeDomainPresent = XdrEncoding.DecodeInt32(stream); if (homeDomainPresent != 0) { decodedSetOptionsOp.HomeDomain = String32.Decode(stream); } int signerPresent = XdrEncoding.DecodeInt32(stream); if (signerPresent != 0) { decodedSetOptionsOp.Signer = Signer.Decode(stream); } return decodedSetOptionsOp; }
public static OperationBody Decode(XdrDataInputStream stream) { OperationBody decodedOperationBody = new OperationBody(); OperationType discriminant = OperationType.Decode(stream); decodedOperationBody.Discriminant = discriminant; switch (decodedOperationBody.Discriminant.InnerValue) { case OperationType.OperationTypeEnum.CREATE_ACCOUNT: decodedOperationBody.CreateAccountOp = CreateAccountOp.Decode(stream); break; case OperationType.OperationTypeEnum.PAYMENT: decodedOperationBody.PaymentOp = PaymentOp.Decode(stream); break; case OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_RECEIVE: decodedOperationBody.PathPaymentStrictReceiveOp = PathPaymentStrictReceiveOp.Decode(stream); break; case OperationType.OperationTypeEnum.MANAGE_SELL_OFFER: decodedOperationBody.ManageSellOfferOp = ManageSellOfferOp.Decode(stream); break; case OperationType.OperationTypeEnum.CREATE_PASSIVE_SELL_OFFER: decodedOperationBody.CreatePassiveSellOfferOp = CreatePassiveSellOfferOp.Decode(stream); break; case OperationType.OperationTypeEnum.SET_OPTIONS: decodedOperationBody.SetOptionsOp = SetOptionsOp.Decode(stream); break; case OperationType.OperationTypeEnum.CHANGE_TRUST: decodedOperationBody.ChangeTrustOp = ChangeTrustOp.Decode(stream); break; case OperationType.OperationTypeEnum.ALLOW_TRUST: decodedOperationBody.AllowTrustOp = AllowTrustOp.Decode(stream); break; case OperationType.OperationTypeEnum.ACCOUNT_MERGE: decodedOperationBody.Destination = MuxedAccount.Decode(stream); break; case OperationType.OperationTypeEnum.INFLATION: break; case OperationType.OperationTypeEnum.MANAGE_DATA: decodedOperationBody.ManageDataOp = ManageDataOp.Decode(stream); break; case OperationType.OperationTypeEnum.BUMP_SEQUENCE: decodedOperationBody.BumpSequenceOp = BumpSequenceOp.Decode(stream); break; case OperationType.OperationTypeEnum.MANAGE_BUY_OFFER: decodedOperationBody.ManageBuyOfferOp = ManageBuyOfferOp.Decode(stream); break; case OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_SEND: decodedOperationBody.PathPaymentStrictSendOp = PathPaymentStrictSendOp.Decode(stream); break; case OperationType.OperationTypeEnum.CREATE_CLAIMABLE_BALANCE: decodedOperationBody.CreateClaimableBalanceOp = CreateClaimableBalanceOp.Decode(stream); break; case OperationType.OperationTypeEnum.CLAIM_CLAIMABLE_BALANCE: decodedOperationBody.ClaimClaimableBalanceOp = ClaimClaimableBalanceOp.Decode(stream); break; case OperationType.OperationTypeEnum.BEGIN_SPONSORING_FUTURE_RESERVES: decodedOperationBody.BeginSponsoringFutureReservesOp = BeginSponsoringFutureReservesOp.Decode(stream); break; case OperationType.OperationTypeEnum.END_SPONSORING_FUTURE_RESERVES: break; case OperationType.OperationTypeEnum.REVOKE_SPONSORSHIP: decodedOperationBody.RevokeSponsorshipOp = RevokeSponsorshipOp.Decode(stream); break; } return(decodedOperationBody); }
public static void Encode(XdrDataOutputStream stream, OperationBody encodedOperationBody) { stream.WriteInt((int)encodedOperationBody.Discriminant.InnerValue); switch (encodedOperationBody.Discriminant.InnerValue) { case OperationType.OperationTypeEnum.CREATE_ACCOUNT: CreateAccountOp.Encode(stream, encodedOperationBody.CreateAccountOp); break; case OperationType.OperationTypeEnum.PAYMENT: PaymentOp.Encode(stream, encodedOperationBody.PaymentOp); break; case OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_RECEIVE: PathPaymentStrictReceiveOp.Encode(stream, encodedOperationBody.PathPaymentStrictReceiveOp); break; case OperationType.OperationTypeEnum.MANAGE_SELL_OFFER: ManageSellOfferOp.Encode(stream, encodedOperationBody.ManageSellOfferOp); break; case OperationType.OperationTypeEnum.CREATE_PASSIVE_SELL_OFFER: CreatePassiveSellOfferOp.Encode(stream, encodedOperationBody.CreatePassiveSellOfferOp); break; case OperationType.OperationTypeEnum.SET_OPTIONS: SetOptionsOp.Encode(stream, encodedOperationBody.SetOptionsOp); break; case OperationType.OperationTypeEnum.CHANGE_TRUST: ChangeTrustOp.Encode(stream, encodedOperationBody.ChangeTrustOp); break; case OperationType.OperationTypeEnum.ALLOW_TRUST: AllowTrustOp.Encode(stream, encodedOperationBody.AllowTrustOp); break; case OperationType.OperationTypeEnum.ACCOUNT_MERGE: MuxedAccount.Encode(stream, encodedOperationBody.Destination); break; case OperationType.OperationTypeEnum.INFLATION: break; case OperationType.OperationTypeEnum.MANAGE_DATA: ManageDataOp.Encode(stream, encodedOperationBody.ManageDataOp); break; case OperationType.OperationTypeEnum.BUMP_SEQUENCE: BumpSequenceOp.Encode(stream, encodedOperationBody.BumpSequenceOp); break; case OperationType.OperationTypeEnum.MANAGE_BUY_OFFER: ManageBuyOfferOp.Encode(stream, encodedOperationBody.ManageBuyOfferOp); break; case OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_SEND: PathPaymentStrictSendOp.Encode(stream, encodedOperationBody.PathPaymentStrictSendOp); break; case OperationType.OperationTypeEnum.CREATE_CLAIMABLE_BALANCE: CreateClaimableBalanceOp.Encode(stream, encodedOperationBody.CreateClaimableBalanceOp); break; case OperationType.OperationTypeEnum.CLAIM_CLAIMABLE_BALANCE: ClaimClaimableBalanceOp.Encode(stream, encodedOperationBody.ClaimClaimableBalanceOp); break; case OperationType.OperationTypeEnum.BEGIN_SPONSORING_FUTURE_RESERVES: BeginSponsoringFutureReservesOp.Encode(stream, encodedOperationBody.BeginSponsoringFutureReservesOp); break; case OperationType.OperationTypeEnum.END_SPONSORING_FUTURE_RESERVES: break; case OperationType.OperationTypeEnum.REVOKE_SPONSORSHIP: RevokeSponsorshipOp.Encode(stream, encodedOperationBody.RevokeSponsorshipOp); break; } }