@pioneer-platform/cosmos-network 8.3.2 → 8.3.5
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 -2
- package/lib/index.js +18 -20
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -170,6 +170,9 @@ module.exports = {
|
|
|
170
170
|
getBalances: function (address) {
|
|
171
171
|
return get_balances(address);
|
|
172
172
|
},
|
|
173
|
+
getVoucherInfo: function (voucher) {
|
|
174
|
+
return get_voucher_info(voucher);
|
|
175
|
+
},
|
|
173
176
|
getBlock: function (height) {
|
|
174
177
|
return get_block(height);
|
|
175
178
|
},
|
|
@@ -319,7 +322,9 @@ var get_voucher_info = function (voucher) {
|
|
|
319
322
|
_a.label = 1;
|
|
320
323
|
case 1:
|
|
321
324
|
_a.trys.push([1, 3, , 4]);
|
|
322
|
-
url = URL_GAIAD + '/ibc/
|
|
325
|
+
url = URL_GAIAD + '/ibc/apps/transfer/v1/denom_traces/' + voucher;
|
|
326
|
+
// let url = URL_GAIAD + '/cosmos/bank/v1beta1/denoms_metadata/' + voucher;
|
|
327
|
+
// let url = URL_GAIAD + '/cosmos/bank/v1beta1/denoms_metadata/' + voucher;
|
|
323
328
|
log.debug(tag, "url: ", url);
|
|
324
329
|
return [4 /*yield*/, axios({ method: 'GET', url: url })];
|
|
325
330
|
case 2:
|
|
@@ -352,7 +357,7 @@ var get_balances = function (address) {
|
|
|
352
357
|
return [4 /*yield*/, axios({ method: 'GET', url: URL_GAIAD + '/bank/balances/' + address })];
|
|
353
358
|
case 3:
|
|
354
359
|
accountInfo = _b.sent();
|
|
355
|
-
log.
|
|
360
|
+
log.info(tag, "accountInfo: ", accountInfo.data);
|
|
356
361
|
if (!((_a = accountInfo.data) === null || _a === void 0 ? void 0 : _a.result)) return [3 /*break*/, 7];
|
|
357
362
|
i = 0;
|
|
358
363
|
_b.label = 4;
|
|
@@ -370,27 +375,20 @@ var get_balances = function (address) {
|
|
|
370
375
|
}
|
|
371
376
|
if (!(entry.denom.indexOf('ibc/') >= 0)) return [3 /*break*/, 6];
|
|
372
377
|
voucher = entry.denom.replace('ibc/', '');
|
|
373
|
-
log.
|
|
378
|
+
log.info(tag, "voucher: ", voucher);
|
|
374
379
|
return [4 /*yield*/, get_voucher_info(voucher)];
|
|
375
380
|
case 5:
|
|
376
381
|
voucherInfo = _b.sent();
|
|
377
|
-
log.
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
};
|
|
388
|
-
output.push(balance);
|
|
389
|
-
}
|
|
390
|
-
else {
|
|
391
|
-
//TODO lookup base_denum to asset
|
|
392
|
-
//handle more assets
|
|
393
|
-
}
|
|
382
|
+
log.info(tag, "voucherInfo: ", voucherInfo);
|
|
383
|
+
balance = {
|
|
384
|
+
type: 'ibcChannel',
|
|
385
|
+
ibc: true,
|
|
386
|
+
voucher: voucher,
|
|
387
|
+
denom: voucherInfo.denom_trace.base_denom,
|
|
388
|
+
channel: voucherInfo.denom_trace.path,
|
|
389
|
+
balance: entry.amount / 1000000
|
|
390
|
+
};
|
|
391
|
+
output.push(balance);
|
|
394
392
|
_b.label = 6;
|
|
395
393
|
case 6:
|
|
396
394
|
i++;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/cosmos-network",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.5",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"create": "npm run build && npm run test",
|
|
6
6
|
"build": "tsc -p .",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
},
|
|
31
31
|
"author": "Bithighlander <pioneer@gmail.com>",
|
|
32
32
|
"license": "ISC",
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "4c12b840606a82a8dabf03389e9c32c44d1efda6"
|
|
34
34
|
}
|