CRYPTO NEWS

Unable to use "window.ethereum" in Angular

import { Component, OnInit } from '@angular/core'; import { ethers } from 'ethers'; import { MetaMaskInpageProvider } from '@metamask/providers'; @Component({   selector: 'app-connect-wallet',   templateUrl: './connect-wallet.component.html',   styleUrls: ['./connect-wallet.component.css'], }) export class ConnectWalletComponent implements OnInit {   constructor(private window: Window) {}    ngOnInit(): void {}    connectWallet() {     if (typeof window.ethereum !== 'undefined') {       console.log('MetaMask is installed!');     }   } } 

I create a component like this to get metamask and I’m constantly getting error:

Cannot find module '@metamask/providers' or its corresponding type declarations.  Property 'ethereum' does not exist on type 'Window & typeof globalThis'. 

Can anybody who can access to metamask with using Angular show me the way?

How is it possible to sign and attest a block within 12 seconds

I am digging deep into understanding the consensus layer specification for ethereum when it has moved to proof of stake. I understand that time is divided into slots of 12 seconds, and 32 of such slots makes an epoch. I also understand that blocks are produced per slot. I also understand that one validator is::Listen

I am digging deep into understanding the consensus layer specification for ethereum when it has moved to proof of stake.

I understand that time is divided into slots of 12 seconds, and 32 of such slots makes an epoch.

I also understand that blocks are produced per slot. I also understand that one validator is randomly selected to propose a block, while a larger amount of validator attests to that block before it is included in the chain.

So in my understanding this is what happens:

  1. A validator is randomly selected. This validator builds a block and shares it
  2. Other validator sees it, and sign attestation that it is valid
  3. Once a threshold of attestation is reached, the block is added to the chain

Now my question are:

  1. I understand that attestations are also part of the block. So how is it possible at step 1 for a block proposer to include attestation when that block has not been shared yet?
  2. Does it first create the block, share it, have other attest to it, then get it back before signing it, and then again other validator attest to it? If so how is this possible within 12 seconds? If not, then how is it done?

Because I fail to understand how attestation can be included by the block builder at the point of creating the block when there is no way for other validators to have seen and attest to that block

Unable to use "window.ethereum" in Angular

Shopping cart
There are no products in the cart!
Continue shopping
0