-
Notifications
You must be signed in to change notification settings - Fork 7
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
13 changed files
with
193 additions
and
297 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
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 +1,2 @@ | ||
pub mod proposal; | ||
pub mod wallet; |
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,32 @@ | ||
use wasm_bindgen::prelude::*; | ||
|
||
use super::wallet::NoteRef; | ||
use zcash_primitives::transaction::fees::zip317::FeeRule; | ||
|
||
/// A handler to an immutable proposal. This can be passed to `create_proposed_transactions` to prove/authorize the transactions | ||
/// before they are sent to the network. | ||
/// | ||
/// The proposal can be reviewed by calling `describe` which will return a JSON object with the details of the proposal. | ||
#[wasm_bindgen] | ||
pub struct Proposal { | ||
inner: zcash_client_backend::proposal::Proposal<FeeRule, NoteRef>, | ||
} | ||
|
||
impl From<zcash_client_backend::proposal::Proposal<FeeRule, NoteRef>> for Proposal { | ||
fn from(inner: zcash_client_backend::proposal::Proposal<FeeRule, NoteRef>) -> Self { | ||
Self { inner } | ||
} | ||
} | ||
|
||
impl From<Proposal> for zcash_client_backend::proposal::Proposal<FeeRule, NoteRef> { | ||
fn from(proposal: Proposal) -> Self { | ||
proposal.inner | ||
} | ||
} | ||
|
||
#[wasm_bindgen] | ||
impl Proposal { | ||
pub fn describe(&self) -> JsValue { | ||
serde_wasm_bindgen::to_value(&self.inner).unwrap() | ||
} | ||
} |
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
Oops, something went wrong.