chainops

package
v0.0.0-...-ee306bc Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// OpRoot - Offset of chain operation code (60).
	OpRoot cells.ID = 0x3c

	// OpMultihash - Multihash native operation code.
	OpMultihash = OpRoot + 1

	// OpID - ID operation.
	OpID = OpRoot + 2

	// OpCID - Contentn ID native operation code.
	OpCID = OpRoot + 3

	// OpHeader - Header operation.
	OpHeader = OpRoot + 4

	// OpNonce - Nonce op (noop).
	OpNonce = OpRoot + 5

	// OpClaim - Address claim operation.
	OpClaim = OpRoot + 6

	// OpAssignPower - Allocation of power operation.
	OpAssignPower = OpRoot + 7

	// OpDelegatePower - Investment of power operation.
	OpDelegatePower = OpRoot + 8

	// OpPubkey - Public key operation.
	OpPubkey = OpRoot + 9

	// OpPubkeyAddr - Public key hash operation.
	OpPubkeyAddr = OpRoot + 10

	// OpSignature - Signature operation.
	OpSignature = OpRoot + 11

	// OpSigned - Signed operation.
	OpSigned = OpRoot + 12

	// OpAddress - Address native operation code.
	OpAddress = OpRoot + 13

	// OpTransfer - Transfer of an asset.
	OpTransfer = OpRoot + 14

	// OpNoop - Signalizes operation finish.
	OpNoop = OpRoot + 15
)

Variables

This section is empty.

Functions

func MustParseID

func MustParseID(str string) *cells.BinaryCell

MustParseID - Creates new uint64 cell from string.

func NewAddrOpFromPubkey

func NewAddrOpFromPubkey(bytes []byte) *cells.BinaryCell

NewAddrOpFromPubkey - Creates public key hash cell from public key.

func NewAssignPowerOp

func NewAssignPowerOp(nonce cells.ID, quantity uint64, addr *cells.CID) *cells.BinaryCell

NewAssignPowerOp - Creates assign power operation.

func NewCIDOp

func NewCIDOp(c *cells.CID) *cells.BinaryCell

NewCIDOp - Creates CID binary cell.

func NewDelegatePowerOp

func NewDelegatePowerOp(nonce cells.ID, quantity uint64, addrs ...*cells.CID) *cells.BinaryCell

NewDelegatePowerOp - Creates delegate power operation.

func NewHeaderOp

func NewHeaderOp(height uint64, prev, exec, state *cells.CID, t time.Time) *cells.BinaryCell

NewHeaderOp - Creates new header cell. Following format is used: `[height][prev-hash][exec-hash][state-hash][timestamp]`.

func NewID

func NewID(num cells.ID) *cells.BinaryCell

NewID New- Creates new uint64 cell.

func NewIDFromString

func NewIDFromString(body string) *cells.BinaryCell

NewIDFromString - Creates new uint64 cell.

func NewMultihash

func NewMultihash(mhash mh.Multihash) *cells.BinaryCell

NewMultihash - Creates multihash binary cell.

func NewNonceOp

func NewNonceOp(nonce cells.ID) *cells.BinaryCell

NewNonceOp - Creates new uint64 cell.

func NewPubkeyOp

func NewPubkeyOp(pubkey *btcec.PublicKey) *cells.BinaryCell

NewPubkeyOp - Creates public key cell.

func NewPubkeyOpFromBytes

func NewPubkeyOpFromBytes(pubkey []byte) *cells.BinaryCell

NewPubkeyOpFromBytes - Creates public key cell.

func NewRootOp

func NewRootOp(ops ...cells.Cell) *cells.BinaryCell

NewRootOp - Creates root operation.

func NewSignatureOp

func NewSignatureOp(body []byte, pk *btcec.PrivateKey) (_ *cells.BinaryCell, err error)

NewSignatureOp - Signs bytes and creates signature operation.

func NewSignatureOpFromBytes

func NewSignatureOpFromBytes(sig []byte) *cells.BinaryCell

NewSignatureOpFromBytes - Creates signature binary cell.

func NewSignedOp

func NewSignedOp(op *cells.BinaryCell, pk *btcec.PrivateKey) (_ *cells.BinaryCell, err error)

NewSignedOp - Signs binary cell and creates signed operation.

func ParseID

func ParseID(src string) (_ *cells.BinaryCell, err error)

ParseID - Creates new uint64 cell from string by parsing it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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