Skip to content

Commit 63de06f

Browse files
authored
Merge pull request #436 from ljunb/feat/foxwallet-extension
feat: add FoxWallet extension
2 parents 22b6e87 + bcee4b6 commit 63de06f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1023
-2
lines changed

examples/cosmos-kit-nextjs-pages-router-example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@cosmos-kit/core": "^2.16.0",
3232
"@cosmos-kit/cosmostation": "^2.15.0",
3333
"@cosmos-kit/fin": "^2.14.0",
34+
"@cosmos-kit/foxwallet": "^1.0.0",
3435
"@cosmos-kit/ins": "^2.2.4",
3536
"@cosmos-kit/keplr": "^2.15.0",
3637
"@cosmos-kit/leap": "^2.15.0",

examples/cosmos-kit-nextjs-pages-router-example/pages/_app.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { MainWalletBase } from "@cosmos-kit/core";
1414
import { wallets as keplrWallets } from "@cosmos-kit/keplr";
1515
import { wallets as leapWallets } from "@cosmos-kit/leap";
1616
import { wallets as owalletWallets } from "@cosmos-kit/owallet";
17+
import { wallets as foxWallets } from "@cosmos-kit/foxwallet";
1718
// Show how to custom modal views
1819
import { ChainProvider, defaultModalViews } from "@cosmos-kit/react";
1920
import { wallets as stationWallets } from "@cosmos-kit/station";
@@ -101,6 +102,7 @@ function MyApp({ Component, pageProps }: AppProps) {
101102
...ctrlWallets,
102103
// ...frontierWallets,
103104
...coin98Wallets,
105+
...foxWallets,
104106
// ...finWallets,
105107
// ...cdcwalletWallets,
106108
]}

packages/cosmos-kit/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"@cosmos-kit/ctrl": "^2.14.0",
8080
"@cosmos-kit/exodus": "^2.13.0",
8181
"@cosmos-kit/fin": "^2.14.0",
82+
"@cosmos-kit/foxwallet": "^1.0.0",
8283
"@cosmos-kit/galaxy-station": "^2.14.0",
8384
"@cosmos-kit/keplr": "^2.15.0",
8485
"@cosmos-kit/leap": "^2.15.0",

packages/cosmos-kit/src/wallets.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { wallets as exodusExtension } from '@cosmos-kit/exodus-extension';
2424
import { wallets as tailwindWallet } from '@cosmos-kit/tailwind';
2525
import { wallets as cdcwalletExtension } from '@cosmos-kit/cdcwallet-extension';
2626
import { wallets as bitgetwalletExtension } from '@cosmos-kit/bitgetwallet-extension';
27+
import { wallets as foxwalletExtension } from '@cosmos-kit/foxwallet-extension';
2728

2829
export type WalletName =
2930
| 'keplr'
@@ -43,7 +44,8 @@ export type WalletName =
4344
| 'exodus'
4445
| 'galaxystation'
4546
| 'cdcwallet'
46-
| 'bitgetwallet';
47+
| 'bitgetwallet'
48+
| 'foxwallet';
4749

4850
export type WalletList<
4951
E extends MainWalletBase | null,
@@ -104,6 +106,7 @@ export const tailwind = createWalletList(tailwindWallet[0], null);
104106
export const owallet = createWalletList(owalletExtension[0], owalletMobile[0]);
105107
export const cdcwallet = createWalletList(cdcwalletExtension[0], null);
106108
export const bitgetwallet = createWalletList(bitgetwalletExtension[0], null);
109+
export const foxwallet = createWalletList(foxwalletExtension[0], null);
107110

