Skip to content

Commit

Permalink
Merge pull request #252 from dappradar/feature/support-more-evm-chains
Browse files Browse the repository at this point in the history
Support more EVM chains
  • Loading branch information
liutaurasjanuskas authored Nov 14, 2023
2 parents 78dd701 + e8e73e6 commit b9e7e15
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ HTTP_PROXY_URL=http://nft-sales-websocket.dappradar.com
# MOONRIVER_NODE_HTTP=
# MOONBEAM_NODE_HTTP=
# CELO_NODE_HTTP=
# AURORA_NODE_HTTP=
# AURORA_NODE_HTTP=
# BASE_NODE_HTTP=
# CRONOS_NODE_HTTP=
# ELYSIUM_NODE_HTTP=
# ZKSYNC_ERA_NODE_HTTP=
8 changes: 8 additions & 0 deletions docs/general/supported-protocols.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@
* BNB Chain (Binance Smart Chain)
* Polygon (Matic)
* Avalanche
* Base
* Cronos
* Elysium
* zkSync Era
* Aurora
* Celo
* Moonbeam
* Moonriver
* Tezos
18 changes: 18 additions & 0 deletions src/sdk/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as dotenv from "dotenv";

dotenv.config();

import { AVAILABLE_PROTOCOLS } from "./constants";
import EVMC_HTTP from "./EVMC-HTTP";

class Base extends EVMC_HTTP {
constructor(props: any) {
super(props);

this.protocol = AVAILABLE_PROTOCOLS.BASE;
this.chainId = 94;
this.node = process.env.BASE_NODE_HTTP;
}
}

export default Base;
5 changes: 5 additions & 0 deletions src/sdk/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ enum AVAILABLE_PROTOCOLS {
CELO = "celo",
MOONBEAM = "moonbeam",
MOONRIVER = "moonriver",
BASE = "base",
CRONOS = "cronos",
ELYSIUM = "elysium",
MOOI = "mooi",
ZKSYNC_ERA = "zksync-era",
}

const API_KEY = process.env.DAPPRADAR_API_KEY || "";
Expand Down
18 changes: 18 additions & 0 deletions src/sdk/cronos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as dotenv from "dotenv";

dotenv.config();

import { AVAILABLE_PROTOCOLS } from "./constants";
import EVMC_HTTP from "./EVMC-HTTP";

class Cronos extends EVMC_HTTP {
constructor(props: any) {
super(props);

this.protocol = AVAILABLE_PROTOCOLS.CRONOS;
this.chainId = 37;
this.node = process.env.CRONOS_NODE_HTTP;
}
}

export default Cronos;
18 changes: 18 additions & 0 deletions src/sdk/elysium.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as dotenv from "dotenv";

dotenv.config();

import {AVAILABLE_PROTOCOLS} from "./constants";
import EVMC_HTTP from "./EVMC-HTTP";

class Elysium extends EVMC_HTTP {
constructor(props: any) {
super(props);

this.protocol = AVAILABLE_PROTOCOLS.ELYSIUM;
this.chainId = 58;
this.node = process.env.ELYSIUM_NODE_HTTP;
}
}

export default Elysium;
18 changes: 18 additions & 0 deletions src/sdk/zksync-era.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as dotenv from "dotenv";

dotenv.config();

import {AVAILABLE_PROTOCOLS} from "./constants";
import EVMC_HTTP from "./EVMC-HTTP";

class ZksyncEra extends EVMC_HTTP {
constructor(props: any) {
super(props);

this.protocol = AVAILABLE_PROTOCOLS.ZKSYNC_ERA;
this.chainId = 93;
this.node = process.env.ZKSYNC_ERA_NODE_HTTP;
}
}

export default ZksyncEra;

0 comments on commit b9e7e15

Please sign in to comment.