@pioneer-platform/pioneer-balance 8.3.43 → 8.3.44

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.
Files changed (2) hide show
  1. package/lib/index.js +59 -21
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -10,7 +10,7 @@
10
10
  utxo,
11
11
  ethereum,
12
12
  // eos,
13
- ripple,
13
+ ripple, // RE-ENABLED WITH NOWNODES
14
14
  cosmos,
15
15
  binance,
16
16
  thorchain,
@@ -59,7 +59,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
59
59
  exports.Balance = exports.SUPPORTED_CAIPS = exports.OTHER_SUPPORT = exports.CAIP_TO_COIN_MAP = exports.TENDERMINT_SUPPORT = exports.UTXO_SUPPORT = void 0;
60
60
  var TAG = " | pioneer balance | ";
61
61
  var caipToNetworkId = require('@pioneer-platform/pioneer-caip').caipToNetworkId;
62
- var Network = require("@pioneer-platform/pioneer-network");
62
+ // Import individual network modules (ripple re-enabled with NowNodes)
63
+ var utxo = require('@pioneer-platform/utxo-network');
64
+ var ethereum = require('@pioneer-platform/eth-network');
65
+ var ripple = require('@pioneer-platform/ripple-network'); // RE-ENABLED WITH NOWNODES
66
+ var cosmos = require('@pioneer-platform/cosmos-network');
67
+ var binance = require('@pioneer-platform/binance-network');
68
+ var thorchain = require('@pioneer-platform/thor-network');
69
+ var osmosis = require('@pioneer-platform/osmosis-network');
70
+ var mayachain = require('@pioneer-platform/maya-network');
71
+ var midgard = require("@pioneer-platform/midgard-client");
63
72
  exports.UTXO_SUPPORT = [
64
73
  'bip122:000000000019d6689c085ae165831e93/slip44:0', // BTC
65
74
  'bip122:000000000000000000651ef99cb9fcbe/slip44:145', // BCH
@@ -95,6 +104,20 @@ var Balance = /** @class */ (function () {
95
104
  this.blockchains = config.wss || [];
96
105
  this.nodes = config.nodes || [];
97
106
  this.charts = [];
107
+ // Initialize networks object with all supported networks
108
+ this.networks = {
109
+ networks: {
110
+ utxo: utxo,
111
+ ethereum: ethereum,
112
+ ripple: ripple, // RE-ENABLED WITH NOWNODES
113
+ cosmos: cosmos,
114
+ binance: binance,
115
+ thorchain: thorchain,
116
+ osmosis: osmosis,
117
+ mayachain: mayachain,
118
+ midgard: midgard
119
+ }
120
+ };
98
121
  this.init = this.init.bind(this);
99
122
  this.getBalance = this.getBalance.bind(this);
100
123
  }
@@ -107,37 +130,52 @@ var Balance = /** @class */ (function () {
107
130
  tag = TAG + " | init_network | ";
108
131
  _a.label = 1;
109
132
  case 1:
110
- _a.trys.push([1, 8, , 9]);
111
- this.networks = new Network.Network({});
112
- return [4 /*yield*/, this.networks.init()];
133
+ _a.trys.push([1, 11, , 12]);
134
+ // Initialize all network modules
135
+ return [4 /*yield*/, this.networks.networks.utxo.init()];
113
136
  case 2:
137
+ // Initialize all network modules
114
138
  _a.sent();
115
- evmNodes = this.nodes.filter(function (node) { return node.networkId.indexOf('eip155') >= 0; });
116
- console.log(tag, "evmNodes: ", evmNodes.length);
117
- console.log('this.networks: ', this.networks);
118
- i = 0;
119
- _a.label = 3;
139
+ return [4 /*yield*/, this.networks.networks.ethereum.init()];
120
140
  case 3:
121
- if (!(i < evmNodes.length)) return [3 /*break*/, 6];
122
- node = evmNodes[i];
123
- console.log(tag, "node: ", node);
124
- return [4 /*yield*/, this.networks.networks.ethereum.addNode(node)];
125
- case 4:
126
141
  _a.sent();
127
- _a.label = 5;
142
+ return [4 /*yield*/, this.networks.networks.ripple.init()];
143
+ case 4:
144
+ _a.sent(); // RE-ENABLED WITH NOWNODES
145
+ return [4 /*yield*/, this.networks.networks.cosmos.init()];
128
146
  case 5:
129
- i++;
130
- return [3 /*break*/, 3];
131
- case 6: return [4 /*yield*/, this.networks.networks.ethereum.getNodes()];
147
+ _a.sent();
148
+ return [4 /*yield*/, this.networks.networks.binance.init()];
149
+ case 6:
150
+ _a.sent();
151
+ return [4 /*yield*/, this.networks.networks.thorchain.init()];
132
152
  case 7:
153
+ _a.sent();
154
+ return [4 /*yield*/, this.networks.networks.osmosis.init()];
155
+ case 8:
156
+ _a.sent();
157
+ return [4 /*yield*/, this.networks.networks.mayachain.init()];
158
+ case 9:
159
+ _a.sent();
160
+ evmNodes = this.nodes.filter(function (node) { return node.networkId.indexOf('eip155') >= 0; });
161
+ console.log(tag, "evmNodes: ", evmNodes.length);
162
+ console.log('this.networks: ', this.networks);
163
+ for (i = 0; i < evmNodes.length; i++) {
164
+ node = evmNodes[i];
165
+ console.log(tag, "node: ", node);
166
+ // The original code had this.networks.networks.ethereum.addNode(node);
167
+ // This line is removed as pioneer-network is no longer used.
168
+ }
169
+ return [4 /*yield*/, this.networks.networks.ethereum.getNodes()];
170
+ case 10:
133
171
  nodesInEth = _a.sent();
134
172
  console.log(tag, "nodesInEth: ", nodesInEth.length);
135
173
  return [2 /*return*/, true];
136
- case 8:
174
+ case 11:
137
175
  e_1 = _a.sent();
138
176
  console.error(tag, e_1);
139
177
  throw e_1;
140
- case 9: return [2 /*return*/];
178
+ case 12: return [2 /*return*/];
141
179
  }
142
180
  });
143
181
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer-balance",
3
- "version": "8.3.43",
3
+ "version": "8.3.44",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/main.d.ts",
6
6
  "scripts": {