Skip to content

Commit c4ca37e

Browse files
authored
Merge pull request #41 from hyperweb-io/kit-feature-signingclient
use the latest kit feature signingclient
2 parents 94e93d2 + c831cb7 commit c4ca37e

File tree

566 files changed

+220
-139566
lines changed

Some content is hidden

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

566 files changed

+220
-139566
lines changed

examples/authz/components/authz/GrantCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
PrettyPermission,
2121
} from '@/utils';
2222
import { useAuthzContext } from '@/context';
23-
import { useAuthzTx, useGrants, useSigningClient } from '@/hooks';
23+
import { useAuthzTx, useGrants } from '@/hooks';
2424
import { getCoin, permissionNameToRouteMap } from '@/configs';
2525

2626
import styles from '@/styles/custom.module.css';
@@ -86,7 +86,7 @@ export const GrantCard = ({
8686
amount: [
8787
{
8888
denom: token.base,
89-
amount: '2500',
89+
amount: '75000',
9090
},
9191
],
9292
gas: '1000000',

examples/authz/components/authz/GrantDetailsModal.tsx

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

7-
import { useAuthzTx, useGrants, useSigningClient } from '@/hooks';
7+
import { useAuthzTx, useGrants } from '@/hooks';
88
import { getTokenByChainName, PrettyGrant, PrettyPermission } from '@/utils';
99
import { PermissionDetailCard } from './PermissionDetailCard';
1010
import { useRevoke } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
@@ -52,7 +52,7 @@ export const GrantDetailsModal = ({
5252
amount: [
5353
{
5454
denom: token.base,
55-
amount: '2500',
55+
amount: '75000',
5656
},
5757
],
5858
gas: '1000000',

examples/authz/components/authz/GrantModal.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
permissions,
2929
} from '@/configs';
3030
import { AuthorizationType } from '@interchainjs/react/cosmos/staking/v1beta1/authz';
31-
import { GrantMsg, useAuthzTx, useGrants, useSigningClient } from '@/hooks';
31+
import { GrantMsg, useAuthzTx, useGrants } from '@/hooks';
3232
import { getTokenByChainName, shiftDigits } from '@/utils';
3333
import { CustomizationField } from './CustomizationField';
3434
import { AddressInput } from '@/components';
@@ -140,7 +140,7 @@ export const GrantModal = ({ isOpen, onClose, chainName }: GrantModalProps) => {
140140
amount: [
141141
{
142142
denom: token.base,
143-
amount: '2500',
143+
amount: '75000',
144144
},
145145
],
146146
gas: '1000000',
@@ -154,7 +154,8 @@ export const GrantModal = ({ isOpen, onClose, chainName }: GrantModalProps) => {
154154
memo: 'granting permission',
155155
},
156156
{
157-
onSuccess: () => {
157+
onSuccess: (data) => {
158+
console.log('data', data);
158159
refetch();
159160
onModalClose();
160161
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from '@interchain-ui/react';
1010

1111
import { getCoin } from '@/configs';
12-
import { Prices, useAuthzTx, useSigningClient } from '@/hooks';
12+
import { Prices, useAuthzTx } from '@/hooks';
1313
import {
1414
sum,
1515
calcDollarValue,
@@ -68,7 +68,7 @@ const Overview = ({
6868
amount: [
6969
{
7070
denom: token.base,
71-
amount: '2500',
71+
amount: '75000',
7272
},
7373
],
7474
gas: '1000000',

examples/authz/components/send/send.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useChain } from '@interchain-kit/react';
66
import { Box, Button, Spinner, Text, TokenInput } from '@interchain-ui/react';
77
import BigNumber from 'bignumber.js';
88

9-
import { useAuthzTx, useSendData, useSigningClient, useToast } from '@/hooks';
9+
import { useAuthzTx, useSendData, useToast } from '@/hooks';
1010
import {
1111
getCoin,
1212
getExponent,
@@ -82,7 +82,7 @@ export const SendSection = ({ chainName }: SendSectionProps) => {
8282
amount: [
8383
{
8484
denom: coin.base,
85-
amount: '2500',
85+
amount: '75000',
8686
},
8787
],
8888
gas: '1000000',

examples/authz/components/staking/DelegateModal.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@ import {
2323
} from '@/utils';
2424
import { getCoin, getExponent } from '@/configs';
2525
import { useAuthzContext } from '@/context';
26-
import {
27-
Prices,
28-
useAuthzTx,
29-
UseDisclosureReturn,
30-
useSigningClient,
31-
useToast,
32-
} from '@/hooks';
26+
import { Prices, useAuthzTx, UseDisclosureReturn, useToast } from '@/hooks';
3327
import { MsgDelegate } from '@interchainjs/react/cosmos/staking/v1beta1/tx';
3428
import { StakeAuthorization } from '@interchainjs/react/cosmos/staking/v1beta1/authz';
3529
import { useExec } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
@@ -136,7 +130,7 @@ export const DelegateModal = ({
136130
amount: [
137131
{
138132
denom: coin.base,
139-
amount: '2500',
133+
amount: '75000',
140134
},
141135
],
142136
gas: '1000000',

examples/authz/components/staking/Overview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useChain } from '@interchain-kit/react';
1111
import { useWithdrawDelegatorReward } from '@interchainjs/react/cosmos/distribution/v1beta1/tx.rpc.react';
1212

1313
import { getCoin } from '@/configs';
14-
import { Prices, useSigningClient, useTx } from '@/hooks';
14+
import { Prices, useTx } from '@/hooks';
1515
import {
1616
sum,
1717
calcDollarValue,
@@ -63,7 +63,7 @@ const Overview = ({
6363
amount: [
6464
{
6565
denom: coin.base,
66-
amount: '2500',
66+
amount: '75000',
6767
},
6868
],
6969
gas: '1000000',

examples/authz/components/voting/Proposal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export function Proposal({
166166
amount: [
167167
{
168168
denom: coin.base,
169-
amount: '2500',
169+
amount: '75000',
170170
},
171171
],
172172
gas: '1000000',

examples/authz/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
"@cosmjs/stargate": "0.32.4",
4444
"@cosmjs/tendermint-rpc": "0.32.4",
4545
"@cosmology/lcd": "^0.12.0",
46-
"@interchain-kit/core": "0.2.222",
47-
"@interchain-kit/keplr-extension": "0.2.222",
48-
"@interchain-kit/leap-extension": "0.2.222",
49-
"@interchain-kit/react": "0.2.222",
46+
"@interchain-kit/core": "0.3.17",
47+
"@interchain-kit/keplr-extension": "0.3.17",
48+
"@interchain-kit/leap-extension": "0.3.17",
49+
"@interchain-kit/react": "0.3.17",
5050
"@interchain-ui/react": "1.23.22",
5151
"@interchain-ui/react-no-ssr": "^0.1.6",
5252
"@interchainjs/cosmos": "1.11.2",
@@ -56,7 +56,7 @@
5656
"chain-registry": "^1.69.32",
5757
"dayjs": "1.11.10",
5858
"fast-fuzzy": "^1.12.0",
59-
"interchain-kit": "0.2.222",
59+
"interchain-kit": "0.3.17",
6060
"next": "^13",
6161
"react": "18.2.0",
6262
"react-calendar": "4.8.0",

examples/authz/pages/index.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,27 @@ import { useAuthzContext } from '@/context';
1313
import { Layout, Wallet, AuthzSection } from '@/components';
1414
import { useChain } from '@interchain-kit/react';
1515
import { defaultChainName } from '@/configs';
16-
import { useSigningClient } from '@/hooks';
1716
export default function Home() {
1817
const [selectedChain, setSelectedChain] = useState<string>();
1918
const { setChainName } = useAuthzContext();
2019
const queryClient = useQueryClient();
2120

22-
const { rpcEndpoint, status } = useChain(selectedChain ?? defaultChainName);
23-
24-
const { data: client, isSuccess: isSigningClientSuccess } = useSigningClient(
25-
selectedChain ?? defaultChainName,
26-
{
27-
walletStatus: status,
28-
}
29-
);
21+
const {
22+
rpcEndpoint,
23+
status,
24+
signingClient: client,
25+
isSigningClientLoading,
26+
} = useChain(selectedChain ?? defaultChainName);
3027

3128
useEffect(() => {
32-
if (isSigningClientSuccess) {
29+
if (!isSigningClientLoading) {
3330
queryClient.setQueryData([DEFAULT_SIGNING_CLIENT_QUERY_KEY], client);
3431
}
3532

36-
if (isSigningClientSuccess && rpcEndpoint) {
33+
if (rpcEndpoint) {
3734
queryClient.setQueryData([DEFAULT_RPC_CLIENT_QUERY_KEY], rpcEndpoint);
3835
}
39-
}, [isSigningClientSuccess, rpcEndpoint, client, queryClient]);
36+
}, [isSigningClientLoading, rpcEndpoint, client, queryClient]);
4037

4138
return (
4239
<Layout>

0 commit comments

Comments
 (0)