5+ Facts You Must Know About DigitalPortal2.Club Before You

Using blockchain API

Uses For The Blockchain / November 13, 2017

All functionality is provided through the Blockchain object.

###Call Limits

The official documentation lists API call limits, which may be bypassed with an API code. If you use a code, enter it when you create the Blockchain object:

$Blockchain = new \Blockchain\Blockchain(' ', $my_api_code);

Set the cURL timeout, in seconds, with the setTimeout member function:

$Blockchain->setTimeout($timeout_seconds);

The default network timeout is 60 seconds.

A Note about Bitcoin Values

All Bitcoin values returned by the API are in string float format, in order to preserve full value precision. It is recommended that all arithmetic operations performed on Bitcoin values within PHP utilize the bcmath functions as follows:

#####bcadd Add Two Numbers

$result = bcadd("101.234115", "3", 8); // "13"

#####bcsub Subtract Two Numbers

$result = bcsub("101.234115", "3", 8); // "7"

#####bcmul Multiply Two Numbers

$result = bcmul("101.234115", "3", 8); // "3513"

#####bcdiv Divide Two Numbers

$result = bcdiv("101.234115", "3", 8); // "2.89833679"

The 8 in the final parameter of each bcmath function call represents the numerical precision to keep in the result.

More help on the bcmath functions can be found in the PHP BC Math documentation.

Source: github.com
Warning:
Text: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
File: /home/nex99/domains/bitcoin-and-blockchain.education/code/utils.php
Line: 483

Warning:
Text: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
File: /home/nex99/domains/bitcoin-and-blockchain.education/code/utils.php
Line: 483