@toruslabs/ethereum-controllers 5.2.15 → 5.3.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.
@@ -1,6 +1,6 @@
1
1
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
- import { BaseController, formatSmallNumbers, addressSlicer, ACTIVITY_ACTION_RECEIVE, ACTIVITY_ACTION_SEND, significantDigits, TransactionStatus, BaseBlockTracker, timeout, BaseCurrencyController, BaseKeyringController, randomId, PROVIDER_JRPC_METHODS, createFetchMiddleware, createSwappableProxy, createEventEmitterProxy, BasePreferencesController, TX_EVENTS, TRANSACTION_TYPES, BaseTransactionStateManager, transactionMatchesNetwork as transactionMatchesNetwork$1 } from '@toruslabs/base-controllers';
3
+ import { CHAIN_NAMESPACES, BaseController, formatSmallNumbers, addressSlicer, ACTIVITY_ACTION_RECEIVE, ACTIVITY_ACTION_SEND, significantDigits, TransactionStatus, BaseBlockTracker, timeout, BaseCurrencyController, BaseKeyringController, randomId, PROVIDER_JRPC_METHODS, createFetchMiddleware, createSwappableProxy, createEventEmitterProxy, BasePreferencesController, TX_EVENTS, TRANSACTION_TYPES, BaseTransactionStateManager, transactionMatchesNetwork as transactionMatchesNetwork$1 } from '@toruslabs/base-controllers';
4
4
  import { Mutex } from 'async-mutex';
5
5
  import { BrowserProvider, toQuantity, Contract, SigningKey, Wallet, isHexString as isHexString$1, JsonRpcProvider, Interface, keccak256 } from 'ethers';
6
6
  import log from 'loglevel';
@@ -551,6 +551,8 @@ const BASE_TESTNET_CHAIN_ID = "0x14a34";
551
551
  const INFURA_KEY = process.env.VITE_APP_INFURA_PROJECT_KEY;
