system

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 5 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AN = zsw.AN
View Source
var ActN = zsw.ActN
View Source
var PN = zsw.PN

Functions

func NewActivateFeature

func NewActivateFeature(featureDigest zsw.Checksum256) *zsw.Action

func NewBidname

func NewBidname(bidder, newname zsw.AccountName, bid zsw.Asset) *zsw.Action

func NewBuyRAM

func NewBuyRAM(payer, receiver zsw.AccountName, eosQuantity uint64) *zsw.Action

func NewBuyRAMBytes

func NewBuyRAMBytes(payer, receiver zsw.AccountName, bytes uint32) *zsw.Action

NewBuyRAMBytes will buy at current market price a given number of bytes of RAM, and grant them to the `receiver` account.

func NewCancelDelay

func NewCancelDelay(cancelingAuth zsw.PermissionLevel, transactionID zsw.Checksum256) *zsw.Action

NewCancelDelay creates an action from the `zswhq.system` contract called `canceldelay`.

`canceldelay` allows you to cancel a deferred transaction, previously sent to the chain with a `delay_sec` larger than 0. You need to sign with cancelingAuth, to cancel a transaction signed with that same authority.

func NewClaimRewards

func NewClaimRewards(owner zsw.AccountName) *zsw.Action

NewClaimRewards will buy at current market price a given number of bytes of RAM, and grant them to the `receiver` account.

func NewCustomNewAccount

func NewCustomNewAccount(creator, newAccount zsw.AccountName, owner, active zsw.Authority) *zsw.Action

NewCustomNewAccount returns a `newaccount` action that lives on the `zswhq.system` contract. You can specify your own `owner` and `active` permissions.

func NewDelegateBW

func NewDelegateBW(from, receiver zsw.AccountName, stakeCPU, stakeNet zsw.Asset, transfer bool) *zsw.Action

NewDelegateBW returns a `delegatebw` action that lives on the `zswhq.system` contract.

func NewDelegatedNewAccount

func NewDelegatedNewAccount(creator, newAccount zsw.AccountName, delegatedTo zsw.AccountName) *zsw.Action

NewDelegatedNewAccount returns a `newaccount` action that lives on the `zswhq.system` contract. It is filled with an authority structure that delegates full control of the new account to an already existing account.

func NewDeleteAuth

func NewDeleteAuth(account zsw.AccountName, permission zsw.PermissionName) *zsw.Action

NewDeleteAuth creates an action from the `zswhq.system` contract called `deleteauth`.

You cannot delete the `owner` or `active` permissions. Also, if a permission is still linked through a previous `updatelink` action, you will need to `unlinkauth` first.

func NewInitSystem

func NewInitSystem(version zsw.Varuint32, core zsw.Symbol) *zsw.Action

NewInitSystem returns a `init` action that lives on the `zswhq.system` contract.

func NewLinkAuth

func NewLinkAuth(account, code zsw.AccountName, actionName zsw.ActionName, requiredPermission zsw.PermissionName) *zsw.Action

NewLinkAuth creates an action from the `zswhq.system` contract called `linkauth`.

`linkauth` allows you to attach certain permission to the given `code::actionName`. With this set on-chain, you can use the `requiredPermission` to sign transactions for `code::actionName` and not rely on your `active` (which might be more sensitive as it can sign anything) for the given operation.

func NewNewAccount

func NewNewAccount(creator, newAccount zsw.AccountName, publicKey ecc.PublicKey) *zsw.Action

NewNewAccount returns a `newaccount` action that lives on the `zswhq.system` contract.

func NewNonce

func NewNonce(nonce string) *zsw.Action

NewNonce returns a `nonce` action that lives on the `zswhq.bios` contract. It should exist only when booting a new network, as it is replaced using the `eos-bios` boot process by the `zswhq.system` contract.

func NewRefund

func NewRefund(owner zsw.AccountName) *zsw.Action

NewRefund returns a `refund` action that lives on the `zswhq.system` contract.

func NewRegProducer

func NewRegProducer(producer zsw.AccountName, producerKey ecc.PublicKey, url string, location uint16) *zsw.Action

NewRegProducer returns a `regproducer` action that lives on the `zswhq.system` contract.

func NewRegProxy

func NewRegProxy(proxy zsw.AccountName, isProxy bool) *zsw.Action

NewRegProxy returns a `regproxy` action that lives on the `zswhq.system` contract.

func NewRemoveProducer

func NewRemoveProducer(producer zsw.AccountName) *zsw.Action

NewRemoveProducer returns a `rmvproducer` action that lives on the `zswhq.system` contract. This is to be called by the consortium of BPs, to oust a BP from its place. If you want to unregister yourself as a BP, use `unregprod`.

