ndau

package
v1.99.99 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 51 Imported by: 7

Documentation

Index

Constants

View Source
const ChangeSchemaExitCode = 0xdd // only 1 byte for return codes on unix

ChangeSchemaExitCode is returned when the ndaunode exits due to ChangeSchema

View Source
const MaxSequenceIncrement = 128

MaxSequenceIncrement is the max allowed difference between the current sequence number and its successor

Variables

TxIDs is a map which defines canonical numeric ids for each transactable type.

Functions

func BuildVMForExchangeEAI

func BuildVMForExchangeEAI(code []byte, acct backing.AccountData, sib eai.Rate) (*vm.ChaincodeVM, error)

BuildVMForExchangeEAI accepts an exchange account data and builds a VM that it sets up to call the default handler. All that needs to happen after this is to call Run().

func BuildVMForNodeDistribution

func BuildVMForNodeDistribution(
	code []byte,
	node address.Address,
	costakers map[string]math.Ndau,
	accounts map[string]backing.AccountData,
	totalAward math.Ndau,
	ts math.Timestamp,
) (*vm.ChaincodeVM, error)

BuildVMForNodeDistribution builds a VM that it sets up to calculate distribution of node rewards.

All that needs to happen after this is to call Run().

Node distribution functions are expected to return a list of structs on top of their stack. These structs must be decorated such that field 10 is the numeric quantitiy of napu which should be disbursed to that costaker.

func BuildVMForNodeGoodness

func BuildVMForNodeGoodness(
	code []byte,
	addr address.Address,
	tmAddress string,
	acct backing.AccountData,
	totalStake math.Ndau,
	ts math.Timestamp,
	voteStats metast.VoteStats,
	node backing.Node,
	app *App,
) (*vm.ChaincodeVM, error)

BuildVMForNodeGoodness builds a VM that it sets up to calculate node goodness.

Node goodness functions use the following pieces of context:

stake ratio (top)
account data
address
delegation ratio
vote history for this node
timestamp of most recent RegisterNode

stake and delegation are not the literal numbers, but instead ratios: this account's, vs the total global amount.

All that needs to happen after this is to call Run().

func BuildVMForRulesValidation

func BuildVMForRulesValidation(
	tx metatx.Transactable,
	state *backing.State,
	rulesAcct ...address.Address,
) (*vm.ChaincodeVM, error)

BuildVMForRulesValidation builds a VM for rules validation.

Rules validation governs Stake and Unstake transactions. The VM is built and run during tx validation to impose additional rules about whether these particular transactions are valid. Storing these rules is half the purpose of the rules account.

Stack within the VM at init, from top to bottom: - total current stake from target staker - total current stake from primary staker (0 if no primary stake yet) - aggregate stake from primary staker and all costakers (0 if no primary stake) - tx - target account ID (or account data for ResolveStake) - stakeTo account ID - rules account ID (or account data for ResolveStake) - primary account ID

Expected output: 0 on top of stack if tx is valid, otherwise non-0 Additionally, for Unstake: if the second item on the stack is a number and non-0, it is interpreted as a math.Duration, added to the block time, and the resulting value is used as the expiry date for the hold, which is retained. Otherwise, the hold is discarded immediately.

func BuildVMForSIB

func BuildVMForSIB(
	code []byte,
	target, market, floor uint64,
	ts math.Timestamp,
) (*vm.ChaincodeVM, error)

BuildVMForSIB builds a VM that it sets up to calculate SIB.

The SIB calculation uses exactly two pieces of data: the target price (at stack top) and the market price. In principle it doesn't matter what units are used for these calculations; any integer pair will do. In practice we standardize on Nanocents.

The SIB calculation function returns an integer compatible with eai.Rate: the unit is 10^12; 1% is 10^10.

All that needs to happen after this is to call Run().

func BuildVMForTxFees

func BuildVMForTxFees(code []byte, tx metatx.Transactable, ts math.Timestamp) (*vm.ChaincodeVM, error)

BuildVMForTxFees accepts a transactable and builds a VM that it sets up to call the appropriate handler for the given transaction type. All that needs to happen after this is to call Run().

func BuildVMForTxValidation

func BuildVMForTxValidation(
	code []byte,
	acct backing.AccountData,
	tx metatx.Transactable,
	signatureSet *bitset256.Bitset256,
	app *App,
) (*vm.ChaincodeVM, error)

BuildVMForTxValidation accepts a transactable and builds a VM that it sets up to call the appropriate handler for the given transaction type. All that needs to happen after this is to call Run().

func IsChaincode

func IsChaincode(code []byte) bool

IsChaincode is true when the supplied bytes appear to be chaincode

func KnownTxNames

func KnownTxNames() []string

KnownTxNames returns a list of valid names which can produce a tx

func MockSystemAccount

func MockSystemAccount(app *App, addr address.Address) ([]signature.PrivateKey, error)

MockSystemAccount generates a single mock system account

given an address and the current time, generates some keypairs for this address, sets them in the app, and returns the private components

mock accounts have 2 validation keys and no validation script; they therefore implement 1 of 2 multisig.

func TMAddress

func TMAddress(key signature.PublicKey) (string, error)

TMAddress constructs a Tendermint-style address from an ndau format public key

func TxFromName

func TxFromName(name string) (tx metatx.Transactable, err error)

TxFromName prepares an example transaction from its name or from some known synonyms.

This is most useful for generic unmarshaling.

Types

type AddressIndexable

type AddressIndexable interface {
	metatx.Transactable
	GetAccountAddresses(*App) ([]string, error)
}

AddressIndexable is a Transactable that has addresses associated with it that we want to index.

type App

type App struct {
	*meta.App
	// contains filtered or unexported fields
}

App is an ABCI application which implements the Ndau chain

func InitMockApp

func InitMockApp() (app *App, assc generator.Associated, err error)

InitMockApp creates an empty test application, which is mainly useful for testing.

This uses a freshly-generated chaos config and an in-memory noms.

func InitMockAppWithIndex

func InitMockAppWithIndex(indexAddr string, indexVersion int) (
	app *App, assc generator.Associated, err error,
)

InitMockAppWithIndex creates an empty test application with indexing and search capability, which is mainly useful for testing.

This uses a freshly-generated chaos config and an in-memory noms.

func NewApp

func NewApp(dbSpec string, indexAddr string, indexVersion int, config config.Config) (*App, error)

NewApp prepares a new Ndau App

func NewAppSilent

func NewAppSilent(dbSpec string, indexAddr string, indexVersion int, config config.Config) (*App, error)

NewAppSilent prepares a new Ndau App which doesn't log

func NewAppWithLogger

func NewAppWithLogger(dbSpec string, indexAddr string, indexVersion int, config config.Config, logger log.FieldLogger) (*App, error)

NewAppWithLogger prepares a new Ndau App with the specified logger

func (*App) BeginBlock

func (app *App) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock

BeginBlock overrides the metanode BeginBlock ABCI message handler.

If a quit is pending, the application (and the ndaunode executable) exits. Otherwise, just uses the default handler.

func (*App) CalculateTxFeeNapu

func (app *App) CalculateTxFeeNapu(tx metatx.Transactable) (uint64, error)

CalculateTxFeeNapu implements AppIndexable

func (*App) CalculateTxSIBNapu

func (app *App) CalculateTxSIBNapu(tx metatx.Transactable) (uint64, error)

CalculateTxSIBNapu implements AppIndexable

func (*App) Delegate

func (app *App) Delegate(target, node address.Address) func(metast.State) (metast.State, error)

