SyedaNadia / blockchain-wallet-APIv2-PHP-Library

Blockchain Wallet API V2 PHP Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blockchain.info PHP Library for NodeJS Wallet Service

Simple PHP library that allows simple communication to the localhost nodeJS wallet service.

BTC: 1NPrfWgJfkANmd1jt88A141PjhiarT8d9U

Usage

  1. Requirements
  1. Download or clone the main project and extract files.

  2. Include or require the wallet-lib.php file

     require_once("wallet-lib.php");
    
  3. Initiate the login to your nodeJS wallet service

     $bci = new blockchain("your_api_key", "your_wallet_id_guid", "your_password", "your_nodejs_wallet_service_port");
     $login = $bci->login();
     print_r($login);
    
  • If your receive an error at this point, check your email. You may need to whitelist your nodeJS service with blockchain.info
  1. Start making calls

Check wallet balance

    $balance = $bci->balance();
	print_r($balance);

Create a new receiving address (label is optional)

	$new = $bci->new_address("my_label");
	print_r($new);

Basic send payment

	$pmt = $bci->send("1J9ikqFuwrzPbczsDkquA9uVYeq6dEehsj", 100000);
	print_r($pmt);

Advanced send payment with From, Custom Fee and Note options

	$pmt = $bci->send("1J9ikqFuwrzPbczsDkquA9uVYeq6dEehsj", 100000, "1FromThisSpecifAddressab324", 10000, "Thanks for using mysite.com");
	print_r($pmt);

Send Many

	$array = array(
		"1someAddress" => 20000,
		"1someAddress2" => 150000,
		"1someAddress3" => 314159
	); 
	$send = $bci->send_many($array);
	print_r($send);

About

Blockchain Wallet API V2 PHP Library


Languages

Language:PHP 100.0%