func NewSellRAM

func NewSellRAM(account zsw.AccountName, bytes uint64) *zsw.Action

NewSellRAM will sell at current market price a given number of bytes of RAM.

func NewSetABI

func NewSetABI(account zsw.AccountName, abiPath string) (out *zsw.Action, err error)

func NewSetAbiContent

func NewSetAbiContent(account zsw.AccountName, abiContent []byte) (out *zsw.Action, err error)

func NewSetAbiFromAbi

func NewSetAbiFromAbi(account zsw.AccountName, abi zsw.ABI) (out *zsw.Action, err error)

func NewSetCode

func NewSetCode(account zsw.AccountName, wasmPath string) (out *zsw.Action, err error)

func NewSetCodeContent

func NewSetCodeContent(account zsw.AccountName, codeContent []byte) *zsw.Action

func NewSetCodeTx

func NewSetCodeTx(account zsw.AccountName, wasmPath, abiPath string) (out *zsw.Transaction, err error)

NewSetCodeTx is _deprecated_. Use NewSetContract instead, and build your transaction yourself.

func NewSetContract

func NewSetContract(account zsw.AccountName, wasmPath, abiPath string) (out []*zsw.Action, err error)

func NewSetContractContent

func NewSetContractContent(account zsw.AccountName, wasmContent, abiContent []byte) (out []*zsw.Action, err error)

func NewSetPriv

func NewSetPriv(account zsw.AccountName) *zsw.Action

NewSetPriv returns a `setpriv` action that lives on the `zswhq.bios` contract. It should exist only when booting a new network, as it is replaced using the `eos-bios` boot process by the `zswhq.system` contract.

func NewSetProds

func NewSetProds(producers []ProducerKey) *zsw.Action

NewSetPriv returns a `setpriv` action that lives on the `zswhq.bios` contract. It should exist only when booting a new network, as it is replaced using the `eos-bios` boot process by the `zswhq.system` contract.

func NewSetRAM

func NewSetRAM(maxRAMSize uint64) *zsw.Action

func NewSetRAMRate

func NewSetRAMRate(bytesPerBlock uint16) *zsw.Action

func NewSetalimits

func NewSetalimits(account zsw.AccountName, ramBytes, netWeight, cpuWeight int64) *zsw.Action

NewSetalimits sets the account limits. Requires signature from `eosio@active` account.

func NewUndelegateBW

func NewUndelegateBW(from, receiver zsw.AccountName, unstakeCPU, unstakeNet zsw.Asset) *zsw.Action

NewUndelegateBW returns a `undelegatebw` action that lives on the `zswhq.system` contract.

func NewUnlinkAuth

func NewUnlinkAuth(account, code zsw.AccountName, actionName zsw.ActionName) *zsw.Action

NewUnlinkAuth creates an action from the `zswhq.system` contract called `unlinkauth`.

`unlinkauth` detaches a previously set permission from a `code::actionName`. See `linkauth`.

func NewUnregProducer

func NewUnregProducer(producer zsw.AccountName) *zsw.Action

NewUnregProducer returns a `unregprod` action that lives on the `zswhq.system` contract.

func NewUpdateAuth

func NewUpdateAuth(account zsw.AccountName, permission, parent zsw.PermissionName, authority zsw.Authority, usingPermission zsw.PermissionName) *zsw.Action

NewUpdateAuth creates an action from the `zswhq.system` contract called `updateauth`.

usingPermission needs to be `owner` if you want to modify the `owner` authorization, otherwise `active` will do for the rest.

func NewVoteProducer

func NewVoteProducer(voter zsw.AccountName, proxy zsw.AccountName, producers ...zsw.AccountName) *zsw.Action

NewNonce returns a `nonce` action that lives on the `zswhq.bios` contract. It should exist only when booting a new network, as it is replaced using the `eos-bios` boot process by the `zswhq.system` contract.

Types

type Activate

type Activate struct {
	FeatureDigest zsw.Checksum256 `json:"feature_digest"`
}

Activate represents a `activate` action on the `zswhq` contract.

type Bidname

type Bidname struct {
	Bidder  zsw.AccountName `json:"bidder"`
	Newname zsw.AccountName `json:"newname"`
	Bid     zsw.Asset       `json:"bid"` // specified in EOS
}

Bidname represents the `zswhq.system_contract::bidname` action.

type BlockchainParameters

