All Projects → blockavel → lara-block-io

blockavel / lara-block-io

Licence: MIT License
A Laravel Package/Facade for the Block.io API

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to lara-block-io

CoinGecko
A C++20 library for CoinGecko--a cryptocurrency data service.
Stars: ✭ 69 (+213.64%)
Mutual labels:  litecoin, dogecoin
desktop
CoinApp is a simple to use minimal Cryptocurrency Wallet for Ethereum, ERC20 Tokens, Bitcoin and Litecoin built for Windows, Mac and Linux.
Stars: ✭ 60 (+172.73%)
Mutual labels:  bitcoin-wallet, litecoin
miningcore
Miningcore is a high-performance Mining Pool Software for Linux and Windows.
Stars: ✭ 554 (+2418.18%)
Mutual labels:  litecoin, dogecoin
Golden Wallet React Native
Golden - Best Wallet Ever
Stars: ✭ 201 (+813.64%)
Mutual labels:  bitcoin-wallet, litecoin
bitcoin-kit-android
Comprehensive Bitcoin development library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash, Litecoin and Dash blockchains. Fully compliant with existing standards and BIPs.
Stars: ✭ 102 (+363.64%)
Mutual labels:  bitcoin-wallet, litecoin
laravel-s3-tools
This Laravel package contains additional functionality not currently in Laravel for interfacing with Amazon's S3 service (including managing versioned objects).
Stars: ✭ 31 (+40.91%)
Mutual labels:  facade, laravel-5-package
Hdwallet
Simple Swift library for creating HD cryptocurrencies wallets and working with crypto Coins/ERC20 tokens.
Stars: ✭ 80 (+263.64%)
Mutual labels:  bitcoin-wallet, litecoin
Crypto-Wallet
Open source SHA-512 loginless bitcoin wallet
Stars: ✭ 24 (+9.09%)
Mutual labels:  bitcoin-wallet, litecoin
moonshine
Moonshine is a homebrewed, open-source, non-custodial, Bitcoin wallet for iOS & Android.
Stars: ✭ 56 (+154.55%)
Mutual labels:  bitcoin-wallet, litecoin
Settings
A Laravel multi-tenant settings manager
Stars: ✭ 36 (+63.64%)
Mutual labels:  laravel-5-package
Laravel-Unsplash-Wrapper
A Laravel wrapper for Unsplash API's.
Stars: ✭ 21 (-4.55%)
Mutual labels:  laravel-5-package
cdek-sdk
SDK для СДЭК
Stars: ✭ 38 (+72.73%)
Mutual labels:  laravel-5-package
laravel-backup-shield
🔒Password protection (and encryption) for your laravel backups.
Stars: ✭ 32 (+45.45%)
Mutual labels:  laravel-5-package
panichd
Ticketing system for Laravel 5.1 - 8.x. Allows to create new tickets via form only. Includes file attachments, ticket tags, filtering, scheduling and e-mail notifications.
Stars: ✭ 78 (+254.55%)
Mutual labels:  laravel-5-package
artisan-shortcuts
🍰 Register shortcuts to execute multiple artisan commands
Stars: ✭ 56 (+154.55%)
Mutual labels:  laravel-5-package
Bitcoin-Payment-Gateway-ASP.NET
Bitcoin Payment Gateway API on ASP.NET. Accept Bitcoin, Litecoin, Dogecoin, Dash, Speedcoin, Reddcoin, Potcoin, Feathercoin, BTC, Vertcoin, Vericoin, Peercoin, Paycoin, MonetaryUnit, Swiscoin Payments Online on your ASP.NET C# website
Stars: ✭ 56 (+154.55%)
Mutual labels:  litecoin
laravel-jarvis
Achieve Your Ambition With Me .
Stars: ✭ 32 (+45.45%)
Mutual labels:  laravel-5-package
sifir-mobile-wallet
Sifir Mobile Bitcoin Wallet
Stars: ✭ 22 (+0%)
Mutual labels:  bitcoin-wallet
rn-bitcoinjs-lib
A React Native compatible implementation of bitcoinjs-lib
Stars: ✭ 28 (+27.27%)
Mutual labels:  litecoin
devtube
Laravel YouTube and Online Video viewing and download interface.
Stars: ✭ 30 (+36.36%)
Mutual labels:  laravel-5-package

blockavel/lara-block-io

