-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add LRT pool filter (dm) (#5257)
* feat: init * chore: delete generated file * chore: Update gitignore * chore: Remove log * fix: module import * chore: Keep required folder * chore: Update schema
- Loading branch information
1 parent
b5115e0
commit 5fece57
Showing
8 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ref, onBeforeMount } from 'vue'; | ||
|
||
const lrtPools = ref<string[]>([]); | ||
|
||
const chainIdToNetworkFileMap = { | ||
1: 'mainnet', | ||
1101: 'zkevm', | ||
}; | ||
|
||
export function usePoolGroups(chainId: string | number) { | ||
const fileName = chainIdToNetworkFileMap[chainId] || 'mainnet'; | ||
|
||
onBeforeMount(async () => { | ||
const module = await import(`@/assets/data/pools/${fileName}.json`); | ||
const pools = module.default; | ||
|
||
lrtPools.value = pools | ||
.filter(pool => pool.categories.includes('lrt')) | ||
.map(pool => pool.id); | ||
}); | ||
|
||
return { lrtPools }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import axios from 'axios'; | ||
|
||
const fs = require('fs'); | ||
|
||
const baseUrl = 'https://raw.githubusercontent.com/balancer/metadata/main'; | ||
const filesToFetch = ['/pools/mainnet.json', '/pools/zkevm.json']; | ||
|
||
async function generate() { | ||
filesToFetch.forEach(async file => { | ||
console.log(`Generating metadata for file ${file}...`); | ||
const { data } = await axios(baseUrl + file); | ||
fs.writeFileSync(`./src/assets/data${file}`, JSON.stringify(data, null, 2)); | ||
}); | ||
} | ||
|
||
(async () => { | ||
try { | ||
console.log('⏳ Generating metadata...'); | ||
await generate(); | ||
console.log('✅ Generated metadata at /src/assets/data/*'); | ||
} catch (error) { | ||
console.error('Failed to generate metadata:', error); | ||
process.exit(1); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters