Coder Social home page Coder Social logo

Comments (4)

daywalker90 avatar daywalker90 commented on August 14, 2024

Strange, i can see both floor and blockcount in the v23.11.2 node.proto

from lightning.

michaelWuensch avatar michaelWuensch commented on August 14, 2024

@daywalker90
Sorry for the unclear description. The problem is that it is missing in the primitives. I want to set the feerate for the withdraw endpoint, but cannot create a feerate object with the desired values to pass as input for the withdraw command:

message Feerate {
oneof style {
bool slow = 1;
bool normal = 2;
bool urgent = 3;
uint32 perkb = 4;
uint32 perkw = 5;
}
}

from lightning.

daywalker90 avatar daywalker90 commented on August 14, 2024

Hm you mean like this?

def test_grpc_feerates(bitcoind, node_factory):
    LOGGER = logging.getLogger(__name__)
    """ Check that conversions of this rather complex type work.
    """
    grpc_port = reserve()
    l1, l2 = node_factory.line_graph(
        2,
        opts=[{"grpc-port": str(grpc_port)}, {}],
        announce_channels=True,  # Do not enforce scid-alias
    )
    l1.fundwallet(10_000_000)

    stub = l1.grpc
    feerates = stub.Feerates(clnpb.FeeratesRequest(style="PERKB"))
    LOGGER.info(f"{feerates}")
    newaddr = stub.NewAddr(clnpb.NewaddrRequest())
    LOGGER.info(f"{newaddr}")
    withdraw = stub.Withdraw(
        clnpb.WithdrawRequest(
            destination=newaddr.bech32,
            satoshi=clnpb.AmountOrAll(amount=clnpb.Amount(msat=500_000_000)),
            feerate=clnpb.Feerate(perkb=feerates.perkb.floor),
        )
    )
    LOGGER.info(f"{withdraw}")
    withdraw = stub.Withdraw(
        clnpb.WithdrawRequest(
            destination=newaddr.bech32,
            satoshi=clnpb.AmountOrAll(amount=clnpb.Amount(msat=500_000_000)),
            feerate=clnpb.Feerate(perkb=feerates.perkb.estimates[0].blockcount),
        )
    )
    LOGGER.info(f"{withdraw}")

Because that works for me.

from lightning.

michaelWuensch avatar michaelWuensch commented on August 14, 2024

Ah, thank you so much. This was my mistake.
With your help I was finally able to implement it in Java.
image

from lightning.

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.