Merge remote-tracking branch 'origin/diagon-alley' into diagon-alley

This commit is contained in:
ben 2022-11-30 12:22:36 +00:00
commit dae9db7042
2 changed files with 5 additions and 5 deletions

View file

@ -336,13 +336,13 @@
this.user = null
})
},
async generateKeys(payment_hash) {
async generateKeys() {
//check if the keys are set
if ('publickey' in this.user.keys && 'privatekey' in this.user.keys)
return
return await LNbits.api
.request('GET', `/diagonalley/api/v1/keys/${payment_hash}`, null)
.request('GET', `/diagonalley/api/v1/keys`, null)
.then(response => {
if (response.data) {
let data = {
@ -457,7 +457,7 @@
}
} else {
// generate keys
this.generateKeys(order_id)
this.generateKeys()
// populate user data
this.user.orders = {
[`${order_id}`]: this.products

View file

@ -481,8 +481,8 @@ async def api_diagonalley_stall_create(
## KEYS
@diagonalley_ext.get("/api/v1/keys/{payment_hash}")
async def api_diagonalley_generate_keys(payment_hash: str):
@diagonalley_ext.get("/api/v1/keys")
async def api_diagonalley_generate_keys():
private_key = PrivateKey()
public_key = private_key.pubkey.serialize().hex()
while not public_key.startswith("02"):