@heliofi/common 0.1.196 → 0.1.197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { GeneralNetwork } from '../constants';
|
|
2
|
-
import { Cluster } from '../model';
|
|
2
|
+
import { BlockchainSymbol, Cluster } from '../model';
|
|
3
3
|
export declare class ClusterService {
|
|
4
4
|
static toBECluster: (cluster: GeneralNetwork) => Cluster;
|
|
5
|
+
static getBlockchainClusterEndpoint: (cluster: Cluster, blockchain: BlockchainSymbol) => string;
|
|
5
6
|
static getPolygonClusterEndpoint: (cluster: Cluster) => string;
|
|
7
|
+
static getSolanaClusterEndpoint: (cluster: Cluster) => string;
|
|
6
8
|
static getEthClusterEndpoint: (cluster: Cluster) => string;
|
|
7
9
|
}
|
|
@@ -18,6 +18,18 @@ ClusterService.toBECluster = (cluster) => {
|
|
|
18
18
|
throw new Error('No such type in general network');
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
+
ClusterService.getBlockchainClusterEndpoint = (cluster, blockchain) => {
|
|
22
|
+
switch (blockchain) {
|
|
23
|
+
case model_1.BlockchainSymbol.ETH:
|
|
24
|
+
return ClusterService.getEthClusterEndpoint(cluster);
|
|
25
|
+
case model_1.BlockchainSymbol.POLYGON:
|
|
26
|
+
return ClusterService.getPolygonClusterEndpoint(cluster);
|
|
27
|
+
case model_1.BlockchainSymbol.SOL:
|
|
28
|
+
return ClusterService.getSolanaClusterEndpoint(cluster);
|
|
29
|
+
default:
|
|
30
|
+
throw new Error('Wrong blockchain provided');
|
|
31
|
+
}
|
|
32
|
+
};
|
|
21
33
|
ClusterService.getPolygonClusterEndpoint = (cluster) => {
|
|
22
34
|
switch (cluster) {
|
|
23
35
|
case model_1.Cluster.MAIN_NET:
|
|
@@ -26,6 +38,14 @@ ClusterService.getPolygonClusterEndpoint = (cluster) => {
|
|
|
26
38
|
return 'https://sleek-floral-morning.matic-testnet.quiknode.pro/36f1f4259eedb86189d518239c1180469f798eb1/';
|
|
27
39
|
}
|
|
28
40
|
};
|
|
41
|
+
ClusterService.getSolanaClusterEndpoint = (cluster) => {
|
|
42
|
+
switch (cluster) {
|
|
43
|
+
case model_1.Cluster.MAIN_NET:
|
|
44
|
+
return 'https://wiser-fittest-river.solana-mainnet.quiknode.pro/';
|
|
45
|
+
default:
|
|
46
|
+
return 'https://evocative-light-card.solana-devnet.quiknode.pro/';
|
|
47
|
+
}
|
|
48
|
+
};
|
|
29
49
|
ClusterService.getEthClusterEndpoint = (cluster) => {
|
|
30
50
|
switch (cluster) {
|
|
31
51
|
case model_1.Cluster.MAIN_NET:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterService.js","sourceRoot":"","sources":["../../../../src/domain/services/ClusterService.ts"],"names":[],"mappings":";;;AAAA,4CAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"ClusterService.js","sourceRoot":"","sources":["../../../../src/domain/services/ClusterService.ts"],"names":[],"mappings":";;;AAAA,4CAA8C;AAC9C,oCAAqD;AAErD,MAAa,cAAc;;AAA3B,wCAwDC;AAvDQ,0BAAW,GAAG,CAAC,OAAuB,EAAW,EAAE;IACxD,QAAQ,OAAO,EAAE;QACf,KAAK,0BAAc,CAAC,MAAM;YACxB,OAAO,eAAO,CAAC,OAAO,CAAC;QACzB,KAAK,0BAAc,CAAC,OAAO;YACzB,OAAO,eAAO,CAAC,QAAQ,CAAC;QAC1B,KAAK,0BAAc,CAAC,OAAO;YACzB,OAAO,eAAO,CAAC,QAAQ,CAAC;QAC1B;YACE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;KACtD;AACH,CAAC,CAAC;AAEK,2CAA4B,GAAG,CACpC,OAAgB,EAChB,UAA4B,EACpB,EAAE;IACV,QAAQ,UAAU,EAAE;QAClB,KAAK,wBAAgB,CAAC,GAAG;YACvB,OAAO,cAAc,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC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