Documentation ¶
Overview ¶
nolint
nolint
Index ¶
- Constants
- Variables
- func Register(reg *registry.Registry)
- type SpawnArguments
- type SpendArguments
- type Vault
- func (v *Vault) BaseGas(uint8) uint64
- func (t *Vault) DecodeScale(dec *scale.Decoder) (total int, err error)
- func (t *Vault) EncodeScale(enc *scale.Encoder) (total int, err error)
- func (v *Vault) ExecGas(uint8) uint64
- func (v *Vault) LoadGas() uint64
- func (v *Vault) MaxSpend(uint8, any) (uint64, error)
- func (v *Vault) Spend(host core.Host, to core.Address, amount uint64) error
- func (v *Vault) Verify(core.Host, []byte, *scale.Decoder) bool
- func (v *Vault) Vested(lid core.LayerID) uint64
Constants ¶
View Source
const ( VAULT_STATE_SIZE = core.ACCOUNT_HEADER_SIZE + 56 DRAINED_SIZE = 8 )
Variables ¶
View Source
var ( // ErrNotOwner is raised if Spend is not executed by a principal that matches owner. ErrNotOwner = errors.New("vault: not an owner") // ErrAmountNotAvailable is raised if Spend overlows available amount (see method with the same name). ErrAmountNotAvailable = errors.New("vault: amount not available") // ErrMisconfigured is raised if a Vault account is misconfigured. ErrMisconfigured = errors.New("vault: account is misconfigured") )
View Source
var TemplateAddress core.Address
TemplateAddress is an address of the vault template.
Functions ¶
Types ¶
type SpawnArguments ¶
type SpawnArguments struct { Owner core.Address TotalAmount uint64 InitialUnlockAmount uint64 VestingStart core.LayerID VestingEnd core.LayerID }
SpawnArguments for the vault.
func (*SpawnArguments) DecodeScale ¶
func (t *SpawnArguments) DecodeScale(dec *scale.Decoder) (total int, err error)
func (*SpawnArguments) EncodeScale ¶
func (t *SpawnArguments) EncodeScale(enc *scale.Encoder) (total int, err error)
func (*SpawnArguments) String ¶
func (args *SpawnArguments) String() string
type SpendArguments ¶
type SpendArguments = wallet.SpendArguments
SpendArguments contains recipient and amount.
type Vault ¶
type Vault struct { Owner core.Address TotalAmount uint64 InitialUnlockAmount uint64 VestingStart core.LayerID VestingEnd core.LayerID }
func (*Vault) DecodeScale ¶
func (*Vault) EncodeScale ¶
func (*Vault) MaxSpend ¶
MaxSpend is noop for this template type, principal of this account type can't submit transactions.
Click to show internal directories.
Click to hide internal directories.