Skip to content

Commit

Permalink
feat: added new chains BASE, AVAX, OPBNB
Browse files Browse the repository at this point in the history
  • Loading branch information
cheshirrrcat committed Apr 22, 2024
1 parent 9ec81ad commit 7ba80e0
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "@electra.finance/sdk",
"version": "0.1.57-rc3",
"version": "0.1.57-rc4",
"description": "Electra finance SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",
Expand Down
27 changes: 27 additions & 0 deletions src/config/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@
"rpc": "testnet.1d.rip",
"explorer": "https://explorer-testnet.1d.rip/"
},
"204": {
"chainId": "204",
"explorer": "http://opbnbscan.com/",
"label": "opBNB Chain",
"shortName": "opBNB",
"code": "opbnb",
"rpc": "https://opbnb-mainnet-rpc.bnbchain.org",
"baseCurrencyName": "BNB"
},
"2525": {
"chainId": "2525",
"label": "inEVM",
Expand All @@ -133,5 +142,23 @@
"baseCurrencyName": "ETH",
"rpc": "https://rpc.linea.build/",
"explorer": "https://lineascan.build/"
},
"43114": {
"chainId": "43114",
"label": "Avalanche Network",
"shortName": "Avax",
"code": "avax",
"baseCurrencyName": "AVAX",
"rpc": "https://api.avax.network/ext/bc/C/rpc/",
"explorer": "https://snowtrace.io/"
},
"8453": {
"chainId": "8453",
"label": "Base",
"shortName": "BASE",
"code": "base",
"baseCurrencyName": "ETH",
"rpc": "https://mainnet.base.org/",
"explorer": "https://basescan.org/"
}
}
96 changes: 96 additions & 0 deletions src/config/envs.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,24 @@
}
}
},
"204": {
"api": "https://electra.finance/opbnb-mainnet",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
},
"indexer": {
"http": "/orion-indexer/"
}
}
},
"2525": {
"api": "https://electra.finance/inevm-mainnet",
"services": {
Expand Down Expand Up @@ -108,6 +126,36 @@
"all": "/price-feed"
}
}
},
"43114": {
"api": "https://electra.finance/avalanche-c-chain",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"8453": {
"api": "https://electra.finance/base-mainnet",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
}
},
"testing": {
Expand Down Expand Up @@ -286,6 +334,24 @@
}
}
},
"204": {
"api": "https://staging.electra.finance/opbnb-mainnet",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
},
"indexer": {
"http": "/orion-indexer/"
}
}
},
"2525": {
"api": "https://staging.electra.finance/inevm-mainnet",
"services": {
Expand Down Expand Up @@ -315,6 +381,36 @@
"all": "/price-feed"
}
}
},
"43114": {
"api": "https://staging.electra.finance/avalanche-c-chain",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"8453": {
"api": "https://staging.electra.finance/base-mainnet",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
}
},
"experimental": {
Expand Down
2 changes: 2 additions & 0 deletions src/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export const productionChains = [
SupportedChainId.OKC,
SupportedChainId.INEVM,
SupportedChainId.LINEA,
SupportedChainId.AVAX,
SupportedChainId.BASE,
];
2 changes: 1 addition & 1 deletion src/constants/networkCodes.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['ftm', 'bsc', 'eth', 'polygon', 'okc', 'arb', 'drip', 'inevm', 'linea'] as const;
export default ['ftm', 'bsc', 'eth', 'polygon', 'okc', 'arb', 'drip', 'opbnb', 'inevm', 'linea', 'avax', 'base'] as const;
2 changes: 1 addition & 1 deletion src/constants/uppercasedNetworkCodes.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['FTM', 'BSC', 'ETH', 'POLYGON', 'OKC', 'ARB'] as const;
export default ['FTM', 'BSC', 'ETH', 'POLYGON', 'OKC', 'ARB', 'DRIP', 'OPBNB', 'INEVM', 'LINEA', 'AVAX', 'BASE'] as const;
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ export enum SupportedChainId {
OKC = '66',
INEVM = '2525',
LINEA = '59144',
AVAX = '43114',
BASE = '8453',

POLYGON_TESTNET = '80001',
FANTOM_TESTNET = '4002',
Expand Down

0 comments on commit 7ba80e0

Please sign in to comment.