Files
raspberry/iOS/Wallet/Sources/Network/Model/BlockchainActions/NetworkModelBlockchainUpdateAuth.swift
2022-06-03 16:55:25 +03:00

74 lines
1.6 KiB
Swift

//
// NetworkModelBlockchainUpdateAuth.swift
// Wallet
//
// Created by Alexandr Serpokrylow on 21.02.2022.
// Copyright © 2022 AM. All rights reserved.
//
import Foundation
extension Network.Model.Blockchain {
struct UpdateAuth: Codable {
let account: String
let permission: String
let parent: String
let auth: Authority
}
struct Authority: Codable {
public var threshold: Int
public var keys: [KeyWeight]
public var waits: [WaitWeight]
public var accounts: [PermissionLevelWeight]
enum CodingKeys: String, CodingKey {
case threshold
case keys
case waits
case accounts
}
}
public struct KeyWeight: Codable {
public var key: String
public var weight: Int
enum CodingKeys: String, CodingKey {
case key
case weight
}
}
public struct WaitWeight: Codable {
public var waitSec: Int
public var weight: Int
enum CodingKeys: String, CodingKey {
case waitSec = "wait_sec"
case weight
}
}
public struct PermissionLevelWeight: Codable {
public var weight: Int
public var permission: PermissionLevel
enum CodingKeys: String, CodingKey {
case weight
case permission
}
}
public struct PermissionLevel: Codable {
public var actor: String
public var permission: String
enum CodingKeys: String, CodingKey {
case actor
case permission
}
}
}