Enable web3Swift

pull/2/head
Michael Scoff 7 years ago
parent 66ef646626
commit 56630690eb
  1. 8
      Trust/Transactions/Storage/Session.swift
  2. 11
      Trust/Vendors/New Group/Web3Swift.swift

@ -9,8 +9,8 @@ enum RefreshType {
class WalletSession {
let account: Account
//let web3: Web3Swift
//let config = Config()
let web3: Web3Swift
let config = Config()
private lazy var balanceCoordinator: BalanceCoordinator = {
return BalanceCoordinator(session: self)
@ -20,8 +20,8 @@ class WalletSession {
init(account: Account) {
self.account = account
//self.web3 = Web3Swift(url: config.rpcURL)
//self.web3.start()
self.web3 = Web3Swift(url: config.rpcURL)
self.web3.start()
self.balanceCoordinator.start()
self.balanceCoordinator.delegate = self
}

@ -59,6 +59,17 @@ class Web3Swift: NSObject {
completion(.failure(AnyError(error)))
}
}
case .script(let command):
JSScript<T.Response>(command).evaluate(in: webView) { result in
switch result {
case .success(let result):
NSLog("script \(result)")
completion(.success(result))
case .failure(let error):
NSLog("script error \(error)")
completion(.failure(AnyError(error)))
}
}
}
}
}

Loading…
Cancel
Save