@cityofzion/bs-neo-legacy 1.12.0 → 1.12.2

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.
@@ -215,13 +215,17 @@ class BSNeoLegacy {
215
215
  const gasAmountNumberLessCozFee = gasAmountNumberLessAllNep17TransfersFee - cozFee;
216
216
  const allGasFeeNumberThatUserWillPay = cozFee + BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_NEP_17_TRANSFER_FEE * 2;
217
217
  const allGasAmountNumberThatUserWillReceive = gasAmountNumberLessCozFee + BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_NEP_17_TRANSFER_FEE;
218
- response.gasMigrationTotalFees = (0, blockchain_service_1.formatNumber)(allGasFeeNumberThatUserWillPay, this.GAS_ASSET.decimals);
219
- response.gasMigrationReceiveAmount = (0, blockchain_service_1.formatNumber)(allGasAmountNumberThatUserWillReceive, this.GAS_ASSET.decimals);
218
+ response.gasMigrationTotalFees = blockchain_service_1.BSNumberHelper.formatNumber(allGasFeeNumberThatUserWillPay, {
219
+ decimals: this.GAS_ASSET.decimals,
220
+ });
221
+ response.gasMigrationReceiveAmount = blockchain_service_1.BSNumberHelper.formatNumber(allGasAmountNumberThatUserWillReceive, {
222
+ decimals: this.GAS_ASSET.decimals,
223
+ });
220
224
  }
221
225
  if (neoLegacyMigrationAmounts.neoBalance && neoLegacyMigrationAmounts.hasEnoughNeoBalance) {
222
226
  const neoMigrationAmountNumber = Number(neoLegacyMigrationAmounts.neoBalance.amount);
223
- response.neoMigrationTotalFees = (0, blockchain_service_1.formatNumber)(Math.ceil(neoMigrationAmountNumber * BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_COZ_FEE), this.NEO_ASSET.decimals);
224
- response.neoMigrationReceiveAmount = (0, blockchain_service_1.formatNumber)(neoMigrationAmountNumber - Number(response.neoMigrationTotalFees), this.NEO_ASSET.decimals);
227
+ response.neoMigrationTotalFees = blockchain_service_1.BSNumberHelper.formatNumber(Math.ceil(neoMigrationAmountNumber * BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_COZ_FEE), { decimals: this.NEO_ASSET.decimals });
228
+ response.neoMigrationReceiveAmount = blockchain_service_1.BSNumberHelper.formatNumber(neoMigrationAmountNumber - Number(response.neoMigrationTotalFees), { decimals: this.NEO_ASSET.decimals });
225
229
  }
226
230
  return response;
227
231
  }
@@ -140,7 +140,8 @@ class DoraBDSNeoLegacy {
140
140
  const addressTemplateUrl = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_explorerService, "f").getAddressTemplateUrl();
141
141
  const txTemplateUrl = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_explorerService, "f").getTxTemplateUrl();
142
142
  const contractTemplateUrl = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_explorerService, "f").getContractTemplateUrl();
