-
Notifications
You must be signed in to change notification settings - Fork 5
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 #95 from xch-dev/cleanup-offers
Cleanup offers
- Loading branch information
Showing
9 changed files
with
421 additions
and
467 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,26 +1,42 @@ | ||
use indexmap::IndexMap; | ||
use serde::{Deserialize, Serialize}; | ||
use specta::Type; | ||
|
||
use crate::{Amount, AssetKind}; | ||
use crate::Amount; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Type)] | ||
pub struct OfferSummary { | ||
pub fee: Amount, | ||
pub offered: Vec<OfferedCoin>, | ||
pub requested: Vec<RequestedAsset>, | ||
pub maker: OfferAssets, | ||
pub taker: OfferAssets, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Type)] | ||
pub struct OfferedCoin { | ||
pub coin_id: String, | ||
pub offered_amount: Amount, | ||
#[serde(flatten)] | ||
pub kind: AssetKind, | ||
pub struct OfferAssets { | ||
pub xch: OfferXch, | ||
pub cats: IndexMap<String, OfferCat>, | ||
pub nfts: IndexMap<String, OfferNft>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Type)] | ||
pub struct RequestedAsset { | ||
pub struct OfferXch { | ||
pub amount: Amount, | ||
#[serde(flatten)] | ||
pub kind: AssetKind, | ||
pub royalty: Amount, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Type)] | ||
pub struct OfferCat { | ||
pub amount: Amount, | ||
pub royalty: Amount, | ||
pub name: Option<String>, | ||
pub ticker: Option<String>, | ||
pub icon_url: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Type)] | ||
pub struct OfferNft { | ||
pub image_data: Option<String>, | ||
pub image_mime_type: Option<String>, | ||
pub name: Option<String>, | ||
pub royalty_percent: 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.