-
Notifications
You must be signed in to change notification settings - Fork 83
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
Showing
18 changed files
with
269 additions
and
44 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod http_client; | ||
pub mod profile; | ||
pub mod unpack_message; |
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,28 @@ | ||
use std::sync::Arc; | ||
|
||
use super::profile::ProfileHolder; | ||
use crate::{errors::error::VcxUniFFIResult, runtime::block_on}; | ||
use aries_vcx::errors::error::AriesVcxError; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)] | ||
pub struct UnpackMessage { | ||
pub message: String, | ||
pub recipient_verkey: String, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub sender_verkey: Option<String>, | ||
} | ||
|
||
pub fn unpack_message( | ||
profile_holder: Arc<ProfileHolder>, | ||
packed_msg: String, | ||
) -> VcxUniFFIResult<UnpackMessage> { | ||
block_on(async { | ||
let packed_bytes = packed_msg.as_bytes(); | ||
let wallet = profile_holder.inner.inject_wallet(); | ||
let unpacked_bytes = wallet.unpack_message(&packed_bytes).await?; | ||
let unpacked_string = String::from_utf8(unpacked_bytes)?; | ||
let unpacked_message = serde_json::from_str::<UnpackMessage>(&unpacked_string)?; | ||
Ok(unpacked_message) | ||
}) | ||
} |
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
5 changes: 5 additions & 0 deletions
5
uniffi_aries_vcx/demo/app/src/main/java/org/hyperledger/ariesvcx/Constants.kt
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,5 @@ | ||
package org.hyperledger.ariesvcx | ||
|
||
// Set your public IP address here, this endpoint will be used while communicating with the peer(agent). | ||
const val BASE_RELAY_ENDPOINT = "https://b199-27-57-116-96.ngrok-free.app"; | ||
const val RELAY_USER_ID = "demo-user-1"; |
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.