sumuslib

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MIT Imports: 6 Imported by: 0

README

GM Sumus Lib

Sumus blockchain lowlevel methods, transaction types, transactions signing, block data etc.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TokenToString = map[Token]string{
	TokenMNT:  "MNT",
	TokenGOLD: "GOLD",
}

TokenToString definition

View Source
var TransactionToString = map[Transaction]string{
	TransactionRegisterNode:           "RegisterNodeTransaction",
	TransactionUnregisterNode:         "UnregisterNodeTransaction",
	TransactionTransferAssets:         "TransferAssetsTransaction",
	TransactionRegisterSystemWallet:   "RegisterSystemWalletTransaction",
	TransactionUnregisterSystemWallet: "UnregisterSystemWalletTransaction",
	TransactionUserData:               "UserDataTransaction",
	TransactionDistributionFee:        "DistributionFeeTransaction",
}

TransactionToString definition

View Source
var WalletTagToString = map[WalletTag]string{
	WalletTagNode:        "Node",
	WalletTagGenesisNode: "GenesisNode",
	WalletTagSupervisor:  "SupervisorWallet",
	WalletTagOwner:       "OwnerWallet",
	WalletTagEmission:    "EmissionWallet",
	WalletTagData:        "DataWallet",
}

WalletTagToString definition

Functions

func DateFromStamp

func DateFromStamp(timestamp uint64) time.Time

DateFromStamp (Sumus timestamp)

func Pack58

func Pack58(data []byte) string

Pack58 packs bytes into base58 with crc

func Unpack58

func Unpack58(data string) ([]byte, error)

Unpack58 from string

func ValidToken

func ValidToken(u uint16) bool

ValidToken as uint16

func ValidTransaction

func ValidTransaction(u uint16) bool

ValidTransaction as uint16

func ValidWalletTag

func ValidWalletTag(u uint8) bool

ValidWalletTag as uint8

Types

type Digest

type Digest [32]byte

Digest bytes

func (Digest) MarshalJSON added in v1.0.3

func (d Digest) MarshalJSON() ([]byte, error)

MarshalJSON impl.

func (Digest) String added in v1.0.3

func (d Digest) String() string

String is a Stringer impl.

type PrivateKey

type PrivateKey [64]byte

PrivateKey bytes

func (PrivateKey) MarshalJSON added in v1.0.3

func (pk PrivateKey) MarshalJSON() ([]byte, error)

MarshalJSON impl.

func (PrivateKey) String added in v1.0.3

func (pk PrivateKey) String() string

String is a Stringer impl.

type PublicKey

type PublicKey [32]byte

PublicKey bytes

func UnpackAddress58

func UnpackAddress58(data string) (PublicKey, error)

UnpackAddress58 from string

func (PublicKey) MarshalJSON added in v1.0.3

func (pk PublicKey) MarshalJSON() ([]byte, error)

MarshalJSON impl.

func (PublicKey) String added in v1.0.3

func (pk PublicKey) String() string

String is a Stringer impl.

type Signature

type Signature [64]byte

Signature bytes

func (Signature) MarshalJSON added in v1.0.3

func (s Signature) MarshalJSON() ([]byte, error)

MarshalJSON impl.

func (Signature) String added in v1.0.3

func (s Signature) String() string

String is a Stringer impl.

type Token

type Token uint16

Token (asset) in Sumus blockchain

const (
	// TokenMNT is MNT
	TokenMNT Token = iota
	// TokenGOLD is GOLD
	TokenGOLD
)

func ParseToken

func ParseToken(s string) (Token, error)

ParseToken from string

func (Token) String

func (t Token) String() string

String representation

type Transaction

type Transaction uint16

Transaction in Sumus blockchain

const (
	// TransactionRegisterNode registers a new node
	TransactionRegisterNode Transaction = 1
	// TransactionUnregisterNode unregisters existing node
	TransactionUnregisterNode Transaction = 2
	// TransactionTransferAssets sends token between wallets
	TransactionTransferAssets Transaction = 10
	// TransactionRegisterSystemWallet registers system wallet
	TransactionRegisterSystemWallet Transaction = 3
	// TransactionUnregisterSystemWallet unregisters system wallet
	TransactionUnregisterSystemWallet Transaction = 4
	// TransactionUserData contains custom payload
	TransactionUserData Transaction = 7
	// TransactionDistributionFee sends block fee to owner
	TransactionDistributionFee Transaction = 11
)

func ParseTransaction

func ParseTransaction(s string) (Transaction, error)

ParseTransaction from string

func (Transaction) String

func (t Transaction) String() string

String representation

type WalletTag

type WalletTag uint8

WalletTag in Sumus blockchain

const (
	// WalletTagNode is node wallet
	WalletTagNode WalletTag = iota + 1
	// WalletTagGenesisNode is node wallet (TODO: clarify)
	WalletTagGenesisNode
	// WalletTagSupervisor is controller wallet who can tag other wallets
	WalletTagSupervisor
	// WalletTagOwner is a fee accumulator
	WalletTagOwner
	// WalletTagEmission emits token without a fee
	WalletTagEmission
	// WalletTagData can send UserData transactions without a fee
	WalletTagData
)

func ParseWalletTag

func ParseWalletTag(s string) (WalletTag, error)

ParseWalletTag from string

func (WalletTag) String

func (t WalletTag) String() string

String representation

Directories

Path Synopsis
ed25519
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.

Jump to

Keyboard shortcuts

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