Skip to content

Commit 3ca4fea

Browse files
committed
update to interchain-kit, chain-registry/v2
1 parent 54f51d9 commit 3ca4fea

36 files changed

+2603
-1569
lines changed

examples/authz/CHANGELOG.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
88

99
### Bug Fixes
1010

11-
* deps ([b2aa70b](https://github.com/cosmology-tech/create-cosmos-app/commit/b2aa70ba9ef34fd96954c033220ff160d2c8ece7))
12-
* old ci job yarn4 issues ([#182](https://github.com/cosmology-tech/create-cosmos-app/issues/182)) ([2bb19f7](https://github.com/cosmology-tech/create-cosmos-app/commit/2bb19f75fcc6ffaa4bcb63ecf071009d2f9d7e76))
13-
* rename telescope-authz to authz ([9ba95fd](https://github.com/cosmology-tech/create-cosmos-app/commit/9ba95fd9d2e23620b1997e87f780460602507d60))
14-
* try locks update script ([000aa5f](https://github.com/cosmology-tech/create-cosmos-app/commit/000aa5fc73faa0182a23f50a6402e8b2351a587c))
15-
* upgrade deps and fix multi chain dropdown ([eecbcaa](https://github.com/cosmology-tech/create-cosmos-app/commit/eecbcaad5e7729f00f9121250c04eb40d201ed80))
11+
* deps ([b2aa70b](https://github.com/hyperweb-io/create-cosmos-app/commit/b2aa70ba9ef34fd96954c033220ff160d2c8ece7))
12+
* old ci job yarn4 issues ([#182](https://github.com/hyperweb-io/create-cosmos-app/issues/182)) ([2bb19f7](https://github.com/hyperweb-io/create-cosmos-app/commit/2bb19f75fcc6ffaa4bcb63ecf071009d2f9d7e76))
13+
* rename telescope-authz to authz ([9ba95fd](https://github.com/hyperweb-io/create-cosmos-app/commit/9ba95fd9d2e23620b1997e87f780460602507d60))
14+
* try locks update script ([000aa5f](https://github.com/hyperweb-io/create-cosmos-app/commit/000aa5fc73faa0182a23f50a6402e8b2351a587c))
15+
* upgrade deps and fix multi chain dropdown ([eecbcaa](https://github.com/hyperweb-io/create-cosmos-app/commit/eecbcaad5e7729f00f9121250c04eb40d201ed80))
1616

1717

1818

@@ -23,21 +23,21 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
2323

2424
### Bug Fixes
2525

26-
* rename telescope-authz to authz ([e30689d](https://github.com/cosmology-tech/create-cosmos-app/commit/e30689d1ff5f5c42a1c962aecc8b568511e0d0c2))
26+
* rename telescope-authz to authz ([e30689d](https://github.com/hyperweb-io/create-cosmos-app/commit/e30689d1ff5f5c42a1c962aecc8b568511e0d0c2))
2727

2828

2929

3030

3131

32-
## [0.0.4](https://github.com/cosmology-tech/create-cosmos-app/compare/@cosmology/[email protected]...@cosmology/[email protected]) (2024-01-20)
32+
## [0.0.4](https://github.com/hyperweb-io/create-cosmos-app/compare/@cosmology/[email protected]...@cosmology/[email protected]) (2024-01-20)
3333

3434
**Note:** Version bump only for package @cosmology/telescope-authz-example
3535

3636

3737

3838

3939

40-
## [0.0.3](https://github.com/cosmology-tech/create-cosmos-app/compare/@cosmology/[email protected]...@cosmology/[email protected]) (2024-01-20)
40+
## [0.0.3](https://github.com/hyperweb-io/create-cosmos-app/compare/@cosmology/[email protected]...@cosmology/[email protected]) (2024-01-20)
4141

4242
**Note:** Version bump only for package @cosmology/telescope-authz-example
4343

examples/authz/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This is a Cosmos App project bootstrapped with [`create-cosmos-app`](https://github.com/cosmology-tech/create-cosmos-app).
1+
This is a Cosmos App project bootstrapped with [`create-cosmos-app`](https://github.com/hyperweb-io/create-cosmos-app).
22

33
## Getting Started
44

@@ -12,13 +12,13 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the
1212

1313
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
1414

15-
## Learn More
15+
## Learn More
1616

1717
### Chain Registry
1818

1919
The npm package for the Official Cosmos chain registry. Get chain and token data for you application.
2020

21-
* https://github.com/cosmology-tech/chain-registry
21+
* https://github.com/hyperweb-io/chain-registry
2222

2323
### Cosmology Videos
2424

@@ -30,13 +30,13 @@ Checkout more videos for how to use various frontend tooling in the Cosmos!
3030

3131
A wallet connector for the Cosmos ⚛️
3232

33-
* https://github.com/cosmology-tech/cosmos-kit
33+
* https://github.com/hyperweb-io/cosmos-kit
3434

3535
### Telescope
3636

3737
A "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. Telescope is used to generate libraries for Cosmos blockchains. Simply point to your protobuffer files and create developer-friendly Typescript libraries for teams to build on your blockchain.
3838

39-
* https://github.com/cosmology-tech/telescope
39+
* https://github.com/hyperweb-io/telescope
4040

4141
🎥 [Checkout the Telescope video playlist](https://www.youtube.com/watch?v=n82MsLe82mk&list=PL-lMkVv7GZwyQaK6bp6kMdOS5mzosxytC) to learn how to use `telescope`!
4242

@@ -68,13 +68,13 @@ Check out our [Next.js deployment documentation](https://nextjs.org/docs/deploym
6868

6969
Checkout these related projects:
7070

71-
* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules.
71+
* [@cosmology/telescope](https://github.com/hyperweb-io/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules.
7272
* [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes.
73-
* [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application.
74-
* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface.
75-
* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command.
76-
* [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit.
77-
* [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain.
73+
* [chain-registry](https://github.com/hyperweb-io/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application.
74+
* [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.
75+
* [create-cosmos-app](https://github.com/hyperweb-io/create-cosmos-app) Set up a modern Cosmos app by running one command.
76+
* [interchain-ui](https://github.com/hyperweb-io/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit.
77+
* [starship](https://github.com/hyperweb-io/starship) Unified Testing and Development for the Interchain.
7878

7979
## Credits
8080

examples/authz/components/authz/AuthzSection.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
// @ts-nocheck
33

44
import { useState } from 'react';
5-
import { ChainName } from 'cosmos-kit';
6-
import { useChain } from '@cosmos-kit/react';
5+
import { useChain } from '@interchain-kit/react';
76
import { Box, Button, Tabs, Text } from '@interchain-ui/react';
87

98
import { Grants } from './Grants';
109
import { GrantModal } from './GrantModal';
1110

12-
export const AuthzSection = ({ chainName }: { chainName: ChainName }) => {
11+
export const AuthzSection = ({ chainName }: { chainName: string }) => {
1312
const [isOpen, setIsOpen] = useState(false);
1413
const [activeTab, setActiveTab] = useState(0);
1514
const { address } = useChain(chainName);

examples/authz/components/authz/GrantCard.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,15 @@ import {
1212
Text,
1313
TextField,
1414
} from '@interchain-ui/react';
15-
import { useChain } from '@cosmos-kit/react';
15+
import { useChain } from '@interchain-kit/react';
1616

1717
import {
1818
getChainLogoByChainName,
1919
PrettyGrant,
2020
PrettyPermission,
2121
} from '@/utils';
2222
import { useAuthzContext } from '@/context';
23-
import {
24-
useAuthzTx,
25-
useGrants,
26-
useSigningClientAmino,
27-
useSigningClientDirect,
28-
} from '@/hooks';
23+
import { useAuthzTx, useGrants, useSigningClient } from '@/hooks';
2924
import { getCoin, permissionNameToRouteMap } from '@/configs';
3025

3126
import styles from '@/styles/custom.module.css';
@@ -50,11 +45,15 @@ export const GrantCard = ({
5045
const [revokingPermission, setRevokingPermission] =
5146
useState<PrettyPermission>();
5247

53-
const { address: signerAddress, chain } = useChain(chainName);
48+
const {
49+
address: signerAddress,
50+
chain,
51+
getSigningClient,
52+
} = useChain(chainName);
5453
const { refetch } = useGrants(chainName);
5554
const { setPermission } = useAuthzContext();
5655
const { createRevokeMsg } = useAuthzTx(chainName);
57-
const { data: client } = useSigningClientDirect(chainName);
56+
const { data: client } = useSigningClient(chainName);
5857

5958
const { mutate: revoke } = useRevoke({
6059
clientResolver: client,

examples/authz/components/authz/GrantDetailsModal.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44
import { useState } from 'react';
55
import { BasicModal, Box, Button } from '@interchain-ui/react';
66

7-
import {
8-
useAuthzTx,
9-
useGrants,
10-
useSigningClientAmino,
11-
useSigningClientDirect,
12-
} from '@/hooks';
7+
import { useAuthzTx, useGrants, useSigningClient } from '@/hooks';
138
import { PrettyGrant, PrettyPermission } from '@/utils';
149
import { PermissionDetailCard } from './PermissionDetailCard';
1510
import { useRevoke } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
1611
import { defaultContext } from '@tanstack/react-query';
17-
import { useChain } from '@cosmos-kit/react';
12+
import { useChain } from '@interchain-kit/react';
1813

1914
type GrantDetailsModalProps = {
2015
grant: PrettyGrant;
@@ -42,7 +37,7 @@ export const GrantDetailsModal = ({
4237
const { refetch } = useGrants(chainName);
4338
const { createRevokeMsg } = useAuthzTx(chainName);
4439

45-
const { data: client } = useSigningClientDirect(chainName);
40+
const { data: client } = useSigningClient(chainName);
4641

4742
const { mutate: revoke } = useRevoke({
4843
clientResolver: client,

examples/authz/components/authz/GrantModal.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// @ts-nocheck
33

44
import { useState } from 'react';
5-
import { ChainName } from 'cosmos-kit';
65
import {
76
BasicModal,
87
Box,
@@ -17,7 +16,7 @@ import {
1716
FieldLabel,
1817
} from '@interchain-ui/react';
1918
import { coin } from '@cosmjs/amino';
20-
import { useChain } from '@cosmos-kit/react';
19+
import { useChain } from '@interchain-kit/react';
2120
import { IoMdCalendar } from 'react-icons/io';
2221
import Calendar from 'react-calendar';
2322
import dayjs from 'dayjs';
@@ -29,13 +28,7 @@ import {
2928
permissions,
3029
} from '@/configs';
3130
import { AuthorizationType } from '@interchainjs/react/cosmos/staking/v1beta1/authz';
32-
import {
33-
GrantMsg,
34-
useAuthzTx,
35-
useGrants,
36-
useSigningClientAmino,
37-
useSigningClientDirect,
38-
} from '@/hooks';
31+
import { GrantMsg, useAuthzTx, useGrants, useSigningClient } from '@/hooks';
3932
import { getTokenByChainName, shiftDigits } from '@/utils';
4033
import { CustomizationField } from './CustomizationField';
4134
import { AddressInput } from '@/components';
@@ -53,7 +46,7 @@ export type AccessList = {
5346
type GrantModalProps = {
5447
isOpen: boolean;
5548
onClose: () => void;
56-
chainName: ChainName;
49+
chainName: string;
5750
};
5851

5952
export const GrantModal = ({ isOpen, onClose, chainName }: GrantModalProps) => {
@@ -80,7 +73,7 @@ export const GrantModal = ({ isOpen, onClose, chainName }: GrantModalProps) => {
8073
const { refetch } = useGrants(chainName);
8174
const { address } = useChain(chainName);
8275
const { createGrantMsg } = useAuthzTx(chainName);
83-
const { data: client } = useSigningClientAmino(chainName);
76+
const { data: client } = useSigningClient(chainName);
8477

8578
const { mutate: grant } = useGrant({
8679
clientResolver: client,

examples/authz/components/authz/LoginInfoBanner.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// TODO fix type issues
22
// @ts-nocheck
33

4-
import { useChain } from '@cosmos-kit/react';
4+
import { WalletState } from '@interchain-kit/core';
5+
import { useChain } from '@interchain-kit/react';
56
import { Box, Icon, Text } from '@interchain-ui/react';
67

78
type LoginInfoBannerProps = {
@@ -13,9 +14,9 @@ export const LoginInfoBanner = ({
1314
loginAddress,
1415
chainName,
1516
}: LoginInfoBannerProps) => {
16-
const { isWalletConnected } = useChain(chainName);
17+
const { status } = useChain(chainName);
1718

18-
if (!isWalletConnected) return null;
19+
if (status === WalletState.Connected) return null;
1920

2021
return (
2122
<Box

examples/authz/components/claim-rewards/ClaimRewardsSection.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
// TODO fix type issues
22
// @ts-nocheck
33

4-
import { useChain } from '@cosmos-kit/react';
5-
import { ChainName } from 'cosmos-kit';
4+
import { useChain } from '@interchain-kit/react';
65
import { Box, Spinner, Text } from '@interchain-ui/react';
76

87
import { useStakingData } from '@/hooks';
98
import Overview from './Overview';
9+
import { WalletState } from '@interchain-kit/core';
1010

11-
export const ClaimRewardsSection = ({
12-
chainName,
13-
}: {
14-
chainName: ChainName;
15-
}) => {
16-
const { isWalletConnected } = useChain(chainName);
11+
export const ClaimRewardsSection = ({ chainName }: { chainName: string }) => {
12+
const { status } = useChain(chainName);
1713
const { data, isLoading, refetch } = useStakingData(chainName);
1814

1915
return (
2016
<Box mt="$16" mb="$26">
21-
{!isWalletConnected ? (
17+
{status !== WalletState.Connected ? (
2218
<Box
2319
height="$28"
2420
display="flex"

examples/authz/components/claim-rewards/Overview.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import {
77
StakingAssetHeader,
88
StakingClaimHeader,
99
} from '@interchain-ui/react';
10-
import { ChainName } from 'cosmos-kit';
1110

1211
import { getCoin } from '@/configs';
13-
import { Prices, useAuthzTx, useSigningClientDirect } from '@/hooks';
12+
import { Prices, useAuthzTx, useSigningClient } from '@/hooks';
1413
import {
1514
sum,
1615
calcDollarValue,
@@ -34,15 +33,15 @@ const Overview = ({
3433
rewards: Rewards;
3534
staked: string;
3635
updateData: () => void;
37-
chainName: ChainName;
36+
chainName: string;
3837
prices: Prices;
3938
}) => {
4039
const [isClaiming, setIsClaiming] = useState(false);
4140

4241
const { permission } = useAuthzContext();
4342
const { createExecMsg } = useAuthzTx(chainName);
4443

45-
const { data: client } = useSigningClientDirect(chainName);
44+
const { data: client } = useSigningClient(chainName);
4645

4746
const { mutate: exec } = useExec({
4847
clientResolver: client,

examples/authz/components/common/AddressInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @ts-nocheck
33

44
import { useMemo } from 'react';
5-
import { useChain } from '@cosmos-kit/react';
5+
import { useChain } from '@interchain-kit/react';
66
import { fromBech32 } from '@cosmjs/encoding';
77
import { TextField, Text, Box, BoxProps } from '@interchain-ui/react';
88

@@ -37,8 +37,8 @@ export const AddressInput = ({
3737

3838
try {
3939
const res = fromBech32(address);
40-
if (!address.startsWith(chain.bech32_prefix)) {
41-
errorMsg = `Invalid address: Unexpected prefix (expected: ${chain.bech32_prefix}, actual: ${res.prefix})`;
40+
if (!address.startsWith(chain.bech32Prefix)) {
41+
errorMsg = `Invalid address: Unexpected prefix (expected: ${chain.bech32Prefix}, actual: ${res.prefix})`;
4242
}
4343
} catch (error) {
4444
errorMsg = 'Invalid address';

0 commit comments

Comments
 (0)