@cityofzion/bs-neo-legacy 1.12.1 → 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 =
|
|
219
|
-
|
|
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 =
|
|
224
|
-
response.neoMigrationReceiveAmount =
|
|
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((
|
|
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,22 +150,28 @@ class DoraBDSNeoLegacy {
|
|
|
149
150
|
date: item.date,
|
|
150
151
|
invocationCount: item.invocationCount,
|
|
151
152
|
notificationCount: item.notificationCount,
|
|
152
|
-
networkFeeAmount:
|
|
153
|
-
|
|
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
|
|
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 = (
|
|
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
167
|
const fromUrl = from ? addressTemplateUrl === null || addressTemplateUrl === void 0 ? void 0 : addressTemplateUrl.replace('{address}', from) : undefined;
|
|
163
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:
|
|
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
176
|
from: from !== null && from !== void 0 ? from : undefined,
|
|
170
177
|
fromUrl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo-legacy",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.2",
|
|
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.30.5",
|
|
15
15
|
"axios": "1.8.2",
|
|
16
16
|
"date-fns": "~4.1.0",
|
|
17
|
-
"@cityofzion/blockchain-service": "1.18.
|
|
17
|
+
"@cityofzion/blockchain-service": "1.18.2",
|
|
18
18
|
"@cityofzion/bs-asteroid-sdk": "0.9.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|