55 type EvmChainId ,
66 createUnionClient ,
77 type CosmosChainId ,
8+ type OfflineSigner ,
89 evmChainFromChainId ,
910 bech32ToBech32Address
1011} from " @unionlabs/client"
@@ -37,14 +38,14 @@ import * as Card from "$lib/components/ui/card/index.ts"
3738import type { Chain , UserAddresses } from " $lib/types.ts"
3839import { Input } from " $lib/components/ui/input/index.js"
3940import { userAddrOnChain } from " $lib/utilities/address.ts"
41+ import { cosmosStore } from " $/lib/wallet/cosmos/config.ts"
4042import { Button } from " $lib/components/ui/button/index.ts"
4143import { getSupportedAsset } from " $lib/utilities/helpers.ts"
4244import CardSectionHeading from " ./card-section-heading.svelte"
4345import ArrowLeftRight from " virtual:icons/lucide/arrow-left-right"
4446import { getCosmosChainInfo } from " $lib/wallet/cosmos/chain-info.ts"
4547import { submittedTransfers } from " $lib/stores/submitted-transfers.ts"
4648import { parseUnits , formatUnits , type HttpTransport , getAddress } from " viem"
47- import { cosmosStore , getCosmosOfflineSigner } from " $/lib/wallet/cosmos/config.ts"
4849import { type Writable , writable , derived , get , type Readable } from " svelte/store"
4950import { type TransferState , stepBefore , stepAfter } from " $lib/transfer/transfer.ts"
5051
@@ -230,7 +231,7 @@ const transfer = async () => {
230231 return
231232 }
232233
233- const wallet = window [connectedWallet as " keplr " | " leap " ]
234+ const wallet = window [connectedWallet ]
234235
235236 if (! wallet ) {
236237 transferState .set ({
@@ -240,6 +241,10 @@ const transfer = async () => {
240241 return
241242 }
242243
244+ const cosmosOfflineSigner = (await wallet .getOfflineSignerAuto ($fromChainId , {
245+ disableBalanceCheck: false
246+ })) as OfflineSigner
247+
243248 // @ts-ignore
244249 transferState .set ({ kind: " SWITCHING_TO_CHAIN" })
245250
@@ -280,8 +285,6 @@ const transfer = async () => {
280285
281286 if (stepBefore ($transferState , " TRANSFERRING" )) {
282287 try {
283- const cosmosOfflineSigner = await getCosmosOfflineSigner ($fromChainId )
284-
285288 const unionClient = createUnionClient ({
286289 account: cosmosOfflineSigner ,
287290 transport: http (` https://${rpcUrl } ` ),
0 commit comments