mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
Better provider init
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.17.15",
|
||||
"version": "0.17.16",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/esm/index.js",
|
||||
"module": "./lib/esm/index.js",
|
||||
|
||||
@@ -76,7 +76,9 @@ export default class OrionUnit {
|
||||
// this.env = config.env;
|
||||
this.chainId = config.chainId;
|
||||
this.networkCode = chainInfo.code;
|
||||
this.provider = new ethers.providers.StaticJsonRpcProvider(this.config.nodeJsonRpc);
|
||||
const intNetwork = parseInt(this.chainId, 10);
|
||||
if (Number.isNaN(intNetwork)) throw new Error('Invalid chainId (not a number)' + this.chainId);
|
||||
this.provider = new ethers.providers.StaticJsonRpcProvider(this.config.nodeJsonRpc, intNetwork);
|
||||
|
||||
this.orionBlockchain = new OrionBlockchain(this.config.services.orionBlockchain.http);
|
||||
this.orionAggregator = new OrionAggregator(
|
||||
|
||||
@@ -3,6 +3,7 @@ import { SupportedChainId } from '../types';
|
||||
export const developmentChains = [
|
||||
SupportedChainId.BSC_TESTNET,
|
||||
SupportedChainId.ROPSTEN,
|
||||
SupportedChainId.GOERLI,
|
||||
SupportedChainId.FANTOM_TESTNET,
|
||||
SupportedChainId.POLYGON_TESTNET,
|
||||
SupportedChainId.OKC_TESTNET,
|
||||
|
||||
Reference in New Issue
Block a user