Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused wasm functions #1141

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions mutiny-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ use crate::indexed_db::IndexedDbStorage;
use crate::models::*;
use bip39::Mnemonic;
use bitcoin::bip32::ExtendedPrivKey;
use bitcoin::consensus::deserialize;
use bitcoin::hashes::hex::FromHex;
use bitcoin::hashes::sha256;
use bitcoin::secp256k1::PublicKey;
use bitcoin::{Address, Network, OutPoint, Transaction, Txid};
use bitcoin::{Address, Network, OutPoint, Txid};
use fedimint_core::{api::InviteCode, config::FederationId};
use futures::lock::Mutex;
use gloo_utils::format::JsValueSerdeExt;
Expand Down Expand Up @@ -423,17 +422,6 @@ impl MutinyWallet {
Ok(self.inner.node_manager.stop().await?)
}

/// Broadcast a transaction to the network.
/// The transaction is broadcast through the configured esplora server.
#[wasm_bindgen]
pub async fn broadcast_transaction(&self, str: String) -> Result<(), MutinyJsError> {
let tx_bytes =
Vec::from_hex(str.as_str()).map_err(|_| MutinyJsError::WalletOperationFailed)?;
let tx: Transaction =
deserialize(&tx_bytes).map_err(|_| MutinyJsError::WalletOperationFailed)?;
Ok(self.inner.node_manager.broadcast_transaction(tx).await?)
}

/// Returns the mnemonic seed phrase for the wallet.
#[wasm_bindgen]
pub fn show_seed(&self) -> String {
Expand Down Expand Up @@ -509,12 +497,6 @@ impl MutinyWallet {
})
}

/// Gets the current balance of the on-chain wallet.
#[wasm_bindgen]
pub fn get_wallet_balance(&self) -> Result<u64, MutinyJsError> {
Ok(self.inner.node_manager.get_wallet_balance()?)
}

/// Creates a BIP 21 invoice. This creates a new address and a lightning invoice.
/// The lightning invoice may return errors related to the LSP. Check the error and
/// fallback to `get_new_address` and warn the user that Lightning is not available.
Expand Down Expand Up @@ -711,15 +693,6 @@ impl MutinyWallet {
)?)
}

/// Lists all the on-chain transactions in the wallet.
/// These are sorted by confirmation time.
#[wasm_bindgen]
pub fn list_onchain(&self) -> Result<JsValue /* Vec<TransactionDetails> */, MutinyJsError> {
Ok(JsValue::from_serde(
&self.inner.node_manager.list_onchain()?,
)?)
}

/// Gets the details of a specific on-chain transaction.
#[wasm_bindgen]
pub fn get_transaction(
Expand Down
Loading