Skip to content

Commit

Permalink
add burnAsset to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Oded Leiba committed Nov 13, 2016
1 parent 154587f commit c8cdce5
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions apidoc/colordoc.js
Expand Up @@ -361,4 +361,83 @@
* @apiSuccess {String} txHex Unsigned hex of the send transaction.
* @apiVersion 0.3.0
*
*/

/*
VERSION 0.3.0
*/


/**
* @api {post} /burnasset Returns a transaction that burns a specified amount of the asset
* @apiName BurnAsset
* @apiGroup ColoredCoinsd
* @apiDescription This api call is used to burn assets, i.e. to reduce a certain amount of units of an asset from its total supply.
* Assets can also be transferred within a burn transaction.
* It can be funded by a specifc utxo or by any spendable utxo of the from address (see financeOutput).
* <sendutxo> can be used to specify the specific utxo you wish to use for burn or transfer.
* If the transaction has more assets in its inputs than assets transferred then the reminder of all the assets is considered to be spent to the last output.
*
* @apiParam {Number} fee Fee for transaction in satoshi.
* @apiParam {String} [pubKeyReturnMultisigDust] encoded public key if you want to recive the multisig dust if multisig is needed for the metadata.
* @apiParam {String[]} [from] Array of adresss to send the asset from. Any unspents of the specific asset held by that address will be used (optional can used sendutxo instead)
* @apiParam {String[]} [sendutxo] Array of Utxos to use for sending the asset itself (<transaction>:<index> format)
* @apiParam {Object} [financeOutput] A vout type object to use in order to finance the transfer (btc costs)
* @apiParam {Number} financeOutput.value Value in BTC of the output
* @apiParam {Number} financeOutput.n Output index
* @apiParam {Object} financeOutput.scriptPubKey ScriptPubKey type object
* @apiParam {String} financeOutput.scriptPubKey.asm Asm for the output
* @apiParam {String} financeOutput.scriptPubKey.hex Hex for the output
* @apiParam {String} financeOutput.scriptPubKey.type Bitcoin transaction type
* @apiParam {Number} [financeOutput.scriptPubKey.reqSigs] Number of required signatures to redeem
* @apiParam {String[]} [financeOutput.scriptPubKey.adresses] Addresses that can redeem
* @apiParam {String} [financeOutputTxid] Txid containing the vout used for the finance
* @apiParam {Object[]} [transfer] Array of transfer type objects (transfers amount of the issued asset to specific addresses)
* @apiParam {String} [transfer.address] Address to transfer assets to
* @apiParam {Number} transfer.amount Amount of Asset to transfer
* @apiParam {String} transfer.assetId Asset ID of Asset to transfer
* @apiParam {String} [transfer.pubKeys] Optional instead of address send the pubkeys as a string array, we create P2SH
* @apiParam {String} [transfer.m Number] of signatures required in order to reedem the multisig
* @apiParam {Object[]} burn Array of burn type objects (burns amount of a specified asset)
* @apiParam {Number} burn.amount Amount of Asset to burn
* @apiParam {String} burn.assetId Asset ID of Asset to burn
* @apiParam {Object} [flags] A flag type object
* @apiParam {Boolean} [flags.injectPreviousOutput] If true the input will contain the pervious output script to make siging simpler
* @apiParam {Object} [metadata] Metadata of the specific utxo from the transaction
* @apiParam {String} [metadata.assetId] Asset Id
* @apiParam {String} [metadata.assetName] Asset Name
* @apiParam {String} [metadata.assetGenesis] Genisis transaction where the asset was created (in case of re issue)
* @apiParam {String} [metadata.issuer] Name of the issuer
* @apiParam {String} [metadata.description] description of the asset
* @apiParam {Object[]} [metadata.urls] Array of URL type objects
* @apiParam {String} metadata.urls.name Name of the url
* @apiParam {String} metadata.urls.url The url
* @apiParam {String} metadata.urls.mimeType Mime type of the data in the url
* @apiParam {String} [metadata.urls.dataHash] If needed hash of the data that in the url (for proof reasons)
* @apiParam {Object[]} [metadata.encryptions] Array of encryptSection type objects
* @apiParam {String} [metadata.encryptions.key] The json key of the value to encrypt within the user section
* @apiParam {String} [metadata.encryptions.pubKey] Public key we will use for the encryption (rsa pubkey)
* @apiParam {String} [metadata.encryptions.format] Input format of the key (accepted values: 'pem', 'der')
* @apiParam {String} [metadata.encryptions.type] Type and padding of the key (accepted values: 'pkcs1', 'pkcs8')
* @apiParam {JSON} [metadata.userData] Any aribtrary json data that the pervious owner of the output has enterd
* @apiParam {Object} [rules] Object for the rules of the asset
* @apiParam {Number} rules.version Version of the rule system
* @apiParam {Object} rules.fees
* @apiParam {Object[]} [rules.fees.items] Array of fee type items
* @apiParam {String} rules.fees.items.address Address to send the fee
* @apiParam {String} rules.fees.items.assetId Asset id to send fee (btc if none asset)
* @apiParam {Number} rules.fees.items.value Value to send for the fee (in satoshi or amount)
* @apiParam {Boolean} rules.fees.locked Feild to specify if following thransaction of the asset can add to this rule type
* @apiParam {Object} [rules.expiration] Experitaion object used to lown an asseet, when asset expires it moves back to last output
* @apiParam {Number} rules.expiration.validUntil When the asset is consider expired
* @apiParam {Boolean} rules.expiration.locked Feild to specify if following thransaction of the asset can add to this rule type
* @apiParam {Object[]} [rules.minters] Array of mitnter objects, (addresses that can issue the asset)
* @apiParam {String} rules.minters.address Address of the minter
* @apiParam {Boolean} rules.minters.locked Feild to specify if following thransaction of the asset can add to this rule type (if the minter can add minters)
* @apiParam {Object[]} [rules.holders] Array of holder type objects, they specify in what addresses the asset is considerd valid
* @apiParam {String} rules.holders.adress Address where the asset is considerd valid
* @apiParam {Boolean} rules.holders.locked Feild to specify if following thransaction of the asset can add to this rule type
* @apiSuccess {String} txHex Unsigned hex of the send transaction.
* @apiVersion 0.3.0
*
*/

0 comments on commit c8cdce5

Please sign in to comment.