types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RIssue        = MsgRoute("issue")
	RTransfer     = MsgRoute("transfer")
	RTransferFrom = MsgRoute("transfer_from")
	RMint         = MsgRoute("mint")
	RBurn         = MsgRoute("burn")
	RBurnFrom     = MsgRoute("burn_from")
	RGrantPerm    = MsgRoute("grant_perm")
	RRevokePerm   = MsgRoute("revoke_perm")
	RModify       = MsgRoute("modify")
	RApprove      = MsgRoute("approve")
)
View Source
const (
	ModuleName = "token"

	StoreKey  = ModuleName
	RouterKey = ModuleName
)
View Source
const (
	MintAction   = "mint"
	BurnAction   = "burn"
	ModifyAction = "modify"
)
View Source
const (
	QuerierRoute    = "token"
	QueryTokens     = "tokens"
	QueryPerms      = "perms"
	QueryBalance    = "balance"
	QuerySupply     = "supply"
	QueryMint       = "mint"
	QueryBurn       = "burn"
	QueryIsApproved = "approved"
	QueryApprovers  = "approvers"
)
View Source
const (
	MaxImageURILength    = 1000
	MaxTokenNameLength   = 20
	MaxTokenMetaLength   = 1000
	MaxChangeFieldsCount = 100
)
View Source
const (
	EncodeRouterKey = "tokenencode"
)

Variables

View Source
var (
	ErrTokenExist               = sdkerrors.Register(ModuleName, 1, "token already exists")
	ErrTokenNotExist            = sdkerrors.Register(ModuleName, 2, "token does not exist")
	ErrTokenNotMintable         = sdkerrors.Register(ModuleName, 3, "token is not mintable")
	ErrInvalidTokenName         = sdkerrors.Register(ModuleName, 4, "token name should not be empty")
	ErrInvalidTokenDecimals     = sdkerrors.Register(ModuleName, 5, "token decimals should be within the range in 0 ~ 18")
	ErrInvalidAmount            = sdkerrors.Register(ModuleName, 6, "invalid token amount")
	ErrInvalidImageURILength    = sdkerrors.Register(ModuleName, 7, "invalid token uri length")
	ErrInvalidNameLength        = sdkerrors.Register(ModuleName, 8, "invalid name length")
	ErrInvalidTokenSymbol       = sdkerrors.Register(ModuleName, 9, "invalid token symbol")
	ErrTokenNoPermission        = sdkerrors.Register(ModuleName, 10, "account does not have the permission")
	ErrAccountExist             = sdkerrors.Register(ModuleName, 11, "account already exists")
	ErrAccountNotExist          = sdkerrors.Register(ModuleName, 12, "account does not exists")
	ErrInsufficientBalance      = sdkerrors.Register(ModuleName, 13, "insufficient balance")
	ErrSupplyExist              = sdkerrors.Register(ModuleName, 14, "supply for token already exists")
	ErrInsufficientSupply       = sdkerrors.Register(ModuleName, 15, "insufficient supply")
	ErrInvalidChangesFieldCount = sdkerrors.Register(ModuleName, 16, "invalid count of field changes")
	ErrEmptyChanges             = sdkerrors.Register(ModuleName, 17, "changes is empty")
	ErrInvalidChangesField      = sdkerrors.Register(ModuleName, 18, "invalid field of changes")
	ErrDuplicateChangesField    = sdkerrors.Register(ModuleName, 19, "invalid field of changes")
	ErrInvalidMetaLength        = sdkerrors.Register(ModuleName, 20, "invalid meta length")
	ErrSupplyOverflow           = sdkerrors.Register(ModuleName, 21, "supply for token reached maximum")
	ErrApproverProxySame        = sdkerrors.Register(ModuleName, 22, "approver is same with proxy")
	ErrTokenNotApproved         = sdkerrors.Register(ModuleName, 23, "proxy is not approved on the token")
	ErrTokenAlreadyApproved     = sdkerrors.Register(ModuleName, 24, "proxy is already approved on the token")
)
View Source
var (
	EventTypeIssueToken      = "issue"
	EventTypeMintToken       = "mint"
	EventTypeBurnToken       = "burn"
	EventTypeBurnTokenFrom   = "burn_from"
	EventTypeModifyToken     = "modify_token"
	EventTypeGrantPermToken  = "grant_perm"
	EventTypeRevokePermToken = "revoke_perm"
	EventTypeTransfer        = "transfer"
	EventTypeTransferFrom    = "transfer_from"
	EventTypeApproveToken    = "approve_token"

	AttributeKeyName       = "name"
	AttributeKeySymbol     = "symbol"
	AttributeKeyContractID = "contract_id"
	AttributeKeyOwner      = "owner"
	AttributeKeyAmount     = "amount"
	AttributeKeyDecimals   = "decimals"
	AttributeKeyMeta       = "meta"
	AttributeKeyImageURI   = "img_uri"
	AttributeKeyMintable   = "mintable"
	AttributeKeyFrom       = "from"
	AttributeKeyTo         = "to"
	AttributeKeyPerm       = "perm"
	AttributeKeyApprover   = "approver"
	AttributeKeyProxy      = "proxy"
	AttributeValueCategory = ModuleName
)
View Source
var (
	TokenKeyPrefix         = []byte{0x00}
	BlacklistKeyPrefix     = []byte{0x01}
	AccountKeyPrefix       = []byte{0x02}
	SupplyKeyPrefix        = []byte{0x03}
	PermKeyPrefix          = []byte{0x04}
	TokenApprovedKeyPrefix = []byte{0x05}
)
View Source
var ModuleCdc *codec.Codec
View Source
var (
	TokenModifiableFields = ModifiableFields{
		AttributeKeyName:     true,
		AttributeKeyMeta:     true,
		AttributeKeyImageURI: true,
	}
)

