account

package
v1.12.4-0...-e320c17 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const PanicIsLogicalError = false

Variables

This section is empty.

Functions

func INSCONSTRUCTOR_New

func INSCONSTRUCTOR_New(ref insolar.Reference, data []byte) (state []byte, result []byte, err error)

func INSMETHOD_Burn

func INSMETHOD_Burn(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_GetBalance

func INSMETHOD_GetBalance(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_GetCode

func INSMETHOD_GetCode(object []byte, data []byte) ([]byte, []byte, error)

func INSMETHOD_GetPrototype

func INSMETHOD_GetPrototype(object []byte, data []byte) ([]byte, []byte, error)

func INSMETHOD_IncreaseBalance

func INSMETHOD_IncreaseBalance(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_ReallocateToDeposit

func INSMETHOD_ReallocateToDeposit(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_Transfer

func INSMETHOD_Transfer(object []byte, data []byte) (newState []byte, result []byte, err error)

func INS_META_INFO

func INS_META_INFO() []map[string]string

func Initialize

func Initialize() insolar.ContractWrapper

Types

type Account

type Account struct {
	foundation.BaseContract
	Balance string
}

func New

func New(balance string) (*Account, error)

func (*Account) Burn

func (a *Account) Burn(
	amountStr string,
	fromMember insolar.Reference,
	request insolar.Reference,
) error

Burn transfers money to burn account.

func (*Account) GetBalance

func (a *Account) GetBalance() (string, error)

GetBalance gets total balance. ins:immutable

func (*Account) IncreaseBalance

func (a *Account) IncreaseBalance(amountStr string) error

IncreaseBalance increases the current balance by the amount.

func (*Account) ReallocateToDeposit

func (a *Account) ReallocateToDeposit(
	amountStr string,
	toDeposit insolar.Reference,
	fromMember insolar.Reference,
	request insolar.Reference,
) error

ReallocateToDeposit transfers money to given member deposit.

func (*Account) Transfer

func (a *Account) Transfer(
	amountStr string, toMember *insolar.Reference,
	fromMember insolar.Reference, request insolar.Reference,
) (interface{}, error)

Transfer transfers money to given member.

Jump to

Keyboard shortcuts

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