Serialize() {
        const buf = new util_1.default.Writer();
        // compliance_action (byte)
        {
            bytes_1.write(buf, this.compliance_action, 'byte');
        }
        // asset_type (string)
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('C') || this.compliance_action === bytes_1.char('R')) {
            bytes_1.WriteFixedChar(buf, this.asset_type, 3);
        }
        // asset_code (AssetCode)
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('C') || this.compliance_action === bytes_1.char('R')) {
            buf.write(this.asset_code.Serialize());
        }
        // target_addresses ([]TargetAddress)
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('C') || this.compliance_action === bytes_1.char('R')) {
            bytes_1.WriteVariableSize(buf, this.target_addresses.length, 16, 8);
            this.target_addresses.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        // freeze_tx_id (TxId)
        if (this.compliance_action === bytes_1.char('T')) {
            buf.write(this.freeze_tx_id.Serialize());
        }
        // freeze_period (Timestamp)
        if (this.compliance_action === bytes_1.char('F')) {
            buf.write(this.freeze_period.Serialize());
        }
        // deposit_address (PublicKeyHash)
        if (this.compliance_action === bytes_1.char('C')) {
            buf.write(this.deposit_address.Serialize());
        }
        // authority_included (bool)
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('T') || this.compliance_action === bytes_1.char('C')) {
            bytes_1.write(buf, this.authority_included, 'bool');
        }
        // authority_name (string)
        if (this.authority_included) {
            bytes_1.WriteVarChar(buf, this.authority_name, 8);
        }
        // authority_public_key ([]byte)
        if (this.authority_included) {
            bytes_1.WriteVarBin(buf, this.authority_public_key, 8);
        }
        // signature_algorithm (uint8)
        if (this.authority_included) {
            bytes_1.write(buf, this.signature_algorithm, 'uint8');
        }
        // order_signature ([]byte)
        if (this.authority_included) {
            bytes_1.WriteVarBin(buf, this.order_signature, 8);
        }
        // supporting_evidence_hash ([32]byte)
        {
            bytes_1.write(buf, this.supporting_evidence_hash, '[32]byte');
        }
        // ref_txs ([]byte)
        if (this.compliance_action === bytes_1.char('R')) {
            bytes_1.WriteVarBin(buf, this.ref_txs, 32);
        }
        // bitcoin_dispersions ([]QuantityIndex)
        if (this.compliance_action === bytes_1.char('R')) {
            bytes_1.WriteVariableSize(buf, this.bitcoin_dispersions.length, 16, 8);
            this.bitcoin_dispersions.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        // message (string)
        {
            bytes_1.WriteVarChar(buf, this.message, 32);
        }
        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.compliance_action, 'byte');
        }
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('C') || this.compliance_action === bytes_1.char('R')) {
            bytes_1.WriteFixedChar(buf, this.asset_type, 3);
        }
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('C') || this.compliance_action === bytes_1.char('R')) {
            buf.write(this.asset_code.Serialize());
        }
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('C') || this.compliance_action === bytes_1.char('R')) {
            bytes_1.WriteVariableSize(buf, this.target_addresses.length, 16, 8);
            this.target_addresses.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        if (this.compliance_action === bytes_1.char('T')) {
            buf.write(this.freeze_tx_id.Serialize());
        }
        if (this.compliance_action === bytes_1.char('F')) {
            buf.write(this.freeze_period.Serialize());
        }
        if (this.compliance_action === bytes_1.char('C')) {
            buf.write(this.deposit_address.Serialize());
        }
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('T') || this.compliance_action === bytes_1.char('C')) {
            bytes_1.write(buf, this.authority_included, 'bool');
        }
        if (this.authority_included) {
            bytes_1.WriteVarChar(buf, this.authority_name, 8);
        }
        if (this.authority_included) {
            bytes_1.WriteVarBin(buf, this.authority_public_key, 8);
        }
        if (this.authority_included) {
            bytes_1.write(buf, this.signature_algorithm, 'uint8');
        }
        if (this.authority_included) {
            bytes_1.WriteVarBin(buf, this.order_signature, 8);
        }
        {
            bytes_1.write(buf, this.supporting_evidence_hash, '[32]byte');
        }
        if (this.compliance_action === bytes_1.char('R')) {
            bytes_1.WriteVarBin(buf, this.ref_txs, 32);
        }
        if (this.compliance_action === bytes_1.char('R')) {
            bytes_1.WriteVariableSize(buf, this.bitcoin_dispersions.length, 16, 8);
            this.bitcoin_dispersions.forEach((value) => {
                buf.write(value.Serialize());
            });
        }
        {
            bytes_1.WriteVarChar(buf, this.message, 32);
        }
        return buf.buf;
    }
Serialize ( ) { const buf = new util_1 . default . Writer ( ) ; { bytes_1 . write ( buf , this . compliance_action , 'byte' ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) || this . compliance_action === bytes_1 . char ( 'C' ) || this . compliance_action === bytes_1 . char ( 'R' ) ) { bytes_1 . WriteFixedChar ( buf , this . asset_type , 3 ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) || this . compliance_action === bytes_1 . char ( 'C' ) || this . compliance_action === bytes_1 . char ( 'R' ) ) { buf . write ( this . asset_code . Serialize ( ) ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) || this . compliance_action === bytes_1 . char ( 'C' ) || this . compliance_action === bytes_1 . char ( 'R' ) ) { bytes_1 . WriteVariableSize ( buf , this . target_addresses . length , 16 , 8 ) ; this . target_addresses . forEach ( ( value ) => { buf . write ( value . Serialize ( ) ) ; } ) ; } if ( this . compliance_action === bytes_1 . char ( 'T' ) ) { buf . write ( this . freeze_tx_id . Serialize ( ) ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) ) { buf . write ( this . freeze_period . Serialize ( ) ) ; } if ( this . compliance_action === bytes_1 . char ( 'C' ) ) { buf . write ( this . deposit_address . Serialize ( ) ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) || this . compliance_action === bytes_1 . char ( 'T' ) || this . compliance_action === bytes_1 . char ( 'C' ) ) { bytes_1 . write ( buf , this . authority_included , 'bool' ) ; } if ( this . authority_included ) { bytes_1 . WriteVarChar ( buf , this . authority_name , 8 ) ; } if ( this . authority_included ) { bytes_1 . WriteVarBin ( buf , this . authority_public_key , 8 ) ; } if ( this . authority_included ) { bytes_1 . write ( buf , this . signature_algorithm , 'uint8' ) ; } if ( this . authority_included ) { bytes_1 . WriteVarBin ( buf , this . order_signature , 8 ) ; } { bytes_1 . write ( buf , this . supporting_evidence_hash , '[32]byte' ) ; } if ( this . compliance_action === bytes_1 . char ( 'R' ) ) { bytes_1 . WriteVarBin ( buf , this . ref_txs , 32 ) ; } if ( this . compliance_action === bytes_1 . char ( 'R' ) ) { bytes_1 . WriteVariableSize ( buf , this . bitcoin_dispersions . length , 16 , 8 ) ; this . bitcoin_dispersions . forEach ( ( value ) => { buf . write ( value . Serialize ( ) ) ; } ) ; } { bytes_1 . WriteVarChar ( buf , this . message , 32 ) ; } return buf . buf ; }
serialize returns the full OP_RETURN payload bytes.
serialize returns the full OP_RETURN payload bytes .
// compliance_action (byte) // asset_type (string) // asset_code (AssetCode) // target_addresses ([]TargetAddress) // freeze_tx_id (TxId) // freeze_period (Timestamp) // deposit_address (PublicKeyHash) // authority_included (bool) // authority_name (string) // authority_public_key ([]byte) // signature_algorithm (uint8) // order_signature ([]byte) // supporting_evidence_hash ([32]byte) // ref_txs ([]byte) // bitcoin_dispersions ([]QuantityIndex) // message (string)