developer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrAccountNotFound

func ErrAccountNotFound() sdk.Error

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

func ErrDeveloperNotFound() sdk.Error

ErrDeveloperNotFound - error if developer not found

func ErrGrantPermissionTooHigh

func ErrGrantPermissionTooHigh() sdk.Error

ErrGrantPermissionTooHigh - error if grant permission is not supported

func ErrInsufficientDeveloperDeposit

func ErrInsufficientDeveloperDeposit() sdk.Error

ErrInsufficientDeveloperDeposit - error if developer deposit is insufficient

func ErrInvalidAppMetadata

func ErrInvalidAppMetadata() sdk.Error

ErrInvalidAppMetadata - error if app metadata length invalid

func ErrInvalidAuthorizedApp

func ErrInvalidAuthorizedApp() sdk.Error

ErrInvalidAuthorizedApp - error if auth app target is invalid

func ErrInvalidDescription

func ErrInvalidDescription() sdk.Error

ErrInvalidDescription - error if description length invalid

func ErrInvalidUsername

func ErrInvalidUsername() sdk.Error

ErrInvalidUsername - error if username invalid

func ErrInvalidValidityPeriod

func ErrInvalidValidityPeriod() sdk.Error

ErrInvalidValidityPeriod - error if validity is invalid

func ErrInvalidWebsite

func ErrInvalidWebsite() sdk.Error

ErrInvalidWebsite - error if website length invalid

func InitGlobalManager

func InitGlobalManager(ctx sdk.Context, gm global.GlobalManager) error

InitGlobalManager - init global manager

func NewHandler

NewHandler - Handle all "developer" type messages.

func RegisterWire

func RegisterWire(cdc *wire.Codec)

Register concrete types on wire codec

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) GetConsumptionWeight

func (dm DeveloperManager) GetConsumptionWeight(
	ctx sdk.Context, username types.AccountKey) (sdk.Rat, 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) 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) 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) 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) 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"`
}

GrantPermissionMsg - user grant permission to app

func NewGrantPermissionMsg

func NewGrantPermissionMsg(
	user, app string, validityPeriodSec int64, grantLevel types.Permission) 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) 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) 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"`
	PubKey   crypto.PubKey    `json:"public_key"`
}

RevokePermissionMsg - user revoke permission from app

func NewRevokePermissionMsg

func NewRevokePermissionMsg(user string, pubKey crypto.PubKey) 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) 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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