From 2d6670fbe4a7cbb9decb7d9a4b2a75aaa1d7e85e Mon Sep 17 00:00:00 2001 From: Cardano Wallet Documentation Bot Date: Mon, 18 Sep 2023 10:23:07 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20Use=20reference=20input=20(#4114)=20=20-=20[x]=20u?= =?UTF-8?q?pdate=20`ApiMinBurnFromInput`=20to=20accommodate=20policy=20id?= =?UTF-8?q?=20-=20[x]=20update=20swagger=20and=20spec=20-=20[x]=20regenera?= =?UTF-8?q?te=20golden=20and=20make=20sure=20unit=20tests=20pass=20-=20[x]?= =?UTF-8?q?=20incorporate=20new=20`ApiMinBurnData`=20inside=20`constructTr?= =?UTF-8?q?ansaction`=20-=20[x]=20introduce=20ScriptSource=20-=20[x]=20han?= =?UTF-8?q?dle=20from=20input=20case=20to=20`mkUnsignedTx`=20-=20[x]=20adj?= =?UTF-8?q?ust=20`mkUnsignedTx`=20-=20[x]=20show=20the=20case=20in=20integ?= =?UTF-8?q?ration=20testing`=20###=20Comments=20builds=20on=20top=20of=20h?= =?UTF-8?q?ttps://github.com/cardano-foundation/cardano-wallet/pull/4086?= =?UTF-8?q?=20=20###=20Issue=20Number=20adp-309?= =?UTF-8?q?0=20=20Source=20commit:=206157932b2b0bbfb1053?= =?UTF-8?q?20ec59cb7db89df62b230?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/edge/mint-burn.md | 18 ++++++++++++++++-- api/edge/swagger.yaml | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/api/edge/mint-burn.md b/api/edge/mint-burn.md index 1b2437aa1a2..e10802d8d99 100644 --- a/api/edge/mint-burn.md +++ b/api/edge/mint-burn.md @@ -33,9 +33,22 @@ Specifically: } ``` -2. Using a refence input that contains a minting script. +2. Getting policy id using the same script template as in point 1. It is realized by calling `POST` on `/wallets/{walletId}/policy-id` endpoint with `POST` data: - In the `mint_burn` field, the array element contains `reference_input`. This field specifies a transaction input (pair of transaction ID and output index) which will be added as a reference input and is assumed to contain the minting script. (If the corresponding output was created using the method above, the appropriate output index is `0`). + ``` + { + "policy_script_template": + { "all": + [ "cosigner#0", + { "active_from": 120 } + ] + } + } + ``` + +3. Using a refence input that contains a minting script. + + In the `mint_burn` field, the array element contains `reference_input` and `policy_id`. The first field specifies a transaction input (pair of transaction ID and output index) which will be added as a reference input and is assumed to contain the minting script. (If the corresponding output was created using the method above, the appropriate output index is `0`). The `policy_id` field is obtained from the response of request realized in point 2. Example `POST` data for the endpoint with reference input: @@ -47,6 +60,7 @@ Specifically: { "id": "464917d2bac71df96269c2d7c34dcb83183b8a3a3253c06e9d6a8bd0681422c9", "index": 0 }, + "policy_id": "7191ae0e1286891fe5c027a5dc041b7401689938e18e14ec83cf74fb", "asset_name": "ab12", "operation": { "mint" : diff --git a/api/edge/swagger.yaml b/api/edge/swagger.yaml index b7e125046f0..61f06febbcb 100644 --- a/api/edge/swagger.yaml +++ b/api/edge/swagger.yaml @@ -3657,8 +3657,10 @@ components: required: - operation - reference_input + - policy_id properties: reference_input: *referenceInput + policy_id: *assetPolicyId asset_name: *assetName operation: *ApiMintBurnOperation