-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathuserManager.ts
48 lines (40 loc) · 1.21 KB
/
userManager.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
42
43
44
45
46
47
48
import LNBits from '../src/index';
const init = async () => {
// Config
const { userManager } = LNBits({
adminKey: 'e84b3c3941cc4e51b1b859c8a95aad3f',
invoiceReadKey: 'b9f390e3b08547458ca016ff5d1c5483',
endpoint: 'https://lnbits.com', //default
});
const users = await userManager.getUsers();
console.log(users);
const wallets = await userManager.getWallets({
user_id: '355c5110bed24744bebb12aecf8fad14',
});
console.log(wallets);
const tx = await userManager.getTransactions({
wallet_id: '4a18ae4b204044069bd349a37ba0be1d',
});
console.log(tx);
const user = await userManager.createUser({
admin_id: '355c5110bed24744bebb12aecf8fad14',
user_name: 'user',
wallet_name: 'wallet',
});
console.log(user);
const userDeleted = await userManager.deleteUser({
user_id: 'b7cab6e3744347f2b6516510f5d40e9d',
});
console.log(userDeleted);
const walletDeleted = await userManager.deleteWallet({
wallet_id: '0d52c8a832f84f9b86bd993b985e6f10',
});
console.log(walletDeleted);
const extension = await userManager.activeExtension({
userid: '355c5110bed24744bebb12aecf8fad14',
extension: 'usermanager',
active: true,
});
console.log(extension);
};
init();