Skip to content

Commit

Permalink
feat: add frame
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Jan 30, 2022
1 parent 152db9a commit 1412eed
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/green-owls-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'wagmi-private': patch
'wagmi': patch
---

add frame to injected
2 changes: 1 addition & 1 deletion examples/next/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const connectors = ({ chainId }: ConnectorsConfig) => {
chains.find((x) => x.id === chainId)?.rpcUrls?.[0] ??
defaultChain.rpcUrls[0]
return [
new InjectedConnector({ chains }),
new InjectedConnector({ chains, options: { shimDisconnect: true } }),
new WalletConnectConnector({
chains,
options: {
Expand Down
2 changes: 1 addition & 1 deletion examples/remix/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function App() {
chains.find((x) => x.id === chainId)?.rpcUrls?.[0] ??
defaultChain.rpcUrls[0]
return [
new InjectedConnector({ chains }),
new InjectedConnector({ chains, options: { shimDisconnect: true } }),
new WalletConnectConnector({
chains,
options: {
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-react/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const connectors = ({ chainId }: ConnectorsConfig) => {
chains.find((x) => x.id === chainId)?.rpcUrls?.[0] ??
defaultChain.rpcUrls[0]
return [
new InjectedConnector({ chains }),
new InjectedConnector({ chains, options: { shimDisconnect: true } }),
new WalletConnectConnector({
chains,
options: {
Expand Down
1 change: 0 additions & 1 deletion packages/private/src/connectors/injected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export class InjectedConnector extends Connector<

async isAuthorized() {
try {
console.log(localStorage.getItem(shimKey))
if (
this.options?.shimDisconnect &&
typeof localStorage !== 'undefined' &&
Expand Down
1 change: 1 addition & 0 deletions packages/private/src/types/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type RequestArguments =

type InjectedProviders = {
isCoinbaseWallet?: true
isFrame?: true
isMetaMask?: true
isTally?: true
}
Expand Down
1 change: 1 addition & 0 deletions packages/private/src/utils/getInjectedName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const getInjectedName = (ethereum?: Window['ethereum']) => {
if (!ethereum) return 'Injected'
if (ethereum.isMetaMask) return 'MetaMask'
if (ethereum.isCoinbaseWallet) return 'Coinbase Wallet'
if (ethereum.isFrame) return 'Frame'
if (ethereum.isTally) return 'Tally'
return 'Injected'
}

1 comment on commit 1412eed

@vercel
Copy link

@vercel vercel bot commented on 1412eed Jan 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.