Skip to main content

playtron_core/dbus/
wallet_interface.rs

1use zbus::proxy;
2
3#[proxy(
4    interface = "one.playtron.Wallet",
5    default_path = "/one/playtron/Wallet",
6    default_service = "one.playtron.Playserve"
7)]
8pub trait WalletInterface {
9    #[zbus(signal)]
10    async fn on_transaction_success(
11        &self,
12        tx_id: String,
13        result: String,
14        completed_at: u64,
15    ) -> zbus::Result<()>;
16
17    #[zbus(signal)]
18    async fn on_transaction_cancelled(&self, tx_id: String, error: String) -> zbus::Result<()>;
19
20    #[zbus(signal)]
21    async fn on_transaction_sign_success(
22        &self,
23        tx_id: String,
24        signature: String,
25    ) -> zbus::Result<()>;
26
27    #[zbus(signal)]
28    async fn on_transaction_sign_cancelled(&self, tx_id: String, error: String)
29        -> zbus::Result<()>;
30
31    #[zbus(signal)]
32    async fn on_message_sign_success(&self, msg_id: String, signature: String) -> zbus::Result<()>;
33
34    #[zbus(signal)]
35    async fn on_message_sign_cancelled(&self, msg_id: String, error: String) -> zbus::Result<()>;
36
37    #[zbus(property)]
38    fn address(&self) -> zbus::Result<String>;
39
40    fn sign_message(
41        &self,
42        provider_app_id: String,
43        msg_id: String,
44        msg: String,
45    ) -> zbus::fdo::Result<()>;
46
47    fn sign_transaction(
48        &self,
49        provider_app_id: String,
50        tx_id: String,
51        tx_bytes: String,
52    ) -> zbus::fdo::Result<()>;
53
54    fn sign_and_execute_transaction(
55        &self,
56        provider_app_id: String,
57        tx_id: String,
58        tx_bytes: String,
59    ) -> zbus::fdo::Result<()>;
60}