Download the PHP package buttercoin/buttercoin-sdk without Composer

On this page you can find all versions of the php package buttercoin/buttercoin-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package buttercoin-sdk

Buttercoin PHP SDK Library

Easy integration with the Buttercoin Trading Platform through our API.

Installation with Composer

Usage

For composer documentation, please refer to getcomposer.org.

This client was built using Guzzle, a PHP HTTP client & framework for building RESTful web service clients.

When you first create a new ButtercoinClient instance you can pass publicKey, privateKey, and environment as configuration settings. These are optional and can be later specified through Setter methods.

For authenticated API Resources, the publicKey and secretKey are required and can also be passed to the factory method in the configuration array. The environment configuration setting defaults to 'production'.

For a list of required and available parameters for the different API Endpoints, please consult the Buttercoin API Reference Docs.

Configuring the Client

The factory method accepts an array of configuration settings for the Buttercoin Webservice Client.

Setting Property Name Description
Public Key publicKey Your Buttercoin API Public Key
Secret Key secretKey Your Buttercoin API Secret Key
Environment environment Your development environment (default: 'production', set to 'sandbox' to test with testnet bitcoins)
API Version version The API Version. Currently used to version the API URL and Service Description
Example

Configuration can be updated to reuse the same Client:

You can reconfigure the Buttercoin Client configuration options through available getters and setters. You can get and set the following options: publicKey, secretKey, environment, & version

Example

Tips

A note on the timestamp param sent to all client methods: This param must always be increasing, and within 5 minutes of Buttercoin server times (GMT). This is to prevent replay attacks on your data.

Before every call, get a new timestamp. (You need only set the timezone once)

Additionally, for convenience, if you don't include the timestamp parameter, it will default to the current timestamp.

WARNING

For Query and Post Params, there is a limitation from the Guzzle library that you always add the params to your array in the order they are displayed in tables below. If you don't do this, the HMAC-SHA256 signature will not be correct and you will get a 401 request error.

Get Data

Unauthenticated

Get Order Book
Return an array of current orders in the Buttercoin order book

Get Trade History
Return an array of the last 100 trades

Get Ticker
Return the current bid, ask, and last sell prices on the Buttercoin platform

Authenticated

Key Permissions
Returns array of permissions associated with this key

Balances
Returns array of balances for this account

Deposit Address
Returns bitcoin address string to deposit your funds into the Buttercoin platform

Get Orders
Returns array of arrays containing information about buy and sell orders

Valid params include (must be added to array in this order):

Name Param Description
Status status enum: ['opened', 'partial-filled', 'filled', 'canceled']
Side side enum: ['buy', 'sell']
Order Type orderType enum: ['market', 'limit']
Date Min dateMin format: ISO-8601, e.g. '2014-05-06T13:15:30Z'
Date Max dateMax format: ISO-8601, e.g. '2014-05-06T13:15:30Z'

Get Transaction
Returns array of arrays containing information about deposit and withdraw action

Valid params include (must be added to array in this order):

Name Param Description
Status status enum: ['pending', 'processing', 'funded', 'canceled', 'failed']
Transaction Type transactionType enum: ['deposit', 'withdrawal']
Date Min dateMin format: ISO-8601, e.g. '2014-05-06T13:15:30Z'
Date Max dateMax format: ISO-8601, e.g. '2014-05-06T13:15:30Z'

Create New Actions

Create Order

Valid order params include:

Name Param Description
Instrument instrument enum: ['BTC_USD, USD_BTC']
Side side enum: ['buy', 'sell'], required true
Order Type orderType enum: ['limit', 'market'], required true
Price price string, required false
Quantity quantity string, required false

Create Transaction

Please contact Buttercoin support before creating a USD deposit using the API

Deposit transaction params include:

Name Param Description
Method method enum: ['wire'], required true
Currency currency enum: ['USD'], required true
Amount amount string, required true

Withdrawal transaction params include:

Name Param Description
Method method enum: ['check'], required true
Currency currency enum: ['USD'], required true
Amount amount string, required true

Send bitcoin transaction params include:

Name Param Description
Currency currency ['USD'], required true
Amount amount string, required true
Destination destination address to which to send currency string, required true

Cancel Actions

All successful cancel calls to the API return a response status of 204 with a human readable success message

Cancel Order
Cancel a pending buy or sell order

Cancel Transaction
Cancel a pending deposit or withdraw action

Further Reading

Buttercoin - Website
Buttercoin API Docs

Contributing

This is an open source project and we love involvement from the community! Hit us up with pull requests and issues.

The aim is to take your great ideas and make everyone's experience using Buttercoin even more powerful. The more contributions the better!

Release History

0.0.6

0.0.5

0.0.3

0.0.2

0.0.1

License

Licensed under the MIT license.


All versions of buttercoin-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
guzzle/guzzle Version ~3.8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package buttercoin/buttercoin-sdk contains the following files

Loading the files please wait ....