// Copyright (c) 2017-2026 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// SPDX-License-Identifier: EUPL-1.2

package types

// Asset operation types used by the HF5 asset_descriptor_operation variant.
const (
	AssetOpRegister   uint8 = 0 // deploy new asset
	AssetOpEmit       uint8 = 1 // emit additional supply
	AssetOpUpdate     uint8 = 2 // update asset metadata
	AssetOpBurn       uint8 = 3 // burn supply with proof
	AssetOpPublicBurn uint8 = 4 // burn supply publicly
)

// AssetDescriptorBase holds the core asset metadata referenced by
// asset_descriptor_operation extra variants.
type AssetDescriptorBase struct {
	Ticker         string
	FullName       string
	TotalMaxSupply uint64
	CurrentSupply  uint64
	DecimalPoint   uint8
	MetaInfo       string
	OwnerKey       PublicKey
	Etc            []byte
}

// AssetDescriptorOperation represents a deploy/emit/update/burn operation.
// The wire format is parsed in wire/ as an opaque blob for round-tripping.
type AssetDescriptorOperation struct {
	Version       uint8
	OperationType uint8
	Descriptor    *AssetDescriptorBase
	AssetID       Hash
	AmountToEmit  uint64
	AmountToBurn  uint64
	Etc           []byte
}
