mirror of
https://github.com/luxfi/utxo.git
synced 2026-10-30 15:13:57 +00:00
34 lines
826 B
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)
|
|
}
|