Skip to content

Commit

Permalink
Merge pull request #111 from sotatek-dev/fix/get-pair
Browse files Browse the repository at this point in the history
fix: get pairs
  • Loading branch information
Sotatek-TanHoang authored Sep 30, 2024
2 parents f47a0e2 + cdf2b33 commit 76e7f65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/constants/error.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export enum EError {
UNAUTHORIZED = 'UNAUTHORIZED',
INVALID_SIGNATURE = 'INVALID_SIGNATURE',
OVER_DAILY_QUOTA = 'OVER_DAILY_QUOTA',
RESOURCE_NOT_FOUND = 'RESOURCE_NOT_FOUND',
}
6 changes: 4 additions & 2 deletions src/modules/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CommonConfigRepository } from '../../database/repositories/common-confi
import { EventLogRepository } from '../../database/repositories/event-log.repository.js';
import { UserRepository } from '../../database/repositories/user.repository.js';
import { TokenPair } from '../../modules/users/entities/tokenpair.entity.js';
import { httpBadRequest } from '../../shared/exceptions/http-exeption.js';
import { httpBadRequest, httpNotFound } from '../../shared/exceptions/http-exeption.js';
import { LoggerService } from '../../shared/modules/logger/logger.service.js';
import { addDecimal } from '../../shared/utils/bignumber.js';
import { UpdateCommonConfigBodyDto } from './dto/common-config-request.dto.js';
Expand Down Expand Up @@ -79,7 +79,9 @@ export class UsersService {
}),
this.commonConfigRepository.getCommonConfig(),
]);

if (!tokenPair) {
httpNotFound(EError.RESOURCE_NOT_FOUND);
}
if (tokenPair.toChain == ENetworkName.MINA) {
decimal = this.configService.get(EEnvKey.DECIMAL_TOKEN_EVM);
gasFee = addDecimal(this.configService.get(EEnvKey.GAS_FEE_EVM), decimal);
Expand Down

0 comments on commit 76e7f65

Please sign in to comment.