-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
60 additions
and
27 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 |
---|---|---|
|
@@ -5,9 +5,18 @@ | |
"description": "The short mint description", | ||
"description_long": "A long mint description that can be a long piece of text.", | ||
"contact": [ | ||
["email", "[email protected]"], | ||
["twitter", "@me"], | ||
["nostr", "npub..."] | ||
{ | ||
"method": "email", | ||
"info": "[email protected]" | ||
}, | ||
{ | ||
"method": "twitter", | ||
"info": "@me" | ||
}, | ||
{ | ||
"method": "nostr", | ||
"info": "npub..." | ||
} | ||
], | ||
"motd": "Message to users", | ||
"nuts": { | ||
|
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 |
---|---|---|
|
@@ -220,11 +220,40 @@ pub struct MintInfoResponse { | |
pub version: Option<String>, | ||
pub description: Option<String>, | ||
pub description_long: Option<String>, | ||
pub contact: Option<Vec<Vec<String>>>, | ||
pub contact: Option<Vec<ContactInfoResponse>>, | ||
pub motd: Option<String>, | ||
pub nuts: Nuts, | ||
} | ||
|
||
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq, ToSchema)] | ||
pub struct ContactInfoResponse { | ||
pub method: String, | ||
pub info: String, | ||
} | ||
|
||
impl ContactInfoResponse { | ||
pub fn email(info: String) -> Self { | ||
Self { | ||
method: "email".to_string(), | ||
info, | ||
} | ||
} | ||
|
||
pub fn twitter(info: String) -> Self { | ||
Self { | ||
method: "twitter".to_string(), | ||
info, | ||
} | ||
} | ||
|
||
pub fn nostr(info: String) -> Self { | ||
Self { | ||
method: "twitter".to_string(), | ||
info, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
pub struct BtcOnchainMintQuote { | ||
pub quote_id: Uuid, | ||
|
@@ -536,7 +565,7 @@ mod tests { | |
use crate::{ | ||
dhke::public_key_from_hex, | ||
fixture::read_fixture, | ||
primitives::{KeyResponse, MintInfoResponse, Nuts, PostSwapResponse}, | ||
primitives::{ContactInfoResponse, KeyResponse, MintInfoResponse, Nuts, PostSwapResponse}, | ||
}; | ||
|
||
#[test] | ||
|
@@ -570,9 +599,9 @@ mod tests { | |
description: Some("The short mint description".to_string()), | ||
description_long: Some("A description that can be a long piece of text.".to_string()), | ||
contact: Some(vec![ | ||
vec!["email".to_string(), "[email protected]".to_string()], | ||
vec!["twitter".to_string(), "@me".to_string()], | ||
vec!["nostr".to_string(), "npub...".to_string()], | ||
ContactInfoResponse::email("[email protected]".to_string()), | ||
ContactInfoResponse::twitter("@me".to_string()), | ||
ContactInfoResponse::nostr("npub...".to_string()), | ||
]), | ||
nuts: Nuts::default(), | ||
motd: Some("Message to display to users.".to_string()), | ||
|
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
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