@pioneer-platform/osmosis-network 8.1.22 → 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.
Files changed (2) hide show
  1. package/lib/index.js +48 -18
  2. 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/", "") + " | ";
@@ -100,6 +128,9 @@ module.exports = {
100
128
  txs: function (address) {
101
129
  return get_txs_by_address(address);
102
130
  },
131
+ getTransaction: function (txid) {
132
+ return get_transaction(txid);
133
+ },
103
134
  transaction: function (txid) {
104
135
  return get_transaction(txid);
105
136
  },
@@ -273,13 +304,13 @@ var broadcast_transaction = function (tx) {
273
304
  })];
274
305
  case 3:
275
306
  result2 = _a.sent();
276
- log.info(tag, '** Broadcast ** REMOTE: result: ', result2.data);
307
+ log.debug(tag, '** Broadcast ** REMOTE: result: ', result2.data);
277
308
  if (result2.data.txhash)
278
309
  output.txid = result2.data.txhash;
279
310
  //verify success
280
311
  if (result2.data.raw_log) {
281
312
  logSend = result2.data.raw_log;
282
- log.info(tag, "logSend: ", logSend);
313
+ log.debug(tag, "logSend: ", logSend);
283
314
  }
284
315
  output.height = result2.height;
285
316
  output.gas_wanted = result2.gas_wanted;
