@cityofzion/bs-neo-legacy 1.12.7 → 1.13.0

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.
@@ -81,6 +81,7 @@ class DoraBDSNeoLegacy {
81
81
  time: Number(data.time),
82
82
  notifications: [],
83
83
  transfers,
84
+ type: 'default',
84
85
  };
85
86
  });
86
87
  }
@@ -112,6 +113,7 @@ class DoraBDSNeoLegacy {
112
113
  time: entry.time,
113
114
  transfers: [transfer],
114
115
  notifications: [],
116
+ type: 'default',
115
117
  });
116
118
  }));
117
119
  yield Promise.all(promises);
@@ -140,7 +142,7 @@ class DoraBDSNeoLegacy {
140
142
  const addressTemplateUrl = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_explorerService, "f").getAddressTemplateUrl();
141
143
  const txTemplateUrl = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_explorerService, "f").getTxTemplateUrl();
142
144
  const contractTemplateUrl = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_explorerService, "f").getContractTemplateUrl();
143
- const itemPromises = items.map((_d) => __awaiter(this, void 0, void 0, function* () {
145
+ const itemPromises = items.map((_d, index) => __awaiter(this, void 0, void 0, function* () {
144
146
  var { networkFeeAmount, systemFeeAmount } = _d, item = __rest(_d, ["networkFeeAmount", "systemFeeAmount"]);
145
147
  const txId = item.transactionID;
146
148
  const newItem = {
@@ -157,8 +159,9 @@ class DoraBDSNeoLegacy {
157
159
  ? blockchain_service_1.BSBigNumberHelper.format(systemFeeAmount, { decimals: __classPrivateFieldGet(this, _DoraBDSNeoLegacy_feeToken, "f").decimals })
158
160
  : undefined,
159
161
  events: [],
162
+ type: 'default',
160
163
  };
161
- const eventPromises = item.events.map((event) => __awaiter(this, void 0, void 0, function* () {
164
+ const eventPromises = item.events.map((event, eventIndex) => __awaiter(this, void 0, void 0, function* () {
162
165
  var _e, _f, _g, _h;
163
166
  const { contractHash: hash, amount, from, to } = event;
164
167
  const [token] = yield blockchain_service_1.BSPromisesHelper.tryCatch(() => this.getTokenInfo(hash));
@@ -182,10 +185,10 @@ class DoraBDSNeoLegacy {
182
185
  token: token !== null && token !== void 0 ? token : undefined,
183
186
  tokenType: isNep5 ? 'nep-5' : 'generic',
184
187
  };
185
- newItem.events.push(assetEvent);
188
+ newItem.events.splice(eventIndex, 0, assetEvent);
186
189
  }));
187
190
  yield Promise.allSettled(eventPromises);
188
- data.push(newItem);
191
+ data.splice(index, 0, newItem);
189
192
  }));
190
193
  yield Promise.allSettled(itemPromises);
191
194
  return { nextCursor: response.nextCursor, data };
@@ -261,9 +264,11 @@ class DoraBDSNeoLegacy {
261
264
  });
262
265
  }
263
266
  getUnclaimed(address) {
267
+ var _a;
264
268
  return __awaiter(this, void 0, void 0, function* () {
265
- const { unclaimed } = yield dora_ts_1.api.NeoLegacyREST.getUnclaimed(address, __classPrivateFieldGet(this, _DoraBDSNeoLegacy_network, "f").id);
266
- return (unclaimed / Math.pow(10, __classPrivateFieldGet(this, _DoraBDSNeoLegacy_claimToken, "f").decimals)).toFixed(__classPrivateFieldGet(this, _DoraBDSNeoLegacy_claimToken, "f").decimals);
269
+ const rpcClient = new neon_js_1.rpc.RPCClient(__classPrivateFieldGet(this, _DoraBDSNeoLegacy_network, "f").url);
270
+ const response = yield rpcClient.getUnclaimed(address);
271
+ return ((_a = response === null || response === void 0 ? void 0 : response.unclaimed) !== null && _a !== void 0 ? _a : 0).toFixed(__classPrivateFieldGet(this, _DoraBDSNeoLegacy_claimToken, "f").decimals);
267
272
  });
268
273
  }
269
274
  getBlockHeight() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-neo-legacy",
3
- "version": "1.12.7",
3
+ "version": "1.13.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Coz",
@@ -14,7 +14,7 @@
14
14
  "@ledgerhq/hw-transport": "~6.31.8",
15
15
  "axios": "~1.8.2",
16
16
  "date-fns": "~4.1.0",
17
- "@cityofzion/blockchain-service": "1.19.3",
17
+ "@cityofzion/blockchain-service": "1.20.0",
18
18
  "@cityofzion/bs-asteroid-sdk": "0.9.1"
19
19
  },
20
20
  "devDependencies": {