Skip to content

Commit

Permalink
API: wip list assets endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Jan 14, 2021
1 parent 1257585 commit 3611a2d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/core/src/Cardano/Wallet/Api.hs
Expand Up @@ -323,6 +323,29 @@ type SignMetadata = "wallets"
:> ReqBody '[JSON] ApiWalletSignData
:> Post '[OctetStream] ByteString

{-------------------------------------------------------------------------------
Assets
See also: https://input-output-hk.github.io/cardano-wallet/api/#tag/Assets
-------------------------------------------------------------------------------}

type Assets =
ListAssets
:<|> GetAsset

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

-- | https://input-output-hk.github.io/cardano-wallet/api/#operation/getAsset
type GetAsset = "wallets"
:> Capture "walletId" (ApiT WalletId)
:> "assets"
:> "fixme"
:> Get '[JSON] ApiAsset

{-------------------------------------------------------------------------------
Addresses
Expand Down
4 changes: 4 additions & 0 deletions lib/core/src/Cardano/Wallet/Api/Types.hs
Expand Up @@ -427,6 +427,10 @@ newtype ApiMaintenanceAction = ApiMaintenanceAction
{ gcStakePools :: ApiT PoolMetadataGCStatus
} deriving (Eq, Generic, Show)

data ApiAsset = ApiAsset
deriving (Eq, Generic, Show)
deriving anyclass NFData

data ApiAddress (n :: NetworkDiscriminant) = ApiAddress
{ id :: !(ApiT Address, Proxy n)
, state :: !(ApiT AddressState)
Expand Down

0 comments on commit 3611a2d

Please sign in to comment.