Ejemplo n.º 1
0
        public override xdr.Memo ToXdr()
        {
            var memo = new xdr.Memo();

            memo.Discriminant = MemoType.Create(MemoType.MemoTypeEnum.MEMO_NONE);
            return(memo);
        }
Ejemplo n.º 2
0
        public override xdr.Memo ToXdr()
        {
            var memo = new xdr.Memo();

            memo.Discriminant = MemoType.Create(MemoType.MemoTypeEnum.MEMO_TEXT);
            memo.Text         = MemoTextValue ?? "none";
            return(memo);
        }
Ejemplo n.º 3
0
        public override xdr.Memo ToXdr()
        {
            var memo = new xdr.Memo();

            memo.Discriminant = MemoType.Create(MemoType.MemoTypeEnum.MEMO_ID);
            var idXdr = new Uint64();

            idXdr.InnerValue = IdValue;
            memo.Id          = idXdr;
            return(memo);
        }
        public override xdr.Memo ToXdr()
        {
            var memo = new xdr.Memo();

            memo.Discriminant = MemoType.Create(MemoType.MemoTypeEnum.MEMO_RETURN);

            var hash = new Hash();

            hash.InnerValue = MemoBytes;

            memo.RetHash = hash;

            return(memo);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        public static Transaction Decode(XdrDataInputStream stream)
        {
            Transaction decodedTransaction = new Transaction();

            decodedTransaction.SourceAccount = MuxedAccount.Decode(stream);
            decodedTransaction.Fee           = Uint32.Decode(stream);
            decodedTransaction.SeqNum        = SequenceNumber.Decode(stream);
            int TimeBoundsPresent = stream.ReadInt();

            if (TimeBoundsPresent != 0)
            {
                decodedTransaction.TimeBounds = TimeBounds.Decode(stream);
            }
            decodedTransaction.Memo = Memo.Decode(stream);
            int operationssize = stream.ReadInt();

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