Skip to content

Commit

Permalink
refactor: shared fedimint service
Browse files Browse the repository at this point in the history
  • Loading branch information
okjodom committed Dec 1, 2024
1 parent 2af9c7f commit bcaf99f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions apps/swap/src/swap.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import { HttpModule } from '@nestjs/axios';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { EventEmitterModule } from '@nestjs/event-emitter';
import { CacheModule } from '@nestjs/cache-manager';
import { CustomStore, DatabaseModule, LoggerModule } from '@bitsacco/common';
import { CustomStore, DatabaseModule, FedimintService, LoggerModule } from '@bitsacco/common';
import { SwapController } from './swap.controller';
import { SwapService } from './swap.service';
import { FxService } from './fx/fx.service';
import { IntasendService } from './intasend/intasend.service';
import { EventsController } from './events.controller';
import { FedimintService } from './fedimint/fedimint.service';
import {
MpesaOfframpSwapRepository,
MpesaOfframpSwapDocument,
Expand Down
4 changes: 2 additions & 2 deletions apps/swap/src/swap.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import {
Currency,
DatabaseModule,
fiatToBtc,
FedimintService,
TransactionStatus,
} from '@bitsacco/common';
import { createTestingModuleWithValidation } from '@bitsacco/testing';
import { TestingModule } from '@nestjs/testing';
import { createTestingModuleWithValidation } from '@bitsacco/testing';
import { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter';
import { FxService } from './fx/fx.service';
import { SwapService } from './swap.service';
import { IntasendService } from './intasend/intasend.service';
import { MpesaTransactionState } from './intasend/intasend.types';
import { FedimintService } from './fedimint/fedimint.service';
import { MpesaCollectionUpdateDto } from './dto';
import {
MpesaOfframpSwapRepository,
Expand Down
10 changes: 4 additions & 6 deletions apps/swap/src/swap.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ import {
ReceiveContext,
type ReceivePaymentFailureEvent,
type ReceivePaymentSuccessEvent,
fiatToBtc,
btcToFiat,
fiatToBtc,
fedimint_receive_success,
fedimint_receive_failure,
FedimintService,
SupportedCurrencyType,
PaginatedRequestDto,
} from '@bitsacco/common';
Expand All @@ -25,18 +28,13 @@ import { Inject, Injectable, Logger } from '@nestjs/common';
import { IntasendService } from './intasend/intasend.service';
import { MpesaCollectionUpdateDto, MpesaPaymentUpdateDto } from './dto';
import { MpesaTransactionState } from './intasend/intasend.types';
import { FedimintService } from './fedimint/fedimint.service';
import { FxService } from './fx/fx.service';
import {
MpesaOnrampSwapDocument,
MpesaOnrampSwapRepository,
MpesaOfframpSwapRepository,
SwapTransactionState,
} from '../db';
import {
fedimint_receive_success,
fedimint_receive_failure,
} from './fedimint/fedimint.const';
import { isMpesaCollectionUpdate } from './dto/utils';

@Injectable()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing';
import { TestingModule } from '@nestjs/testing';
import { createTestingModuleWithValidation } from '@bitsacco/testing';
import { FedimintService } from './fedimint.service';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { FedimintService } from './fedimint.service';

describe('FedimintService', () => {
let mockCfg: jest.Mocked<ConfigService> = {
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions libs/common/src/fedimint/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './fedimint.const';
export * from './fedimint.service';
1 change: 1 addition & 0 deletions libs/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './utils';
export * from './constants';
export * from './dto';
export * from './database';
export * from './fedimint';

0 comments on commit bcaf99f

Please sign in to comment.