-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
js(nostr): add
EventBuilder::job_feedback
- Loading branch information
1 parent
4b3d421
commit 47028b8
Showing
3 changed files
with
61 additions
and
0 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
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 |
---|---|---|
|
@@ -14,3 +14,4 @@ pub mod nip46; | |
pub mod nip47; | ||
pub mod nip57; | ||
pub mod nip65; | ||
pub mod nip90; |
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,38 @@ | ||
// Copyright (c) 2023-2024 Rust Nostr Developers | ||
// Distributed under the MIT software license | ||
|
||
use nostr::nips::nip90::DataVendingMachineStatus; | ||
use wasm_bindgen::prelude::*; | ||
|
||
#[wasm_bindgen(js_name = DataVendingMachineStatus)] | ||
pub enum JsDataVendingMachineStatus { | ||
PaymentRequired, | ||
Processing, | ||
Error, | ||
Success, | ||
Partial, | ||
} | ||
|
||
impl From<DataVendingMachineStatus> for JsDataVendingMachineStatus { | ||
fn from(value: DataVendingMachineStatus) -> Self { | ||
match value { | ||
DataVendingMachineStatus::PaymentRequired => Self::PaymentRequired, | ||
DataVendingMachineStatus::Processing => Self::Processing, | ||
DataVendingMachineStatus::Error => Self::Error, | ||
DataVendingMachineStatus::Success => Self::Success, | ||
DataVendingMachineStatus::Partial => Self::Partial, | ||
} | ||
} | ||
} | ||
|
||
impl From<JsDataVendingMachineStatus> for DataVendingMachineStatus { | ||
fn from(value: JsDataVendingMachineStatus) -> Self { | ||
match value { | ||
JsDataVendingMachineStatus::PaymentRequired => Self::PaymentRequired, | ||
JsDataVendingMachineStatus::Processing => Self::Processing, | ||
JsDataVendingMachineStatus::Error => Self::Error, | ||
JsDataVendingMachineStatus::Success => Self::Success, | ||
JsDataVendingMachineStatus::Partial => Self::Partial, | ||
} | ||
} | ||
} |