Skip to content

Commit

Permalink
add ApiTransactionConstructData and ApiDelegationTx
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Jun 14, 2021
1 parent 35f82fa commit f9c43ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 14 additions & 0 deletions lib/core/src/Cardano/Wallet/Api/Types.hs
Expand Up @@ -858,6 +858,20 @@ data ApiConstructTransaction (n :: NetworkDiscriminant) = ApiConstructTransactio
} deriving (Eq, Generic, Show)
deriving anyclass NFData

data ApiDelegationTx = ApiDelegationTx
{ delegationAction :: !ApiDelegationAction
} deriving (Eq, Generic, Show)
deriving anyclass NFData

data ApiTransactionConstructData (n :: NetworkDiscriminant) = ApiTransactionConstructData
{ payments :: !(Maybe (NonEmpty (AddressAmount (ApiT Address, Proxy n))))
, withdrawal :: !(Maybe ApiWithdrawalPostData)
, metadata :: !(Maybe (ApiT TxMetadata))
, mint :: !(Maybe (ApiT W.TokenMap))
, delegation :: ![ApiDelegationTx]
, timeToLive :: !(Maybe (Quantity "second" NominalDiffTime))
} deriving (Eq, Generic, Show)

data PostTransactionData (n :: NetworkDiscriminant) = PostTransactionData
{ payments :: !(NonEmpty (AddressAmount (ApiT Address, Proxy n)))
, passphrase :: !(ApiT (Passphrase "lenient"))
Expand Down
6 changes: 2 additions & 4 deletions specifications/api/swagger.yaml
Expand Up @@ -1142,11 +1142,9 @@ x-transactionDelegations: &transactionDelegations
type: object
additionalProperties: false
required:
- delegation_action
- delegation_target
- action
properties:
delegation_action: *delegationTarget
delegation_target: *delegationTarget
action: *delegationAction

x-transactionMint: &transactionMint
description: |
Expand Down

0 comments on commit f9c43ad

Please sign in to comment.