Giter Site home page Giter Site logo

lnurl-grpc-proxy's Introduction

lnurl-grpc-proxy

A rest -> grpc proxy for lnurl withdraw requests

This is meant to be used by clients behind firewalls (Bitcoin Bounty Hunt node e.g.)

usage

lnurl-grpc-proxy --grpc_port 10512 --base_url "http://localhost:10513" --http_host "localhost:10513"

lnurl-grpc-proxy's People

Contributors

sputn1ck avatar

Watchers

James Cloos avatar Jonas Nick avatar  avatar

lnurl-grpc-proxy's Issues

Ask LN SERVICE for params

// WithdrawRequest handles the request comming from the
// LN WALLET to the LN SERVICE. It returns the Withdraw
// response as specified in the lnurl rfc.
func (s *Service) WithdrawRequest(id string) (*lnurl.LNURLWithdrawResponse, *lnurl.LNURLErrorResponse) {
// TODO: maybe we should ask the LN SERVICE for the params (max, min withdrawable) in this step.
s.RLock()
if withdrawProcess, ok := s.withdrawProcesses[id]; ok {
s.RUnlock()
res := &lnurl.LNURLWithdrawResponse{
Tag: LNURL_WITHDRAWTAG,
K1: id,
Callback: fmt.Sprintf("%s/%s", s.baseUrl, DEFAULT_CALLBACK_SUBDIR),
CallbackURL: nil,
MaxWithdrawable: withdrawProcess.WithdrawParams.MaxAmt,
MinWithdrawable: withdrawProcess.WithdrawParams.MinAmt,
DefaultDescription: withdrawProcess.WithdrawParams.Description,
}
log.Printf("\t [LNURL] > New WithdrawRequest %s %v", id, res)
return res, nil
}
s.RUnlock()
return nil, &lnurl.LNURLErrorResponse{
Status: "ERROR",
Reason: WithdrawNotExistError.Error(),
}
}

As it says in the todo: maybe we should ask the LN SERVICE for the params (max, min withdrawable) in this step. This might the better place as there could be a change on the buffer after asking for the bechstiring (qr code tag).

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.