<commit_before><?php
/**
 * Blockchain Transactions Repository
 */
namespace Minds\Core\Blockchain\Transactions;

use Cassandra;
use Cassandra\Varint;
use Cassandra\Decimal;
use Cassandra\Timestamp;
use Minds\Core\Data\Cassandra\Client;
use Minds\Core\Data\Cassandra\Prepared\Custom;
use Minds\Core\Di\Di;
use Minds\Core\Util\BigNumber;

class Repository
{
    /** @var Client */
    private $db;

    public function __construct($db = null)
    {
        $this->db = $db ? $db : Di::_()->get('Database\Cassandra\Cql');
    }

    public function add($transactions)
    {
        if (!is_array($transactions)) {
            $transactions = [ $transactions ];
        }

        $requests = [];
        $template = "INSERT INTO blockchain_transactions (
            user_guid,
            wallet_address,
            timestamp,
            tx,
            contract,
            amount,
            completed,
            failed,
            data
            ) 
            VALUES (?,?,?,?,?,?,?,?,?)";
        foreach ($transactions as $transaction) {
            $requests[] = [
                'string' => $template, 
                'values' => [
                    new Varint($transaction->getUserGuid()),
                    $transaction->getWalletAddress(),
                    new Timestamp($transaction->getTimestamp()),
                    $transaction->getTx(),
                    $transaction->getContract(),
                    new Varint($transaction->getAmount()),
                    $transaction->isCompleted(),
                    $transaction->isFailed(),
                    json_encode($transaction->getData()),<commit_msg>(feat): disable mainnet transactions<commit_after><?php
/**
 * Blockchain Transactions Repository
 */
namespace Minds\Core\Blockchain\Transactions;

use Cassandra;
use Cassandra\Varint;
use Cassandra\Decimal;
use Cassandra\Timestamp;
use Minds\Core\Data\Cassandra\Client;
use Minds\Core\Data\Cassandra\Prepared\Custom;
use Minds\Core\Di\Di;
use Minds\Core\Util\BigNumber;

class Repository
{
    /** @var Client */
    private $db;

    public function __construct($db = null)
    {
        $this->db = $db ? $db : Di::_()->get('Database\Cassandra\Cql');
    }

    public function add($transactions)
    {
        throw new \Exception("This service has been temporarily disabled while we transition to the Ethereum Main Net. Service will be restored as soon the transition is complete.");
        if (!is_array($transactions)) {
            $transactions = [ $transactions ];
        }

        $requests = [];
        $template = "INSERT INTO blockchain_transactions (
            user_guid,
            wallet_address,
            timestamp,
            tx,
            contract,
            amount,
            completed,
            failed,
            data
            ) 
            VALUES (?,?,?,?,?,?,?,?,?)";
        foreach ($transactions as $transaction) {
            $requests[] = [
                'string' => $template, 
                'values' => [
                    new Varint($transaction->getUserGuid()),
                    $transaction->getWalletAddress(),
                    new Timestamp($transaction->getTimestamp()),
                    $transaction->getTx(),
                    $transaction->getContract(),
                    new Varint($transaction->getAmount()),
                    $transaction->isCompleted(),
                    $transaction->isFailed(),
                    json_encode($transaction->getData()),
{'fraction_non_alphanumeric': 0.12736119061247853, 'fraction_numerical': 0.0, 'mean_word_length': 1.8253839935327405, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3006283', 'n_tokens_mistral': 907, 'n_tokens_neox': 872, 'n_words': 184}