Skip to content

meadsteve/razrbit-sdk-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Official SDKs: Android | iOS | Javascript | PHP | Ruby

LUXSTACK Bitcoin Platform and SDKs — build, test and scale bitcoin apps faster. Plug in our powerful SDKs to supercharge your bitcoin toolbox.

Razrbit SDK for PHP (Beta)

Installation

Via composer

Add the following to your composer.json:

  "require": {
        "luxstack/razrbit": "dev-master"
    }

Then run composer update

By manually cloning the repo

In the library section of your project, clone the API:

git clone https://github.com/LUXSTACK/razrbit-sdk-php.git

And then be sure to import the razrbit.php file where needed:

require_once 'razrbit-sdk-php/src/razrbit.php';

Usage - REST API Calls

Prior to making any REST API calls, invoke the init method passing in your AppId and AppSecret which will be used for all subsequent invocations:

$razrbit = new Razrbit(MY_APP_ID,MY_APP_SECRET);

Once this has been done, any available services can be invoked. Response data is accessible in the callback and can be used as needed:

$new_address = $razrbit->walletCreateNewAddress();

$balance = $razrbit->getBalanceFromAddress($new_address);

API

Wallet

$razrbit->walletCreateNewAddress();

Creates a new bitcoin address

razrbit->walletSendAmount("1exampleFromAddressPrivateKey", "1exampleToAddress", 123456);

Sends bitcoin from one of your addresses to the destination address. Amount is measured in bits.

$razrbit->walletGetBalanceFromAddress($exampleAddress);

Returns the balance of the given address in bits.

Explorer

$razrbit->explorerBlock($exampleBlock);

Retrieve details about a given block

$razrbit->explorerTransaction($exampleTransaction);

Retrieve details about a given transaction

$razrbit->explorerAddress($exampleAddress);

Retrieve details about a given address

$razrbit->explorerAddressUnspentOutputs($exampleAddress);

Returns the list of unspent outputs for a given address

Network

$razrbit->networkGetDifficulty();

Retrieve the current network difficulty

$razrbit->networkPushTransaction("exampleTransaction");

Push a transaction onto the network

Markets

currencyCode is a valid ISO 4217 code such as USD or EUR.

$razrbit->marketsPrice("USD");

Returns the current bitcoin price

$razrbit->marketsDayPrice("USD");

Returns the day price

$razrbit->marketsHistoricalPrice("USD","2014-03-03");

Returns the historical price at the given date. date must be a date in the yyyy-mm-dd format.

Webhooks

$razrbit->notificationAddress($exampleAddress,"example@example.com");

Set up a notification email for a given address

$razrbit->notificationBlock($blockHash,"example@example.com");

Set up a notification email for a given block

$razrbit->notificationTransaction($transactionHash,"example@example.com");

Set up a notification email for a given transaction

Support

Feel free to request a feature and make suggestions for our product team.

License

Code released under the MIT license.

Copyright 2012-2014 LUXSTACK Inc. Razrbit is a trademark maintained by LUXSTACK Inc.

LUXSTACK Bitcoin SDKs for other platforms

About

PHP SDK for Razrbit Bitcoin App Platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%