legacy

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LegacyBlock

type LegacyBlock struct {
	Number                      int64               `json:"number"`
	HASH                        string              `json:"hash"`
	TimeStart                   int64               `json:"time-start"`
	TimeEnd                     int64               `json:"time-end"`
	TimeTotal                   int32               `json:"time-total"`
	TimeLast20                  int32               `json:"time-last-20"`
	TransactionsCount           int32               `json:"transaction-count"`
	Difficulty                  int32               `json:"difficulty"`
	TargetHash                  PascalShortString   `json:"target-hash"`     // Capacity 32
	Solution                    PascalShortString   `json:"solution"`        // Capacity 200
	LastBlockHash               PascalShortString   `json:"last-block-hash"` // Capacity 32
	NextBlockDifficulty         int32               `json:"next-block-difficulty"`
	Miner                       PascalShortString   `json:"miner"` // Capacity 40
	Fee                         int64               `json:"fee"`
	Reward                      int64               `json:"reward"`
	Transactions                []LegacyTransaction `json:"transactions"`
	ProofOfStakeRewardCount     int32               `json:"pos-reward-count"`
	ProofOfStakeRewardAmount    int64               `json:"pos-reward-amount"`
	ProofOfStakeRewardAddresses []PascalShortString `json:"pos-reward-addresses"`
	MasterNodeRewardCount       int32               `json:"master-node-reward-count"`
	MasterNodeRewardAmount      int64               `json:"master-node-reward-amount"`
	MasterNodeRewardAddresses   []PascalShortString `json:"master-node-reward-addresses"`
}

func (*LegacyBlock) AsJSON added in v0.0.8

func (b *LegacyBlock) AsJSON() string

func (*LegacyBlock) ReadFromFile

func (b *LegacyBlock) ReadFromFile(f string) error

ReadFromFile reads the data from a block file

func (*LegacyBlock) ReadFromStream

func (b *LegacyBlock) ReadFromStream(f *os.File) error

ReadFromFile reads the data from a stream

type LegacyGVT

type LegacyGVT struct {
	EntryCount int64            `json:"entries-count"`
	Entries    []LegacyGVTEntry `json:"entries"`
}

func (*LegacyGVT) AsJSON added in v0.0.8

func (g *LegacyGVT) AsJSON() string

func (*LegacyGVT) ReadFromFile

func (g *LegacyGVT) ReadFromFile(f string) error

type LegacyGVTEntry

type LegacyGVTEntry struct {
	Number  PascalShortString `json:"number"` // Capacity 2
	Owner   PascalShortString `json:"owner"`  // Capacity 32
	Hash    PascalShortString `json:"hash"`   // Capacity 64
	Control int32             `json:"control"`
}

func (*LegacyGVTEntry) ReadFromStream

func (e *LegacyGVTEntry) ReadFromStream(f *os.File) error

type LegacyMNLockItem added in v0.0.7

type LegacyMNLockItem struct {
	Address PascalShortString `json:"address"` // Capacity 32 aligned makes it 35
	Expire  int32             `json:"expire"`
}

func (*LegacyMNLockItem) ReadFromStream added in v0.0.7

func (m *LegacyMNLockItem) ReadFromStream(f *os.File) error

type LegacyPSO added in v0.0.7

type LegacyPSO struct {
	Block       int32              `json:"block"`
	MNLockCount int32              `json:"mn-locks-count"`
	PSOCount    int32              `json:"psos-count"`
	MNLocks     []LegacyMNLockItem `json:"mn-locks"`
	PSOS        []LegacyPSOItem    `json:"psos"`
}

func (*LegacyPSO) AsJSON added in v0.0.8

func (p *LegacyPSO) AsJSON() string

func (*LegacyPSO) ReadFromFile added in v0.0.7

func (p *LegacyPSO) ReadFromFile(f string) error

type LegacyPSOItem added in v0.0.7

type LegacyPSOItem struct {
	Mode    int32  `json:"mode"`
	Hash    string `json:"hash"`
	Owner   string `json:"owner"`
	Expire  int32  `json:"expire"`
	Members string `json:"members"`
	Params  string `json:"params"`
}

type LegacySummary