Delegate Target to Node

func (*App) EndBlock

func (app *App) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock

EndBlock updates the validator set, compositing its behavior with metanode's

func (*App) GetAccountAddresses

func (app *App) GetAccountAddresses(tx metatx.Transactable) ([]string, error)

GetAccountAddresses gets the affected account addresses from a tx

Transactions can override the behavior by implementing AddressIndexable, but by default, every ndau transactable will return its source

func (*App) IsFeatureActive

func (app *App) IsFeatureActive(feature string) bool

IsFeatureActive returns whether the given feature is currently active.

Once a feature becomes "active", it never becomes "inactive". We can handle this when we add more features that override previous features by checking the newest features first.

For example, say we have a feature in some transaction validation code that rounds a qty:

qty := math.Round(tx.Qty)

Then later we decided to round to the nearest tenth instead, we would write:

qty := tx.Qty
if app.IsFeatureActive("RoundToTenths") {
    qty = math.Round(qty*10)/10
} else {
    qty = math.Round(qty)
}

Then even later we decide to round to the nearest hundredth, we would write:

qty := tx.Qty
if app.IsFeatureActive("RoundToHundredths") {
    qty = math.Round(qty*100)/100
} else if app.IsFeatureActive("RoundToTenths") {
    qty = math.Round(qty*10)/10
} else {
    qty = math.Round(qty)
}

That way we remain backward compatible until the new rules become active as the app's state (i.e. block height) increases.

height:        0          120               300
               |           |                 |
blockchain:    |--x---x----+---y------y------+--z--z-------z---...
               |           |                 |
feature:    genesis   RoundToTenths   RoundToHundredths

A transaction "x" that occurs prior to block 120 gets the default handling since genesis. A transaction "y" with height in [120, 300) gets the rounding-by-tenths handling. A transaction "z" on or after block height 300 gets the rounding-by-hundredths handling.

func (*App) NodeStakers

func (app *App) NodeStakers(node address.Address) (map[string]math.Ndau, error)

NodeStakers returns all stakers and costakers of a node and their total stake

func (*App) SelectByGoodness

func (app *App) SelectByGoodness(random uint64) (address.Address, error)

SelectByGoodness deterministically selects one of the active nodes.

If the system var sv.NodeRewardMaxRewarded exists, only that quantity of the top nodes by goodness are eligible for rewards.

The specific choice depends on the random number. This random number is generated by an external service uniformly in the range [0..uint64_max]

func (*App) Stake

func (app *App) Stake(
	qty math.Ndau,
	target, stakeTo, rules address.Address,
	tx metatx.Transactable,
) func(metast.State) (metast.State, error)

Stake updates the state to handle staking an account to another

It is assumed that all necessary validation has already been performed. In particular, this function does not attempt to construct or run the chaincode context for the rules account.

This function returns a function suitable for calling within app.UpdateState

func (*App) System

func (app *App) System(name string, value msgp.Unmarshaler) (err error)

System retrieves a named system variable.

func (*App) Unstake

func (app *App) Unstake(
	qty math.Ndau,
	target, stakeTo, rules address.Address,
	retainFor math.Duration,
) func(metast.State) (metast.State, error)

Unstake updates the state to handle unstaking an account

It is assumed that all necessary validation has already been performed. In particular, this function does not attempt to construct or run the chaincode context for the rules account.

This function returns a function suitable for calling within app.UpdateState

func (*App) UnstakeAndBurn

func (app *App) UnstakeAndBurn(
	qty math.Ndau, burn uint8,
	target, stakeTo, rules address.Address,
	retainFor math.Duration,
	recursive bool,
) func(metast.State) (metast.State, error)

UnstakeAndBurn updates the state to handle unstaking an account with some amount burned. Burn is expressed as a fraction.

It is assumed that all necessary validation has already been performed. In particular, this function does not attempt to construct or run the chaincode context for the rules account.

This function returns a function suitable for calling within app.UpdateState

type Burn

type Burn struct {
	Target     address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	Qty        math.Ndau             `msg:"qty" chain:"11,Tx_Quantity" json:"qty"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

Burn transactions burn the specfied amount of ndau, permanently removing it from circulation.

func NewBurn

func NewBurn(
	target address.Address,
	qty math.Ndau,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *Burn

NewBurn creates a new Burn transactable

If signing keys are present, the new transactable is signed with all of them

func (*Burn) Apply

func (tx *Burn) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*Burn) ExtendSignatures

func (tx *Burn) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*Burn) GetSequence

func (tx *Burn) GetSequence() uint64

GetSequence implements Sequencer

func (*Burn) GetSignatures

func (tx *Burn) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*Burn) GetSource

func (tx *Burn) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*Burn) MarshalMsg

func (z *Burn) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Burn) Msgsize

func (z *Burn) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Burn) SignableBytes

func (tx *Burn) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for Burn

func (*Burn) UnmarshalMsg

func (z *Burn) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Burn) Validate

func (tx *Burn) Validate(appI interface{}) error

Validate implements metatx.Transactable

func (*Burn) Withdrawal

func (tx *Burn) Withdrawal() math.Ndau

Withdrawal implements Withdrawer

type ChangeRecoursePeriod

type ChangeRecoursePeriod struct {
	Target     address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	Period     math.Duration         `msg:"per" chain:"21,Tx_Period" json:"period"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A ChangeRecoursePeriod transaction is used to change the recourse period for transactions outbound from an account.

func NewChangeRecoursePeriod

func NewChangeRecoursePeriod(
	target address.Address,
	period math.Duration,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *ChangeRecoursePeriod

NewChangeRecoursePeriod creates a new ChangeRecoursePeriod transactable

If signing keys are present, the new transactable is signed with all of them

func (*ChangeRecoursePeriod) Apply

func (tx *ChangeRecoursePeriod) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*ChangeRecoursePeriod) ExtendSignatures

func (tx *ChangeRecoursePeriod) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*ChangeRecoursePeriod) GetSequence

func (tx *ChangeRecoursePeriod) GetSequence() uint64

GetSequence implements Sequencer

func (*ChangeRecoursePeriod) GetSignatures

func (tx *ChangeRecoursePeriod) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*ChangeRecoursePeriod) GetSource

func (tx *ChangeRecoursePeriod) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*ChangeRecoursePeriod) MarshalMsg

func (z *ChangeRecoursePeriod) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ChangeRecoursePeriod) Msgsize

func (z *ChangeRecoursePeriod) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ChangeRecoursePeriod) SignableBytes

func (tx *ChangeRecoursePeriod) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for ChangeRecoursePeriod

func (*ChangeRecoursePeriod) UnmarshalMsg

func (z *ChangeRecoursePeriod) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*ChangeRecoursePeriod) Validate

func (tx *ChangeRecoursePeriod) Validate(appI interface{}) (err error)

Validate implements metatx.Transactable

type ChangeSchema

type ChangeSchema struct {
	// SchemaVersion is advisory and not checked or retained by the blockchain.
	// It is intended to be read by humans replaying the blockchain.
	SchemaVersion string                `msg:"sav" json:"schema_version"`
	Sequence      uint64                `msg:"seq" json:"sequence"`
	Signatures    []signature.Signature `msg:"sig" json:"signatures"`
}

A ChangeSchema transaction triggers the ndaunode to shut down.

This is used to enable versioning upgrades which change the noms schema.

func NewChangeSchema

func NewChangeSchema(
	schemaversion string,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *ChangeSchema

NewChangeSchema creates a new ChangeSchema transactable

If signing keys are present, the new transactable is signed with all of them

func (*ChangeSchema) Apply

func (tx *ChangeSchema) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*ChangeSchema) ExtendSignatures

func (tx *ChangeSchema) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*ChangeSchema) GetSequence

func (tx *ChangeSchema) GetSequence() uint64

GetSequence implements Sequencer

func (*ChangeSchema) GetSignatures

func (tx *ChangeSchema) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*ChangeSchema) GetSource

func (tx *ChangeSchema) GetSource(app *App) (addr address.Address, err error)

GetSource implements Sourcer

func (*ChangeSchema) MarshalMsg

func (z *ChangeSchema) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ChangeSchema) Msgsize

func (z *ChangeSchema) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ChangeSchema) SignableBytes

func (tx *ChangeSchema) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for ChangeSchema

func (*ChangeSchema) UnmarshalMsg

func (z *ChangeSchema) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*ChangeSchema) Validate

func (tx *ChangeSchema) Validate(appI interface{}) error

Validate implements metatx.Transactable

type ChangeValidation

type ChangeValidation struct {
	Target           address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	NewKeys          []signature.PublicKey `msg:"key" chain:"31,Tx_NewKeys" json:"new_keys"`
	ValidationScript []byte                `msg:"val" chain:"32,Tx_ValidationScript" json:"validation_script"`
	Sequence         uint64                `msg:"seq" json:"sequence"`
	Signatures       []signature.Signature `msg:"sig" json:"signatures"`
}

A ChangeValidation transaction is used to set validation rules

func NewChangeValidation

func NewChangeValidation(
	target address.Address,
	newkeys []signature.PublicKey,
	validationscript []byte,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *ChangeValidation

NewChangeValidation creates a new ChangeValidation transactable

If signing keys are present, the new transactable is signed with all of them

func (*ChangeValidation) Apply

func (tx *ChangeValidation) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*ChangeValidation) ExtendSignatures

func (tx *ChangeValidation) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*ChangeValidation) GetSequence

func (tx *ChangeValidation) GetSequence() uint64

GetSequence implements Sequencer

func (*ChangeValidation) GetSignatures

func (tx *ChangeValidation) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*ChangeValidation) GetSource

func (tx *ChangeValidation) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*ChangeValidation) MarshalMsg

func (z *ChangeValidation) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ChangeValidation) Msgsize

func (z *ChangeValidation) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ChangeValidation) SignableBytes

func (tx *ChangeValidation) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for ChangeValidation

func (*ChangeValidation) UnmarshalMsg

func (z *ChangeValidation) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*ChangeValidation) Validate

func (tx *ChangeValidation) Validate(appI interface{}) (err error)

Validate implements metatx.Transactable

type ClaimNodeReward

type ClaimNodeReward struct {
	Node       address.Address       `msg:"nod" chain:"4,Tx_Node" json:"node"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A ClaimNodeReward transaction signals that the named node has been watching the blockchain, noticed that it won the nomination, and is up and ready to claim its reward.

func NewClaimNodeReward

func NewClaimNodeReward(
	node address.Address,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *ClaimNodeReward

NewClaimNodeReward creates a new ClaimNodeReward transactable

If signing keys are present, the new transactable is signed with all of them

func (*ClaimNodeReward) Apply

func (tx *ClaimNodeReward) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*ClaimNodeReward) ExtendSignatures

func (tx *ClaimNodeReward) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*ClaimNodeReward) GetSequence

func (tx *ClaimNodeReward) GetSequence() uint64

GetSequence implements Sequencer

func (*ClaimNodeReward) GetSignatures

func (tx *ClaimNodeReward) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*ClaimNodeReward) GetSource

func (tx *ClaimNodeReward) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*ClaimNodeReward) MarshalMsg

func (z *ClaimNodeReward) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ClaimNodeReward) Msgsize

func (z *ClaimNodeReward) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ClaimNodeReward) SignableBytes

func (tx *ClaimNodeReward) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for ClaimNodeReward

func (*ClaimNodeReward) UnmarshalMsg

func (z *ClaimNodeReward) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*ClaimNodeReward) Validate

func (tx *ClaimNodeReward) Validate(appI interface{}) error

Validate implements metatx.Transactable

type CommandValidatorChange

type CommandValidatorChange struct {
	// Node must previously have been registered with RegisterNode
	Node address.Address `msg:"nod" chain:"4,Tx_Node" json:"node"`

	// Power is an arbitrary integer with no intrinsic
	// meaning; during the Global Trust period, it
	// can be literally whatever. Setting it to 0
	// removes the validator.
	Power int64 `msg:"pow" chain:"17,Tx_Power" json:"power"`

	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A CommandValidatorChange changes a validator's power by fiat.

Like NNR and RFE, there is a special account whose address is stored as a system variable, which both authenticates this transaction and pays its associated fees.

This transaction replaces GTValidatorChange, which was too insecure to ever actually deploy with.

func NewCommandValidatorChange

func NewCommandValidatorChange(
	node address.Address,
	power int64,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *CommandValidatorChange

NewCommandValidatorChange creates a new CommandValidatorChange transactable

If signing keys are present, the new transactable is signed with all of them

func (*CommandValidatorChange) Apply

func (tx *CommandValidatorChange) Apply(appI interface{}) error

Apply this CVC to the node state

func (*CommandValidatorChange) ExtendSignatures

func (tx *CommandValidatorChange) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*CommandValidatorChange) GetSequence

func (tx *CommandValidatorChange) GetSequence() uint64

GetSequence implements Sequencer

func (*CommandValidatorChange) GetSignatures

func (tx *CommandValidatorChange) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*CommandValidatorChange) GetSource

func (tx *CommandValidatorChange) GetSource(app *App) (addr address.Address, err error)

GetSource implements Sourcer

func (*CommandValidatorChange) MarshalMsg

func (z *CommandValidatorChange) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*CommandValidatorChange) Msgsize

func (z *CommandValidatorChange) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*CommandValidatorChange) SignableBytes

func (tx *CommandValidatorChange) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for CommandValidatorChange

func (*CommandValidatorChange) ToValidator

func (tx *CommandValidatorChange) ToValidator(state *backing.State) (*abci.ValidatorUpdate, error)

ToValidator converts this tx into a TM-style ValidatorUpdate struct

func (*CommandValidatorChange) UnmarshalMsg

func (z *CommandValidatorChange) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*CommandValidatorChange) Validate

func (tx *CommandValidatorChange) Validate(appI interface{}) error

Validate implements metatx.Transactable

type CreateChildAccount

type CreateChildAccount struct {
	Target                address.Address       `msg:"tgt"  json:"target"`
	Child                 address.Address       `msg:"chd"  json:"child"`
	ChildOwnership        signature.PublicKey   `msg:"cown" json:"child_ownership"`
	ChildSignature        signature.Signature   `msg:"csig" json:"child_signature"`
	ChildRecoursePeriod   math.Duration         `msg:"cper" json:"child_recourse_period"`
	ChildValidationKeys   []signature.PublicKey `msg:"ckey" json:"child_validation_keys"`
	ChildValidationScript []byte                `msg:"cval" json:"child_validation_script"`
	ChildDelegationNode   address.Address       `msg:"nod"  json:"child_delegation_node"`
	Sequence              uint64                `msg:"seq"  json:"sequence"`
	Signatures            []signature.Signature `msg:"sig"  json:"signatures"`
}

A CreateChildAccount transaction is used to set the initial validation rules for a child account, and link the target account as its parent.

func NewCreateChildAccount

func NewCreateChildAccount(
	target address.Address,
	child address.Address,
	childownership signature.PublicKey,
	childsignature signature.Signature,
	childrecourseperiod math.Duration,
	childvalidationkeys []signature.PublicKey,
	childvalidationscript []byte,
	childdelegationnode address.Address,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *CreateChildAccount

NewCreateChildAccount creates a new CreateChildAccount transactable

If signing keys are present, the new transactable is signed with all of them

func (*CreateChildAccount) Apply

func (tx *CreateChildAccount) Apply(appI interface{}) error

Apply applies this tx if no error occurs

func (*CreateChildAccount) ExtendSignatures

func (tx *CreateChildAccount) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*CreateChildAccount) GetAccountAddresses

func (tx *CreateChildAccount) GetAccountAddresses(app *App) ([]string, error)

GetAccountAddresses returns the account addresses associated with this transaction type.

func (*CreateChildAccount) GetSequence

func (tx *CreateChildAccount) GetSequence() uint64

GetSequence implements Sequencer

func (*CreateChildAccount) GetSignatures

func (tx *CreateChildAccount) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*CreateChildAccount) GetSource

func (tx *CreateChildAccount) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*CreateChildAccount) MarshalMsg

func (z *CreateChildAccount) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*CreateChildAccount) Msgsize

func (z *CreateChildAccount) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*CreateChildAccount) SignableBytes

func (tx *CreateChildAccount) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for CreateChildAccount

func (*CreateChildAccount) UnmarshalMsg

func (z *CreateChildAccount) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*CreateChildAccount) Validate

func (tx *CreateChildAccount) Validate(appI interface{}) error

Validate returns nil if tx is valid, or an error

type CreditEAI

type CreditEAI struct {
	Node       address.Address       `msg:"nod" chain:"4,Tx_Node" json:"node"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A CreditEAI transaction is used to award EAI.

This transaction is sent electively by any node which has accounts delegated to it. It is expected that nodes will arrange to create this transaction on a regular schedule.

The transaction doesn't include the actual EAI computations. There are two reasons for this:

  1. All nodes must perform the calculations anyway in order to verify that the transaction is valid. If you're doing the calculations anway, there's not much point in adding them to the transaction in the first place.
  2. The originating node can't know ahead of time what the official block time will be.

func NewCreditEAI

func NewCreditEAI(
	node address.Address,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *CreditEAI

NewCreditEAI creates a new CreditEAI transactable

If signing keys are present, the new transactable is signed with all of them

func (*CreditEAI) Apply

func (tx *CreditEAI) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*CreditEAI) ExtendSignatures

func (tx *CreditEAI) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*CreditEAI) GetAccountAddresses

