mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-30 01:27:57 +03:00
Sublings optimization
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { ethers } from 'ethers';
|
||||
import getOrionUnitSiblings from '../getOrionUnitSiblings';
|
||||
import { OrionAggregator } from '../services/OrionAggregator';
|
||||
import OrionAnalytics from '../services/OrionAnalytics';
|
||||
import { OrionBlockchain } from '../services/OrionBlockchain';
|
||||
@@ -143,6 +142,13 @@ export default class OrionUnit {
|
||||
}
|
||||
|
||||
get siblings() {
|
||||
return getOrionUnitSiblings(this.chainId, this.env);
|
||||
const envInfo = envs[this.env];
|
||||
const envNetworks = envInfo?.networks;
|
||||
|
||||
const siblingsNetworks = Object
|
||||
.keys(envNetworks)
|
||||
.filter(isValidChainId)
|
||||
.filter((chainId) => chainId !== this.chainId);
|
||||
return siblingsNetworks.map((chainId) => new OrionUnit(chainId, this.env));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user