Skip to content

Commit

Permalink
feat(ui): fix TypeScript type incompatibility for gasPrice in signing…
Browse files Browse the repository at this point in the history
…CosmWasm
  • Loading branch information
tsukipond8531 authored Feb 10, 2025
1 parent 0abee9e commit 09f20d7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions package/ui/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CosmWasmClient } from "@cosmjs/cosmwasm-stargate";
import { CosmWasmClient, SigningCosmWasmClientOptions } from "@cosmjs/cosmwasm-stargate";
import { GasPrice } from "@cosmjs/stargate";
import { wallets as keplrWallets } from "@cosmos-kit/keplr-extension";
import { wallets as leapWallets } from "@cosmos-kit/leap-extension";
Expand All @@ -19,7 +19,9 @@ import AppLayout from "./layout/app";
import { ENABLED_TESTNETS, TESTNET } from "./lib/config";
import rollbar from "./lib/rollbar";
import Error from "./pages/error";
typeof CosmWasmClient === "function" && null; // Pretend to use CosmWasmClient to avoid tree shaking, without side effects

// Pretend to use CosmWasmClient to avoid tree shaking, without side effects
typeof CosmWasmClient === "function" && null;

const WalletDialog = lazy(() => import("./components/wallet-dialog"));
const CallWeek1OptionPage = lazy(() => import("./pages/options/call-week1"));
Expand Down Expand Up @@ -55,7 +57,8 @@ const router = createBrowserRouter(
{ path: "put-week1", element: <PutWeek1OptionPage /> },
{ path: "call-week2", element: <CallWeek2OptionPage /> },
{ path: "put-week2", element: <PutWeek2OptionPage /> },
// { path: ":quoteDenom", element: <QuoteDenomTablePage /> }, if uncommented it creates a webpage: https://app.kogen.markets/options/quoteDenom
// { path: ":quoteDenom", element: <QuoteDenomTablePage /> },
// If uncommented, it creates a webpage: https://app.kogen.markets/options/quoteDenom
],
},
],
Expand Down Expand Up @@ -95,28 +98,28 @@ function App() {
ENABLED_TESTNETS.includes(c.chain_id as TESTNET)
)}
assetLists={assets}
wallets={[...keplrWallets, ...leapWallets]} // supported wallets
wallets={[...keplrWallets, ...leapWallets]} // Supported wallets
signerOptions={{
signingCosmwasm: (chain) => {
signingCosmwasm: (chain): SigningCosmWasmClientOptions | undefined => {
if ((chain as Chain).chain_id === TESTNET.NEUTRON) {
return {
gasPrice: GasPrice.fromString("0.01untrn"),
};
} as SigningCosmWasmClientOptions;
}

if ((chain as Chain).chain_id === TESTNET.ARCHWAY) {
return {
gasPrice: GasPrice.fromString("900000000000.0aconst"),
};
} as SigningCosmWasmClientOptions;
}

if ((chain as Chain).chain_id === TESTNET.SEI) {
return {
gasPrice: GasPrice.fromString("0.01usei"),
};
} as SigningCosmWasmClientOptions;
}

return {};
return undefined;
},
}}
//@ts-ignore
Expand Down

0 comments on commit 09f20d7

Please sign in to comment.