public function buildOpReturnForIssuance($raw_amount, $asset, $divisible, $description, $txid) {
        $amount_hex          = $this->paddedRawAmountHex($raw_amount);
        $asset_hex           = $this->padHexString($this->assetNameToIDHex($asset), 8);
        $divisible_hex       = $this->padHexString(($divisible ? 1 : 0), 1);
        $call_data_hex       = '000000000000000000';
        $description_hex     = unpack('H*0', $description)[0];
        $description_len_hex = $this->padHexString(dechex(strlen($description_hex) / 2), 1);
        $data_hex = $asset_hex.$amount_hex.$divisible_hex.$call_data_hex.$description_len_hex.$description_hex;

        // must be 80 bytes to fit into OP_RETURN
        if (strlen($data_hex) > 160) { throw new Exception("Description too long", 1); }

        return $this->assembleCounterpartyOpReturn(20, $data_hex, $txid);
    }
public function buildOpReturnForIssuance($raw_amount, $asset, $divisible, $description, $txid) {
        $amount_hex          = $this->paddedRawAmountHex($raw_amount);
        $asset_hex           = $this->padHexString($this->assetNameToIDHex($asset), 8);
        $divisible_hex       = $this->padHexString(($divisible ? 1 : 0), 1);
        $call_data_hex       = '000000000000000000';
        $description_hex     = unpack('H*0', $description)[0];
        $description_len_hex = $this->padHexString(dechex(strlen($description_hex) / 2), 1);
        $data_hex = $asset_hex.$amount_hex.$divisible_hex.$call_data_hex.$description_len_hex.$description_hex;

        // must be 80 bytes to fit into OP_RETURN
        if (strlen($data_hex) > 160) { throw new Exception("Description too long", 1); }

        return $this->assembleCounterpartyOpReturn(20, $data_hex, $txid);
    }
public function buildOpReturnForIssuance ( $ raw_amount , $ asset , $ divisible , $ description , $ txid ) { $ amount_hex = $ this -> paddedRawAmountHex ( $ raw_amount ) ; $ asset_hex = $ this -> padHexString ( $ this -> assetNameToIDHex ( $ asset ) , 8 ) ; $ divisible_hex = $ this -> padHexString ( ( $ divisible ? 1 : 0 ) , 1 ) ; $ call_data_hex = '000000000000000000' ; $ description_hex = unpack ( 'H*0' , $ description ) [ 0 ] ; $ description_len_hex = $ this -> padHexString ( dechex ( strlen ( $ description_hex ) / 2 ) , 1 ) ; $ data_hex = $ asset_hex . $ amount_hex . $ divisible_hex . $ call_data_hex . $ description_len_hex . $ description_hex ; // must be 80 bytes to fit into OP_RETURN if ( strlen ( $ data_hex ) > 160 ) { throw new Exception ( "Description too long" , 1 ) ; } return $ this -> assembleCounterpartyOpReturn ( 20 , $ data_hex , $ txid ) ; }
description should be 41 characters or less
description should be 41 characters or less