Skip to content

Commit ce1099d

Browse files
committed
feat!: remove cosmos-kit from react-components
1 parent 534cd44 commit ce1099d

Some content is hidden

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

42 files changed

+4234
-9704
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"resolutions": {
4848
"@agoric/swingset-liveslots": "0.10.3-dev-8c14632.0",
4949
"@agoric/xsnap@npm:^0.14.3-u14.0": "patch:@agoric/xsnap@npm%3A0.14.3-u14.0#~/.yarn/patches/@agoric-xsnap-npm-0.14.3-u14.0-768ce73dba.patch",
50-
"@agoric/xsnap@npm:^0.14.2": "patch:@agoric/xsnap@npm%3A0.14.3-u14.0#~/.yarn/patches/@agoric-xsnap-npm-0.14.3-u14.0-768ce73dba.patch"
50+
"@agoric/xsnap@npm:^0.14.2": "patch:@agoric/xsnap@npm%3A0.14.3-u14.0#~/.yarn/patches/@agoric-xsnap-npm-0.14.3-u14.0-768ce73dba.patch",
51+
"esbuild": "0.21.5"
5152
}
5253
}

packages/example/.eslintrc.cjs

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/example/README.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
1-
# React + TypeScript + Vite
1+
This is an Interchain App project bootstrapped with [`create-interchain-app`](https://github.com/hyperweb-io/create-interchain-app).
22

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3+
## Getting Started
44

5-
Currently, two official plugins are available:
5+
First, install the packages and run the development server:
66

7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7+
```bash
8+
yarn install && yarn dev
9+
```
910

10-
## Expanding the ESLint configuration
11+
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
1112

12-
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13+
You can start editing the page by modifying `src/App.tsx`. The page auto-updates as you edit the file.
1314

14-
- Configure the top-level `parserOptions` property like this:
15+
## Interchain JavaScript Stack
1516

16-
```js
17-
export default {
18-
// other rules...
19-
parserOptions: {
20-
ecmaVersion: 'latest',
21-
sourceType: 'module',
22-
project: ['./tsconfig.json', './tsconfig.node.json'],
23-
tsconfigRootDir: __dirname,
24-
},
25-
};
26-
```
17+
A unified toolkit for building applications and smart contracts in the Interchain ecosystem ⚛️
18+
19+
| Category | Tools | Description |
20+
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
21+
| **Chain Information** | [**Chain Registry**](https://github.com/hyperweb-io/chain-registry), [**Utils**](https://www.npmjs.com/package/@chain-registry/utils), [**Client**](https://www.npmjs.com/package/@chain-registry/client) | Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. |
22+
| **Wallet Connectors** | [**Interchain Kit**](https://github.com/hyperweb-io/interchain-kit)<sup>beta</sup>, [**Cosmos Kit**](https://github.com/hyperweb.io/cosmos-kit) | Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. |
23+
| **Signing Clients** | [**InterchainJS**](https://github.com/hyperweb-io/interchainjs)<sup>beta</sup>, [**CosmJS**](https://github.com/cosmos/cosmjs) | A single, universal signing interface for any network |
24+
| **SDK Clients** | [**Telescope**](https://github.com/hyperweb.io/telescope) | Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. |
25+
| **Starter Kits** | [**Create Interchain App**](https://github.com/hyperweb-io/create-interchain-app)<sup>beta</sup>, [**Create Cosmos App**](https://github.com/hyperweb.io/create-cosmos-app) | Set up a modern Interchain app by running one command. |
26+
| **UI Kits** | [**Interchain UI**](https://github.com/hyperweb.io/interchain-ui) | The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. |
27+
| **Testing Frameworks** | [**Starship**](https://github.com/hyperweb.io/starship) | Unified Testing and Development for the Interchain. |
28+
| **TypeScript Smart Contracts** | [**Create Hyperweb App**](https://github.com/hyperweb-io/create-hyperweb-app) | Build and deploy full-stack blockchain applications with TypeScript |
29+
| **CosmWasm Contracts** | [**CosmWasm TS Codegen**](https://github.com/CosmWasm/ts-codegen) | Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. |
30+
31+
## Credits
32+
33+
🛠 Built by Hyperweb (formerly Cosmology) — if you like our tools, please checkout and contribute to [our github ⚛️](https://github.com/hyperweb-io)
34+
35+
## Disclaimer
36+
37+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
2738

28-
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29-
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
39+
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.

packages/example/eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

packages/example/package.json

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
{
2-
"name": "example",
2+
"name": "@agoric/ui-kit-example",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "0.0.1",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc && vite build",
9-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10-
"postinstall": "patch-package",
8+
"build": "tsc -b && vite build",
9+
"lint": "eslint .",
1110
"preview": "vite preview"
1211
},
1312
"dependencies": {
14-
"@agoric/react-components": "0.4.0",
15-
"patch-package": "^7.0.0",
16-
"react": "^18.2.0",
17-
"react-dom": "^18.2.0",
18-
"ses": "1.3.0"
13+
"@agoric/react-components": "^0.5.0",
14+
"@agoric/rpc": "^0.10.0",
15+
"@agoric/web-components": "^0.17.0",
16+
"buffer": "^6.0.3",
17+
"react": "^18.3.1",
18+
"react-dom": "^18.3.1"
1919
},
2020
"devDependencies": {
21-
"@types/react": "^18.2.66",
22-
"@types/react-dom": "^18.2.22",
23-
"@typescript-eslint/eslint-plugin": "^7.2.0",
24-
"@typescript-eslint/parser": "^7.2.0",
25-
"@vitejs/plugin-react": "^4.2.1",
26-
"eslint": "^8.57.0",
27-
"eslint-plugin-react-hooks": "^4.6.0",
28-
"eslint-plugin-react-refresh": "^0.4.6",
29-
"typescript": "^5.2.2",
30-
"vite": "^5.2.0"
21+
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
22+
"@eslint/js": "^9.9.1",
23+
"@keplr-wallet/types": "^0.12.271",
24+
"@types/react": "^18.3.5",
25+
"@types/react-dom": "^18.3.0",
26+
"@vitejs/plugin-react": "^4.3.1",
27+
"eslint": "^9.9.1",
28+
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
29+
"eslint-plugin-react-refresh": "^0.4.11",
30+
"globals": "^15.9.0",
31+
"typescript": "^5.5.3",
32+
"typescript-eslint": "^8.3.0",
33+
"vite": "^5.4.2",
34+
"vite-plugin-node-polyfills": "^0.24.0"
3135
}
3236
}

packages/example/public/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

packages/example/src/App.tsx

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,36 @@
1-
import { AgoricProvider, ConnectWalletButton } from '@agoric/react-components';
2-
import { wallets } from 'cosmos-kit';
3-
import { ThemeProvider, useTheme } from '@interchain-ui/react';
4-
import '@agoric/react-components/dist/style.css';
1+
import { useEffect } from 'react';
2+
import WalletDetails from './components/WalletDetails';
3+
import { useWalletManager } from './hooks/useWalletManager';
4+
import { AgoricProvider } from '@agoric/react-components';
5+
import { CHAIN_ID, REST_ENDPOINT, RPC_ENDPOINT } from './utils/constants';
56

6-
const localnet = {
7-
testChain: {
8-
chainId: 'agoriclocal',
9-
chainName: 'agoric-local',
10-
},
11-
apis: {
12-
rest: ['http://localhost:1317'],
13-
rpc: ['http://localhost:26657'],
14-
iconUrl: '/agoriclocal.svg', // Optional icon for Network Dropdown component
15-
},
16-
};
7+
function App() {
8+
const { address, connectWallet, offlineSigner } = useWalletManager();
179

18-
// Omit "testChain" to specify the apis for Agoric Mainnet.
19-
const mainnet = {
20-
apis: {
21-
rest: ['https://main.api.agoric.net'],
22-
rpc: ['https://main.rpc.agoric.net'],
23-
},
24-
};
10+
useEffect(() => {
11+
connectWallet();
12+
}, [connectWallet]);
2513

26-
const App = () => {
27-
const { themeClass } = useTheme();
2814
return (
29-
<ThemeProvider>
30-
<div className={themeClass}>
31-
<AgoricProvider
32-
wallets={wallets.extension}
33-
agoricNetworkConfigs={[localnet, mainnet]}
34-
/**
35-
* If unspecified, connects to Agoric Mainnet by default.
36-
* See "Network Dropdown" below to see how to switch between Agoric testnets.
37-
*/
38-
defaultChainName="agoric-local"
39-
>
40-
<ConnectWalletButton />
41-
</AgoricProvider>
15+
<AgoricProvider
16+
restEndpoint={REST_ENDPOINT}
17+
rpcEndpoint={RPC_ENDPOINT}
18+
offlineSigner={offlineSigner}
19+
address={address}
20+
chainName={CHAIN_ID}
21+
>
22+
<div>
23+
<div>
24+
<h1> Agoric Wallet</h1>
25+
{!address ? (
26+
<button onClick={connectWallet}>Connect Keplr</button>
27+
) : (
28+
<WalletDetails />
29+
)}
30+
</div>
4231
</div>
43-
</ThemeProvider>
32+
</AgoricProvider>
4433
);
45-
};
34+
}
4635

4736
export default App;
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)