-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add taho wallet connector * chore: added changeset and cleaned up shimDisconnect pass-through --------- Co-authored-by: Daniel Sinclair <d@niel.nyc>
- Loading branch information
1 parent
936b523
commit 6a01368
Showing
6 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
'@rainbow-me/rainbowkit': patch | ||
--- | ||
|
||
Taho Support | ||
|
||
**Example usage** | ||
|
||
```ts | ||
import { | ||
getDefaultWallets, | ||
connectorsForWallets, | ||
} from '@rainbow-me/rainbowkit'; | ||
import { tahoWallet } from '@rainbow-me/rainbowkit/wallets'; | ||
const { wallets } = getDefaultWallets({ appName, chains }); | ||
const connectors = connectorsForWallets([ | ||
...wallets, | ||
{ | ||
groupName: 'Other', | ||
wallets: [tahoWallet({ chains })], | ||
}, | ||
]); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/rainbowkit/src/wallets/walletConnectors/tahoWallet/tahoWallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions
51
packages/rainbowkit/src/wallets/walletConnectors/tahoWallet/tahoWallet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* eslint-disable sort-keys-fix/sort-keys-fix */ | ||
import type { InjectedConnectorOptions } from '@wagmi/core/connectors/injected'; | ||
import { InjectedConnector } from 'wagmi/connectors/injected'; | ||
import { Chain } from '../../../components/RainbowKitProvider/RainbowKitChainContext'; | ||
import { Wallet } from '../../Wallet'; | ||
|
||
export interface TahoWalletOptions { | ||
chains: Chain[]; | ||
} | ||
|
||
declare global { | ||
interface Window { | ||
tally: any; | ||
} | ||
} | ||
|
||
export const tahoWallet = ({ | ||
chains, | ||
...options | ||
}: TahoWalletOptions & InjectedConnectorOptions): Wallet => ({ | ||
id: 'taho', | ||
name: 'Taho', | ||
iconBackground: '#d08d57', | ||
iconUrl: async () => (await import('./tahoWallet.svg')).default, | ||
downloadUrls: { | ||
browserExtension: | ||
'https://chrome.google.com/webstore/detail/taho/eajafomhmkipbjmfmhebemolkcicgfmd', | ||
}, | ||
installed: | ||
typeof window !== 'undefined' && | ||
typeof window.tally !== 'undefined' && | ||
window['tally'] | ||
? true | ||
: undefined, | ||
createConnector: () => { | ||
return { | ||
connector: new InjectedConnector({ | ||
chains, | ||
options: { | ||
getProvider: () => { | ||
const getTaho = (tally?: any) => | ||
tally?.isTally ? tally : undefined; | ||
if (typeof window === 'undefined') return; | ||
return getTaho(window.tally); | ||
}, | ||
...options, | ||
}, | ||
}), | ||
}; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6a01368
There was a problem hiding this comment.
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:
rainbowkit-example – ./
rainbowkit-example.vercel.app
rainbowkit-example-git-main-rainbowdotme.vercel.app
rainbowkit-example-rainbowdotme.vercel.app
6a01368
There was a problem hiding this comment.
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:
rainbowkit-site – ./
rainbowkit.com
rainbowkit-site-rainbowdotme.vercel.app
www.rainbowkit.com
rainbowkit.vercel.app
rainbowkit-site-git-main-rainbowdotme.vercel.app