Skip to content

Commit a76eed2

Browse files
authored
Merge pull request #3385 from DFXswiss/develop
Release: develop -> main
2 parents 4270e5e + 4c9c639 commit a76eed2

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

src/subdomains/generic/gs/dto/gs.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const DebugBlockedCols: Record<string, string[]> = {
8888
'country',
8989
],
9090
checkout_tx: ['cardName', 'ip', 'cardBin', 'cardLast4', 'cardFingerPrint', 'cardIssuer', 'cardIssuerCountry', 'raw'],
91-
virtual_iban: ['iban', 'bban', 'label'],
91+
virtual_iban: ['label'],
9292
kyc_step: ['result'],
9393
kyc_file: ['name', 'uid'],
9494
kyc_log: ['comment', 'ipAddress', 'result', 'pdfUrl'],

src/subdomains/supporting/realunit/realunit.service.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { UserDataService } from 'src/subdomains/generic/user/models/user-data/us
4545
import { User } from 'src/subdomains/generic/user/models/user/user.entity';
4646
import { UserService } from 'src/subdomains/generic/user/models/user/user.service';
4747
import { FiatPaymentMethod } from 'src/subdomains/supporting/payment/dto/payment-method.enum';
48+
import { QuoteError } from 'src/subdomains/supporting/payment/dto/transaction-helper/quote-error.enum';
4849
import { TransactionRequestStatus } from 'src/subdomains/supporting/payment/entities/transaction-request.entity';
4950
import { SwissQRService } from 'src/subdomains/supporting/payment/services/swiss-qr.service';
5051
import { TransactionRequestService } from 'src/subdomains/supporting/payment/services/transaction-request.service';
@@ -867,9 +868,12 @@ export class RealUnitService {
867868
}
868869

869870
// 2. KYC Level check - Level 30 minimum
870-
const requiredLevel = KycLevel.LEVEL_30;
871-
if (userData.kycLevel < requiredLevel) {
872-
throw new KycLevelRequiredException(requiredLevel, userData.kycLevel, 'KYC Level 30 required for RealUnit sell');
871+
if (userData.kycLevel < KycLevel.LEVEL_30) {
872+
throw new KycLevelRequiredException(
873+
KycLevel.LEVEL_30,
874+
userData.kycLevel,
875+
'KYC Level 30 required for RealUnit sell',
876+
);
873877
}
874878

875879
// 3. Get REALU asset
@@ -901,13 +905,22 @@ export class RealUnitService {
901905
false, // includeTx
902906
);
903907

904-
// 7. Prepare EIP-7702 delegation data (ALWAYS for RealUnit - app supports eth_sign)
908+
// 7. Check if limit exceeded
909+
if (sellPaymentInfo.error === QuoteError.LIMIT_EXCEEDED) {
910+
throw new KycLevelRequiredException(
911+
KycLevel.LEVEL_50,
912+
userData.kycLevel,
913+
'KYC Level 50 required for RealUnit sell exceeding trading limit',
914+
);
915+
}
916+
917+
// 8. Prepare EIP-7702 delegation data (ALWAYS for RealUnit - app supports eth_sign)
905918
const delegationData = await this.eip7702DelegationService.prepareDelegationDataForRealUnit(
906919
user.address,
907920
realuAsset.blockchain,
908921
);
909922

910-
// 8. Build response with EIP-7702 data AND fallback transfer info
923+
// 9. Build response with EIP-7702 data AND fallback transfer info
911924
const amountWei = EvmUtil.toWeiAmount(sellPaymentInfo.amount, realuAsset.decimals);
912925

913926
const response: RealUnitSellPaymentInfoDto = {

0 commit comments

Comments
 (0)