Documentation ¶
Index ¶
- Constants
- func ErrAccountNotFound() sdk.Error
- func ErrDeveloperAlreadyExist(username types.AccountKey) sdk.Error
- func ErrDeveloperNotFound() sdk.Error
- func ErrGrantPermissionTooHigh() sdk.Error
- func ErrInsufficientDeveloperDeposit() sdk.Error
- func ErrInvalidAppMetadata() sdk.Error
- func ErrInvalidAuthorizedApp() sdk.Error
- func ErrInvalidDescription() sdk.Error
- func ErrInvalidGrantPermission() sdk.Error
- func ErrInvalidUsername() sdk.Error
- func ErrInvalidValidityPeriod() sdk.Error
- func ErrInvalidWebsite() sdk.Error
- func ErrQueryFailed() sdk.Error
- func InitGlobalManager(ctx sdk.Context, gm global.GlobalManager) error
- func NewHandler(dm DeveloperManager, am acc.AccountManager, gm *global.GlobalManager) sdk.Handler
- func NewQuerier(dm DeveloperManager) sdk.Querier
- func RegisterWire(cdc *wire.Codec)
- type DeveloperManager
- func (dm DeveloperManager) AddToDeveloperList(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (dm DeveloperManager) ClearConsumption(ctx sdk.Context) sdk.Error
- func (dm DeveloperManager) DoesDeveloperExist(ctx sdk.Context, username types.AccountKey) bool
- func (dm DeveloperManager) Export(ctx sdk.Context) *model.DeveloperTables
- func (dm DeveloperManager) GetConsumptionWeight(ctx sdk.Context, username types.AccountKey) (sdk.Dec, sdk.Error)
- func (dm DeveloperManager) GetDeveloperList(ctx sdk.Context) (*model.DeveloperList, sdk.Error)
- func (dm DeveloperManager) Import(ctx sdk.Context, tb *model.DeveloperTablesIR)
- func (dm DeveloperManager) InitGenesis(ctx sdk.Context) error
- func (dm DeveloperManager) RegisterDeveloper(ctx sdk.Context, username types.AccountKey, deposit types.Coin, ...) sdk.Error
- func (dm DeveloperManager) RemoveFromDeveloperList(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (dm DeveloperManager) ReportConsumption(ctx sdk.Context, username types.AccountKey, consumption types.Coin) sdk.Error
- func (dm DeveloperManager) UpdateDeveloper(ctx sdk.Context, username types.AccountKey, ...) sdk.Error
- func (dm DeveloperManager) Withdraw(ctx sdk.Context, username types.AccountKey, coin types.Coin) sdk.Error
- func (dm DeveloperManager) WithdrawAll(ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
- type DeveloperRegisterMsg
- func (msg DeveloperRegisterMsg) GetConsumeAmount() types.Coin
- func (msg DeveloperRegisterMsg) GetPermission() types.Permission
- func (msg DeveloperRegisterMsg) GetSignBytes() []byte
- func (msg DeveloperRegisterMsg) GetSigners() []sdk.AccAddress
- func (msg DeveloperRegisterMsg) Route() string
- func (msg DeveloperRegisterMsg) String() string
- func (msg DeveloperRegisterMsg) Type() string
- func (msg DeveloperRegisterMsg) ValidateBasic() sdk.Error
- type DeveloperRevokeMsg
- func (msg DeveloperRevokeMsg) GetConsumeAmount() types.Coin
- func (msg DeveloperRevokeMsg) GetPermission() types.Permission
- func (msg DeveloperRevokeMsg) GetSignBytes() []byte
- func (msg DeveloperRevokeMsg) GetSigners() []sdk.AccAddress
- func (msg DeveloperRevokeMsg) Route() string
- func (msg DeveloperRevokeMsg) String() string
- func (msg DeveloperRevokeMsg) Type() string
- func (msg DeveloperRevokeMsg) ValidateBasic() sdk.Error
- type DeveloperUpdateMsg
- func (msg DeveloperUpdateMsg) GetConsumeAmount() types.Coin
- func (msg DeveloperUpdateMsg) GetPermission() types.Permission
- func (msg DeveloperUpdateMsg) GetSignBytes() []byte
- func (msg DeveloperUpdateMsg) GetSigners() []sdk.AccAddress
- func (msg DeveloperUpdateMsg) Route() string
- func (msg DeveloperUpdateMsg) String() string
- func (msg DeveloperUpdateMsg) Type() string
- func (msg DeveloperUpdateMsg) ValidateBasic() sdk.Error
- type GrantPermissionMsg
- func (msg GrantPermissionMsg) GetConsumeAmount() types.Coin
- func (msg GrantPermissionMsg) GetPermission() types.Permission
- func (msg GrantPermissionMsg) GetSignBytes() []byte
- func (msg GrantPermissionMsg) GetSigners() []sdk.AccAddress
- func (msg GrantPermissionMsg) Route() string
- func (msg GrantPermissionMsg) String() string
- func (msg GrantPermissionMsg) Type() string
- func (msg GrantPermissionMsg) ValidateBasic() sdk.Error
- type PreAuthorizationMsg
- func (msg PreAuthorizationMsg) GetConsumeAmount() types.Coin
- func (msg PreAuthorizationMsg) GetPermission() types.Permission
- func (msg PreAuthorizationMsg) GetSignBytes() []byte
- func (msg PreAuthorizationMsg) GetSigners() []sdk.AccAddress
- func (msg PreAuthorizationMsg) Route() string
- func (msg PreAuthorizationMsg) String() string
- func (msg PreAuthorizationMsg) Type() string
- func (msg PreAuthorizationMsg) ValidateBasic() sdk.Error
- type RevokePermissionMsg
- func (msg RevokePermissionMsg) GetConsumeAmount() types.Coin
- func (msg RevokePermissionMsg) GetPermission() types.Permission
- func (msg RevokePermissionMsg) GetSignBytes() []byte
- func (msg RevokePermissionMsg) GetSigners() []sdk.AccAddress
- func (msg RevokePermissionMsg) Route() string
- func (msg RevokePermissionMsg) String() string
- func (msg RevokePermissionMsg) Type() string
- func (msg RevokePermissionMsg) ValidateBasic() sdk.Error
Constants ¶
const ( // ModuleKey is the name of the module ModuleName = "developer" // RouterKey is the message route for gov RouterKey = ModuleName // QuerierRoute is the querier route for gov QuerierRoute = ModuleName QueryDeveloper = "dev" QueryDeveloperList = "devList" )
Variables ¶
This section is empty.
Functions ¶
func ErrAccountNotFound ¶
ErrAccountNotFound - error if account doesn't exist
func ErrDeveloperAlreadyExist ¶
func ErrDeveloperAlreadyExist(username types.AccountKey) sdk.Error
ErrDeveloperAlreadyExist - error if developer is already registered
func ErrDeveloperNotFound ¶
ErrDeveloperNotFound - error if developer not found
func ErrGrantPermissionTooHigh ¶
ErrGrantPermissionTooHigh - error if grant permission is not supported
func ErrInsufficientDeveloperDeposit ¶
ErrInsufficientDeveloperDeposit - error if developer deposit is insufficient
func ErrInvalidAppMetadata ¶
ErrInvalidAppMetadata - error if app metadata length invalid
func ErrInvalidAuthorizedApp ¶
ErrInvalidAuthorizedApp - error if auth app target is invalid
func ErrInvalidDescription ¶
ErrInvalidDescription - error if description length invalid
func ErrInvalidGrantPermission ¶ added in v0.2.0
ErrInvalidGrantPermission - error if grant permission is not supported
func ErrInvalidUsername ¶
ErrInvalidUsername - error if username invalid
func ErrInvalidValidityPeriod ¶
ErrInvalidValidityPeriod - error if validity is invalid
func ErrInvalidWebsite ¶
ErrInvalidWebsite - error if website length invalid
func ErrQueryFailed ¶ added in v0.2.0
ErrQueryFailed - error when query developer store failed
func InitGlobalManager ¶
func InitGlobalManager(ctx sdk.Context, gm global.GlobalManager) error
InitGlobalManager - init global manager
func NewHandler ¶
func NewHandler(dm DeveloperManager, am acc.AccountManager, gm *global.GlobalManager) sdk.Handler
NewHandler - Handle all "developer" type messages.
func NewQuerier ¶ added in v0.2.0
func NewQuerier(dm DeveloperManager) sdk.Querier
creates a querier for developer REST endpoints
Types ¶
type DeveloperManager ¶
type DeveloperManager struct {
// contains filtered or unexported fields
}
func NewDeveloperManager ¶
func NewDeveloperManager(key sdk.StoreKey, holder param.ParamHolder) DeveloperManager
NewDeveloperManager - create new developer manager
func (DeveloperManager) AddToDeveloperList ¶
func (dm DeveloperManager) AddToDeveloperList( ctx sdk.Context, username types.AccountKey) sdk.Error
func (DeveloperManager) ClearConsumption ¶
func (dm DeveloperManager) ClearConsumption(ctx sdk.Context) sdk.Error
func (DeveloperManager) DoesDeveloperExist ¶
func (dm DeveloperManager) DoesDeveloperExist(ctx sdk.Context, username types.AccountKey) bool
DoesDeveloperExist - check if given developer in the developer list or not
func (DeveloperManager) Export ¶ added in v0.2.0
func (dm DeveloperManager) Export(ctx sdk.Context) *model.DeveloperTables
Export state of storage
func (DeveloperManager) GetConsumptionWeight ¶
func (dm DeveloperManager) GetConsumptionWeight( ctx sdk.Context, username types.AccountKey) (sdk.Dec, sdk.Error)
GetConsumptionWeight - given app name, get consumption percentage report by this app
func (DeveloperManager) GetDeveloperList ¶
func (dm DeveloperManager) GetDeveloperList(ctx sdk.Context) (*model.DeveloperList, sdk.Error)
func (DeveloperManager) Import ¶ added in v0.2.0
func (dm DeveloperManager) Import(ctx sdk.Context, tb *model.DeveloperTablesIR)
Import state of storage
func (DeveloperManager) InitGenesis ¶
func (dm DeveloperManager) InitGenesis(ctx sdk.Context) error
InitGenesis - init developer manager
func (DeveloperManager) RegisterDeveloper ¶
func (dm DeveloperManager) RegisterDeveloper( ctx sdk.Context, username types.AccountKey, deposit types.Coin, website, description, appMetaData string) sdk.Error
func (DeveloperManager) RemoveFromDeveloperList ¶
func (dm DeveloperManager) RemoveFromDeveloperList( ctx sdk.Context, username types.AccountKey) sdk.Error
func (DeveloperManager) ReportConsumption ¶
func (dm DeveloperManager) ReportConsumption( ctx sdk.Context, username types.AccountKey, consumption types.Coin) sdk.Error
func (DeveloperManager) UpdateDeveloper ¶
func (dm DeveloperManager) UpdateDeveloper( ctx sdk.Context, username types.AccountKey, website, description, appMetadata string) sdk.Error
func (DeveloperManager) Withdraw ¶
func (dm DeveloperManager) Withdraw( ctx sdk.Context, username types.AccountKey, coin types.Coin) sdk.Error
this method won't check if it is a legal withdraw, caller should check by itself
func (DeveloperManager) WithdrawAll ¶
func (dm DeveloperManager) WithdrawAll( ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
type DeveloperRegisterMsg ¶
type DeveloperRegisterMsg struct { Username types.AccountKey `json:"username"` Deposit types.LNO `json:"deposit"` Website string `json:"website"` Description string `json:"description"` AppMetaData string `json:"app_meta_data"` }
DeveloperRegisterMsg - register developer on blockchain
func NewDeveloperRegisterMsg ¶
func NewDeveloperRegisterMsg(developer string, deposit types.LNO, website string, description string, appMetaData string) DeveloperRegisterMsg
DeveloperRegisterMsg Msg Implementations
func (DeveloperRegisterMsg) GetConsumeAmount ¶
func (msg DeveloperRegisterMsg) GetConsumeAmount() types.Coin
func (DeveloperRegisterMsg) GetPermission ¶
func (msg DeveloperRegisterMsg) GetPermission() types.Permission
func (DeveloperRegisterMsg) GetSignBytes ¶
func (msg DeveloperRegisterMsg) GetSignBytes() []byte
func (DeveloperRegisterMsg) GetSigners ¶
func (msg DeveloperRegisterMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (DeveloperRegisterMsg) Route ¶ added in v0.2.0
func (msg DeveloperRegisterMsg) Route() string
Route - implements sdk.Msg
func (DeveloperRegisterMsg) String ¶
func (msg DeveloperRegisterMsg) String() string
func (DeveloperRegisterMsg) Type ¶
func (msg DeveloperRegisterMsg) Type() string
Type - implements sdk.Msg
func (DeveloperRegisterMsg) ValidateBasic ¶
func (msg DeveloperRegisterMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg
type DeveloperRevokeMsg ¶
type DeveloperRevokeMsg struct {
Username types.AccountKey `json:"username"`
}
DeveloperRevokeMsg - revoke developer on blockchain
func NewDeveloperRevokeMsg ¶
func NewDeveloperRevokeMsg(developer string) DeveloperRevokeMsg
DeveloperRevokeMsg Msg Implementations
func (DeveloperRevokeMsg) GetConsumeAmount ¶
func (msg DeveloperRevokeMsg) GetConsumeAmount() types.Coin
GetConsumeAmount - implements types.Msg
func (DeveloperRevokeMsg) GetPermission ¶
func (msg DeveloperRevokeMsg) GetPermission() types.Permission
func (DeveloperRevokeMsg) GetSignBytes ¶
func (msg DeveloperRevokeMsg) GetSignBytes() []byte
GetSignBytes - implements sdk.Msg
func (DeveloperRevokeMsg) GetSigners ¶
func (msg DeveloperRevokeMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (DeveloperRevokeMsg) Route ¶ added in v0.2.0
func (msg DeveloperRevokeMsg) Route() string
Route - implements sdk.Msg
func (DeveloperRevokeMsg) String ¶
func (msg DeveloperRevokeMsg) String() string
func (DeveloperRevokeMsg) Type ¶
func (msg DeveloperRevokeMsg) Type() string
Type - implements sdk.Msg
func (DeveloperRevokeMsg) ValidateBasic ¶
func (msg DeveloperRevokeMsg) ValidateBasic() sdk.Error
type DeveloperUpdateMsg ¶
type DeveloperUpdateMsg struct { Username types.AccountKey `json:"username"` Website string `json:"website"` Description string `json:"description"` AppMetaData string `json:"app_meta_data"` }
DeveloperUpdateMsg - update developer info on blockchain
func NewDeveloperUpdateMsg ¶
func NewDeveloperUpdateMsg(developer string, website string, description string, appMetaData string) DeveloperUpdateMsg
NewDeveloperUpdateMsg - new DeveloperUpdateMsg
func (DeveloperUpdateMsg) GetConsumeAmount ¶
func (msg DeveloperUpdateMsg) GetConsumeAmount() types.Coin
GetConsumeAmount - implements types.Msg
func (DeveloperUpdateMsg) GetPermission ¶
func (msg DeveloperUpdateMsg) GetPermission() types.Permission
func (DeveloperUpdateMsg) GetSignBytes ¶
func (msg DeveloperUpdateMsg) GetSignBytes() []byte
func (DeveloperUpdateMsg) GetSigners ¶
func (msg DeveloperUpdateMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (DeveloperUpdateMsg) Route ¶ added in v0.2.0
func (msg DeveloperUpdateMsg) Route() string
Route - implements sdk.Msg
func (DeveloperUpdateMsg) String ¶
func (msg DeveloperUpdateMsg) String() string
func (DeveloperUpdateMsg) Type ¶
func (msg DeveloperUpdateMsg) Type() string
Type - implements sdk.Msg
func (DeveloperUpdateMsg) ValidateBasic ¶
func (msg DeveloperUpdateMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg
type GrantPermissionMsg ¶
type GrantPermissionMsg struct { Username types.AccountKey `json:"username"` AuthorizedApp types.AccountKey `json:"authorized_app"` ValidityPeriodSec int64 `json:"validity_period_second"` GrantLevel types.Permission `json:"grant_level"` Amount types.LNO `json:"amount"` }
GrantPermissionMsg - user grant permission to app
func NewGrantPermissionMsg ¶
func NewGrantPermissionMsg( user, app string, validityPeriodSec int64, grantLevel types.Permission, amount types.LNO) GrantPermissionMsg
Grant Msg Implementations
func (GrantPermissionMsg) GetConsumeAmount ¶
func (msg GrantPermissionMsg) GetConsumeAmount() types.Coin
GetConsumeAmount - implements types.Msg
func (GrantPermissionMsg) GetPermission ¶
func (msg GrantPermissionMsg) GetPermission() types.Permission
func (GrantPermissionMsg) GetSignBytes ¶
func (msg GrantPermissionMsg) GetSignBytes() []byte
GetSignBytes - implements sdk.Msg
func (GrantPermissionMsg) GetSigners ¶
func (msg GrantPermissionMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (GrantPermissionMsg) Route ¶ added in v0.2.0
func (msg GrantPermissionMsg) Route() string
Route - implements sdk.Msg
func (GrantPermissionMsg) String ¶
func (msg GrantPermissionMsg) String() string
func (GrantPermissionMsg) Type ¶
func (msg GrantPermissionMsg) Type() string
Type - implements sdk.Msg
func (GrantPermissionMsg) ValidateBasic ¶
func (msg GrantPermissionMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg
type PreAuthorizationMsg ¶
type PreAuthorizationMsg struct { Username types.AccountKey `json:"username"` AuthorizedApp types.AccountKey `json:"authorized_app"` ValidityPeriodSec int64 `json:"validity_period_second"` Amount types.LNO `json:"amount"` }
PreAuthorizationMsg - preauth permission to app
func NewPreAuthorizationMsg ¶
func NewPreAuthorizationMsg( user string, authorizedApp string, validityPeriodSec int64, amount types.LNO) PreAuthorizationMsg
PreAuthorization Msg Implementations
func (PreAuthorizationMsg) GetConsumeAmount ¶
func (msg PreAuthorizationMsg) GetConsumeAmount() types.Coin
GetConsumeAmount - implements types.Msg
func (PreAuthorizationMsg) GetPermission ¶
func (msg PreAuthorizationMsg) GetPermission() types.Permission
func (PreAuthorizationMsg) GetSignBytes ¶
func (msg PreAuthorizationMsg) GetSignBytes() []byte
GetSignBytes - implements sdk.Msg
func (PreAuthorizationMsg) GetSigners ¶
func (msg PreAuthorizationMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (PreAuthorizationMsg) Route ¶ added in v0.2.0
func (msg PreAuthorizationMsg) Route() string
Route - implements sdk.Msg
func (PreAuthorizationMsg) String ¶
func (msg PreAuthorizationMsg) String() string
func (PreAuthorizationMsg) Type ¶
func (msg PreAuthorizationMsg) Type() string
Type - implements sdk.Msg
func (PreAuthorizationMsg) ValidateBasic ¶
func (msg PreAuthorizationMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg
type RevokePermissionMsg ¶
type RevokePermissionMsg struct { Username types.AccountKey `json:"username"` RevokeFrom types.AccountKey `json:"revoke_from"` Permission types.Permission `json:"permission"` }
RevokePermissionMsg - user revoke permission from app
func NewRevokePermissionMsg ¶
func NewRevokePermissionMsg(user string, revokeFrom string, permission int) RevokePermissionMsg
Revoke Msg Implementations
func (RevokePermissionMsg) GetConsumeAmount ¶
func (msg RevokePermissionMsg) GetConsumeAmount() types.Coin
GetConsumeAmount - implements types.Msg
func (RevokePermissionMsg) GetPermission ¶
func (msg RevokePermissionMsg) GetPermission() types.Permission
func (RevokePermissionMsg) GetSignBytes ¶
func (msg RevokePermissionMsg) GetSignBytes() []byte
GetSignBytes - implements sdk.Msg
func (RevokePermissionMsg) GetSigners ¶
func (msg RevokePermissionMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (RevokePermissionMsg) Route ¶ added in v0.2.0
func (msg RevokePermissionMsg) Route() string
Route - implements sdk.Msg
func (RevokePermissionMsg) String ¶
func (msg RevokePermissionMsg) String() string
func (RevokePermissionMsg) Type ¶
func (msg RevokePermissionMsg) Type() string
Type - implements sdk.Msg
func (RevokePermissionMsg) ValidateBasic ¶
func (msg RevokePermissionMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg