Updated on 2026-08-14
This commit is contained in:
parent
3c80a53254
commit
5514e3a195
7 changed files with 48 additions and 22 deletions
|
|
@ -76,18 +76,22 @@ internal class DefaultYieldSupplyRepository(
|
|||
(walletManager as? YieldSupplyProvider)?.isSupported() ?: false
|
||||
}
|
||||
|
||||
override suspend fun activateProtocol(cryptoCurrencyToken: CryptoCurrency.Token, address: String): Boolean =
|
||||
withContext(dispatchers.io) {
|
||||
val chainId = Blockchain.fromNetworkId(cryptoCurrencyToken.network.backendId)?.getChainId()
|
||||
?: error("Chain id is required for evm's")
|
||||
yieldSupplyApi.activateYieldModule(
|
||||
YieldSupplyChangeTokenStatusBody(
|
||||
tokenAddress = cryptoCurrencyToken.contractAddress,
|
||||
chainId = chainId,
|
||||
userAddress = address,
|
||||
),
|
||||
).getOrThrow().isActive
|
||||
}
|
||||
override suspend fun activateProtocol(
|
||||
userWalletId: UserWalletId,
|
||||
cryptoCurrencyToken: CryptoCurrency.Token,
|
||||
address: String,
|
||||
): Boolean = withContext(dispatchers.io) {
|
||||
val chainId = Blockchain.fromNetworkId(cryptoCurrencyToken.network.backendId)?.getChainId()
|
||||
?: error("Chain id is required for evm's")
|
||||
yieldSupplyApi.activateYieldModule(
|
||||
body = YieldSupplyChangeTokenStatusBody(
|
||||
tokenAddress = cryptoCurrencyToken.contractAddress,
|
||||
chainId = chainId,
|
||||
userAddress = address,
|
||||
),
|
||||
userWalletId = userWalletId.stringValue,
|
||||
).getOrThrow().isActive
|
||||
}
|
||||
|
||||
override suspend fun deactivateProtocol(cryptoCurrencyToken: CryptoCurrency.Token, address: String): Boolean =
|
||||
withContext(dispatchers.io) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue