@pioneer-platform/osmosis-network 8.3.3 → 8.3.6

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 +16 -17
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -998,7 +998,7 @@ var get_balances = function (address) {
998
998
  _b.label = 2;
999
999
  case 2:
1000
1000
  _b.trys.push([2, 10, , 11]);
1001
- return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/bank/balances/' + address })];
1001
+ return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/cosmos/bank/v1beta1/balances/' + address })];
1002
1002
  case 3:
1003
1003
  accountInfo = _b.sent();
1004
1004
  log.debug(tag, "accountInfo: ", accountInfo.data);
@@ -1098,29 +1098,28 @@ var get_balances = function (address) {
1098
1098
  });
1099
1099
  };
1100
1100
  var get_balance = function (address) {
1101
- var _a;
1102
1101
  return __awaiter(this, void 0, void 0, function () {
1103
1102
  var tag, output, accountInfo, i, entry, e_26, e_27;
1104
- return __generator(this, function (_b) {
1105
- switch (_b.label) {
1103
+ return __generator(this, function (_a) {
1104
+ switch (_a.label) {
1106
1105
  case 0:
1107
1106
  tag = TAG + " | get_balance | ";
1108
- _b.label = 1;
1107
+ _a.label = 1;
1109
1108
  case 1:
1110
- _b.trys.push([1, 6, , 7]);
1109
+ _a.trys.push([1, 6, , 7]);
1111
1110
  output = 0;
1112
- _b.label = 2;
1111
+ _a.label = 2;
1113
1112
  case 2:
1114
- _b.trys.push([2, 4, , 5]);
1115
- console.log("URL: ", URL_OSMO_LCD + '/bank/balances/' + address);
1116
- return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/bank/balances/' + address })];
1113
+ _a.trys.push([2, 4, , 5]);
1114
+ console.log("URL: ", URL_OSMO_LCD + '/cosmos/bank/v1beta1/balances/' + address);
1115
+ return [4 /*yield*/, axios({ method: 'GET', url: URL_OSMO_LCD + '/cosmos/bank/v1beta1/balances/' + address })];
1117
1116
  case 3:
1118
- accountInfo = _b.sent();
1119
- log.debug(tag, "accountInfo: ", accountInfo.data);
1117
+ accountInfo = _a.sent();
1118
+ log.info(tag, "accountInfo: ", accountInfo.data);
1120
1119
  //
1121
- if ((_a = accountInfo.data) === null || _a === void 0 ? void 0 : _a.result) {
1122
- for (i = 0; i < accountInfo.data.result.length; i++) {
1123
- entry = accountInfo.data.result[i];
1120
+ if (accountInfo.data) {
1121
+ for (i = 0; i < accountInfo.data.balances.length; i++) {
1122
+ entry = accountInfo.data.balances[i];
1124
1123
  if (entry.denom === 'uosmo') {
1125
1124
  output = entry.amount;
1126
1125
  }
@@ -1129,11 +1128,11 @@ var get_balance = function (address) {
1129
1128
  output = output / BASE_OSMO;
1130
1129
  return [3 /*break*/, 5];
1131
1130
  case 4:
1132
- e_26 = _b.sent();
1131
+ e_26 = _a.sent();
1133
1132
  return [3 /*break*/, 5];
1134
1133
  case 5: return [2 /*return*/, output];
1135
1134
  case 6:
1136
- e_27 = _b.sent();
1135
+ e_27 = _a.sent();
1137
1136
  log.error(tag, "e: ", e_27);
1138
1137
  throw e_27;
1139
1138
  case 7: return [2 /*return*/];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/osmosis-network",
3
- "version": "8.3.3",
3
+ "version": "8.3.6",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {