-
Notifications
You must be signed in to change notification settings - Fork 12
/
withdraw.ts
41 lines (36 loc) · 979 Bytes
/
withdraw.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import LNBits from '../src/index';
const init = async () => {
const { withdraw } = LNBits({
adminKey: 'e84b3c3941cc4e51b1b859c8a95aad3f',
invoiceReadKey: 'b9f390e3b08547458ca016ff5d1c5483',
endpoint: 'https://lnbits.com', //default
});
const withdrawLinks = await withdraw.getLinks({
withdraw_id: '5o57EM9Qty5CLQB2QNjQ2p',
});
console.log(withdrawLinks);
const link = await withdraw.createLink({
title: 'title',
min_withdrawable: 10,
max_withdrawable: 20,
uses: 10,
wait_time: 3600,
is_unique: false,
});
console.log(link);
const linkUpdated = await withdraw.updateLink({
withdraw_id: 'aaWVY3cu655xHxJpYLJhcA',
title: 'title',
min_withdrawable: 10,
max_withdrawable: 20,
uses: 10,
wait_time: 3600,
is_unique: false,
});
console.log(linkUpdated);
const linkDeleted = await withdraw.deleteLink({
withdraw_id: 'aaWVY3cu655xHxJpYLJhcA',
});
console.log(linkDeleted);
};
init();