-
-
Notifications
You must be signed in to change notification settings - Fork 251
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(suite-native): Send Custom Fee #15364
base: develop
Are you sure you want to change the base?
Conversation
🚀 Expo preview is ready!
|
1e87211
to
98eb80e
Compare
98eb80e
to
2174dd8
Compare
onClose(); | ||
}); | ||
|
||
const animatedButtonContainerStyle = useAnimatedStyle( |
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 think you might want to use this https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#linear-transition
It should work better and it should also add some nice animation when that error box is diplayed
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.
The layout linear transition works good for calculating animation of the component wrappen in the Animated.View. But I decided to use this kind of height transformation, because it also nicely resizes the whole bottomSheet (wrapper of the content) without doing any nasty layout jumps. If you have some better solution to address this issue, I will be happy to fix 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.
Checked, not tested on real device also I don't know much about how fees works
</HStack> | ||
</VStack> | ||
<HStack flex={1} justifyContent="space-between"> | ||
<Box flex={1 / 3}> |
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 think if you use just 1 and later 2 it will work same from what I know about flexbox
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.
const mockedFee = transactionBytes * Number(feePerUnit); | ||
const mockedTotalAmount = mockedFee + (Number(normalFee.totalSpent) - Number(normalFee.fee)); | ||
const isSubmittable = selectedFeeLevelTransaction.type === 'final'; | ||
const mockedFee = BigNumber(transactionBytes) |
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.
Can we memo these BigNumber operations? They are usually quite slow
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.
|
||
// TODO: estimate do not work for error state EtH | ||
// If the trezor-connect is unable to compose the transaction, we display rough estimate of the fee instead. | ||
const feeEstimate = watchedFeePerUnit |
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.
can we memo this?
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.
|
||
if (!networkFeeInfo) return false; | ||
|
||
const feeBig = new BigNumber(value); |
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.
It is necessary to have BN here? How does numbers looks like?
I guess this validation runs with every change of form so it should be super quick.
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.
you are right, no need for BN here 61136b9
state: NativeSendRootState, | ||
): GeneralPrecomposedTransaction | undefined => state.wallet.send.feeLevels.custom; | ||
|
||
export const selectFeeLevelTransactionBytes = ( |
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.
use memoize, especially if you use BN
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.
Description
Related Issue
Resolve #15180
Screenshots:
BTC
Screen.Recording.2024-11-13.at.9.57.12.mov
BTC - Send Max
Screen.Recording.2024-11-13.at.10.40.24.mov
ETH
Screen.Recording.2024-11-13.at.10.39.37.mov