-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Batch 14: AurhorizedDappDetailed, AccountsOrPersonas +more (#110)
`AuthorizedDappDetails` and `AccountOrPersona` and more
- Loading branch information
1 parent
e38020d
commit 5decc31
Showing
136 changed files
with
4,462 additions
and
1,918 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
.../Sargon/Extensions/Methods/Profile+Supporting+Types/AccountOrPersona+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...rces/Sargon/Extensions/Methods/Profile/Collection/AccountsForDisplay+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...rces/Sargon/Extensions/Methods/Profile/Collection/AccountsOrPersonas+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...gon/Extensions/Methods/Profile/Collection/DetailedAuthorizedPersonas+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
apple/Sources/Sargon/Extensions/Methods/Profile/ProfileNetwork+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...gon/Extensions/SampleValues/Profile+Supporting+Types/AccountForDisplay+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
14 changes: 14 additions & 0 deletions
14
...rgon/Extensions/SampleValues/Profile+Supporting+Types/AccountOrPersona+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
9 changes: 9 additions & 0 deletions
9
...xtensions/SampleValues/Profile+Supporting+Types/AuthorizedDappDetailed+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
9 changes: 9 additions & 0 deletions
9
...nsions/SampleValues/Profile+Supporting+Types/AuthorizedPersonaDetailed+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...s/Sargon/Extensions/SampleValues/Profile/Collection/AccountsForDisplay+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
16 changes: 16 additions & 0 deletions
16
...s/Sargon/Extensions/SampleValues/Profile/Collection/AccountsOrPersonas+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
16 changes: 16 additions & 0 deletions
16
.../Extensions/SampleValues/Profile/Collection/DetailedAuthorizedPersonas+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
8 changes: 8 additions & 0 deletions
8
apple/Sources/Sargon/Extensions/SampleValues/Profile/EntitySecurityState+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
.../Sources/Sargon/Extensions/SampleValues/Profile/UnsecuredEntityControl+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
18 changes: 18 additions & 0 deletions
18
.../Sargon/Extensions/Swiftified/Profile+Supporting+Types/AccountForDisplay+Swiftified.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Oops, something went wrong.