@swapkit/tokens 1.0.0-rc.46 → 1.0.0-rc.48

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/package.json CHANGED
@@ -2,9 +2,7 @@
2
2
  "author": "swapkit-oss",
3
3
  "description": "SwapKit - Tokens",
4
4
  "devDependencies": {
5
- "@swapkit/api": "1.0.0-rc.50",
6
- "@swapkit/types": "1.0.0-rc.49",
7
- "bun-types": "1.1.1"
5
+ "bun-types": "1.1.2"
8
6
  },
9
7
  "files": [
10
8
  "src/",
@@ -21,14 +19,14 @@
21
19
  },
22
20
  "scripts": {
23
21
  "build": "bun run ./build.ts",
24
- "clean": "rm -rf .turbo dist node_modules tsconfig.tsbuildinfo",
25
- "generate-tokens": "bun run ./src/fetchTokenLists.ts",
26
- "lint": "biome check --apply ./src",
22
+ "clean": "rm -rf .turbo dist node_modules *.tsbuildinfo",
23
+ "generate-tokens": "bun run ./fetchTokenLists.ts",
24
+ "lint": "biome check --apply-unsafe ./src",
27
25
  "test": "echo 'bun test --run'",
28
26
  "test:coverage": "echo 'bun test --coverage'",
29
27
  "type-check": "tsc --noEmit"
30
28
  },
31
29
  "type": "module",
32
30
  "types": "./src/index.ts",
33
- "version": "1.0.0-rc.46"
31
+ "version": "1.0.0-rc.48"
34
32
  }
@@ -19,13 +19,7 @@ export const list = {
19
19
  identifier: "ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48",
20
20
  decimals: 6,
21
21
  },
22
- {
23
- address: "0xdac17f958d2ee523a2206206994597c13d831ec7",
24
- chain: "ETH",
25
- identifier: "ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7",
26
- decimals: 6,
27
- },
28
22
  ],
29
- count: 6,
23
+ count: 5,
30
24
  logo: "https://static.thorswap.net/token-list/images/flip.flip.png",
31
25
  } as const;
@@ -1,47 +0,0 @@
1
- import { RequestClient, SwapKitApi, type TokensResponse } from "@swapkit/api";
2
- import { Chain } from "@swapkit/types";
3
-
4
- function parseChain(chain: string) {
5
- if (chain === "ARBITRUM") return Chain.Arbitrum;
6
- return chain;
7
- }
8
-
9
- function parseIdentifier(identifier: string) {
10
- if (identifier.startsWith("ARBITRUM.")) {
11
- return identifier.replace("ARBITRUM.", `${Chain.Arbitrum}.`);
12
- }
13
- return identifier;
14
- }
15
-
16
- const providers = await SwapKitApi.getTokenListProviders();
17
-
18
- for (const { provider } of providers) {
19
- if (provider.includes("whitelist")) continue;
20
-
21
- try {
22
- const tokenList = await RequestClient.get<TokensResponse>(
23
- `https://static.thorswap.net/token-list/${provider}.json`,
24
- );
25
-
26
- if (!tokenList) continue;
27
-
28
- const tokens = tokenList?.tokens
29
- ?.map(({ address, chain, identifier, decimals, logoURL }) => ({
30
- address,
31
- chain: parseChain(chain),
32
- identifier: parseIdentifier(identifier),
33
- decimals,
34
- logoURL,
35
- }))
36
- .sort((a, b) => a.identifier.localeCompare(b.identifier));
37
-
38
- const tokenListWithTokens = { ...tokenList, tokens };
39
-
40
- await Bun.write(
41
- `src/tokenLists/${provider}.ts`,
42
- `export const list = ${JSON.stringify(tokenListWithTokens)} as const;`,
43
- );
44
- } catch (_error) {
45
- console.error(provider);
46
- }
47
- }