Latest 0.1.1
Homepage https://github.com/JCCDex/jcc-oc-base-lib
License MIT
Platforms ios 9.0, requires ARC
Dependencies MJExtension, WebViewJavascriptBridge
Authors

jcc-oc-base-lib

An interface for interacting with the blockchain wallet operation for ios.

Pod version
Build Status
Coverage Status
PRs Welcome

Installation with CocoaPods

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

pod 'jcc_oc_base_lib'

API of JTWalletManager

interface for interacting with the node sdk of jingtum & jingtum alliance chains. Now supports SWTC & BIZAIN chain.

createWallet

#import <jcc_oc_base_lib/JTWalletManager.h>
#import <jcc_oc_base_lib/JingtumWallet.h>
#import <jcc_oc_base_lib/JccChains.h>

// create swtc wallet
NSString *chain = SWTC_CHAIN;
// create bizain wallet
// NSString *chain = BIZAIN_CHAIN;

[[JTWalletManager shareInstance] createWallet:chain completion:^(NSError *error, JingtumWallet *wallet) {
    // create successfully if the error is nil.
}];

importSecret

// import swtc secret
NSString *chain = SWTC_CHAIN;
// import bizain secret
// NSString *chain = BIZAIN_CHAIN;

NSString *secret = @"";

[[JTWalletManager shareInstance] importSecret:secret chain:chain completion:^(NSError *error, JingtumWallet *wallet) {
    // import succesfully if the error is nil.
}];

isValidSecret

NSString *chain = SWTC_CHAIN;
// NSString *chain = BIZAIN_CHAIN;

NSString *secret = @"";

[[JTWalletManager shareInstance] isValidSecret:secret chain:chain completion:^(BOOL isValid) {
    // the isValid is YES if the secret is valid.
}];

isValidAddress

NSString *chain = SWTC_CHAIN;
// NSString *chain = BIZAIN_CHAIN;

NSString *address = @"";

[[JTWalletManager shareInstance] isValidAddress:address chain:chain completion:^(BOOL isValid) {
    // the isValid is YES if the address is valid.
}];

sign

// transaction data
NSMutableDictionary *transaction = [[NSMutableDictionary alloc] initWithCapacity:0];

NSString *secret = @"";

// sign transaction data of swtc chain
NSString *chain = SWTC_CHAIN;
// sign transaction data of bizain chain
// NSString *chain = BIZAIN_CHAIN;

[_jtWalletManager sign:transaction secret:secret chain:chain completion:^(NSError *error, NSString *signature) {
    // the error is nil if locally sign successfully.
}];

Latest podspec

{
    "name": "jcc_oc_base_lib",
    "version": "0.1.1",
    "summary": "An interface for interacting with the blockchain wallet operation for ios",
    "description": "An interface for interacting with the blockchain wallet operation for ios. Supports jingtum & jingtum alliance chians.",
    "homepage": "https://github.com/JCCDex/jcc-oc-base-lib",
    "license": "MIT",
    "authors": {
        "GinMu": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/JCCDex/jcc-oc-base-lib.git",
        "tag": "0.1.1"
    },
    "source_files": "jcc_oc_base_lib/**/*.{h,m}",
    "resources": "jcc_oc_base_lib/**/*.{html,js}",
    "requires_arc": true,
    "dependencies": {
        "MJExtension": [],
        "WebViewJavascriptBridge": []
    }
}

Pin It on Pinterest

Share This