Skip to content

Commit ad5c6ae

Browse files
amirmradj-mueller
andauthored
Add recipient to issue endpoint (#69)
* Add recipient to issue * Update schema --------- Co-authored-by: Jann Müller <[email protected]>
1 parent cc85f09 commit ad5c6ae

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

generated/openapi/schema.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@
5454
},
5555
"quantity": {
5656
"$ref": "#/components/schemas/Quantity"
57+
},
58+
"recipient": {
59+
"$ref": "#/components/schemas/Address"
5760
}
5861
},
5962
"required": [
6063
"issuer",
6164
"asset_name",
62-
"quantity"
65+
"quantity",
66+
"recipient"
6367
],
6468
"type": "object"
6569
},

src/lib/Wst/Server.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ issueProgrammableTokenEndpoint :: forall era env m.
188188
, MonadUtxoQuery m
189189
)
190190
=> IssueProgrammableTokenArgs -> m (TextEnvelopeJSON (C.Tx era))
191-
issueProgrammableTokenEndpoint IssueProgrammableTokenArgs{itaAssetName, itaQuantity, itaIssuer} = do
192-
let C.ShelleyAddress _network cred _stake = itaIssuer
191+
issueProgrammableTokenEndpoint IssueProgrammableTokenArgs{itaAssetName, itaQuantity, itaIssuer, itaRecipient} = do
192+
let C.ShelleyAddress _network cred _stake = itaRecipient
193193
destinationCredential = C.fromShelleyPaymentCredential cred
194194
operatorEnv <- Env.loadOperatorEnvFromAddress itaIssuer
195195
dirEnv <- asks Env.directoryEnv

src/lib/Wst/Server/Types.hs

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ data IssueProgrammableTokenArgs =
108108
{ itaIssuer :: C.Address C.ShelleyAddr
109109
, itaAssetName :: AssetName
110110
, itaQuantity :: Quantity
111+
, itaRecipient :: C.Address C.ShelleyAddr
111112
}
112113
deriving stock (Eq, Show, Generic)
113114

0 commit comments

Comments
 (0)