public static TransactionV0 Decode(XdrDataInputStream stream)
        {
            TransactionV0 decodedTransactionV0 = new TransactionV0();

            decodedTransactionV0.SourceAccountEd25519 = Uint256.Decode(stream);
            decodedTransactionV0.Fee    = Uint32.Decode(stream);
            decodedTransactionV0.SeqNum = SequenceNumber.Decode(stream);
            int TimeBoundsPresent = stream.ReadInt();

            if (TimeBoundsPresent != 0)
            {
                decodedTransactionV0.TimeBounds = TimeBounds.Decode(stream);
            }

            decodedTransactionV0.Memo = Memo.Decode(stream);
            int operationssize = stream.ReadInt();

            decodedTransactionV0.Operations = new Operation[operationssize];
            for (int i = 0; i < operationssize; i++)
            {
                decodedTransactionV0.Operations[i] = Operation.Decode(stream);
            }

            decodedTransactionV0.Ext = TransactionV0Ext.Decode(stream);
            return(decodedTransactionV0);
        }
        public static void Encode(XdrDataOutputStream stream, TransactionV0 encodedTransactionV0)
        {
            Uint256.Encode(stream, encodedTransactionV0.SourceAccountEd25519);
            Uint32.Encode(stream, encodedTransactionV0.Fee);
            SequenceNumber.Encode(stream, encodedTransactionV0.SeqNum);
            if (encodedTransactionV0.TimeBounds != null)
            {
                stream.WriteInt(1);
                TimeBounds.Encode(stream, encodedTransactionV0.TimeBounds);
            }
            else
            {
                stream.WriteInt(0);
            }

            Memo.Encode(stream, encodedTransactionV0.Memo);
            int operationssize = encodedTransactionV0.Operations.Length;

            stream.WriteInt(operationssize);
            for (int i = 0; i < operationssize; i++)
            {
                Operation.Encode(stream, encodedTransactionV0.Operations[i]);
            }

            TransactionV0Ext.Encode(stream, encodedTransactionV0.Ext);
        }
예제 #3
0
        public static void Encode(XdrDataOutputStream stream, TransactionV0Envelope encodedTransactionV0Envelope)
        {
            TransactionV0.Encode(stream, encodedTransactionV0Envelope.Tx);
            int signaturessize = encodedTransactionV0Envelope.Signatures.Length;

            stream.WriteInt(signaturessize);
            for (int i = 0; i < signaturessize; i++)
            {
                DecoratedSignature.Encode(stream, encodedTransactionV0Envelope.Signatures[i]);
            }
        }
예제 #4
0
        public static TransactionV0Envelope Decode(XdrDataInputStream stream)
        {
            TransactionV0Envelope decodedTransactionV0Envelope = new TransactionV0Envelope();

            decodedTransactionV0Envelope.Tx = TransactionV0.Decode(stream);
            int signaturessize = stream.ReadInt();

            decodedTransactionV0Envelope.Signatures = new DecoratedSignature[signaturessize];
            for (int i = 0; i < signaturessize; i++)
            {
                decodedTransactionV0Envelope.Signatures[i] = DecoratedSignature.Decode(stream);
            }
            return(decodedTransactionV0Envelope);
        }