33 lines
859 B
Swift
33 lines
859 B
Swift
//
|
|
// AccountServiceConnect.swift
|
|
// Wallet
|
|
//
|
|
// Created by Igor on 15.10.2020.
|
|
// Copyright © 2020 List. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension Account.Service {
|
|
class Connect {
|
|
|
|
var model: AccountModelConnect!
|
|
|
|
func submit(privateKey: String, _ completion: @escaping (String?) -> Void) {
|
|
Network.Service.Blockchain.execute(
|
|
contract: model.contract,
|
|
action: .transfer,
|
|
data: Network.Model.Blockchain.Transfer(
|
|
from: model.from,
|
|
to: model.to,
|
|
quantity: model.amount + " " + model.symbol,
|
|
memo: model.memo
|
|
),
|
|
privateKeys: [privateKey]
|
|
) { (result) in
|
|
completion(.error(result: result))
|
|
}
|
|
}
|
|
}
|
|
}
|