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: 🎸 migrated balance_of to v2 #547

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

damfinkel
Copy link
Collaborator

Why?

Migration of the balanceOf method used to see if there's assets to withdraw migrated to v2.

How?

  • Migrated balanceOf to getMyBalance (jelly v2)
  • Updated @dfinity/Principal library to match JellyJS's

Contribution checklist?

  • The commit messages are detailed
  • It does not break existing features (unless required)
  • I have performed a self-review of my own code
  • Documentation has been updated to reflect the changes
  • Tests have been added or updated to reflect the changes
  • All code formatting pass
  • All lints pass

Demo?

There was a console error saying that balanceOf was not an existing method for the canister. The error is gone now.

@@ -16,7 +17,9 @@ import { useAssetsToWithdraw } from '../../hooks/use-assets-to-withdraw';
export const Alerts = () => {
const { t } = useTranslation();

useAssetsToWithdraw();
const { collectionId } = useParams();
Copy link
Contributor

@prasanthLalapeta prasanthLalapeta Sep 16, 2022

Choose a reason for hiding this comment

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

Are we sure about this one ?

I think collectionId will be always undefined here, Because component is not under <Routes>...</Routes> in App.tsx

const jellyCollection: JellyCollection =
await jellyInstance.getJellyCollection(collection);

const balanceResponse = await jellyCollection.getMyBalance();
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can rename getMyBalance method to getAssetsToWithdraw. Because getMyBalance is something reminds me of plugBalance at 1st glance.

Yeah just think about this. And feel free to proceed if you are ok. Thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I like that suggestion. I'll change it in JellyJS and come back to this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

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