Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
INFURA_KEY=xxx
ALCHEMY_KEY=xxx # For zkEVM
COINGECKO_API_KEY=xxx
GITHUB_TOKEN="github_pat_..."
111 changes: 111 additions & 0 deletions .github/workflows/tokenlist-fetch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Token List Fetch

on:
workflow_dispatch:
inputs:
source_url:
description: 'Source URL for token list'
required: false
default: 'https://raw.githubusercontent.com/burrbear-dev/default-lists/main/src/tokens/mainnet/defaultTokenList.json'
type: string
target_token_file:
description: 'Target token file path'
required: false
default: 'src/tokenlists/balancer/tokens/berachain.ts'
type: string
assets_dir:
description: 'Assets directory for logos'
required: false
default: 'src/assets/images/tokens'
type: string

jobs:
update-tokenlist:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'

- name: Fetch token list
run: |
# Set environment variables for the script
export SOURCE_URL="${{ inputs.source_url }}"
export TARGET_TOKEN_FILE="${{ inputs.target_token_file }}"
export ASSETS_DIR="${{ inputs.assets_dir }}"

# Run the fetch script
npm run tokenlist:fetch
env:
NODE_ENV: production

- name: Generate token list
run: |
# Run the generate script
npm run generate
env:
NODE_ENV: production

- name: Check for changes
id: check-changes
run: |
if git diff --quiet; then
echo "changes=false" >> $GITHUB_OUTPUT
echo "No changes detected"
else
echo "changes=true" >> $GITHUB_OUTPUT
echo "Changes detected"
fi

- name: Create PR
if: steps.check-changes.outputs.changes == 'true'
run: |
# Set environment variables for the PR script
export TARGET_TOKEN_FILE="${{ inputs.target_token_file }}"
export ASSETS_DIR="${{ inputs.assets_dir }}"

# Run the PR creation script
npm run tokenlist:pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment on PR
if: steps.check-changes.outputs.changes == 'true'
uses: actions/github-script@v7
with:
script: |
const { data: pulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
head: `${context.repo.owner}:${context.payload.ref || 'feat/tokenlist-update-' + new Date().toISOString().slice(0, 19).replace(/[:.]/g, '-')}`
});

if (pulls.length > 0) {
const pr = pulls[0];
const commentBody = '🤖 **Automated Token List Update**\n\nThis PR was automatically generated by the GitHub Actions workflow.\n\n**Workflow Details:**\n- **Triggered by**: Manual workflow dispatch\n- **Run ID**: [' + context.runId + '](' + context.serverUrl + '/' + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + context.runId + ')\n- **Commit**: ' + context.sha + '\n\n**Changes:**\n- Updated token list with latest addresses\n- Downloaded new logo assets\n- Generated timestamped backups and logs\n\n---\n*This is an automated PR. Please review the changes before merging.*';

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
body: commentBody
});
}
7 changes: 7 additions & 0 deletions create-pr-2025-07-18T08-22-21.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[2025-07-18T08:22:21.825Z] Changes detected, proceeding with PR creation...
[2025-07-18T08:22:21.826Z] Analysis: 66 tokens, 1069 logo files
[2025-07-18T08:22:21.840Z] Created new branch: feat/tokenlist-update-2025-07-18T08-22-21
[2025-07-18T08:22:21.933Z] Changes committed successfully
[2025-07-18T08:22:26.878Z] Pushed branch feat/tokenlist-update-2025-07-18T08-22-21 to remote
[2025-07-18T08:22:26.900Z] Could not parse repository information from git remote.
[2025-07-18T08:22:26.900Z] PR creation workflow completed with warnings
12 changes: 12 additions & 0 deletions create-pr-2025-07-18T08-24-19.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[2025-07-18T08:24:19.506Z] Changes detected, proceeding with PR creation...
[2025-07-18T08:24:19.507Z] Analysis: 66 tokens, 1069 logo files
[2025-07-18T08:24:19.561Z] Created new branch: feat/tokenlist-update-2025-07-18T08-24-19
[2025-07-18T08:24:19.820Z] Changes committed successfully
[2025-07-18T08:24:23.304Z] Pushed branch feat/tokenlist-update-2025-07-18T08-24-19 to remote
[2025-07-18T08:24:23.827Z] Failed to create PR: {
"message": "Bad credentials",
"documentation_url": "https://docs.github.com/rest",
"status": "401"
}

