<commit_before><?php

namespace Coinbase\Wallet\ActiveRecord;

use Coinbase\Wallet\Resource\Address;
use Coinbase\Wallet\Resource\Buy;
use Coinbase\Wallet\Resource\Deposit;
use Coinbase\Wallet\Resource\ResourceCollection;
use Coinbase\Wallet\Resource\Sell;
use Coinbase\Wallet\Resource\Transaction;
use Coinbase\Wallet\Resource\Withdrawal;

trait AccountActiveRecord
{
    use BaseActiveRecord;

    /**
     * Issues a refresh request to the API.
     */
    public function refresh(array $params = [])
    {
        $this->getClient()->refreshAccount($this, $params);
    }

    /**
     * Issues an refresh request to the API.
     */
    public function update(array $params = [])
    {
        $this->getClient()->updateAccount($this, $params);
    }

    /**
     * Issues an API request to make the current account primary.
     */
    public function makePrimary(array $params = [])
    {
        $this->getClient()->setPrimaryAccount($this, $params);
    }

    /**
     * Issues an API request to delete the current account.
     */
    public function delete(array $params = [])
    {
        $this->getClient()->deleteAccount($this, $params);
    }

    // addresses

    /**
     * Fetches account addresses from the API.
     *
     * @return ResourceCollection|Address[] The addresses
     */
    public function getAddresses(array $params = [])
    {
        return $this->getClient()->getAccountAddresses($this, $params);
    }

    /**
     * Fetches a specific account address from the API.
     *
     * @return Address The address
     */
    public function getAddress($addressId, array $params = [])
    {
        return $this->getClient()->getAccountAddress($this, $addressId, $params);
    }

    /**
     * Issues an API request to create a new account address.
     */
    public function createAddress(Address $address, array $params = [])
    {
        $this->getClient()->createAccountAddress($this, $address, $params);
    }

    // transactions

    /**
     * Fetches account transactions from the API.
     *
     * @return ResourceCollection|Transaction[] The transactions
     */
    public function getTransactions(array $params = [])
    {
        return $this->getClient()->getAccountTransactions($this, $params);
    }

    /**
     * Fetches a specific account transaction from the API.
     *
     * @return Transaction The transaction
     */
    public function getTransaction($transactionId, array $params = [])
    {
        return $this->getClient()->getAccountTransaction($this, $transactionId, $params);
    }

    /**
     * Issues an API request to create a new account transaction.
     */
    public function createTransaction(Transaction $transaction, array $params = [])
    {
        $this->getClient()->createAccountTransaction($this, $transaction, $params);
    }

    // buys

    /**
     * Fetches account buys from the API.
     *
     * @return ResourceCollection|Buy[] The buys
     */
    public function getBuys(array $params = [])
    {
        return $this->getClient()->getAccountBuys($this, $params);
    }

    /**
     * Fetches a specific account buy from the API.
     *
     * @return Buy The buy
     */
    public function getBuy($buyId, array $params = [])
    {
        return $this->getClient()->getAccountBuy($this, $buyId, $params);
    }

    /**
     * Issues an API request to create a new account buy.
     */
    public function createBuy(Buy $buy, array $params = [])
    {
        $this->getClient()->createAccountBuy($this, $buy, $params);
    }

    /**
     * Issues an API request to commit an account buy.
     */
    public function commitBuy(Buy $buy, array $params = [])
    {
        $this->getClient()->commitBuy($buy, $params);
    }

    // sells

    /**
     * Fetches account sells from the API.
     *
     * @return ResourceCollection|Sell[] The sells
     */
    public function getSells(array $params = [])
    {
        return $this->getClient()->getSells($this, $params);<commit_msg>Update AccountActiveRecord.php (#196)<commit_after><?php

namespace Coinbase\Wallet\ActiveRecord;

use Coinbase\Wallet\Resource\Address;
use Coinbase\Wallet\Resource\Buy;
use Coinbase\Wallet\Resource\Deposit;
use Coinbase\Wallet\Resource\ResourceCollection;
use Coinbase\Wallet\Resource\Sell;
use Coinbase\Wallet\Resource\Transaction;
use Coinbase\Wallet\Resource\Withdrawal;

trait AccountActiveRecord
{
    use BaseActiveRecord;

    /**
     * Issues a refresh request to the API.
     */
    public function refresh(array $params = [])
    {
        $this->getClient()->refreshAccount($this, $params);
    }

    /**
     * Issues an refresh request to the API.
     */
    public function update(array $params = [])
    {
        $this->getClient()->updateAccount($this, $params);
    }

    /**
     * Issues an API request to make the current account primary.
     */
    public function makePrimary(array $params = [])
    {
        $this->getClient()->setPrimaryAccount($this, $params);
    }

    /**
     * Issues an API request to delete the current account.
     */
    public function delete(array $params = [])
    {
        $this->getClient()->deleteAccount($this, $params);
    }

    // addresses

    /**
     * Fetches account addresses from the API.
     *
     * @return ResourceCollection|Address[] The addresses
     */
    public function getAddresses(array $params = [])
    {
        return $this->getClient()->getAccountAddresses($this, $params);
    }

    /**
     * Fetches a specific account address from the API.
     *
     * @return Address The address
     */
    public function getAddress($addressId, array $params = [])
    {
        return $this->getClient()->getAccountAddress($this, $addressId, $params);
    }

    /**
     * Issues an API request to create a new account address.
     */
    public function createAddress(Address $address, array $params = [])
    {
        $this->getClient()->createAccountAddress($this, $address, $params);
    }

    // transactions

    /**
     * Fetches account transactions from the API.
     *
     * @return ResourceCollection|Transaction[] The transactions
     */
    public function getTransactions(array $params = [])
    {
        return $this->getClient()->getAccountTransactions($this, $params);
    }

    /**
     * Fetches a specific account transaction from the API.
     *
     * @return Transaction The transaction
     */
    public function getTransaction($transactionId, array $params = [])
    {
        return $this->getClient()->getAccountTransaction($this, $transactionId, $params);
    }

    /**
     * Issues an API request to create a new account transaction.
     */
    public function createTransaction(Transaction $transaction, array $params = [])
    {
        $this->getClient()->createAccountTransaction($this, $transaction, $params);
    }

    // buys

    /**
     * Fetches account buys from the API.
     *
     * @return ResourceCollection|Buy[] The buys
     */
    public function getBuys(array $params = [])
    {
        return $this->getClient()->getAccountBuys($this, $params);
    }

    /**
     * Fetches a specific account buy from the API.
     *
     * @return Buy The buy
     */
    public function getBuy($buyId, array $params = [])
    {
        return $this->getClient()->getAccountBuy($this, $buyId, $params);
    }

    /**
     * Issues an API request to create a new account buy.
     */
    public function createBuy(Buy $buy, array $params = [])
    {
        $this->getClient()->createAccountBuy($this, $buy, $params);
    }

    /**
     * Issues an API request to commit an account buy.
     */
    public function commitBuy(Buy $buy, array $params = [])
    {
        $this->getClient()->commitBuy($buy, $params);
    }

    // sells

    /**
     * Fetches account sells from the API.
     *
     * @return ResourceCollection|Sell[] The sells
     */
    public function getAccountSells(array $params = [])
    {
        return $this->getClient()->getAccountSells($this, $params);
{'fraction_non_alphanumeric': 0.13110667996011965, 'fraction_numerical': 0.00037387836490528417, 'mean_word_length': 2.5352422907488985, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 63, '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': '4926123', 'n_tokens_mistral': 2334, 'n_tokens_neox': 2233, 'n_words': 575}