Skip to content

Commit

Permalink
add rari network mono
Browse files Browse the repository at this point in the history
  • Loading branch information
0xa3k5 committed Apr 14, 2024
1 parent 0c5fda0 commit 63bc7f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/raw-svgs/networks/mono/rari.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions packages/utils/src/scripts/update-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const appendToNetworksJson = async (
const formatted = await prettier.format(JSON.stringify(existingMetadata), {
parser: 'json',
})
console.log(`appended ${network.id} to networks.json`)
fs.writeFileSync(jsonPath, formatted)
}

Expand Down Expand Up @@ -78,6 +79,7 @@ const appendToTokensJson = async (coin: ITokenMetadata): Promise<void> => {
JSON.stringify(existingMetadata),
{ parser: 'json' },
)
console.log(`appended ${coin.symbol} to tokens.json`)
fs.writeFileSync(jsonPath, formattedContent)
}

Expand All @@ -103,13 +105,14 @@ const processSVGFile = async (
(coin: any) => normalizeName(coin.symbol) === normalizedFileName,
)
if (foundCoin) {
console.log(`Found match for ${foundCoin.symbol}`)
const tokenMetadata: ITokenMetadata = {
id: foundCoin.id,
symbol: foundCoin.symbol,
name: foundCoin.name,
variants: file.includes('/branded/') ? ['branded'] : ['mono'],
marketCapRank: 0, // Will be fetched below
addresses: {}, // Will be fetched below
marketCapRank: 0, // will be fetched below
addresses: {}, // will be fetched below
}
const data = await getCoinByID(foundCoin.id)
tokenMetadata.addresses = data.platforms
Expand All @@ -124,6 +127,7 @@ const processSVGFile = async (
normalizeName(network.name) === normalizedFileName,
)
if (foundNetwork) {
console.log(`Found match for ${foundNetwork.symbol}`)
const networkMetadata: INetworkMetadata = {
id: foundNetwork.id,
name: foundNetwork.name,
Expand All @@ -147,7 +151,7 @@ const main = async (filePaths: string[]) => {

try {
main(files)
console.log('Metadata updated successfully.')
console.log('Metadata updated successfully for', files.map((f) => f).join('\n '))
} catch (error) {
console.error('Failed to update metadata:', error)
process.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/scripts/validate-svgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if (files.length === 0) {

try {
main(files)
console.log('SVG validation passed.')
console.log(`SVG validation passed for ${files.map((f) => f).join('\n ')}`)
} catch (error) {
console.error('SVG validation failed:', error)
process.exit(1)
Expand Down

0 comments on commit 63bc7f7

Please sign in to comment.