[2025-07-18T08:24:23.829Z] PR creation workflow completed with warnings
12 changes: 12 additions & 0 deletions create-pr-2025-07-18T08-24-43.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[2025-07-18T08:24:43.863Z] Changes detected, proceeding with PR creation...
[2025-07-18T08:24:43.866Z] Analysis: 66 tokens, 1069 logo files
[2025-07-18T08:24:43.949Z] Created new branch: feat/tokenlist-update-2025-07-18T08-24-43
[2025-07-18T08:24:44.417Z] Changes committed successfully
[2025-07-18T08:24:47.825Z] Pushed branch feat/tokenlist-update-2025-07-18T08-24-43 to remote
[2025-07-18T08:24:48.273Z] Failed to create PR: {
"message": "Bad credentials",
"documentation_url": "https://docs.github.com/rest",
"status": "401"
}

[2025-07-18T08:24:48.275Z] PR creation workflow completed with warnings
3 changes: 3 additions & 0 deletions create-pr-2025-07-18T08-32-37.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[2025-07-18T08:32:37.260Z] Changes detected, proceeding with PR creation...
[2025-07-18T08:32:37.261Z] Analysis: 66 tokens, 1069 logo files
[2025-07-18T08:32:37.277Z] Created new branch: feat/tokenlist-update-2025-07-18T08-32-37
75 changes: 75 additions & 0 deletions fetch-tokenlist-2025-07-18T08-21-25.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[2025-07-18T08:21:25.217Z] Fetching token list from source using curl...
[2025-07-18T08:21:25.576Z] Successfully fetched 66 tokens using curl
[2025-07-18T08:21:25.577Z] Processing tokens...
[2025-07-18T08:21:25.577Z] Found 66 unique valid addresses
[2025-07-18T08:21:25.578Z] Updating berachain token list...
[2025-07-18T08:21:25.579Z] Backup created: berachain.ts.backup-2025-07-18T08-21-25
[2025-07-18T08:21:25.579Z] Successfully updated token list with 66 addresses (1 existing + 66 new)
[2025-07-18T08:21:25.579Z] Starting asset downloads using curl...
[2025-07-18T08:21:25.906Z] Downloaded: wgbera.png -> 0xD77552D3849ab4D8C3b189A9582d0ba4C1F4f912.png
[2025-07-18T08:21:26.241Z] Downloaded: wbera.png -> 0x6969696969696969696969696969696969696969.png
[2025-07-18T08:21:26.557Z] Downloaded: weth.png -> 0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590.png
[2025-07-18T08:21:26.910Z] Downloaded: honey.png -> 0xFCBD14DC51f0A4d49d5E53C2E0950e0bC26d0Dce.png
[2025-07-18T08:21:27.249Z] Downloaded: burr.png -> 0x28e0e3B9817012b356119dF9e217c25932D609c2.png
[2025-07-18T08:21:27.609Z] Downloaded: logo.png -> 0x1cE0a25D13CE4d52071aE7e02Cf1F6606F4C79d3.png
[2025-07-18T08:21:27.779Z] Downloaded: USD_Coin_icon.png -> 0x549943e04f40284185054145c6E4e9568C1D3241.png
[2025-07-18T08:21:27.880Z] Downloaded: 0x231a6bd8eb88cfa42776b7ac575cecaf82bf1e21.png -> 0x231A6BD8eB88Cfa42776B7Ac575CeCAf82bf1E21.png
[2025-07-18T08:21:28.206Z] Downloaded: lbgt.png -> 0xBaadCC2962417C01Af99fb2B7C75706B9bd6Babe.png
[2025-07-18T08:21:28.550Z] Downloaded: bgt.png -> 0x656b95E550C07a9ffe548bd4085c72418Ceb1dba.png
[2025-07-18T08:21:28.869Z] Downloaded: ibgt.png -> 0xac03CABA51e17c86c921E1f6CBFBdC91F8BB2E6b.png
[2025-07-18T08:21:29.203Z] Downloaded: suUSD.png -> 0x8bf591eae535f93a242d5a954d3cde648b48a5a8.png
[2025-07-18T08:21:29.553Z] Downloaded: suBTC.png -> 0xe85411C030fB32A9D8b14Bbbc6CB19417391F711.png
[2025-07-18T08:21:29.886Z] Downloaded: eliteness.png -> 0x30c8cf6b46aa4df3f9fbc2857aca92f10a6cad7f.png
[2025-07-18T08:21:30.204Z] Downloaded: nect-usdc-honey.png -> 0xD10E65A5F8cA6f835F2B1832e37cF150fb955f23.png
[2025-07-18T08:21:30.545Z] Downloaded: coin.png -> 0x65967109401506222609BDc86e3039F910C4d08b.png
[2025-07-18T08:21:30.895Z] Downloaded: icoin.png -> 0x9EA30078bc52740F10812539E77B6502A2a5387a.png
[2025-07-18T08:21:31.234Z] Downloaded: nvda.png -> 0x1De7EfAbfA656d077cFD961e4a83b061D351a83B.png
[2025-07-18T08:21:31.581Z] Downloaded: invda.png -> 0x3A4B2d07c237C701c68238dA07E11302353A16F1.png
[2025-07-18T08:21:31.582Z] Skipping existing file: 0x0555E30da8f98308EdB960aa94C0Db47230d2B9c.png
[2025-07-18T08:21:31.935Z] Downloaded: solvbtc.png -> 0x541FD749419CA806a8bc7da8ac23D346f2dF8B77.png
[2025-07-18T08:21:32.269Z] Downloaded: xsolvbtc.png -> 0xCC0966D8418d412c599A6421b760a847eB169A8c.png
[2025-07-18T08:21:32.618Z] Downloaded: CanaNect.png -> 0x439c84851bb1EDd8Db3DD94809ebBEA6670682F3.png
[2025-07-18T08:21:32.951Z] Downloaded: usdt0.png -> 0x779Ded0c9e1022225f8E0630b35a9b54bE713736.png
[2025-07-18T08:21:33.277Z] Downloaded: CanaBERA.png -> 0x768670beAD85b4383940F60AfD8492AC76b2Ba28.png
[2025-07-18T08:21:33.608Z] Downloaded: BAs.svg -> 0xbdaB22CD9a4BcaB42Fe5Cf17e523A029cbe903Dc.svg
[2025-07-18T08:21:33.953Z] Downloaded: LMTs.svg -> 0x69B88c116cb7cBBC5B0f85CBeA1Be91DF40b56E1.svg
[2025-07-18T08:21:34.319Z] Downloaded: COINs.svg -> 0x24BC5c9a529024e2B670B5b8166993d4ECaefE22.svg
[2025-07-18T08:21:34.663Z] Downloaded: WBDs.svg -> 0x4E0c8b91183374D3aB5eE691b0F59F1a4A671D80.svg
[2025-07-18T08:21:35.008Z] Downloaded: YMAXs.svg -> 0xd9c5b692ed20fA4207f2da1a3db3450828d90a46.svg
[2025-07-18T08:21:35.326Z] Downloaded: ARKKs.svg -> 0x25f838Dc9DFC8F4Ac5bF957c475F90860Dde3460.svg
[2025-07-18T08:21:35.689Z] Downloaded: PARAs.svg -> 0x17A238d9a31fFF2f1078C8e1E4b2aC6B84E3A068.svg
[2025-07-18T08:21:36.044Z] Downloaded: FIATs.svg -> 0x6379BB654aA1B63bC602DBC947f60305AB9d6467.svg
[2025-07-18T08:21:36.364Z] Downloaded: XDTEs.svg -> 0x39890d84ac4a0E94d486068486f6513470E541b4.svg
[2025-07-18T08:21:36.680Z] Downloaded: AAPLs.svg -> 0x77D5cbfE85b3DfB6dB3e63d9392829f4C34FFA86.svg
[2025-07-18T08:21:37.049Z] Downloaded: TSLAs.svg -> 0xca72Cf92768bc1ABEF4b14cFD3E096c8B5f54696.svg
[2025-07-18T08:21:37.403Z] Downloaded: AMZNs.svg -> 0x30F8a2fE5Ea2eb2E64b26CcbD33b690Ec4EFe723.svg
[2025-07-18T08:21:37.747Z] Downloaded: SPYs.svg -> 0xa8e8EFB06Ff91e8c5BEeD849417945d39F3f22Eb.svg
[2025-07-18T08:21:38.083Z] Downloaded: GMEs.svg -> 0x70fA06e485285B6873B0A93189B613E2d85dc5e2.svg
[2025-07-18T08:21:38.418Z] Downloaded: SUPVs.svg -> 0x59dEA303501B18c058882096b781B89B836aA12C.svg
[2025-07-18T08:21:38.745Z] Downloaded: YPFs.svg -> 0xbc2CeE93341C0e10d2fd5ED502F17AF88CFa1E7B.svg
[2025-07-18T08:21:39.080Z] Downloaded: CONYs.svg -> 0xf79d63c21d7C69f1097114716dDB76844169B363.svg
[2025-07-18T08:21:39.418Z] Downloaded: MELIs.svg -> 0xac894A14e3D2CE9E89AefD209b0a38c12AdcF624.svg
[2025-07-18T08:21:39.770Z] Downloaded: NVDAs.svg -> 0x9933Bb212C36860EF22915D44b74a8Cf1ffd45BB.svg
[2025-07-18T08:21:40.118Z] Downloaded: METAs.svg -> 0xB35ffDB091e2e4361d907d5AA7dB3C150846a3e1.svg
[2025-07-18T08:21:40.461Z] Downloaded: CRCLs.svg -> 0x849F0393632746AC5e8426b53d78266d1d8ac1cd.svg
[2025-07-18T08:21:40.790Z] Downloaded: DLOs.svg -> 0x8f7F14481a9c0943836898F825BFb5494b7828Db.svg
[2025-07-18T08:21:41.135Z] Downloaded: UPSTs.svg -> 0x08bc8b0c234390a40Aa305277355fd1A1819f10E.svg
[2025-07-18T08:21:41.459Z] Downloaded: SPYIs.svg -> 0x7542d8347913fA8eE3090fFf38544CDF694dd5F9.svg
[2025-07-18T08:21:41.801Z] Downloaded: AMCs.svg -> 0x3a33A4Fa4443A5fd4aa89349BB3D2bc1D644478b.svg
[2025-07-18T08:21:42.136Z] Downloaded: QQQs.svg -> 0x12855A68877A95482CEA16a39AaA25009ac6E396.svg
[2025-07-18T08:21:42.485Z] Downloaded: MSTRs.svg -> 0xB7ca08EEF00a58489A670a1E22D4c6D01579db2F.svg
[2025-07-18T08:21:42.874Z] Downloaded: DNAs.svg -> 0xe9C99da8395C57Bd08830c547a9c5d57A23C5cB3.svg
[2025-07-18T08:21:43.218Z] Downloaded: DISs.svg -> 0x8dcCB687201955299E7bb1da47664313ff6759dd.svg
[2025-07-18T08:21:43.553Z] Downloaded: AAAUs.svg -> 0x7195A0Bc1e8A8b29Cd426D545522d38e698120Bf.svg
[2025-07-18T08:21:43.898Z] Downloaded: ABNBs.svg -> 0xD2A26cF1d3aB11799AFd3E2461eC7ea0D62eEC6C.svg
[2025-07-18T08:21:44.242Z] Downloaded: PLTRs.svg -> 0x42BECBE61383ce454db886e2A2802eC88ddC6beb.svg
[2025-07-18T08:21:44.580Z] Downloaded: DTs.svg -> 0x4D9CeB1a0baA95b1Ae6198c152F44AB4e919824D.svg
[2025-07-18T08:21:44.937Z] Downloaded: MCDs.svg -> 0x43456286034E248EFC1471687fA7e7fF6aC4Bd5a.svg
[2025-07-18T08:21:45.282Z] Downloaded: GSs.svg -> 0xB1fef1bcf006604c382200168932f00812Ac9FF0.svg
[2025-07-18T08:21:45.622Z] Downloaded: UBERs.svg -> 0x6C353a03d1177b5bA0C4Da63dA77341433015F86.svg
[2025-07-18T08:21:45.947Z] Downloaded: BLKs.svg -> 0x682BedD46D9d308eF35eaa7F92430e8A57c73792.svg
[2025-07-18T08:21:46.265Z] Downloaded: BYDs.svg -> 0xB064c58a63EBf8D03CD7A063e9e5e1398CdeA138.svg
[2025-07-18T08:21:46.610Z] Downloaded: MSFTs.svg -> 0x56b4930057bcF3Dc9b8f6F17FF64dD54698598e8.svg
[2025-07-18T08:21:46.954Z] Downloaded: UNGs.svg -> 0x23a9dfBc5f489311E891118a587C5367cc992a40.svg
[2025-07-18T08:21:47.286Z] Downloaded: SAIL.svg -> 0x3e5D85dD846B4Ca5A12Eb19eBd21d2798b724c36.svg
[2025-07-18T08:21:47.287Z] Token list integration completed successfully!
Loading
Loading