Skip to content

A php wrapper around some Blockfolio requests, unoffical

License

Notifications You must be signed in to change notification settings

jojothebandit/BlockfolioSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockfolio unofficial PHP SDK


A php wrapper around some Blockfolio requests
Now you can edit your crypto values in the app through this little SDK
DISCLAIMER: Since this is totally unofficial it can stop working at any time
I will try to keep up and fix stuff if it breaks, but I am not promising anything

How to install (Composer)

composer require "jojothebandit/blockfolio-sdk":"dev-master"

or add to your project's composer.json

"require": {
    "jojothebandit/blockfolio-sdk": "~1.0"
}

How to use

Find your client id in the settings part of Blockfolio
Instantiate the SDK with a client id

    use jojothebandit\BlockfolioSDK\BlockfolioSDK;

    $blockfolio = new BlockfolioSDK();
    $blockfolio->setClientId('YOUR_CLIENT_ID');

Get your whole portfolio in JSON

    $blockfolio->getPortfolio()

Get value of your portfolio(default currency is USD)
    $blockfolio->getPortfolioValue('USD')

Get quantity of coins of a specific crypto
    $blockfolio->getQuantity('ETH')

Add a "sell" transaction
    $blockfolio->sell(0.12, 'BTC');

Add a "buy" transaction
    $blockfolio->buy(0.67, 'ETH');

Add a sell transaction, with the amount being the amount you have currently in the app for a specific crypto
    $blockfolio->sellAll('ETH');

Make a trade, does two transactions, removes x of the first crypto, and adds y of the second
    $blockfolio->trade(5, 'LTC', 3, 'BTC'));

Find the exchange rate between two cryptos, mostly goes one way, BTC being the source crypto
    $blockfolio->getExchangeRate('BTC', 'ETH');

You can set the exchange with
    $blockfolio->setExchangeName('poloniex');

You can internally set the source and destination crypto
    $blockfolio->setSourceCrypto('BTC');
    $blockfolio->setDestinationCrypto('BCC');

Contribute

Contributions are more than welcome :)

Questions, problems?

I'll do my best to answer all issues

License

MIT License

About

A php wrapper around some Blockfolio requests, unoffical

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages