Skip to content

Commit

Permalink
Batch 14: AurhorizedDappDetailed, AccountsOrPersonas +more (#110)
Browse files Browse the repository at this point in the history
`AuthorizedDappDetails` and `AccountOrPersona` and more
  • Loading branch information
CyonAlexRDX authored Apr 29, 2024
1 parent e38020d commit 5decc31
Show file tree
Hide file tree
Showing 136 changed files with 4,462 additions and 1,918 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// File.swift
//
//
// Created by Alexander Cyon on 2024-04-27.
//

import Foundation
import SargonUniFFI

extension AccountOrPersona {
public var id: AddressOfAccountOrPersona {
accountOrPersonaGetId(entity: self)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ extension Accounts {
accountsGetAccountById(accounts: self, id: id)
}

internal var elementCount: Int {
Int(accountsElementCount(accounts: self))
}

public var count: Int {
elementCount
Int(accountsElementCount(accounts: self))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// File.swift
//
//
// Created by Alexander Cyon on 2024-04-14.
//

import Foundation
import SargonUniFFI

extension AccountsForDisplay {
public init(_ elements: [Element]) {
self = newAccountsForDisplay(accountsForDisplay: elements)
}

public init(element: Element) {
self = newAccountsForDisplayWithAccountForDisplay(accountForDisplay: element)
}

public var elements: [Element] {
accountsForDisplayGetElements(accountsForDisplay: self)
}

public func appending(_ element: Element) -> Self {
newAccountsForDisplayByAppending(accountForDisplay: element, to: self)
}

public func updatingOrInserting(element: Element, at index: Int) -> Self {
newAccountsForDisplayByUpdatingOrInsertingAtIndex(accountForDisplay: element, to: self, index: UInt64(index))
}

public func removing(_ id: Element.ID) -> Self {
newAccountsForDisplayRemovedById(idOfAccountForDisplay: id, from: self)
}

public func updatingOrAppending(_ element: Element) -> Self {
newAccountsForDisplayByUpdatingOrAppending(accountForDisplay: element, to: self)
}

public func removing(element: Element) -> Self {
newAccountsForDisplayRemovedElement(accountForDisplay: element, from: self)
}

public func get(id: Element.ID) -> Element? {
accountsForDisplayGetAccountForDisplayById(accountsForDisplay: self, id: id)
}

public var count: Int {
Int(accountsForDisplayElementCount(accountsForDisplay: self))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// File.swift
//
//
// Created by Alexander Cyon on 2024-04-14.
//

import Foundation
import SargonUniFFI

extension AccountsOrPersonas {
public init(_ elements: [Element]) {
self = newAccountsOrPersonas(accountsOrPersonas: elements)
}

public init(element: Element) {
self = newAccountsOrPersonasWithAccountOrPersona(accountOrPersona: element)
}

public var elements: [Element] {
accountsOrPersonasGetElements(accountsOrPersonas: self)
}

public func appending(_ element: Element) -> Self {
newAccountsOrPersonasByAppending(accountOrPersona: element, to: self)
}

public func updatingOrInserting(element: Element, at index: Int) -> Self {
newAccountsOrPersonasByUpdatingOrInsertingAtIndex(accountOrPersona: element, to: self, index: UInt64(index))
}

public func removing(_ id: Element.ID) -> Self {
newAccountsOrPersonasRemovedById(idOfAccountOrPersona: id, from: self)
}

public func updatingOrAppending(_ element: Element) -> Self {
newAccountsOrPersonasByUpdatingOrAppending(accountOrPersona: element, to: self)
}

public func removing(element: Element) -> Self {
newAccountsOrPersonasRemovedElement(accountOrPersona: element, from: self)
}

public func get(id: Element.ID) -> Element? {
accountsOrPersonasGetAccountOrPersonaById(accountsOrPersonas: self, id: id)
}

public var count: Int {
Int(accountsOrPersonasElementCount(accountsOrPersonas: self))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import Foundation
import SargonUniFFI

extension DetailedAuthorizedPersonas {
public init(_ elements: [Element]) {
self = newDetailedAuthorizedPersonas(detailedAuthorizedPersonas: elements)
}

public init(element: Element) {
self = newDetailedAuthorizedPersonasWithAuthorizedPersonaDetailed(authorizedPersonaDetailed: element)
}

public var elements: [Element] {
detailedAuthorizedPersonasGetElements(detailedAuthorizedPersonas: self)
}

public func appending(_ element: Element) -> Self {
newDetailedAuthorizedPersonasByAppending(authorizedPersonaDetailed: element, to: self)
}

public func updatingOrInserting(element: Element, at index: Int) -> Self {
newDetailedAuthorizedPersonasByUpdatingOrInsertingAtIndex(authorizedPersonaDetailed: element, to: self, index: UInt64(index))
}

public func removing(_ id: Element.ID) -> Self {
newDetailedAuthorizedPersonasRemovedById(idOfAuthorizedPersonaDetailed: id, from: self)
}

public func updatingOrAppending(_ element: Element) -> Self {
newDetailedAuthorizedPersonasByUpdatingOrAppending(authorizedPersonaDetailed: element, to: self)
}

public func removing(element: Element) -> Self {
newDetailedAuthorizedPersonasRemovedElement(authorizedPersonaDetailed: element, from: self)
}

public func get(id: Element.ID) -> Element? {
detailedAuthorizedPersonasGetAuthorizedPersonaDetailedById(detailedAuthorizedPersonas: self, id: id)
}

public var count: Int {
Int(detailedAuthorizedPersonasElementCount(detailedAuthorizedPersonas: self))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// File.swift
//
//
// Created by Alexander Cyon on 2024-04-28.
//

import Foundation
import SargonUniFFI

extension ProfileNetwork {
public func detailsForAuthorizedDapp(
_ dapp: AuthorizedDapp
) throws -> AuthorizedDappDetailed {
try profileNetworkDetailsForAuthorizedDapp(
profileNetwork: self,
dapp: dapp
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Foundation
import SargonUniFFI

#if DEBUG
extension AccountForDisplay {
public static let sample: Self = newAccountForDisplaySample()
public static let sampleOther: Self = newAccountForDisplaySampleOther()
}
#endif // DEBUG
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Foundation
import SargonUniFFI

#if DEBUG
extension AccountOrPersona {
public static let sampleMainnet: Self = newAccountOrPersonaSampleMainnet()
public static let sampleMainnetOther: Self = newAccountOrPersonaSampleMainnetOther()
public static let sampleMainnetThird: Self = newAccountOrPersonaSampleMainnetThird()

public static let sampleStokenet: Self = newAccountOrPersonaSampleStokenet()
public static let sampleStokenetOther: Self = newAccountOrPersonaSampleStokenetOther()
public static let sampleStokenetThird: Self = newAccountOrPersonaSampleStokenetThird()
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Foundation
import SargonUniFFI

#if DEBUG
extension AuthorizedDappDetailed {
public static let sample: Self = newAuthorizedDappDetailedSample()
public static let sampleOther: Self = newAuthorizedDappDetailedSampleOther()
}
#endif // DEBUG
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Foundation
import SargonUniFFI

#if DEBUG
extension AuthorizedPersonaDetailed {
public static let sample: Self = newAuthorizedPersonaDetailedSample()
public static let sampleOther: Self = newAuthorizedPersonaDetailedSampleOther()
}
#endif // DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extension Account {
public static let sampleMainnetAlice: Self = newAccountSampleMainnetAlice()
public static let sampleMainnetBob: Self = newAccountSampleMainnetBob()
public static let sampleMainnetCarol: Self = newAccountSampleMainnetCarol()
public static let sampleMainnetDiana: Self = newAccountSampleMainnetDiana()

public static let sampleStokenetNadia: Self = newAccountSampleStokenetNadia()
public static let sampleStokenetOlivia: Self = newAccountSampleStokenetOlivia()
Expand All @@ -13,6 +14,7 @@ extension Account {
public static let sampleMainnet = Self.sampleMainnetAlice
public static let sampleMainnetOther = Self.sampleMainnetBob
public static let sampleMainnetThird = Self.sampleMainnetCarol
public static let sampleMainnetFourth = Self.sampleMainnetDiana

public static let sampleStokenet = Self.sampleStokenetNadia
public static let sampleStokenetOther = Self.sampleStokenetOlivia
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// File.swift
//
//
// Created by Alexander Cyon on 2024-04-22.
//

import Foundation
import SargonUniFFI

#if DEBUG
extension AccountsForDisplay {
public static let sample: Self = newAccountsForDisplaySample()
public static let sampleOther: Self = newAccountsForDisplaySampleOther()
}
#endif // DEBUG
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// File.swift
//
//
// Created by Alexander Cyon on 2024-04-15.
//

import Foundation
import SargonUniFFI

#if DEBUG
extension AccountsOrPersonas {
public static let sample: Self = newAccountsOrPersonasSample()
public static let sampleOther: Self = newAccountsOrPersonasSampleOther()
}
#endif // DEBUG
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// File.swift
//
//
// Created by Alexander Cyon on 2024-04-22.
//

import Foundation
import SargonUniFFI

#if DEBUG
extension DetailedAuthorizedPersonas {
public static let sample: Self = newDetailedAuthorizedPersonasSample()
public static let sampleOther: Self = newDetailedAuthorizedPersonasSampleOther()
}
#endif // DEBUG
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import SargonUniFFI

#if DEBUG
extension EntitySecurityState {
public static let sample: Self = newEntitySecurityStateSample()
public static let sampleOther: Self = newEntitySecurityStateSampleOther()
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,23 @@ import SargonUniFFI

#if DEBUG
extension Persona {
public static let sampleMainnet: Self = newPersonaSampleMainnetSatoshi()
public static let sampleMainnetOther: Self = newPersonaSampleMainnetBatman()
public static let sampleMainnetThird: Self = newPersonaSampleMainnetRipley()

public static let sampleStokenet: Self = newPersonaSampleStokenetLeiaSkywalker()
public static let sampleStokenetOther: Self = newPersonaSampleStokenetHermione()
public static let sampleStokenetThird: Self = newPersonaSampleStokenetConnor()
public static let sampleMainnetSatoshi: Self = newPersonaSampleMainnetSatoshi()
public static let sampleMainnetBatman: Self = newPersonaSampleMainnetBatman()
public static let sampleMainnetRipley: Self = newPersonaSampleMainnetRipley()
public static let sampleMainnetTuring: Self = newPersonaSampleMainnetTuring()

public static let sampleMainnet: Self = .sampleMainnetSatoshi
public static let sampleMainnetOther: Self = .sampleMainnetBatman
public static let sampleMainnetThird: Self = .sampleMainnetRipley
public static let sampleMainnetForth: Self = .sampleMainnetTuring

public static let sampleStokenetSkywalker: Self = newPersonaSampleStokenetLeiaSkywalker()
public static let sampleStokenetGranger: Self = newPersonaSampleStokenetHermione()
public static let sampleStokenetConnor: Self = newPersonaSampleStokenetConnor()

public static let sampleStokenet: Self = .sampleStokenetSkywalker
public static let sampleStokenetOther: Self = .sampleStokenetGranger
public static let sampleStokenetThird: Self = .sampleStokenetConnor
}
#endif // DEBUG
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import SargonUniFFI

#if DEBUG
extension UnsecuredEntityControl {
public static let sample: Self = newUnsecuredEntityControlSample()
public static let sampleOther: Self = newUnsecuredEntityControlSampleOther()
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// File.swift
//
//
// Created by Alexander Cyon on 2024-04-28.
//

import Foundation
import SargonUniFFI

extension AccountForDisplay: SargonModel {}

extension AccountForDisplay: Identifiable {
public typealias ID = AccountAddress
public var id: ID {
address
}
}
Loading

0 comments on commit 5decc31

Please sign in to comment.