GitHub license Build Status StyleCI

A Laravel package/facade for the Block.io API PHP wrapper.

This repository implements a simple Service Provider of the Block.io client, and makes it easily accessible via a Facade in Laravel >= 5.

See @BlockIo/block_io-php and the BlockIo PHP API docs for more information about the PHP wrapper of the Block.io API and its interfaces.

Requirements

Create an account at Block.io and take note of your API key under Account > Dashboard.

The BlockIo library requires the 'mcrypt' (please note that mcrypt has been deprecated for php7.1), 'gmp', and 'cURL' extensions for PHP as well as the 'bcmath' library. To enable these, please see:

-mCrypt Installation Guide

-GMP Installation Guide

-cURL Installation Guide

-bcmath Installation Guide

Installation using Composer

In your terminal application move to the root directory of your laravel project using the cd command and require the project as a dependency using composer.

composer require blockavel/lara-block-io

This will add the following lines to your composer.json and download the project and its dependencies to your projects ./vendor directory:

// 

./composer.json
{
    "name": "blockavel/lara-block-io",
    "description": "A dummy project used to test the Laravel Block.io Facade.",

    // ...

    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "blockavel/lara-block-io": "1.0.*",
        // ...
    },

    //...
}

Usage

In order to use the static interface we must customize the application configuration to tell the system where it can find the new service. Open the file config/app.php and add the following lines ([a], [b]):

// config/app.php

return [

    // ...

    'providers' => [

        // ...

        /*
         * Package Service Providers...
         */
        Blockavel\LaraBlockIo\LaraBlockIoServiceProvider::class, // [a]

        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,

    ],

    // ...

    'aliases' => [

        'App' => Illuminate\Support\Facades\App::class,
        'Artisan' => Illuminate\Support\Facades\Artisan::class,

        // ...

        'LaraBlockIo' => 'Blockavel\LaraBlockIo\LaraBlockIoFacade', // [b]
        'Hash' => Illuminate\Support\Facades\Hash::class,

        // ...
    ],

];

Publish Vendor

lara-block-io requires a connection configuration. To get started, you'll need to publish all vendor assets running:

php artisan vendor:publish

This will create a config/larablockio.php file in your app that you can modify to set your configuration. Make sure you check for changes compared to the original config file after an upgrade.

Now you should be able to use the facade within your application. Ex:

namespace App;

use Illuminate\Database\Eloquent\Model;

class BlockIoTest extends Model
{
    /**
     * Get the balance information associated with a Bitcoin Dogecoin,
     * or Litecoin account.
     *
     * @return object Contains balance information
     */
     
    public function test()
    {
        return LaraBlockIo::getBalanceInfo();
    }
}

List of Available Methods

Balance and Network Info

// BlockIo getter method, returns a BlockIo object.
LaraBlockIo::getBlockIo();
// Get the balance information associated with a Bitcoin Dogecoin, or Litecoin account.
LaraBlockIo::getBalanceInfo();
// Get the Network associated with your API KEY.
LaraBlockIo::getNetwork();  
// Get the balance associated with all your addresses in the selected network.
LaraBlockIo::getAvailableBalance();
// Get the the balance that's pending confirmation in the selected network.
LaraBlockIo::getPendingReceivedBalance();
// Get address(es) balance by specified address(es).
LaraBlockIo::getAddressesBalanceByAddress($addresses);
// Get address(es) balance by specified label(s).
LaraBlockIo::getAddressesBalanceByLabels($labels);
// Get user(s) balance.
LaraBlockIo::getUsersBalance($userIds);
// Get network fee estimate for transacting (withdrawing, sending).
LaraBlockIo::getNetworkFeeEstimate($amounts, $addresses);

Addresses

// Create new address.
LaraBlockIo::createAddress($label); 
// Get all the (unarchived) addresses information.
LaraBlockIo::getAddressesInfo();
// Get all the (unarchived) addresses information without balance.
LaraBlockIo::getAddressesInfoWithoutBalances(); 
// Get the (unarchived) addresses associated with your account.
LaraBlockIo::getAddresses(); 
// Get the (unarchived) addresses associated with your account without balance.
LaraBlockIo::getAddressesWithoutBalances();
// Get address by label.
LaraBlockIo::getAddressByLabel($label);
// Get all the users associated with your account in a given network.
LaraBlockIo::getUsers()
// Get a user's address.
LaraBlockIo::getUserAddress($userId);

