Skip to content

chore: create new token #40

chore: create new token

chore: create new token #40

Workflow file for this run

name: Validate New Token Configurations
on:
pull_request:
paths:
- "registry/mainnet/interchain/squid.tokenlist.json"
jobs:
validate-tokens:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Extract and validate new tokens
run: |
git fetch origin ${{ github.base_ref }}
git show origin/${{ github.base_ref }}:registry/mainnet/interchain/squid.tokenlist.json > base_file.json
cp registry/mainnet/interchain/squid.tokenlist.json current_file.json
bun run - <<EOF
import * as fs from 'fs/promises';
const base = JSON.parse(await fs.readFile('base_file.json', 'utf8'));
const current = JSON.parse(await fs.readFile('current_file.json', 'utf8'));
const newTokens = Object.entries(current.tokens)
.filter(([id, token]) => !base.tokens[id])
.reduce((obj, [id, token]) => ({ ...obj, [id]: token }), {});
await fs.writeFile('new_tokens.json', JSON.stringify(newTokens, null, 2));
EOF
bun run scripts/validate-token-configs.ts