keeper

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryParameters         = "parameters"
	QueryTreasury           = "treasury"
	QueryOperators          = "operators"
	QueryDisbursements      = "disbursements"
	QueryPrice              = "price"
	QueryDisbursementEscrow = "disbursement-escrow"
)

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a new querier for treasury clients.

Types

type Keeper

type Keeper struct {
	AccountKeeper auth.AccountKeeper
	BankKeeper    bank.Keeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramspace params.Subspace, supplyKeeper supply.Keeper, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper) Keeper

func (Keeper) AddOperator

func (k Keeper) AddOperator(ctx sdk.Context, address sdk.AccAddress)

func (Keeper) BurnCoinsFromBuyBackLiquidityFund

func (k Keeper) BurnCoinsFromBuyBackLiquidityFund(ctx sdk.Context, amount sdk.Coins) error

func (Keeper) BurnFromDistributionProfits

func (k Keeper) BurnFromDistributionProfits(ctx sdk.Context, amount sdk.Coins) error

func (Keeper) BuyBackPercentage

func (k Keeper) BuyBackPercentage(ctx sdk.Context) (res sdk.Dec)

func (Keeper) CalculateDinAmount

func (k Keeper) CalculateDinAmount(ctx sdk.Context, pinCoins sdk.Coins) sdk.Coins

func (Keeper) CalculateDinAmountExtended

func (k Keeper) CalculateDinAmountExtended(ctx sdk.Context, pinCoins sdk.Coins) sdk.Coins

Returns the Din amount for input Pin taking in to account Treasury BuyBack

func (Keeper) CalculatePinAmount

func (k Keeper) CalculatePinAmount(ctx sdk.Context, dinCoins sdk.Coins) sdk.Coins

func (Keeper) CalculatePinAmountExtended

func (k Keeper) CalculatePinAmountExtended(ctx sdk.Context, dinCoins sdk.Coins) (total sdk.Coins, pinFromBuyBack sdk.Coins, pinFromTreasury sdk.Coins)

Returns the Pin amount for input Din taking in to account Treasury BuyBack

func (Keeper) CoinsPerStage

func (k Keeper) CoinsPerStage(ctx sdk.Context) sdk.Int

func (Keeper) DisburseFunds

func (k Keeper) DisburseFunds(ctx sdk.Context, operator sdk.AccAddress, recipient sdk.AccAddress, dinAmount sdk.Coins, fromBuyBack sdk.Coins, fromTreasury sdk.Coins) error

func (Keeper) DisburseFundsFromEscrow

func (k Keeper) DisburseFundsFromEscrow(ctx sdk.Context, reference string, amount sdk.Int, recipient sdk.AccAddress) error

func (Keeper) DisburseFundsToEscrow

func (k Keeper) DisburseFundsToEscrow(ctx sdk.Context, reference string, dinAmount sdk.Coins, fromBuyBack sdk.Coins, fromTreasury sdk.Coins) error

func (Keeper) DisbursementQueueIterator

func (keeper Keeper) DisbursementQueueIterator(ctx sdk.Context) sdk.Iterator

func (Keeper) DistributedFromTreasury

func (k Keeper) DistributedFromTreasury(ctx sdk.Context) sdk.Int

func (Keeper) GetDisbursementReferenceAmount

func (k Keeper) GetDisbursementReferenceAmount(ctx sdk.Context, reference string) (bool, sdk.Int)

func (Keeper) GetDisbursementReferenceIterator

func (k Keeper) GetDisbursementReferenceIterator(ctx sdk.Context) sdk.Iterator

func (Keeper) GetDisbursements

func (k Keeper) GetDisbursements(ctx sdk.Context) []types.Disbursement

func (Keeper) GetOperatorIterator

func (k Keeper) GetOperatorIterator(ctx sdk.Context) sdk.Iterator

func (Keeper) GetOperators

func (k Keeper) GetOperators(ctx sdk.Context) []sdk.AccAddress

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

func (Keeper) GetPriceForStage

func (k Keeper) GetPriceForStage(ctx sdk.Context, stage sdk.Int) sdk.Int

returned amount is $0.0000000001 per PIN

func (Keeper) GetStageFromDistribution

func (k Keeper) GetStageFromDistribution(ctx sdk.Context, distribution sdk.Int) sdk.Int

func (Keeper) GetTreasury

func (k Keeper) GetTreasury(ctx sdk.Context) (minter types.Treasury)

func (Keeper) HandleAddOperator

func (k Keeper) HandleAddOperator(ctx sdk.Context, sender sdk.AccAddress, operator sdk.AccAddress) error

func (Keeper) HandleCancelDisbursement

func (k Keeper) HandleCancelDisbursement(ctx sdk.Context, manager sdk.AccAddress, recipient sdk.AccAddress, scheduledFor time.Time) error

func (Keeper) HandleCreateBuyOrder

func (k Keeper) HandleCreateBuyOrder(ctx sdk.Context, buyer sdk.AccAddress, dinAmount sdk.Coins) error

func (Keeper) HandleCreateSellOrder

