dfinity / nns-dapp

The Dapp of the Internet Computer's Network Nervous System.
https://nns.ic0.app/
Other
110 stars 37 forks source link

Populate icrc store with imported tokens #5378

Open mstrasinskis opened 2 weeks ago

mstrasinskis commented 2 weeks ago

Motivation

The imported tokens are ICRC tokens. The only new difference is that the index canister is optional. To make the NNS-dapp work with them, the only change needed is to modify the ICRC store to support entries without the index canister (here).

Once the ICRC store supports tokens without an index canister, we can add imported tokens to the ICRC store, and they will be displayed in the tokens table and on the wallet page.

Changes

Tests

The existence of the work-around suggests that not specifying an index canister already works.

The index canister is optional in IcrcWallet.

The transaction list is now shown when no index canister.

{#if nonNullish($selectedAccountStore.account) && nonNullish($selectedIcrcTokenUniverseIdStore) && nonNullish(indexCanisterId)}
  <IcrcWalletTransactionsList

Index canister is not used in GetTokensModal.

The index canister is not used in the logic of derived stores that uses icrcStore:

Todos