108111
export type SubWalletList = MainWalletBase[] & {
109112
get mobile(): MainWalletBase[];
@@ -128,6 +131,7 @@ export type AllWalletList = SubWalletList & {
128131
cdcwallet: typeof cdcwallet;
129132
galaxystation: typeof galaxystation;
130133
bitgetwallet: typeof bitgetwallet;
134+
foxwallet: typeof foxwallet;
131135
for: (...names: WalletName[]) => SubWalletList;
132136
not: (...names: WalletName[]) => SubWalletList;
133137
};
@@ -169,6 +173,7 @@ export function createAllWalletList(ws: MainWalletBase[]) {
169173
wallets.cdcwallet = cdcwallet;
170174
wallets.galaxystation = galaxystation;
171175
wallets.bitgetwallet = bitgetwallet;
176+
wallets.foxwallet = foxwallet;
172177

173178
defineGetters(wallets);
174179

@@ -216,6 +221,7 @@ export const wallets = createAllWalletList([
216221
...tailwind,
217222
...owallet,
218223
...cdcwallet,
224+
...foxwallet,
219225
...galaxystation,
220226
...bitgetwallet,
221227
]);

packages/docs/pages/_app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ function MyApp({ Component, pageProps }: AppProps) {
6262
"fin",
6363
"tailwind",
6464
"owallet",
65-
"cdcwallet"
65+
"cdcwallet",
66+
"foxwallet"
6667
),
6768
// ...web3AuthWallets,
6869
]}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# How to Add FoxWallet to CosmosKit
2+
3+
There are two packages for foxwallet
4+
5+
- `@cosmos-kit/foxwallet`
6+
- `@cosmos-kit/foxwallet-extension`
7+
8+
`@cosmos-kit/foxwallet` export all available foxwallet wallets, while if you only want to add a particular one, choose `@cosmos-kit/foxwallet-extension`
9+
10+
> Note: all these packages export `wallets` and it's an array of `MainWalletBase`
11+
12+
Take `@cosmos-kit/foxwallet` for example
13+
14+
## add `@cosmos-kit/foxwallet`
15+
16+
```
17+
yarn add @cosmos-kit/foxwallet
18+
```
19+
20+
## import the wallets
21+
22+
```js
23+
import { wallets as foxwallet } from "@cosmos-kit/foxwallet";
24+
```
25+
26+
## add to your provider
27+
28+
```js
29+
function MyCosmosApp({ Component, pageProps }: AppProps) {
30+
return (
31+
<ChainProvider
32+
chains={chains}
33+
assetLists={assets}
34+
wallets={[...foxwallet]}
35+
walletConnectOptions={...} // required if `wallets` contains mobile wallets
36+
>
37+
<Component {...pageProps} />
38+
</ChainProvider>
39+
);
40+
}
41+
42+
export default MyCosmosApp;
43+
```
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
dist/
3+
main/
4+
module/
5+
types/
6+
coverage/
7+
/index.ts
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"plugins": [
3+
"@typescript-eslint",
4+
"simple-import-sort",
5+
"unused-imports"
6+
],
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
// configures both eslint-plugin-prettier and eslint-config-prettier
11+
"plugin:prettier/recommended"
12+
],
13+
"parser": "@typescript-eslint/parser",
14+
"parserOptions": {
15+
"ecmaVersion": 2020,
16+
"sourceType": "module",
17+
"project": "tsconfig.json"
18+
},
19+
"env": {
20+
"es6": true,
21+
"browser": true,
22+
"node": true,
23+
"jest": true
24+
},
25+
"rules": {
26+
"simple-import-sort/imports": 2,
27+
"simple-import-sort/exports": 2,
28+
"prettier/prettier": 2,
29+
"unused-imports/no-unused-imports": 2,
30+
"no-console": 1,
31+
"no-debugger": 2,
32+
"no-alert": 2,
33+
"no-await-in-loop": 0,
34+
"no-prototype-builtins": 0,
35+
"no-return-assign": [
36+
"error",
37+
"except-parens"
38+
],
39+
"no-restricted-syntax": [
40+
2,
41+
"ForInStatement",
42+
"LabeledStatement",
43+
"WithStatement"
44+
],
45+
"no-unused-vars": 0,
46+
"@typescript-eslint/no-unused-vars": [
47+
"warn",
48+
{
49+
"argsIgnorePattern": "React|res|next|^_"
50+
}
51+
],
52+
"prefer-const": [
53+
"error",
54+
{
55+
"destructuring": "all"
56+
}
57+
],
58+
"no-unused-expressions": [
59+
2,
60+
{
61+
"allowTaggedTemplates": true
62+
}
63+
],
64+
"comma-dangle": 0,
65+
"jsx-quotes": [
66+
2,
67+
"prefer-double"
68+
],
69+
"linebreak-style": [
70+
"error",
71+
"unix"
72+
],
73+
"quotes": [
74+
2,
75+
"single",
76+
{
77+
"avoidEscape": true,
78+
"allowTemplateLiterals": true
79+
}
80+
]
81+
}
82+
}

0 commit comments

Comments
 (0)