Skip to content

Commit

Permalink
add scaffolding for getSharedWallet endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Apr 6, 2021
1 parent f0b692e commit 1e9f7ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 7 additions & 1 deletion lib/core/src/Cardano/Wallet/Api.hs
Expand Up @@ -839,13 +839,19 @@ type GetCurrentSMASHHealth = "smash"
-------------------------------------------------------------------------------}

type SharedWallets =
PostSharedWallet
PostSharedWallet
:<|> GetSharedWallet

-- | https://input-output-hk.github.io/cardano-wallet/api/#operation/postSharedWallet
type PostSharedWallet = "shared-wallets"
:> ReqBody '[JSON] ApiSharedWalletPostData
:> PostCreated '[JSON] ApiSharedWallet

-- | https://input-output-hk.github.io/cardano-wallet/api/#operation/getSharedWallet
type GetSharedWallet = "shared-wallets"
:> Capture "walletId" (ApiT WalletId)
:> Get '[JSON] ApiSharedWallet

{-------------------------------------------------------------------------------
Proxy_
Expand Down
10 changes: 7 additions & 3 deletions lib/shelley/src/Cardano/Wallet/Shelley/Api/Server.hs
Expand Up @@ -228,7 +228,7 @@ server byron icarus shelley spl ntp =
:<|> proxy
:<|> settingS
:<|> smash
:<|> shareWallets
:<|> sharedWallets
where
wallets :: Server Wallets
wallets = deleteWallet shelley
Expand Down Expand Up @@ -488,8 +488,12 @@ server byron icarus shelley spl ntp =
FetchSMASH smashServer -> getHealth smashServer
_ -> pure (ApiHealthCheck NoSmashConfigured)

shareWallets :: Server SharedWallets
shareWallets = pure $ throwError err501
sharedWallets :: Server SharedWallets
sharedWallets =
postSharedWallet :<|> getSharedWallet
where
postSharedWallet = pure $ throwError err501
getSharedWallet = pure $ throwError err501

postAnyAddress
:: NetworkId
Expand Down

0 comments on commit 1e9f7ac

Please sign in to comment.