Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jccdex/jcc-oc-base-lib

An interface for interacting with the blockchain wallet operation for ios
https://github.com/jccdex/jcc-oc-base-lib

bizain blockchain ios jccdex jingtum local-sign wallet-operation

Last synced: 8 days ago
JSON representation

An interface for interacting with the blockchain wallet operation for ios

Awesome Lists containing this project

README

        

# jcc-oc-base-lib

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

[![Pod version](https://badge.fury.io/co/jcc_oc_base_lib.svg)](https://badge.fury.io/co/jcc_oc_base_lib)
[![Build Status](https://travis-ci.com/JCCDex/jcc-oc-base-lib.svg?branch=master)](https://travis-ci.com/JCCDex/jcc-oc-base-lib)
[![Coverage Status](https://coveralls.io/repos/github/JCCDex/jcc-oc-base-lib/badge.svg?branch=dev)](https://coveralls.io/github/JCCDex/jcc-oc-base-lib?branch=dev)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

## Installation with CocoaPods

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

```ruby
pod 'jcc_oc_base_lib'
```

## API of JTWalletManager

interface for interacting with the node sdk of jingtum & jingtum alliance chains. Now supports [SWTC](https://state.jingtum.com/#!/) & [BIZAIN](https://bizain.net/) chain.

### createWallet

```objective-c
#import
#import
#import

// 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

```objective-c
// 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

```objective-c
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

```objective-c
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

```objective-c
// 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.
}];
```

For more structure of transaction data, see [jcc_exchange](https://github.com/JCCDex/jcc_exchange/blob/master/src/tx.js).