mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-04-08 05:57:49 +03:00
Added network code to OrionUnit
This commit is contained in:
@@ -12,6 +12,8 @@ const orionAnalyticsHost = 'trade.orionprotocol.io';
|
||||
export default class OrionUnit {
|
||||
public readonly env: string;
|
||||
|
||||
public readonly networkCode: string;
|
||||
|
||||
public readonly chainId: SupportedChainId;
|
||||
|
||||
public readonly provider: ethers.providers.StaticJsonRpcProvider;
|
||||
@@ -32,11 +34,13 @@ export default class OrionUnit {
|
||||
|
||||
constructor(
|
||||
chainId: SupportedChainId,
|
||||
networkCode: string,
|
||||
rpc: string,
|
||||
env: string,
|
||||
apiUrl: string,
|
||||
) {
|
||||
this.chainId = chainId;
|
||||
this.networkCode = networkCode;
|
||||
this.provider = new ethers.providers.StaticJsonRpcProvider(rpc);
|
||||
this.env = env;
|
||||
this.apiUrl = apiUrl;
|
||||
|
||||
@@ -47,6 +47,7 @@ export default function initOrionUnit(chain: string, env: string) {
|
||||
|
||||
return new OrionUnit(
|
||||
chainId,
|
||||
chainInfo.code,
|
||||
envNetworkInfo.rpc ?? chainInfo.rpc,
|
||||
env,
|
||||
envNetworkInfo.api,
|
||||
|
||||
Reference in New Issue
Block a user