func (k Keeper) HandleCreateSellOrder(ctx sdk.Context, sender sdk.AccAddress, pinAmount sdk.Coins) error

func (Keeper) HandleDisburse

func (k Keeper) HandleDisburse(ctx sdk.Context, operator sdk.AccAddress, recipient sdk.AccAddress, dinAmount sdk.Coins, reference string) error

func (Keeper) HandleDisburseFromEscrow

func (k Keeper) HandleDisburseFromEscrow(ctx sdk.Context, operator sdk.AccAddress, reference string, recipient sdk.AccAddress) error

func (Keeper) HandleDisburseToEscrow

func (k Keeper) HandleDisburseToEscrow(ctx sdk.Context, operator sdk.AccAddress, dinAmount sdk.Coins, reference string) error

func (Keeper) HandleRemoveOperator

func (k Keeper) HandleRemoveOperator(ctx sdk.Context, sender sdk.AccAddress, operator sdk.AccAddress) error

func (Keeper) HandleRevertFromEscrow

func (k Keeper) HandleRevertFromEscrow(ctx sdk.Context, operator sdk.AccAddress, amount sdk.Coins, reference string) error

func (Keeper) HasDisbursementInQueue

func (keeper Keeper) HasDisbursementInQueue(ctx sdk.Context, recipient sdk.AccAddress, scheduledFor time.Time) bool

func (Keeper) InsertDisbursementQueue

func (keeper Keeper) InsertDisbursementQueue(ctx sdk.Context, disbursement types.Disbursement)

func (Keeper) IsDisbursementReferenceSet

func (k Keeper) IsDisbursementReferenceSet(ctx sdk.Context, reference string) bool

func (Keeper) IsManager

func (k Keeper) IsManager(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IsOperator

func (k Keeper) IsOperator(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IterateDisbursementQueue

func (k Keeper) IterateDisbursementQueue(ctx sdk.Context, cb func(disbursement types.Disbursement) (stop bool))

func (Keeper) IterateDisbursementReferences

func (k Keeper) IterateDisbursementReferences(ctx sdk.Context, cb func(reference string, amount sdk.Int) (stop bool))

func (Keeper) IterateOperators

func (k Keeper) IterateOperators(ctx sdk.Context, cb func(address sdk.AccAddress) (stop bool))

func (Keeper) IterateScheduledDisbursementQueue

func (k Keeper) IterateScheduledDisbursementQueue(ctx sdk.Context, endTime time.Time, cb func(disbursement types.Disbursement) (stop bool))

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) Managers

func (k Keeper) Managers(ctx sdk.Context) (res []sdk.AccAddress)

func (Keeper) MintCoins

func (k Keeper) MintCoins(ctx sdk.Context, newCoins sdk.Coins) error

func (Keeper) MintCoinsToBuyBackLiquidityFund

func (k Keeper) MintCoinsToBuyBackLiquidityFund(ctx sdk.Context, newCoins sdk.Coins) error

func (Keeper) RemainingPinInStage

func (k Keeper) RemainingPinInStage(ctx sdk.Context, stage sdk.Int, cannonicalStage sdk.Int) sdk.Int

func (Keeper) RemoveDisbursementReferenceAmount

func (k Keeper) RemoveDisbursementReferenceAmount(ctx sdk.Context, reference string)

func (Keeper) RemoveFromDisbursementQueue

func (keeper Keeper) RemoveFromDisbursementQueue(ctx sdk.Context, address sdk.AccAddress, endTime time.Time)

func (Keeper) RemoveOperator

func (k Keeper) RemoveOperator(ctx sdk.Context, address sdk.AccAddress)

func (Keeper) RiskAssessmentAmount

func (k Keeper) RiskAssessmentAmount(ctx sdk.Context) (res sdk.Coins)

func (Keeper) RiskAssessmentDuration

func (k Keeper) RiskAssessmentDuration(ctx sdk.Context) (res time.Duration)

func (Keeper) ScheduledDisbursementQueueIterator

func (keeper Keeper) ScheduledDisbursementQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

func (Keeper) SetDisbursementReferenceAmount

func (k Keeper) SetDisbursementReferenceAmount(ctx sdk.Context, reference string, amount sdk.Int)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

func (Keeper) SetTreasury

func (k Keeper) SetTreasury(ctx sdk.Context, minter types.Treasury)

func (Keeper) TotalSupply

func (k Keeper) TotalSupply(ctx sdk.Context) sdk.Coins

func (Keeper) TransferFromBuyBackFund

func (k Keeper) TransferFromBuyBackFund(ctx sdk.Context, recipient sdk.AccAddress, amount sdk.Coins) error

func (Keeper) TransferFromDistributionProfitsToBuyBackLiquidity

func (k Keeper) TransferFromDistributionProfitsToBuyBackLiquidity(ctx sdk.Context, amount sdk.Coins) error

func (Keeper) TransferToBuyBackFund

func (k Keeper) TransferToBuyBackFund(ctx sdk.Context, sender sdk.AccAddress, amount sdk.Coins) error

Jump to

Keyboard shortcuts

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