Skip to content

Commit

Permalink
Merge pull request #1141 from MutinyWallet/rm-unused-wasm-funcs
Browse files Browse the repository at this point in the history
Remove unused wasm functions
  • Loading branch information
TonyGiorgio authored Apr 15, 2024
2 parents 142d0b5 + 2209647 commit 014bac1
Showing 1 changed file with 1 addition and 28 deletions.
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

0 comments on commit 014bac1

Please sign in to comment.