Skip to content

Commit 77f6042

Browse files
committed
updates
1 parent 12b070b commit 77f6042

File tree

8 files changed

+3038
-1782
lines changed

8 files changed

+3038
-1782
lines changed

cca/README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# CCA App
22

3-
* <https://github.com/cosmology-tech/create-cosmos-app>
3+
This Ignite App is aimed to extend [Ignite CLI](https://github.com/ignite/cli) and bootstrap the development of a chain frontend.
4+
It uses the widely used [Cosmology create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) template and its libraries.
5+
6+
## Prerequisites
7+
8+
* Ignite v28.7.0 or later
9+
* Node.js
10+
* [Corepack](https://yarnpkg.com/corepack)
411

512
## Installation
613

@@ -13,6 +20,11 @@ ignite app install -g github.com/ignite/apps/cca
1320
```shell
1421
ignite s cca
1522
cd web
16-
npm install
17-
npm start
23+
yarn
24+
yarn dev
1825
```
26+
27+
Learn more about Cosmos-Kit and Ignite in their respective documentation:
28+
29+
* <https://docs.ignite.com>
30+
* <https://github.com/cosmology-tech/create-cosmos-app>

cca/templates/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Templates
22

3-
The template is based on [Cosmology chain-admin template](https://github.com/cosmology-tech/create-cosmos-app/tree/f758ce814fbe8bd1e7cb07d3a6e91242efe33cd4/templates/chain-template) at commit `f758ce814fbe8bd1e7cb07d3a6e91242efe33cd4`.
3+
The template is based on Cosmology's [chain-admin template](https://github.com/cosmology-tech/create-cosmos-app/tree/fd87039feee9568a86aa8d8d19edea8f4a78f599/templates/chain-template) at commit `fd87039feee9568a86aa8d8d19edea8f4a78f599`.
44

55
Some modifications have been done to make it work nicer with Ignite scaffolded chains.
66
An exhaustive list of changes compared to the original template can be found [here](./ignite-chain-admin.patch).
7+
8+
## Development Instructions
9+
10+
When upgrading the templates:
11+
12+
- checkout `github.com/cosmology-tech/create-cosmos-app` at the above mentioned commit.
13+
- apply the git patch to the `chain-template` directory (`git apply ignite-chain-admin.patch`)
14+
- merge upstream changes from main
15+
- commit the changes (as a single commit, rewriting history if necessary -- `git reset $(git merge-base main $(git branch --show-current))`)
16+
- export the changes to a patch file (`git diff main > ignite-chain-admin.patch`)

cca/templates/ignite-chain-admin.patch

Lines changed: 2645 additions & 363 deletions
Large diffs are not rendered by default.

cca/templates/web/components/common/Header/ChainDropdown.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import Image from 'next/image';
2-
import { useState } from 'react';
2+
import { useState, useEffect } from 'react';
33
import { useChain, useManager } from '@cosmos-kit/react';
44
import { Box, Combobox, Skeleton, Stack, Text } from '@interchain-ui/react';
5+
import { Chain, AssetList } from '@chain-registry/types';
56

67
import { useDetectBreakpoints } from '@/hooks';
78
import { chainStore, useChainStore } from '@/contexts';
@@ -11,12 +12,28 @@ import { getSignerOptions } from '@/utils';
1112
export const ChainDropdown = () => {
1213
const { selectedChain } = useChainStore();
1314
const { chain } = useChain(selectedChain);
14-
const [input, setInput] = useState<string>(chain.pretty_name);
15+
const [input, setInput] = useState<string>(chain.chain_name);
1516
const { isMobile } = useDetectBreakpoints();
1617

1718
const { addChains, getChainLogo } = useManager();
1819

1920
// TODO(@julienrbrt), use addChains, and add the chain from the generate chain-registry.json
21+
const loadAndAddChains = async () => {
22+
try {
23+
// Load chain and asset configurations
24+
const chainConfig: Chain = await import('../../../../chain.json');
25+
const assetConfig: AssetList = await import('../../../../assetlist.json');
26+
27+
// Add chains using cosmos-kit
28+
await addChains([chainConfig],[assetConfig]);
29+
} catch (error) {
30+
console.error('Failed to load chain configuration:', error);
31+
}
32+
};
33+
34+
useEffect(() => {
35+
loadAndAddChains();
36+
}, []);
2037

2138
const onOpenChange = (isOpen: boolean) => {};
2239

@@ -63,7 +80,7 @@ export const ChainDropdown = () => {
6380
>
6481
<Image
6582
src={getChainLogo(c.chain_name) ?? ''}
66-
alt={c.pretty_name}
83+
alt={c.chain_name}
6784
width={isMobile ? 18 : 24}
6885
height={isMobile ? 18 : 24}
6986
style={{

cca/templates/web/config/wallets.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ export const wallets = [
77
_wallets.keplr.extension,
88
_wallets.leap.extension,
99
_wallets.cosmostation.extension,
10-
_wallets.station.extension,
1110
] as MainWalletBase[];

cca/templates/web/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
"@cosmjs/amino": "0.32.3",
2222
"@cosmjs/cosmwasm-stargate": "0.32.3",
2323
"@cosmjs/stargate": "0.31.1",
24-
"@cosmos-kit/react": "2.18.0",
24+
"@cosmos-kit/react": "2.21.2",
2525
"@interchain-ui/react": "1.23.31",
2626
"@interchain-ui/react-no-ssr": "0.1.2",
2727
"@tanstack/react-query": "4.32.0",
2828
"ace-builds": "1.35.0",
2929
"bignumber.js": "9.1.2",
30-
"chain-registry": "1.69.33",
31-
"cosmos-kit": "2.18.4",
30+
"chain-registry": "^1.69.32",
31+
"cosmos-kit": "2.23.4",
3232
"dayjs": "1.11.11",
3333
"interchain-query": "1.10.1",
3434
"next": "^13",
@@ -42,7 +42,7 @@
4242
"zustand": "4.5.2"
4343
},
4444
"devDependencies": {
45-
"@chain-registry/types": "0.44.3",
45+
"@chain-registry/types": "^0.50.13",
4646
"@keplr-wallet/types": "^0.12.111",
4747
"@tanstack/react-query-devtools": "4.32.0",
4848
"@types/node": "18.11.9",

cca/templates/web/utils/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const getWalletLogo = (wallet: Wallet) => {
3131
};
3232

3333
export const getSignerOptions = (): SignerOptions => {
34-
const defaultGasPrice = GasPrice.fromString('0.025uatom');
34+
const defaultGasPrice = GasPrice.fromString('0.025stake');
3535

3636
return {
3737
// @ts-ignore

0 commit comments

Comments
 (0)