Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cosmos-kit, docs): apply prax extension #504

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cosmos-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"@cosmos-kit/okxwallet-extension": "^2.11.2",
"@cosmos-kit/omni": "^2.10.2",
"@cosmos-kit/owallet": "^2.11.2",
"@cosmos-kit/prax-extension": "0.0.1",
"@cosmos-kit/shell": "^2.11.2",
"@cosmos-kit/station": "^2.10.2",
"@cosmos-kit/tailwind": "^1.5.2",
Expand Down
8 changes: 7 additions & 1 deletion packages/cosmos-kit/src/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { wallets as exodusExtension } from '@cosmos-kit/exodus-extension';
import { wallets as tailwindWallet } from '@cosmos-kit/tailwind';
import { wallets as galaxyStationExtension } from '@cosmos-kit/galaxy-station-extension';
import { wallets as cdcwalletExtension } from '@cosmos-kit/cdcwallet-extension';
import { wallets as praxExtension } from '@cosmos-kit/prax-extension';

export type WalletName =
| 'keplr'
Expand All @@ -45,7 +46,8 @@ export type WalletName =
| 'owallet'
| 'exodus'
| 'galaxystation'
| 'cdcwallet';
| 'cdcwallet'
| 'prax';

export type WalletList<
E extends MainWalletBase | null,
Expand Down Expand Up @@ -106,6 +108,7 @@ export const tailwind = createWalletList(tailwindWallet[0], null);
export const owallet = createWalletList(owalletExtension[0], null);
export const galaxystation = createWalletList(galaxyStationExtension[0], null);
export const cdcwallet = createWalletList(cdcwalletExtension[0], null);
export const prax = createWalletList(praxExtension[0], null);

export type SubWalletList = MainWalletBase[] & {
get mobile(): MainWalletBase[];
Expand All @@ -132,6 +135,7 @@ export type AllWalletList = SubWalletList & {
owallet: typeof owallet;
galaxystation: typeof owallet;
cdcwallet: typeof cdcwallet;
prax: typeof prax;
for: (...names: WalletName[]) => SubWalletList;
not: (...names: WalletName[]) => SubWalletList;
};
Expand Down Expand Up @@ -175,6 +179,7 @@ export function createAllWalletList(ws: MainWalletBase[]) {
wallets.owallet = owallet;
wallets.galaxystation = galaxystation;
wallets.cdcwallet = cdcwallet;
wallets.prax = prax;

defineGetters(wallets);

Expand Down Expand Up @@ -226,4 +231,5 @@ export const wallets = createAllWalletList([
...owallet,
...galaxystation,
...cdcwallet,
...prax,
]);
4 changes: 1 addition & 3 deletions packages/docs/components/react/wallet-connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ export const ConnectWalletButton = ({
gap="$4"
as="span"
borderRadius="8px"
style={{
zIndex: "1",
}}
zIndex={1}
>
<Box as="span">
<IoWallet />
Expand Down
3 changes: 2 additions & 1 deletion packages/docs/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ function MyApp({ Component, pageProps }: AppProps) {
"tailwind",
"owallet",
"galaxystation",
"cdcwallet"
"cdcwallet",
"prax"
),
// ...web3AuthWallets,
]}
Expand Down
3 changes: 2 additions & 1 deletion packages/docs/pages/integrating-wallets/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"trust": "@ Trust Wallet",
"vectis": "@ Vectis Wallet",
"web3auth": "@ Web3Auth",
"xdefi": "@ Xdefi Wallet"
"xdefi": "@ Xdefi Wallet",
"prax": "@ Prax Wallet"
}
38 changes: 38 additions & 0 deletions packages/docs/pages/integrating-wallets/prax.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# How to Add Prax Wallet to CosmosKit

There is one packages for Prax

- `@cosmos-kit/prax-extension`

> Note: This package exports `wallets` and it's an array of `MainWalletBase`.

## add `@cosmos-kit/prax-extension`

```
yarn add @cosmos-kit/prax-extension
```

## import the wallets

```js
import { wallets as prax } from "@cosmos-kit/prax-extension";
```

## add to your provider

```js
function MyCosmosApp({ Component, pageProps }: AppProps) {
return (
<ChainProvider
chains={chains}
assetLists={assets}
wallets={[...prax]}
walletConnectOptions={...} // required if `wallets` contains mobile wallets
>
<Component {...pageProps} />
</ChainProvider>
);
}

export default MyCosmosApp;
```