Documentation ¶
Index ¶
- Constants
- Variables
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) []abci.ValidatorUpdate
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func ValidateGenesis(data GenesisState) error
- type AccStake
- type AccStruct
- type AppModule
- func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) sdk.Tags
- func (am AppModule) EndBlock(sdk.Context, abci.RequestEndBlock) ([]abci.ValidatorUpdate, sdk.Tags)
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRouter)
- func (am AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router, cdc *codec.Codec)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type GenesisState
- type Holding
- type Keeper
- func (k Keeper) GetAccData(ctx sdk.Context, accID, ticker string) string
- func (k Keeper) GetAccStruct(ctx sdk.Context, accID string) AccStruct
- func (k Keeper) GetDatasIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetPoolData(ctx sdk.Context, poolID, ticker string) (string, string)
- func (k Keeper) GetPoolStruct(ctx sdk.Context, poolID string) PoolStruct
- func (k Keeper) GetStakeData(ctx sdk.Context, stakeID, name string) AccStake
- func (k Keeper) GetStakeStruct(ctx sdk.Context, stakeID string) StakeStruct
- func (k Keeper) SetAccData(ctx sdk.Context, accID string, name, ticker, amount string)
- func (k Keeper) SetAccStruct(ctx sdk.Context, accID string, accstruct AccStruct)
- func (k Keeper) SetBalances(ctx sdk.Context, poolID, atom, token string)
- func (k Keeper) SetPoolData(ctx sdk.Context, poolID string, ...)
- func (k Keeper) SetPoolStruct(ctx sdk.Context, poolID string, poolstruct PoolStruct)
- func (k Keeper) SetStakeData(ctx sdk.Context, stakeID string, name, atom, token string)
- func (k Keeper) SetStakeStruct(ctx sdk.Context, stakeID string, stakestruct StakeStruct)
- type MsgSetAccData
- type MsgSetPoolData
- type MsgSetStakeData
- type MsgSwap
- type PoolStruct
- type QueryResAccDatas
- type QueryResPoolDatas
- type QueryResResolve
- type QueryResStakeDatas
- type StakeStruct
Constants ¶
const ( ModuleName = types.ModuleName RouterKey = types.RouterKey StoreKey = types.StoreKey )
const ( QueryPoolStruct = "poolstruct" QueryPoolDatas = "pooldatas" QueryAccStruct = "accstruct" QueryAccDatas = "accdatas" QueryStakeStruct = "stakestruct" QueryStakeDatas = "stakedatas" )
query endpoints supported by the swapservice Querier
Variables ¶
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 ¶
NewHandler returns a handler for "swapservice" type messages.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
func NewAppModule ¶
NewAppModule creates a new AppModule Object
func (AppModule) BeginBlock ¶
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(sdk.Context, abci.RequestEndBlock) ([]abci.ValidatorUpdate, sdk.Tags)
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) NewHandler ¶
func (AppModule) NewQuerierHandler ¶
func (AppModule) QuerierRoute ¶
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRouter)
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 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 (Keeper) GetAccStruct ¶
Gets the entire AccStruct metadata struct for a acc ID
func (Keeper) GetDatasIterator ¶
Get an iterator over all pool IDs in which the keys are the pool IDs and the values are the poolstruct
func (Keeper) GetPoolData ¶
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 ¶
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 ¶
SetAccData - sets the value string that a acc ID resolves to
func (Keeper) SetAccStruct ¶
Sets the entire AccStruct metadata struct for a acc ID
func (Keeper) SetBalances ¶
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 ¶
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 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