TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Aug 2015 |
Maintained by Ricardo Alves.
Objective C client library for the meXBT exchange API
To run the example project, clone the repo, and run pod install
from the Example directory first.
[MexbtClient productPairs];
[MexbtClient ticker:@"BTCMXN"];
[MexbtClient trades:@"BTCMXN" startIndex:-1 count:20];
[MexbtClient tradesByDate:@"BTCMXN" startDate:1416530012 endDate:1416559390];
[MexbtClient orderBook:@"BTCMXN"];
MexbtClient *client = [[MexbtClient alloc] init];
client.privateKey = @"<YOUR PRIVATE KEY>";
client.publicKey = @"<YOUR PUBLIC KEY>";
client.userId = @"<YOUR USER ID / EMAIL";
client.isSandbox = YES;
[client createMarketOrder:@"BTCUSD" side:@"buy" qty:@1.0 px:@342.99];
[client createLimitOrder:@"BTCUSD" side:@"buy" qty:@1.0 px:@342.99];
NSDictionary *order = [client createOrder:@"BTCUSD" side:@"buy" orderType:0 qty:@1.0 px:@342.99];
NSInteger orderId = [order[@"serverOrderId"] integerValue];
[client modifyOrder:@"BTCUSD" serverOrderId:orderId modifyAction:1];
[client moveOrderToTop:@"BTCUSD" serverOrderId:orderId];
[client executeOrder:@"BTCUSD" serverOrderId:orderId];
[client cancelOrder:@"BTCUSD" serverOrderId:orderId];
[client cancelAll:@"BTCUSD"];
[client accountInfo];
[client balance];
[client accountTrades:@"BTCUSD" startIndex:-1 count:20];
[client orders];
[client depositAddresses];
[client depositAddress:@"BTC"]
[client withdraw:@"BTC" amount:@1.123456 sendToAddress:@"address"];
MexbtClient is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "MexbtClient"
pod "IGDigest", "~> 1.1"
(NSDictionary *)
except for depositAddress
which returns (NSString *)
.nil
when meXBT API returns with HTTP status code other than 200
or returns non-json or empty response. true
, false
) are stored as (NSNumber *)
using 0
for false
and 1
for true
. So if if you want to get the BOOL
of an (NSNumber *) x
, you would use [x boolValue]
For convenience you can install the lib in any XCode from the Github repo directly.
This only makes sense when you are working on the lib not when your are using it, in which case you should do as specified in Installation section above.
You can do that by adding the following to Podfile
.
pod 'MexbtClient', :git => 'https://github.com/Ahimta/mexbt-objective-c.git'
pod 'IGDigest', '~> 1.1'
git clone https://github.com/Ahimta/mexbt-objective-c.git
cd mexbt-objective-c/Example
pod install
Then open mexbt-objective-c/Example/MexbtClient.xcworkspace
in XCode.
The library consists primarily of three files (the rest is mostly generated by CocoaPods):
Abdullah Alansari, [email protected]
MexbtClient is available under the MIT license. See the LICENSE file for more info.