Giter Club home page Giter Club logo

independentreserve's Introduction

IndependentReserve

Build Status Scrutinizer Code Quality Coverage Status Latest Stable Version Total Downloads License

PHP API for independentreserve.com

Installation

Using composer:

composer require elliotchance/independentreserve

Public APIs

All public APIs are supported, and do not need authentication:

use IndependentReserve\PublicClient;
use IndependentReserve\Currency;

$client = new PublicClient();
$marketSummary = $client->getMarketSummary(Currency::XBT, Currency::USD);
printf('%s: %s USD',
    $marketSummary->getCreatedTimestamp()->format('r'),
    $marketSummary->getDayAveragePrice()
);

// Fri, 26 Dec 2014 05:03:34 +0000: 323.21 USD

View all of the public APIs at https://www.independentreserve.com/API#public

Private APIs

All private APIs are available. You must use your API key and secret to access them:

use IndependentReserve\PrivateClient;
use IndependentReserve\Currency;

$client = new PrivateClient('api_key', 'api_secret');
$address = $client->getBitcoinDepositAddress();
echo $address->getBitcoinAddress();

// 12a7FbBzSGvJd36wNesAxAksLXMWm4oLUJ

View all of the private APIs at https://www.independentreserve.com/API#private

All of the public API methods are accessible through the PrivateClient as well:

$client = new PrivateClient('api_key', 'api_secret');
$marketSummary = $client->getMarketSummary(Currency::XBT, Currency::USD);

Paging Results

Some of the APIs return their results as paged calls (25 items at a time), you do not need to worry about this because these APIs use elliotchance/iterator which will handle all the paged requests for you on demand, you may use all results as an active array:

$client = new PrivateClient('api_key', 'api_secret');
$openOrders = $client->getOpenOrders();

echo count($openOrders);
// 452

var_dump($openOrders[135]); // 136th order

foreach ($openOrders as $order) {
    // ...
}

independentreserve's People

Contributors

dependabot[bot] avatar elliotchance avatar ir00man avatar jasonbphillips avatar maxpovver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

independentreserve's Issues

Update PHP version requirement

Assuming this is compatible with newer versions on PHP (in my case 5.6.3) could you please update your composer.json and packagist listing. When trying to require in my project I get the following message:
This package requires php 5.4.* but your PHP version (5.6.3) does not satisfy that requirement.

Thanks

Make the nonce more reliable for parallel processing

It quite possible that two applications will use the API within a few second and one of the requests will fail because the nonce falls out of sync - we see this in the CI pipeline.

Allow it to try requests again if it fails because the nonce is expired.

API change regarding authentication

On April 15, 2018, a change in the Independent Reserve Airbridge API removed support for the method of authentication used in v1.1.3 and prior versions of the PHP client.

Authentication using a signature generated with only a nonce and user API key is no longer accepted. Requests to private methods of the API using a signature generated in that way produce a "400 Invalid credentials" error.

Requests to public methods of the API are unaffected.

The current method of generating a signature for authentication to the API is detailed at:

https://www.independentreserve.com/API

New API endpoints

Several new methods have been added to the API based on feedback we have received from users:

  • GetTrades โ€“ Returns a list of all trades executed against your orders
  • SynchBitcoinAddressWithBlockchain โ€“ Allows you to force a Bitcoin deposit address to be synched with the Blockchain, after you have made a Bitcoin deposit.
  • WithdrawBitcoin โ€“ Allows you to request a Bitcoin withdrawal. As a security precaution, you can only call this method using an API Key which you have explicitly permitted to make Bitcoin withdrawals. You can set this permission on the API Keys section of the Settings page.
    Further details on these new API methods can be found on the API page.

New authentication method

We have adjusted the authentication mechanism so that all method parameters and values are now included in the signature, along with the URL, API Key and Secret.
Full details can be found on the API page as well as the sample .Net API client on Github.
The new implementation is backwards compatible with the old method so your existing API clients will continue to work, however we encourage you to update your clients to use the new method as it offers improved security.

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.