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

feat: unify internal transfer transactions #1456

Merged
merged 4 commits into from
Dec 30, 2024
Merged

Conversation

euharrison
Copy link
Collaborator

Create the hook useTransfer which can be used to any Namada(internal) transfer transaction (not ibc, maybe yet?).

Then, apply it to the <NamadaTransfer>, <MaspShield> and <MaspUnshield>.

Please note that this is the first step for #1297 as the notification implementation for Transfer and Masp page will be the same now, but they both still has some notification issues that should be handled in a different PR focused on the notification systems, not the sdk transaction

@euharrison euharrison changed the title feat: unify transfer transactions feat: unify internal transfer transactions Dec 30, 2024
Copy link
Collaborator

@pedrorezende pedrorezende left a comment

Choose a reason for hiding this comment

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

Awesome PR!!! 🚀 Super neat!

);

// Currently we don't have the option of batching transfer transactions
if (txList.length === 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: let's prefer the use of the invariant? :)

} catch (err) {
setGeneralErrorMessage(err + "");
setCurrentStepIndex(0);
setTransaction(undefined);
Copy link
Collaborator

Choose a reason for hiding this comment

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

After talking to @ChrisHoltDesign we won't have the timeline active on the "Signing" anymore, which simplifies A LOT of things. Maybe you can redirect directly to the transactions page after the storeTransaction just like I did on #1454 - we can do it in a later PR too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, this is a copy and paste from that you implemented 😁

I'll open a new PR focused on the Timeline 👍

throw new Error("No gas config");
}
invariant(sourceAddress, "Source address is not defined");
invariant(chainId, "Chain ID is undefined");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe, just maybe, we could use a function to validate these variables here? We're repeating this validation multiple times

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I agree, some variables on the begin of the component as well. I'll explore this more on the next PRs

@euharrison
Copy link
Collaborator Author

I'll merge it and address the comments in the next PR :)

@euharrison euharrison merged commit d7a75e3 into main Dec 30, 2024
10 checks passed
@euharrison euharrison deleted the feat/shield-notifications branch December 30, 2024 20:38
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.

2 participants