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: init ICP index canister in ledger-icp and add account balance function #459

Merged
merged 10 commits into from
Nov 6, 2023

Conversation

peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Nov 6, 2023

Motivation

Add support for ICP index canister in @dfinity/ledger-icp.

Notes

The ledger and the index canisters providing both a way to fetch the balance, the idea is to use the same function name and same parameters in both canister JS code.

Changes

  • add did file to import candid and generate idl scripts
  • init IndexCanister
  • implement accountBalance function for the new canister
  • refactor type AccountIdentifier to AccountIdentiferHex to avoid conflicts
  • refactor Ledger.accountBalance params to support account identifier as hex or class

Copy link
Contributor

github-actions bot commented Nov 6, 2023

size-limit report 📦

Path Size
@dfinity/ckbtc 6.79 KB (0%)
@dfinity/cmc 1.01 KB (0%)
@dfinity/ledger-icrc 2.92 KB (0%)
@dfinity/ledger-icp 14.32 KB (+1.07% 🔺)
@dfinity/nns 33.78 KB (+0.06% 🔺)
@dfinity/nns-proto 76.3 KB (0%)
@dfinity/sns 14.91 KB (0%)
@dfinity/utils 3.81 KB (0%)
@dfinity/ic-management 1.94 KB (0%)

Copy link
Contributor

@lmuntaner lmuntaner left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@peterpeterparker peterpeterparker merged commit 01b692e into main Nov 6, 2023
10 checks passed
@peterpeterparker peterpeterparker deleted the feat/icp-index branch November 6, 2023 08:29
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.

None yet

2 participants