Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions preferences-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ currencies:
dailyCount: 100
monthlyTotal: 30000
monthlyCount: 3000
gift: 100000
gift: 1000000
- symbol: TBTC
name: Bitcoin (Test)
precision: 0.000001
Expand All @@ -65,7 +65,7 @@ currencies:
withdrawFee: 0.0001
withdrawMin: 0.0001
decimal: 0
gift: 21000000
gift: 5
- symbol: TETH
name: Ethereum (Test)
precision: 0.000001
Expand All @@ -79,7 +79,7 @@ currencies:
withdrawFee: 0.00001
withdrawMin: 0.000001
decimal: 18
gift: 2000
gift: 100
- symbol: TUSDT
name: Tether (Test)
precision: 0.01
Expand Down Expand Up @@ -135,7 +135,7 @@ currencies:
withdrawFee: 0.01
withdrawMin: 0.01
decimal: 18
gift: 1000000
gift: 2000
markets:
- leftSide: TBTC
rightSide: TUSDT
Expand Down Expand Up @@ -260,4 +260,4 @@ userLimits:
monthlyCount: 3000
system:
walletTitle: system
walletLevel: basic
walletLevel: basic
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import java.math.BigDecimal

@Component
class UserRegistrationService(
val walletOwnerManager: WalletOwnerManager, val walletManager: WalletManager, val currencyService: CurrencyService
val walletOwnerManager: WalletOwnerManager,
val walletManager: WalletManager,
val currencyService: CurrencyService
) {
@Autowired
private lateinit var preferences: Preferences
Expand All @@ -24,7 +26,7 @@ class UserRegistrationService(
suspend fun registerNewUser(event: UserCreatedEvent) {
val owner = walletOwnerManager.createWalletOwner(event.uuid, "${event.firstName} ${event.lastName}", "1")

preferences.currencies.filter { it.gift > BigDecimal.ZERO }.forEach {
preferences.currencies.forEach {
val currency = currencyService.getCurrency(it.symbol) ?: throw OpexException(OpexError.CurrencyNotFound)
walletManager.createWallet(owner, Amount(currency, it.gift), currency, "main")
}
Expand Down