Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
paluh committed Nov 24, 2023
1 parent d1734de commit d7830d1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion nix/gen/npm-deps-hash.nix
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file was generated by prefetch-npm-deps
"sha256-pZ5QQgWs5ymu+2Vieurq/B84uU1bIM2abwIcdnt0U8U="
"sha256-3sDbVhLjIYiSICPJZfjneW6s2nNKsKSJxtkOt+xTKKQ="
6 changes: 3 additions & 3 deletions nix/gen/spago-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ let

"cardano-wallet-client" = pkgs.stdenv.mkDerivation {
name = "cardano-wallet-client";
version = "v0.1.0";
version = "v0.1.1";
src = pkgs.fetchgit {
url = "https://github.com/input-output-hk/purescript-cardano-wallet-client.git";
rev = "a2b08694d2c9d5e55e0707a1ce7d292503ee1eca";
sha256 = "1pin92qfjm8lvirkrc9n8i38940nsa12cfadz2m9drrzr0z45m29";
rev = "d6c4be8bc24d285e700264ad29cf6b6b7623c6ed";
sha256 = "09vqahbsawzp8qjcylvpcy1yrk0b489c4hd9z22jabs8mpai624r";
};
phases = "installPhase";
installPhase = "ln -s $src $out";
Expand Down
2 changes: 1 addition & 1 deletion packages.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ in upstream
, "web-encoding"
]
"https://github.com/input-output-hk/purescript-cardano-wallet-client.git"
"v0.1.0"
"v0.1.1"

-- with marlowe-runtime-client = ../purescript-marlowe-runtime-client/spago.dhall as Location
with marlowe-runtime-client =
Expand Down
2 changes: 0 additions & 2 deletions spago.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
, "foreign-generic"
, "foreign-object"
, "formatters"
, "free"
, "functions"
, "functors"
, "halogen-subscriptions"
Expand Down Expand Up @@ -78,7 +77,6 @@
, "typelevel-prelude"
, "undefined-is-not-a-problem"
, "unsafe-coerce"
, "unsafe-reference"
, "uri"
, "validation"
, "variant"
Expand Down
21 changes: 12 additions & 9 deletions src/Component/App.purs
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,20 @@ import Web.HTML (window)

-- | Debugging helpers which allow us to automatically connect wallet
data WalletBrand
= Lace
| Yoroi
= Eternl
| Gero
| Lace
| Nami
| Eternl
| Typhon
| Yoroi

instance Show WalletBrand where
show Yoroi = "Yoroi"
show Nami = "Nami"
show Lace = "Lace"
show Eternl = "Eternl"
show Gero = "Gero"
show Lace = "Lace"
show Nami = "Nami"
show Typhon = "Typhon"
show Yoroi = "Yoroi"

autoConnectWallet :: WalletBrand -> (WalletInfo Wallet.Api -> Effect Unit) -> Aff Unit
autoConnectWallet walletBrand onSuccess = liftEffect (window >>= Wallet.cardano) >>= case _ of
Expand All @@ -94,12 +96,13 @@ autoConnectWallet walletBrand onSuccess = liftEffect (window >>= Wallet.cardano)
Just cardano -> do
let
extractWallet = case walletBrand of
Eternl -> Wallet.eternl
Gero -> Wallet.gerowallet
Lace -> Wallet.lace
Nami -> Wallet.nami
Yoroi -> Wallet.yoroi
Eternl -> Wallet.eternl
Typhon -> Wallet.typhon
liftEffect (extractWallet cardano) >>= traverse walletInfo >>= case _ of
Yoroi -> Wallet.yoroi
liftEffect (extractWallet cardano) >>= traverse walletInfo >>= join >>> case _ of
Nothing -> do
liftEffect $ throw $ "Unable to extract wallet " <> show walletBrand
Just walletInfo@(WalletInfo { wallet }) -> do
Expand Down

0 comments on commit d7830d1

Please sign in to comment.