@@ -327,7 +358,7 @@ var get_account_info = function (address) {
327
358
  return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/auth/accounts/' + address })];
328
359
  case 2:
329
360
  txInfo = _a.sent();
330
- log.info(tag, "txInfo: ", txInfo.data);
361
+ log.debug(tag, "txInfo: ", txInfo.data);
331
362
  return [2 /*return*/, txInfo.data];
332
363
  case 3:
333
364
  e_8 = _a.sent();
@@ -348,7 +379,7 @@ var normalize_tx = function (tx, address) {
348
379
  var amount = void 0;
349
380
  var rawlog = JSON.parse(tx.raw_log);
350
381
  rawlog = rawlog;
351
- log.info("rawlog: ", rawlog);
382
+ log.debug("rawlog: ", rawlog);
352
383
  output.txid = tx.txhash;
353
384
  output.height = tx.height;
354
385
  output.gas = {
@@ -365,21 +396,21 @@ var normalize_tx = function (tx, address) {
365
396
  ];
366
397
  for (var i = 0; i < rawlog.length; i++) {
367
398
  var txEvents = rawlog[i];
368
- //log.info(tag,"txEvents: ",txEvents)
399
+ //log.debug(tag,"txEvents: ",txEvents)
369
400
  txEvents = txEvents.events;
370
401
  for (var j = 0; j < txEvents.length; j++) {
371
402
  var event_1 = txEvents[j];
372
403
  //
373
- //log.info(tag,"event: ",event)
374
- //log.info(tag,"attributes: ",prettyjson.render(event.attributes))
404
+ //log.debug(tag,"event: ",event)
405
+ //log.debug(tag,"attributes: ",prettyjson.render(event.attributes))
375
406
  //detect event type
376
- log.info(tag, "type: ", event_1.type);
407
+ log.debug(tag, "type: ", event_1.type);
377
408
  switch (event_1.type) {
378
409
  case 'message':
379
410
  // ignore
380
411
  break;
381
412
  case 'transfer':
382
- log.info(tag, "attributes: ", event_1.attributes);
413
+ log.debug(tag, "attributes: ", event_1.attributes);
383
414
  for (var k = 0; k < event_1.attributes.length; k++) {
384
415
  var attribute = event_1.attributes[k];
385
416
  if (attribute.key === 'recipient') {
@@ -425,8 +456,8 @@ var get_txs_by_address = function (address) {
425
456
  case 1:
426
457
  _a.trys.push([1, 4, , 5]);
427
458
  output = [];
428
- url = URL_OSMO_LCD + '/txs?message.sender=' + address;
429
- log.info(tag, "url: ", url);
459
+ url = URL_OSMO_LCD + '/txs?transfer.sender=' + address;
460
+ log.debug(tag, "url: ", url);
430
461
  return [4 /*yield*/, axios({
431
462
  url: url,
432
463
  method: 'GET'
@@ -434,7 +465,7 @@ var get_txs_by_address = function (address) {
434
465
  case 2:
435
466
  resultSends = _a.sent();
436
467
  sends = resultSends.data;
437
- log.info('sends: ', sends);
468
+ //log.debug('sends: ', sends)
438
469
  if (sends.txs) {
439
470
  for (i = 0; i < sends.txs.length; i++) {
440
471
  tx = sends.txs[i];
@@ -444,7 +475,6 @@ var get_txs_by_address = function (address) {
444
475
  }
445
476
  //receives
446
477
  url = URL_OSMO_LCD + '/txs?transfer.recipient=' + address;
447
- console.log("URL_OSMO_LCD: ", url);
448
478
  return [4 /*yield*/, axios({
449
479
  url: url,
450
480
  method: 'GET'
@@ -452,7 +482,7 @@ var get_txs_by_address = function (address) {
452
482
  case 3:
453
483
  resultRecieves = _a.sent();
454
484
  receives = resultRecieves.data;
455
- log.info('receives: ', receives);
485
+ //log.debug('receives: ', receives)
456
486
  if (receives.txs) {
457
487
  for (i = 0; i < receives.txs.length; i++) {
458
488
  tx = receives.txs[i];
@@ -489,7 +519,7 @@ var get_balances = function (address) {
489
519
  return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/bank/balances/' + address })];
490
520
  case 3:
491
521
  accountInfo = _b.sent();
492
- log.info(tag, "accountInfo: ", accountInfo.data);
522
+ log.debug(tag, "accountInfo: ", accountInfo.data);
493
523
  //
494
524
  if ((_a = accountInfo.data) === null || _a === void 0 ? void 0 : _a.result) {
495
525
  for (i = 0; i < accountInfo.data.result.length; i++) {
@@ -532,7 +562,7 @@ var get_balance = function (address) {
532
562
  return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/bank/balances/' + address })];
533
563
  case 3:
534
564
  accountInfo = _b.sent();
535
- log.info(tag, "accountInfo: ", accountInfo.data);
565
+ log.debug(tag, "accountInfo: ", accountInfo.data);
536
566
  //
537
567
  if ((_a = accountInfo.data) === null || _a === void 0 ? void 0 : _a.result) {
538
568
  for (i = 0; i < accountInfo.data.result.length; i++) {
@@ -571,7 +601,7 @@ var get_node_info_verbose = function () {
571
601
  return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/syncing' })];
572
602
  case 2:
573
603
  syncInfo = _a.sent();
574
- log.info(tag, "syncInfo: ", syncInfo.data);
604
+ log.debug(tag, "syncInfo: ", syncInfo.data);
575
605
  output.isSyncing = syncInfo.data;
576
606
  return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/node_info' })];
577
607
  case 3:
@@ -579,7 +609,7 @@ var get_node_info_verbose = function () {
579
609
  log.debug(tag, "nodeInfo: ", nodeInfo.data);
580
610
  output = nodeInfo.data;
581
611
  // let lastBlock = await axios({method:'GET',url: URL_OSMO_LCD+'/blocks/latest'})
582
- // log.info(tag,"lastBlock: ",lastBlock.data)
612
+ // log.debug(tag,"lastBlock: ",lastBlock.data)
583
613
  //let height
584
614
  //output.height = lastBlock.data.block.header.height
585
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.22",
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",
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": "cc48dcf5e18cec902582feb54c003906b4cc957d"
29
+ "gitHead": "f579a2843254be8f184ebfd2fdfa906fdf5554b5"
30
30
  }