5
5
type EvmChainId ,
6
6
createUnionClient ,
7
7
type CosmosChainId ,
8
+ type OfflineSigner ,
8
9
evmChainFromChainId ,
9
10
bech32ToBech32Address
10
11
} from " @unionlabs/client"
@@ -29,6 +30,7 @@ import ChainButton from "./chain-button.svelte"
29
30
import { toIsoString } from " $lib/utilities/date"
30
31
import AssetsDialog from " ./assets-dialog.svelte"
31
32
import { truncate } from " $lib/utilities/format.ts"
33
+ import { userAddrCosmos } from " $lib/wallet/cosmos"
32
34
import Stepper from " $lib/components/stepper.svelte"
33
35
import { raise , sleep } from " $lib/utilities/index.ts"
34
36
import { userBalancesQuery } from " $lib/queries/balance"
@@ -41,10 +43,9 @@ import { Button } from "$lib/components/ui/button/index.ts"
41
43
import { getSupportedAsset } from " $lib/utilities/helpers.ts"
42
44
import CardSectionHeading from " ./card-section-heading.svelte"
43
45
import ArrowLeftRight from " virtual:icons/lucide/arrow-left-right"
44
- import { parseUnits , formatUnits , type HttpTransport , getAddress } from " viem"
45
46
import { getCosmosChainInfo } from " $lib/wallet/cosmos/chain-info.ts"
46
47
import { submittedTransfers } from " $lib/stores/submitted-transfers.ts"
47
- import { userAddrCosmos , getCosmosOfflineSigner } from " $lib/wallet/cosmos "
48
+ import { parseUnits , formatUnits , type HttpTransport , getAddress } from " viem "
48
49
import { type Writable , writable , derived , get , type Readable } from " svelte/store"
49
50
import { type TransferState , stepBefore , stepAfter } from " $lib/transfer/transfer.ts"
50
51
@@ -143,10 +144,6 @@ let receiver = derived([toChain, userAddress], ([$toChain, $userAddress]) => {
143
144
}
144
145
})
145
146
146
- $ : {
147
- console .info ($receiver )
148
- }
149
-
150
147
let ucs01Configuration = derived (
151
148
[fromChain , toChainId , receiver ],
152
149
([$fromChain , $toChainId , $receiver ]) => {
@@ -234,7 +231,7 @@ const transfer = async () => {
234
231
return
235
232
}
236
233
237
- const wallet = window [connectedWallet as " keplr " | " leap " ]
234
+ const wallet = window [connectedWallet ]
238
235
239
236
if (! wallet ) {
240
237
transferState .set ({
@@ -244,6 +241,10 @@ const transfer = async () => {
244
241
return
245
242
}
246
243
244
+ const cosmosOfflineSigner = (await wallet .getOfflineSignerAuto ($fromChainId , {
245
+ disableBalanceCheck: false
246
+ })) as OfflineSigner
247
+
247
248
// @ts-ignore
248
249
transferState .set ({ kind: " SWITCHING_TO_CHAIN" })
249
250
@@ -284,8 +285,6 @@ const transfer = async () => {
284
285
285
286
if (stepBefore ($transferState , " TRANSFERRING" )) {
286
287
try {
287
- const cosmosOfflineSigner = getCosmosOfflineSigner ($fromChainId )
288
-
289
288
const unionClient = createUnionClient ({
290
289
account: cosmosOfflineSigner ,
291
290
transport: http (` https://${rpcUrl } ` ),
0 commit comments