func (tx *CreditEAI) GetAccountAddresses(app *App) ([]string, error)

GetAccountAddresses returns the account addresses associated with this transaction type.

func (*CreditEAI) GetSequence

func (tx *CreditEAI) GetSequence() uint64

GetSequence implements Sequencer

func (*CreditEAI) GetSignatures

func (tx *CreditEAI) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*CreditEAI) GetSource

func (tx *CreditEAI) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*CreditEAI) MarshalMsg

func (z *CreditEAI) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*CreditEAI) Msgsize

func (z *CreditEAI) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*CreditEAI) SignableBytes

func (tx *CreditEAI) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for CreditEAI

func (*CreditEAI) UnmarshalMsg

func (z *CreditEAI) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*CreditEAI) Validate

func (tx *CreditEAI) Validate(appI interface{}) error

Validate implements metatx.Transactable

type Delegate

type Delegate struct {
	Target     address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	Node       address.Address       `msg:"nod" chain:"4,Tx_Node" json:"node"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A Delegate transaction is used to delegate the node which should compute EAI for the specified account.

The sequence number must be higher than that of the target Account

func NewDelegate

func NewDelegate(
	target address.Address,
	node address.Address,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *Delegate

NewDelegate creates a new Delegate transactable

If signing keys are present, the new transactable is signed with all of them

func (*Delegate) Apply

func (tx *Delegate) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*Delegate) ExtendSignatures

func (tx *Delegate) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*Delegate) GetAccountAddresses

func (tx *Delegate) GetAccountAddresses(app *App) ([]string, error)

GetAccountAddresses returns the account addresses associated with this transaction type.

func (*Delegate) GetSequence

func (tx *Delegate) GetSequence() uint64

GetSequence implements Sequencer

func (*Delegate) GetSignatures

func (tx *Delegate) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*Delegate) GetSource

func (tx *Delegate) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*Delegate) MarshalMsg

func (z *Delegate) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Delegate) Msgsize

func (z *Delegate) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Delegate) SignableBytes

func (tx *Delegate) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for Delegate

func (*Delegate) UnmarshalMsg

func (z *Delegate) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Delegate) Validate

func (tx *Delegate) Validate(appI interface{}) error

Validate implements metatx.Transactable

type HasDestination

type HasDestination interface {
	// return the address which is considered the transaction's destination
	GetDestination(*App) (address.Address, error)
}

A HasDestination is a transaction with a destination

type Issue

type Issue struct {
	Qty        math.Ndau             `msg:"qty" chain:"11,Tx_Quantity" json:"qty"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

An Issue transaction is the second half of the primary sales process.

See https://github.com/ndau/ndau/issues/229 for details.

The signatures are checked against an account specified by the ReleaseFromEndowmentAddress system variable. That account also specifes the validation script, and pays the transaction fee.

func NewIssue

func NewIssue(
	qty math.Ndau,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *Issue

NewIssue creates a new Issue transactable

If signing keys are present, the new transactable is signed with all of them

func (*Issue) Apply

func (tx *Issue) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*Issue) ExtendSignatures

func (tx *Issue) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*Issue) GetSequence

func (tx *Issue) GetSequence() uint64

GetSequence implements Sequencer

func (*Issue) GetSignatures

func (tx *Issue) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*Issue) GetSource

func (tx *Issue) GetSource(app *App) (addr address.Address, err error)

GetSource implements Sourcer

func (*Issue) MarshalMsg

func (z *Issue) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Issue) Msgsize

func (z *Issue) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Issue) SignableBytes

func (tx *Issue) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for Issue

func (*Issue) UnmarshalMsg

func (z *Issue) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Issue) UpdatedTargetPrice

func (*Issue) UpdatedTargetPrice()

UpdatedTargetPrice implements search.TargetPriceIndexable

func (*Issue) Validate

func (tx *Issue) Validate(appI interface{}) error

Validate implements metatx.Transactable

type Lock

