2017 © Pedro Peláez
 

library blockchain

Laravel packeg for Blockchain.info API

image

gupta/blockchain

Laravel packeg for Blockchain.info API

  • Thursday, April 26, 2018
  • by kuntal1230
  • Repository
  • 0 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 100 % Grown

The README.md

Laravel-blockchain-api

This is a laravel package for interacting with blockchain api, (*1)

laravel-blockchain

A Laravel 5 Package for working with blockchain api, (*2)

Installation

PHP 5.4+ or HHVM 3.3+, and Composer are required., (*3)

To get the latest version of blockchain api, simply run the code below in your project., (*4)

"composer require gupta/blockchain"

Once Laravel Blockchain is installed, You need to register the service provider. Open up config/app.php and add the following to the providers key., (*5)

  • Gupta\Blockchain\BlockchainServiceProvider::class,

Also, register the Facade like so:, (*6)

'aliases' => [
    ...
    'Blockchain' => Gupta\Blockchain\Facades\Blockchain::class,,
    ...
]

Configuration

You can publish the configuration file using this command:, (*7)

php artisan vendor:publish --provider="Gupta\Blockchain\BlockchainServiceProvider"

A configuration-file named blockchain.php with default settings will be placed in your config directory:, (*8)

You can visit this link to get your blockchain api, (*9)

https://api.blockchain.info/customer/signup

Usage

Open your .env file and add the following in this format. Ensure you must have gotten your api key:, (*10)

BLOCKCHAIN_API=***********************
DEFAULT_BTC_FEE=0.0001
TRANSACTION_BTC_FEE=0.000

USING /Gupta/BLOCKCHAIN PACKAGE

Add the following line to your controller

use Blockchain

1. GET RATES

Blockchain::getRates();

2. CONVERT A CURRENCY VALUE TO BTC

$rates = Blockchain::convertCurrencyToBTC('NGN'  600000);

3. GET STATISTICS CHART

$rates = Blockchain::getStats();

4. CREATE WALLET

$wallet = Blockchain::createWallet($wallet_password);

5. WALLET BALANCE

$wallet = Blockchain::getWalletBalance($wallet_guid, $wallet_password);

6. Making Outgoing Payment

$wallet = Blockchain::makeOutgoingPayment($wallet_guid, $amount, $wallet_password, $to_guid);

7. List Address

$wallet = Blockchain::listAddress($wallet_guid, $wallet_password);

8. Create New Address

$wallet = Blockchain::createNewAddress($wallet_guid, $wallet_password, $label ='');

Credit

Readme document was inpsired and tuned from one of @Unicodedeveloper. Prosper Otemuyiwa., (*11)

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities., (*12)

Thanks! maxtee, (*13)

License

The MIT License (MIT). Please see License File for more information., (*14)

The Versions

26/04 2018

dev-master

9999999-dev

Laravel packeg for Blockchain.info API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kuntal Gupta