Skip to content

Commit

Permalink
Merge branch 'NickKelly1-devop/add-opbnb-network' into devop/release-…
Browse files Browse the repository at this point in the history
…prep
  • Loading branch information
kvhnuke committed Aug 15, 2024
2 parents 9a40208 + cd5fdb0 commit c8a4319
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/extension/src/libs/nft-handlers/simplehash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default async (
[NetworkNames.Linea]: "linea",
[NetworkNames.MantaPacific]: "manta",
[NetworkNames.Mode]: "mode",
[NetworkNames.OpBNB]: "opbnb",
};
if (!Object.keys(supportedNetworks).includes(network.name))
throw new Error("Simplehash: network not supported");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ const supportedNetworks: Record<SupportedNetworkNames, SupportedNetwork> = {
tbName: "mode",
cgPlatform: CoingeckoPlatform.Mode,
},
[NetworkNames.OpBNB]: {
tbName: "opbnb",
cgPlatform: CoingeckoPlatform.OpBNB,
},
};

const getTokens = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const TokenList: Record<SupportedNetworkNames, string> = {
[NetworkNames.Linea]: `https://tokens.coingecko.com/${CoingeckoPlatform.Linea}/all.json`,
[NetworkNames.MantaPacific]: `https://tokens.coingecko.com/${CoingeckoPlatform.MantaPacific}/all.json`,
[NetworkNames.Mode]: `https://tokens.coingecko.com/${CoingeckoPlatform.Mode}/all.json`,
[NetworkNames.OpBNB]: `https://tokens.coingecko.com/${CoingeckoPlatform.OpBNB}/all.json`,
};

const getKnownNetworkTokens = async (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ export type SupportedNetworkNames =
| NetworkNames.Godwoken
| NetworkNames.Linea
| NetworkNames.MantaPacific
| NetworkNames.Mode;
| NetworkNames.Mode
| NetworkNames.OpBNB;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions packages/extension/src/providers/ethereum/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ import blastNode from "./blast";
import sankoNode from "./dmt";
import degenNode from "./degen";
import hamNode from "./ham";
<<<<<<< HEAD
import zcdNode from "./zcd";
import immutableZkevmNode from "./immutable-zkevm";
import formaNode from "./forma";
import godwokenNode from "./godwoken";
import lineaNode from "./linea";
import mantaPacificNode from "./manta-pacific";
=======
import modeNode from "./mode";
>>>>>>> 374b1106bb46580513954011e61377b81276a57d
import opbnbNode from "./op-bnb";

export default {
sepolia: sepoliaNode,
Expand Down Expand Up @@ -118,4 +116,5 @@ export default {
linea: lineaNode,
mantaPacific: mantaPacificNode,
mode: modeNode,
opbnb: opbnbNode,
};
27 changes: 27 additions & 0 deletions packages/extension/src/providers/ethereum/networks/op-bnb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CoingeckoPlatform, NetworkNames } from "@enkryptcom/types";
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";
import assetsInfoHandler from "@/providers/ethereum/libs/assets-handlers/assetinfo-mew";
import shNFTHandler from "@/libs/nft-handlers/simplehash";

const opBnbOptions: EvmNetworkOptions = {
name: NetworkNames.OpBNB,
name_long: "opBNB",
homePage: "https://opbnb.bnbchain.org/en",
blockExplorerTX: "https://opbnbscan.com/tx/[[txHash]]",
blockExplorerAddr: "https://opbnbscan.com/address/[[address]]",
chainID: "0xcc",
isTestNetwork: false,
currencyName: "BNB",
currencyNameLong: "Binance Coin",
node: "wss://opbnb-rpc.publicnode.com",
icon: require("./icons/opbnb.png"),
coingeckoID: "binancecoin",
coingeckoPlatform: CoingeckoPlatform.OpBNB,
assetsInfoHandler,
NFTHandler: shNFTHandler,
activityHandler: () => Promise.resolve([]),
};

const op = new EvmNetwork(opBnbOptions);

export default op;
2 changes: 2 additions & 0 deletions packages/types/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export enum NetworkNames {
Linea = "Linea",
MantaPacific = "MantaPacific",
Mode = "mode",
OpBNB = "OpBNB",
}

export enum CoingeckoPlatform {
Expand Down Expand Up @@ -137,4 +138,5 @@ export enum CoingeckoPlatform {
Linea = "linea",
MantaPacific = "manta-pacific",
Mode = "mode",
OpBNB = "opbnb",
}

1 comment on commit c8a4319

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.