mirror of
https://github.com/nbd-wtf/satdress.git
synced 2024-11-11 16:30:35 +00:00
support for "commando" method.
This commit is contained in:
parent
e4f330d3a4
commit
dadd45cf08
18
db.go
18
db.go
|
@ -14,13 +14,17 @@ import (
|
|||
)
|
||||
|
||||
type Params struct {
|
||||
Name string `json:"name"`
|
||||
Domain string `json:"domain,omitempty"`
|
||||
Kind string `json:"kind"`
|
||||
Host string `json:"host"`
|
||||
Key string `json:"key"`
|
||||
Pak string `json:"pak"`
|
||||
Waki string `json:"waki"`
|
||||
Name string `json:"name"`
|
||||
Domain string `json:"domain,omitempty"`
|
||||
Kind string `json:"kind"`
|
||||
|
||||
Host string `json:"host"`
|
||||
Key string `json:"key"`
|
||||
Pak string `json:"pak"`
|
||||
Waki string `json:"waki"`
|
||||
NodeId string `json:"nodeid"`
|
||||
Rune string `json:"rune"`
|
||||
|
||||
Pin string `json:"pin"`
|
||||
MinSendable string `json:"minSendable"`
|
||||
MaxSendable string `json:"maxSendable"`
|
||||
|
|
4
go.mod
4
go.mod
|
@ -5,10 +5,10 @@ go 1.16
|
|||
require (
|
||||
github.com/cockroachdb/pebble v0.0.0-20210812144839-61318a019370
|
||||
github.com/fiatjaf/go-lnurl v1.4.0
|
||||
github.com/fiatjaf/makeinvoice v1.3.1
|
||||
github.com/fiatjaf/makeinvoice v1.4.0
|
||||
github.com/gorilla/mux v1.8.0
|
||||
github.com/kelseyhightower/envconfig v1.4.0
|
||||
github.com/lib/pq v1.10.2
|
||||
github.com/lib/pq v1.10.3
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
||||
github.com/rs/zerolog v1.23.0
|
||||
github.com/tidwall/sjson v1.1.7
|
||||
|
|
27
index.html
27
index.html
|
@ -42,7 +42,8 @@
|
|||
<option disabled value="">Please select one:</option>
|
||||
<option value="lnd">LND</option>
|
||||
<option value="eclair">Eclair</option>
|
||||
<option value="sparko">Sparko</option>
|
||||
<option value="sparko">Sparko (c-lightning)</option>
|
||||
<option value="commando">Commando (c-lightning)</option>
|
||||
<option value="lnpay">LNPay</option>
|
||||
<option value="lnbits">LNbits</option>
|
||||
</select>
|
||||
|
@ -122,6 +123,30 @@
|
|||
<input type="checkbox" v-model="isNew" />
|
||||
</label>
|
||||
</div>
|
||||
<div v-if="kind == 'commando'">
|
||||
<div class="field">
|
||||
<label for="nodeid">Node ID (pubkey)</label>
|
||||
<input
|
||||
class="input full-width"
|
||||
name="nodeid"
|
||||
id="nodeid"
|
||||
placeholder="02c16cca44562b590dd279c942200bdccfd4f990c3a69fad620c10ef2f8228eaff"
|
||||
/>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="host">Node IP + Port</label>
|
||||
<input
|
||||
class="input full-width"
|
||||
name="host"
|
||||
id="host"
|
||||
placeholder="10.147.17.32:9735"
|
||||
/>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="rune">Rune</label>
|
||||
<input class="input full-width" name="rune" id="rune" />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="field" v-if="!isNew">
|
||||
<label for="pin"> Secret PIN </label>
|
||||
|
|
12
main.go
12
main.go
|
@ -104,11 +104,13 @@ func main() {
|
|||
}
|
||||
|
||||
pin, inv, err := SaveName(name, domain, &Params{
|
||||
Kind: r.FormValue("kind"),
|
||||
Host: r.FormValue("host"),
|
||||
Key: r.FormValue("key"),
|
||||
Pak: r.FormValue("pak"),
|
||||
Waki: r.FormValue("waki"),
|
||||
Kind: r.FormValue("kind"),
|
||||
Host: r.FormValue("host"),
|
||||
Key: r.FormValue("key"),
|
||||
Pak: r.FormValue("pak"),
|
||||
Waki: r.FormValue("waki"),
|
||||
NodeId: r.FormValue("nodeid"),
|
||||
Rune: r.FormValue("rune"),
|
||||
}, r.FormValue("pin"))
|
||||
if err != nil {
|
||||
w.WriteHeader(500)
|
||||
|
|
|
@ -55,6 +55,12 @@ func makeInvoice(
|
|||
Host: params.Host,
|
||||
Password: "",
|
||||
}
|
||||
case "commando":
|
||||
backend = makeinvoice.CommandoParams{
|
||||
Host: params.Host,
|
||||
NodeId: params.NodeId,
|
||||
Rune: params.Rune,
|
||||
}
|
||||
}
|
||||
|
||||
mip := makeinvoice.Params{
|
||||
|
|
Loading…
Reference in New Issue
Block a user