type BlockchainParameters struct {
	MaxBlockNetUsage               zsw.Uint64 `json:"max_block_net_usage"`
	TargetBlockNetUsagePct         uint32     `json:"target_block_net_usage_pct"`
	MaxTransactionNetUsage         uint32     `json:"max_transaction_net_usage"`
	BasePerTransactionNetUsage     uint32     `json:"base_per_transaction_net_usage"`
	NetUsageLeeway                 uint32     `json:"net_usage_leeway"`
	ContextFreeDiscountNetUsageNum uint32     `json:"context_free_discount_net_usage_num"`
	ContextFreeDiscountNetUsageDen uint32     `json:"context_free_discount_net_usage_den"`
	MaxBlockCPUUsage               uint32     `json:"max_block_cpu_usage"`
	TargetBlockCPUUsagePct         uint32     `json:"target_block_cpu_usage_pct"`
	MaxTransactionCPUUsage         uint32     `json:"max_transaction_cpu_usage"`
	MinTransactionCPUUsage         uint32     `json:"min_transaction_cpu_usage"`
	MaxTransactionLifetime         uint32     `json:"max_transaction_lifetime"`
	DeferredTrxExpirationWindow    uint32     `json:"deferred_trx_expiration_window"`
	MaxTransactionDelay            uint32     `json:"max_transaction_delay"`
	MaxInlineActionSize            uint32     `json:"max_inline_action_size"`
	MaxInlineActionDepth           uint16     `json:"max_inline_action_depth"`
	MaxAuthorityDepth              uint16     `json:"max_authority_depth"`
	MaxGeneratedTransactionCount   uint32     `json:"max_generated_transaction_count"`
}

BlockchainParameters are all the params we can set through `setparams`.

type BuyRAM

type BuyRAM struct {
	Payer    zsw.AccountName `json:"payer"`
	Receiver zsw.AccountName `json:"receiver"`
	Quantity zsw.Asset       `json:"quant"` // specified in EOS
}

BuyRAM represents the `zswhq.system::buyram` action.

type BuyRAMBytes

type BuyRAMBytes struct {
	Payer    zsw.AccountName `json:"payer"`
	Receiver zsw.AccountName `json:"receiver"`
	Bytes    uint32          `json:"bytes"`
}

BuyRAMBytes represents the `zswhq.system::buyrambytes` action.

type CancelDelay

type CancelDelay struct {
	CancelingAuth zsw.PermissionLevel `json:"canceling_auth"`
	TransactionID zsw.Checksum256     `json:"trx_id"`
}

CancelDelay represents the native `canceldelay` action, through the system contract.

type ClaimRewards

type ClaimRewards struct {
	Owner zsw.AccountName `json:"owner"`
}

ClaimRewards represents the `zswhq.system::claimrewards` action.

type DelegateBW

type DelegateBW struct {
	From     zsw.AccountName `json:"from"`
	Receiver zsw.AccountName `json:"receiver"`
	StakeNet zsw.Asset       `json:"stake_net_quantity"`
	StakeCPU zsw.Asset       `json:"stake_cpu_quantity"`
	Transfer zsw.Bool        `json:"transfer"`
}

DelegateBW represents the `zswhq.system::delegatebw` action.

type DeleteAuth

type DeleteAuth struct {
	Account    zsw.AccountName    `json:"account"`
	Permission zsw.PermissionName `json:"permission"`
}

DeleteAuth represents the native `deleteauth` action, reachable through the `zswhq.system` contract.

type EOSIOGlobalState

type EOSIOGlobalState struct {
	BlockchainParameters
	TotalStorageBytesReserved zsw.Uint64 `json:"total_storage_bytes_reserved"`
	TotalStorageStake         zsw.Uint64 `json:"total_storage_stake"`
	PaymentPerBlock           zsw.Uint64 `json:"payment_per_block"`
}

type Init

type Init struct {
	Version zsw.Varuint32 `json:"version"`
	Core    zsw.Symbol    `json:"core"`
}

Init represents the `zswhq.system::init` action

type LinkAuth

type LinkAuth struct {
	Account     zsw.AccountName    `json:"account"`
	Code        zsw.AccountName    `json:"code"`
	Type        zsw.ActionName     `json:"type"`
	Requirement zsw.PermissionName `json:"requirement"`
}

LinkAuth represents the native `linkauth` action, through the system contract.

type NewAccount

type NewAccount struct {
	Creator zsw.AccountName `json:"creator"`
	Name    zsw.AccountName `json:"name"`
	Owner   zsw.Authority   `json:"owner"`
	Active  zsw.Authority   `json:"active"`
}

NewAccount represents a `newaccount` action on the `zswhq.system` contract. It is one of the rare ones to be hard-coded into the blockchain.

type Nonce

type Nonce struct {
	Value string `json:"value"`
}

