-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwallet_address.rs
More file actions
51 lines (44 loc) · 1.26 KB
/
wallet_address.rs
File metadata and controls
51 lines (44 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WalletAddress {
pub id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub public_name: Option<String>,
pub asset_code: String,
pub asset_scale: u8,
pub auth_server: String,
pub resource_server: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct JsonWebKeySet {
pub keys: Vec<JsonWebKey>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct JsonWebKey {
pub kid: String,
pub alg: JwkAlgorithm,
#[serde(skip_serializing_if = "Option::is_none")]
pub use_: Option<JwkUse>,
pub kty: JwkKeyType,
pub crv: JwkCurve,
pub x: String,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
pub enum JwkAlgorithm {
EdDSA,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "lowercase")]
pub enum JwkUse {
#[serde(rename = "sig")]
Signature,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
pub enum JwkKeyType {
OKP,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
pub enum JwkCurve {
Ed25519,
}