Giter Club home page Giter Club logo

laravel-blockchain-api-receive-v2's Introduction

Laravel-blockchain-api

This is a laravel package for interacting with blockchain api

laravel-blockchain

A Laravel 5 Package for working with blockchain api

Installation

PHP 5.4+ or HHVM 3.3+, and Composer are required.

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

"composer require botdigit/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.

  • Botdigit\Blockchain\BlockchainServiceProvider::class,

Also, register the Facade like so:

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

Configuration

You can publish the configuration file using this command:

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

A configuration-file named blockchain.php with default settings will be placed in your config directory:

You can visit this link to get your blockchain api

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:

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

USING /BOTDIGIT/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.

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

How can I thank you?

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!

Don't forget to follow me on twitter!

Thanks! Famurewa Taiwo

License

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

laravel-blockchain-api-receive-v2's People

Contributors

tarun-developer avatar

Stargazers

 avatar

Watchers

 avatar

laravel-blockchain-api-receive-v2's Issues

unable to send bitcoin

trying to send bitcoin to another address

am geting a error
$wallet = Blockchain::makeOutgoingPayment($wallet_guid, $amount, $wallet_password, $to_guid,$from_guid);

errors

file_get_contents(http://127.0.0.1:3000/merchant/ijfia83405-2339-fdjofe-b8d2-ergrgwgefa?payment?password=huyut7342s%4011&api_code=8698dr4w5d-yftdt-lhilj-a7878-hisrwserwrt536&to=1ABYVpfwSxPukqvmPDtZ6KiybgzRe4KaFF&amount=10000.00000000&from=1LMdnxXsuHuZaDeiqRMAkQfUc7JgdwsKVu&fee=1000): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error\r\n in /var/www/html/coin_api/vendor/botdigit/blockchain/src/Blockchain.php:264

on d wallet server i get this
1593571032038 - info: blockchain.info wallet service v0.26.3 running on http://127.0.0.1:3000
1593571039821 - error: [object Object]
1593571117816 - error: [object Object]
1593571189722 - error: [object Object]
1593571618354 - error: [object Object]
1593572101402 - error: [object Object]

Unable to create addrress

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.