Skip to content

Commit

Permalink
Experimental UTL aggregator (#100)
Browse files Browse the repository at this point in the history
* Migrate to @brave/utl-aggregator

* Update node version to 20.x

* Update yarn.lock
  • Loading branch information
onyb authored Dec 13, 2023
1 parent 9a3d20c commit 592dad6
Show file tree
Hide file tree
Showing 7 changed files with 372 additions and 377 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: '18.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: brew install librsvg libimagequant pkg-config
- run: npm install -g yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: '18.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: brew install librsvg libimagequant pkg-config
- run: npm install -g yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: '18.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: brew install librsvg libimagequant pkg-config
- run: npm install -g yarn npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solana-tokenlist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: '18.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: brew install librsvg libimagequant pkg-config

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Manages custom token lists for Brave Wallet",
"dependencies": {
"@metamask/contract-metadata": "git+https://[email protected]/MetaMask/contract-metadata.git",
"@solflare-wallet/utl-aggregator": "^0.0.14",
"@brave/utl-aggregator": "^0.0.15",
"node-fetch": "2",
"nodejs-file-downloader": "^4.9.3",
"qyu": "^0.4.7",
Expand Down
28 changes: 14 additions & 14 deletions scripts/solana.task.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path'
import fs from 'fs'
import path from "path";
import fs from "fs";

import {
Generator,
Expand All @@ -8,16 +8,16 @@ import {
ProviderIgnore,
ChainId,
Tag,
} from '@solflare-wallet/utl-aggregator'
} from "@brave/utl-aggregator";

const sec = 1000
const sec = 1000;

async function generateTokensList() {
const trustedTokenList =
process.env.TRUSTED_TOKEN_LIST_URL ??
'https://cdn.jsdelivr.net/gh/brave/token-lists@main/data/solana/trusted-tokenlist.json'
const coinGeckoApiKey = process.env.COINGECKO_API_KEY ?? null
const rpcUrlMainnet = process.env.SOLANA_MAINNET_RPC_URL
"https://cdn.jsdelivr.net/gh/brave/token-lists@main/data/solana/trusted-tokenlist.json";
const coinGeckoApiKey = process.env.COINGECKO_API_KEY ?? null;
const rpcUrlMainnet = process.env.SOLANA_MAINNET_RPC_URL;

const generator = new Generator(
[
Expand All @@ -39,19 +39,19 @@ async function generateTokensList() {
],
[
new ProviderIgnore(
'https://raw.githubusercontent.com/solflare-wallet/token-list/master/ignore-tokenlist.json',
"https://raw.githubusercontent.com/solflare-wallet/token-list/master/ignore-tokenlist.json",
[],
ChainId.MAINNET
),
]
)
);

const tokenMap = await generator.generateTokenList()
const tokenMap = await generator.generateTokenList();
fs.writeFileSync(
path.join('data', 'solana', 'tokenlist.json'),
path.join("data", "solana", "tokenlist.json"),
JSON.stringify(tokenMap, null, 2)
)
return tokenMap
);
return tokenMap;
}

await generateTokensList()
await generateTokensList();
Loading

0 comments on commit 592dad6

Please sign in to comment.