@osn/polkadot-api-container 1.0.12 → 1.1.0

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.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@osn/polkadot-api-container",
3
- "version": "1.0.12",
3
+ "version": "1.1.0",
4
4
  "main": "src/index.js",
5
5
  "repository": "git@github.com:opensquare-network/polkadot-api-container.git",
6
6
  "author": "OpenSquare <https://www.opensquare.network/>",
7
7
  "license": "Apache-2.0",
8
8
  "dependencies": {
9
9
  "@osn/provider-options": "1.1.0",
10
- "@polkadot/api": "9.6.2",
10
+ "@polkadot/api": "9.7.1",
11
11
  "lodash.isnil": "^4.0.0"
12
12
  },
13
13
  "peerDependencies": {
package/src/apis/index.js CHANGED
@@ -13,6 +13,7 @@ const {
13
13
  parallelOptions,
14
14
  shidenOptions,
15
15
  } = require("@osn/provider-options");
16
+ const allOptions = require("@osn/provider-options");
16
17
 
17
18
  const nodeTimeoutSeconds = 20;
18
19
 
@@ -48,7 +49,7 @@ async function reConnect(network, endpoint, logger) {
48
49
  async function createApi(network, endpoint, logger = console) {
49
50
  const provider = new WsProvider(endpoint, 100);
50
51
 
51
- let options = {};
52
+ let options;
52
53
  if ([chains.karura, chains.acala].includes(network)) {
53
54
  options = karuraOptions;
54
55
  } else if ([chains.khala, chains.phala].includes(network)) {
@@ -69,6 +70,8 @@ async function createApi(network, endpoint, logger = console) {
69
70
  options = parallelOptions;
70
71
  } else if (chains.shiden === network) {
71
72
  options = shidenOptions;
73
+ } else {
74
+ options = allOptions[network] || {};
72
75
  }
73
76
 
74
77
  let api;
@@ -20,6 +20,8 @@ const chains = {
20
20
  zeitgeist: "zeitgeist",
21
21
  shiden: "shiden",
22
22
  parallel: "parallel",
23
+ basilisk: "basilisk",
24
+ hydradx: "hydradx",
23
25
  };
24
26
 
25
27
  module.exports = {