skale

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caller

type Caller struct {
	NodeType EthereumNodeType
	// contains filtered or unexported fields
}

Caller caller for SKALE api functions The only reason this exists is to be used as an interface binding all it's methods

func NewCaller

func NewCaller(NodeType EthereumNodeType, requestsPerSecond float64) *Caller

func (*Caller) DelegationsByValidator

func (c *Caller) DelegationsByValidator(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, validatorID *big.Int, delegationsNumber uint64) (delegationID *big.Int, err error)

func (*Caller) GetAndUpdateEarnedBountyAmountOf

func (c *Caller) GetAndUpdateEarnedBountyAmountOf(ctx context.Context, bc *bind.BoundContract, validatorID *big.Int, wallet common.Address, blockNumber uint64) (earned, endMonth *big.Int, err error)

func (*Caller) GetDelegation

func (c *Caller) GetDelegation(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, delegationID *big.Int) (d structs.Delegation, err error)

func (*Caller) GetDelegationState

func (c *Caller) GetDelegationState(ctx context.Context, bc *bind.BoundContract, blockNumber uint64, delegationID *big.Int) (ds structs.DelegationState, err error)

func (*Caller) GetDelegationWithInfo

func (c *Caller) GetDelegationWithInfo(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, delegationID *big.Int) (d structs.Delegation, err error)

GetDelegationInfo delegation info with all parameters

func (*Caller) GetEarnedFeeAmountOf

func (c *Caller) GetEarnedFeeAmountOf(ctx context.Context, bc *bind.BoundContract, blockNumber uint64, validatorID *big.Int) (earned, endMonth *big.Int, err error)

func (*Caller) GetHolderDelegations

func (c *Caller) GetHolderDelegations(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, holder common.Address) (delegations []structs.Delegation, err error)

func (*Caller) GetNode

func (c *Caller) GetNode(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, nodeID *big.Int) (n structs.Node, err error)

func (*Caller) GetNodeAddress

func (c *Caller) GetNodeAddress(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, nodeID *big.Int) (adr common.Address, err error)

func (*Caller) GetNodeNextRewardDate

func (c *Caller) GetNodeNextRewardDate(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, nodeID *big.Int) (t time.Time, err error)

func (*Caller) GetNodeWithInfo

func (c *Caller) GetNodeWithInfo(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, nodeID *big.Int) (n structs.Node, err error)

func (*Caller) GetPendingDelegationsTokens

func (c *Caller) GetPendingDelegationsTokens(ctx context.Context, bc *bind.BoundContract, blockNumber uint64, holderAddress common.Address) (amount *big.Int, err error)

func (*Caller) GetValidator

func (c *Caller) GetValidator(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, validatorID *big.Int) (v structs.Validator, err error)

func (*Caller) GetValidatorDelegations

func (c *Caller) GetValidatorDelegations(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, validatorID *big.Int) (delegations []structs.Delegation, err error)

func (*Caller) GetValidatorDelegationsIDs

func (c *Caller) GetValidatorDelegationsIDs(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, validatorID *big.Int) (delegationsIDs []uint64, err error)

func (*Caller) GetValidatorNodes

func (c *Caller) GetValidatorNodes(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, validatorID *big.Int) (nodes []structs.Node, err error)

func (*Caller) GetValidatorWithInfo

func (c *Caller) GetValidatorWithInfo(ctx context.Context, bc transport.BoundContractCaller, blockNumber uint64, validatorID *big.Int) (v structs.Validator, err error)

func (*Caller) IsAuthorizedValidator

func (c *Caller) IsAuthorizedValidator(ctx context.Context, bc *bind.BoundContract, blockNumber uint64, validatorID *big.Int) (isAuthorized bool, err error)

type DelegationRaw

type DelegationRaw struct {
	Holder           common.Address `json:"holder"`
	ValidatorID      *big.Int       `json:"validatorId"`
	Amount           *big.Int       `json:"amount"`
	DelegationPeriod *big.Int       `json:"delegationPeriod"`
	Created          *big.Int       `json:"created"`
	Started          *big.Int       `json:"started"`
	Finished         *big.Int       `json:"finished"`
	Info             string         `json:"info"`
}

Delegation structure - to be used with abi.ConvertType method and it is decoding data using... field order. this is why we cannot change field order

type EthereumNodeType

type EthereumNodeType uint8
const (
	ENTArchive EthereumNodeType = iota
	ENTRecent
)

type IdError

type IdError struct {
	ID  uint64
	Err error
}

type ValidatorDelegationsCache

type ValidatorDelegationsCache struct {
	LastID      uint64
	Length      uint64
	Delegations []uint64
}

type ValidatorRaw

type ValidatorRaw struct {
	Name                    string         `json:"name"`
	ValidatorAddress        common.Address `json:"validatorAddress"`
	RequestedAddress        common.Address `json:"requestedAddress"`
	Description             string         `json:"description"`
	FeeRate                 *big.Int       `json:"feeRate"`
	RegistrationTime        *big.Int       `json:"registrationTime"`
	MinimumDelegationAmount *big.Int       `json:"minimumDelegationAmount"`
	AcceptNewRequests       bool           `json:"acceptNewRequests"`
}

Validator structure - to be used with abi.ConvertType method It is decoding data using... field order. this is why we cannot change field order

Notes

Bugs

  • recover from panic after format update!

Jump to

Keyboard shortcuts

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