|
1 | 1 | import { |
2 | | - ISupportedWallet, |
3 | | - StellarWalletsKit, |
4 | | - WalletNetwork, |
5 | | - allowAllModules, |
6 | | -} from "@creit.tech/stellar-wallets-kit"; |
7 | | -import { Horizon } from "@stellar/stellar-sdk"; |
8 | | -import { networkPassphrase, stellarNetwork } from "../contracts/util"; |
| 2 | + type ISupportedWallet, |
| 3 | + StellarWalletsKit, |
| 4 | + type WalletNetwork, |
| 5 | + allowAllModules, |
| 6 | +} from "@creit.tech/stellar-wallets-kit" |
| 7 | +import { Horizon } from "@stellar/stellar-sdk" |
| 8 | +import { networkPassphrase, stellarNetwork } from "../contracts/util" |
| 9 | +import storage from "./storage" |
9 | 10 |
|
10 | 11 | const kit: StellarWalletsKit = new StellarWalletsKit({ |
11 | | - network: networkPassphrase as WalletNetwork, |
12 | | - modules: allowAllModules(), |
13 | | -}); |
| 12 | + network: networkPassphrase as WalletNetwork, |
| 13 | + modules: allowAllModules(), |
| 14 | +}) |
14 | 15 |
|
15 | 16 | export const connectWallet = async () => { |
16 | 17 | await kit.openModal({ |
@@ -48,12 +49,12 @@ export const connectWallet = async () => { |
48 | 49 | } |
49 | 50 |
|
50 | 51 | export const disconnectWallet = async () => { |
51 | | - await kit.disconnect(); |
52 | | - storage.removeItem("walletId"); |
53 | | - storage.removeItem("walletAddress"); |
54 | | - storage.removeItem("walletNetwork"); |
55 | | - storage.removeItem("networkPassphrase"); |
56 | | -}; |
| 52 | + await kit.disconnect() |
| 53 | + storage.removeItem("walletId") |
| 54 | + storage.removeItem("walletAddress") |
| 55 | + storage.removeItem("walletNetwork") |
| 56 | + storage.removeItem("networkPassphrase") |
| 57 | +} |
57 | 58 |
|
58 | 59 | function getHorizonHost(mode: string) { |
59 | 60 | switch (mode) { |
|
0 commit comments