552
552
  const SUPPORTED_NETWORKS = {
553
553
  [MAINNET_CHAIN_ID]: {
554
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
555
+ decimals: 18,
554
556
  blockExplorerUrl: "https://etherscan.io",
555
557
  chainId: MAINNET_CHAIN_ID,
556
558
  displayName: "Ethereum",
@@ -560,6 +562,8 @@ const SUPPORTED_NETWORKS = {
560
562
  tickerName: "Ethereum"
561
563
  },
562
564
  [POLYGON_CHAIN_ID]: {
565
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
566
+ decimals: 18,
563
567
  blockExplorerUrl: "https://polygonscan.com",
564
568
  chainId: POLYGON_CHAIN_ID,
565
569
  displayName: "Polygon",
@@ -569,6 +573,8 @@ const SUPPORTED_NETWORKS = {
569
573
  tickerName: "Matic Network Token"
570
574
  },
571
575
  [BSC_MAINNET_CHAIN_ID]: {
576
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
577
+ decimals: 18,
572
578
  blockExplorerUrl: "https://bscscan.com",
573
579
  chainId: BSC_MAINNET_CHAIN_ID,
574
580
  displayName: "Binance Smart Chain (BSC)",
@@ -578,6 +584,8 @@ const SUPPORTED_NETWORKS = {
578
584
  tickerName: "Binance Coin"
579
585
  },
580
586
  [AVALANCHE_MAINNET_CHAIN_ID]: {
587
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
588
+ decimals: 18,
581
589
  blockExplorerUrl: "https://snowtrace.io",
582
590
  chainId: AVALANCHE_MAINNET_CHAIN_ID,
583
591
  displayName: "Avalanche",
@@ -587,6 +595,8 @@ const SUPPORTED_NETWORKS = {
587
595
  tickerName: "Avalanche"
588
596
  },
589
597
  [OPTIMISM_MAINNET_CHAIN_ID]: {
598
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
599
+ decimals: 18,
590
600
  blockExplorerUrl: "https://optimistic.etherscan.io",
591
601
  chainId: OPTIMISM_MAINNET_CHAIN_ID,
592
602
  displayName: "Optimism",
@@ -596,6 +606,8 @@ const SUPPORTED_NETWORKS = {
596
606
  tickerName: "Ethereum"
597
607
  },
598
608
  [CELO_MAINNET_CHAIN_ID]: {
609
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
610
+ decimals: 18,
599
611
  blockExplorerUrl: "https://explorer.celo.org",
600
612
  chainId: CELO_MAINNET_CHAIN_ID,
601
613
  displayName: "Celo Mainnet",
@@ -605,6 +617,8 @@ const SUPPORTED_NETWORKS = {
605
617
  tickerName: "Celo"
606
618
  },
607
619
  [ARBITRUM_MAINNET_CHAIN_ID]: {
620
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
621
+ decimals: 18,
608
622
  blockExplorerUrl: "https://arbiscan.io",
609
623
  chainId: ARBITRUM_MAINNET_CHAIN_ID,
610
624
  displayName: "Arbitrum One",
@@ -614,6 +628,8 @@ const SUPPORTED_NETWORKS = {
614
628
  tickerName: "Ethereum"
615
629
  },
616
630
  [XDAI_CHAIN_ID]: {
631
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
632
+ decimals: 18,
617
633
  blockExplorerUrl: "https://gnosis.blockscout.com",
618
634
  chainId: XDAI_CHAIN_ID,
619
635
  displayName: "xDai",
@@ -623,6 +639,8 @@ const SUPPORTED_NETWORKS = {
623
639
  tickerName: "xDai Token"
624
640
  },
625
641
  [BASE_CHAIN_ID]: {
642
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
643
+ decimals: 18,
626
644
  blockExplorerUrl: "https://basescan.org",
627
645
  chainId: BASE_CHAIN_ID,
628
646
  displayName: "Base",
@@ -632,6 +650,8 @@ const SUPPORTED_NETWORKS = {
632
650
  tickerName: "Ethereum"
633
651
  },
634
652
  [SEPOLIA_CHAIN_ID]: {
653
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
654
+ decimals: 18,
635
655
  blockExplorerUrl: "https://sepolia.etherscan.io",
636
656
  chainId: SEPOLIA_CHAIN_ID,
637
657
  displayName: "Sepolia Test Network",
@@ -642,6 +662,8 @@ const SUPPORTED_NETWORKS = {
642
662
  isTestnet: true
643
663
  },
644
664
  [POLYGON_MUMBAI_CHAIN_ID]: {
665
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
666
+ decimals: 18,
645
667
  blockExplorerUrl: "https://mumbai.polygonscan.com",
646
668
  chainId: POLYGON_MUMBAI_CHAIN_ID,
647
669
  displayName: "Polygon Mumbai",
@@ -652,6 +674,8 @@ const SUPPORTED_NETWORKS = {
652
674
  isTestnet: true
653
675
  },
654
676
  [BSC_TESTNET_CHAIN_ID]: {
677
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
678
+ decimals: 18,
655
679
  blockExplorerUrl: "https://testnet.bscscan.com",
656
680
  chainId: BSC_TESTNET_CHAIN_ID,
657
681
  displayName: "Binance Smart Chain Testnet",
@@ -662,6 +686,8 @@ const SUPPORTED_NETWORKS = {
662
686
  isTestnet: true
663
687
  },
664
688
  [AVALANCHE_TESTNET_CHAIN_ID]: {
689
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
690
+ decimals: 18,
665
691
  blockExplorerUrl: "https://testnet.snowtrace.io",
666
692
  chainId: AVALANCHE_TESTNET_CHAIN_ID,
667
693
  displayName: "Avalanche Testnet C-Chain",
@@ -672,6 +698,8 @@ const SUPPORTED_NETWORKS = {
672
698
  isTestnet: true
673
699
  },
674
700
  [ARBITRUM_TESTNET_CHAIN_ID]: {
701
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
702
+ decimals: 18,
675
703
  blockExplorerUrl: "https://sepolia.arbiscan.io",
676
704
  chainId: ARBITRUM_TESTNET_CHAIN_ID,
677
705
  displayName: "Arbitrum Sepolia",
@@ -682,6 +710,8 @@ const SUPPORTED_NETWORKS = {
682
710
  isTestnet: true
683
711
  },
684
712
  [OPTIMISM_TESTNET_CHAIN_ID]: {
713
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
714
+ decimals: 18,
685
715
  blockExplorerUrl: "https://sepolia-optimistic.etherscan.io",
686
716
  chainId: OPTIMISM_TESTNET_CHAIN_ID,
687
717
  displayName: "Optimism Sepolia",
@@ -692,6 +722,8 @@ const SUPPORTED_NETWORKS = {
692
722
  isTestnet: true
693
723
  },
694
724
  [BASE_TESTNET_CHAIN_ID]: {
725
+ chainNamespace: CHAIN_NAMESPACES.EIP155,
726
+ decimals: 18,
695
727
  blockExplorerUrl: "https://sepolia.basescan.org",
696
728
  chainId: BASE_TESTNET_CHAIN_ID,
697
729
  displayName: "Base Sepolia",