isysapi

package
v0.0.0-...-4f0ab6e Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 4 Imported by: 10

Documentation

Index

Constants

View Source
const (
	// SysAPITransfer : deal with transfer type transaction.
	SysAPITransfer = "transfer"
	// SysAPIDeposit : deal with deposit type transaction.
	SysAPIDeposit = "deposit"
	// SysAPIWithdraw : deal with withdraw type transaction.
	SysAPIWithdraw = "withdraw"
	// SysAPIReward : deal with reward type transaction.
	SysAPIReward = "reward"
	// SysAPIDeploy : deal with deploy type transaction.
	SysAPIDeploy = "deploy"
	// SysAPIBinding : deal with binding type transaction.
	SysAPIBinding = "binding"
)

Variables

View Source
var (
	// MinerRewardAmount proposes block reward.
	MinerRewardAmount = new(big.Int).SetUint64(5e18)

	// StorageRewardAmount node service reward.
	StorageRewardAmount = new(big.Int).SetUint64(3e18)

	// SysAPIAddress is should be immutable.
	SysAPIAddress = multivacaddress.GenerateAddress(signature.PublicKey([]byte{}),
		multivacaddress.SystemContractAddress)
)

Functions

This section is empty.

Types

type BindingParams

type BindingParams struct {
	*TransferParams
	BindingAddress multivacaddress.Address
}

BindingParams is the params of binding trasaction See docs.md to get more details of binding transaction

type DeployParams

type DeployParams struct {
	APIList []string
	// Store the  init code , it will be builded by VM and create shard data outputs which index is 1
	Init []byte
	// Store the  smart contract code, it will be builded by VM
	Code []byte
}

DeployParams is the parameter of a smart contract deployment.

type DepositParams

type DepositParams struct {
	*TransferParams
	BindingAddress multivacaddress.Address
}

DepositParams is the parameter of deposit transaction.

type RewardParams

type RewardParams struct {
	To     multivacaddress.Address
	Amount *big.Int
}

RewardParams is the parameter of reward transaction.

type TransferParams

type TransferParams struct {
	To     multivacaddress.Address
	Shard  shard.Index
	Amount *big.Int
}

TransferParams is the parameter of normal transaction.

func (TransferParams) GetAmount

func (tp TransferParams) GetAmount() *big.Int

GetAmount get tp's amount.

func (TransferParams) GetShard

func (tp TransferParams) GetShard() shard.Index

GetShard get the shard of tp.

func (TransferParams) GetTo

GetTo get the To address.

type TxParameter

type TxParameter interface {
	GetTo() multivacaddress.Address
	GetShard() shard.Index
	GetAmount() *big.Int
}

TxParameter specifies the parameter of a transaction.

type WithdrawParams

type WithdrawParams struct {
	*TransferParams
}

WithdrawParams is the parameter of withdraw transaction.

Jump to

Keyboard shortcuts

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