2022-02-14 21:54:38 +03:00
|
|
|
// Copyright © 2022 Tokenary. All rights reserved.
|
|
|
|
|
|
|
|
import Foundation
|
2022-05-07 23:06:17 +03:00
|
|
|
import WalletCore
|
2022-02-14 21:54:38 +03:00
|
|
|
|
|
|
|
enum DappRequestAction {
|
|
|
|
case none
|
|
|
|
case justShowApp
|
2022-07-13 17:11:10 +03:00
|
|
|
case switchAccount(SelectAccountAction)
|
2022-02-14 21:54:38 +03:00
|
|
|
case selectAccount(SelectAccountAction)
|
|
|
|
case approveMessage(SignMessageAction)
|
|
|
|
case approveTransaction(SendTransactionAction)
|
|
|
|
}
|
|
|
|
|
|
|
|
struct SelectAccountAction {
|
2022-08-23 18:00:48 +03:00
|
|
|
let peer: PeerMeta?
|
|
|
|
let coinType: CoinType?
|
|
|
|
var selectedAccounts: Set<SpecificWalletAccount>
|
2023-10-27 21:10:18 +03:00
|
|
|
let initiallyConnectedProviders: Set<InpageProvider>
|
2023-10-26 13:01:12 +03:00
|
|
|
var network: EthereumNetwork?
|
2022-08-31 16:05:23 +03:00
|
|
|
let source: Source
|
2023-10-26 13:01:12 +03:00
|
|
|
let completion: (EthereumNetwork?, [SpecificWalletAccount]?) -> Void
|
2022-08-31 16:05:23 +03:00
|
|
|
|
|
|
|
enum Source {
|
|
|
|
case walletConnect, safariExtension
|
|
|
|
}
|
2022-02-14 21:54:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
struct SignMessageAction {
|
2023-10-27 21:10:18 +03:00
|
|
|
let provider: InpageProvider
|
2022-02-14 21:54:38 +03:00
|
|
|
let subject: ApprovalSubject
|
2022-05-08 22:44:12 +03:00
|
|
|
let account: Account
|
2022-02-14 21:54:38 +03:00
|
|
|
let meta: String
|
|
|
|
let peerMeta: PeerMeta
|
|
|
|
let completion: (Bool) -> Void
|
|
|
|
}
|
|
|
|
|
|
|
|
struct SendTransactionAction {
|
2023-10-27 21:10:18 +03:00
|
|
|
let provider: InpageProvider
|
2022-02-14 21:54:38 +03:00
|
|
|
let transaction: Transaction
|
2023-10-26 13:01:12 +03:00
|
|
|
let chain: EthereumNetwork
|
2022-05-08 22:44:12 +03:00
|
|
|
let account: Account
|
2022-02-14 21:54:38 +03:00
|
|
|
let peerMeta: PeerMeta
|
|
|
|
let completion: (Transaction?) -> Void
|
|
|
|
}
|