type Lock struct {
	Target     address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	Period     math.Duration         `msg:"per" chain:"21,Tx_Period" json:"period"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

Lock transactions lock the specfied account.

Locked accounts may still receive ndau but may not be the source for transfers.

func NewLock

func NewLock(
	target address.Address,
	period math.Duration,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *Lock

NewLock creates a new Lock transactable

If signing keys are present, the new transactable is signed with all of them

func (*Lock) Apply

func (tx *Lock) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*Lock) ExtendSignatures

func (tx *Lock) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*Lock) GetSequence

func (tx *Lock) GetSequence() uint64

GetSequence implements Sequencer

func (*Lock) GetSignatures

func (tx *Lock) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*Lock) GetSource

func (tx *Lock) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*Lock) MarshalMsg

func (z *Lock) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Lock) Msgsize

func (z *Lock) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Lock) SignableBytes

func (tx *Lock) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for Lock

func (*Lock) UnmarshalMsg

func (z *Lock) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Lock) Validate

func (tx *Lock) Validate(appI interface{}) error

Validate implements metatx.Transactable

type NTransactable

type NTransactable interface {
	metatx.Transactable
	Sourcer
	Sequencer
}

NTransactable is a wrapper around metatx.Transactable that allows us to manipulate ndau tx specifically. It's a little confusing to just call it Transactable.

type NominateNodeReward

type NominateNodeReward struct {
	Random     int64                 `msg:"rnd" chain:"41,Tx_Random" json:"random"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A NominateNodeReward transaction signals that a node is probably about to be rewarded.

The signatures are checked against an account specified by the NominateNodeRewardAddress system variable. That account also specifes the validation script, and pays the transaction fee.

func NewNominateNodeReward

func NewNominateNodeReward(
	random int64,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *NominateNodeReward

NewNominateNodeReward creates a new NominateNodeReward transactable

If signing keys are present, the new transactable is signed with all of them

func (*NominateNodeReward) Apply

func (tx *NominateNodeReward) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*NominateNodeReward) ExtendSignatures

func (tx *NominateNodeReward) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*NominateNodeReward) GetSequence

func (tx *NominateNodeReward) GetSequence() uint64

GetSequence implements Sequencer

func (*NominateNodeReward) GetSignatures

func (tx *NominateNodeReward) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*NominateNodeReward) GetSource

func (tx *NominateNodeReward) GetSource(app *App) (addr address.Address, err error)

GetSource implements Sourcer

func (*NominateNodeReward) MarshalMsg

func (z *NominateNodeReward) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*NominateNodeReward) Msgsize

func (z *NominateNodeReward) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*NominateNodeReward) SignableBytes

func (tx *NominateNodeReward) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for NominateNodeReward

func (*NominateNodeReward) UnmarshalMsg

func (z *NominateNodeReward) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*NominateNodeReward) Validate

func (tx *NominateNodeReward) Validate(appI interface{}) error

Validate implements metatx.Transactable

type Notify

type Notify struct {
	Target     address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

Notify transactions notify that the specified account should be unlocked once its notice period expires.

Notified accounts may not receive ndau.

func NewNotify

func NewNotify(
	target address.Address,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *Notify

NewNotify creates a new Notify transactable

If signing keys are present, the new transactable is signed with all of them

func (*Notify) Apply

func (tx *Notify) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*Notify) ExtendSignatures

func (tx *Notify) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*Notify) GetSequence

func (tx *Notify) GetSequence() uint64

GetSequence implements Sequencer

func (*Notify) GetSignatures

func (tx *Notify) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*Notify) GetSource

func (tx *Notify) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*Notify) MarshalMsg

func (z *Notify) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Notify) Msgsize

func (z *Notify) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Notify) SignableBytes

func (tx *Notify) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for Notify

func (*Notify) UnmarshalMsg

func (z *Notify) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Notify) Validate

func (tx *Notify) Validate(appI interface{}) error

Validate implements metatx.Transactable

type RecordEndowmentNAV

type RecordEndowmentNAV struct {
	NAV        pricecurve.Nanocent   `msg:"nav" chain:"11,Tx_Quantity" json:"nav"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A RecordEndowmentNAV transaction records the current Net Asset Value of the ndau endowment.

This data is used to calculate the current SIB in effect.

Its signatures are checked against an account specified by the RecordEndowmentNAVAddress system variable. That account also specifies the validation script, and pays the transaction fee.

func NewRecordEndowmentNAV

func NewRecordEndowmentNAV(
	nav pricecurve.Nanocent,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *RecordEndowmentNAV

NewRecordEndowmentNAV creates a new RecordEndowmentNAV transactable

If signing keys are present, the new transactable is signed with all of them

func (*RecordEndowmentNAV) Apply

func (tx *RecordEndowmentNAV) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*RecordEndowmentNAV) ExtendSignatures

func (tx *RecordEndowmentNAV) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*RecordEndowmentNAV) GetSequence

func (tx *RecordEndowmentNAV) GetSequence() uint64

GetSequence implements Sequencer

func (*RecordEndowmentNAV) GetSignatures

func (tx *RecordEndowmentNAV) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*RecordEndowmentNAV) GetSource

func (tx *RecordEndowmentNAV) GetSource(app *App) (addr address.Address, err error)

GetSource implements Sourcer

func (*RecordEndowmentNAV) MarshalMsg

func (z *RecordEndowmentNAV) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*RecordEndowmentNAV) Msgsize

func (z *RecordEndowmentNAV) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RecordEndowmentNAV) SignableBytes

func (tx *RecordEndowmentNAV) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for RecordEndowmentNAV

func (*RecordEndowmentNAV) UnmarshalMsg

func (z *RecordEndowmentNAV) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*RecordEndowmentNAV) UpdatedTargetPrice

func (*RecordEndowmentNAV) UpdatedTargetPrice()

UpdatedTargetPrice implements search.TargetPriceIndexable

func (*RecordEndowmentNAV) Validate

func (tx *RecordEndowmentNAV) Validate(appI interface{}) error

Validate implements metatx.Transactable

type RecordPrice

type RecordPrice struct {
	MarketPrice pricecurve.Nanocent   `msg:"prc" chain:"11,Tx_Quantity" json:"market_price"`
	Sequence    uint64                `msg:"seq" json:"sequence"`
	Signatures  []signature.Signature `msg:"sig" json:"signatures"`
}

A RecordPrice transaction records the current market price of Ndau.

This data is used to calculate the current SIB in effect.

Its signatures are checked against an account specified by the RecordPriceAddress system variable. That account also specifies the validation script, and pays the transaction fee.

func NewRecordPrice

func NewRecordPrice(
	marketprice pricecurve.Nanocent,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *RecordPrice

NewRecordPrice creates a new RecordPrice transactable

If signing keys are present, the new transactable is signed with all of them

func (*RecordPrice) Apply

func (tx *RecordPrice) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*RecordPrice) ExtendSignatures

func (tx *RecordPrice) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*RecordPrice) GetMarketPrice

func (tx *RecordPrice) GetMarketPrice() pricecurve.Nanocent

GetMarketPrice implements search.MarketPriceIndexable

func (*RecordPrice) GetSequence

func (tx *RecordPrice) GetSequence() uint64

GetSequence implements Sequencer

func (*RecordPrice) GetSignatures

func (tx *RecordPrice) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*RecordPrice) GetSource

func (tx *RecordPrice) GetSource(app *App) (addr address.Address, err error)

GetSource implements Sourcer

func (*RecordPrice) MarshalMsg

func (z *RecordPrice) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*RecordPrice) Msgsize

func (z *RecordPrice) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RecordPrice) SignableBytes

func (tx *RecordPrice) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for RecordPrice

func (*RecordPrice) UnmarshalMsg

func (z *RecordPrice) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*RecordPrice) UpdatedTargetPrice

func (*RecordPrice) UpdatedTargetPrice()

UpdatedTargetPrice implements search.TargetPriceIndexable

func (*RecordPrice) Validate

func (tx *RecordPrice) Validate(appI interface{}) error

Validate implements metatx.Transactable

type RegisterNode

type RegisterNode struct {
	Node               address.Address       `msg:"nod" chain:"4,Tx_Node" json:"node"`
	DistributionScript []byte                `msg:"dis" chain:"33,Tx_DistributionScript" json:"distribution_script"`
	Ownership          signature.PublicKey   `msg:"own" chain:"34,Tx_Ownership" json:"ownership"`
	Sequence           uint64                `msg:"seq" json:"sequence"`
	Signatures         []signature.Signature `msg:"sig" json:"signatures"`
}

A RegisterNode transaction activates a node

func NewRegisterNode

func NewRegisterNode(
	node address.Address,
	distributionscript []byte,
	ownership signature.PublicKey,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *RegisterNode

NewRegisterNode creates a new RegisterNode transactable

If signing keys are present, the new transactable is signed with all of them

func (*RegisterNode) Apply

func (tx *RegisterNode) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*RegisterNode) ExtendSignatures

func (tx *RegisterNode) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*RegisterNode) GetSequence

func (tx *RegisterNode) GetSequence() uint64

GetSequence implements Sequencer

func (*RegisterNode) GetSignatures

func (tx *RegisterNode) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*RegisterNode) GetSource

func (tx *RegisterNode) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*RegisterNode) MarshalMsg

func (z *RegisterNode) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*RegisterNode) Msgsize

func (z *RegisterNode) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RegisterNode) SignableBytes

func (tx *RegisterNode) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for RegisterNode

func (*RegisterNode) UnmarshalMsg

func (z *RegisterNode) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*RegisterNode) Validate

func (tx *RegisterNode) Validate(appI interface{}) error

Validate implements metatx.Transactable

type ReleaseFromEndowment

type ReleaseFromEndowment struct {
	Destination address.Address       `msg:"dst" chain:"2,Tx_Destination" json:"destination"`
	Qty         math.Ndau             `msg:"qty" chain:"11,Tx_Quantity" json:"qty"`
	Sequence    uint64                `msg:"seq" json:"sequence"`
	Signatures  []signature.Signature `msg:"sig" json:"signatures"`
}

A ReleaseFromEndowment transaction is used to release funds from the endowment into an individual account.

It must be signed with the private key corresponding to one of the public keys listed in the system variable `ReleaseFromEndowmentKeys`.

func NewReleaseFromEndowment

func NewReleaseFromEndowment(
	destination address.Address,
	qty math.Ndau,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *ReleaseFromEndowment

NewReleaseFromEndowment creates a new ReleaseFromEndowment transactable

If signing keys are present, the new transactable is signed with all of them

func (*ReleaseFromEndowment) Apply

func (tx *ReleaseFromEndowment) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*ReleaseFromEndowment) ExtendSignatures

func (tx *ReleaseFromEndowment) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*ReleaseFromEndowment) GetAccountAddresses

func (tx *ReleaseFromEndowment) GetAccountAddresses(app *App) ([]string, error)

GetAccountAddresses returns the account addresses associated with this transaction type.

func (*ReleaseFromEndowment) GetSequence

func (tx *ReleaseFromEndowment) GetSequence() uint64

GetSequence implements Sequencer

func (*ReleaseFromEndowment) GetSignatures

func (tx *ReleaseFromEndowment) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*ReleaseFromEndowment) GetSource

func (tx *ReleaseFromEndowment) GetSource(app *App) (addr address.Address, err error)

GetSource implements Sourcer

func (*ReleaseFromEndowment) MarshalMsg

func (z *ReleaseFromEndowment) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ReleaseFromEndowment) Msgsize

func (z *ReleaseFromEndowment) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ReleaseFromEndowment) SignableBytes

func (tx *ReleaseFromEndowment) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for ReleaseFromEndowment

func (*ReleaseFromEndowment) UnmarshalMsg

func (z *ReleaseFromEndowment) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*ReleaseFromEndowment) Validate

func (tx *ReleaseFromEndowment) Validate(appI interface{}) error

Validate implements metatx.Transactable

type ResolveStake

type ResolveStake struct {
	Target     address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"` // primary staker
	Rules      address.Address       `msg:"rul" chain:"8,Tx_Rules" json:"rules"`
	Burn       uint8                 `msg:"brn" chain:"12,Tx_Burn" json:"burn"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A ResolveStake transaction is submitted by a stake rules account to resolve a stake.

Most of the time this will not be required: stakers will eventually `Unstake`, be subject to some delay, and then have their staked balance automatically return to spendable status.

ResolveStake is not for those transactions. It is for those times when an account or group of accounts must have its stake slashed, and for dispute resolution.

func NewResolveStake

func NewResolveStake(
	target address.Address,
	rules address.Address,
	burn uint8,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *ResolveStake

NewResolveStake creates a new ResolveStake transactable

If signing keys are present, the new transactable is signed with all of them

func (*ResolveStake) Apply

func (tx *ResolveStake) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*ResolveStake) ExtendSignatures

func (tx *ResolveStake) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*ResolveStake) GetAccountAddresses

func (tx *ResolveStake) GetAccountAddresses(app *App) ([]string, error)

GetAccountAddresses returns the account addresses associated with this transaction type.

func (*ResolveStake) GetSequence

func (tx *ResolveStake) GetSequence() uint64

GetSequence implements Sequencer

func (*ResolveStake) GetSignatures

func (tx *ResolveStake) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*ResolveStake) GetSource

func (tx *ResolveStake) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*ResolveStake) MarshalMsg

func (z *ResolveStake) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ResolveStake) Msgsize

func (z *ResolveStake) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ResolveStake) SignableBytes

func (tx *ResolveStake) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for ResolveStake

func (*ResolveStake) UnmarshalMsg

func (z *ResolveStake) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*ResolveStake) Validate

func (tx *ResolveStake) Validate(appI interface{}) error

Validate implements metatx.Transactable

type Sequencer

type Sequencer interface {
	// return the sequence number of this transaction
	GetSequence() uint64
}

A Sequencer is a transaction with a sequence number.

type SetRewardsDestination

type SetRewardsDestination struct {
	Target      address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	Destination address.Address       `msg:"dst" chain:"2,Tx_Destination" json:"destination"`
	Sequence    uint64                `msg:"seq" json:"sequence"`
	Signatures  []signature.Signature `msg:"sig" json:"signatures"`
}

SetRewardsDestination transactions update the rewards target for the specified account.

When the rewards target is empty, EAI and other rewards are deposited to the origin account. Otherwise, they are deposited to the specified destination.

func NewSetRewardsDestination

func NewSetRewardsDestination(
	target address.Address,
	destination address.Address,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *SetRewardsDestination

NewSetRewardsDestination creates a new SetRewardsDestination transactable

If signing keys are present, the new transactable is signed with all of them

func (*SetRewardsDestination) Apply

func (tx *SetRewardsDestination) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*SetRewardsDestination) ExtendSignatures

func (tx *SetRewardsDestination) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*SetRewardsDestination) GetAccountAddresses

func (tx *SetRewardsDestination) GetAccountAddresses(app *App) ([]string, error)

GetAccountAddresses returns the account addresses associated with this transaction type.

func (*SetRewardsDestination) GetSequence

func (tx *SetRewardsDestination) GetSequence() uint64

GetSequence implements Sequencer

func (*SetRewardsDestination) GetSignatures

func (tx *SetRewardsDestination) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*SetRewardsDestination) GetSource

func (tx *SetRewardsDestination) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*SetRewardsDestination) MarshalMsg

func (z *SetRewardsDestination) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*SetRewardsDestination) Msgsize

func (z *SetRewardsDestination) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*SetRewardsDestination) SignableBytes

func (tx *SetRewardsDestination) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for SetRewardsDestination

func (*SetRewardsDestination) UnmarshalMsg

func (z *SetRewardsDestination) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*SetRewardsDestination) Validate

func (tx *SetRewardsDestination) Validate(appI interface{}) error

Validate implements metatx.Transactable

type SetStakeRules

type SetStakeRules struct {
	Target     address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	StakeRules []byte                `msg:"krs" chain:"35,Tx_StakeRules" json:"stake_rules"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A SetStakeRules transaction is used to set or remove stake rules from an account

func NewSetStakeRules

func NewSetStakeRules(
	target address.Address,
	stakerules []byte,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *SetStakeRules

NewSetStakeRules creates a new SetStakeRules transactable

If signing keys are present, the new transactable is signed with all of them

func (*SetStakeRules) Apply

func (tx *SetStakeRules) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*SetStakeRules) ExtendSignatures

func (tx *SetStakeRules) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*SetStakeRules) GetSequence

