// // InheritanceServiceInformation.swift // Wallet // // Created by Igor on 11.03.2021. // Copyright © 2021 AM. All rights reserved. // import Foundation extension Inheritance.Service { class Information: Common.Service.Provider { var contract = Contract.cash private(set) var object: Model? } } extension Inheritance.Service.Information { func fetch(username: String?, completion: @escaping () -> Void) { Network.table.fetch( code: ApplicationEnvironment.shared().current.contract(contract), table: "inheritance", scope: ApplicationEnvironment.shared().current.contract(contract), limit: 1, lowerBound: username, upperBound: username, type: Inheritance.Model.Information.self ) { collection in self.object = collection.first completion() } } } extension Inheritance.Service.Information { typealias Contract = EOSContract typealias Model = Inheritance.Model.Information }