Giter Club home page Giter Club logo

blockfoliosdk's Introduction

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

blockfoliosdk's People

Contributors

jojothebandit avatar

Watchers

James Cloos avatar Tony Mrakovcic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.