func (tx *SetStakeRules) GetSequence() uint64

GetSequence implements Sequencer

func (*SetStakeRules) GetSignatures

func (tx *SetStakeRules) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*SetStakeRules) GetSource

func (tx *SetStakeRules) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*SetStakeRules) MarshalMsg

func (z *SetStakeRules) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*SetStakeRules) Msgsize

func (z *SetStakeRules) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*SetStakeRules) SignableBytes

func (tx *SetStakeRules) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for SetStakeRules

func (*SetStakeRules) UnmarshalMsg

func (z *SetStakeRules) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*SetStakeRules) Validate

func (tx *SetStakeRules) Validate(appI interface{}) (err error)

Validate implements metatx.Transactable

type SetSysvar

type SetSysvar struct {
	Name       string                `msg:"nme" chain:"6,Tx_Name" json:"name"`
	Value      []byte                `msg:"vlu" chain:"7,Tx_Value" json:"value"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A SetSysvar transaction sets a system variable.

Its signatures are checked against an account specified by the SetSysvarAddress system variable. That account also specifies the validation script, and pays the transaction fee.

func NewSetSysvar

func NewSetSysvar(
	name string,
	value []byte,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *SetSysvar

NewSetSysvar creates a new SetSysvar transactable

If signing keys are present, the new transactable is signed with all of them

func (*SetSysvar) Apply

func (tx *SetSysvar) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*SetSysvar) ExtendSignatures

func (tx *SetSysvar) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*SetSysvar) GetName

func (tx *SetSysvar) GetName() string

GetName implements SysvarIndexable.

func (*SetSysvar) GetSequence

func (tx *SetSysvar) GetSequence() uint64

GetSequence implements Sequencer

func (*SetSysvar) GetSignatures

func (tx *SetSysvar) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*SetSysvar) GetSource

func (tx *SetSysvar) GetSource(app *App) (addr address.Address, err error)

GetSource implements Sourcer

func (*SetSysvar) GetValue

func (tx *SetSysvar) GetValue() []byte

GetValue implements SysvarIndexable.

func (*SetSysvar) MarshalMsg

func (z *SetSysvar) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*SetSysvar) Msgsize

func (z *SetSysvar) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*SetSysvar) SignableBytes

func (tx *SetSysvar) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for SetSysvar

func (*SetSysvar) UnmarshalMsg

func (z *SetSysvar) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*SetSysvar) Validate

func (tx *SetSysvar) Validate(appI interface{}) error

Validate implements metatx.Transactable

type SetValidation

type SetValidation struct {
	Target           address.Address       `msg:"tgt" json:"target"`
	Ownership        signature.PublicKey   `msg:"own" json:"ownership"`
	ValidationKeys   []signature.PublicKey `msg:"key" json:"validation_keys"`
	ValidationScript []byte                `msg:"val" json:"validation_script"`
	Sequence         uint64                `msg:"seq" json:"sequence"`
	Signature        signature.Signature   `msg:"sig" json:"signature"`
}

A SetValidation transaction is used to set the initial validation rules for an account.

It is the only type of transaction which may be signed with the ownership key.

func NewSetValidation

func NewSetValidation(
	target address.Address,
	ownership signature.PublicKey,
	validationkeys []signature.PublicKey,
	validationscript []byte,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *SetValidation

NewSetValidation creates a new SetValidation transactable

If signing keys are present, the new transactable is signed with all of them

Note: though this constructor supports an arbitrary number of signing keys, SetValidation supports only a single signature. Any keys set beyond the first are ignored.

func (*SetValidation) Apply

func (tx *SetValidation) Apply(appI interface{}) error

Apply applies this tx if no error occurs

func (*SetValidation) GetSequence

func (tx *SetValidation) GetSequence() uint64

GetSequence implements Sequencer

func (*SetValidation) GetSource

func (tx *SetValidation) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*SetValidation) MarshalMsg

func (z *SetValidation) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*SetValidation) Msgsize

func (z *SetValidation) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*SetValidation) SignableBytes

func (tx *SetValidation) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for SetValidation

func (*SetValidation) UnmarshalMsg

func (z *SetValidation) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*SetValidation) Validate

func (tx *SetValidation) Validate(appI interface{}) error

Validate returns nil if tx is valid, or an error

type Signable

type Signable interface {
	// append to the list of signatures on this transaction
	ExtendSignatures([]signature.Signature)
}

Signable allows signatures to be added to this TX

type Signeder

type Signeder interface {
	// return the signatures of this transaction
	GetSignatures() []signature.Signature
}

A Signeder is a transaction which has some number of signatures.

type Sourcer

type Sourcer interface {
	// return the address which is considered the transaction's source
	// this address is used to check the sequence number, provides the tx
	// fees, etc.
	GetSource(*App) (address.Address, error)
}

A Sourcer is a transaction with a source from which tx fees are withdrawn, whose sequence number is checked, etc.

type Stake

type Stake struct {
	Target     address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	Rules      address.Address       `msg:"rul" chain:"8,Tx_Rules" json:"rules"`
	StakeTo    address.Address       `msg:"sto" chain:"5,Tx_StakeTo" json:"stake_to"`
	Qty        math.Ndau             `msg:"qty" chain:"11,Tx_Quantity" json:"qty"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

A Stake transaction stakes to a node

func NewStake

func NewStake(
	target address.Address,
	rules address.Address,
	staketo address.Address,
	qty math.Ndau,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *Stake

NewStake creates a new Stake transactable

If signing keys are present, the new transactable is signed with all of them

func (*Stake) Apply

func (tx *Stake) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*Stake) ExtendSignatures

func (tx *Stake) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*Stake) GetAccountAddresses

func (tx *Stake) GetAccountAddresses(app *App) ([]string, error)

GetAccountAddresses returns the account addresses associated with this transaction type.

func (*Stake) GetSequence

func (tx *Stake) GetSequence() uint64

GetSequence implements Sequencer

func (*Stake) GetSignatures

func (tx *Stake) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*Stake) GetSource

func (tx *Stake) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*Stake) MarshalMsg

func (z *Stake) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Stake) Msgsize

func (z *Stake) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Stake) SignableBytes

func (tx *Stake) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for Stake

func (*Stake) UnmarshalMsg

func (z *Stake) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Stake) Validate

func (tx *Stake) Validate(appI interface{}) error

Validate implements metatx.Transactable

type Transfer

type Transfer struct {
	Source      address.Address       `msg:"src" chain:"1,Tx_Source" json:"source"`
	Destination address.Address       `msg:"dst" chain:"2,Tx_Destination" json:"destination"`
	Qty         math.Ndau             `msg:"qty" chain:"11,Tx_Quantity" json:"qty"`
	Sequence    uint64                `msg:"seq" json:"sequence"`
	Signatures  []signature.Signature `msg:"sig" json:"signatures"`
}

A Transfer is the fundamental transaction of the Ndau chain.

func NewTransfer

