Skip to content

coinninjadev/CNBitcoinKit

Repository files navigation

CNBitcoinKit

Dynamic umbrella framework to be consumed by an iOS app for implementing functionality with respect to Bitcion and connecting to the Bitcoin network. The framework is an umbrella framework, which includes various static libraries such as:

The Xcode project defines the necessary steps to build the framework as a build target.

Getting Started

  1. Clone the project
  2. Type bundle install in a Terminal window, at the project root
  3. Type bundle exec fastlane test ...or...
  4. Open Xcode
  5. Ensure the CNBitcoinKit target is selected, and build (Cmd + B). The build process will build the libbitcoin dependent target, which calls make recipes to build libbitcoin and subsequent dependencies.

Prerequisites

What things you need to install the software and how to install them

  • Xcode >= 9.2
  • macOS >= 10.13

Installing

Carthage (Recommended)

Recommended consumption is via Carthage. Create a Cartfile in the project root of your app project and add the following line:

github "coinninjadev/CNBitcoinKit.git" "master"

Then, from the command line (add the --platform iOS parameter if compiling only for iOS):

carthage bootstrap [--platform iOS]

Then, follow the steps for adding a Carthage dependency to Xcode

Running the tests

Open Xcode and press Cmd-U to run all tests.

Usage

To create (and eventually broadcast) a transaction use - (void)broadcastWithTransactionData:(CNBTransactionData *)data wallet:(CNBHDWallet *)wallet success:(void (^)(NSString *))success failure:(void (^)(NSError *))failure function exposed on the CNBTransactionBuilder class. In order to call that method, you'll need an instance of CNBHDWallet initialized with recovery words with funds available to spend, and a populated CNBTransactionData object, holding the data about the transaction which should be broadcasted.

NOTE: The above function is the only function that should be used. Do not use any functions exposed by the wallet. They are exposed to allow the builder to successfully build a transaction.

Contributing

Please read CONTRIBUTING.md for our contribution policy.

Please read CODE_OF_CONDUCT.md for details on our code of conduct.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Make recipe structure inspired by AirBitz