Latest 0.1.0
Homepage https://github.com/JCCDex/jcc_rpc_oc
License MIT
Platforms ios 10.9
Authors

An objective-c restful api for interacting with the jingchang server.

PRs Welcome

Installation with CocoaPods

To integrate jcc_rpc_oc into your Xcode project using CocoaPods, specify it in your Podfile, then run pod install.

pod 'jcc_rpc_oc'

Import

#import <jcc_rpc_oc/JccdexExchange.h>
#import <jcc_rpc_oc/JccdexMacro.h>

API of JCCDex Exchange

initExchangeNodes

// init exchange nodes firstly
_jccdexExchange = [JccdexExchange shareInstance];
NSArray *nodes;
[_jccdexExchange initExchangeNodes:nodes];

requestBalance

NSString *address = @"";
[[JccdexExchange shareInstance] requestBalance:address onResponse:^(NSDictionary *response) {
    NSString *code = [response objectForKey:@"code"];
    if () {
    } else {
    }
} onFail:^(NSError *error) {
}];

createOrder

NSString *signature = @"";
[[JccdexExchange shareInstance] createOrder:signature onResponse:^(NSDictionary *response) {
    NSString *code = [response objectForKey:@"code"];
    if () {
    } else {
    }
} onFail:^(NSError *error) {
}];

requestSequence

NSString *address = @"";
[[JccdexExchange shareInstance] requestSequence:address onResponse:^(NSInteger sequence) {
    if (sequence == JC_INVALID_SEQUENCE) {
        // invalid sequence
    } else {
        // valid sequence
    }
} onFail:^(NSError *error) {
}];

cancelOrder

NSString *signature = @"";
[[JccdexExchange shareInstance] cancelOrder:signature onResponse:^(NSDictionary *response) {
    NSString *code = [response objectForKey:@"code"];
    if () {
    } else {
    }
} onFail:^(NSError *error) {
}];

transferToken

NSString *signature = @"";
[[JccdexExchange shareInstance] transferToken:signature onResponse:^(NSDictionary *response) {
    NSString *code = [response objectForKey:@"code"];
    if () {
    } else {
    }
} onFail:^(NSError *error) {
}];

requestOrders

NSString *address = @"";
NSInteger page = 0;
[[JccdexExchange shareInstance] requestOrders:address page:page onResponse:^(NSDictionary *response) {
    NSString *code = [response objectForKey:@"code"];
    if () {
    } else {
    }
} onFail:^(NSError *error) {
}];

requestHistoricTransactions

// request without ledger or seq
NSString *address = @"";
[[JccdexExchange shareInstance] requestHistoricTransactions:address onResponse:^(NSDictionary *response) {
    NSString *code = [response objectForKey:@"code"];
    if () {
    } else {
    }
} onFail:^(NSError *error) {
}];
// request with ledger and seq
NSString *address = @"";
NSInteger ledger = 0;
NSInteger seq = 0;
[[JccdexExchange shareInstance] requestHistoricTransactions:address ledger:ledger seq:seq onResponse:^(NSDictionary *response) {
    NSString *code = [response objectForKey:@"code"];
    if () {
    } else {
    }
} onFail:^(NSError *error) {
}];

Latest podspec

{
    "name": "jcc_rpc_oc",
    "version": "0.1.0",
    "summary": "JCCDex rpc with objective-c",
    "description": "An objective-c interface for interacting with jingchang server",
    "homepage": "https://github.com/JCCDex/jcc_rpc_oc",
    "license": "MIT",
    "authors": {
        "GinMu": "[email protected]"
    },
    "platforms": {
        "ios": "10.9"
    },
    "source": {
        "git": "https://github.com/JCCDex/jcc_rpc_oc.git",
        "tag": "0.1.0"
    },
    "source_files": "jcc_rpc_oc/*.{h,m}"
}

Pin It on Pinterest

Share This