func NewTransfer(
	source address.Address,
	destination address.Address,
	qty math.Ndau,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *Transfer

NewTransfer creates a new Transfer transactable

If signing keys are present, the new transactable is signed with all of them

func (*Transfer) Apply

func (tx *Transfer) Apply(appInt interface{}) error

Apply satisfies metatx.Transactable

func (*Transfer) ExtendSignatures

func (tx *Transfer) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*Transfer) GetAccountAddresses

func (tx *Transfer) GetAccountAddresses(app *App) ([]string, error)

GetAccountAddresses returns the account addresses associated with this transaction type.

func (*Transfer) GetDestination

func (tx *Transfer) GetDestination(*App) (address.Address, error)

GetDestination implements HasDestination

func (*Transfer) GetSequence

func (tx *Transfer) GetSequence() uint64

GetSequence implements Sequencer

func (*Transfer) GetSignatures

func (tx *Transfer) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*Transfer) GetSource

func (tx *Transfer) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*Transfer) MarshalMsg

func (z *Transfer) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Transfer) Msgsize

func (z *Transfer) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Transfer) SignableBytes

func (tx *Transfer) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for Transfer

func (*Transfer) UnmarshalMsg

func (z *Transfer) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Transfer) Validate

func (tx *Transfer) Validate(appInt interface{}) error

Validate satisfies metatx.Transactable

func (*Transfer) Withdrawal

func (tx *Transfer) Withdrawal() math.Ndau

Withdrawal implements Withdrawer

type TransferAndLock

type TransferAndLock struct {
	Source      address.Address       `msg:"src" chain:"1,Tx_Source" json:"source"`
	Destination address.Address       `msg:"dst" chain:"2,Tx_Destination" json:"destination"`
	Qty         math.Ndau             `msg:"qty" chain:"11,Tx_Quantity" json:"qty"`
	Period      math.Duration         `msg:"per" chain:"21,Tx_Period" json:"period"`
	Sequence    uint64                `msg:"seq" json:"sequence"`
	Signatures  []signature.Signature `msg:"sig" json:"signatures"`
}

TransferAndLock allows a transaction where the received amount is locked for a specified period. It can only be sent to accounts that did not previously exist on the blockchain.

func NewTransferAndLock

func NewTransferAndLock(
	source address.Address,
	destination address.Address,
	qty math.Ndau,
	period math.Duration,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *TransferAndLock

NewTransferAndLock creates a new TransferAndLock transactable

If signing keys are present, the new transactable is signed with all of them

func (*TransferAndLock) Apply

func (tx *TransferAndLock) Apply(appInt interface{}) error

Apply satisfies metatx.Transactable

func (*TransferAndLock) ExtendSignatures

func (tx *TransferAndLock) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*TransferAndLock) GetAccountAddresses

func (tx *TransferAndLock) GetAccountAddresses(app *App) ([]string, error)

GetAccountAddresses returns the account addresses associated with this transaction type.

func (*TransferAndLock) GetDestination

func (tx *TransferAndLock) GetDestination(*App) (address.Address, error)

GetDestination implements HasDestination

func (*TransferAndLock) GetSequence

func (tx *TransferAndLock) GetSequence() uint64

GetSequence implements Sequencer

func (*TransferAndLock) GetSignatures

func (tx *TransferAndLock) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*TransferAndLock) GetSource

func (tx *TransferAndLock) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*TransferAndLock) MarshalMsg

func (z *TransferAndLock) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TransferAndLock) Msgsize

func (z *TransferAndLock) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TransferAndLock) SignableBytes

func (tx *TransferAndLock) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for TransferAndLock

func (*TransferAndLock) UnmarshalMsg

func (z *TransferAndLock) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*TransferAndLock) Validate

func (tx *TransferAndLock) Validate(appInt interface{}) error

Validate satisfies metatx.Transactable

func (*TransferAndLock) Withdrawal

func (tx *TransferAndLock) Withdrawal() math.Ndau

Withdrawal implements Withdrawer

type UnregisterNode

type UnregisterNode struct {
	Node       address.Address       `msg:"nod" chain:"4,Tx_Node" json:"node"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

An UnregisterNode transaction deactivates a node

func NewUnregisterNode

func NewUnregisterNode(
	node address.Address,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *UnregisterNode

NewUnregisterNode creates a new UnregisterNode transactable

If signing keys are present, the new transactable is signed with all of them

func (*UnregisterNode) Apply

func (tx *UnregisterNode) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*UnregisterNode) ExtendSignatures

func (tx *UnregisterNode) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*UnregisterNode) GetSequence

func (tx *UnregisterNode) GetSequence() uint64

GetSequence implements Sequencer

func (*UnregisterNode) GetSignatures

func (tx *UnregisterNode) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*UnregisterNode) GetSource

func (tx *UnregisterNode) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*UnregisterNode) MarshalMsg

func (z *UnregisterNode) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*UnregisterNode) Msgsize

func (z *UnregisterNode) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*UnregisterNode) SignableBytes

func (tx *UnregisterNode) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for UnregisterNode

func (*UnregisterNode) UnmarshalMsg

func (z *UnregisterNode) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*UnregisterNode) Validate

func (tx *UnregisterNode) Validate(appI interface{}) error

Validate implements metatx.Transactable

type Unstake

type Unstake struct {
	Target     address.Address       `msg:"tgt" chain:"3,Tx_Target" json:"target"`
	Rules      address.Address       `msg:"rul" chain:"8,Tx_Rules" json:"rules"`
	StakeTo    address.Address       `msg:"sto" chain:"5,Tx_StakeTo" json:"stake_to"`
	Qty        math.Ndau             `msg:"qty" chain:"11,Tx_Quantity" json:"qty"`
	Sequence   uint64                `msg:"seq" json:"sequence"`
	Signatures []signature.Signature `msg:"sig" json:"signatures"`
}

An Unstake transaction stakes to a node

func NewUnstake

func NewUnstake(
	target address.Address,
	rules address.Address,
	staketo address.Address,
	qty math.Ndau,
	sequence uint64,
	signingKeys ...signature.PrivateKey,
) *Unstake

NewUnstake creates a new Unstake transactable

If signing keys are present, the new transactable is signed with all of them

func (*Unstake) Apply

func (tx *Unstake) Apply(appI interface{}) error

Apply implements metatx.Transactable

func (*Unstake) ExtendSignatures

func (tx *Unstake) ExtendSignatures(sa []signature.Signature)

ExtendSignatures implements Signable

func (*Unstake) GetSequence

func (tx *Unstake) GetSequence() uint64

GetSequence implements Sequencer

func (*Unstake) GetSignatures

func (tx *Unstake) GetSignatures() []signature.Signature

GetSignatures implements Signeder

func (*Unstake) GetSource

func (tx *Unstake) GetSource(*App) (address.Address, error)

GetSource implements Sourcer

func (*Unstake) MarshalMsg

func (z *Unstake) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Unstake) Msgsize

func (z *Unstake) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Unstake) SignableBytes

func (tx *Unstake) SignableBytes() []byte

SignableBytes partially implements metatx.Transactable for Unstake

func (*Unstake) UnmarshalMsg

func (z *Unstake) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Unstake) Validate

func (tx *Unstake) Validate(appI interface{}) error

Validate implements metatx.Transactable

type Withdrawer

type Withdrawer interface {
	// return the amount withdrawn from the source by this transaction.
	// Does not include tx fee or SIB.
	Withdrawal() math.Ndau
}

A Withdrawer is a transaction which withdraws some amount from the source in addition to the normal tx fees.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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