-
Notifications
You must be signed in to change notification settings - Fork 146
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
feat: sbtc token support #6014
feat: sbtc token support #6014
Conversation
We would only need to add 'mainnet' to the wallet config to show the promo card. |
const network = useCurrentNetwork(); | ||
|
||
return useMemo(() => { | ||
const displayPromoCardOnNetworks = (sbtc as any)?.showPromoLinkOnNetworks ?? []; |
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.
Do we have to cast as any? I made a comment I deleted thinking this was for all config properties, but I see below we can have some type safety on sbtc.enabled
- would love to see that here too for refactorability and not surprising ourselves with small avoidable bugs in the future.
@@ -70,11 +70,11 @@ function useCreateSwapAsset(address: string) { | |||
...swapAsset, | |||
balance: availableBalance ?? createMoney(0, token.symbol, token.tokenDecimals), | |||
marketData: availableBalance | |||
? priceAsMarketData(swapAsset.principal, availableBalance.symbol) | |||
: priceAsMarketData(swapAsset.principal, token.symbol), | |||
? getTokenMarketData(swapAsset.principal, availableBalance.symbol) |
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.
Aren't token.symbol
and availableBlance.symbol
the same? Thinking that because of this logic:
const availableBalance = sip10Tokens.find(
sip10Token => getPrincipalFromContractId(sip10Token.info.contractId) === token.tokenContract
)?.balance.availableBalance;
Where the contract info is matched on the token.tokenContract
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.
Left a couple comments, nothing major - approving to help move things along but feel free to wait for a more qualified teammate 😁
Closing in favor of feature branch #5991 |
This PR separates out some of the initial work for sBTC support:
cc @kyranjamie as this was mostly your work