143
- const itemPromises = items.map((item) => __awaiter(this, void 0, void 0, function* () {
143
+ const itemPromises = items.map((_d) => __awaiter(this, void 0, void 0, function* () {
144
+ var { networkFeeAmount, systemFeeAmount } = _d, item = __rest(_d, ["networkFeeAmount", "systemFeeAmount"]);
144
145
  const txId = item.transactionID;
145
146
  const newItem = {
146
147
  txId,
@@ -149,26 +150,32 @@ class DoraBDSNeoLegacy {
149
150
  date: item.date,
150
151
  invocationCount: item.invocationCount,
151
152
  notificationCount: item.notificationCount,
152
- networkFeeAmount: (0, blockchain_service_1.formatNumber)(item.networkFeeAmount, __classPrivateFieldGet(this, _DoraBDSNeoLegacy_feeToken, "f").decimals),
153
- systemFeeAmount: (0, blockchain_service_1.formatNumber)(item.systemFeeAmount, __classPrivateFieldGet(this, _DoraBDSNeoLegacy_feeToken, "f").decimals),
153
+ networkFeeAmount: networkFeeAmount
154
+ ? blockchain_service_1.BSNumberHelper.formatNumber(networkFeeAmount, { decimals: __classPrivateFieldGet(this, _DoraBDSNeoLegacy_feeToken, "f").decimals })
155
+ : undefined,
156
+ systemFeeAmount: systemFeeAmount
157
+ ? blockchain_service_1.BSNumberHelper.formatNumber(systemFeeAmount, { decimals: __classPrivateFieldGet(this, _DoraBDSNeoLegacy_feeToken, "f").decimals })
158
+ : undefined,
154
159
  events: [],
155
160
  };
156
161
  const eventPromises = item.events.map((event) => __awaiter(this, void 0, void 0, function* () {
157
- var _d, _e, _f, _g;
162
+ var _e, _f, _g, _h;
158
163
  const { contractHash: hash, amount, from, to } = event;
159
164
  const [token] = yield blockchain_service_1.BSPromisesHelper.tryCatch(() => this.getTokenInfo(hash));
160
- const standard = (_f = (_e = (_d = event.supportedStandards) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.toLowerCase()) !== null && _f !== void 0 ? _f : '';
165
+ const standard = (_g = (_f = (_e = event.supportedStandards) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.toLowerCase()) !== null && _g !== void 0 ? _g : '';
161
166
  const isNep5 = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_supportedNep5Standards, "f").includes(standard);
162
- const toUrl = to ? addressTemplateUrl === null || addressTemplateUrl === void 0 ? void 0 : addressTemplateUrl.replace('{address}', to) : undefined;
163
167
  const fromUrl = from ? addressTemplateUrl === null || addressTemplateUrl === void 0 ? void 0 : addressTemplateUrl.replace('{address}', from) : undefined;
168
+ const toUrl = to ? addressTemplateUrl === null || addressTemplateUrl === void 0 ? void 0 : addressTemplateUrl.replace('{address}', to) : undefined;
164
169
  const hashUrl = hash ? contractTemplateUrl === null || contractTemplateUrl === void 0 ? void 0 : contractTemplateUrl.replace('{hash}', hash) : undefined;
165
170
  const assetEvent = {
166
171
  eventType: 'token',
167
- amount: (0, blockchain_service_1.formatNumber)(amount, (_g = token === null || token === void 0 ? void 0 : token.decimals) !== null && _g !== void 0 ? _g : event.tokenDecimals),
172
+ amount: amount
173
+ ? blockchain_service_1.BSNumberHelper.formatNumber(amount, { decimals: (_h = token === null || token === void 0 ? void 0 : token.decimals) !== null && _h !== void 0 ? _h : event.tokenDecimals })
174
+ : undefined,
168
175
  methodName: event.methodName,
169
- from: from || 'Mint',
176
+ from: from !== null && from !== void 0 ? from : undefined,
170
177
  fromUrl,
171
- to: to || 'Burn',
178
+ to: to !== null && to !== void 0 ? to : undefined,
172
179
  toUrl,
173
180
  hash,
174
181
  hashUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-neo-legacy",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Coz",
@@ -9,12 +9,12 @@
9
9
  "/dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@cityofzion/dora-ts": "0.5.0",
12
+ "@cityofzion/dora-ts": "0.5.1",
13
13
  "@cityofzion/neon-js": "4.8.3",
14
14
  "@ledgerhq/hw-transport": "~6.30.5",
15
15
  "axios": "1.8.2",
16
16
  "date-fns": "~4.1.0",
17
- "@cityofzion/blockchain-service": "1.18.0",
17
+ "@cityofzion/blockchain-service": "1.18.2",
18
18
  "@cityofzion/bs-asteroid-sdk": "0.9.1"
19
19
  },
20
20
  "devDependencies": {