Destroying custom Assets
After an agreement is complete with your customer, you may need to destroy the tokens that has been withdrawn. For example, in a tokenized marketplace, you may need to destroy the tokens regarding a delivered product in a sale.
For that, all you need is the wallet id of the source and the code of the Asset to be destroyed.
// Destroy some MAPC tokens from a specific wallet
await bitcapital.assets().destroy({
code: 'MAPC',
amount: '10.00',
source: 'eef00b8e-8e16-4421-9628-af25d908b69b'
});
curl --location --request POST 'https://instance-url.btcore.app/assets/MACP/destroy' \
--header 'Authorization: Bearer 0000000000000000000000000000000000000000'\
--header 'Content-Type: application/json' \
--header 'X-Request-Timestamp: 1578678110828' \
--header 'X-Request-Signature: 140cf378103cb985a938fa3080401f9eb72524172f1a9725482c74a003d4993b' \
--data-raw '{
"amount": "10.00",
"source": "eef00b8e-8e16-4421-9628-af25d908b69b"
}'
Updated almost 5 years ago