Skip to content
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

Merged
merged 4 commits into from
Oct 31, 2024
Merged

Add custom token to Solana #1251

merged 4 commits into from
Oct 31, 2024

Conversation

aminsato
Copy link
Contributor

Fix #1196

@aminsato aminsato requested review from yevhen1sec, yvebe and johnnyluo and removed request for yevhen1sec October 29, 2024 04:10
@@ -50,6 +53,7 @@ internal data class ChainTokensUiModel(
val canSelectTokens: Boolean = false,
val isBalanceVisible: Boolean = true,
val isBuyWeweVisible: Boolean = false,
val enableCustomToken: Boolean = false,
Copy link
Collaborator

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

Copy link
Contributor Author

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
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 167 to 177
fun openCustomTokenScreen() {
viewModelScope.launch {
navigator.navigate(
Destination.CustomToken(
chainId = chainRaw
)
)
val searchedCoin = requestResultRepository.request<Coin>(REQUEST_SEARCHED_TOKEN_ID)
vaultRepository.addTokenToVault(vaultId, searchedCoin)
}
}
Copy link
Collaborator

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

Copy link
Contributor Author

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"
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 27 to 35
Chain.Ethereum -> tokenRepository
.getTokenByContract(
chainId, contractAddress
)

Chain.Solana -> splTokenRepository
.getTokenByContract(contractAddress)

else -> null
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@aminsato aminsato force-pushed the feat/add-custom-token-to-solana branch 3 times, most recently from 9a1fa25 to fc56ba1 Compare October 31, 2024 02:40
@aminsato aminsato force-pushed the feat/add-custom-token-to-solana branch from fc56ba1 to 1c48d70 Compare October 31, 2024 02:41
@aminsato aminsato requested a review from yvebe October 31, 2024 06:28
@yvebe yvebe merged commit 54969d2 into main Oct 31, 2024
1 check passed
@yvebe yvebe deleted the feat/add-custom-token-to-solana branch October 31, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ADD] Custom token support for SOL
2 participants