account

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Overview

Package account provides functionality for managing account information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

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

The Account struct represents an account object.

func FromBytes

func FromBytes(data []byte) (*Account, error)

FromBytes constructs a new account from byte array.

func NewAccount

func NewAccount(number int32) *Account

NewAccount constructs a new account from the given number.

func (*Account) AddToBalance

func (acc *Account) AddToBalance(amt int64)

AddToBalance adds the given amount to the account's balance.

func (Account) Balance

func (acc Account) Balance() int64

Balance returns the balance of the account.

func (*Account) Bytes

func (acc *Account) Bytes() ([]byte, error)

Bytes returns the serialized byte representation of the account.

func (*Account) Clone added in v0.12.0

func (acc *Account) Clone() *Account

Clone creates a deep copy of the account.

func (*Account) Hash

func (acc *Account) Hash() hash.Hash

Hash calculates and returns the hash of the account.

func (Account) Number

func (acc Account) Number() int32

Number returns the number of the account.

func (*Account) SerializeSize

func (acc *Account) SerializeSize() int

SerializeSize returns the size in bytes required to serialize the account.

func (*Account) SubtractFromBalance

func (acc *Account) SubtractFromBalance(amt int64)

SubtractFromBalance subtracts the given amount from the account's balance.

Jump to

Keyboard shortcuts

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