Download the PHP package weoka/stakecube-php-sdk without Composer
On this page you can find all versions of the php package weoka/stakecube-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package stakecube-php-sdk
StakeCube-PHP-SDK
Unofficial StakeCube API SDK for PHP - Available on Composer!
Install
Composer: composer require weoka/stakecube-php-sdk
...or clone via git and import the module yourself!
Setup
To start using the StakeCube SDK, you'll need to import the Stakecube class and initialize an instance with your public and private key as parameters. If you only intend to use public endpoints, you can just send random string as parameters.
If you don't have your pair keys, grab them from your Profile
Usage
Note: If you're looking for Advanced REST API documentation, please use this document from DevCube!
Get Arbitrage Info
Gets arbitrage information for a chosen coin ticker.
- Method:
getArbitrageInfo($ticker);
Parameter | Description | Example |
---|---|---|
(required) ticker | the ticker of a coin | DOGEC |
Example:
Get Markets
Gets a list of all StakeCube markets under the chosen base market, optionally sorted by
volume
orchange
, but by default sorted alphabetically.
- Method:
getMarkets($base, $orderBy);
Parameter | Description | Example |
---|---|---|
(required) base | the chosen base coin | DOGEC |
(optional) orderBy | the ordering of the list | volume or change |
Example:
Get OHLC Data
Gets an array of the last 500 candles for the chosen market pair and interval.
- Method:
getOhlcData($market, $interval);
Parameter | Description | Example |
---|---|---|
(required) market | the chosen market pair | DOGEC_BTC |
(required) interval | the per-candle timeframe / period | 1m , 5m , 15m , 30m , 1h , 4h , 1d , 1w , 1mo |
Example:
Get MineCube Info
Gets the current real-time info for MineCube, such as total and available workers, the price of workers, and the payouts-in-progress status.
- Method:
getMineCubeInfo();
Example:
Get MineCube Miners
Gets a list of all Miners belonging to MineCube, you may optionally specify a coin to see miners for only that coin, such as 'ETH' which uses AMD GPUs, or 'DASH' which uses StrongU ASICs.
- Method:
getMineCubeMiners($coin);
Example:
Get Rate Limits
Gets the current global StakeCube rate-limits for APIs.
- Method:
getRatelimits();
Example:
Get Trades
Returns the last trades of a specified market pair, optionally with a custom results limit.
- Method:
getTrades($market);
Parameter | Description | Example |
---|---|---|
(required) market | the chosen market pair | DOGEC_BTC |
(optional) limit | the maximum returned trades | 100 |
Example:
Get Orderbook
Gets the orderbook of a chosen market, optionally a specified side, but by default will load both orderbook sides.
- Method:
getOrderbook($market);
Parameter | Description | Example |
---|---|---|
(required) market | the chosen market pair | DOGEC_BTC |
(optional) side | the orderbook side | buy or sell |
Example:
Private APIs
These APIs require you to be using real API keys with sufficient permissions to perform the private action. For example, withdrawals will work on any key with the Withdrawals Permission enabled, order placing/cancelling will work on a key with "Full Permissions", but will not work on a "Read only" key, be aware of this and customize your keys accordingly for security!
Get Account (Auth Required)
Returns general information about your StakeCube account, including wallets, balances, fee-rate in percentage and your account username.
- Method:
getAccount();
Example:
Withdraw (Auth Required)
Creates a withdrawal request with a specified coin, address and amount.
- Method:
withdraw($ticker, $address, $amount);
Parameter | Description | Example |
---|---|---|
(required) ticker | the withdrawal coin | DOGEC |
(required) address | the withdrawal address | dWdSgX... |
(required) amount | the withdrawal amount | 100 |
Example:
Get Open Orders (Auth Required)
Returns a list of all open orders for all StakeCube Exchange markets.
- Method:
getOpenOrders();
Example:
Get My Trades (Auth Required)
Returns a list of all trades, you can leave the market empty ("") to return all trades, or specify a market such as "DOGEC_BTC" to return those market orders, you may also specify a limit of the amount of returned trades, of which the default is 100 trades.
- Method:
getMyTrades($market, $limit);
Parameter | Description | Example |
---|---|---|
(optional) market | the market pair | DOGEC_BTC |
(optional) limit | the maximum returned trades | 100 |
Example:
Get Order History (Auth Required)
Returns a list of all orders from a specified market such as "DOGEC_BTC", you may also specify a limit of the amount of returned orders, of which the default is 100 orders.
- Method:
getOrderHistory($market, $limit);
Parameter | Description | Example |
---|---|---|
(required) market | the market pair | DOGEC_BTC |
(optional) limit | the maximum returned trades | 100 |
Example:
Post Order (Auth Required)
Creates an exchange order for the specified market pair, orderbook side, price and amount.
- Method:
postOrder($market, $side, $price, $amount);
Parameter | Description | Example |
---|---|---|
(required) market | the market pair | DOGEC_BTC |
(required) side | the trade side | BUY |
(required) price | the price in the base coin | 0.00002000 (BTC) |
(required) amount | the amount of the trade coin | 1000 (DOGEC) |
Example:
Cancel Order (Auth Required)
Cancels an open order by it's orderId
- Method:
cancel($orderId);
Parameter | Description | Example |
---|---|---|
(required) orderId | the ID of your order | 123 |
Example:
Cancel All (Auth Required)
Cancels all orders in a specified market pair.
- Method:
cancelAll($market);
Parameter | Description | Example |
---|---|---|
(required) market | the market pair | DOGEC_BTC |
Example:
Set MineCube Payout Coin (Auth Required)
Sets a coin as the preferred payout coin to receive upon future MineCube payouts.
- Method:
setMineCubePayoutCoin($coin);
Parameter | Description | Example |
---|---|---|
(required) coin | the MineCube payout coin | DOGE |
Example:
Buy MineCube Workers (Auth Required)
Buys a specified amount of MineCube workers using the chosen payment method.
- Method:
buyMineCubeWorkers($method, $workers);
Parameter | Description | Example |
---|---|---|
(required) method | the payment method | SCC or CREDITS |
(required) workers | the worker quantity | 10 |
Example: