Serialize() {
        const buf = new util_1.default.Writer();
        // contract_name (string)
        {
            bytes_1.WriteVarChar(buf, this.contract_name, 8);
        }
        // body_of_agreement_type (uint8)
        {
            bytes_1.write(buf, this.body_of_agreement_type, 'uint8');
        }
        // body_of_agreement ([]byte)
        {
            bytes_1.WriteVarBin(buf, this.body_of_agreement, 32);
        }
        // contract_type (string)
        {
            bytes_1.WriteVarChar(buf, this.contract_type, 8);
        }
        // supporting_docs ([]Document)
        {
            bytes_1.WriteVariableSize(buf, this.supporting_docs.length, 8, 8);
            this.supporting_docs.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        // governing_law (string)
        {
            bytes_1.WriteFixedChar(buf, this.governing_law, 5);
        }
        // jurisdiction (string)
        {
            bytes_1.WriteFixedChar(buf, this.jurisdiction, 5);
        }
        // contract_expiration (Timestamp)
        {
            buf.write(this.contract_expiration.Serialize());
        }
        // contract_uri (string)
        {
            bytes_1.WriteVarChar(buf, this.contract_uri, 8);
        }
        // issuer (Entity)
        {
            buf.write(this.issuer.Serialize());
        }
        // issuer_logo_url (string)
        {
            bytes_1.WriteVarChar(buf, this.issuer_logo_url, 8);
        }
        // contract_operator_included (bool)
        {
            bytes_1.write(buf, this.contract_operator_included, 'bool');
        }
        // contract_operator (Entity)
        if (this.contract_operator_included) {
            buf.write(this.contract_operator.Serialize());
        }
        // contract_fee (uint64)
        {
            bytes_1.write(buf, this.contract_fee, 'uint64');
        }
        // voting_systems ([]VotingSystem)
        {
            bytes_1.WriteVariableSize(buf, this.voting_systems.length, 8, 8);
            this.voting_systems.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        // contract_auth_flags ([]byte)
        {
            bytes_1.WriteVarBin(buf, this.contract_auth_flags, 16);
        }
        // restricted_qty_assets (uint64)
        {
            bytes_1.write(buf, this.restricted_qty_assets, 'uint64');
        }
        // administration_proposal (bool)
        {
            bytes_1.write(buf, this.administration_proposal, 'bool');
        }
        // holder_proposal (bool)
        {
            bytes_1.write(buf, this.holder_proposal, 'bool');
        }
        // oracles ([]Oracle)
        {
            bytes_1.WriteVariableSize(buf, this.oracles.length, 8, 8);
            this.oracles.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        // master_pkh (PublicKeyHash)
        {
            buf.write(this.master_pkh.Serialize());
        }
        // contract_revision (uint32)
        {
            bytes_1.write(buf, this.contract_revision, 'uint32');
        }
        // timestamp (Timestamp)
        {
            buf.write(this.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.WriteVarChar(buf, this.contract_name, 8);
        }
        {
            bytes_1.write(buf, this.body_of_agreement_type, 'uint8');
        }
        {
            bytes_1.WriteVarBin(buf, this.body_of_agreement, 32);
        }
        {
            bytes_1.WriteVarChar(buf, this.contract_type, 8);
        }
        {
            bytes_1.WriteVariableSize(buf, this.supporting_docs.length, 8, 8);
            this.supporting_docs.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        {
            bytes_1.WriteFixedChar(buf, this.governing_law, 5);
        }
        {
            bytes_1.WriteFixedChar(buf, this.jurisdiction, 5);
        }
        {
            buf.write(this.contract_expiration.Serialize());
        }
        {
            bytes_1.WriteVarChar(buf, this.contract_uri, 8);
        }
        {
            buf.write(this.issuer.Serialize());
        }
        {
            bytes_1.WriteVarChar(buf, this.issuer_logo_url, 8);
        }
        {
            bytes_1.write(buf, this.contract_operator_included, 'bool');
        }
        if (this.contract_operator_included) {
            buf.write(this.contract_operator.Serialize());
        }
        {
            bytes_1.write(buf, this.contract_fee, 'uint64');
        }
        {
            bytes_1.WriteVariableSize(buf, this.voting_systems.length, 8, 8);
            this.voting_systems.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        {
            bytes_1.WriteVarBin(buf, this.contract_auth_flags, 16);
        }
        {
            bytes_1.write(buf, this.restricted_qty_assets, 'uint64');
        }
        {
            bytes_1.write(buf, this.administration_proposal, 'bool');
        }
        {
            bytes_1.write(buf, this.holder_proposal, 'bool');
        }
        {
            bytes_1.WriteVariableSize(buf, this.oracles.length, 8, 8);
            this.oracles.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        {
            buf.write(this.master_pkh.Serialize());
        }
        {
            bytes_1.write(buf, this.contract_revision, 'uint32');
        }
        {
            buf.write(this.timestamp.Serialize());
        }
        return buf.buf;
    }
Serialize ( ) { const buf = new util_1 . default . Writer ( ) ; { bytes_1 . WriteVarChar ( buf , this . contract_name , 8 ) ; } { bytes_1 . write ( buf , this . body_of_agreement_type , 'uint8' ) ; } { bytes_1 . WriteVarBin ( buf , this . body_of_agreement , 32 ) ; } { bytes_1 . WriteVarChar ( buf , this . contract_type , 8 ) ; } { bytes_1 . WriteVariableSize ( buf , this . supporting_docs . length , 8 , 8 ) ; this . supporting_docs . forEach ( ( value ) => { buf . write ( value . Serialize ( ) ) ; } ) ; } { bytes_1 . WriteFixedChar ( buf , this . governing_law , 5 ) ; } { bytes_1 . WriteFixedChar ( buf , this . jurisdiction , 5 ) ; } { buf . write ( this . contract_expiration . Serialize ( ) ) ; } { bytes_1 . WriteVarChar ( buf , this . contract_uri , 8 ) ; } { buf . write ( this . issuer . Serialize ( ) ) ; } { bytes_1 . WriteVarChar ( buf , this . issuer_logo_url , 8 ) ; } { bytes_1 . write ( buf , this . contract_operator_included , 'bool' ) ; } if ( this . contract_operator_included ) { buf . write ( this . contract_operator . Serialize ( ) ) ; } { bytes_1 . write ( buf , this . contract_fee , 'uint64' ) ; } { bytes_1 . WriteVariableSize ( buf , this . voting_systems . length , 8 , 8 ) ; this . voting_systems . forEach ( ( value ) => { buf . write ( value . Serialize ( ) ) ; } ) ; } { bytes_1 . WriteVarBin ( buf , this . contract_auth_flags , 16 ) ; } { bytes_1 . write ( buf , this . restricted_qty_assets , 'uint64' ) ; } { bytes_1 . write ( buf , this . administration_proposal , 'bool' ) ; } { bytes_1 . write ( buf , this . holder_proposal , 'bool' ) ; } { bytes_1 . WriteVariableSize ( buf , this . oracles . length , 8 , 8 ) ; this . oracles . forEach ( ( value ) => { buf . write ( value . Serialize ( ) ) ; } ) ; } { buf . write ( this . master_pkh . Serialize ( ) ) ; } { bytes_1 . write ( buf , this . contract_revision , 'uint32' ) ; } { buf . write ( this . timestamp . Serialize ( ) ) ; } return buf . buf ; }
serialize returns the full OP_RETURN payload bytes.
serialize returns the full OP_RETURN payload bytes .
// contract_name (string) // body_of_agreement_type (uint8) // body_of_agreement ([]byte) // contract_type (string) // supporting_docs ([]Document) // governing_law (string) // jurisdiction (string) // contract_expiration (Timestamp) // contract_uri (string) // issuer (Entity) // issuer_logo_url (string) // contract_operator_included (bool) // contract_operator (Entity) // contract_fee (uint64) // voting_systems ([]VotingSystem) // contract_auth_flags ([]byte) // restricted_qty_assets (uint64) // administration_proposal (bool) // holder_proposal (bool) // oracles ([]Oracle) // master_pkh (PublicKeyHash) // contract_revision (uint32) // timestamp (Timestamp)