-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom token to Solana #1251
Conversation
@@ -50,6 +53,7 @@ internal data class ChainTokensUiModel( | |||
val canSelectTokens: Boolean = false, | |||
val isBalanceVisible: Boolean = true, | |||
val isBuyWeweVisible: Boolean = false, | |||
val enableCustomToken: Boolean = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would you add a new parameter and a view for that? we have canSelectTokens field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
val uiState = MutableStateFlow(ChainTokensUiModel()) | ||
val uiState = MutableStateFlow( | ||
ChainTokensUiModel( | ||
enableCustomToken = Chain.fromRaw(chainRaw) == Chain.Solana |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, there's already a mechanism for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
fun openCustomTokenScreen() { | ||
viewModelScope.launch { | ||
navigator.navigate( | ||
Destination.CustomToken( | ||
chainId = chainRaw | ||
) | ||
) | ||
val searchedCoin = requestResultRepository.request<Coin>(REQUEST_SEARCHED_TOKEN_ID) | ||
vaultRepository.addTokenToVault(vaultId, searchedCoin) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, all of this is already done by our old custom tokens screen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -89,6 +89,7 @@ internal class CoinGeckoApiImpl @Inject constructor( | |||
Chain.Optimism -> "optimistic-ethereum" | |||
Chain.BscChain -> "binance-smart-chain" | |||
Chain.ZkSync -> "zksync" | |||
Chain.Solana -> "solana" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check if this works with current main, because I turned off solana for coinGecko because of that. might need to be turned on again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Chain.Ethereum -> tokenRepository | ||
.getTokenByContract( | ||
chainId, contractAddress | ||
) | ||
|
||
Chain.Solana -> splTokenRepository | ||
.getTokenByContract(contractAddress) | ||
|
||
else -> null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we support more chains?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
9a1fa25
to
fc56ba1
Compare
fc56ba1
to
1c48d70
Compare
Fix #1196