Skip to content

Commit

Permalink
docs: Use reference input (#4114) <!-- Detail in a few bullet points …
Browse files Browse the repository at this point in the history
…the work accomplished in this PR. Before you submit, don't forget to: CODE-OF-CONDUCT.md CONTRIBUTING.md LICENSE MAINTAINERS.md README.md cabal.project default.nix docker-compose.yml docs flake.lock flake.nix floskell.json fourmolu.yaml hie-direnv.yaml justfile lib nix prototypes reports scripts shell.nix specifications test touch.me.CI weeder.dhall Make sure the GitHub PR fields are correct: ✓ Set a good Title for your PR. ✓ Assign yourself to the PR. ✓ Assign one or more reviewer(s). ✓ Link to a Jira issue, and/or other GitHub issues or PRs. ✓ In the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. CODE-OF-CONDUCT.md CONTRIBUTING.md LICENSE MAINTAINERS.md README.md cabal.project default.nix docker-compose.yml docs flake.lock flake.nix floskell.json fourmolu.yaml hie-direnv.yaml justfile lib nix prototypes reports scripts shell.nix specifications test touch.me.CI weeder.dhall Don't waste reviewers' time: ✓ If it's a draft, select the Create Draft PR option. ✓ Self-review your changes to make sure nothing unexpected slipped through. CODE-OF-CONDUCT.md CONTRIBUTING.md LICENSE MAINTAINERS.md README.md cabal.project default.nix docker-compose.yml docs flake.lock flake.nix floskell.json fourmolu.yaml hie-direnv.yaml justfile lib nix prototypes reports scripts shell.nix specifications test touch.me.CI weeder.dhall Try to make your intent clear: ✓ Write a good Description that explains what this PR is meant to do. ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding Jira ticket. ✓ Highlight what Testing you have done. ✓ Acknowledge any changes required to the Documentation. --> - [x] update `ApiMinBurnFromInput` to accommodate policy id - [x] update swagger and spec - [x] regenerate golden and make sure unit tests pass - [x] incorporate new `ApiMinBurnData` inside `constructTransaction` - [x] introduce ScriptSource - [x] handle from input case to `mkUnsignedTx` - [x] adjust `mkUnsignedTx` - [x] show the case in integration testing` ### Comments builds on top of #4086 <!-- Additional comments, links, or screenshots to attach, if any. --> ### Issue Number adp-3090 <!-- Reference the Jira/GitHub issue that this PR relates to, and which requirements it tackles. Note: Jira issues of the form ADP- will be auto-linked. --> Source commit: 6157932
  • Loading branch information
Cardano Wallet Documentation Bot committed Sep 18, 2023
1 parent 3f309dc commit 2d6670f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 16 additions & 2 deletions api/edge/mint-burn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -47,6 +60,7 @@ Specifically:
{ "id": "464917d2bac71df96269c2d7c34dcb83183b8a3a3253c06e9d6a8bd0681422c9",
"index": 0
},
"policy_id": "7191ae0e1286891fe5c027a5dc041b7401689938e18e14ec83cf74fb",
"asset_name": "ab12",
"operation":
{ "mint" :
Expand Down
2 changes: 2 additions & 0 deletions api/edge/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3657,8 +3657,10 @@ components:
required:
- operation
- reference_input
- policy_id
properties:
reference_input: *referenceInput
policy_id: *assetPolicyId
asset_name: *assetName
operation: *ApiMintBurnOperation

Expand Down

0 comments on commit 2d6670f

Please sign in to comment.