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
|
|
|
|
case selectAccount(SelectAccountAction)
|
|
|
|
case approveMessage(SignMessageAction)
|
|
|
|
case approveTransaction(SendTransactionAction)
|
|
|
|
}
|
|
|
|
|
|
|
|
struct SelectAccountAction {
|
|
|
|
let provider: Web3Provider
|
2022-05-07 23:06:17 +03:00
|
|
|
let completion: (EthereumChain?, TokenaryWallet?, Account?) -> Void
|
2022-02-14 21:54:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
struct SignMessageAction {
|
|
|
|
let provider: Web3Provider
|
|
|
|
let subject: ApprovalSubject
|
|
|
|
let address: String
|
|
|
|
let meta: String
|
|
|
|
let peerMeta: PeerMeta
|
|
|
|
let completion: (Bool) -> Void
|
|
|
|
}
|
|
|
|
|
|
|
|
struct SendTransactionAction {
|
|
|
|
let provider: Web3Provider
|
|
|
|
let transaction: Transaction
|
|
|
|
let chain: EthereumChain
|
|
|
|
let address: String
|
|
|
|
let peerMeta: PeerMeta
|
|
|
|
let completion: (Transaction?) -> Void
|
|
|
|
}
|