diff --git a/api/edge/swagger.yaml b/api/edge/swagger.yaml index 897e7be9767..8422eafd7b7 100644 --- a/api/edge/swagger.yaml +++ b/api/edge/swagger.yaml @@ -2909,6 +2909,107 @@ components: "none": *ApiNullStakeKey + ApiMintedBurnedInfo: &ApiMintedBurnedInfo + type: object + required: + - monetary_policy_index + - policy_id + - asset_name + - subject + - script + properties: + monetary_policy_index: *derivationSegment + policy_id: *assetPolicyId + asset_name: *assetName + subject: *assetFingerprint + script: + <<: *ScriptValue + description: The script under which this asset was minted or burned. + + ApiMintedBurnedTransaction: &ApiMintedBurnedTransaction + type: object + required: + - transaction + - minted_burned + properties: + transaction: + <<: *ApiTransaction + description: Information about the mint/burn transaction submitted. + minted_burned: + type: array + items: *ApiMintedBurnedInfo + minItems: 1 + description: An entry for each unique asset minted and/or burned, containing helpful information. + + ApiAssetQuantity: &ApiAssetQuantity + type: object + required: + - quantity + - unit + properties: + quantity: + type: integer + example: 14 + unit: + type: string + enum: + - assets + + ApiMintData: &ApiMintData + type: object + required: + - receiving_address + - amount + properties: + receiving_address: *addressId + amount: *ApiAssetQuantity + + ApiBurnData: &ApiBurnData + allOf: + - *ApiAssetQuantity + + ApiMintBurnOperation: &ApiMintBurnOperation + type: object + oneOf: + - title: "mint" + properties: + mint: *ApiMintData + - title: "burn" + properties: + burn: *ApiBurnData + + ApiMintBurnData: &ApiMintBurnData + type: object + required: + - asset_name + - operation + properties: + monetary_policy_index: + allOf: + - *derivationSegment + - type: string + default: 0 + asset_name: *assetName + operation: *ApiMintBurnOperation + + ApiPostMintBurnAssetData: &ApiPostMintBurnAssetData + type: object + required: + - mint_burn + - passphrase + properties: + mint_burn: + type: array + items: *ApiMintBurnData + minItems: 1 + passphrase: + <<: *lenientPassphrase + description: The wallet's master passphrase. + metadata: *transactionMetadata + time_to_live: *transactionTTL + + + ############################################################################# # # @@ -3930,6 +4031,30 @@ x-responsesPostSharedWallet: &responsesPostSharedWallet application/json: schema: *ApiSharedWallet +x-responsesMintToken: &responsesMintToken + 403: + description: Forbidden + content: + application/json: + schema: + oneOf: + - <<: *errInvalidWalletType + - <<: *errAlreadyWithdrawing + - <<: *errUtxoTooSmall + - <<: *errCannotCoverFee + - <<: *errNotEnoughMoney + - <<: *errTransactionIsTooBig + - <<: *errNoRootKey + - <<: *errWrongEncryptionPassphrase + <<: *responsesErr404WalletNotFound + <<: *responsesErr406 + <<: *responsesErr415UnsupportedMediaType + 202: + description: Accepted + content: + application/json: + schema: *ApiMintedBurnedTransaction + x-responsesPostByronWallet: &responsesPostByronWallet <<: *responsesErr400 <<: *responsesErr406 @@ -4662,6 +4787,39 @@ paths: - *parametersWalletId responses: *responsesListAssets + post: + operationId: mintBurnAssets + tags: ["Assets"] + summary: Mint/Burn + description: | +
status: under development
+ + Mint and burn assets from the wallet. + + We only support the simplest of scripts: those which require a signature + from a single key (known as the policy key). The policy key is generated + from the HD wallet according to to draft CIP-1855 + (https://github.com/cardano-foundation/CIPs/blob/b2e9d02cb9a71ba9e754a432c78197428abf7e4c/CIP-1855/CIP-1855.md). + + Once the policy key is generated, cardano-wallet creates a script from + that key, which we then mint or burn assets under. + + **⚠️ WARNING ⚠️** + + Please note that due to the fact that there is no physical access to + policy keys under which assets are minted from the wallet it is + currently not possible to add metadata of such assets into [Cardano Token Registry](https://github.com/cardano-foundation/cardano-token-registry). + + parameters: + - *parametersWalletId + requestBody: + required: true + content: + application/json: + schema: + <<: *ApiPostMintBurnAssetData + responses: *responsesMintToken + /wallets/{walletId}/assets/{policyId}/{assetName}: get: operationId: getAsset