tokenary/Shared/Models/DappRequestAction.swift

46 lines
1.1 KiB
Swift
Raw Normal View History

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