Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d3368db
Fix chart problem (#495)
AmirRajabii Jan 6, 2025
31fa658
Merge branch 'main' into dev
Marchosiax Jan 8, 2025
05fc3d6
New transfer ‌category(for referral) (#487)
AmirRajabii Jan 13, 2025
08274a3
SVG Chart of Price Trend (#498)
AmirRajabii Jan 15, 2025
5dffd9e
Merge OTC changes to dev (#501)
Marchosiax Jan 25, 2025
da756fa
Add voucher (#502)
AmirRajabii Feb 8, 2025
e99d876
Fix voucher services (#503)
AmirRajabii Feb 16, 2025
af38835
Merge branch 'main' into dev
Marchosiax Feb 17, 2025
5cfbe67
Remove preferences and its configs (#505)
Marchosiax Feb 18, 2025
dc502bd
Merge branch 'main' into dev
Marchosiax Feb 18, 2025
e49f5f5
Delete preferences from readme
Marchosiax Feb 18, 2025
d006378
fix spark-line and recent trades problems (#507)
AmirRajabii Feb 19, 2025
e8a87dc
Fix typo in terminal query (#508)
fatemeh-i Feb 20, 2025
9223442
Merge branch 'main' into dev
Marchosiax Feb 23, 2025
e75dea7
Develop a service to calculate source amount in swapping (#515)
fatemeh-i Mar 3, 2025
cd9e6b0
Organize wallet service for admin (#512)
AmirRajabii Mar 4, 2025
64b531f
Pair trading availability for admin services (#514)
AmirRajabii Mar 4, 2025
070b91f
Calculate source amount (#516)
fatemeh-i Mar 5, 2025
2703817
The description has been added to the user's voucher transactions (#518)
AmirRajabii Mar 10, 2025
c0b621b
Add more logs in BackupService
Marchosiax Mar 16, 2025
5e104f4
Admin services (#521)
AmirRajabii Mar 17, 2025
cd2ccd8
update workflows (#525)
AmirRajabii Apr 20, 2025
4c51eaf
Merge branch 'main' into dev
Marchosiax Apr 26, 2025
a4a6efb
Refactor user management (#530)
Marchosiax Apr 29, 2025
0a62837
Add matching-gateway vault config
Marchosiax Apr 30, 2025
3f33f84
Gateway and voucher changes (#527)
AmirRajabii May 5, 2025
596678f
New UI services (#531)
AmirRajabii May 5, 2025
80299ec
Add captchaType (#532)
AmirRajabii May 11, 2025
0adf8ae
New register and login flow (#533)
Marchosiax May 12, 2025
cdd3458
fix security problem (#534)
AmirRajabii May 12, 2025
7ff5c0b
fix deposit manually problem (#536)
AmirRajabii May 17, 2025
0273a85
Temporarily add otp code in response. Will remove later.
Marchosiax May 17, 2025
43d104e
Merge remote-tracking branch 'origin/dev' into dev
Marchosiax May 17, 2025
b8e596b
Record manual deposit in tx history completely
AmirRajabii May 17, 2025
06922b7
Add new wallet services (#535)
AmirRajabii May 18, 2025
3f09a47
Set user's mobile number as a title of wallet owner
fatemeh-i May 18, 2025
7923cf6
add captcha to new authentication flow (#538)
AmirRajabii May 19, 2025
761e25b
fix matching gateway problem (#540)
AmirRajabii May 25, 2025
d5f31b6
use central api module (#541)
AmirRajabii May 31, 2025
a2b0979
Add infrastructure for permission authorization (#542)
Marchosiax May 31, 2025
7575823
Replace old keycloak (#543)
Marchosiax Jun 2, 2025
ce5ffe4
Otc security config (#544)
Marchosiax Jun 7, 2025
a95c2d1
Fix profile image url
Marchosiax Jun 7, 2025
1553f56
Add open order service without symbol
Marchosiax Jun 8, 2025
78dffd5
Fix token exchange error (#545)
Marchosiax Jun 9, 2025
bbcaf41
Fix api key token exchange error (#546)
Marchosiax Jun 11, 2025
3651743
Remove zookeeper (#548)
AmirRajabii Jun 30, 2025
a0c2280
Add quote currency management feature (#549)
AmirRajabii Jul 7, 2025
7c09f9c
Add count to history services (#550)
AmirRajabii Jul 8, 2025
9c019a9
Validation and calculation based on precision (#547)
AmirRajabii Jul 12, 2025
a6c72b1
Update dev.yml
fatemeh-i Jul 12, 2025
853a4c9
Calculate min and max based on quote asset for pairs (#552)
AmirRajabii Jul 14, 2025
2f3e098
Add max amount to currency (#555)
AmirRajabii Jul 15, 2025
840ca4d
Fix trade history problem (#556)
AmirRajabii Jul 15, 2025
1ba16fd
hot fix (#557)
AmirRajabii Jul 16, 2025
7327e03
Fix the problem of not creating a profile after user registration (#558)
AmirRajabii Jul 19, 2025
e37e032
Add market event producer (#559)
Marchosiax Jul 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 10 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +25,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
12 changes: 6 additions & 6 deletions .github/workflows/dev-otc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Build, Test, and Deploy otc (DEV env) services for specific partner
name: Build, Test, and Deploy otc (DEV env) services for specific partner
on:
# push:
# branches:
# - dev
# push:
# branches:
# - dev

workflow_dispatch:
inputs:
Expand All @@ -14,7 +14,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ 17 ]
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
echo "password=$server_pass" >> $GITHUB_OUTPUT

- name: Build
run: |
run: |
mvn -pl common -am -B -T 1C clean install -Potc
mvn -pl wallet,bc-gateway -amd -B -T 1C clean install -Potc

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ 21 ]
Expand All @@ -21,11 +21,11 @@ jobs:
distribution: 'adopt'
java-package: jdk
java-version: ${{ matrix.java }}
# cache: maven
# cache: maven
- name: Build
run: mvn -B -T 1C clean install
run: mvn -B clean install
- name: Run Tests
run: mvn -B -T 1C -Dskip.unit.tests=false surefire:test
run: mvn -B -Dskip.unit.tests=false surefire:test
- name: Build Docker images
env:
TAG: dev
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/main-otc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Build, Test, and Deploy otc (PRD env) services for specific partner
name: Build, Test, and Deploy otc (PRD env) services for specific partner
on:
# push:
# branches:
# - main
# push:
# branches:
# - main

workflow_dispatch:
inputs:
Expand All @@ -14,7 +14,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ 17 ]
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
echo "password=$server_pass" >> $GITHUB_OUTPUT

- name: Build
run: |
run: |
mvn -pl common -am -B -T 1C clean install -Potc
mvn -pl wallet,bc-gateway -amd -B -T 1C clean install -Potc

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ 21 ]
Expand All @@ -21,7 +21,7 @@ jobs:
distribution: 'adopt'
java-package: jdk
java-version: ${{ matrix.java }}
# cache: maven
# cache: maven
- name: Build
run: mvn -B -T 1C clean install
- name: Run Tests
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ 21 ]
Expand All @@ -20,11 +20,11 @@ jobs:
distribution: 'adopt'
java-package: jdk
java-version: ${{ matrix.java }}
# cache: maven
# cache: maven
- name: Build
run: mvn -B -T 1C clean install -Potc
run: mvn -B clean install -Potc
- name: Run Tests
run: mvn -B -T 1C -Dskip.unit.tests=false surefire:test
run: mvn -B -Dskip.unit.tests=false surefire:test
- name: Build Docker images
env:
TAG: pr
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ on:
# branches:
# - dev
workflow_dispatch:

# inputs:
# partner_name:
# type: string
# description: 'The name of the partner (provided during workflow execution)'
# required: true
# default: default
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ 17 ]
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ KEYCLOAK_FRONTEND_URL=http://localhost:8083/auth
KEYCLOAK_ADMIN_URL=http://localhost:8083/auth
KEYCLOAK_VERIFY_REDIRECT_URL=http://localhost:8080/verify
KEYCLOAK_FORGOT_REDIRECT_URL=http://localhost:8080/forgot
PREFERENCES=preferences-demo.yml
WHITELIST_REGISTER_ENABLED=true
WHITELIST_LOGIN_ENABLED=true
WALLET_BACKUP_ENABLED=false
Expand All @@ -80,7 +79,6 @@ TAG=debug
| SMTP_PASS | SMTP password used by keycloak to send emails for various operations (e.g. user verification, reset password) |
| API_KEY_CLIENT_SECRET | In order to access the api key feature, please follow the steps below:</br>1. Go to Keycloak admin panel located at http://localhost:8083/auth/admin/master/console/#/realms/opex/clients <br/>2. Login with the username and password you provided in the `.env` file (KEYCLOAK_ADMIN_USERNAME and KEYCLOAK_ADMIN_PASSWORD)<br/>3. Go to `clients` section on the left menu </br>4. Click on `opex-api-key` client </br>5. In the credentials section, click on `Regenerate Secret` button </br>6. Copy the generated secret and paste it into this section |
| KEYCLOAK_FRONTEND_URL<br/>KEYCLOAK_ADMIN_URL<br/>KEYCLOAK_VERIFY_REDIRECT_URL<br/>KEYCLOAK_FORGOT_REDIRECT_URL | Replace `localhost` with your server's IP if you're not running on local machine. Do not change the rest. |
| PREFERENCES | Points to a file containing seed data used to by modules to initialize their databases. An example of this file is provided and is available inside the root directory (preferences-demo.yml). It's deprecated and will be removed soon |
| WHITELIST_REGISTER_ENABLED | Allows registration only for whitelisted emails |
| WHITELIST_LOGIN_ENABLED | Allows login only for whitelisted emails |
| WALLET_BACKUP_ENABLED | Enables wallet data backup to google drive folder. In order to use this feature, you need to have `drive-key.json` file (obtained from google drive API panel) in the root directory of project |
Expand Down
6 changes: 1 addition & 5 deletions accountant/accountant-app/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -64,10 +64,6 @@
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>co.nilin.opex.utility</groupId>
<artifactId>preferences</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package co.nilin.opex.accountant.app

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.context.properties.ConfigurationPropertiesScan
import org.springframework.boot.runApplication
import org.springframework.context.annotation.ComponentScan

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package co.nilin.opex.accountant.app.config

import co.nilin.opex.accountant.app.listener.*
import co.nilin.opex.accountant.app.listener.AccountantEventListener
import co.nilin.opex.accountant.app.listener.AccountantTempEventListener
import co.nilin.opex.accountant.app.listener.AccountantTradeListener
import co.nilin.opex.accountant.app.listener.OrderListener
import co.nilin.opex.accountant.core.api.FeeCalculator
import co.nilin.opex.accountant.core.api.FinancialActionJobManager
import co.nilin.opex.accountant.core.api.OrderManager
Expand All @@ -14,10 +10,6 @@ import co.nilin.opex.accountant.core.service.OrderManagerImpl
import co.nilin.opex.accountant.core.service.TradeManagerImpl
import co.nilin.opex.accountant.core.spi.*
import co.nilin.opex.accountant.ports.kafka.listener.consumer.*
import co.nilin.opex.accountant.ports.kafka.listener.consumer.EventKafkaListener
import co.nilin.opex.accountant.ports.kafka.listener.consumer.OrderKafkaListener
import co.nilin.opex.accountant.ports.kafka.listener.consumer.TempEventKafkaListener
import co.nilin.opex.accountant.ports.kafka.listener.consumer.TradeKafkaListener
import co.nilin.opex.accountant.ports.kafka.listener.spi.FAResponseListener
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Bean
Expand Down Expand Up @@ -147,7 +139,8 @@ class AppConfig {
@Autowired
fun configureTempEventListener(
tempEventKafkaListener: TempEventKafkaListener,
accountantTempEventListener: AccountantTempEventListener) {
accountantTempEventListener: AccountantTempEventListener
) {
tempEventKafkaListener.addListener(accountantTempEventListener)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,61 +1,18 @@
package co.nilin.opex.accountant.app.config

import co.nilin.opex.accountant.ports.postgres.dao.PairConfigRepository
import co.nilin.opex.accountant.ports.postgres.dao.PairFeeConfigRepository
import co.nilin.opex.accountant.ports.postgres.dao.UserLevelRepository
import co.nilin.opex.accountant.ports.postgres.model.PairFeeConfigModel
import co.nilin.opex.utility.preferences.Preferences
import kotlinx.coroutines.reactor.awaitSingleOrNull
import kotlinx.coroutines.runBlocking
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.DependsOn
import org.springframework.stereotype.Component
import javax.annotation.PostConstruct

@Component
@DependsOn("postgresConfig")
class InitializeService(
private val pairConfigRepository: PairConfigRepository,
private val pairFeeConfigRepository: PairFeeConfigRepository,
private val userLevelRepository: UserLevelRepository,
) {

@Autowired
private lateinit var preferences: Preferences
class InitializeService{

@PostConstruct
fun init() = runBlocking {
preferences.userLevels.forEach {
userLevelRepository.insert(it).awaitSingleOrNull()
}

preferences.markets.map {
val pair = it.pair ?: "${it.leftSide}_${it.rightSide}"
val leftSideCurrency = preferences.currencies.first { c -> it.leftSide == c.symbol }
val rightSideCurrency = preferences.currencies.first { c -> it.rightSide == c.symbol }
val leftSideFraction = (it.leftSideFraction ?: leftSideCurrency.precision)
val rightSideFraction = (it.rightSideFraction ?: rightSideCurrency.precision)
pairConfigRepository.insert(
pair,
it.leftSide,
it.rightSide,
leftSideFraction,
rightSideFraction
).awaitSingleOrNull()
it.feeConfigs.forEach { f ->
runCatching {
pairFeeConfigRepository.save(
PairFeeConfigModel(
null,
pair,
f.direction,
f.userLevel,
f.makerFee,
f.takerFee
)
).awaitSingleOrNull()
}
}
}
// addUserLevels()
// addPairConfigs()
// addPairFeeConfigs
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package co.nilin.opex.accountant.app.config

import org.springframework.context.annotation.Bean
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity
import org.springframework.security.config.web.server.ServerHttpSecurity
import org.springframework.security.web.server.SecurityWebFilterChain

@EnableWebFluxSecurity
class SecurityConfig {

@Bean
fun springSecurityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
http.csrf().disable()
.authorizeExchange()
.anyExchange().permitAll()
return http.build()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package co.nilin.opex.accountant.app.data
import java.math.BigDecimal

data class PairFeeResponse(
val pair:String,
val pair: String,
val direction: String,
val userLevel: String,
val makerFee: BigDecimal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package co.nilin.opex.accountant.app.listener
import co.nilin.opex.accountant.core.inout.KycLevelUpdatedEvent
import co.nilin.opex.accountant.ports.kafka.listener.spi.KycLevelUpdatedEventListener
import co.nilin.opex.accountant.ports.postgres.impl.UserLevelLoaderImpl
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Component
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Component

@Component
class KycLevelUpdatedListener(val userLevelLoaderImpl: UserLevelLoaderImpl) : KycLevelUpdatedEventListener {
Expand All @@ -18,8 +18,10 @@ class KycLevelUpdatedListener(val userLevelLoaderImpl: UserLevelLoaderImpl) : Ky
return "KycLevelUpdatedListener"
}

override fun onEvent(event: KycLevelUpdatedEvent,
partition: Int, offset: Long, timestamp: Long, eventId: String) {
override fun onEvent(
event: KycLevelUpdatedEvent,
partition: Int, offset: Long, timestamp: Long, eventId: String
) {
logger.info("==========================================================================")
logger.info("Incoming UserLevelUpdated event: $event")
logger.info("==========================================================================")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ management:
web:
base-path: /actuator
exposure:
include: ["health", "metrics"]
include: [ "health", "metrics" ]
endpoint:
health:
show-details: always
Expand Down
2 changes: 1 addition & 1 deletion accountant/accountant-core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading
Loading