-
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: add cancel transaction, ref #LEA-958 #5920
Conversation
src/app/components/stacks-transaction-item/stacks-transaction-action-menu.tsx
Outdated
Show resolved
Hide resolved
5d797f7
to
3c88737
Compare
if (!transaction) return; | ||
|
||
const routeUrl = RouteUrls.IncreaseStxFee.replace(':txid', transaction.tx_id); | ||
const routeUrl = | ||
action === 'increaseFee' |
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.
Maybe pull this out as a defined type and use increase-fee
?
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.
added enum
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.
👍
@314159265359879 could you test this build please |
@pete-watters yeah, as I understand you need to increase fee a bit to cancel tx |
Thanks for this @alter-eggo For context, STX transfers don't usually need a higher fee to get included in a block (unlike some contract calls and contract deployments) they require very little of the "block space". With the change above. I opt to remove "A higher fee can help replace the old transaction." from the explainer. Because in most cases we'll set the right fee (just 0.000001 STX more then current). Leaving it in there may make users think that they have to set a much higher fee, which is not actually the case. There is always still a chance the old transaction gets processed anyway, because it reaches a miner first or before it is replaced by the new transaction with the higher fee. "To cancel the transaction we replace it with a minimal STX transfer." Could be a good add here so users are not surprised that the "cancelled" transaction goes away and a small STX transfer is displayed in its place. I think this is out of scope now: Later we can create an enhancement to label the transaction differently (based on the memo) used in the cancel transaction. "Pending Cancellation" instead of the normal "Pending". |
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.
See comments above.
3c88737
to
53a7e31
Compare
thanks @314159265359879 fixed 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.
Looking great!
This pr adds option to cancel stx transaction, also adds tests for increase and cancel stx transaction
@Aman-zishan thanks a lot for your work on this