-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tokenaryWallet support (#1596)
* add tokenary * fix tokenaryWallet * Update tokenaryWallet.ts * fix: tokenary * chore: changeset * revert: duplicate isTokenary check * fix: tokenary metadata * chore: minify/resize svg icon * fix: iconBackground * fix: safari desktop download url * fix: safari check for tokenary * fix: missing qrcode url --------- Co-authored-by: Daniel Sinclair <d@niel.nyc>
- Loading branch information
1 parent
899c602
commit 74ead9d
Showing
6 changed files
with
75 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 | ||
--- | ||
|
||
Tokenary Support | ||
|
||
**Example usage** | ||
|
||
```ts | ||
import { | ||
getDefaultWallets, | ||
connectorsForWallets, | ||
} from '@rainbow-me/rainbowkit'; | ||
import { tokenaryWallet } from '@rainbow-me/rainbowkit/wallets'; | ||
const { wallets } = getDefaultWallets({ appName, chains }); | ||
const connectors = connectorsForWallets([ | ||
...wallets, | ||
{ | ||
groupName: 'Other', | ||
wallets: [tokenaryWallet({ 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
1 change: 1 addition & 0 deletions
1
packages/rainbowkit/src/wallets/walletConnectors/tokenaryWallet/tokenaryWallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions
37
packages/rainbowkit/src/wallets/walletConnectors/tokenaryWallet/tokenaryWallet.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,37 @@ | ||
import type { InjectedConnectorOptions } from '@wagmi/core/connectors/injected'; | ||
import { InjectedConnector } from 'wagmi/connectors/injected'; | ||
import { Chain } from '../../../components/RainbowKitProvider/RainbowKitChainContext'; | ||
import { isSafari } from '../../../utils/browsers'; | ||
import { Wallet } from '../../Wallet'; | ||
|
||
export interface TokenaryWalletOptions { | ||
chains: Chain[]; | ||
} | ||
|
||
export const tokenaryWallet = ({ | ||
chains, | ||
...options | ||
}: TokenaryWalletOptions & InjectedConnectorOptions): Wallet => ({ | ||
id: 'tokenary', | ||
name: 'Tokenary', | ||
iconUrl: async () => (await import('./tokenaryWallet.svg')).default, | ||
iconBackground: '#ffffff', | ||
installed: | ||
typeof window !== 'undefined' && | ||
typeof window.ethereum !== 'undefined' && | ||
window.ethereum.isTokenary, | ||
hidden: () => !isSafari(), | ||
downloadUrls: { | ||
ios: 'https://tokenary.io/get', | ||
mobile: 'https://tokenary.io', | ||
qrCode: 'https://tokenary.io/get', | ||
safari: 'https://tokenary.io/get', | ||
browserExtension: 'https://tokenary.io/get', | ||
}, | ||
createConnector: () => ({ | ||
connector: new InjectedConnector({ | ||
chains, | ||
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
74ead9d
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-rainbowdotme.vercel.app
rainbowkit-example-git-main-rainbowdotme.vercel.app
rainbowkit-example.vercel.app
74ead9d
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-site-rainbowdotme.vercel.app
rainbowkit.vercel.app
v1-rainbowkit.vercel.app
v2-rainbowkit.vercel.app
rainbowkit-site-git-main-rainbowdotme.vercel.app
rainbowkit.com
www.rainbowkit.com