type LegacySummary struct {
	AccountsCount int64                  `json:"accounts-count"`
	Accounts      []LegacySummaryAccount `json:"accounts"`
}

func (*LegacySummary) AsJSON added in v0.0.8

func (s *LegacySummary) AsJSON() string

func (*LegacySummary) ReadFromFile

func (s *LegacySummary) ReadFromFile(f string) error

type LegacySummaryAccount

type LegacySummaryAccount struct {
	Hash          PascalShortString `json:"hash"`   // Capacity 40
	Custom        PascalShortString `json:"custom"` // Capacity 40
	Balance       int64             `json:"balance"`
	Score         int64             `json:"score"`
	LastOperation int64             `json:"last-operation"`
}

func (*LegacySummaryAccount) ReadFromStream

func (a *LegacySummaryAccount) ReadFromStream(f *os.File) error

type LegacyTransaction

type LegacyTransaction struct {
	Block           int32             `json:"block"`          //
	OrderID         PascalShortString `json:"order-id"`       // Capacity 64
	OrderLinesCount int32             `json:"orders-count"`   //
	OrderType       PascalShortString `json:"order-type"`     // Capacity 6
	TransferID      PascalShortString `json:"id"`             // Capacity 64
	TimeStamp       int64             `json:"timestamp"`      //
	Reference       PascalShortString `json:"reference"`      // Capacity 64
	TransferIndex   int32             `json:"transfer-index"` //
	Sender          PascalShortString `json:"sender"`         // Capacity 120
	Address         PascalShortString `json:"address"`        // Capacity 40
	Receiver        PascalShortString `json:"receiver"`       // Capacity 40
	AmountFee       int64             `json:"fee"`            //
	AmountTransfer  int64             `json:"amount"`         //
	Signature       PascalShortString `json:"signature"`      // Capacity 120
}

func (*LegacyTransaction) AsJSON added in v0.0.9

func (t *LegacyTransaction) AsJSON() string

func (*LegacyTransaction) ReadFromStream

func (t *LegacyTransaction) ReadFromStream(r io.Reader) error

ReadFromStream reads a transaction from a stream

type LegacyWallet

type LegacyWallet struct {
	AccountsCount int64                 `json:"accounts-count"`
	Accounts      []LegacyWalletAccount `json:"accounts"`
}

func (*LegacyWallet) AsJSON added in v0.0.8

func (w *LegacyWallet) AsJSON() string

func (*LegacyWallet) ReadFromFile

func (w *LegacyWallet) ReadFromFile(f string) error

type LegacyWalletAccount

type LegacyWalletAccount struct {
	Hash          PascalShortString `json:"hash"`        // Capacity 40
	Custom        PascalShortString `json:"custom"`      // Capacity 40
	PrivateKey    PascalShortString `json:"private-key"` // Capacity 255
	PublicKey     PascalShortString `json:"public-key"`  // Capacity 255
	Balance       int64             `json:"balance"`
	Pending       int64             `json:"pending"`
	Score         int64             `json:"score"`
	LastOperation int64             `json:"last-operation"`
}

func (*LegacyWalletAccount) ReadFromStream

func (a *LegacyWalletAccount) ReadFromStream(f *os.File) error

type PascalShortString

type PascalShortString struct {
	// contains filtered or unexported fields
}

func NewPascalShortString

func NewPascalShortString(capacity int) *PascalShortString

NewPascalShortString creates a new PascalShortString with a given capacity

func (*PascalShortString) GetString

func (p *PascalShortString) GetString() string

GetString returns the actual string part (up to the length byte)

func (*PascalShortString) MarshalJSON added in v0.0.8

func (p *PascalShortString) MarshalJSON() ([]byte, error)

MarshalJSON allows this struct to be used with `json.Marshal()`

func (*PascalShortString) ReadFromStream

func (p *PascalShortString) ReadFromStream(r io.Reader) error

ReadFromStream reads a Pascal Short String from the provided stream

func (*PascalShortString) SetString

func (p *PascalShortString) SetString(s string) error

SetString sets the string value without overwriting existing content, and ensures garbage is maintained

func (*PascalShortString) WriteToStream

func (p *PascalShortString) WriteToStream(w io.Writer) error

WriteToStream writes the Pascal Short String to the provided stream

Jump to

Keyboard shortcuts

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