Functions

func AccountKey

func AccountKey(contractID string, addr sdk.AccAddress) []byte

func BlacklistKey

func BlacklistKey(addr sdk.AccAddress, action string) []byte

func IsAddressContains

func IsAddressContains(addresses []sdk.AccAddress, address sdk.AccAddress) bool

func PermKey

func PermKey(contractID string, addr sdk.AccAddress) []byte

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

func SupplyKey

func SupplyKey(contractID string) []byte

func TokenApprovedKey

func TokenApprovedKey(contractID string, proxy sdk.AccAddress, approver sdk.AccAddress) []byte

func TokenApproversKey

func TokenApproversKey(contractID string, proxy sdk.AccAddress) []byte

func TokenKey

func TokenKey(contractID string) []byte

func ValidateImageURI

func ValidateImageURI(imageURI string) bool

func ValidateMeta

func ValidateMeta(meta string) bool

func ValidateName

func ValidateName(name string) bool

func ValidateReg

func ValidateReg(symbol string, reg *regexp.Regexp) error

func ValidateTokenSymbol

func ValidateTokenSymbol(symbol string) error

func WrapIfOverflowPanic

func WrapIfOverflowPanic(r interface{}) error

Types

type Account

type Account interface {
	GetAddress() sdk.AccAddress
	GetContractID() string
	GetBalance() sdk.Int
	SetBalance(amount sdk.Int) Account
	String() string
}

type AccountKeeper

type AccountKeeper interface {
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) auth.Account
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.Account
	SetAccount(ctx sdk.Context, acc auth.Account)
}

type AccountPermission

type AccountPermission struct {
	Address     sdk.AccAddress
	Permissions Permissions
}

func (*AccountPermission) AddPermission

func (ap *AccountPermission) AddPermission(p Permission)

func (*AccountPermission) GetAddress

func (ap *AccountPermission) GetAddress() sdk.AccAddress

func (*AccountPermission) GetPermissions

func (ap *AccountPermission) GetPermissions() Permissions

func (*AccountPermission) HasPermission

func (ap *AccountPermission) HasPermission(p Permission) bool

func (*AccountPermission) RemovePermission

func (ap *AccountPermission) RemovePermission(p Permission)

func (*AccountPermission) String

func (ap *AccountPermission) String() string

type AccountPermissionI

type AccountPermissionI interface {
	GetAddress() sdk.AccAddress
	HasPermission(Permission) bool
	AddPermission(Permission)
	RemovePermission(Permission)
	String() string
	GetPermissions() Permissions
}

func NewAccountPermission

func NewAccountPermission(addr sdk.AccAddress) AccountPermissionI

type ApproversParam

type ApproversParam struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
}

type BalanceParam

type BalanceParam struct {
	ContractID string         `json:"contract_id"`
	Address    sdk.AccAddress `json:"address"`
}

type BaseAccount

type BaseAccount struct {
	ContractID string         `json:"contract_id"`
	Address    sdk.AccAddress `json:"address"`
	Amount     sdk.Int        `json:"amount"`
}

func NewBaseAccountWithAddress

func NewBaseAccountWithAddress(contractID string, addr sdk.AccAddress) *BaseAccount

