starknet-io / get-starknet

StarkNet wallet <-> dApp bridge
MIT License
160 stars 115 forks source link

fix: `get starknet v4` MetaMask detection #274

Closed khanti42 closed 1 month ago

khanti42 commented 1 month ago

Fix MetaMask Detection and Provider Handling for get-starknet

This PR fixes the detection and handling of the MetaMask provider in the get-starknet v4 integration, following the same strategy as in the get-starknet v3 implementation: provider logic detection happens in the metaMaskVirtualWallet.ts.

The hasSupport methods detects the provider and sets it as provider attribute in the object, so that when loading the wallet the provider does not need to be fetched again. If the provider is not set when loading then we try to load it again.

This PR is required to finalise the get-starknet v4 implementation on the StarkNet Snap.

fracek commented 1 month ago

Looks good. Can you add a changeset with your PR so that I can make a release as soon as it's merged?

khanti42 commented 1 month ago

@fracek : just added the changeset!