Withdraw

// Withdraws amount of coins from any addresses in your account.
LaraBlockIo::withdraw($amounts, $toAddresses, $nonce = null);
// Withdraws amount of coins from specific addresses in your account.
LaraBlockIo::withdrawFromAddressesToAddresses($amounts, $fromAddresses, $toAddresses, $nonce = null);
LaraBlockIo::withdrawFromLabelsToLabels($amounts, $fromLabels, $toLabels, $nonce = null);
LaraBlockIo::withdrawFromLabelsToAddresses($amounts, $fromLabels, $toAddresses, $nonce = null);

Archive

// Archive adress(es).
LaraBlockIo::archiveAddressesByAddress($addresses);
LaraBlockIo::archiveAddressesByLabels($labels);
// Unarchive address(es)
LaraBlockIo::unarchiveAddressesByAddress($addresses);
LaraBlockIo::unarchiveAddressesByLabels($labels);
// Returns all the archived addresses.
LaraBlockIo::getArchivedAddresses();

Transactions

// Returns various data for transactions spent or received.
LaraBlockIo::getTransactionsByAddresses($type, $addresses, $beforeTx = null);
LaraBlockIo::getTransactionsByLabels($type, $labels, $beforeTx = null);
LaraBlockIo::getTransactionsByUserIds($type, $userIds, $beforeTx = null);
LaraBlockIo::getReceivedTransactions($beforeTx = null);
LaraBlockIo::getSentTransactions($beforeTx = null);
// Returns the prices from the largest exchanges for the given network.
LaraBlockIo::getCurrentPrice($baseCurrency = null);
// Returns an array of transactions that were sent by Block.io Green Addresses.
LaraBlockIo::isGreenTransaction($txIds);
// Get pending transactions.
LaraBlockIo::getNotConfirmedTxs($toAddress, $confidenceThreshold);

DTrust

// Get all dtrust addresses.
LaraBlockIo::getDTrustAddresses();
// Create a MultiSig address.
LaraBlockIo::createMultiSigAddress($label, $reqSigs, $s1, $s2, $s3 = null, $s4 = null);
// Get details of a dtrust address associated with a given label.
LaraBlockIo::getDTrustInfoByLabel($label);
// Perform a MultiSig withdraw.
LaraBlockIo::multiSigWithdraw($label, $toAddresses, $amount);
// Returns a MultiSig withdraw object for signing.
LaraBlockIo::getMultiSigWithdraw($referenceId);
// Sign MultiSig withdraw.
LaraBlockIo::signMultiSigWithdraw($reference_id, $passphrase);
// Returns sent dtrust transactions.
LaraBlockIo::getSentDTrustTransactions($beforeTx = null);
// Returns received dtrust transactions.
LaraBlockIo::getReceivedDTrustTransactions($beforeTx = null);
// Returns information associated with dtrust transactions.
LaraBlockIo::getDtrustTransactionsByAddresses($type, $addresses, $beforeTx = null);
LaraBlockIo::getDtrustTransactionsByLabels($type, $labels, $beforeTx = null);
LaraBlockIo::getDTrustTransactionsByUserIds($type, $userIds, $beforeTx = null);
// Get balance associated with dtrust addresses.
LaraBlockIo::getDTrustAddressBalance($addresses);
// Archive dtrust addresses.
LaraBlockIo::archiveDTrustAddress($addresses);
// Unarchive dtrust addresses.
LaraBlockIo::unarchiveDTrustAddress($addresses);
// Get archived addresses.
LaraBlockIo::getArchivedDTrustAddresses();
// Get estimated network fee for dtrust transactions.
LaraBlockIo::getNetworkDTrustFeeEstimate($amounts, $fromAddress, $toAddress);

Sweep Funds

// Sweep funds from external address to a BlockIo address.
LaraBlockIo::sweepFromAddress($fromAddress, $toAddress, $privateKey);

Testing

Unit Tests are created with PHPunit and orchestra/testbench, they can be ran with ./vendor/bin/phpunit.

Contributing

Find an area you can help with and do it. Open source is about collaboration and open participation. Try to make your code look like what already exists or better and submit a pull request. Also, if you have any ideas on how to make the code better or on improving the scope and functionality please contact any of the contributors.

License

MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].