diff --git a/example/package-lock.json b/example/package-lock.json index 01e0ccb..1ba6668 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -42,7 +42,7 @@ } }, "..": { - "version": "2.7.0", + "version": "2.8.0", "license": "ISC", "dependencies": { "@sats-connect/core": "0.2.2", diff --git a/example/src/App.tsx b/example/src/App.tsx index 5ca5d61..4835074 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -20,6 +20,7 @@ import { GetRunesBalance } from './components/GetRunesBalance'; import { SendInscription } from './components/sendInscriptions'; import AddressDisplay from './components/AddressDisplay'; +import { GetAddresses } from './components/bitcoin/GetAddresses.tsx'; import { SendBtc } from './components/bitcoin/SendBtc'; import EtchRunes from './components/EtchRunes'; import MintRunes from './components/MintRunes'; @@ -161,8 +162,9 @@ const WalletMethods = () => { addresses={[...btcAddressInfo, ...stxAddressInfo]} onDisconnect={onDisconnect} /> - + + ); }; @@ -235,7 +237,13 @@ const router = createBrowserRouter( ), ); -const queryClient = new QueryClient(); +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + }, + }, +}); const theme = createTheme({ primaryColor: 'orange', diff --git a/example/src/components/bitcoin/GetAccounts.tsx b/example/src/components/bitcoin/GetAccounts.tsx index 7afb61b..d08d2d5 100644 --- a/example/src/components/bitcoin/GetAccounts.tsx +++ b/example/src/components/bitcoin/GetAccounts.tsx @@ -1,7 +1,7 @@ -import Wallet, { AddressPurpose } from 'sats-connect'; -import { Button, Card } from '../../App.styles'; import { useQuery } from '@tanstack/react-query'; +import Wallet, { AddressPurpose } from 'sats-connect'; import styled from 'styled-components'; +import { Button, Card } from '../../App.styles'; const ErrorMessage = styled.div({ color: 'red', @@ -24,7 +24,7 @@ export function GetAccounts() { return ( -

Get accounts

+

[Legacy] Get accounts

+ + {(() => { + if (isFetching) { + return

Loading...

; + } + + if (isError) { + console.error(error); + console.error(error.cause); + return Error. Check console for details.; + } + + if (isSuccess) { + console.log(data); + return ( +
+

Check console for data.

+
+ ); + } + })()} +
+ ); +} diff --git a/example/src/components/wallet/WalletType.tsx b/example/src/components/wallet/WalletType.tsx index 4810d09..fa35de4 100644 --- a/example/src/components/wallet/WalletType.tsx +++ b/example/src/components/wallet/WalletType.tsx @@ -1,7 +1,7 @@ -import Wallet from 'sats-connect'; -import { Button, Card } from '../../App.styles'; import { useQuery } from '@tanstack/react-query'; +import Wallet from 'sats-connect'; import styled from 'styled-components'; +import { Button, Card } from '../../App.styles'; const ErrorMessage = styled.div({ color: 'red', @@ -39,6 +39,7 @@ export function WalletType() { if (isError) { console.error(error); + console.error(error.cause); return Error. Check console for details.; }