dfinity / nns-dapp

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

Default icrc canisters store #5383

Closed mstrasinskis closed 2 months ago

mstrasinskis commented 2 months ago

Motivation

We need to make the NNS-dapp treat imported tokens as ICRC tokens, just as it does with the current tokens, since imported tokens follow the ICRC standard. The only differences are that the index canister is optional (and the nns-dapp already handles this), and they are added by the user.

Note: This PR includes a solution suggested in another approach PR.

Changes

  1. Rename icrcCanistersStore to defaultIcrcCanistersStore.
  2. Introduce a new derived store that contains both the current ICRC canister IDs and imported token IDs, and give this store the old name icrcCanistersStore.
  3. Adjust the NNS-dapp code so that it reads the canister IDs from the derived store and writes to the renamed defaultIcrcCanistersStore.

Tests

Todos