Skip to content

Commit

Permalink
feat: add base l2 chain identifiers (#1133)
Browse files Browse the repository at this point in the history
* feat: add base l2 chain identifiers

* fix: add isTestChain

* chore: bump version to 6.1.6

* chore: add warning for testnet list to update another spot
  • Loading branch information
sambarnes authored Aug 4, 2023
1 parent bea2b4c commit 69fb2ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensea-js",
"version": "6.1.5",
"version": "6.1.6",
"description": "JavaScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data!",
"license": "MIT",
"author": "OpenSea Developers",
Expand Down
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ export enum Chain {
Polygon = "matic",
/** Klaytn */
Klaytn = "klaytn",
/** Base L2 */
Base = "base",
/** Binance Smart Chain */
BNB = "bsc",
/** Arbitrum */
Expand All @@ -122,6 +124,7 @@ export enum Chain {
Zora = "zora",

// Testnet Chains
// ⚠️NOTE: When adding to this list, also add to the util function `isTestChain`
/** Goerli */
Goerli = "goerli",
/** Sepolia */
Expand All @@ -130,6 +133,8 @@ export enum Chain {
Mumbai = "mumbai",
/** Klaytn Baobab */
Baobab = "baobab",
/** Base L2 Testnet */
BaseGoerli = "base_goerli",
/** Binance Smart Chain Testnet */
BNBTestnet = "bsctestnet",
/** Arbitrum Testnet */
Expand Down
4 changes: 4 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ export const getWETHAddress = (chain: Chain) => {
case Chain.BNBTestnet:
return "0xae13d989dac2f0debff460ac112a837c89baa7cd";
// OP Chains have weth at the same address
case Chain.Base:
case Chain.BaseGoerli:
case Chain.Optimism:
case Chain.OptimismGoerli:
case Chain.Zora:
case Chain.ZoraTestnet:
return "0x4200000000000000000000000000000000000006";
Expand Down Expand Up @@ -397,6 +400,7 @@ export const isTestChain = (chain: Chain): boolean => {
case Chain.Sepolia:
case Chain.Mumbai:
case Chain.Baobab:
case Chain.BaseGoerli:
case Chain.BNBTestnet:
case Chain.ArbitrumGoerli:
case Chain.Fuji:
Expand Down

0 comments on commit 69fb2ba

Please sign in to comment.