Commit 94a3379
Release: develop -> main (#2917)
* feat(liquidity-management): add swap command to DfxDexAdapter (#2882)
* feat(liquidity-management): add swap command to DfxDexAdapter
Add new 'swap' command for cross-asset liquidity acquisition via DEX.
Unlike 'purchase' (same asset), 'swap' allows converting one asset to
another, e.g., USDC → EURC via Uniswap.
- Add SWAP to DfxDexAdapterCommands enum
- Implement swap() method with source asset from params
- Add param validation for sourceAsset parameter
- Reuse checkSellPurchaseCompletion for order tracking
Usage: Action params {"sourceAsset": "USDC"} with rule targetAsset EURC
will swap available USDC to EURC via the configured DEX pool.
* refactor: consolidate SWAP into PURCHASE/SELL with tradeAsset parameter
- Remove SWAP command from DfxDexAdapterCommands enum
- Add optional tradeAsset parameter to PURCHASE and SELL commands
- Add resolveTradeAsset() helper for cross-asset operations
- Add validateTradeAssetParams() for parameter validation
When tradeAsset is provided, the command uses it as the source asset
for cross-asset operations (e.g., USDC → EURC via DEX).
When not provided, behavior remains unchanged (same-asset operation).
This creates a symmetric API where both PURCHASE and SELL support
cross-asset operations through a single optional parameter.
* refactor: simplify tradeAsset - only for PURCHASE, not SELL
- Remove tradeAsset support from SELL (sellLiquidity not implemented for any asset)
- Simplify return type to Asset instead of Awaited<ReturnType<...>>
- Keep SELL with original simple implementation
* perf: avoid unnecessary async call when no tradeAsset provided
* style: fix prettier formatting
* feat: cleanup + added sell
* fix: fixed swap amounts
---------
Co-authored-by: David May <david.leo.may@gmail.com>
* [DEV-4424] Implemented forwarded pay-in return (#2913)
* [DEV-4424] Implemented forwarded pay-in return
* [DEV-4424] Fix tests
* feat(aml): add NAME_TOO_SHORT check for bank payout validation (#2879)
* feat(aml): add NAME_TOO_SHORT check for bank payout validation
Add AML check to reject transactions where the user's name contains
fewer than 4 letters. Banks require a minimum name length for processing.
Changes:
- Add AmlError.NAME_TOO_SHORT with CRUCIAL type and FAIL status
- Add AmlReason.NAME_TOO_SHORT
- Add countLetters() helper to count only alphabetic characters
- Add name length validation in getAmlErrors() after NAME_MISSING check
- Update SiftAmlDeclineMap and TransactionReasonMapper
The check uses verifiedName, bankData.name, or completeName (in that order)
and counts only letters (including European special characters like ä, ö, ü, ß).
* feat(i18n): add name_too_short chargeback reason translations
Add email translations for NAME_TOO_SHORT AML reason in all 6 languages:
- EN, DE, FR, IT, ES, PT
This text is shown to users when their transaction is refunded due to
the account holder name having fewer than 4 letters, which banks
require for processing payouts.
* fix: use Unicode property escape for letter counting
Replace hardcoded character list with \p{L} Unicode property escape
to correctly count letters in all languages (Scandinavian, Polish,
Czech, Turkish, etc.).
Before: 'Åse Ødegård' counted as 6 letters (å, Ø ignored)
After: 'Åse Ødegård' counted as 10 letters (correct)
* fix: use Sepolia blockchain for REALU on DEV/LOC (#2915)
* fix: use Sepolia blockchain for REALU on DEV/LOC
On DEV and LOC environments, REALU transactions were being broadcast
to Ethereum Mainnet instead of Sepolia testnet. This caused the sell
confirm flow to fail since actual tokens are on Sepolia.
Change tokenBlockchain to be environment-aware: use Sepolia on DEV/LOC,
Ethereum on PROD/STG.
* fix: support Sepolia for EIP-7702 delegation on DEV/LOC
Update isDelegationSupportedForRealUnit() to accept Sepolia blockchain
on DEV/LOC environments. Without this, the EIP-7702 transfer would fail
with 'delegation not supported' error even though the asset blockchain
is correctly set to Sepolia.
* fix: update buy simulation to use Sepolia REALU on DEV/LOC
Since TransactionRequests are now created with Sepolia REALU asset,
the buy simulation must also search for Sepolia REALU targetId.
- Remove mainnet REALU lookup (no longer needed)
- Search for Sepolia REALU targetId instead of mainnet
- Update tests to match new behavior
* fix: always use Mainnet asset for REALU price lookups
Price data is only available for Mainnet REALU asset. Add separate
getMainnetRealuAsset() method for price-related functions while
keeping getRealuAsset() environment-based for transactions.
- getRealUnitPrice() now uses Mainnet asset
- getHistoricalPrice() now uses Mainnet asset
- Transaction methods (buy/sell) still use environment-based asset
* refactor RealUnitDevService variables.
* chore: revert fetch prices only from mainnet.
---------
Co-authored-by: TuanLamNguyen <xnguyen.lam@gmail.com>
* fix(bank-data): transform empty string names to null in DTOs (#2918)
Empty strings in bankData.name bypass nullish coalescing fallback logic
because ?? treats "" as a present value. This causes incorrect behavior
in AML name resolution where empty strings are used instead of actual
user data.
Add @Transform decorator to name field in CreateBankDataDto and
UpdateBankDataDto that trims whitespace and converts empty strings
to null, preventing invalid data at the source.
Closes #2911
* Update XT/DEURO liquidity minimum from 4300 to 10000 (#2920)
---------
Co-authored-by: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com>
Co-authored-by: David May <david.leo.may@gmail.com>
Co-authored-by: David May <85513542+davidleomay@users.noreply.github.com>
Co-authored-by: TuanLamNguyen <xnguyen.lam@gmail.com>
Co-authored-by: bernd2022 <104787072+bernd2022@users.noreply.github.com>
Co-authored-by: Danswar <48102227+Danswar@users.noreply.github.com>25 files changed
Lines changed: 353 additions & 90 deletions
File tree
- migration
- src
- integration
- sift/dto
- subdomains
- core
- aml
- enums
- services
- liquidity-management/adapters/actions
- sell-crypto
- process
- __tests__
- services
- generic/user/models/bank-data/dto
- __tests__
- supporting
- dex/services
- payment/dto
- realunit
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
| 1040 | + | |
1040 | 1041 | | |
1041 | 1042 | | |
1042 | 1043 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
| |||
0 commit comments