Serialize() {
        const buf = new util_1.default.Writer();
        // Version (uint8)
        {
            bytes_1.write(buf, this.version, 'uint8');
        }
        // Timestamp (Timestamp)
        {
            buf.write(this.timestamp.Serialize());
        }
        // Subject (string)
        {
            bytes_1.WriteVarChar(buf, this.subject, 16);
        }
        // Regarding (Output)
        {
            buf.write(this.regarding.Serialize());
        }
        // PrivateMessage (Document)
        {
            buf.write(this.private_message.Serialize());
        }
        // Attachments ([]Document)
        {
            bytes_1.WriteVariableSize(buf, this.attachments.length, 32, 8);
            this.attachments.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        return buf.buf;
    }
// Serialize returns the full OP_RETURN payload bytes.
Serialize returns the full OP_RETURN payload bytes.
Serialize returns the full OP_RETURN payload bytes .
Serialize() {
        const buf = new util_1.default.Writer();
        {
            bytes_1.write(buf, this.version, 'uint8');
        }
        {
            buf.write(this.timestamp.Serialize());
        }
        {
            bytes_1.WriteVarChar(buf, this.subject, 16);
        }
        {
            buf.write(this.regarding.Serialize());
        }
        {
            buf.write(this.private_message.Serialize());
        }
        {
            bytes_1.WriteVariableSize(buf, this.attachments.length, 32, 8);
            this.attachments.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        return buf.buf;
    }
Serialize ( ) { const buf = new util_1 . default . Writer ( ) ; { bytes_1 . write ( buf , this . version , 'uint8' ) ; } { buf . write ( this . timestamp . Serialize ( ) ) ; } { bytes_1 . WriteVarChar ( buf , this . subject , 16 ) ; } { buf . write ( this . regarding . Serialize ( ) ) ; } { buf . write ( this . private_message . Serialize ( ) ) ; } { bytes_1 . WriteVariableSize ( buf , this . attachments . length , 32 , 8 ) ; this . attachments . forEach ( ( value ) => { buf . write ( value . Serialize ( ) ) ; } ) ; } return buf . buf ; }
Serialize returns the full OP_RETURN payload bytes.
Serialize returns the full OP_RETURN payload bytes .
// Version (uint8) // Timestamp (Timestamp) // Subject (string) // Regarding (Output) // PrivateMessage (Document) // Attachments ([]Document)