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
Make indexCanisterId optional in IcrcCanistersStore.
Add imported tokens to IcrcCanistersStore after loading them.
Tests
Unit test that the icrsStore was populated after imported tokens loading.
Other parts were tested manually:
The existence of the work-around suggests that not specifying an index canister already works.
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
IcrcCanistersStore
.IcrcCanistersStore
after loading them.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.
Index canister is not used in GetTokensModal.
The index canister is not used in the logic of derived stores that uses icrcStore:
icrc-universes.derived
selectable-universe.derived
selected-universe.derived store
Todos