-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
112 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/api/admin/domain/transferFailLog/TransferFailLog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.api.admin.domain.transferFailLog | ||
|
||
import org.springframework.data.annotation.Id | ||
import org.springframework.data.relational.core.mapping.Table | ||
import java.sql.Timestamp | ||
|
||
@Table("transfer_fail_log") | ||
data class TransferFailLog( | ||
@Id val id: Long? = null, | ||
val wallet: String, | ||
val timestamp: Long? = System.currentTimeMillis(), | ||
val transactionHash: String?, | ||
val errorMessage: String, | ||
) |
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/api/admin/domain/transferFailLog/TransferFailLogRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.api.admin.domain.transferFailLog | ||
|
||
import org.springframework.data.repository.reactive.ReactiveCrudRepository | ||
|
||
interface TransferFailLogRepository: ReactiveCrudRepository<TransferFailLog,Long> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,7 @@ enum class TokenType { | |
MATIC, ETH | ||
} | ||
|
||
|
||
enum class TransactionStatus { | ||
SUCCESS, FAILURE | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/kotlin/com/api/admin/service/TransferFailLogService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.api.admin.service | ||
|
||
import com.api.admin.domain.transferFailLog.TransferFailLog | ||
import com.api.admin.domain.transferFailLog.TransferFailLogRepository | ||
import org.springframework.stereotype.Service | ||
import reactor.core.publisher.Mono | ||
|
||
@Service | ||
class TransferFailLogService( | ||
private val transferFailLogRepository: TransferFailLogRepository, | ||
) { | ||
|
||
fun save(wallet: String, transactionHash: String?, message: String): Mono<Void> { | ||
return transferFailLogRepository.save( | ||
TransferFailLog( | ||
wallet = wallet, | ||
transactionHash = transactionHash, | ||
errorMessage = message | ||
) | ||
).doOnSuccess { | ||
|
||
}.then() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
package com.api.admin.util | ||
|
||
import com.api.admin.enums.ChainType | ||
|
||
object Util { | ||
fun getChainId(chain: ChainType): Long { | ||
val chain = when (chain) { | ||
ChainType.ETHEREUM_MAINNET -> 1L | ||
ChainType.POLYGON_MAINNET -> 137L | ||
ChainType.LINEA_MAINNET -> 59144L | ||
ChainType.LINEA_SEPOLIA -> 59140L | ||
ChainType.ETHEREUM_HOLESKY -> 1L | ||
ChainType.ETHEREUM_SEPOLIA -> 11155111L | ||
ChainType.POLYGON_AMOY -> 80002L | ||
} | ||
return chain | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters