31 lines
953 B
Swift
31 lines
953 B
Swift
//
|
|
// URL.swift
|
|
// List
|
|
//
|
|
// Created by Igor Danich on 30.07.2020.
|
|
// Copyright © 2020 List. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
// MARK: - REFACTOR
|
|
|
|
extension URL {
|
|
init?(transactionId: String) {
|
|
self.init(string: "https://bloks.io/transaction/\(transactionId)")
|
|
}
|
|
init?(billAccount: String, scope: String, bounds: String) {
|
|
self.init(string: "https://bloks.io/account/\(billAccount)?loadContract=true&tab=Tables&table=bills&scope=\(scope)&limit=100&lower_bound=\(bounds)&upper_bound=\(bounds)")
|
|
}
|
|
}
|
|
|
|
extension URL {
|
|
static func from(symbol: String, contract: String? = nil) -> URL {
|
|
if let contract = contract {
|
|
return URL(string: "https://raw.githubusercontent.com/BlockABC/eos-tokens/master/tokens/\(contract)/\(symbol).png")!
|
|
} else {
|
|
return URL(string: "https://raw.githubusercontent.com/eoscafe/eos-airdrops/master/logos/\(symbol).png")!
|
|
}
|
|
}
|
|
}
|