@@ -45,6 +45,7 @@ import { UserDataService } from 'src/subdomains/generic/user/models/user-data/us
4545import { User } from 'src/subdomains/generic/user/models/user/user.entity' ;
4646import { UserService } from 'src/subdomains/generic/user/models/user/user.service' ;
4747import { FiatPaymentMethod } from 'src/subdomains/supporting/payment/dto/payment-method.enum' ;
48+ import { QuoteError } from 'src/subdomains/supporting/payment/dto/transaction-helper/quote-error.enum' ;
4849import { TransactionRequestStatus } from 'src/subdomains/supporting/payment/entities/transaction-request.entity' ;
4950import { SwissQRService } from 'src/subdomains/supporting/payment/services/swiss-qr.service' ;
5051import { 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