keeper

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Key for getting a the next available proposalID from the store

Functions

func KeyAddressIssues

func KeyAddressIssues(addr string) []byte

Key for getting a specific address from the store

func KeyAllowed added in v0.5.0

func KeyAllowed(issueID string, sender sdk.AccAddress, spender sdk.AccAddress) []byte

Key for getting a specific allowed from the store

func KeyFreeze added in v0.5.0

func KeyFreeze(issueID string, accAddress sdk.AccAddress) []byte

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

func PrefixFreeze added in v0.6.0

func PrefixFreeze(issueID string) []byte

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.Error)
	SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error)
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
}

expected bank keeper

type FeeCollectionKeeper added in v0.6.0

type FeeCollectionKeeper interface {
	AddCollectedFees(ctx sdk.Context, coins sdk.Coins) sdk.Coins
}

expected fee collection keeper

type Hooks added in v0.6.0

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

Wrapper struct

func (Hooks) CanSend added in v0.6.0

func (hooks Hooks) CanSend(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) (bool, sdk.Error)

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, feeCollectionKeeper FeeCollectionKeeper, codespace sdk.CodespaceType) Keeper

New issue keeper Instance

func (Keeper) AddIssue

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

Keys add Add a issue

func (Keeper) Allowance added in v0.5.0

func (keeper Keeper) Allowance(ctx sdk.Context, owner sdk.AccAddress, spender sdk.AccAddress, issueID string) (amount sdk.Int)

Get the amount of tokens that an owner allowed to a spender

func (Keeper) Approve added in v0.5.0

func (keeper Keeper) Approve(ctx sdk.Context, sender sdk.AccAddress, spender sdk.AccAddress, issueID string, amount sdk.Int) sdk.Error

Approve the passed address to spend the specified amount of tokens on behalf of sender

func (Keeper) BurnFrom

func (keeper Keeper) BurnFrom(ctx sdk.Context, issueID string, amount sdk.Int, sender sdk.AccAddress, who sdk.AccAddress) (sdk.Coins, sdk.Error)

func (Keeper) BurnHolder added in v0.5.0

func (keeper Keeper) BurnHolder(ctx sdk.Context, issueID string, amount sdk.Int, sender sdk.AccAddress) (sdk.Coins, sdk.Error)

Burn a coin

func (Keeper) BurnOwner added in v0.5.0

func (keeper Keeper) BurnOwner(ctx sdk.Context, issueID string, amount sdk.Int, sender sdk.AccAddress) (sdk.Coins, sdk.Error)

func (Keeper) CanMint

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

Can mint a coin

func (Keeper) CheckFreeze added in v0.6.0

func (keeper Keeper) CheckFreeze(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, issueID string) sdk.Error

func (Keeper) CreateIssue added in v0.6.0

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

Create a issue

func (Keeper) DecreaseApproval added in v0.5.0

func (keeper Keeper) DecreaseApproval(ctx sdk.Context, sender sdk.AccAddress, spender sdk.AccAddress, issueID string, subtractedValue sdk.Int) sdk.Error

Decrease the amount of tokens that an owner allowed to a spender

func (Keeper) DisableFeature added in v0.5.0

func (keeper Keeper) DisableFeature(ctx sdk.Context, sender sdk.AccAddress, issueID string, feature string) sdk.Error

func (Keeper) Fee added in v0.6.0

func (keeper Keeper) Fee(ctx sdk.Context, sender sdk.AccAddress, fee sdk.Coin) sdk.Error

func (Keeper) Freeze added in v0.5.0

func (keeper Keeper) Freeze(ctx sdk.Context, issueID string, sender sdk.AccAddress, accAddress sdk.AccAddress, freezeType string, endTime int64) sdk.Error

func (Keeper) GetAddressIssues

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

Get address from a issue

func (Keeper) GetBankKeeper added in v0.6.0

func (keeper Keeper) GetBankKeeper() BankKeeper

Get box bankKeeper

func (Keeper) GetFeeCollectionKeeper added in v0.6.0

func (keeper Keeper) GetFeeCollectionKeeper() FeeCollectionKeeper

Get box feeCollectionKeeper

func (Keeper) GetFreeze added in v0.5.0

func (keeper Keeper) GetFreeze(ctx sdk.Context, accAddress sdk.AccAddress, issueID string) types.IssueFreeze

func (Keeper) GetFreezes added in v0.6.0

func (keeper Keeper) GetFreezes(ctx sdk.Context, issueID string) []types.IssueAddressFreeze

func (Keeper) GetIssue

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

Returns issue by issueID

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) GetParams added in v0.6.0

func (ak Keeper) GetParams(ctx sdk.Context) (params config.Params)

GetParams gets the auth module's parameters.

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) Hooks added in v0.6.0

func (keeper Keeper) Hooks() Hooks

Create new box hooks

func (Keeper) IncreaseApproval added in v0.5.0

func (keeper Keeper) IncreaseApproval(ctx sdk.Context, sender sdk.AccAddress, spender sdk.AccAddress, issueID string, addedValue sdk.Int) sdk.Error

Increase the amount of tokens that an owner allowed to a spender

func (Keeper) Iterator added in v0.6.0

func (keeper Keeper) Iterator(ctx sdk.Context, startIssueId string) sdk.Iterator

func (Keeper) List

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

func (Keeper) ListAll added in v0.6.0

func (keeper Keeper) ListAll(ctx sdk.Context) []types.CoinIssueInfo

func (Keeper) Mint

func (keeper Keeper) Mint(ctx sdk.Context, issueID string, amount sdk.Int, sender sdk.AccAddress, to sdk.AccAddress) (sdk.Coins, 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.Error

Send coins

func (Keeper) SendFrom added in v0.5.0

func (keeper Keeper) SendFrom(ctx sdk.Context, sender sdk.AccAddress, from sdk.AccAddress, to sdk.AccAddress, issueID string, amount sdk.Int) sdk.Error

Transfer tokens from one address to another

func (Keeper) SetInitialIssueStartingIssueId

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

Set the initial issueCount

func (Keeper) SetIssueDescription

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

func (Keeper) SetParams added in v0.6.0

func (ak Keeper) SetParams(ctx sdk.Context, params config.Params)

SetParams sets the auth module's parameters.

func (Keeper) TransferOwnership

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

TransferOwnership

func (Keeper) UnFreeze added in v0.5.0

func (keeper Keeper) UnFreeze(ctx sdk.Context, issueID string, sender sdk.AccAddress, accAddress sdk.AccAddress, freezeType string) sdk.Error

Jump to

Keyboard shortcuts

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