func (BaseAccount) GetAddress

func (acc BaseAccount) GetAddress() sdk.AccAddress

func (BaseAccount) GetBalance

func (acc BaseAccount) GetBalance() sdk.Int

func (BaseAccount) GetContractID

func (acc BaseAccount) GetContractID() string

func (BaseAccount) SetBalance

func (acc BaseAccount) SetBalance(amount sdk.Int) Account

func (BaseAccount) String

func (acc BaseAccount) String() string

type BaseSupply

type BaseSupply struct {
	ContractID  string  `json:"contract_id"`
	TotalSupply sdk.Int `json:"total_supply"`
	TotalMint   sdk.Int `json:"total_mint"`
	TotalBurn   sdk.Int `json:"total_burn"`
}

func (BaseSupply) Deflate

func (supply BaseSupply) Deflate(amount sdk.Int) Supply

func (BaseSupply) GetContractID

func (supply BaseSupply) GetContractID() string

func (BaseSupply) GetTotalBurn

func (supply BaseSupply) GetTotalBurn() sdk.Int

func (BaseSupply) GetTotalMint

func (supply BaseSupply) GetTotalMint() sdk.Int

func (BaseSupply) GetTotalSupply

func (supply BaseSupply) GetTotalSupply() sdk.Int

func (BaseSupply) Inflate

func (supply BaseSupply) Inflate(amount sdk.Int) Supply

func (BaseSupply) SetTotalSupply

func (supply BaseSupply) SetTotalSupply(total sdk.Int) Supply

func (BaseSupply) String

func (supply BaseSupply) String() string

type BaseToken

type BaseToken struct {
	ContractID string  `json:"contract_id"`
	Name       string  `json:"name"`
	Symbol     string  `json:"symbol"`
	Meta       string  `json:"meta"`
	ImageURI   string  `json:"img_uri"`
	Decimals   sdk.Int `json:"decimals"`
	Mintable   bool    `json:"mintable"`
}

func (BaseToken) GetContractID

func (t BaseToken) GetContractID() string

func (BaseToken) GetDecimals

func (t BaseToken) GetDecimals() sdk.Int

func (BaseToken) GetImageURI

func (t BaseToken) GetImageURI() string

func (BaseToken) GetMeta

func (t BaseToken) GetMeta() string

func (BaseToken) GetMintable

func (t BaseToken) GetMintable() bool

func (BaseToken) GetName

func (t BaseToken) GetName() string

func (BaseToken) GetSymbol

func (t BaseToken) GetSymbol() string

func (*BaseToken) SetImageURI

func (t *BaseToken) SetImageURI(tokenURI string)

func (*BaseToken) SetMeta

func (t *BaseToken) SetMeta(meta string)

func (*BaseToken) SetName

func (t *BaseToken) SetName(name string)

func (BaseToken) String

func (t BaseToken) String() string

type Change

type Change struct {
	Field string `json:"field"`
	Value string `json:"value"`
}

func NewChange

func NewChange(field string, value string) Change

type Changes

type Changes []Change

func NewChanges

func NewChanges(changes ...Change) Changes

func NewChangesWithMap

func NewChangesWithMap(changesMap map[string]string) Changes

type ChangesValidator

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

func NewChangesValidator

func NewChangesValidator() *ChangesValidator

func (*ChangesValidator) Validate

func (c *ChangesValidator) Validate(changes Changes) error

type EncodeHandler

type EncodeHandler func(jsonMsg json.RawMessage) ([]sdk.Msg, error)

type EncodeQuerier

type EncodeQuerier func(ctx sdk.Context, jsonQuerier json.RawMessage) ([]byte, error)

type IsApprovedParam

type IsApprovedParam struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
	Approver   sdk.AccAddress `json:"approver"`
}

type ModifiableFields

type ModifiableFields map[string]bool

type MsgApprove

type MsgApprove struct {
	Approver   sdk.AccAddress `json:"approver"`
	ContractID string         `json:"contract_id"`
	Proxy      sdk.AccAddress `json:"proxy"`
}

func NewMsgApprove

func NewMsgApprove(approver sdk.AccAddress, contractID string, proxy sdk.AccAddress) MsgApprove

func (MsgApprove) GetContractID

func (msg MsgApprove) GetContractID() string

func (MsgApprove) GetSignBytes

func (msg MsgApprove) GetSignBytes() []byte

func (MsgApprove) GetSigners

func (msg MsgApprove) GetSigners() []sdk.AccAddress

func (MsgApprove) Route

func (MsgApprove) Route() string

func (MsgApprove) Type

func (MsgApprove) Type() string

func (MsgApprove) ValidateBasic

func (msg MsgApprove) ValidateBasic() error

type MsgBurn

type MsgBurn struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	Amount     sdk.Int        `json:"amount"`
}

func NewMsgBurn

func NewMsgBurn(from sdk.AccAddress, contractID string, amount sdk.Int) MsgBurn

func (MsgBurn) GetContractID

func (msg MsgBurn) GetContractID() string

func (MsgBurn) GetSignBytes

func (msg MsgBurn) GetSignBytes() []byte

func (MsgBurn) GetSigners

func (msg MsgBurn) GetSigners() []sdk.AccAddress

func (MsgBurn) Route

func (MsgBurn) Route() string

func (MsgBurn) Type

func (MsgBurn) Type() string

func (MsgBurn) ValidateBasic

func (msg MsgBurn) ValidateBasic() error

type MsgBurnFrom

type MsgBurnFrom struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
	From       sdk.AccAddress `json:"from"`
	Amount     sdk.Int        `json:"amount"`
}

func NewMsgBurnFrom

func NewMsgBurnFrom(proxy sdk.AccAddress, contractID string, from sdk.AccAddress, amount sdk.Int) MsgBurnFrom

func (MsgBurnFrom) GetContractID

func (msg MsgBurnFrom) GetContractID() string

func (MsgBurnFrom) GetSignBytes

func (msg MsgBurnFrom) GetSignBytes() []byte

func (MsgBurnFrom) GetSigners

func (msg MsgBurnFrom) GetSigners() []sdk.AccAddress

func (MsgBurnFrom) Route

func (MsgBurnFrom) Route() string

func (MsgBurnFrom) Type

func (MsgBurnFrom) Type() string

func (MsgBurnFrom) ValidateBasic

func (msg MsgBurnFrom) ValidateBasic() error

type MsgGrantPermission

type MsgGrantPermission struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	To         sdk.AccAddress `json:"to"`
	Permission Permission     `json:"permission"`
}

func NewMsgGrantPermission

func NewMsgGrantPermission(from sdk.AccAddress, contractID string, to sdk.AccAddress, perm Permission) MsgGrantPermission

func (MsgGrantPermission) GetContractID

func (msg MsgGrantPermission) GetContractID() string

func (MsgGrantPermission) GetSignBytes

func (msg MsgGrantPermission) GetSignBytes() []byte

func (MsgGrantPermission) GetSigners

func (msg MsgGrantPermission) GetSigners() []sdk.AccAddress

func (MsgGrantPermission) Route

func (MsgGrantPermission) Route() string

func (MsgGrantPermission) Type

func (MsgGrantPermission) Type() string

func (MsgGrantPermission) ValidateBasic

func (msg MsgGrantPermission) ValidateBasic() error

type MsgIssue

type MsgIssue struct {
	Owner    sdk.AccAddress `json:"owner"`
	To       sdk.AccAddress `json:"to"`
	Name     string         `json:"name"`
	Symbol   string         `json:"symbol"`
	ImageURI string         `json:"img_uri"`
	Meta     string         `json:"meta"`
	Amount   sdk.Int        `json:"amount"`
	Mintable bool           `json:"mintable"`
	Decimals sdk.Int        `json:"decimals"`
}

func NewMsgIssue

func NewMsgIssue(owner, to sdk.AccAddress, name, symbol, meta string, imageURI string, amount sdk.Int, decimal sdk.Int, mintable bool) MsgIssue

func (MsgIssue) GetSignBytes

func (msg MsgIssue) GetSignBytes() []byte

func (MsgIssue) GetSigners

func (msg MsgIssue) GetSigners() []sdk.AccAddress

func (MsgIssue) Route

func (msg MsgIssue) Route() string

func (MsgIssue) Type

func (msg MsgIssue) Type() string

func (MsgIssue) ValidateBasic

func (msg MsgIssue) ValidateBasic() error

type MsgMint

type MsgMint struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	To         sdk.AccAddress `json:"to"`
	Amount     sdk.Int        `json:"amount"`
}

func NewMsgMint

func NewMsgMint(from sdk.AccAddress, contractID string, to sdk.AccAddress, amount sdk.Int) MsgMint

func (MsgMint) GetContractID

func (msg MsgMint) GetContractID() string

func (MsgMint) GetSignBytes

