Skip to content

Commit

Permalink
Migrate to @brave/utl-aggregator
Browse files Browse the repository at this point in the history
  • Loading branch information
onyb committed Dec 13, 2023
1 parent 9a3d20c commit 3d48367
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 95 deletions.
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 3d48367

Please sign in to comment.