@toruslabs/ethereum-controllers 5.2.13 → 5.2.15
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/dist/ethereumControllers.cjs.js +5 -6
- package/dist/ethereumControllers.cjs.js.map +1 -1
- package/dist/ethereumControllers.esm.js +5 -6
- package/dist/ethereumControllers.esm.js.map +1 -1
- package/dist/ethereumControllers.umd.min.js +1 -1
- package/dist/ethereumControllers.umd.min.js.map +1 -1
- package/dist/types/utils/interfaces.d.ts +2 -2
- package/package.json +4 -4
- package/src/Preferences/PreferencesController.ts +3 -3
- package/src/utils/helpers.ts +2 -2
- package/src/utils/interfaces.ts +2 -2
|
@@ -1203,8 +1203,8 @@ const formatPastTx = (x, lowerCaseSelectedAddress) => {
|
|
|
1203
1203
|
currencyAmountString,
|
|
1204
1204
|
amount: `${totalAmountString} / ${currencyAmountString}`,
|
|
1205
1205
|
status: x.status,
|
|
1206
|
-
etherscanLink: getEtherScanHashLink(x.transaction_hash, x.
|
|
1207
|
-
|
|
1206
|
+
etherscanLink: getEtherScanHashLink(x.transaction_hash, x.chain_id || MAINNET_CHAIN_ID),
|
|
1207
|
+
chainId: x.chain_id,
|
|
1208
1208
|
ethRate: Number.parseFloat(x === null || x === void 0 ? void 0 : x.total_amount) && Number.parseFloat(x === null || x === void 0 ? void 0 : x.currency_amount) ? `1 ${x.symbol} = ${(0,base_controllers_namespaceObject.significantDigits)(Number.parseFloat(x.currency_amount) / Number.parseFloat(x.total_amount))}` : "",
|
|
1209
1209
|
currencyUsed: x.selected_currency,
|
|
1210
1210
|
type: x.type,
|
|
@@ -4208,7 +4208,7 @@ class PreferencesController extends base_controllers_namespaceObject.BasePrefere
|
|
|
4208
4208
|
var _this$getAddressState2;
|
|
4209
4209
|
const formattedTx = formatPastTx(tx);
|
|
4210
4210
|
const storePastTx = (_this$getAddressState2 = this.getAddressState(address)) === null || _this$getAddressState2 === void 0 ? void 0 : _this$getAddressState2.formattedPastTransactions;
|
|
4211
|
-
const duplicateIndex = storePastTx.findIndex(x => x.transaction_hash === tx.transaction_hash && x.
|
|
4211
|
+
const duplicateIndex = storePastTx.findIndex(x => x.transaction_hash === tx.transaction_hash && x.chainId === tx.chain_id);
|
|
4212
4212
|
if (tx.status === base_controllers_namespaceObject.TransactionStatus.submitted || tx.status === base_controllers_namespaceObject.TransactionStatus.confirmed) {
|
|
4213
4213
|
if (duplicateIndex === -1) {
|
|
4214
4214
|
// No duplicate found
|
|
@@ -4436,7 +4436,7 @@ class PreferencesController extends base_controllers_namespaceObject.BasePrefere
|
|
|
4436
4436
|
const pendingTx = [];
|
|
4437
4437
|
const lowerCaseSelectedAddress = address.toLowerCase();
|
|
4438
4438
|
for (const x of txs) {
|
|
4439
|
-
if (x.
|
|
4439
|
+
if (x.chain_id === SUPPORTED_NETWORKS[this.getProviderConfig().chainId].chainId && x.to && x.from && (lowerCaseSelectedAddress === x.from.toLowerCase() || lowerCaseSelectedAddress === x.to.toLowerCase())) {
|
|
4440
4440
|
if (x.status !== "confirmed") {
|
|
4441
4441
|
pendingTx.push(x);
|
|
4442
4442
|
} else {
|
|
@@ -4453,8 +4453,7 @@ class PreferencesController extends base_controllers_namespaceObject.BasePrefere
|
|
|
4453
4453
|
pastTx.push(finalObject);
|
|
4454
4454
|
if (lowerCaseSelectedAddress === element.from.toLowerCase() && finalObject.status && finalObject.status !== element.status) this.patchPastTx({
|
|
4455
4455
|
id: element.id,
|
|
4456
|
-
status: finalObject.status
|
|
4457
|
-
updated_at: new Date().toISOString()
|
|
4456
|
+
status: finalObject.status
|
|
4458
4457
|
}, address);
|
|
4459
4458
|
}
|
|
4460
4459
|
const finalTx = this.cancelTxCalculate(pastTx);
|