keeper

package
v0.15.1 Latest Latest
Warning

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

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

Documentation

Overview

nolint

Index

Constants

View Source
const (
	FeeFactorBase = 3
	FeeFactorExp  = 4
)

fee factor formula: (ln(len({name}))/ln{base})^{exp}

Variables

View Source
var (
	PrefixGateway = []byte("gateways:") // prefix for the gateway store
	PrefixToken   = []byte("token:")    // prefix for the token store
)

Functions

func GatewayCreateFeeHandler

func GatewayCreateFeeHandler(ctx sdk.Context, k Keeper, owner sdk.AccAddress, moniker string) sdk.Error

GatewayCreateFeeHandler performs fee handling for creating a gateway

func GatewayTokenIssueFeeHandler

func GatewayTokenIssueFeeHandler(ctx sdk.Context, k Keeper, owner sdk.AccAddress, symbol string) sdk.Error

GatewayTokenIssueFeeHandler performs fee handling for issuing gateway token

func GatewayTokenMintFeeHandler

func GatewayTokenMintFeeHandler(ctx sdk.Context, k Keeper, owner sdk.AccAddress, symbol string) sdk.Error

GatewayTokenMintFeeHandler performs fee handling for minting gateway token

func GetGatewayCreateFee

func GetGatewayCreateFee(ctx sdk.Context, k Keeper, moniker string) sdk.Coin

GetGatewayCreateFee returns the gateway creation fee

func GetGatewayTokenIssueFee

func GetGatewayTokenIssueFee(ctx sdk.Context, k Keeper, symbol string) sdk.Coin

getGatewayTokenIssueFee returns the gateway token issurance fee

func GetGatewayTokenMintFee

func GetGatewayTokenMintFee(ctx sdk.Context, k Keeper, symbol string) sdk.Coin

getGatewayTokenMintFee returns the gateway token mint fee

func GetTokenIssueFee

func GetTokenIssueFee(ctx sdk.Context, k Keeper, symbol string) sdk.Coin

getTokenIssueFee returns the token issurance fee

func GetTokenMintFee

func GetTokenMintFee(ctx sdk.Context, k Keeper, symbol string) sdk.Coin

getTokenMintFee returns the token mint fee

func KeyGateway

func KeyGateway(moniker string) []byte

KeyGateway returns the key of the specified moniker

func KeyGatewaysSubspace

func KeyGatewaysSubspace(owner sdk.AccAddress) []byte

KeyGatewaysSubspace returns the key prefix for iterating on all gateways of an owner

func KeyOwnerGateway

func KeyOwnerGateway(owner sdk.AccAddress, moniker string) []byte

KeyOwnerGateway returns the key of the specifed owner and moniker. Intended for querying all gateways of an owner

func KeyToken

func KeyToken(tokenId string) []byte

KeyToken returns the key of the specified token source and id

func KeyTokens

func KeyTokens(owner sdk.AccAddress, tokenId string) []byte

KeyTokens returns the key of the specifed owner and token id. Intended for querying all tokens of an owner

func NewAnteHandler

func NewAnteHandler(k Keeper) sdk.AnteHandler

NewAnteHandler returns an AnteHandler that checks if the balance of the fee payer is sufficient for asset related fee

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

func TokenIssueFeeHandler

func TokenIssueFeeHandler(ctx sdk.Context, k Keeper, owner sdk.AccAddress, symbol string) sdk.Error

TokenIssueFeeHandler performs fee handling for issuing token

func TokenMintFeeHandler

func TokenMintFeeHandler(ctx sdk.Context, k Keeper, owner sdk.AccAddress, symbol string) sdk.Error

TokenMintFeeHandler performs fee handling for minting token

Types

type Keeper

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

func NewKeeper

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

func (Keeper) AddToken

save a new token to keystore

func (Keeper) Codespace

func (k Keeper) Codespace() sdk.CodespaceType

return the codespace

