1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
metamask-extension/ui/pages/import-token
Niranjana Binoy 6e5c2f03bf
Token detection V2 Flag Removal and Re-introducing the use of legacy token list when token detection is OFF (#15138)
* addding the legacy tokenlist, tuning token detection OFF by default, adding new message while importing tokens

updating the controller version and calling detectNewToken on network change

fixing rebase error

Run yarn lavamoat:auto for updating policies

updating lavamoat

Deleted node modules and run again lavamoat auto

fixing rebase issues

updating lavamoat policies

updating lavamoat after rebasing

policies

updating custom token warning and blocking detectedtoken link when tpken detection is off for supported networks

to update the token in fetchTosync

updating the contract map object

Revert build-system lavamoat policy changes

Move token list selection logic from components to getTokenList selector

updating the tokenList

Update lavamoat

Fix error

updating lavamoat

lint fix

fix unit test fail

fix unit test fail

lint fix

fixing rebase locale error

rebase fix

Revert build-system policy changes

temp

addressing review comments

* rebase fix
2022-08-09 22:56:25 -02:30
..
token-list Token detection V2 Flag Removal and Re-introducing the use of legacy token list when token detection is OFF (#15138) 2022-08-09 22:56:25 -02:30
token-search Move search icon and add to storybook (#14940) 2022-06-21 10:18:35 -05:00
import-token.component.js Token detection V2 Flag Removal and Re-introducing the use of legacy token list when token detection is OFF (#15138) 2022-08-09 22:56:25 -02:30
import-token.container.js Token detection V2 Flag Removal and Re-introducing the use of legacy token list when token detection is OFF (#15138) 2022-08-09 22:56:25 -02:30
import-token.stories.js Change over ImportToken stories to use controls instead of knobs, update props in stories (#14246) 2022-03-29 15:20:19 -07:00
import-token.test.js Token detection V2 Flag Removal and Re-introducing the use of legacy token list when token detection is OFF (#15138) 2022-08-09 22:56:25 -02:30
index.js Adding fake token warning and replacing Add Token labels with Import Tokens (#11798) 2021-09-10 16:21:04 -04:00
index.scss Enable Token search functionality on supported networks (#14034) 2022-03-31 09:48:05 -04:00
README.mdx Updating content to sentence case and updating tests (#15285) 2022-08-08 12:01:38 -07:00

import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';

import ImportToken from './import-token.component';

import testData from '../../../.storybook/test-data';
import configureStore from '../../store/store';
const store = configureStore(testData);
const { metamask } = store.getState();

export const PersonalAddress = () => <code>{metamask.selectedAddress}</code>;

# ImportToken

The `ImportToken` component allows a user to import custom tokens in one of two ways:

1. By searching for one
2. By importing one by `Token Contract Address`

<Canvas>
  <Story id="ui-pages-import-token-import-token-stories-js--default-story" />
</Canvas>

## Example inputs

An example input that works, to enable the `Add custom token` button is `0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`.

### Personal address error

To show the personal address detected error, input the address <PersonalAddress/> in the `Token Contract Address` field.

## Props

<ArgsTable of={ImportToken} />