Nonce represents the `zswhq.system::nonce` action. It is used to add variability in a transaction, so you can send the same many times in the same block, without it having the same Tx hash.

type ProducerKey

type ProducerKey struct {
	ProducerName    zsw.AccountName `json:"producer_name"`
	BlockSigningKey ecc.PublicKey   `json:"block_signing_key"`
}

type Refund

type Refund struct {
	Owner zsw.AccountName `json:"owner"`
}

Refund represents the `zswhq.system::refund` action

type RegProducer

type RegProducer struct {
	Producer    zsw.AccountName `json:"producer"`
	ProducerKey ecc.PublicKey   `json:"producer_key"`
	URL         string          `json:"url"`
	Location    uint16          `json:"location"` // what,s the meaning of that anyway ?
}

RegProducer represents the `zswhq.system::regproducer` action

type RegProxy

type RegProxy struct {
	Proxy   zsw.AccountName `json:"proxy"`
	IsProxy bool            `json:"isproxy"`
}

RegProxy represents the `zswhq.system::regproxy` action

type RemoveProducer

type RemoveProducer struct {
	Producer zsw.AccountName `json:"producer"`
}

RemoveProducer represents the `zswhq.system::rmvproducer` action

type SellRAM

type SellRAM struct {
	Account zsw.AccountName `json:"account"`
	Bytes   uint64          `json:"bytes"`
}

SellRAM represents the `zswhq.system::sellram` action.

type SetABI

type SetABI struct {
	Account zsw.AccountName `json:"account"`
	ABI     zsw.HexBytes    `json:"abi"`
}

SetABI represents the hard-coded `setabi` action.

type SetCode

type SetCode struct {
	Account   zsw.AccountName `json:"account"`
	VMType    byte            `json:"vmtype"`
	VMVersion byte            `json:"vmversion"`
	Code      zsw.HexBytes    `json:"code"`
}

SetCode represents the hard-coded `setcode` action.

type SetPriv

type SetPriv struct {
	Account zsw.AccountName `json:"account"`
	IsPriv  zsw.Bool        `json:"is_priv"`
}

SetPriv sets privileged account status. Used in the bios boot mechanism.

type SetProds

type SetProds struct {
	Schedule []ProducerKey `json:"schedule"`
}

SetProds is present in `zswhq.bios` contract. Used only at boot time.

type SetRAM

type SetRAM struct {
	MaxRAMSize zsw.Uint64 `json:"max_ram_size"`
}

SetRAM represents the hard-coded `setram` action.

type SetRAMRate

type SetRAMRate struct {
	BytesPerBlock uint16 `json:"bytes_per_block"`
}

SetRAMRate represents the system contract's `setramrate` action.

type Setalimits

type Setalimits struct {
	Account   zsw.AccountName `json:"account"`
	RAMBytes  int64           `json:"ram_bytes"`
	NetWeight int64           `json:"net_weight"`
	CPUWeight int64           `json:"cpu_weight"`
}

Setalimits represents the `zswhq.system::setalimit` action.

type UndelegateBW

type UndelegateBW struct {
	From       zsw.AccountName `json:"from"`
	Receiver   zsw.AccountName `json:"receiver"`
	UnstakeNet zsw.Asset       `json:"unstake_net_quantity"`
	UnstakeCPU zsw.Asset       `json:"unstake_cpu_quantity"`
}

UndelegateBW represents the `zswhq.system::undelegatebw` action.

type UnlinkAuth

type UnlinkAuth struct {
	Account zsw.AccountName `json:"account"`
	Code    zsw.AccountName `json:"code"`
	Type    zsw.ActionName  `json:"type"`
}

UnlinkAuth represents the native `unlinkauth` action, through the system contract.

type UnregProducer

type UnregProducer struct {
	Producer zsw.AccountName `json:"producer"`
}

UnregProducer represents the `zswhq.system::unregprod` action

type UpdateAuth

type UpdateAuth struct {
	Account    zsw.AccountName    `json:"account"`
	Permission zsw.PermissionName `json:"permission"`
	Parent     zsw.PermissionName `json:"parent"`
	Auth       zsw.Authority      `json:"auth"`
}

UpdateAuth represents the hard-coded `updateauth` action.

If you change the `active` permission, `owner` is the required parent.

If you change the `owner` permission, there should be no parent.

type VoteProducer

type VoteProducer struct {
	Voter     zsw.AccountName   `json:"voter"`
	Proxy     zsw.AccountName   `json:"proxy"`
	Producers []zsw.AccountName `json:"producers"`
}

VoteProducer represents the `zswhq.system::voteproducer` action

Jump to

Keyboard shortcuts

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