Serialize() {
        const buf = new util_1.default.Writer();
        // initiator (uint8)
        {
            bytes_1.write(buf, this.initiator, 'uint8');
        }
        // asset_specific_vote (bool)
        {
            bytes_1.write(buf, this.asset_specific_vote, 'bool');
        }
        // asset_type (string)
        if (this.asset_specific_vote) {
            bytes_1.WriteFixedChar(buf, this.asset_type, 3);
        }
        // asset_code (AssetCode)
        if (this.asset_specific_vote) {
            buf.write(this.asset_code.Serialize());
        }
        // vote_system (uint8)
        {
            bytes_1.write(buf, this.vote_system, 'uint8');
        }
        // specific (bool)
        {
            bytes_1.write(buf, this.specific, 'bool');
        }
        // proposed_amendments ([]Amendment)
        if (this.specific) {
            bytes_1.WriteVariableSize(buf, this.proposed_amendments.length, 8, 8);
            this.proposed_amendments.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        // vote_options (string)
        {
            bytes_1.WriteVarChar(buf, this.vote_options, 8);
        }
        // vote_max (uint8)
        {
            bytes_1.write(buf, this.vote_max, 'uint8');
        }
        // proposal_description (string)
        {
            bytes_1.WriteVarChar(buf, this.proposal_description, 32);
        }
        // proposal_document_hash ([32]byte)
        {
            bytes_1.write(buf, this.proposal_document_hash, '[32]byte');
        }
        // vote_cut_off_timestamp (Timestamp)
        {
            buf.write(this.vote_cut_off_timestamp.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.initiator, 'uint8');
        }
        {
            bytes_1.write(buf, this.asset_specific_vote, 'bool');
        }
        if (this.asset_specific_vote) {
            bytes_1.WriteFixedChar(buf, this.asset_type, 3);
        }
        if (this.asset_specific_vote) {
            buf.write(this.asset_code.Serialize());
        }
        {
            bytes_1.write(buf, this.vote_system, 'uint8');
        }
        {
            bytes_1.write(buf, this.specific, 'bool');
        }
        if (this.specific) {
            bytes_1.WriteVariableSize(buf, this.proposed_amendments.length, 8, 8);
            this.proposed_amendments.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        {
            bytes_1.WriteVarChar(buf, this.vote_options, 8);
        }
        {
            bytes_1.write(buf, this.vote_max, 'uint8');
        }
        {
            bytes_1.WriteVarChar(buf, this.proposal_description, 32);
        }
        {
            bytes_1.write(buf, this.proposal_document_hash, '[32]byte');
        }
        {
            buf.write(this.vote_cut_off_timestamp.Serialize());
        }
        return buf.buf;
    }
Serialize ( ) { const buf = new util_1 . default . Writer ( ) ; { bytes_1 . write ( buf , this . initiator , 'uint8' ) ; } { bytes_1 . write ( buf , this . asset_specific_vote , 'bool' ) ; } if ( this . asset_specific_vote ) { bytes_1 . WriteFixedChar ( buf , this . asset_type , 3 ) ; } if ( this . asset_specific_vote ) { buf . write ( this . asset_code . Serialize ( ) ) ; } { bytes_1 . write ( buf , this . vote_system , 'uint8' ) ; } { bytes_1 . write ( buf , this . specific , 'bool' ) ; } if ( this . specific ) { bytes_1 . WriteVariableSize ( buf , this . proposed_amendments . length , 8 , 8 ) ; this . proposed_amendments . forEach ( ( value ) => { buf . write ( value . Serialize ( ) ) ; } ) ; } { bytes_1 . WriteVarChar ( buf , this . vote_options , 8 ) ; } { bytes_1 . write ( buf , this . vote_max , 'uint8' ) ; } { bytes_1 . WriteVarChar ( buf , this . proposal_description , 32 ) ; } { bytes_1 . write ( buf , this . proposal_document_hash , '[32]byte' ) ; } { buf . write ( this . vote_cut_off_timestamp . Serialize ( ) ) ; } return buf . buf ; }
serialize returns the full OP_RETURN payload bytes.
serialize returns the full OP_RETURN payload bytes .
// initiator (uint8) // asset_specific_vote (bool) // asset_type (string) // asset_code (AssetCode) // vote_system (uint8) // specific (bool) // proposed_amendments ([]Amendment) // vote_options (string) // vote_max (uint8) // proposal_description (string) // proposal_document_hash ([32]byte) // vote_cut_off_timestamp (Timestamp)