2017 © Pedro Peláez
 

library php-client

BlockCypher's PHP SDK for REST API

image

blockcypher/php-client

BlockCypher's PHP SDK for REST API

  • Monday, November 13, 2017
  • by mriou
  • Repository
  • 13 Watchers
  • 32 Stars
  • 8,656 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 46 Forks
  • 41 Open issues
  • 14 Versions
  • 23 % Grown

The README.md

Due to the lack of usage, the PHP SDK has been deprecated. However our RESTful APIs are extremely easy to integrate with any good HTTP client library., (*1)

PHP REST API SDK for BlockCypher

Home Image, (*2)

PHP Composer Coverage Status, (*3)

Welcome to BlockCypher PHP SDK. This repository contains BlockCypher's PHP SDK and samples for REST API., (*4)

Warning: the legacy version (up to v1.5.0) which targets PHP >= 5.5.0 is in the branch php55. The master branch targets PHP >= 7.1.0 and is release as v2. While we are transitioning to v2 some of the documentation might be out of date. Please open an issue if this is the case., (*5)

SDK Documentation

Our BlockCypher-PHP-SDK Page includes all the documentation related to PHP SDK. Everything from SDK Wiki, to Sample Codes, to Releases. Here are few quick links to get you there faster., (*6)

Prerequisites

More help

Upcoming features

Currently unavailable/upcoming REST API features

  • Install from phar

New samples

  • Capturing callback sample.
  • Managing errors in batching requests.

Quick Examples

Setup ApiContext

<?php
// Autoload the SDK Package. Installed via direct download.
require __DIR__  . '/php-client/autoload.php';
// Require the Composer autoloader. Installed via composer
//require 'vendor/autoload.php';

use BlockCypher\Auth\SimpleTokenCredential;
use BlockCypher\Rest\ApiContext;
use BlockCypher\Api\Address;

// Provide your Token. Replace the given one with your app Token
// https://accounts.blockcypher.com/dashboard
$token = 'c0afcccdde5081d6429de37d16166ead';

// SDK config
$config = array(
    'mode' => 'sandbox',
    'log.LogEnabled' => true,
    'log.FileName' => 'BlockCypher.log',
    'log.LogLevel' => 'DEBUG', // PLEASE USE 'INFO' LEVEL FOR LOGGING IN LIVE ENVIRONMENTS
    'validation.level' => 'log',
);

$apiContext = ApiContext::create(
    'main', 'btc', 'v1',
    new SimpleTokenCredential('c0afcccdde5081d6429de37d16166ead'),
    $config
);

Get Address info

<?php
use BlockCypher\Client\AddressClient;

$addressClient = new AddressClient($apiContext);
$address = $addressClient->get('1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD');

echo "JSON Address: " . $address->toJson() . "\n";
var_dump($address);

Send a microtransaction

<?php
$microTXClient = new MicroTXClient($apiContext);

try {
    $microTX = $microTXClient->sendSigned(
        "2c2cc015519b79782bd9c5af66f442e808f573714e3c4dc6df7d79c183963cff", // private key
        "C4MYFr4EAdqEeUKxTnPUF3d3whWcPMz1Fi", // to address
        10000 // value (satoshis)
    );
} catch (\Exception $e) {
    echo "There was an error sending the microtx.\n";
}

The Versions

13/11 2017

dev-master

9999999-dev https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

14/11 2016

v1.5.0

1.5.0.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

14/11 2016

v1.4.0

1.4.0.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

16/06 2016

v1.3.1

1.3.1.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

30/01 2016

v1.3.0

1.3.0.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

14/09 2015

v1.2.2

1.2.2.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

25/07 2015

v1.2.1

1.2.1.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

24/07 2015

v1.2.0

1.2.0.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

22/07 2015

v1.1.0

1.1.0.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

21/07 2015

v1.0.1

1.0.1.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

30/06 2015

v1.0.0

1.0.0.0 https://github.com/blockcypher/php-client

BlockCypher's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

 

The Development Requires

rest sdk bitcoin blockchain blockcypher

08/05 2015

v1.0.0-beta

1.0.0.0-beta https://github.com/blockchyper/php-client

BlockChyper's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

  • php >=5.3.0
  • ext-curl *
  • ext-json *

 

The Development Requires

rest sdk bitcoin blockchain blockchyper

05/05 2015

v0.6.0

0.6.0.0 https://github.com/blockchyper/php-client

BlockChyper's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

  • php >=5.3.0
  • ext-curl *
  • ext-json *

 

The Development Requires

rest sdk bitcoin blockchain blockchyper

04/05 2015

v0.5.0

0.5.0.0 https://github.com/blockchyper/php-client

BlockChyper's PHP SDK for REST API

  Sources   Download

Apache2

The Requires

  • php >=5.3.0
  • ext-curl *
  • ext-json *

 

The Development Requires

rest sdk bitcoin blockchain blockchyper