-
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 integration #5991
feat: sbtc integration #5991
Conversation
ac141e6
to
190d197
Compare
Let's link to an issue on the board? |
I'll look for an issue. I just stepped in to take this over, so I'm not sure what issue it relates to specifically. I think we are just trying to get a POC working for the sBTC deposit tx, and then we can apply that to swaps UI. |
Just an update here, working branched off on adding all the stuff needed to the swaps UI while we wait on the sbtc pkg update. I think tracking all the changes needed to update the stacks.js pkgs with copying the code over will be quite a chunk of work, so stalling for the lib update from Hiro. I will circle back to tracking the updates if that lib doesn't move fwd in the next few days. |
sbtc pkg was updated, so I'll update here and hopefully remove copied code 🤞 https://www.npmjs.com/package/sbtc |
b9406bf
to
8530e51
Compare
Swaps UI draft here: #5997 |
a72120a
to
dff2e4f
Compare
src/app/pages/swap/components/swap-assets-pair/swap-asset-item.layout.tsx
Fixed
Show resolved
Hide resolved
As an update, currently stuck here and waiting for feedback... https://github.com/hirosystems/stacks.js/pull/1554/files#r1870157852 |
69a66fe
to
96fcbfe
Compare
@kyranjamie we seem to be using both |
useEffect(() => { | ||
// Clear quote amount if quote asset is reset | ||
if (isUndefined(values.swapAssetQuote)) { | ||
void setFieldValue('swapAmountQuote', ''); | ||
} | ||
}, [setFieldValue, values]); |
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.
I wonder if there are other ways we can do this. Seems kinda side effecty to have this component setting/updating state like this
src/app/pages/swap/components/swap-assets-pair/swap-assets-pair.tsx
Outdated
Show resolved
Hide resolved
src/app/pages/swap/components/swap-assets-pair/swap-assets-pair.tsx
Outdated
Show resolved
Hide resolved
const { balance } = useBtcCryptoAssetBalanceNativeSegwit(currentBitcoinAddress); | ||
const bitcoinMarketData = useCryptoCurrencyMarketDataMeanAverage('BTC'); | ||
|
||
return useCallback((): SwapAsset => { |
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.
Could be a useMemo?
85c4e68
to
7229768
Compare
bbabe49
to
c4c0b7a
Compare
c4c0b7a
to
d60d444
Compare
12d6e50
to
e618ccf
Compare
This PR ensures sBTC displays correctly, with market data.
There are several design variants I'm not entirely sure which we should go for. No icon for now because apparently there's a new one on the way.
I'm a bit uncertain how we should handle sBTC specific behaviour. Either we can treat is separately from other SIP-10s or, manipulate the data/events we pass to the SIP-10 components such that it displays/behaves as we expect. Trying to avoid lots of
if (symbol === 'sBTC')
-like code.