@pioneer-platform/osmosis-network 8.1.25 → 8.1.26
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.js +45 -18
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -38,7 +38,35 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
/*
|
|
39
39
|
OSMO Network
|
|
40
40
|
|
|
41
|
+
https://api-osmosis.imperator.co/swagger/#/
|
|
41
42
|
|
|
43
|
+
|
|
44
|
+
https://github.com/osmosis-labs/osmosis-frontend/tree/master/src/stores/osmosis/query
|
|
45
|
+
|
|
46
|
+
endpoints
|
|
47
|
+
'/osmosis/gamm/v1beta1/num_pools'
|
|
48
|
+
`/osmosis/pool-incentives/v1beta1/distr_info`
|
|
49
|
+
`/osmosis/mint/v1beta1/epoch_provisions`
|
|
50
|
+
'/osmosis/pool-incentives/v1beta1/lockable_durations'
|
|
51
|
+
`/cosmos/params/v1beta1/params?subspace=gamm&key=PoolCreationFee`
|
|
52
|
+
`/osmosis/mint/v1beta1/params`
|
|
53
|
+
`/osmosis/claim/v1beta1/params`
|
|
54
|
+
`/osmosis/gamm/v1beta1/pools/${poolId}`
|
|
55
|
+
`/osmosis/claim/v1beta1/total_claimable/${bech32Address}`
|
|
56
|
+
`/osmosis/lockup/v1beta1/account_unlockable_coins/${bech32Address}`
|
|
57
|
+
`/osmosis/lockup/v1beta1/account_locked_coins/${bech32Address}`
|
|
58
|
+
`/osmosis/lockup/v1beta1/account_unlocking_coins/${bech32Address}`
|
|
59
|
+
`/osmosis/claim/v1beta1/claim_record/${bech32Address}`
|
|
60
|
+
`/osmosis/incentives/v1beta1/gauge_by_id/${id}`
|
|
61
|
+
`/osmosis/gamm/v1beta1/pools?pagination.limit=500`
|
|
62
|
+
`/osmosis/lockup/v1beta1/account_locked_longer_duration/${bech32Address}`
|
|
63
|
+
'/osmosis/pool-incentives/v1beta1/incentivized_pools'
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
IBC
|
|
67
|
+
`/ibc/core/channel/v1beta1/channels/${params.channelId}/ports/${params.portId}`
|
|
68
|
+
`/ibc/core/channel/v1beta1/channels/${channelId}/ports/${portId}/client_state`
|
|
69
|
+
"/cosmos/base/tendermint/v1beta1/node_info"
|
|
42
70
|
*/
|
|
43
71
|
var pjson = require("../package.json");
|
|
44
72
|
var TAG = " | " + pjson.name.replace("@pioneer-platform/", "") + " | ";
|
|
@@ -276,13 +304,13 @@ var broadcast_transaction = function (tx) {
|
|
|
276
304
|
})];
|
|
277
305
|
case 3:
|
|
278
306
|
result2 = _a.sent();
|
|
279
|
-
log.
|
|
307
|
+
log.debug(tag, '** Broadcast ** REMOTE: result: ', result2.data);
|
|
280
308
|
if (result2.data.txhash)
|
|
281
309
|
output.txid = result2.data.txhash;
|
|
282
310
|
//verify success
|
|
283
311
|
if (result2.data.raw_log) {
|
|
284
312
|
logSend = result2.data.raw_log;
|
|
285
|
-
log.
|
|
313
|
+
log.debug(tag, "logSend: ", logSend);
|
|
286
314
|
}
|
|
287
315
|
output.height = result2.height;
|
|
288
316
|
output.gas_wanted = result2.gas_wanted;
|
|
@@ -330,7 +358,7 @@ var get_account_info = function (address) {
|
|
|
330
358
|
return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/auth/accounts/' + address })];
|
|
331
359
|
case 2:
|
|
332
360
|
txInfo = _a.sent();
|
|
333
|
-
log.
|
|
361
|
+
log.debug(tag, "txInfo: ", txInfo.data);
|
|
334
362
|
return [2 /*return*/, txInfo.data];
|
|
335
363
|
case 3:
|
|
336
364
|
e_8 = _a.sent();
|
|
@@ -351,7 +379,7 @@ var normalize_tx = function (tx, address) {
|
|
|
351
379
|
var amount = void 0;
|
|
352
380
|
var rawlog = JSON.parse(tx.raw_log);
|
|
353
381
|
rawlog = rawlog;
|
|
354
|
-
log.
|
|
382
|
+
log.debug("rawlog: ", rawlog);
|
|
355
383
|
output.txid = tx.txhash;
|
|
356
384
|
output.height = tx.height;
|
|
357
385
|
output.gas = {
|
|
@@ -368,21 +396,21 @@ var normalize_tx = function (tx, address) {
|
|
|
368
396
|
];
|
|
369
397
|
for (var i = 0; i < rawlog.length; i++) {
|
|
370
398
|
var txEvents = rawlog[i];
|
|
371
|
-
//log.
|
|
399
|
+
//log.debug(tag,"txEvents: ",txEvents)
|
|
372
400
|
txEvents = txEvents.events;
|
|
373
401
|
for (var j = 0; j < txEvents.length; j++) {
|
|
374
402
|
var event_1 = txEvents[j];
|
|
375
403
|
//
|
|
376
|
-
//log.
|
|
377
|
-
//log.
|
|
404
|
+
//log.debug(tag,"event: ",event)
|
|
405
|
+
//log.debug(tag,"attributes: ",prettyjson.render(event.attributes))
|
|
378
406
|
//detect event type
|
|
379
|
-
log.
|
|
407
|
+
log.debug(tag, "type: ", event_1.type);
|
|
380
408
|
switch (event_1.type) {
|
|
381
409
|
case 'message':
|
|
382
410
|
// ignore
|
|
383
411
|
break;
|
|
384
412
|
case 'transfer':
|
|
385
|
-
log.
|
|
413
|
+
log.debug(tag, "attributes: ", event_1.attributes);
|
|
386
414
|
for (var k = 0; k < event_1.attributes.length; k++) {
|
|
387
415
|
var attribute = event_1.attributes[k];
|
|
388
416
|
if (attribute.key === 'recipient') {
|
|
@@ -428,8 +456,8 @@ var get_txs_by_address = function (address) {
|
|
|
428
456
|
case 1:
|
|
429
457
|
_a.trys.push([1, 4, , 5]);
|
|
430
458
|
output = [];
|
|
431
|
-
url = URL_OSMO_LCD + '/txs?
|
|
432
|
-
log.
|
|
459
|
+
url = URL_OSMO_LCD + '/txs?transfer.sender=' + address;
|
|
460
|
+
log.debug(tag, "url: ", url);
|
|
433
461
|
return [4 /*yield*/, axios({
|
|
434
462
|
url: url,
|
|
435
463
|
method: 'GET'
|
|
@@ -437,7 +465,7 @@ var get_txs_by_address = function (address) {
|
|
|
437
465
|
case 2:
|
|
438
466
|
resultSends = _a.sent();
|
|
439
467
|
sends = resultSends.data;
|
|
440
|
-
log.
|
|
468
|
+
//log.debug('sends: ', sends)
|
|
441
469
|
if (sends.txs) {
|
|
442
470
|
for (i = 0; i < sends.txs.length; i++) {
|
|
443
471
|
tx = sends.txs[i];
|
|
@@ -447,7 +475,6 @@ var get_txs_by_address = function (address) {
|
|
|
447
475
|
}
|
|
448
476
|
//receives
|
|
449
477
|
url = URL_OSMO_LCD + '/txs?transfer.recipient=' + address;
|
|
450
|
-
console.log("URL_OSMO_LCD: ", url);
|
|
451
478
|
return [4 /*yield*/, axios({
|
|
452
479
|
url: url,
|
|
453
480
|
method: 'GET'
|
|
@@ -455,7 +482,7 @@ var get_txs_by_address = function (address) {
|
|
|
455
482
|
case 3:
|
|
456
483
|
resultRecieves = _a.sent();
|
|
457
484
|
receives = resultRecieves.data;
|
|
458
|
-
log.
|
|
485
|
+
//log.debug('receives: ', receives)
|
|
459
486
|
if (receives.txs) {
|
|
460
487
|
for (i = 0; i < receives.txs.length; i++) {
|
|
461
488
|
tx = receives.txs[i];
|
|
@@ -492,7 +519,7 @@ var get_balances = function (address) {
|
|
|
492
519
|
return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/bank/balances/' + address })];
|
|
493
520
|
case 3:
|
|
494
521
|
accountInfo = _b.sent();
|
|
495
|
-
log.
|
|
522
|
+
log.debug(tag, "accountInfo: ", accountInfo.data);
|
|
496
523
|
//
|
|
497
524
|
if ((_a = accountInfo.data) === null || _a === void 0 ? void 0 : _a.result) {
|
|
498
525
|
for (i = 0; i < accountInfo.data.result.length; i++) {
|
|
@@ -535,7 +562,7 @@ var get_balance = function (address) {
|
|
|
535
562
|
return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/bank/balances/' + address })];
|
|
536
563
|
case 3:
|
|
537
564
|
accountInfo = _b.sent();
|
|
538
|
-
log.
|
|
565
|
+
log.debug(tag, "accountInfo: ", accountInfo.data);
|
|
539
566
|
//
|
|
540
567
|
if ((_a = accountInfo.data) === null || _a === void 0 ? void 0 : _a.result) {
|
|
541
568
|
for (i = 0; i < accountInfo.data.result.length; i++) {
|
|
@@ -574,7 +601,7 @@ var get_node_info_verbose = function () {
|
|
|
574
601
|
return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/syncing' })];
|
|
575
602
|
case 2:
|
|
576
603
|
syncInfo = _a.sent();
|
|
577
|
-
log.
|
|
604
|
+
log.debug(tag, "syncInfo: ", syncInfo.data);
|
|
578
605
|
output.isSyncing = syncInfo.data;
|
|
579
606
|
return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/node_info' })];
|
|
580
607
|
case 3:
|
|
@@ -582,7 +609,7 @@ var get_node_info_verbose = function () {
|
|
|
582
609
|
log.debug(tag, "nodeInfo: ", nodeInfo.data);
|
|
583
610
|
output = nodeInfo.data;
|
|
584
611
|
// let lastBlock = await axios({method:'GET',url: URL_OSMO_LCD+'/blocks/latest'})
|
|
585
|
-
// log.
|
|
612
|
+
// log.debug(tag,"lastBlock: ",lastBlock.data)
|
|
586
613
|
//let height
|
|
587
614
|
//output.height = lastBlock.data.block.header.height
|
|
588
615
|
return [2 /*return*/, output];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/osmosis-network",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.26",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"refresh": "rm -rf ./node_modules ./package-lock.json && npm install"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@pioneer-platform/loggerdog": "^8.1.
|
|
14
|
+
"@pioneer-platform/loggerdog": "^8.1.15",
|
|
15
15
|
"bech32": "^1.1.4",
|
|
16
16
|
"bip32": "^2.0.5",
|
|
17
17
|
"bip39": "^3.0.2",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"ts-node": "^8.10.2",
|
|
27
27
|
"typescript": "^3.9.5"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "f579a2843254be8f184ebfd2fdfa906fdf5554b5"
|
|
30
30
|
}
|