owner

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const NEO3WalletSize = 25

NEO3WalletSize contains size of neo3 wallet.

Variables

This section is empty.

Functions

func ScriptHashBE

func ScriptHashBE(id fmt.Stringer) ([]byte, error)

Types

type ID

type ID refs.OwnerID

ID represents v2-compatible owner identifier.

func NewID

func NewID() *ID

NewID creates and initializes blank ID.

Works similar as NewIDFromV2(new(OwnerID)).

Defaults:

  • value: nil.

func NewIDFromNeo3Wallet

func NewIDFromNeo3Wallet(v *NEO3Wallet) *ID

NewIDFromNeo3Wallet creates new owner identity from 25-byte neo wallet.

func NewIDFromV2

func NewIDFromV2(idV2 *refs.OwnerID) *ID

NewIDFromV2 wraps v2 OwnerID message to ID.

Nil refs.OwnerID converts to nil.

func (*ID) Equal added in v1.27.0

func (id *ID) Equal(id2 *ID) bool

Equal defines a comparison relation on ID's.

ID's are equal if they have the same binary representation.

func (*ID) Marshal

func (id *ID) Marshal(b ...[]byte) ([]byte, error)

Marshal marshals ID into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (*ID) MarshalJSON

func (id *ID) MarshalJSON() ([]byte, error)

MarshalJSON encodes ID to protobuf JSON format.

func (*ID) Parse

func (id *ID) Parse(s string) error

Parse converts base58 string representation into ID.

func (*ID) SetNeo3Wallet

func (id *ID) SetNeo3Wallet(v *NEO3Wallet)

SetNeo3Wallet sets owner identifier value to NEO3 wallet address.

func (*ID) String

func (id *ID) String() string

func (*ID) ToV2

func (id *ID) ToV2() *refs.OwnerID

ToV2 returns the v2 owner ID message.

Nil ID converts to nil.

func (*ID) Unmarshal

func (id *ID) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of ID.

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ID from protobuf JSON format.

type NEO3Wallet

type NEO3Wallet [NEO3WalletSize]byte

NEO3Wallet represents NEO3 wallet address.

func NEO3WalletFromPublicKey

func NEO3WalletFromPublicKey(key *ecdsa.PublicKey) (*NEO3Wallet, error)

NEO3WalletFromPublicKey converts public key to NEO3 wallet address.

func (*NEO3Wallet) Bytes

func (w *NEO3Wallet) Bytes() []byte

Bytes returns slice of NEO3 wallet address bytes.

func (*NEO3Wallet) String

func (w *NEO3Wallet) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL