Skip to main content

magiclink_server_wallets_api/
dto.rs

1use crate::domain::Network;
2use serde::{
3  Deserialize,
4  Serialize,
5};
6use std::collections::HashMap;
7
8#[derive(Debug, Serialize)]
9pub struct WalletGroupMetadataParam {
10  pub metadata: HashMap<String, String>,
11}
12
13#[derive(Debug, Serialize)]
14pub struct WalletParam {
15  pub encryption_context: String,
16  pub network: Network,
17  pub wallet_group_id: String,
18  pub metadata: HashMap<String, String>,
19}
20
21#[derive(Debug, Serialize)]
22pub struct RecoveryParam {
23  pub wallet_id: String,
24  pub encryption_context: String,
25  pub recovery_key: String,
26}
27
28#[derive(Debug, Serialize)]
29pub struct TransSigningParam<T> {
30  pub encryption_context: String,
31  pub access_key: String,
32  pub wallet_id: String,
33  pub payload: T,
34}
35
36#[derive(Debug, Serialize)]
37pub struct EVMPayload {
38  pub _type: u16,
39  pub chainId: u64,
40  pub nonce: u16,
41  pub value: String,
42  pub gas: u64,
43  pub maxFeePerGas: u64,
44  pub maxPriorityFeePerGas: u64,
45  pub to: String,
46}
47
48pub type SolanaPayload = String;
49
50#[derive(Debug, Serialize)]
51pub struct BitcoinPayload {
52  pub inputs: Vec<AddressInfo>,
53  pub outputs: Vec<AddressInfo>,
54}
55
56#[derive(Debug, Serialize)]
57pub struct AddressInfo {
58  pub address: String,
59  pub value: u16,
60  pub txid: Option<String>,
61  pub tx_num: Option<u16>,
62}
63
64#[derive(Debug, Serialize)]
65pub struct MessageSigningParam {
66  pub raw_data_hash: String,
67  pub encryption_context: String,
68  pub access_key: String,
69  pub wallet_id: String,
70}
71
72#[derive(Debug, Serialize)]
73pub struct SolanaSignMessageParam {
74  pub message_base64: String,
75  pub encryption_context: String,
76  pub access_key: String,
77  pub wallet_id: String,
78}