func (Keeper) CreateGateway

func (k Keeper) CreateGateway(ctx sdk.Context, msg types.MsgCreateGateway) (sdk.Tags, sdk.Error)

CreateGateway creates a gateway

func (Keeper) EditGateway

func (k Keeper) EditGateway(ctx sdk.Context, msg types.MsgEditGateway) (sdk.Tags, sdk.Error)

EditGateway edits the specified gateway

func (Keeper) EditToken

func (k Keeper) EditToken(ctx sdk.Context, msg types.MsgEditToken) (sdk.Tags, sdk.Error)

EditToken edits the specified token

func (Keeper) GetGateway

func (k Keeper) GetGateway(ctx sdk.Context, moniker string) (types.Gateway, sdk.Error)

GetGateway retrieves the gateway of the given moniker

func (Keeper) GetGateways

func (k Keeper) GetGateways(ctx sdk.Context, owner sdk.AccAddress) sdk.Iterator

GetGateways retrieves all the gateways of the given owner

func (Keeper) GetParamSet

func (k Keeper) GetParamSet(ctx sdk.Context) types.Params

get asset params from the global param store

func (Keeper) HasGateway

func (k Keeper) HasGateway(ctx sdk.Context, moniker string) bool

HasGateway checks if the given gateway exists. Return true if exists, false otherwise

func (Keeper) HasToken

func (k Keeper) HasToken(ctx sdk.Context, tokenId string) bool

func (Keeper) Init

func (k Keeper) Init(ctx sdk.Context)

func (Keeper) IssueToken

func (k Keeper) IssueToken(ctx sdk.Context, token types.FungibleToken) (sdk.Tags, sdk.Error)

IssueToken issue a new token

func (Keeper) IterateGateways

func (k Keeper) IterateGateways(ctx sdk.Context, op func(gateway types.Gateway) (stop bool))

IterateGateways iterates through all existing gateways

func (Keeper) IterateTokens

func (k Keeper) IterateTokens(ctx sdk.Context, op func(token types.FungibleToken) (stop bool))

IterateTokens iterates through all existing tokens

func (Keeper) MintToken

func (k Keeper) MintToken(ctx sdk.Context, msg types.MsgMintToken) (sdk.Tags, sdk.Error)

func (Keeper) SetGateway

func (k Keeper) SetGateway(ctx sdk.Context, gateway types.Gateway)

SetGateway stores the given gateway into the underlying storage

func (Keeper) SetOwnerGateway

func (k Keeper) SetOwnerGateway(ctx sdk.Context, owner sdk.AccAddress, moniker string)

SetOwnerGateway stores the gateway moniker into storage by the key KeyOwnerGateway. Intended for iteration on gateways of an owner

func (Keeper) SetParamSet

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

set asset params from the global param store

func (Keeper) SetToken

func (k Keeper) SetToken(ctx sdk.Context, token types.FungibleToken) sdk.Error

func (Keeper) SetTokens

func (k Keeper) SetTokens(ctx sdk.Context, owner sdk.AccAddress, token types.FungibleToken) sdk.Error

func (Keeper) TransferGatewayOwner

func (k Keeper) TransferGatewayOwner(ctx sdk.Context, msg types.MsgTransferGatewayOwner) (sdk.Tags, sdk.Error)

TransferGatewayOwner transfers the owner of the specified gateway to a new one

func (Keeper) TransferTokenOwner

func (k Keeper) TransferTokenOwner(ctx sdk.Context, msg types.MsgTransferTokenOwner) (sdk.Tags, sdk.Error)

TransferTokenOwner transfers the owner of the specified token to a new one

func (Keeper) UpdateOwnerGateway

func (k Keeper) UpdateOwnerGateway(ctx sdk.Context, moniker string, originOwner, newOwner sdk.AccAddress)

UpdateOwnerGateway updates the KeyOwnerGateway key of the given moniker from an owner to another

Jump to

Keyboard shortcuts

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