Skip to content

Commit

Permalink
add 'assets' to ApiByronWallet
Browse files Browse the repository at this point in the history
  It is actually totally legit and possible to send native assets to a Byron addresses.
  Addresses and multi-assets are totally decoupled. So we ought to support it too.
  • Loading branch information
KtorZ committed Jan 29, 2021
1 parent ad07503 commit a86bd7b
Show file tree
Hide file tree
Showing 6 changed files with 41,126 additions and 121 deletions.
4 changes: 4 additions & 0 deletions lib/core/src/Cardano/Wallet/Api/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,10 @@ mkLegacyWallet ctx wid cp meta pending progress = do
{ available = coinToQuantity $ TokenBundle.getCoin available
, total = coinToQuantity $ TokenBundle.getCoin total
}
, assets = ApiWalletAssetsBalance
{ available = ApiT (available ^. #tokens)
, total = ApiT (total ^. #tokens)
}
, id = ApiT wid
, name = ApiT $ meta ^. #name
, passphrase = pwdInfo
Expand Down
1 change: 1 addition & 0 deletions lib/core/src/Cardano/Wallet/Api/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@ instance EncodeAddress n => ToHttpApiData (ApiT Address, Proxy n) where
data ApiByronWallet = ApiByronWallet
{ id :: !(ApiT WalletId)
, balance :: !(ApiByronWalletBalance)
, assets :: !ApiWalletAssetsBalance
, discovery :: !ApiWalletDiscovery
, name :: !(ApiT WalletName)
, passphrase :: !(Maybe ApiWalletPassphraseInfo)
Expand Down
Loading

0 comments on commit a86bd7b

Please sign in to comment.