wallet tracking backend support

This commit is contained in:
Mononaut
2024-07-25 22:33:32 +00:00
parent ca7221f8b7
commit 862c9591a1
9 changed files with 213 additions and 0 deletions

View File

@@ -162,6 +162,14 @@ interface IConfig {
PAID: boolean;
API_KEY: string;
},
WALLETS: {
ENABLED: boolean;
WALLETS: {
url: string;
name: string;
apiKey: string;
}[];
}
}
const defaults: IConfig = {
@@ -324,6 +332,10 @@ const defaults: IConfig = {
'PAID': false,
'API_KEY': '',
},
'WALLETS': {
'ENABLED': false,
'WALLETS': [],
},
};
class Config implements IConfig {
@@ -345,6 +357,7 @@ class Config implements IConfig {
MEMPOOL_SERVICES: IConfig['MEMPOOL_SERVICES'];
REDIS: IConfig['REDIS'];
FIAT_PRICE: IConfig['FIAT_PRICE'];
WALLETS: IConfig['WALLETS'];
constructor() {
const configs = this.merge(configFromFile, defaults);
@@ -366,6 +379,7 @@ class Config implements IConfig {
this.MEMPOOL_SERVICES = configs.MEMPOOL_SERVICES;
this.REDIS = configs.REDIS;
this.FIAT_PRICE = configs.FIAT_PRICE;
this.WALLETS = configs.WALLETS;
}
merge = (...objects: object[]): IConfig => {