@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.
@@ -316,7 +316,7 @@ export interface TransactionPayload {
316
316
  currency_amount: string;
317
317
  selected_currency: string;
318
318
  status?: TransactionStatus;
319
- network: string;
319
+ chain_id: string;
320
320
  transaction_hash: string;
321
321
  transaction_category: string;
322
322
  gas: string;
@@ -354,7 +354,7 @@ export interface FormattedTransactionActivity {
354
354
  etherscanLink: string;
355
355
  ethRate: string;
356
356
  currencyUsed: string;
357
- networkType: string;
357
+ chainId: string;
358
358
  type: string;
359
359
  type_name: string;
360
360
  type_image_link: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toruslabs/ethereum-controllers",
3
- "version": "5.2.13",
3
+ "version": "5.2.15",
4
4
  "homepage": "https://github.com/torusresearch/controllers#readme",
5
5
  "license": "ISC",
6
6
  "main": "dist/ethereumControllers.cjs.js",
@@ -24,9 +24,9 @@
24
24
  "@ethereumjs/util": "^9.0.1",
25
25
  "@metamask/eth-sig-util": "^7.0.1",
26
26
  "@metamask/rpc-errors": "^6.1.0",
27
- "@toruslabs/base-controllers": "^5.2.12",
27
+ "@toruslabs/base-controllers": "^5.2.15",
28
28
  "@toruslabs/http-helpers": "^6.0.0",
29
- "@toruslabs/openlogin-jrpc": "^6.2.3",
29
+ "@toruslabs/openlogin-jrpc": "^6.2.4",
30
30
  "async-mutex": "^0.4.1",
31
31
  "bignumber.js": "^9.1.2",
32
32
  "bn.js": "^5.2.1",
@@ -64,7 +64,7 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "ff1f86a9f2c01898e1df8ea7f58ee919e88164de",
67
+ "gitHead": "94fa568058975305722cfc9c7d41c6353d107e61",
68
68
  "devDependencies": {
69
69
  "@nomicfoundation/hardhat-toolbox": "^4.0.0",
70
70
  "hardhat": "^2.19.4"
@@ -170,7 +170,7 @@ export default class PreferencesController
170
170
  public async patchNewTx(tx: TransactionPayload, address: string): Promise<void> {
171
171
  const formattedTx = formatPastTx(tx);
172
172
  const storePastTx = this.getAddressState(address)?.formattedPastTransactions;
173
- const duplicateIndex = storePastTx.findIndex((x) => x.transaction_hash === tx.transaction_hash && x.networkType === tx.network);
173
+ const duplicateIndex = storePastTx.findIndex((x) => x.transaction_hash === tx.transaction_hash && x.chainId === tx.chain_id);
174
174
  if (tx.status === TransactionStatus.submitted || tx.status === TransactionStatus.confirmed) {
175
175
  if (duplicateIndex === -1) {
176
176
  // No duplicate found
@@ -385,7 +385,7 @@ export default class PreferencesController
385
385
  const lowerCaseSelectedAddress = address.toLowerCase();
386
386
  for (const x of txs) {
387
387
  if (
388
- x.network === SUPPORTED_NETWORKS[this.getProviderConfig().chainId].chainId &&
388
+ x.chain_id === SUPPORTED_NETWORKS[this.getProviderConfig().chainId].chainId &&
389
389
  x.to &&
390
390
  x.from &&
391
391
  (lowerCaseSelectedAddress === x.from.toLowerCase() || lowerCaseSelectedAddress === x.to.toLowerCase())
@@ -405,7 +405,7 @@ export default class PreferencesController
405
405
  finalObject.status = resolvedTxStatuses[index] || TransactionStatus.submitted;
406
406
  pastTx.push(finalObject);
407
407
  if (lowerCaseSelectedAddress === element.from.toLowerCase() && finalObject.status && finalObject.status !== element.status)
408
- this.patchPastTx({ id: element.id, status: finalObject.status, updated_at: new Date().toISOString() }, address);
408
+ this.patchPastTx({ id: element.id, status: finalObject.status }, address);
409
409
  }
410
410
 
411
411
  const finalTx = this.cancelTxCalculate(pastTx);
@@ -51,8 +51,8 @@ export const formatPastTx = (x: TransactionPayload, lowerCaseSelectedAddress?: s
51
51
  currencyAmountString,
52
52
  amount: `${totalAmountString} / ${currencyAmountString}`,
53
53
  status: x.status,
54
- etherscanLink: getEtherScanHashLink(x.transaction_hash, x.network || MAINNET_CHAIN_ID),
55
- networkType: x.network,
54
+ etherscanLink: getEtherScanHashLink(x.transaction_hash, x.chain_id || MAINNET_CHAIN_ID),
55
+ chainId: x.chain_id,
56
56
  ethRate:
57
57
  Number.parseFloat(x?.total_amount) && Number.parseFloat(x?.currency_amount)
58
58
  ? `1 ${x.symbol} = ${significantDigits(Number.parseFloat(x.currency_amount) / Number.parseFloat(x.total_amount))}`
@@ -380,7 +380,7 @@ export interface TransactionPayload {
380
380
  currency_amount: string;
381
381
  selected_currency: string;
382
382
  status?: TransactionStatus;
383
- network: string;
383
+ chain_id: string;
384
384
  transaction_hash: string;
385
385
  transaction_category: string;
386
386
  gas: string;
@@ -421,7 +421,7 @@ export interface FormattedTransactionActivity {
421
421
  etherscanLink: string;
422
422
  ethRate: string;
423
423
  currencyUsed: string;
424
- networkType: string;
424
+ chainId: string;
425
425
  type: string;
426
426
  type_name: string;
427
427
  type_image_link: string;