-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TW-683: Assets rework. Tokens. + Whitelist
- Loading branch information
Showing
39 changed files
with
409 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
- Migrate IndexDB tokens into Redux | ||
- `token.metadata.null` | ||
- No-cycle lint rule | ||
- `export { dispatch } from 'app/store';` | ||
- `export { useSelector, dispatch } from 'app/store';` | ||
- Whitelisted tokens to Redux store | ||
- Minimize persisted data | ||
- Refactor `lib/assets/hooks` | ||
- `useSlugsOf` | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
import { createAction } from '@reduxjs/toolkit'; | ||
|
||
import { WhitelistResponseToken } from 'lib/apis/temple'; | ||
import { createActions } from 'lib/store'; | ||
|
||
import { StorredToken } from './state'; | ||
import { StoredAssetStatus, StoredToken } from './state'; | ||
|
||
interface LoadTokensPayload { | ||
/** PKH */ | ||
account: string; | ||
chainId: string; | ||
} | ||
|
||
export const loadAccountTokensActions = createActions< | ||
{ account: string; chainId: string }, | ||
{ account: string; chainId: string; slugs: string[] }, | ||
LoadTokensPayload, | ||
LoadTokensPayload & { slugs: string[] }, | ||
{ code?: number } | ||
>('assets/LOAD_ACCOUNT_TOKENS'); | ||
|
||
type TokenStatusAlterPayload = Pick<StorredToken, 'account' | 'chainId' | 'slug'>; | ||
type LoadWhitelistPayload = WhitelistResponseToken[]; | ||
|
||
export const loadTokensWhitelistActions = createActions<void, LoadWhitelistPayload, { code?: number }>( | ||
'assets/LOAD_TOKENS_WHITELIST' | ||
); | ||
|
||
export const setTokenStatusToRemovedAction = createAction<TokenStatusAlterPayload>('assets/SET_TOKEN_REMOVED'); | ||
interface SetTokenStatusPayload extends Pick<StoredToken, 'account' | 'chainId' | 'slug'> { | ||
status: StoredAssetStatus; | ||
} | ||
|
||
export const toggleTokenStatusAction = createAction<TokenStatusAlterPayload>('assets/TOGGLE_TOKEN_STATUS'); | ||
export const setTokenStatusAction = createAction<SetTokenStatusPayload>('assets/SET_TOKEN_STATUS'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.