-
Notifications
You must be signed in to change notification settings - Fork 78
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
ad20c56
commit 3524107
Showing
2 changed files
with
26 additions
and
5 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,4 +1,25 @@ | ||
pub trait SubmitIntent<IntentId, Intent>{ | ||
type Error; | ||
fn submit_intent(intent: Intent) -> Result<IntentId, Self::Error>; | ||
} | ||
use codec::{Decode, Encode}; | ||
use frame_support::pallet_prelude::{ConstU32, TypeInfo}; | ||
use frame_support::BoundedVec; | ||
|
||
#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq, TypeInfo, Default)] | ||
pub struct AssetAmount<AssetId> { | ||
pub asset_id: AssetId, | ||
pub amount: u128, | ||
} | ||
|
||
pub const MAX_DATA_SIZE: u32 = 4 * 1024 * 1024; | ||
pub type CallData = BoundedVec<u8, ConstU32<MAX_DATA_SIZE>>; | ||
|
||
pub trait SubmitIntent<AccountId, AssetId> { | ||
type Error; | ||
fn submit_intent( | ||
who: &AccountId, | ||
asset_in: AssetAmount<AssetId>, | ||
asset_out: AssetAmount<AssetId>, | ||
deadline: u64, | ||
partial: bool, | ||
on_success: Option<CallData>, | ||
on_failure: Option<CallData>, | ||
) -> Result<u128, Self::Error>; | ||
} |
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