neovmUtils 1.8.0

neovmUtils 1.8.0

Wyatt Mufson维护。



 
依赖项
RyuCrypto= 0.0.1
NetworkUtils= 1.1.0
 

  • 作者:
  • WyattMufson

neovmUtils

Build Status codecov Version License Platform

概述

neovmUtils 是一个用于与 Ontology 和 NEO 区块链交互的本地 iOS 框架。它包含由 O3 Labs 撰写的 neo-utils 项目编译版本,该项目用 Go 编写。

neovmUtils 还实现 BIP39 密码短语,通过 Trezor Crypto 库的 iOS 包装器生成钱包。

它允许用户与 Ontology 上多种类的数字资产进行交互,例如原生 ONT/ONG 和 OEP4/5/8/10 资产。

安装

neovmUtils 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod 'neovmUtils'

然后导入到您的项目中

import neovmUtils

注意: neovmUtils 需要 iOS 12.0 或更高版本。

以下是一个示例 Podfile

use_frameworks!
platform :ios, '12.0'

target :'My_App' do
  pod 'neovmUtils'
end

子依赖项

neovmUtils 需要

  • RyuCrypto - Trezor Crypto 库的 Ryu 分支
  • NetworkUtils - Swift风格的HTTP请求库
    • SwiftPromises - Ryu的Swift异步请求库

使用说明

neovmUtils提供了

golang

该SDK与该pod搭配使用,可以通过import Neoutils导入使用。

Go实现方式的文档可在此查阅:here

改进

编译好的neo-utils SDK使用比较复杂,因此我们在原生Swift中对其进行了许多改进。

例如,钱包创建可以这样做:

import Neoutils (编译后的Swift)

let wif = "<SOME VALID WIF>"
let err = NSErrorPointer(nilLiteral: ())
let account = NeoutilsGenerateFromWIF(wif, err) // account is of type NeoutilsWallet?
if err != nil {
  print("There was an error: \(err!)")
}

或者也可以这样做:

import neovmUtils (Swift抽象层)

let wif = "<SOME VALID WIF>"
let account = walletFromWIF(wif: wif) // account is of type Wallet?

贡献

我们欢迎为neovmUtils贡献者。在开始之前,请查阅我们的贡献指南

它遵循ontio-community sdk specifications doc来实现其Ontology集成。

gomobile创建的编译头文件应该在gomobile解决这个问题之前被包裹在NS_ASSUME_NONNULL宏中(https://stackoverflow.com/a/36164132/3830876)。

主要作者

neovmUtils - Ryu Games 和 TowerBuilders 的 Wyatt Mufson

neo-utils - O3 Labs 的 Apisit Toompakdee

许可协议

neovmUtils 在 MIT 许可协议下可用。