@pancakeswap/token-lists 0.0.14 → 0.0.16
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 +11 -16
- package/CHANGELOG.md +14 -0
- package/dist/{chunk-COROHIJN.mjs → chunk-DC45HQOL.mjs} +40 -2
- package/dist/{chunk-OGWZ2K32.js → chunk-YOAEDKQH.js} +42 -1
- package/dist/index.js +6 -7
- package/dist/index.mjs +1 -2
- package/dist/react.d.ts +40 -19
- package/dist/react.js +567 -70
- package/dist/react.mjs +561 -67
- package/package.json +5 -5
- package/react/getTokenList.ts +26 -43
- package/react/index.test.ts +5 -2
- package/react/index.ts +2 -1
- package/react/lists.ts +53 -1
- package/react/useFetchListCallback.ts +6 -3
- package/dist/chunk-2L3ZO4UM.mjs +0 -41
- package/dist/chunk-4TPCCB4K.js +0 -45
- package/dist/getTokenList-A3DXVBCD.js +0 -481
- package/dist/getTokenList-PEH2JP67.mjs +0 -471
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pancakeswap/token-lists@0.0.
|
|
2
|
+
> @pancakeswap/token-lists@0.0.16 build /home/runner/work/pancake-frontend/pancake-frontend/packages/token-lists
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
CLI Building entry: {"index":"./src/index.ts","react":"./react/index.ts"}
|
|
@@ -9,21 +9,16 @@ CLI Using tsup config: /home/runner/work/pancake-frontend/pancake-frontend/packa
|
|
|
9
9
|
CLI Target: es6
|
|
10
10
|
ESM Build start
|
|
11
11
|
CJS Build start
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
CJS dist/
|
|
17
|
-
CJS dist/
|
|
18
|
-
CJS
|
|
19
|
-
|
|
20
|
-
ESM dist/index.mjs 160.00 B
|
|
21
|
-
ESM dist/chunk-COROHIJN.mjs 2.67 KB
|
|
22
|
-
ESM dist/getTokenList-PEH2JP67.mjs 14.03 KB
|
|
23
|
-
ESM dist/react.mjs 8.43 KB
|
|
24
|
-
ESM ⚡️ Build success in 841ms
|
|
12
|
+
ESM dist/index.mjs 129.00 B
|
|
13
|
+
ESM dist/chunk-DC45HQOL.mjs 4.05 KB
|
|
14
|
+
ESM dist/react.mjs 23.29 KB
|
|
15
|
+
ESM ⚡️ Build success in 1305ms
|
|
16
|
+
CJS dist/index.js 783.00 B
|
|
17
|
+
CJS dist/chunk-YOAEDKQH.js 4.28 KB
|
|
18
|
+
CJS dist/react.js 24.16 KB
|
|
19
|
+
CJS ⚡️ Build success in 1305ms
|
|
25
20
|
DTS Build start
|
|
26
|
-
DTS ⚡️ Build success in
|
|
21
|
+
DTS ⚡️ Build success in 13852ms
|
|
27
22
|
DTS dist/index.d.ts 1.68 KB
|
|
28
|
-
DTS dist/react.d.ts
|
|
23
|
+
DTS dist/react.d.ts 3.50 KB
|
|
29
24
|
DTS dist/types-d6730d17.d.ts 1.03 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @pancakeswap/token-lists
|
|
2
2
|
|
|
3
|
+
## 0.0.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [cd589e1]
|
|
8
|
+
- @pancakeswap/swap-sdk-core@1.5.0
|
|
9
|
+
|
|
10
|
+
## 0.0.15
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [cb44715]
|
|
15
|
+
- @pancakeswap/swap-sdk-core@1.4.0
|
|
16
|
+
|
|
3
17
|
## 0.0.14
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
import { Token } from '@pancakeswap/swap-sdk-core';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
+
var __async = (__this, __arguments, generator) => {
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
var fulfilled = (value) => {
|
|
25
|
+
try {
|
|
26
|
+
step(generator.next(value));
|
|
27
|
+
} catch (e) {
|
|
28
|
+
reject(e);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var rejected = (value) => {
|
|
32
|
+
try {
|
|
33
|
+
step(generator.throw(value));
|
|
34
|
+
} catch (e) {
|
|
35
|
+
reject(e);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
39
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
40
|
+
});
|
|
41
|
+
};
|
|
4
42
|
var WrappedTokenInfo = class extends Token {
|
|
5
43
|
constructor(tokenInfo) {
|
|
6
44
|
super(tokenInfo.chainId, tokenInfo.address, tokenInfo.decimals, tokenInfo.symbol, tokenInfo.name);
|
|
@@ -83,4 +121,4 @@ function createFilterToken(search, isAddress) {
|
|
|
83
121
|
};
|
|
84
122
|
}
|
|
85
123
|
|
|
86
|
-
export { VersionUpgrade, WrappedTokenInfo, createFilterToken, deserializeToken, getVersionUpgrade };
|
|
124
|
+
export { VersionUpgrade, WrappedTokenInfo, __async, __spreadProps, __spreadValues, createFilterToken, deserializeToken, getVersionUpgrade };
|
|
@@ -2,7 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
var swapSdkCore = require('@pancakeswap/swap-sdk-core');
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
7
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __async = (__this, __arguments, generator) => {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
var fulfilled = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.next(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var rejected = (value) => {
|
|
34
|
+
try {
|
|
35
|
+
step(generator.throw(value));
|
|
36
|
+
} catch (e) {
|
|
37
|
+
reject(e);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
6
44
|
var WrappedTokenInfo = class extends swapSdkCore.Token {
|
|
7
45
|
constructor(tokenInfo) {
|
|
8
46
|
super(tokenInfo.chainId, tokenInfo.address, tokenInfo.decimals, tokenInfo.symbol, tokenInfo.name);
|
|
@@ -87,6 +125,9 @@ function createFilterToken(search, isAddress) {
|
|
|
87
125
|
|
|
88
126
|
exports.VersionUpgrade = VersionUpgrade;
|
|
89
127
|
exports.WrappedTokenInfo = WrappedTokenInfo;
|
|
128
|
+
exports.__async = __async;
|
|
129
|
+
exports.__spreadProps = __spreadProps;
|
|
130
|
+
exports.__spreadValues = __spreadValues;
|
|
90
131
|
exports.createFilterToken = createFilterToken;
|
|
91
132
|
exports.deserializeToken = deserializeToken;
|
|
92
133
|
exports.getVersionUpgrade = getVersionUpgrade;
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-4TPCCB4K.js');
|
|
3
|
+
var chunkYOAEDKQH_js = require('./chunk-YOAEDKQH.js');
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
Object.defineProperty(exports, 'VersionUpgrade', {
|
|
9
8
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkYOAEDKQH_js.VersionUpgrade; }
|
|
11
10
|
});
|
|
12
11
|
Object.defineProperty(exports, 'WrappedTokenInfo', {
|
|
13
12
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkYOAEDKQH_js.WrappedTokenInfo; }
|
|
15
14
|
});
|
|
16
15
|
Object.defineProperty(exports, 'createFilterToken', {
|
|
17
16
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkYOAEDKQH_js.createFilterToken; }
|
|
19
18
|
});
|
|
20
19
|
Object.defineProperty(exports, 'deserializeToken', {
|
|
21
20
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkYOAEDKQH_js.deserializeToken; }
|
|
23
22
|
});
|
|
24
23
|
Object.defineProperty(exports, 'getVersionUpgrade', {
|
|
25
24
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkYOAEDKQH_js.getVersionUpgrade; }
|
|
27
26
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { VersionUpgrade, WrappedTokenInfo, createFilterToken, deserializeToken, getVersionUpgrade } from './chunk-
|
|
2
|
-
import './chunk-2L3ZO4UM.mjs';
|
|
1
|
+
export { VersionUpgrade, WrappedTokenInfo, createFilterToken, deserializeToken, getVersionUpgrade } from './chunk-DC45HQOL.mjs';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
import * as _reduxjs_toolkit_dist_createReducer from '@reduxjs/toolkit/dist/createReducer';
|
|
2
|
-
import { a as TokenList, V as Version } from './types-d6730d17.js';
|
|
3
1
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
2
|
import { ActionCreatorWithPayload } from '@reduxjs/toolkit';
|
|
3
|
+
import { a as TokenList, V as Version } from './types-d6730d17.js';
|
|
4
|
+
import * as jotai_vanilla_utils_atomFamily from 'jotai/vanilla/utils/atomFamily';
|
|
5
5
|
import * as jotai from 'jotai';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly byUrl: {
|
|
9
|
-
readonly [url: string]: {
|
|
10
|
-
readonly current: TokenList | null;
|
|
11
|
-
readonly pendingUpdate: TokenList | null;
|
|
12
|
-
readonly loadingRequestId: string | null;
|
|
13
|
-
readonly error: string | null;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
readonly lastInitializedDefaultListOfLists?: string[];
|
|
17
|
-
readonly activeListUrls: string[] | undefined;
|
|
18
|
-
}
|
|
19
|
-
type ListByUrlState = ListsState['byUrl'][string];
|
|
20
|
-
declare const NEW_LIST_STATE: ListByUrlState;
|
|
21
|
-
declare const createTokenListReducer: (initialState: ListsState, DEFAULT_LIST_OF_LISTS: string[], DEFAULT_ACTIVE_LIST_URLS: string[]) => _reduxjs_toolkit_dist_createReducer.ReducerWithInitialState<ListsState>;
|
|
6
|
+
import * as src from 'src';
|
|
7
|
+
import * as _reduxjs_toolkit_dist_createReducer from '@reduxjs/toolkit/dist/createReducer';
|
|
22
8
|
|
|
23
9
|
declare const fetchTokenList: Readonly<{
|
|
24
10
|
pending: ActionCreatorWithPayload<{
|
|
@@ -44,12 +30,47 @@ declare const acceptListUpdate: ActionCreatorWithPayload<string, string>;
|
|
|
44
30
|
declare const rejectVersionUpdate: ActionCreatorWithPayload<Version, string>;
|
|
45
31
|
declare const updateListVersion: _reduxjs_toolkit.ActionCreatorWithoutPayload<"lists/updateListVersion">;
|
|
46
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Contains the logic for resolving a list URL to a validated token list
|
|
35
|
+
* @param listUrl list url
|
|
36
|
+
*/
|
|
37
|
+
declare function getTokenList(listUrl: string): Promise<TokenList | undefined>;
|
|
38
|
+
|
|
39
|
+
interface ListsState {
|
|
40
|
+
readonly byUrl: {
|
|
41
|
+
readonly [url: string]: {
|
|
42
|
+
readonly current: TokenList | null;
|
|
43
|
+
readonly pendingUpdate: TokenList | null;
|
|
44
|
+
readonly loadingRequestId: string | null;
|
|
45
|
+
readonly error: string | null;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
readonly lastInitializedDefaultListOfLists?: string[];
|
|
49
|
+
readonly activeListUrls: string[] | undefined;
|
|
50
|
+
}
|
|
51
|
+
type ListByUrlState = ListsState['byUrl'][string];
|
|
52
|
+
declare const NEW_LIST_STATE: ListByUrlState;
|
|
53
|
+
declare const createTokenListReducer: (initialState: ListsState, DEFAULT_LIST_OF_LISTS: string[], DEFAULT_ACTIVE_LIST_URLS: string[]) => _reduxjs_toolkit_dist_createReducer.ReducerWithInitialState<ListsState>;
|
|
54
|
+
|
|
55
|
+
declare function findTokenByAddress(state: ListsState, chainId: number, address: string): src.TokenInfo | undefined;
|
|
56
|
+
declare function findTokenBySymbol(state: ListsState, chainId: number, symbol: string): src.TokenInfo | undefined;
|
|
47
57
|
declare const createListsAtom: (storeName: string, reducer: any, initialState: any) => {
|
|
48
58
|
listsAtom: jotai.WritableAtom<ListsState, any, void>;
|
|
59
|
+
tokenAtom: jotai_vanilla_utils_atomFamily.AtomFamily<{
|
|
60
|
+
chainId: number;
|
|
61
|
+
address: string;
|
|
62
|
+
}, jotai.Atom<src.TokenInfo | undefined>>;
|
|
63
|
+
tokenBySymbolAtom: jotai_vanilla_utils_atomFamily.AtomFamily<{
|
|
64
|
+
chainId: number;
|
|
65
|
+
symbol: string;
|
|
66
|
+
}, jotai.Atom<src.TokenInfo | undefined>>;
|
|
67
|
+
fetchListAtom: jotai.WritableAtom<null, [string], Promise<void>> & {
|
|
68
|
+
init: null;
|
|
69
|
+
};
|
|
49
70
|
useListStateReady: () => boolean;
|
|
50
71
|
useListState: () => [ListsState, (...args: any) => void];
|
|
51
72
|
};
|
|
52
73
|
|
|
53
74
|
declare function useFetchListCallback(dispatch: (action?: unknown) => void): (listUrl: string, sendDispatch?: boolean) => Promise<TokenList>;
|
|
54
75
|
|
|
55
|
-
export { ListByUrlState, ListsState, NEW_LIST_STATE, acceptListUpdate, addList, createListsAtom, createTokenListReducer, disableList, enableList, fetchTokenList, rejectVersionUpdate, removeList, updateListVersion, useFetchListCallback };
|
|
76
|
+
export { ListByUrlState, ListsState, NEW_LIST_STATE, acceptListUpdate, addList, createListsAtom, createTokenListReducer, disableList, enableList, fetchTokenList, findTokenByAddress, findTokenBySymbol, getTokenList, rejectVersionUpdate, removeList, updateListVersion, useFetchListCallback };
|