diff --git a/example/next/next.config.js b/example/next/next.config.js index 96456b8..2de2702 100644 --- a/example/next/next.config.js +++ b/example/next/next.config.js @@ -16,11 +16,6 @@ const nextConfig = { typescript: { ignoreBuildErrors: Boolean(process.env.VERCEL), }, - transpilePackages: [ - "@leapwallet/cosmos-social-login-capsule-provider", - "@leapwallet/cosmos-social-login-capsule-provider-ui", - "@leapwallet/capsule-web-sdk-lite", - ], }; module.exports = nextConfig; diff --git a/example/next/pages/_app.tsx b/example/next/pages/_app.tsx index dccb958..3a166ab 100644 --- a/example/next/pages/_app.tsx +++ b/example/next/pages/_app.tsx @@ -22,8 +22,8 @@ const CustomApp: NextPage = ({ Component, pageProps }) => { }, }, capsuleConfig: { - apiKey: "72c07c099c0f3d8e744bb0754a11726b", - env: "BETA", + apiKey: process.env.NEXT_PUBLIC_CAPSULE_API_KEY, + env: process.env.NEXT_PUBLIC_CAPSULE_ENV, }, }} > diff --git a/example/starter/src/pages/_app.tsx b/example/starter/src/pages/_app.tsx index e9fb58c..cb2052c 100644 --- a/example/starter/src/pages/_app.tsx +++ b/example/starter/src/pages/_app.tsx @@ -30,8 +30,8 @@ const MyApp = ({ Component, pageProps }: AppProps) => { }, }, capsuleConfig: { - apiKey: "72c07c099c0f3d8e744bb0754a11726b", - env: "BETA", + apiKey: process.env.NEXT_PUBLIC_CAPSULE_API_KEY, + env: process.env.NEXT_PUBLIC_CAPSULE_ENV, }, walletDefaultOptions: { sign: { diff --git a/packages/graz/src/hooks/account.ts b/packages/graz/src/hooks/account.ts index 8e2d6ea..d6efacf 100644 --- a/packages/graz/src/hooks/account.ts +++ b/packages/graz/src/hooks/account.ts @@ -198,7 +198,7 @@ export const useBalances = ( */ export const useBalance = ( args: { - denom: string; + denom?: string; bech32Address?: string; } & { chainId: ChainId } & QueryConfig, ): UseMultiChainQueryResult => { @@ -221,7 +221,11 @@ export const useBalance = ( return _balances?.find((x) => x.denom === _denom); }, { - enabled: Boolean(balances) && Boolean(balances?.length) && (args.enabled === undefined ? true : args.enabled), + enabled: + Boolean(args.denom) && + Boolean(balances) && + Boolean(balances?.length) && + (args.enabled === undefined ? true : args.enabled), }, ); diff --git a/packages/graz/src/store/index.ts b/packages/graz/src/store/index.ts index f093e2e..798525c 100644 --- a/packages/graz/src/store/index.ts +++ b/packages/graz/src/store/index.ts @@ -24,8 +24,8 @@ export interface WalletConnectStore { } export interface CapsuleConfig { - apiKey: string; - env: "DEV" | "SANDBOX" | "BETA" | "PROD"; + apiKey?: string; + env?: "DEV" | "SANDBOX" | "BETA" | "PROD"; } export interface CapsuleState {