Skip to content

Commit

Permalink
optional apikey and env
Browse files Browse the repository at this point in the history
  • Loading branch information
codingki committed Apr 20, 2024
1 parent 8e26211 commit 2af6bbd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
5 changes: 0 additions & 5 deletions example/next/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions example/next/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const CustomApp: NextPage<AppProps> = ({ Component, pageProps }) => {
},
},
capsuleConfig: {
apiKey: "72c07c099c0f3d8e744bb0754a11726b",
env: "BETA",
apiKey: process.env.NEXT_PUBLIC_CAPSULE_API_KEY,
env: process.env.NEXT_PUBLIC_CAPSULE_ENV,
},
}}
>
Expand Down
4 changes: 2 additions & 2 deletions example/starter/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
8 changes: 6 additions & 2 deletions packages/graz/src/hooks/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const useBalances = <TMulti extends MultiChainHookArgs>(
*/
export const useBalance = <TMulti extends MultiChainHookArgs>(
args: {
denom: string;
denom?: string;
bech32Address?: string;
} & { chainId: ChainId } & QueryConfig,
): UseMultiChainQueryResult<TMulti, Coin | undefined> => {
Expand All @@ -221,7 +221,11 @@ export const useBalance = <TMulti extends MultiChainHookArgs>(
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),
},
);

Expand Down
4 changes: 2 additions & 2 deletions packages/graz/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2af6bbd

Please sign in to comment.