func (msg MsgMint) GetSignBytes() []byte

func (MsgMint) GetSigners

func (msg MsgMint) GetSigners() []sdk.AccAddress

func (MsgMint) Route

func (MsgMint) Route() string

func (MsgMint) Type

func (MsgMint) Type() string

func (MsgMint) ValidateBasic

func (msg MsgMint) ValidateBasic() error

type MsgModify

type MsgModify struct {
	Owner      sdk.AccAddress `json:"owner"`
	ContractID string         `json:"contract_id"`
	Changes    Changes        `json:"changes"`
}

func NewMsgModify

func NewMsgModify(owner sdk.AccAddress, contractID string, changes Changes) MsgModify

func (MsgModify) GetContractID

func (msg MsgModify) GetContractID() string

func (MsgModify) GetSignBytes

func (msg MsgModify) GetSignBytes() []byte

func (MsgModify) GetSigners

func (msg MsgModify) GetSigners() []sdk.AccAddress

func (MsgModify) Route

func (msg MsgModify) Route() string

func (MsgModify) Type

func (msg MsgModify) Type() string

func (MsgModify) ValidateBasic

func (msg MsgModify) ValidateBasic() error

type MsgRevokePermission

type MsgRevokePermission struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	Permission Permission     `json:"permission"`
}

func NewMsgRevokePermission

func NewMsgRevokePermission(from sdk.AccAddress, contractID string, perm Permission) MsgRevokePermission

func (MsgRevokePermission) GetContractID

func (msg MsgRevokePermission) GetContractID() string

func (MsgRevokePermission) GetSignBytes

func (msg MsgRevokePermission) GetSignBytes() []byte

func (MsgRevokePermission) GetSigners

func (msg MsgRevokePermission) GetSigners() []sdk.AccAddress

func (MsgRevokePermission) Route

func (MsgRevokePermission) Route() string

func (MsgRevokePermission) Type

func (MsgRevokePermission) Type() string

func (MsgRevokePermission) ValidateBasic

func (msg MsgRevokePermission) ValidateBasic() error

type MsgRoute

type MsgRoute string

type MsgTransfer

type MsgTransfer struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	To         sdk.AccAddress `json:"to"`
	Amount     sdk.Int        `json:"amount"`
}

func NewMsgTransfer

func NewMsgTransfer(from sdk.AccAddress, to sdk.AccAddress, contractID string, amount sdk.Int) MsgTransfer

func (MsgTransfer) GetContractID

func (msg MsgTransfer) GetContractID() string

func (MsgTransfer) GetSignBytes

func (msg MsgTransfer) GetSignBytes() []byte

func (MsgTransfer) GetSigners

func (msg MsgTransfer) GetSigners() []sdk.AccAddress

func (MsgTransfer) Route

func (msg MsgTransfer) Route() string

func (MsgTransfer) Type

func (msg MsgTransfer) Type() string

func (MsgTransfer) ValidateBasic

func (msg MsgTransfer) ValidateBasic() error

type MsgTransferFrom

type MsgTransferFrom struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
	From       sdk.AccAddress `json:"from"`
	To         sdk.AccAddress `json:"to"`
	Amount     sdk.Int        `json:"amount"`
}

func NewMsgTransferFrom

func NewMsgTransferFrom(proxy sdk.AccAddress, contractID string, from sdk.AccAddress, to sdk.AccAddress, amount sdk.Int) MsgTransferFrom

func (MsgTransferFrom) GetContractID

func (msg MsgTransferFrom) GetContractID() string

func (MsgTransferFrom) GetSignBytes

func (msg MsgTransferFrom) GetSignBytes() []byte

func (MsgTransferFrom) GetSigners

func (msg MsgTransferFrom) GetSigners() []sdk.AccAddress

func (MsgTransferFrom) MarshalJSON

func (msg MsgTransferFrom) MarshalJSON() ([]byte, error)

func (MsgTransferFrom) Route

func (MsgTransferFrom) Route() string

func (MsgTransferFrom) Type

func (MsgTransferFrom) Type() string

func (*MsgTransferFrom) UnmarshalJSON

func (msg *MsgTransferFrom) UnmarshalJSON(data []byte) error

func (MsgTransferFrom) ValidateBasic

func (msg MsgTransferFrom) ValidateBasic() error

type NodeQuerier

type NodeQuerier interface {
	QueryWithData(path string, data []byte) ([]byte, int64, error)
	WithHeight(height int64) context.CLIContext
}

type PermParam

