-
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.
[ABW-3899] Create subintent API (#255)
* logic * version bump * tests * Update README.md * Update README.md * Add more extensions * updates after feedback --------- Co-authored-by: micbakos-rdx <[email protected]>
- Loading branch information
1 parent
4694350
commit e5e07b5
Showing
27 changed files
with
438 additions
and
13 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
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,3 +1,4 @@ | ||
mod pre_authorization; | ||
mod profile_state_holder; | ||
mod sargon_os; | ||
mod sargon_os_accounts; | ||
|
1 change: 1 addition & 0 deletions
1
crates/sargon-uniffi/src/system/sargon_os/pre_authorization/mod.rs
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 @@ | ||
mod sargon_os_create_subintent; |
26 changes: 26 additions & 0 deletions
26
crates/sargon-uniffi/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs
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 crate::prelude::*; | ||
|
||
// ================== | ||
// Create Subintent | ||
// ================== | ||
#[uniffi::export] | ||
impl SargonOS { | ||
/// Creates a Subintent given its discriminator, manifest and expiration. | ||
pub async fn create_subintent( | ||
&self, | ||
intent_discriminator: IntentDiscriminator, | ||
subintent_manifest: SubintentManifest, | ||
expiration: DappToWalletInteractionSubintentExpiration, | ||
message: Option<String>, | ||
) -> Result<Subintent> { | ||
self.wrapped | ||
.create_subintent( | ||
intent_discriminator.into_internal(), | ||
subintent_manifest.into_internal(), | ||
expiration.into_internal(), | ||
message, | ||
) | ||
.await | ||
.into_result() | ||
} | ||
} |
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
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,9 @@ | ||
// 5 minutes | ||
pub const EPOCH_DURATION_IN_SECONDS: u64 = 300; | ||
|
||
// As per the transaction validation configuration, epoch diff should be less than 1 month. | ||
pub const MAX_EPOCH_DIFF: u64 = 30 * 24 * 60 * 60 / EPOCH_DURATION_IN_SECONDS; | ||
|
||
// 1 epoch for the fact that it's min_inclusive and max_exclusive; | ||
// 1 more for the fact that we might be very close to the end of the epoch already | ||
pub const MIN_EPOCH_DIFF: u64 = 2; |
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,3 @@ | ||
mod sargon_os_create_subintent; | ||
|
||
pub use sargon_os_create_subintent::*; |
Oops, something went wrong.