keeper

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyDelimiter   = []byte(":")
	KeyNextIssueID = []byte("newIssueID")
)

Key for getting a the next available proposalID from the store

View Source
var (
	ParamStoreKeyIssueParams = []byte("issueparams")
)

Parameter store key

Functions

func KeyAddressIssues

func KeyAddressIssues(addr string) []byte

Key for getting a specific address from the store

func KeyIssueIdStr

func KeyIssueIdStr(seq uint64) string

func KeyIssuer

func KeyIssuer(issueIdStr string) []byte
func BytesString(b []byte) string {
	return *(*string)(unsafe.Pointer(&b))
}

Key for getting a specific issuer from the store

func KeySymbolIssues

func KeySymbolIssues(symbol string) []byte

Key for getting a specific symbol from the store

func ParamKeyTable

func ParamKeyTable() params.KeyTable

Key declaration for parameters

Types

type BankKeeper

type BankKeeper interface {
	GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Tags, sdk.Error)
	SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Tags, sdk.Error)
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.Tags, sdk.Error)
}

expected bank keeper

type Keeper

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

Issue Keeper

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramsKeeper params.Keeper,
	paramSpace params.Subspace, ck BankKeeper, codespace sdk.CodespaceType) Keeper

New issue keeper Instance

func (Keeper) AddIssue

func (keeper Keeper) AddIssue(ctx sdk.Context, coinIssueInfo *types.CoinIssueInfo) (sdk.Coins, sdk.Tags, sdk.Error)

Add a issue

func (Keeper) Burn

func (keeper Keeper) Burn(ctx sdk.Context, issueID string, amount sdk.Int, operator sdk.AccAddress) (sdk.Coins, sdk.Tags, sdk.Error)

Burn a coin

func (Keeper) BurnAnyOff

func (keeper Keeper) BurnAnyOff(ctx sdk.Context, operator sdk.AccAddress, issueID string) sdk.Error

BurnAnyOff a coin

func (Keeper) BurnFrom

func (keeper Keeper) BurnFrom(ctx sdk.Context, issueID string, amount sdk.Int, operator sdk.AccAddress, burnfrom sdk.AccAddress) (sdk.Coins, sdk.Tags, sdk.Error)

Burn a coin from address

func (Keeper) BurnFromOff

func (keeper Keeper) BurnFromOff(ctx sdk.Context, operator sdk.AccAddress, issueID string) sdk.Error

BurnFromOff a coin

func (Keeper) BurnOff

func (keeper Keeper) BurnOff(ctx sdk.Context, operator sdk.AccAddress, issueID string) sdk.Error

BurnOff a coin

func (Keeper) CanMint

func (keeper Keeper) CanMint(ctx sdk.Context, issueID string) bool

Can mint a coin

func (Keeper) FinishMinting

func (keeper Keeper) FinishMinting(ctx sdk.Context, operator sdk.AccAddress, issueID string) sdk.Error

Finished Minting a coin

func (Keeper) GetAddressIssues

func (keeper Keeper) GetAddressIssues(ctx sdk.Context, accAddress string) (issueIDs []string)

Get address from a issue

func (Keeper) GetIssue

func (keeper Keeper) GetIssue(ctx sdk.Context, issueID string) *types.CoinIssueInfo

Returns issue by issueID

func (Keeper) GetIssueConfigParams

func (keeper Keeper) GetIssueConfigParams(ctx sdk.Context) issueparams.IssueConfigParams

Params Returns the current issueConfigParams from the global param store

func (Keeper) GetIssues

func (keeper Keeper) GetIssues(ctx sdk.Context, accAddress string) []*types.CoinIssueInfo

Returns issues by accAddress

func (Keeper) GetLastIssueID

func (keeper Keeper) GetLastIssueID(ctx sdk.Context) (issueID uint64)

Get the last used issueID

func (Keeper) GetSymbolIssues

func (keeper Keeper) GetSymbolIssues(ctx sdk.Context, symbol string) (issueIDs []string)

Get issueIDs from a issue

func (Keeper) Getcdc

func (keeper Keeper) Getcdc() *codec.Codec

Get issue codec

func (Keeper) List

func (keeper Keeper) List(ctx sdk.Context, params issueparams.IssueQueryParams) []*types.CoinIssueInfo

func (Keeper) Mint

func (keeper Keeper) Mint(ctx sdk.Context, issueID string, amount sdk.Int, operator sdk.AccAddress, to sdk.AccAddress) (sdk.Coins, sdk.Tags, sdk.Error)

Mint a coin

func (Keeper) PeekCurrentIssueID

func (keeper Keeper) PeekCurrentIssueID(ctx sdk.Context) (issueID uint64, err sdk.Error)

Peeks the next available IssueID without incrementing it

func (Keeper) SearchIssues

func (keeper Keeper) SearchIssues(ctx sdk.Context, symbol string) []*types.CoinIssueInfo

func (Keeper) SendCoins

func (keeper Keeper) SendCoins(ctx sdk.Context,
	fromAddr sdk.AccAddress, toAddr sdk.AccAddress,
	amt sdk.Coins) (sdk.Tags, sdk.Error)

Send coins

func (Keeper) SetInitialIssueStartingIssueId

func (keeper Keeper) SetInitialIssueStartingIssueId(ctx sdk.Context, issueID uint64) sdk.Error

Set the initial issueCount

func (Keeper) SetIssueConfigParams

func (keeper Keeper) SetIssueConfigParams(ctx sdk.Context, issueConfigParams issueparams.IssueConfigParams)

Set issueConfigParams

func (Keeper) SetIssueDescription

func (keeper Keeper) SetIssueDescription(ctx sdk.Context, issueID string, operator sdk.AccAddress, description []byte) sdk.Error

func (Keeper) TransferOwnership

func (keeper Keeper) TransferOwnership(ctx sdk.Context, issueID string, operator sdk.AccAddress, to sdk.AccAddress) sdk.Error

TransferOwnership

Jump to

Keyboard shortcuts

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