type PermParam struct {
	ContractID string         `json:"contract_id"`
	Address    sdk.AccAddress `json:"address"`
}

type Permission

type Permission string

func NewBurnPermission

func NewBurnPermission() Permission

func NewMintPermission

func NewMintPermission() Permission

func NewModifyPermission

func NewModifyPermission() Permission

func (Permission) Equal

func (p Permission) Equal(p2 Permission) bool

func (Permission) String

func (p Permission) String() string

func (Permission) Validate

func (p Permission) Validate() bool

type Permissions

type Permissions []Permission

func NewPermissions

func NewPermissions(perms ...Permission) Permissions

func (*Permissions) AddPermission

func (pms *Permissions) AddPermission(p Permission)

func (*Permissions) GetPermissions

func (pms *Permissions) GetPermissions() []Permission

func (Permissions) HasPermission

func (pms Permissions) HasPermission(p Permission) bool

func (*Permissions) RemoveElement

func (pms *Permissions) RemoveElement(idx int)

func (*Permissions) RemovePermission

func (pms *Permissions) RemovePermission(p Permission)

func (Permissions) String

func (pms Permissions) String() string

type QueryApproversWrapper

type QueryApproversWrapper struct {
	ApproversParam ApproversParam `json:"approvers_param"`
}

type QueryBalanceWrapper

type QueryBalanceWrapper struct {
	BalanceParam BalanceParam `json:"balance_param"`
}

type QueryContractIDAccAddressParams

type QueryContractIDAccAddressParams struct {
	Addr sdk.AccAddress `json:"addr"`
}

func NewQueryContractIDAccAddressParams

func NewQueryContractIDAccAddressParams(addr sdk.AccAddress) QueryContractIDAccAddressParams

type QueryIsApprovedParams

type QueryIsApprovedParams struct {
	Proxy    sdk.AccAddress `json:"proxy"`
	Approver sdk.AccAddress `json:"approver"`
}

func NewQueryIsApprovedParams

func NewQueryIsApprovedParams(proxy sdk.AccAddress, approver sdk.AccAddress) QueryIsApprovedParams

type QueryIsApprovedWrapper

type QueryIsApprovedWrapper struct {
	IsApprovedParam IsApprovedParam `json:"is_approved_param"`
}

type QueryPermWrapper

type QueryPermWrapper struct {
	PermParam PermParam `json:"perm_param"`
}

type QueryProxyParams

type QueryProxyParams struct {
	Proxy sdk.AccAddress `json:"proxy"`
}

func NewQueryApproverParams

func NewQueryApproverParams(proxy sdk.AccAddress) QueryProxyParams

type QueryTokenWrapper

type QueryTokenWrapper struct {
	TokenParam TokenParam `json:"token_param"`
}

type QueryTotalWrapper

type QueryTotalWrapper struct {
	TotalParam TotalParam `json:"total_param"`
}

type Supply

type Supply interface {
	GetTotalSupply() sdk.Int
	SetTotalSupply(total sdk.Int) Supply
	GetTotalBurn() sdk.Int
	GetTotalMint() sdk.Int
	GetContractID() string

	Inflate(amount sdk.Int) Supply
	Deflate(amount sdk.Int) Supply

	String() string
}

func DefaultSupply

func DefaultSupply(contractID string) Supply

func NewSupply

func NewSupply(contractID string, total sdk.Int) Supply

type Token

type Token interface {
	GetContractID() string
	GetName() string
	SetName(name string)
	GetSymbol() string
	GetMeta() string
	SetMeta(meta string)
	GetImageURI() string
	SetImageURI(tokenURI string)
	GetMintable() bool
	GetDecimals() sdk.Int
	String() string
}

func NewToken

func NewToken(contractID, name, symbol, meta string, imageURI string, decimals sdk.Int, mintable bool) Token

type TokenID

type TokenID string

type TokenParam

type TokenParam struct {
	ContractID string `json:"contract_id"`
}

type Tokens

type Tokens []Token

func (Tokens) String

func (ts Tokens) String() string

type TotalParam

type TotalParam struct {
	ContractID string `json:"contract_id"`
}

type WasmCustomMsg

type WasmCustomMsg struct {
	Route string          `json:"route"`
	Data  json.RawMessage `json:"data"`
}

WasmCustomMsg - wasm custom msg parser

type WasmCustomQuerier

type WasmCustomQuerier struct {
	Route string          `json:"route"`
	Data  json.RawMessage `json:"data"`
}

Jump to

Keyboard shortcuts

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