Git Product home page Git Product logo

Comments (8)

spirrello avatar spirrello commented on July 18, 2024

I checked in Discord about this and they recommended to use rpc directly to get the balance. I tried this in a local branch and it worked.

New match case in poll_for_user_input function.

"walletbalance" => {
    let runtime =
        tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
    runtime.block_on(wallet_balance(bitcoin_client.clone()));
    continue;
}

Function for returning the wallet balance.

async fn wallet_balance(bitcoin: Arc<BitcoindClient>) {
	let params: &[serde_json::Value] =
		&[serde_json::Value::String("*".to_string()), serde_json::Value::Number(6.into())];
	let available_balance: serde_json::Value =
		bitcoin.bitcoind_rpc_client.call_method("getbalance", params).await.unwrap();
	println!("balance: {}", available_balance);
}

from ldk-sample.

ikeogu avatar ikeogu commented on July 18, 2024

Good day @spirrello can I contribute to this?

from ldk-sample.

spirrello avatar spirrello commented on July 18, 2024

Good day @spirrello can I contribute to this?

@ikeogu yes absolutely

from ldk-sample.

ikeogu avatar ikeogu commented on July 18, 2024

Alright, please can you assist me with more details?

from ldk-sample.

ikeogu avatar ikeogu commented on July 18, 2024

please can I get more clarity , and also how to raise the PR.

from ldk-sample.

TheBlueMatt avatar TheBlueMatt commented on July 18, 2024

Given this is just a sample focused on how to interact with LDK, I'm not sure we want a method to fetch the Bitcoin Core balance. That's generally outside the scope of LDK and more "stuff" in the sample detracts from the goal of an easy-to-read small-ish codebase.

from ldk-sample.

ikeogu avatar ikeogu commented on July 18, 2024

alright @TheBlueMatt , let me find another issue to resolve.

from ldk-sample.

tnull avatar tnull commented on July 18, 2024

Thanks, @ikeogu!

Closing this as not planned.

from ldk-sample.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.