Files
utxo/nftfx/mint_output.go

34 lines
826 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package nftfx
import (
"encoding/json"
"github.com/luxfi/utxo/secp256k1fx"
"github.com/luxfi/vm/components/verify"
)
var _ verify.State = (*MintOutput)(nil)
type MintOutput struct {
verify.IsState `serialize:"-" json:"-"`
GroupID uint32 `serialize:"true" json:"groupID"`
secp256k1fx.OutputOwners `serialize:"true"`
}
// MarshalJSON marshals Amt and the embedded OutputOwners struct
// into a JSON readable format
// If OutputOwners cannot be serialized then this will return error
func (out *MintOutput) MarshalJSON() ([]byte, error) {
result, err := out.OutputOwners.Fields()
if err != nil {
return nil, err
}
result["groupID"] = out.GroupID
return json.Marshal(result)
}