Skip to content

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.

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.

3 participants