nns-dapp
nns-dapp copied to clipboard
Basic Imported Tokens Modal
Motivation
We need to implement a modal for importing custom tokens. This modal will consist of two steps:
- Step 1: The user can enter a ledger canister ID and, optionally, an index canister ID.
- Step 2: After clicking the “Next” button, a review step will display the entered IDs and the token’s meta information. If the dapp fails to load the meta information, the user will remain on the first step and an error toast will be shown.
Note: This PR does not include index canister validation or saving the imported token in the NNS-dapp canister.
Import button (existed) | Step 1 | Step 2 |
---|---|---|
Changes
- New components:
-
ImportTokenModal
- step 1:
ImportTokenForm
- step 2:
ImportTokenReview
- step 1:
-
-
fetchIcrcTokenMetaData
service. - Open
ImportTokenModal
on "Import Token" button click.
Tests
- Manually agains localhost.
- Added unit tests for new components.
Todos
- [ ] Add entry to changelog (if necessary). Not yet.