File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,19 @@ async function setWalletId(value) {
52
52
} ) ;
53
53
}
54
54
55
+ async function getWithdrawLinks ( ) {
56
+ const result = await browser . storage . sync . get ( {
57
+ withdrawLinks : ''
58
+ } )
59
+ return result . walletId
60
+ }
61
+
62
+ async function setWithdrawLinks ( value ) {
63
+ return browser . storage . sync . set ( {
64
+ withdrawLinks : value
65
+ } ) ;
66
+ }
67
+
55
68
async function getActiveWallet ( ) {
56
69
const user = await getUser ( )
57
70
const walletId = await getWalletId ( )
@@ -64,6 +77,7 @@ async function cleanConfig() {
64
77
await setUserId ( '' )
65
78
await setWalletId ( '' )
66
79
await setUser ( { } )
80
+ await setWithdrawLinks ( [ ] )
67
81
}
68
82
69
83
async function isConfigValid ( ) {
@@ -83,6 +97,8 @@ export default {
83
97
getWalletId,
84
98
setWalletId,
85
99
getActiveWallet,
100
+ getWithdrawLinks,
101
+ setWithdrawLinks,
86
102
cleanConfig,
87
103
isConfigValid,
88
104
}
Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ function lnbitsApi(serverUrl) {
59
59
'/api/v1/payments/' + paymentHash ,
60
60
wallet . inkey
61
61
)
62
+ } ,
63
+ getWithdrawLinks : function ( wallet ) {
64
+ return this . request (
65
+ 'get' ,
66
+ '/withdraw/api/v1/links/' ,
67
+ wallet . inkey
68
+ )
62
69
}
63
70
}
64
71
}
You can’t perform that action at this time.
0 commit comments