Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release #72

Merged
merged 2 commits into from
Sep 12, 2024
Merged
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
4 changes: 4 additions & 0 deletions apps/api/src/api-docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ components:
type: string
example: "https://explorer.example.com"
description: The URL of the chain's explorer.
websiteUrl:
type: string
example: "https://example.com"
description: The URL of the chain's website.
launchDate:
type: number
example: 1638307200
Expand Down
8 changes: 8 additions & 0 deletions apps/api/src/metrics/dto/response/metadata.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export class ZkChainMetadata {
*/
explorerUrl?: string;

/**
* The URL of the chain's website.
* @type {string}
* @memberof Metadata
*/
websiteUrl?: string;

/**
* The launch date of the chain (timestamp).
* @type {number}
Expand All @@ -42,6 +49,7 @@ export class ZkChainMetadata {
this.name = data.name;
this.publicRpcs = data.publicRpcs;
this.explorerUrl = data.explorerUrl;
this.websiteUrl = data.websiteUrl;
this.launchDate = data.launchDate;
}
}
23 changes: 12 additions & 11 deletions packages/metadata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@ This file contains an array of Chain metadata. To add a new one, follow the foll

```json
{
"chainId": 324, //mandatory
"name": "ZKsyncERA", //mandatory
"iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png", //optional
"chainId": 324, // mandatory
"name": "ZKsyncERA", // mandatory
"iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png", // optional
"publicRpcs": [
"https://mainnet.era.zksync.io",
"https://zksync.drpc.org",
"https://zksync.meowrpc.com"
], //optional,
"explorerUrl": "https://explorer.zksync.io/", //optional
"launchDate": 1679626800, //mandatory
], // optional,
"explorerUrl": "https://explorer.zksync.io/", // optional
"websiteUrl": "https://zksync.io/", // optional
"launchDate": 1679626800, // mandatory
"chainType": "Rollup", // "Rollup" | "Validium"
"baseToken": {
"name": "Ether", //mandatory
"symbol": "ETH", //mandatory
"name": "Ether", // mandatory
"symbol": "ETH", // mandatory
"type": "native", // "native" | "erc20"
"contractAddress": null, // null if "native", address if "erc20"
"imageUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628", //optional
"decimals": 18 //mandatory
"imageUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628", // optional
"decimals": 18 // mandatory
}
}
```
Expand Down Expand Up @@ -57,7 +58,7 @@ Inside [examples](./examples/) folder, you'll find json examples. Copy it to you

At [ZKchainHub-metadata repository](https://github.com/defi-wonderland/ZKchainHub-metadata) you'll find the latest curated list of tokens. To use it, remember to copy file url as raw content.

> https://raw.githubusercontent.com/defi-wonderland/ZKchainHub-metadata/79779a6313ab43af055f59861be012bf67bb908d/chains_mainnet.json
> https://raw.githubusercontent.com/defi-wonderland/ZKchainHub-metadata/main/chains_mainnet.json

## 📋 Prerequisites

Expand Down
2 changes: 2 additions & 0 deletions packages/metadata/examples/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"https://zksync.meowrpc.com"
],
"explorerUrl": "https://explorer.zksync.io/",
"websiteUrl": "https://zksync.io/",
"launchDate": 1679626800,
"chainType": "Rollup",
"baseToken": {
Expand All @@ -27,6 +28,7 @@
"chainType": "Validium",
"publicRpcs": ["https://mainnet.zkevm.cronos.org"],
"explorerUrl": "https://explorer.zkevm.cronos.org/",
"websiteUrl": "https://cronos.org/zkevm",
"baseToken": {
"symbol": "zkCRO",
"name": "zkCRO",
Expand Down
1 change: 1 addition & 0 deletions packages/metadata/src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const ChainSchema = z.object({
iconUrl: z.string().url().optional(),
publicRpcs: z.array(z.string().url()).default([]),
explorerUrl: z.string().url().optional(),
websiteUrl: z.string().url().optional(),
launchDate: z.number().positive(),
chainType: z.union([z.literal("Rollup"), z.literal("Validium")]),
baseToken: TokenSchema,
Expand Down
1 change: 1 addition & 0 deletions packages/metadata/test/fixtures/metadata.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const mockChainData = [
"https://zksync.meowrpc.com",
],
explorerUrl: "https://explorer.zksync.io/",
websiteUrl: "https://zksync.io/",
launchDate: 1679626800,
chainType: "Rollup",
baseToken: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe("GithubMetadataProvider", () => {
"https://zksync.meowrpc.com",
],
explorerUrl: "https://explorer.zksync.io/",
websiteUrl: "https://zksync.io/",
launchDate: 1679626800,
chainType: "Rollup",
baseToken: {
Expand Down Expand Up @@ -140,6 +141,7 @@ describe("GithubMetadataProvider", () => {
"https://zksync.meowrpc.com",
],
explorerUrl: "https://explorer.zksync.io/",
websiteUrl: "https://zksync.io/",
launchDate: 1679626800,
chainType: "Rollup",
baseToken: {
Expand Down Expand Up @@ -187,6 +189,7 @@ describe("GithubMetadataProvider", () => {
"https://zksync.meowrpc.com",
],
explorerUrl: "https://explorer.zksync.io/",
websiteUrl: "https://zksync.io/",
launchDate: 1679626800,
chainType: "Rollup",
baseToken: {
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/types/zkchain.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type ZKChainMetadataItem = {
baseToken: Token<"erc20" | "native">;
publicRpcs: string[];
explorerUrl?: string;
websiteUrl?: string;
launchDate: number;
};

Expand Down