api

package
v0.2400.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package api defines the staking application API for other applications.

Index

Constants

This section is empty.

Variables

View Source
var MessageAccountHook = messageKind(0)

MessageAccountHook is the message kind for dispatching account hooks. The message itself implements the AccountHookInvocation interface.

Only the module that can handle the given destination should respond. The response value depends on the hook.

Functions

This section is empty.

Types

type AccountHookInvocation

type AccountHookInvocation interface {
	// Kind is the invoked hook kind.
	Kind() staking.HookKind

	// DestinationMatches checks whether the destination matches the given destination.
	DestinationMatches(dst staking.HookDestination) bool
}

AccountHookInvocation is the message body for dispatching account hooks.

type WithdrawHookInvocation

type WithdrawHookInvocation struct {
	// Destination is the configured hook destination.
	Destination staking.HookDestination
	// From is the address of the source account.
	From staking.Address
	// To is the address of the account that is attempting withdrawal.
	To staking.Address
	// Amount is the amount that is being withdrawn.
	Amount *quantity.Quantity
}

WithdrawHookInvocation is the message body for HookKindWithdraw hook dispatch.

func (*WithdrawHookInvocation) DestinationMatches

func (wh *WithdrawHookInvocation) DestinationMatches(dst staking.HookDestination) bool

DestinationMatches checks whether the destination matches the given destination.

func (*WithdrawHookInvocation) Kind

Kind is the invoked hook kind.

Jump to

Keyboard shortcuts

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