(wasm) Treat arbitrary byte data as Uint8Array, instead of base64url marshalling.
This commit is contained in:
@@ -215,7 +215,6 @@ impl VeilidAPIError {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(target_arch = "wasm32", declare)]
|
||||
pub type VeilidAPIResult<T> = Result<T, VeilidAPIError>;
|
||||
|
||||
impl From<std::io::Error> for VeilidAPIError {
|
||||
|
@@ -9,9 +9,13 @@ pub struct VeilidAppMessage {
|
||||
#[cfg_attr(target_arch = "wasm32", tsify(optional, type = "string"))]
|
||||
sender: Option<TypedKey>,
|
||||
|
||||
#[serde(with = "as_human_base64")]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), serde(with = "as_human_base64"))]
|
||||
#[schemars(with = "String")]
|
||||
#[cfg_attr(target_arch = "wasm32", tsify(type = "string"))]
|
||||
#[cfg_attr(
|
||||
target_arch = "wasm32",
|
||||
serde(with = "serde_bytes"),
|
||||
tsify(type = "Uint8Array")
|
||||
)]
|
||||
message: Vec<u8>,
|
||||
}
|
||||
|
||||
@@ -40,8 +44,13 @@ pub struct VeilidAppCall {
|
||||
#[cfg_attr(target_arch = "wasm32", tsify(optional))]
|
||||
sender: Option<TypedKey>,
|
||||
|
||||
#[serde(with = "as_human_base64")]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), serde(with = "as_human_base64"))]
|
||||
#[schemars(with = "String")]
|
||||
#[cfg_attr(
|
||||
target_arch = "wasm32",
|
||||
serde(with = "serde_bytes"),
|
||||
tsify(type = "Uint8Array")
|
||||
)]
|
||||
message: Vec<u8>,
|
||||
|
||||
#[serde(with = "as_human_string")]
|
||||
|
@@ -8,9 +8,13 @@ pub struct ValueData {
|
||||
seq: ValueSeqNum,
|
||||
|
||||
/// The contents of a DHT Record
|
||||
#[serde(with = "as_human_base64")]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), serde(with = "as_human_base64"))]
|
||||
#[schemars(with = "String")]
|
||||
#[cfg_attr(target_arch = "wasm32", tsify(type = "string"))]
|
||||
#[cfg_attr(
|
||||
target_arch = "wasm32",
|
||||
serde(with = "serde_bytes"),
|
||||
tsify(type = "Uint8Array")
|
||||
)]
|
||||
data: Vec<u8>,
|
||||
|
||||
/// The public identity key of the writer of the data
|
||||
|
Reference in New Issue
Block a user