@pioneer-platform/pioneer-balance 8.3.23 → 8.3.25
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/lib/index.d.ts +1 -0
- package/lib/index.js +28 -7
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
@@ -77,28 +77,50 @@ var Balance = /** @class */ (function () {
|
|
77
77
|
tag = TAG + " | init_network | ";
|
78
78
|
_a.label = 1;
|
79
79
|
case 1:
|
80
|
-
_a.trys.push([1,
|
80
|
+
_a.trys.push([1, 4, , 5]);
|
81
81
|
this.networks = new Network.Network({});
|
82
82
|
return [4 /*yield*/, this.networks.init()];
|
83
83
|
case 2:
|
84
84
|
_a.sent();
|
85
85
|
evmNodes = this.nodes.filter(function (node) { return node.networkId.indexOf('eip155') >= 0; });
|
86
|
-
console.log(tag, "evmNodes: ", evmNodes);
|
86
|
+
console.log(tag, "evmNodes: ", evmNodes.length);
|
87
87
|
console.log('this.networks: ', this.networks);
|
88
|
-
this.networks.networks.ethereum.addNodes(evmNodes);
|
89
|
-
return [2 /*return*/, true];
|
88
|
+
return [4 /*yield*/, this.networks.networks.ethereum.addNodes(evmNodes)];
|
90
89
|
case 3:
|
90
|
+
_a.sent();
|
91
|
+
return [2 /*return*/, true];
|
92
|
+
case 4:
|
91
93
|
e_1 = _a.sent();
|
92
94
|
console.error(tag, e_1);
|
93
95
|
throw e_1;
|
94
|
-
case
|
96
|
+
case 5: return [2 /*return*/];
|
97
|
+
}
|
98
|
+
});
|
99
|
+
});
|
100
|
+
};
|
101
|
+
Balance.prototype.getNodes = function (networkId) {
|
102
|
+
return __awaiter(this, void 0, void 0, function () {
|
103
|
+
var tag, nodes;
|
104
|
+
return __generator(this, function (_a) {
|
105
|
+
tag = TAG + " | getNodes | ";
|
106
|
+
try {
|
107
|
+
console.log(tag, "networkId: ", networkId);
|
108
|
+
console.log(tag, 'total nodes: ', this.nodes.length);
|
109
|
+
nodes = this.nodes.filter(function (node) { return node.networkId === networkId; });
|
110
|
+
console.log(tag, 'nodes: ', nodes.length);
|
111
|
+
return [2 /*return*/, nodes];
|
112
|
+
}
|
113
|
+
catch (e) {
|
114
|
+
console.error(tag, e);
|
115
|
+
throw e;
|
95
116
|
}
|
117
|
+
return [2 /*return*/];
|
96
118
|
});
|
97
119
|
});
|
98
120
|
};
|
99
121
|
Balance.prototype.getBalance = function (asset, pubkey) {
|
100
122
|
return __awaiter(this, void 0, void 0, function () {
|
101
|
-
var tag, networkId,
|
123
|
+
var tag, networkId, balance;
|
102
124
|
return __generator(this, function (_a) {
|
103
125
|
switch (_a.label) {
|
104
126
|
case 0:
|
@@ -109,7 +131,6 @@ var Balance = /** @class */ (function () {
|
|
109
131
|
throw new Error("pubkey required!");
|
110
132
|
networkId = caipToNetworkId(asset.caip);
|
111
133
|
console.info(tag, "networkId: ", networkId);
|
112
|
-
networkNodes = this.nodes.filter(function (node) { return node.networkId === networkId; });
|
113
134
|
if (!(networkId.indexOf('eip155') >= 0)) return [3 /*break*/, 2];
|
114
135
|
return [4 /*yield*/, this.networks.networks.ethereum.getBalanceAddressByNetwork(networkId, pubkey.pubkey)];
|
115
136
|
case 1:
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pioneer-platform/pioneer-balance",
|
3
|
-
"version": "8.3.
|
3
|
+
"version": "8.3.25",
|
4
4
|
"main": "./lib/index.js",
|
5
5
|
"types": "./lib/main.d.ts",
|
6
6
|
"scripts": {
|
@@ -14,8 +14,8 @@
|
|
14
14
|
"refresh": "rm -rf ./node_modules ./package-lock.json && npm install"
|
15
15
|
},
|
16
16
|
"dependencies": {
|
17
|
-
"@pioneer-platform/pioneer-caip": "^9.2.
|
18
|
-
"@pioneer-platform/pioneer-network": "^8.3.
|
17
|
+
"@pioneer-platform/pioneer-caip": "^9.2.34",
|
18
|
+
"@pioneer-platform/pioneer-network": "^8.3.24",
|
19
19
|
"@types/node": "^18.15.11",
|
20
20
|
"events": "^3.3.0",
|
21
21
|
"socket.io-client": "^4.5.4",
|