Contents

AndrewBarba/lisk-swift

Swift 4 library for Lisk - Including Local Signing for maximum security

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-beta")
    ]
)

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

Package Metadata

Repository: AndrewBarba/lisk-swift

Homepage: https://lisk.io

Stars: 10

Forks: 5

Open issues: 1

Default branch: master

Primary language: swift

License: Apache-2.0

Topics: bitcoin, cryptocurrency, ios, lisk, lsk, macos, swift, tvos, watchos

README: README.md