NativeScript

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NativeScript

type NativeScript struct {
	Tag           ScriptTag
	KeyHash       []byte
	NativeScripts []NativeScript
	NoK           int
	Before        int64
	After         int64
}

func NewInvalidBefore added in v1.0.11

func NewInvalidBefore(before int64) NativeScript

func NewInvalidHereafter added in v1.0.11

func NewInvalidHereafter(after int64) NativeScript

func NewScriptAll added in v1.0.11

func NewScriptAll(nativeScripts []NativeScript) NativeScript

func NewScriptAny added in v1.0.11

func NewScriptAny(nativeScripts []NativeScript) NativeScript

func NewScriptNofK added in v1.0.11

func NewScriptNofK(nativeScripts []NativeScript, noK int) NativeScript

func NewScriptPubKey added in v1.0.11

func NewScriptPubKey(keyHash []byte) NativeScript

func (NativeScript) Hash

*

Hash computes the script hash for the NativeScript.

Returns:
	serialization.ScriptHash: The computed script hash.
	error: An error if the hashing fails.

func (*NativeScript) MarshalCBOR

func (ns *NativeScript) MarshalCBOR() ([]uint8, error)

*

MarshalCBOR encodes the NativeScript into CBOR format.

Returns:
	[]uint8: The CBOR-encoded data.
	error: An error if encoding fails, nil otherwise.

func (*NativeScript) UnmarshalCBOR

func (ns *NativeScript) UnmarshalCBOR(value []byte) error

*

UnmarshalCBOR decodes the CBOR-encoded data and populates
the NativeScript fields.

Params:
	value []byte: The CBOR-encoded data to encode.

Returns:
	error: An error if decoding fails, nil otherwise.

type ScriptTag

type ScriptTag int
const (
	ScriptPubKey ScriptTag = iota
	ScriptAll
	ScriptAny
	ScriptNofK
	InvalidBefore
	InvalidHereafter
)

type SerialHash

type SerialHash struct {
	Tag   ScriptTag
	Value []byte
	// contains filtered or unexported fields
}

type SerialInt

type SerialInt struct {
	Tag   ScriptTag
	Value int64
	// contains filtered or unexported fields
}

type SerialNok

type SerialNok struct {
	Tag           ScriptTag
	NoK           int
	NativeScripts []NativeScript
	// contains filtered or unexported fields
}

type SerialScripts

type SerialScripts struct {
	Tag           ScriptTag
	NativeScripts []NativeScript
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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