Latest 1.0.0-beta6
Homepage https://github.com/AndrewBarba/lisk-swift
License Apache 2.0
Platforms ios 10.0, osx 10.12, tvos 10.0, watchos 3.0
Dependencies Ed25519
Authors

Lisk Swift

Build Status
CocoaPods Compatible
Carthage Compatible
Twitter

Lisk Swift is a Swift 4 library for Lisk – the cryptocurrency and blockchain application platform. It allows developers to create offline transactions and broadcast them onto the network. It also allows developers to interact with the core Lisk API, for retrieval of collections and single records of data located on the Lisk blockchain. Its main benefit is that it does not require a locally installed Lisk node, and instead utilizes the existing peers on the network. It can be used on any environment that runs Swift 4, including iOS, tvOS, macOS, watchOS.

Lisk Swift is heavily inspired by Lisk JS

Features

  • [x] Local Signing for maximum security
  • [x] Targets Lisk 1.0.0 API
  • [x] Directly based on lisk-js
  • [x] Swift 4.0
  • [x] Unit Tests (87% coverage)
  • [x] Documentation

API

Documentation

https://andrewbarba.github.io/lisk-swift/

Usage

Import Framework

import Lisk

Send LSK

let address = ...
let secret = ...

// Send LSK on the Mainnet
Transactions().transfer(lsk: 1.12, to: address, secret: secret) { response in
    switch response {
    case .success(let result):
        print(result.transactionId)
    case .error(let error):
        print(error.message)
    }
}

Send LSK on Testnet

let address = ...
let secret = ...

// Send LSK on the Testnet
Transactions(client: .testnet).transfer(lsk: 1.12, to: address, secret: secret) { response in
    switch response {
    case .success(let result):
        print(result.transactionId)
    case .error(let error):
        print(error.message)
    }
}

Testnet

By default, all modules are initialized with an APIClient pointing to the Lisk Mainnet. You can optionally pass in a specific client to any modules constructor:

let mainTransactions = Transactions()
let testTransactions = Transactions(client: .testnet)

To default all modules to a specific client you can set the shared client:

APIClient.shared = .testnet

And then all modules initialized will default to Testnet:

// This will connect to Testnet
let transactions = Transactions()

Requirements

  • iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+
  • Xcode 9.0+
  • Swift 4.0+

Installation

Swift Package Manager

// swift-tools-version:4.0

import PackageDescription

let package = Package(
    name: "My Lisk App",
    dependencies: [
        .package(url: "https://github.com/AndrewBarba/lisk-swift.git", from: "1.0.0")
    ]
)

CocoaPods

CocoaPods 1.1.0+ is required to build lisk-swift

pod 'Lisk', '~> 1.0.0-beta'

Carthage

github "AndrewBarba/lisk-swift" ~> 1.0.0-beta

Thank You

To show support for continued development feel free to vote for my delegate: andrew

Or donate LSK to 14987768355736502769L

Latest podspec

{
    "name": "Lisk",
    "version": "1.0.0-beta6",
    "summary": "Swift 4 library for Lisk - the cryptocurrency and blockchain application platform",
    "homepage": "https://github.com/AndrewBarba/lisk-swift",
    "documentation_url": "https://andrewbarba.github.io/lisk-swift/",
    "license": {
        "type": "Apache 2.0",
        "file": "LICENSE.md"
    },
    "authors": {
        "Andrew Barba": "[email protected]"
    },
    "source": {
        "git": "https://github.com/AndrewBarba/lisk-swift.git",
        "tag": "1.0.0-beta6"
    },
    "pod_target_xcconfig": {
        "SWIFT_WHOLE_MODULE_OPTIMIZATION": "YES",
        "APPLICATION_EXTENSION_API_ONLY": "YES"
    },
    "platforms": {
        "ios": "10.0",
        "osx": "10.12",
        "tvos": "10.0",
        "watchos": "3.0"
    },
    "source_files": "Sources/**/*.{h,swift}",
    "public_header_files": "Sources/**/*.h",
    "dependencies": {
        "Ed25519": [
            "~> 0.2.0"
        ]
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This