-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from xch-dev/view-offer
Add ability to view and take offer
- Loading branch information
Showing
16 changed files
with
642 additions
and
86 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use specta::Type; | ||
|
||
use crate::{Amount, AssetKind}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Type)] | ||
pub struct OfferSummary { | ||
pub fee: Amount, | ||
pub offered: Vec<OfferedCoin>, | ||
pub requested: Vec<RequestedAsset>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Type)] | ||
pub struct OfferedCoin { | ||
pub coin_id: String, | ||
pub offered_amount: Amount, | ||
#[serde(flatten)] | ||
pub kind: AssetKind, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Type)] | ||
pub struct RequestedAsset { | ||
pub amount: Amount, | ||
#[serde(flatten)] | ||
pub kind: AssetKind, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
mod amount; | ||
mod asset_kind; | ||
mod nft_uri_kind; | ||
mod unit; | ||
|
||
pub use amount::*; | ||
pub use asset_kind::*; | ||
pub use nft_uri_kind::*; | ||
pub use unit::*; |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use specta::Type; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Type)] | ||
#[serde(tag = "type", rename_all = "snake_case")] | ||
pub enum AssetKind { | ||
Unknown, | ||
Xch, | ||
Launcher, | ||
Cat { | ||
asset_id: String, | ||
name: Option<String>, | ||
ticker: Option<String>, | ||
icon_url: Option<String>, | ||
}, | ||
Did { | ||
launcher_id: String, | ||
name: Option<String>, | ||
}, | ||
Nft { | ||
launcher_id: String, | ||
image_data: Option<String>, | ||
image_mime_type: Option<String>, | ||
name: Option<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
Oops, something went wrong.