@pancakeswap/token-lists 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +22 -0
- package/CHANGELOG.md +9 -0
- package/dist/chunk-YBVZDUCZ.mjs +70 -0
- package/dist/getTokenList-T45DK2AY.mjs +455 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +99 -0
- package/dist/index.mjs +12 -0
- package/dist/react.d.ts +55 -0
- package/dist/react.js +781 -0
- package/dist/react.mjs +249 -0
- package/dist/types-b620c9be.d.ts +39 -0
- package/package.json +55 -0
- package/react/actions.ts +25 -0
- package/react/getTokenList.ts +46 -0
- package/react/index.ts +4 -0
- package/react/lists.ts +65 -0
- package/react/package.json +5 -0
- package/react/reducer.test.ts +543 -0
- package/react/reducer.ts +186 -0
- package/react/useFetchListCallback.ts +37 -0
- package/schema/pancakeswap.json +392 -0
- package/schema/uniswap.json +302 -0
- package/src/getVersionUpgrade.ts +33 -0
- package/src/index.ts +3 -0
- package/src/types.ts +45 -0
- package/src/validator.ts +4 -0
- package/src/wrappedTokenInfo.ts +63 -0
- package/tsconfig.json +9 -0
- package/tsup.config.ts +10 -0
package/dist/index.mjs
ADDED
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as _reduxjs_toolkit_dist_createReducer from '@reduxjs/toolkit/dist/createReducer';
|
|
2
|
+
import { a as TokenList, V as Version } from './types-b620c9be.js';
|
|
3
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
|
+
import { ActionCreatorWithPayload } from '@reduxjs/toolkit';
|
|
5
|
+
import * as jotai from 'jotai';
|
|
6
|
+
import * as jotai_utils from 'jotai/utils';
|
|
7
|
+
|
|
8
|
+
interface ListsState {
|
|
9
|
+
readonly byUrl: {
|
|
10
|
+
readonly [url: string]: {
|
|
11
|
+
readonly current: TokenList | null;
|
|
12
|
+
readonly pendingUpdate: TokenList | null;
|
|
13
|
+
readonly loadingRequestId: string | null;
|
|
14
|
+
readonly error: string | null;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly lastInitializedDefaultListOfLists?: string[];
|
|
18
|
+
readonly activeListUrls: string[] | undefined;
|
|
19
|
+
}
|
|
20
|
+
declare type ListByUrlState = ListsState['byUrl'][string];
|
|
21
|
+
declare const NEW_LIST_STATE: ListByUrlState;
|
|
22
|
+
declare const createTokenListReducer: (initialState: ListsState, DEFAULT_LIST_OF_LISTS: string[], DEFAULT_ACTIVE_LIST_URLS: string[]) => _reduxjs_toolkit_dist_createReducer.ReducerWithInitialState<ListsState>;
|
|
23
|
+
|
|
24
|
+
declare const fetchTokenList: Readonly<{
|
|
25
|
+
pending: ActionCreatorWithPayload<{
|
|
26
|
+
url: string;
|
|
27
|
+
requestId: string;
|
|
28
|
+
}>;
|
|
29
|
+
fulfilled: ActionCreatorWithPayload<{
|
|
30
|
+
url: string;
|
|
31
|
+
tokenList: TokenList;
|
|
32
|
+
requestId: string;
|
|
33
|
+
}>;
|
|
34
|
+
rejected: ActionCreatorWithPayload<{
|
|
35
|
+
url: string;
|
|
36
|
+
errorMessage: string;
|
|
37
|
+
requestId: string;
|
|
38
|
+
}>;
|
|
39
|
+
}>;
|
|
40
|
+
declare const addList: ActionCreatorWithPayload<string, string>;
|
|
41
|
+
declare const removeList: ActionCreatorWithPayload<string, string>;
|
|
42
|
+
declare const enableList: ActionCreatorWithPayload<string, string>;
|
|
43
|
+
declare const disableList: ActionCreatorWithPayload<string, string>;
|
|
44
|
+
declare const acceptListUpdate: ActionCreatorWithPayload<string, string>;
|
|
45
|
+
declare const rejectVersionUpdate: ActionCreatorWithPayload<Version, string>;
|
|
46
|
+
declare const updateListVersion: _reduxjs_toolkit.ActionCreatorWithoutPayload<"lists/updateListVersion">;
|
|
47
|
+
|
|
48
|
+
declare const createListsAtom: (storeName: string, reducer: any, initialState: any) => {
|
|
49
|
+
listsAtom: jotai.WritableAtom<ListsState, ListsState | typeof jotai_utils.RESET | ((prev: ListsState) => ListsState | typeof jotai_utils.RESET), Promise<void>>;
|
|
50
|
+
useListState: () => [ListsState, (action?: unknown) => void];
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
declare function useFetchListCallback(dispatch: (action?: unknown) => void): (listUrl: string, sendDispatch?: boolean) => Promise<TokenList>;
|
|
54
|
+
|
|
55
|
+
export { ListsState, NEW_LIST_STATE, acceptListUpdate, addList, createListsAtom, createTokenListReducer, disableList, enableList, fetchTokenList, rejectVersionUpdate, removeList, updateListVersion, useFetchListCallback };
|