Skip to content

Commit

Permalink
fix address format
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomas committed Dec 17, 2024
1 parent fabbc3c commit e4dcdb7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions react/react-solana/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ createAppKit({
})

export function App() {
const [transactionHash, setTransactionHash] = useState<`0x${string}` | undefined>(undefined);
const [transactionHash, setTransactionHash] = useState<string | undefined>(undefined);
const [signedMsg, setSignedMsg] = useState('');
const [balance, setBalance] = useState('');

const receiveHash = (hash: `0x${string}`) => {
const receiveHash = (hash: string) => {
setTransactionHash(hash); // Update the state with the transaction hash
};

Expand Down
32 changes: 18 additions & 14 deletions react/react-solana/src/components/ActionButtonList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const ActionButtonList = ({ sendHash, sendSignMsg, sendBalance }: ActionB
const { disconnect } = useDisconnect();
const { open } = useAppKit();
const { switchNetwork } = useAppKitNetwork();
const { address } = useAppKitAccount()
const { isConnected, address } = useAppKitAccount()
const { connection } = useAppKitConnection();
const { walletProvider } = useAppKitProvider<Provider>('solana')

Expand Down Expand Up @@ -75,16 +75,20 @@ export const ActionButtonList = ({ sendHash, sendSignMsg, sendBalance }: ActionB
console.error("Failed to disconnect:", error);
}
};
return (
<div >
<div >
<button onClick={() => open()}>Open</button>
<button onClick={handleDisconnect}>Disconnect</button>
<button onClick={() => switchNetwork(networks[1]) }>Switch</button>
<button onClick={handleSignMsg}>Sign msg</button>
<button onClick={handleSendTx}>Send tx</button>
<button onClick={handleGetBalance}>Get Balance</button>
</div>
</div>
)
}
return (
<>
{isConnected ? (
<div >
<div >
<button onClick={() => open()}>Open</button>
<button onClick={handleDisconnect}>Disconnect</button>
<button onClick={() => switchNetwork(networks[1]) }>Switch</button>
<button onClick={handleSignMsg}>Sign msg</button>
<button onClick={handleSendTx}>Send tx</button>
<button onClick={handleGetBalance}>Get Balance</button>
</div>
</div>
) : null}
</>
);
}
2 changes: 1 addition & 1 deletion react/react-solana/src/components/InfoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@reown/appkit/react'

interface InfoListProps {
hash: `0x${string}` | undefined;
hash: string | undefined;
signedMsg: string;
balance: string;
}
Expand Down

0 comments on commit e4dcdb7

Please sign in to comment.