Skip to content

Commit

Permalink
Merge #2476
Browse files Browse the repository at this point in the history
2476: Native assets for API Byron wallets r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. -->

ADP-603

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- ad07503
  📍 **mark migration endpoints as disabled in the API documentation.**
  
- a86bd7b
  📍 **add 'assets' to ApiByronWallet**
    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.


# Comments

<!-- Additional comments or screenshots to attach if any -->

<!--
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


Co-authored-by: KtorZ <[email protected]>
  • Loading branch information
iohk-bors[bot] and KtorZ authored Jan 29, 2021
2 parents e82e58a + 54d85d7 commit 185e27e
Show file tree
Hide file tree
Showing 5 changed files with 339 additions and 125 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 185e27e

Please sign in to comment.