func (id *ID) UnmarshalJSON(data []byte) error {
	return (*refs.OwnerID)(id).
		UnmarshalJSON(data)
}
UnmarshalJSON decodes ID from protobuf JSON format.
package owner
import (
	"bytes"
	"errors"
	"fmt"
	"github.com/mr-tron/base58"
	"github.com/nspcc-dev/neo-go/pkg/encoding/address"
	"github.com/nspcc-dev/neofs-api-go/v2/refs"
)
type ID refs.OwnerID
var errInvalidIDString = errors.New("incorrect format of the string owner ID")
func NewIDFromV2(idV2 *refs.OwnerID) *ID {
	return (*ID)(idV2)
}
func NewID() *ID {
	return NewIDFromV2(new(refs.OwnerID))
}
func (id *ID) SetNeo3Wallet(v *NEO3Wallet) {
	(*refs.OwnerID)(id).SetValue(v.Bytes())
}
func (id *ID) ToV2() *refs.OwnerID {
	return (*refs.OwnerID)(id)
}
func (id *ID) String() string {
	return base58.Encode((*refs.OwnerID)(id).GetValue())
}
func (id *ID) Equal(id2 *ID) bool {
	return bytes.Equal(
		(*refs.ObjectID)(id).GetValue(),
		(*refs.ObjectID)(id2).GetValue(),
	)
}
func ScriptHashBE(id fmt.Stringer) ([]byte, error) {
	addr, err := address.StringToUint160(id.String())
	if err != nil {
		return nil, err
	}
	return addr.BytesBE(), nil
}
func NewIDFromNeo3Wallet(v *NEO3Wallet) *ID {
	id := NewID()
	id.SetNeo3Wallet(v)
	return id
}
func (id *ID) Parse(s string) error {
	data, err := base58.Decode(s)
	if err != nil {
		return fmt.Errorf("could not parse owner.ID from string: %w", err)
	} else if len(data) != NEO3WalletSize {
		return errInvalidIDString
	}
	(*refs.OwnerID)(id).SetValue(data)
	return nil
}
func (id *ID) Marshal(b ...[]byte) ([]byte, error) {
	var buf []byte
	if len(b) > 0 {
		buf = b[0]
	}
	return (*refs.OwnerID)(id).
		StableMarshal(buf)
}
func (id *ID) Unmarshal(data []byte) error {
	return (*refs.OwnerID)(id).
		Unmarshal(data)
}
func (id *ID) MarshalJSON() ([]byte, error) {
	return (*refs.OwnerID)(id).
		MarshalJSON()
}