@pioneer-platform/osmosis-network 8.3.4 → 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.
- package/lib/index.js +16 -17
- 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 (
|
|
1105
|
-
switch (
|
|
1103
|
+
return __generator(this, function (_a) {
|
|
1104
|
+
switch (_a.label) {
|
|
1106
1105
|
case 0:
|
|
1107
1106
|
tag = TAG + " | get_balance | ";
|
|
1108
|
-
|
|
1107
|
+
_a.label = 1;
|
|
1109
1108
|
case 1:
|
|
1110
|
-
|
|
1109
|
+
_a.trys.push([1, 6, , 7]);
|
|
1111
1110
|
output = 0;
|
|
1112
|
-
|
|
1111
|
+
_a.label = 2;
|
|
1113
1112
|
case 2:
|
|
1114
|
-
|
|
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 =
|
|
1119
|
-
log.
|
|
1117
|
+
accountInfo = _a.sent();
|
|
1118
|
+
log.info(tag, "accountInfo: ", accountInfo.data);
|
|
1120
1119
|
//
|
|
1121
|
-
if (
|
|
1122
|
-
for (i = 0; i < accountInfo.data.
|
|
1123
|
-
entry = accountInfo.data.
|
|
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 =
|
|
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 =
|
|
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*/];
|