write(b) {
        const buf = new util_1.default.Reader(b);
        // compliance_action (byte)
        {
            this.compliance_action = bytes_1.read(buf, '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')) {
            this.asset_type = bytes_1.ReadFixedChar(buf, 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')) {
            this.asset_code = new protocol_types_1.AssetCode();
            this.asset_code.Write(buf);
        }
        // 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')) {
            // IsInternalTypeArray
            const size = bytes_1.ReadVariableSize(buf, 16, 8);
            this.target_addresses = [];
            for (let i = 0; i < size; i++) {
                const newValue = new field_types_1.TargetAddress();
                newValue.Write(buf);
                this.target_addresses.push(newValue);
            }
        }
        // freeze_tx_id (TxId)
        if (this.compliance_action === bytes_1.char('T')) {
            this.freeze_tx_id = new protocol_types_1.TxId();
            this.freeze_tx_id.Write(buf);
        }
        // freeze_period (Timestamp)
        if (this.compliance_action === bytes_1.char('F')) {
            this.freeze_period = new protocol_types_1.Timestamp();
            this.freeze_period.Write(buf);
        }
        // deposit_address (PublicKeyHash)
        if (this.compliance_action === bytes_1.char('C')) {
            this.deposit_address = new protocol_types_1.PublicKeyHash();
            this.deposit_address.Write(buf);
        }
        // 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')) {
            this.authority_included = bytes_1.read(buf, 'bool');
        }
        // authority_name (string)
        if (this.authority_included) {
            this.authority_name = bytes_1.ReadVarChar(buf, 8);
        }
        // authority_public_key ([]byte)
        if (this.authority_included) {
            this.authority_public_key = bytes_1.ReadVarBin(buf, 8);
        }
        // signature_algorithm (uint8)
        if (this.authority_included) {
            this.signature_algorithm = bytes_1.read(buf, 'uint8');
        }
        // order_signature ([]byte)
        if (this.authority_included) {
            this.order_signature = bytes_1.ReadVarBin(buf, 8);
        }
        // supporting_evidence_hash ([32]byte)
        {
            this.supporting_evidence_hash = bytes_1.read(buf, '[32]byte');
        }
        // ref_txs ([]byte)
        if (this.compliance_action === bytes_1.char('R')) {
            this.ref_txs = bytes_1.ReadVarBin(buf, 32);
        }
        // bitcoin_dispersions ([]QuantityIndex)
        if (this.compliance_action === bytes_1.char('R')) {
            // IsInternalTypeArray
            const size = bytes_1.ReadVariableSize(buf, 16, 8);
            this.bitcoin_dispersions = [];
            for (let i = 0; i < size; i++) {
                const newValue = new field_types_1.QuantityIndex();
                newValue.Write(buf);
                this.bitcoin_dispersions.push(newValue);
            }
        }
        // message (string)
        {
            this.message = bytes_1.ReadVarChar(buf, 32);
        }
        return b.length - buf.length;
    }
// write populates the fields in Order from the byte slice
write populates the fields in Order from the byte slice
write populates the fields in Order from the byte slice
write(b) {
        const buf = new util_1.default.Reader(b);
        {
            this.compliance_action = bytes_1.read(buf, 'byte');
        }
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('C') || this.compliance_action === bytes_1.char('R')) {
            this.asset_type = bytes_1.ReadFixedChar(buf, 3);
        }
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('C') || this.compliance_action === bytes_1.char('R')) {
            this.asset_code = new protocol_types_1.AssetCode();
            this.asset_code.Write(buf);
        }
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('C') || this.compliance_action === bytes_1.char('R')) {
            const size = bytes_1.ReadVariableSize(buf, 16, 8);
            this.target_addresses = [];
            for (let i = 0; i < size; i++) {
                const newValue = new field_types_1.TargetAddress();
                newValue.Write(buf);
                this.target_addresses.push(newValue);
            }
        }
        if (this.compliance_action === bytes_1.char('T')) {
            this.freeze_tx_id = new protocol_types_1.TxId();
            this.freeze_tx_id.Write(buf);
        }
        if (this.compliance_action === bytes_1.char('F')) {
            this.freeze_period = new protocol_types_1.Timestamp();
            this.freeze_period.Write(buf);
        }
        if (this.compliance_action === bytes_1.char('C')) {
            this.deposit_address = new protocol_types_1.PublicKeyHash();
            this.deposit_address.Write(buf);
        }
        if (this.compliance_action === bytes_1.char('F') || this.compliance_action === bytes_1.char('T') || this.compliance_action === bytes_1.char('C')) {
            this.authority_included = bytes_1.read(buf, 'bool');
        }
        if (this.authority_included) {
            this.authority_name = bytes_1.ReadVarChar(buf, 8);
        }
        if (this.authority_included) {
            this.authority_public_key = bytes_1.ReadVarBin(buf, 8);
        }
        if (this.authority_included) {
            this.signature_algorithm = bytes_1.read(buf, 'uint8');
        }
        if (this.authority_included) {
            this.order_signature = bytes_1.ReadVarBin(buf, 8);
        }
        {
            this.supporting_evidence_hash = bytes_1.read(buf, '[32]byte');
        }
        if (this.compliance_action === bytes_1.char('R')) {
            this.ref_txs = bytes_1.ReadVarBin(buf, 32);
        }
        if (this.compliance_action === bytes_1.char('R')) {
            const size = bytes_1.ReadVariableSize(buf, 16, 8);
            this.bitcoin_dispersions = [];
            for (let i = 0; i < size; i++) {
                const newValue = new field_types_1.QuantityIndex();
                newValue.Write(buf);
                this.bitcoin_dispersions.push(newValue);
            }
        }
        {
            this.message = bytes_1.ReadVarChar(buf, 32);
        }
        return b.length - buf.length;
    }
