adapters

package
v0.1.0-mage.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SourceAdapters

type SourceAdapters struct {
	// contains filtered or unexported fields
}

SourceAdapters is a collection of source adapters.

func NewSourceAdapters

func NewSourceAdapters(
	swapKeeper types.SwapKeeper,
	earnKeeper types.EarnKeeper,
) SourceAdapters

NewSourceAdapters returns a new SourceAdapters instance with all available source adapters.

func (SourceAdapters) OwnerSharesBySource

func (a SourceAdapters) OwnerSharesBySource(
	ctx sdk.Context,
	claimType types.ClaimType,
	owner sdk.AccAddress,
	sourceIDs []string,
) []SourceShare

OwnerSharesBySource returns a slice of SourceShares for each sourceID from a specified owner. The slice is sorted by sourceID.

func (SourceAdapters) TotalSharesBySource

func (a SourceAdapters) TotalSharesBySource(
	ctx sdk.Context,
	claimType types.ClaimType,
	sourceID string,
) sdk.Dec

TotalSharesBySource returns the total shares of a given claimType and sourceID.

type SourceShare

type SourceShare struct {
	ID     string
	Shares sdk.Dec
}

SourceShare is a single share from a source with it's corresponding ID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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