Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/subdomains/monitoring/monitoring.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { BoltzModule } from '../boltz/boltz.module';
import { AssetModule } from '../master-data/asset/asset.module';
import { PricingModule } from '../pricing/pricing.module';
import { LightningWalletEntity } from '../user/domain/entities/lightning-wallet.entity';
import { LightingWalletRepository } from '../user/application/repositories/lightning-wallet.repository';
import { LightningWalletRepository } from '../user/application/repositories/lightning-wallet.repository';
import { MonitoringController } from './controllers/monitoring.controller';
import { MonitoringBalanceEntity } from './entities/monitoring-balance.entity';
import { MonitoringEvmBalanceEntity } from './entities/monitoring-evm-balance.entity';
Expand Down Expand Up @@ -38,7 +38,7 @@ import { MonitoringService } from './services/monitoring.service';
MonitoringRepository,
MonitoringBalanceRepository,
MonitoringEvmBalanceRepository,
LightingWalletRepository,
LightningWalletRepository,
MonitoringService,
MonitoringEvmService,
BalanceAlertService,
Expand Down
8 changes: 4 additions & 4 deletions src/subdomains/monitoring/services/monitoring.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { QueueHandler } from 'src/shared/utils/queue-handler';
import { AssetService } from 'src/subdomains/master-data/asset/services/asset.service';
import { CoinGeckoService } from 'src/subdomains/pricing/services/coingecko.service';
import { LightningWalletTotalBalanceDto } from 'src/subdomains/user/application/dto/lightning-wallet.dto';
import { LightingWalletRepository } from 'src/subdomains/user/application/repositories/lightning-wallet.repository';
import { LightningWalletRepository } from 'src/subdomains/user/application/repositories/lightning-wallet.repository';
import { MonitoringBlockchainBalance } from '../dto/monitoring.dto';
import { MonitoringBalanceEntity } from '../entities/monitoring-balance.entity';
import { MonitoringBalanceRepository } from '../repositories/monitoring-balance.repository';
Expand All @@ -39,7 +39,7 @@ export class MonitoringService implements OnModuleInit {
private readonly evmRegistryService: EvmRegistryService,
private readonly monitoringRepository: MonitoringRepository,
private readonly monitoringBalanceRepository: MonitoringBalanceRepository,
private readonly lightingWalletRepository: LightingWalletRepository,
private readonly lightningWalletRepository: LightningWalletRepository,
) {
this.bitcoinClient = bitcoinservice.getDefaultClient();
this.lightningClient = lightningService.getDefaultClient();
Expand Down Expand Up @@ -76,8 +76,8 @@ export class MonitoringService implements OnModuleInit {

try {
const internalWalletIds = Config.blockchain.lightning.lnbits.internalWalletIds;
const internalBalances = await this.lightingWalletRepository.getInternalBalances(internalWalletIds);
const customerBalances = await this.lightingWalletRepository.getCustomerBalances(internalWalletIds);
const internalBalances = await this.lightningWalletRepository.getInternalBalances(internalWalletIds);
const customerBalances = await this.lightningWalletRepository.getCustomerBalances(internalWalletIds);

await this.processBalances(internalBalances, customerBalances);
await this.processChannels();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LightningWalletEntity } from '../../domain/entities/lightning-wallet.en
import { LightningWalletTotalBalanceDto } from '../dto/lightning-wallet.dto';

@Injectable()
export class LightingWalletRepository extends BaseRepository<LightningWalletEntity> {
export class LightningWalletRepository extends BaseRepository<LightningWalletEntity> {
constructor(manager: EntityManager) {
super(LightningWalletEntity, manager);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from 'src/subdomains/user/domain/entities/user-transaction.entity';
import { LightningWalletEntity } from '../../domain/entities/lightning-wallet.entity';
import { UserTransactionDto } from '../dto/user-transaction.dto';
import { LightingWalletRepository } from '../repositories/lightning-wallet.repository';
import { LightningWalletRepository } from '../repositories/lightning-wallet.repository';
import { WalletRepository } from '../repositories/wallet.repository';

interface LightningWalletInfoDto {
Expand All @@ -51,7 +51,7 @@ export class LightningWalletService {
private readonly lightningTransactionService: LightningTransactionService,
private readonly paymentRequestService: PaymentRequestService,
private readonly userTransactionRepository: UserTransactionRepository,
private readonly lightingWalletRepository: LightingWalletRepository,
private readonly lightningWalletRepository: LightningWalletRepository,
private readonly walletRepository: WalletRepository,
) {
this.client = lightningService.getDefaultClient();
Expand All @@ -64,14 +64,14 @@ export class LightningWalletService {
}

async getLightningWallet(walletId: string): Promise<LightningWalletEntity> {
return this.lightingWalletRepository.getByWalletId(walletId);
return this.lightningWalletRepository.getByWalletId(walletId);
}

async updateLightningWalletBalances(): Promise<void> {
const userTransactionBalances = await this.userTransactionRepository.getBalances();

for (const userTransactionBalance of userTransactionBalances) {
await this.lightingWalletRepository.update(
await this.lightningWalletRepository.update(
{ id: userTransactionBalance.lightningWalletId },
{
balance: userTransactionBalance.balance,
Expand All @@ -81,8 +81,8 @@ export class LightningWalletService {

const internalWalletIds = Config.blockchain.lightning.lnbits.internalWalletIds;

const internalBalances = await this.lightingWalletRepository.getInternalBalances(internalWalletIds);
const customerBalances = await this.lightingWalletRepository.getCustomerBalances(internalWalletIds);
const internalBalances = await this.lightningWalletRepository.getInternalBalances(internalWalletIds);
const customerBalances = await this.lightningWalletRepository.getCustomerBalances(internalWalletIds);

await this.monitoringService.processBalanceMonitoring(internalBalances, customerBalances);
}
Expand Down Expand Up @@ -110,7 +110,7 @@ export class LightningWalletService {
...(await this.getUserTransactionEntities(lightningWalletInfo, startDate, endDate, withBalance)),
);
} else {
const lightningWalletIterator = this.lightingWalletRepository.getRawIterator<LightningWalletInfoDto>(
const lightningWalletIterator = this.lightningWalletRepository.getRawIterator<LightningWalletInfoDto>(
100,
'id AS lightningWalletId, lnbitsWalletId, adminKey, assetId AS accountAssetId',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { LightningLogger } from 'src/shared/services/lightning-logger';
import { QueueHandler } from 'src/shared/utils/queue-handler';
import { LightningWalletService } from 'src/subdomains/user/application/services/lightning-wallet.service';
import { UserBoltcardEntity, UserBoltcardStatus } from '../../domain/entities/user-boltcard.entity';
import { LightingWalletRepository } from '../repositories/lightning-wallet.repository';
import { LightningWalletRepository } from '../repositories/lightning-wallet.repository';
import { UserBoltcardRepository } from '../repositories/user-boltcard.repository';
import { WalletRepository } from '../repositories/wallet.repository';

Expand All @@ -24,7 +24,7 @@ export class UserBoltcardService {
readonly lnbitsWebHookService: LnbitsWebHookService,
private readonly lightningWalletService: LightningWalletService,
private readonly userBoltcardRepository: UserBoltcardRepository,
private readonly lightingWalletRepository: LightingWalletRepository,
private readonly lightningWalletRepository: LightningWalletRepository,
private readonly walletRepository: WalletRepository,
) {
this.client = lightningService.getDefaultClient();
Expand Down Expand Up @@ -89,7 +89,7 @@ export class UserBoltcardService {
}
}
} else {
const lightningWalletIterator = this.lightingWalletRepository.getRawIterator<{ adminKey: string }>(
const lightningWalletIterator = this.lightningWalletRepository.getRawIterator<{ adminKey: string }>(
100,
'adminKey',
);
Expand Down
4 changes: 2 additions & 2 deletions src/subdomains/user/user.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { PaymentRequestModule } from '../payment-request/payment-request.module'
import { AuthController } from './api/controllers/auth.controller';
import { UserController } from './api/controllers/user.controller';
import { LightningWalletSynchronizeController } from './application/controller/lightning-wallet-sync.controller';
import { LightingWalletRepository } from './application/repositories/lightning-wallet.repository';
import { LightningWalletRepository } from './application/repositories/lightning-wallet.repository';
import { UserBoltcardRepository } from './application/repositories/user-boltcard.repository';
import { UserTransactionRepository } from './application/repositories/user-transaction.repository';
import { UserRepository } from './application/repositories/user.repository';
Expand Down Expand Up @@ -55,7 +55,7 @@ import { WalletEntity } from './domain/entities/wallet.entity';
UserRepository,
WalletProviderRepository,
WalletRepository,
LightingWalletRepository,
LightningWalletRepository,
UserTransactionRepository,
UserBoltcardRepository,
AuthService,
Expand Down