write ( b ) { const buf = new util_1 . default . Reader ( b ) ; { this . compliance_action = bytes_1 . read ( buf , 'byte' ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) || this . compliance_action === bytes_1 . char ( 'C' ) || this . compliance_action === bytes_1 . char ( 'R' ) ) { this . asset_type = bytes_1 . ReadFixedChar ( buf , 3 ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) || this . compliance_action === bytes_1 . char ( 'C' ) || this . compliance_action === bytes_1 . char ( 'R' ) ) { this . asset_code = new protocol_types_1 . AssetCode ( ) ; this . asset_code . Write ( buf ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) || this . compliance_action === bytes_1 . char ( 'C' ) || this . compliance_action === bytes_1 . char ( 'R' ) ) { const size = bytes_1 . ReadVariableSize ( buf , 16 , 8 ) ; this . target_addresses = [ ] ; for ( let i = 0 ; i < size ; i ++ ) { const newValue = new field_types_1 . TargetAddress ( ) ; newValue . Write ( buf ) ; this . target_addresses . push ( newValue ) ; } } if ( this . compliance_action === bytes_1 . char ( 'T' ) ) { this . freeze_tx_id = new protocol_types_1 . TxId ( ) ; this . freeze_tx_id . Write ( buf ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) ) { this . freeze_period = new protocol_types_1 . Timestamp ( ) ; this . freeze_period . Write ( buf ) ; } if ( this . compliance_action === bytes_1 . char ( 'C' ) ) { this . deposit_address = new protocol_types_1 . PublicKeyHash ( ) ; this . deposit_address . Write ( buf ) ; } if ( this . compliance_action === bytes_1 . char ( 'F' ) || this . compliance_action === bytes_1 . char ( 'T' ) || this . compliance_action === bytes_1 . char ( 'C' ) ) { this . authority_included = bytes_1 . read ( buf , 'bool' ) ; } if ( this . authority_included ) { this . authority_name = bytes_1 . ReadVarChar ( buf , 8 ) ; } if ( this . authority_included ) { this . authority_public_key = bytes_1 . ReadVarBin ( buf , 8 ) ; } if ( this . authority_included ) { this . signature_algorithm = bytes_1 . read ( buf , 'uint8' ) ; } if ( this . authority_included ) { this . order_signature = bytes_1 . ReadVarBin ( buf , 8 ) ; } { this . supporting_evidence_hash = bytes_1 . read ( buf , '[32]byte' ) ; } if ( this . compliance_action === bytes_1 . char ( 'R' ) ) { this . ref_txs = bytes_1 . ReadVarBin ( buf , 32 ) ; } if ( this . compliance_action === bytes_1 . char ( 'R' ) ) { const size = bytes_1 . ReadVariableSize ( buf , 16 , 8 ) ; this . bitcoin_dispersions = [ ] ; for ( let i = 0 ; i < size ; i ++ ) { const newValue = new field_types_1 . QuantityIndex ( ) ; newValue . Write ( buf ) ; this . bitcoin_dispersions . push ( newValue ) ; } } { this . message = bytes_1 . ReadVarChar ( buf , 32 ) ; } return b . length - buf . length ; }
write populates the fields in Order from the byte slice
write populates the fields in Order from the byte slice
// compliance_action (byte) // asset_type (string) // asset_code (AssetCode) // target_addresses ([]TargetAddress) // IsInternalTypeArray // 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) // IsInternalTypeArray // message (string)