-
Notifications
You must be signed in to change notification settings - Fork 1
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 #2 from FigureTechnologies/feature/contribute-loan…
…-pools Feature/contribute loan pools
- Loading branch information
Showing
30 changed files
with
2,971 additions
and
9 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
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,62 @@ | ||
use cosmwasm_std::{Addr, CosmosMsg, Uint128}; | ||
use provwasm_std::{AccessGrant, ProvenanceMsg}; | ||
use schemars::JsonSchema; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] | ||
#[serde(rename_all = "snake_case")] | ||
pub struct LoanPoolMarkerCollateral { | ||
pub marker_address: Addr, | ||
pub marker_denom: String, | ||
pub share_count: Uint128, | ||
pub original_contributor: Addr, | ||
// this is the address with ADMIN privileges that added the marker to the securitization. | ||
pub removed_permissions: Vec<AccessGrant>, | ||
} | ||
|
||
impl LoanPoolMarkerCollateral { | ||
pub(crate) fn new<S: Into<String>>( | ||
marker_address: Addr, | ||
marker_denom: S, | ||
share_count: u128, | ||
original_owner: Addr, | ||
removed_permissions: Vec<AccessGrant>, | ||
) -> Self { | ||
Self { | ||
marker_address, | ||
marker_denom: marker_denom.into(), | ||
share_count: Uint128::new(share_count), | ||
original_contributor: original_owner, | ||
removed_permissions, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] | ||
pub struct LoanPoolMarkers { | ||
pub collaterals: Vec<LoanPoolMarkerCollateral>, | ||
} | ||
|
||
impl LoanPoolMarkers { | ||
pub(crate) fn new(collaterals: Vec<LoanPoolMarkerCollateral>) -> Self { | ||
Self { collaterals } | ||
} | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] | ||
/// Holds information about a loan pool addition. | ||
pub struct LoanPoolAdditionData { | ||
/// The collateral being added to the loan. | ||
pub collateral: LoanPoolMarkerCollateral, | ||
/// The Provenance messages associated with the loan. | ||
pub messages: Vec<CosmosMsg<ProvenanceMsg>>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] | ||
/// Holds information about a loan pool removal. | ||
pub struct LoanPoolRemovalData { | ||
/// The collateral to be deleted from state | ||
pub collateral: LoanPoolMarkerCollateral, | ||
/// The Provenance messages associated with the loan. | ||
pub messages: Vec<CosmosMsg<ProvenanceMsg>>, | ||
} |
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
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,4 +1,5 @@ | ||
pub mod aliases; | ||
pub mod collateral; | ||
pub mod constants; | ||
pub mod error; | ||
pub mod fee; | ||
|
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.