-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1bb738
commit a9fcbf3
Showing
3 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// lib.rs | ||
|
||
pub mod chain; | ||
pub mod chain; | ||
pub mod name; | ||
pub mod price; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
use typeshare::typeshare; | ||
use crate::chain::Chain; | ||
use serde::Serialize; | ||
|
||
#[typeshare(swift="Codable")] | ||
#[allow(dead_code)] | ||
struct NameRecord { | ||
name: String, | ||
chain: Chain, | ||
address: String | ||
address: String, | ||
provider: NameProvider, | ||
} | ||
|
||
#[derive(Debug, Serialize)] | ||
#[serde(rename_all = "lowercase")] | ||
pub enum NameProvider { | ||
Ud, | ||
Ens, | ||
} | ||
|
||
impl NameProvider { | ||
pub fn as_str(&self) -> &'static str { | ||
match self { | ||
Self::Ud => "ud", | ||
Self::Ens => "ens", | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters