-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from OpenFuturePlatform/interoperability
Added new methods for noncustodial wallet import
- Loading branch information
Showing
38 changed files
with
346 additions
and
164 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
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
8 changes: 5 additions & 3 deletions
8
src/main/kotlin/io/openfuture/state/config/EthereumTestConfig.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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
package io.openfuture.state.config | ||
|
||
import io.openfuture.state.property.EthereumTestProperties | ||
import io.openfuture.state.property.EthereumAlchemyTestnetProperties | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.web3j.protocol.Web3j | ||
import org.web3j.protocol.http.HttpService | ||
|
||
@Configuration | ||
class EthereumTestConfig { | ||
|
||
@Bean | ||
fun web3jTest(ethereumTestProperties: EthereumTestProperties): Web3j { | ||
return Web3j.build(HttpService(ethereumTestProperties.nodeAddress)) | ||
fun web3jTest(ethereumAlchemyTestnetProperties: EthereumAlchemyTestnetProperties): Web3j { | ||
return Web3j.build(HttpService(ethereumAlchemyTestnetProperties.address)) | ||
} | ||
|
||
} |
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
35 changes: 35 additions & 0 deletions
35
src/main/kotlin/io/openfuture/state/controller/WalletControllerV2.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,35 @@ | ||
package io.openfuture.state.controller | ||
|
||
import io.openfuture.state.service.WalletService | ||
import io.openfuture.state.service.dto.AddWatchResponse | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.RequestBody | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
@RestController | ||
@RequestMapping("/api/wallets/v2/") | ||
class WalletControllerV2( | ||
private val walletService: WalletService | ||
) { | ||
|
||
@PostMapping("add") | ||
suspend fun addWallet(@RequestBody request: AddWalletStateForUserRequest): AddWatchResponse { | ||
return walletService.addWallet(request) | ||
} | ||
|
||
} | ||
|
||
data class AddWalletStateForUserRequest( | ||
val webhook: String, | ||
val blockchains: ArrayList<BlockChain>, | ||
val applicationId: String, | ||
val userId: String, | ||
val test: Boolean, | ||
val metadata: Any? | ||
) | ||
|
||
data class BlockChain( | ||
val address: String, | ||
val blockchain: String | ||
) |
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
17 changes: 12 additions & 5 deletions
17
src/main/kotlin/io/openfuture/state/domain/WalletPaymentDetail.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 |
---|---|---|
@@ -1,10 +1,17 @@ | ||
package io.openfuture.state.domain | ||
|
||
import java.math.BigDecimal | ||
|
||
data class WalletPaymentDetail( | ||
var orderId: String, | ||
var orderKey: String, | ||
var amount: String, | ||
var productCurrency: String, | ||
var source: String, | ||
val paymentCurrency: String | ||
var amount: BigDecimal, | ||
var totalPaid: BigDecimal = BigDecimal.ZERO, | ||
var currency: String, | ||
val blockchains: List<BlockchainWallets> | ||
) | ||
|
||
data class BlockchainWallets( | ||
val address: String, | ||
val blockchain: String, | ||
val rate: BigDecimal | ||
) |
Oops, something went wrong.