Skip to content

Commit

Permalink
feat(session): execute & execute from outisde (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo authored Aug 30, 2024
1 parent 6a0a629 commit bea1576
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/account-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,17 @@ impl CartridgeSessionAccount {
}

pub async fn execute(&self, calls: Vec<JsCall>) -> Result<JsValue> {
let calls = calls
.into_iter()
.map(TryInto::try_into)
.collect::<std::result::Result<Vec<_>, _>>()?;

let res = self.0.execute_v1(calls).send().await?;

Ok(to_value(&res)?)
}

pub async fn execute_from_outside(&self, calls: Vec<JsCall>) -> Result<JsValue> {
let caller = OutsideExecutionCaller::Any;
let calls = calls
.into_iter()
Expand Down

0 comments on commit bea1576

Please sign in to comment.