Skip to content

Commit

Permalink
add Api.Link for postAnyAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Oct 28, 2020
1 parent 780ab7d commit 5ae6ff8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/core/src/Cardano/Wallet/Api.hs
Expand Up @@ -36,7 +36,7 @@ module Cardano.Wallet.Api
, Addresses
, ListAddresses
, InspectAddress
, PostScriptAddress
, PostAnyAddress

, CoinSelections
, SelectCoins
Expand Down Expand Up @@ -320,7 +320,7 @@ type SignMetadata = "wallets"
type Addresses n =
ListAddresses n
:<|> InspectAddress
:<|> PostScriptAddress n
:<|> PostAnyAddress n

-- | https://input-output-hk.github.io/cardano-wallet/api/#operation/listAddresses
type ListAddresses n = "wallets"
Expand All @@ -335,7 +335,7 @@ type InspectAddress = "addresses"
:> Get '[JSON] ApiAddressInspect

-- | https://input-output-hk.github.io/cardano-wallet/api/#operation/postAnyAddress
type PostScriptAddress n = "addresses"
type PostAnyAddress n = "addresses"
:> ReqBody '[JSON] ApiCredentials
:> PostCreated '[JSON] AnyAddress

Expand Down
6 changes: 6 additions & 0 deletions lib/core/src/Cardano/Wallet/Api/Link.hs
Expand Up @@ -58,6 +58,7 @@ module Cardano.Wallet.Api.Link
, listAddresses
, listAddresses'
, inspectAddress
, postAnyAddress

-- * CoinSelections
, selectCoins
Expand Down Expand Up @@ -345,6 +346,11 @@ inspectAddress
inspectAddress addr =
endpoint @Api.InspectAddress (addr &)

postAnyAddress
:: (Method, Text)
postAnyAddress =
endpoint @(Api.PostAnyAddress Net) id

--
-- Coin Selections
--
Expand Down

0 comments on commit 5ae6ff8

Please sign in to comment.