swapservice

package
v0.0.0-...-2eee87b Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = types.ModuleName
	RouterKey  = types.RouterKey
	StoreKey   = types.StoreKey
)
View Source
const (
	QueryPoolStruct  = "poolstruct"
	QueryPoolDatas   = "pooldatas"
	QueryAccStruct   = "accstruct"
	QueryAccDatas    = "accdatas"
	QueryStakeStruct = "stakestruct"
	QueryStakeDatas  = "stakedatas"
)

query endpoints supported by the swapservice Querier

Variables

View Source
var (
	NewMsgSetPoolData  = types.NewMsgSetPoolData
	NewPoolStruct      = types.NewPoolStruct
	NewMsgSetAccData   = types.NewMsgSetAccData
	NewAccStruct       = types.NewAccStruct
	NewMsgSetStakeData = types.NewMsgSetStakeData
	NewStakeStruct     = types.NewStakeStruct
	NewMsgSwap         = types.NewMsgSwap
	ModuleCdc          = types.ModuleCdc
	RegisterCodec      = types.RegisterCodec
)

Functions

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) []abci.ValidatorUpdate

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

NewHandler returns a handler for "swapservice" type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type AccStake

type AccStake = types.AccStake

type AccStruct

type AccStruct = types.AccStruct

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(k Keeper, bankKeeper bank.Keeper) AppModule

NewAppModule creates a new AppModule Object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) sdk.Tags

func (AppModule) EndBlock

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

func (AppModule) Name

func (AppModule) Name() string

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRouter)

func (AppModule) Route

func (am AppModule) Route() string

type AppModuleBasic

type AppModuleBasic struct{}

app module Basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

Get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

Get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router, cdc *codec.Codec)

Register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

Validation check of the Genesis

type GenesisState

type GenesisState struct {
	PoolStructRecords []PoolStruct `json:"poolstruct_records"`
	AccStructRecords  []AccStruct  `json:"accstruct_records"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState

func NewGenesisState

func NewGenesisState(pools []PoolStruct, accs []AccStruct) GenesisState

type Holding

type Holding = types.Holding

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(coinKeeper bank.Keeper, storeKey sdk.StoreKey, cdc *codec.Codec) Keeper

NewKeeper creates new instances of the swapservice Keeper

func (Keeper) GetAccData

func (k Keeper) GetAccData(ctx sdk.Context, accID, ticker string) string

func (Keeper) GetAccStruct

func (k Keeper) GetAccStruct(ctx sdk.Context, accID string) AccStruct

Gets the entire AccStruct metadata struct for a acc ID

func (Keeper) GetDatasIterator

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

Get an iterator over all pool IDs in which the keys are the pool IDs and the values are the poolstruct

func (Keeper) GetPoolData

func (k Keeper) GetPoolData(ctx sdk.Context, poolID, ticker string) (string, string)

GetPool - gets the balances of a pool. Specifying ticker dictates which balance is return in 0 vs 1 spot.

func (Keeper) GetPoolStruct

func (k Keeper) GetPoolStruct(ctx sdk.Context, poolID string) PoolStruct

Gets the entire PoolStruct metadata struct for a pool ID

func (Keeper) GetStakeData

func (k Keeper) GetStakeData(ctx sdk.Context, stakeID, name string) AccStake

Get stake data for a specific user

func (Keeper) GetStakeStruct

func (k Keeper) GetStakeStruct(ctx sdk.Context, stakeID string) StakeStruct

Gets the entire StakeStruct metadata struct for a stake ID

func (Keeper) SetAccData

func (k Keeper) SetAccData(ctx sdk.Context, accID string, name, ticker, amount string)

SetAccData - sets the value string that a acc ID resolves to

func (Keeper) SetAccStruct

func (k Keeper) SetAccStruct(ctx sdk.Context, accID string, accstruct AccStruct)

Sets the entire AccStruct metadata struct for a acc ID

func (Keeper) SetBalances

func (k Keeper) SetBalances(ctx sdk.Context, poolID, atom, token string)

SetBalances - sets the current balances of a pool

func (Keeper) SetPoolData

func (k Keeper) SetPoolData(ctx sdk.Context, poolID string, tokenName, ticker, balanceAtom, balanceToken string)

SetPoolData - sets the value string that a pool ID resolves to

func (Keeper) SetPoolStruct

func (k Keeper) SetPoolStruct(ctx sdk.Context, poolID string, poolstruct PoolStruct)

Sets the entire PoolStruct metadata struct for a pool ID

func (Keeper) SetStakeData

func (k Keeper) SetStakeData(ctx sdk.Context, stakeID string, name, atom, token string)

SetStakeData - sets the value string that a stake ID resolves to

func (Keeper) SetStakeStruct

func (k Keeper) SetStakeStruct(ctx sdk.Context, stakeID string, stakestruct StakeStruct)

Sets the entire StakeStruct metadata struct for a stake ID

type MsgSetAccData

type MsgSetAccData = types.MsgSetAccData

type MsgSetPoolData

type MsgSetPoolData = types.MsgSetPoolData

type MsgSetStakeData

type MsgSetStakeData = types.MsgSetStakeData

type MsgSwap

type MsgSwap = types.MsgSwap

type PoolStruct

type PoolStruct = types.PoolStruct

type QueryResAccDatas

type QueryResAccDatas = types.QueryResAccDatas

type QueryResPoolDatas

type QueryResPoolDatas = types.QueryResPoolDatas

type QueryResResolve

type QueryResResolve = types.QueryResResolve

type QueryResStakeDatas

type QueryResStakeDatas = types.QueryResStakeDatas

type StakeStruct

type StakeStruct = types.StakeStruct

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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