Documentation ¶
Overview ¶
nolint:unparam
Index ¶
- Variables
- type AccountKeeper
- type BankKeeper
- type BurnKeeper
- type CollectionKeeper
- type ComposeKeeper
- type IssueKeeper
- type Keeper
- func (k Keeper) AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt types.Coins) (types.Coins, error)
- func (k Keeper) AddNFTOwner(ctx sdk.Context, addr sdk.AccAddress, tokenID string)
- func (k Keeper) AddPermission(ctx sdk.Context, addr sdk.AccAddress, perm types.Permission)
- func (k Keeper) Attach(ctx sdk.Context, from sdk.AccAddress, toTokenID string, tokenID string) error
- func (k Keeper) AttachFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, toTokenID string, ...) error
- func (k Keeper) BurnFT(ctx sdk.Context, from sdk.AccAddress, amount types.Coins) error
- func (k Keeper) BurnFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, amount types.Coins) error
- func (k Keeper) BurnNFT(ctx sdk.Context, from sdk.AccAddress, tokenIDs ...string) error
- func (k Keeper) BurnNFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, tokenIDs ...string) error
- func (k Keeper) BurnSupply(ctx sdk.Context, from sdk.AccAddress, amt types.Coins) (err error)
- func (k Keeper) ChangeNFTOwner(ctx sdk.Context, from, to sdk.AccAddress, tokenID string) error
- func (k Keeper) ChildrenOf(ctx sdk.Context, tokenID string) (types.Tokens, error)
- func (k Keeper) CreateCollection(ctx sdk.Context, collection types.Collection, owner sdk.AccAddress) error
- func (k Keeper) DeleteApproved(ctx sdk.Context, proxy sdk.AccAddress, approver sdk.AccAddress) error
- func (k Keeper) DeleteNFTOwner(ctx sdk.Context, addr sdk.AccAddress, tokenID string)
- func (k Keeper) DeleteToken(ctx sdk.Context, tokenID string) error
- func (k Keeper) Detach(ctx sdk.Context, from sdk.AccAddress, tokenID string) error
- func (k Keeper) DetachFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, tokenID string) error
- func (k Keeper) ExistCollection(ctx sdk.Context) bool
- func (k Keeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) (acc types.Account, err error)
- func (k Keeper) GetAllCollections(ctx sdk.Context) types.Collections
- func (k Keeper) GetApprovers(ctx sdk.Context, proxy sdk.AccAddress) (accAds []sdk.AccAddress, err error)
- func (k Keeper) GetBalance(ctx sdk.Context, tokenID string, addr sdk.AccAddress) (sdk.Int, error)
- func (k Keeper) GetCoins(ctx sdk.Context, addr sdk.AccAddress) types.Coins
- func (k Keeper) GetCollection(ctx sdk.Context) (collection types.Collection, err error)
- func (k Keeper) GetDepthFromRoot(ctx sdk.Context, tokenID string) int
- func (k Keeper) GetDepthWidthTable(ctx sdk.Context, tokenID string) []int
- func (k Keeper) GetFT(ctx sdk.Context, tokenID string) (types.FT, error)
- func (k Keeper) GetFTs(ctx sdk.Context) (tokens types.Tokens, err error)
- func (k Keeper) GetNFT(ctx sdk.Context, tokenID string) (types.NFT, error)
- func (k Keeper) GetNFTCount(ctx sdk.Context, tokenType string) (sdk.Int, error)
- func (k Keeper) GetNFTCountInt(ctx sdk.Context, tokenType, target string) (sdk.Int, error)
- func (k Keeper) GetNFTs(ctx sdk.Context, tokenType string) (tokens types.Tokens, err error)
- func (k Keeper) GetNFTsOwner(ctx sdk.Context, addr sdk.AccAddress) (tokenIDs []string)
- func (k Keeper) GetNextTokenIDFT(ctx sdk.Context) (string, error)
- func (k Keeper) GetNextTokenIDNFT(ctx sdk.Context, tokenType string) (string, error)
- func (k Keeper) GetNextTokenType(ctx sdk.Context) (tokenType string, err error)
- func (k Keeper) GetOrNewAccount(ctx sdk.Context, addr sdk.AccAddress) (acc types.Account, err error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPermissions(ctx sdk.Context, addr sdk.AccAddress) types.Permissions
- func (k Keeper) GetSupply(ctx sdk.Context) (supply types.Supply)
- func (k Keeper) GetToken(ctx sdk.Context, tokenID string) (types.Token, error)
- func (k Keeper) GetTokenType(ctx sdk.Context, tokenTypeID string) (types.TokenType, error)
- func (k Keeper) GetTokenTypes(ctx sdk.Context) (tokenTypes types.TokenTypes, err error)
- func (k Keeper) GetTokens(ctx sdk.Context) (tokens types.Tokens, err error)
- func (k Keeper) GetTotalInt(ctx sdk.Context, tokenID, target string) (supply sdk.Int, err error)
- func (k Keeper) GrantPermission(ctx sdk.Context, from, to sdk.AccAddress, perm types.Permission) error
- func (k Keeper) HasCoins(ctx sdk.Context, addr sdk.AccAddress, amt types.Coins) bool
- func (k Keeper) HasContractID(ctx sdk.Context) bool
- func (k Keeper) HasNFTOwner(ctx sdk.Context, addr sdk.AccAddress, tokenID string) bool
- func (k Keeper) HasPermission(ctx sdk.Context, addr sdk.AccAddress, p types.Permission) bool
- func (k Keeper) HasToken(ctx sdk.Context, tokenID string) bool
- func (k Keeper) HasTokenType(ctx sdk.Context, tokenType string) bool
- func (k Keeper) IsApproved(ctx sdk.Context, proxy sdk.AccAddress, approver sdk.AccAddress) bool
- func (k Keeper) IssueFT(ctx sdk.Context, owner, to sdk.AccAddress, token types.FT, amount sdk.Int) error
- func (k Keeper) IssueNFT(ctx sdk.Context, tokenType types.TokenType, owner sdk.AccAddress) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MarshalJSON(o interface{}) ([]byte, error)
- func (k Keeper) MarshalJSONIndent(o interface{}) ([]byte, error)
- func (k Keeper) MintFT(ctx sdk.Context, from, to sdk.AccAddress, amount types.Coins) error
- func (k Keeper) MintNFT(ctx sdk.Context, from sdk.AccAddress, token types.NFT) error
- func (k Keeper) MintSupply(ctx sdk.Context, to sdk.AccAddress, amt types.Coins) (err error)
- func (k Keeper) Modify(ctx sdk.Context, owner sdk.AccAddress, tokenType, tokenIndex string, ...) error
- func (k Keeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) (acc types.Account, err error)
- func (k Keeper) NewContractID(ctx sdk.Context) string
- func (k Keeper) ParentOf(ctx sdk.Context, tokenID string) (types.NFT, error)
- func (k Keeper) RevokePermission(ctx sdk.Context, addr sdk.AccAddress, perm types.Permission) error
- func (k Keeper) RootOf(ctx sdk.Context, tokenID string) (types.NFT, error)
- func (k Keeper) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, ...) error
- func (k Keeper) SetAccount(ctx sdk.Context, acc types.Account) error
- func (k Keeper) SetApproved(ctx sdk.Context, proxy sdk.AccAddress, approver sdk.AccAddress) error
- func (k Keeper) SetCoins(ctx sdk.Context, addr sdk.AccAddress, amt types.Coins) error
- func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetSupply(ctx sdk.Context, supply types.Supply)
- func (k Keeper) SetToken(ctx sdk.Context, token types.Token) error
- func (k Keeper) SetTokenType(ctx sdk.Context, tokenType types.TokenType) error
- func (k Keeper) SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt types.Coins) (types.Coins, error)
- func (k Keeper) TransferFT(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, amount ...types.Coin) error
- func (k Keeper) TransferFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, to sdk.AccAddress, ...) error
- func (k Keeper) TransferNFT(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, tokenIDs ...string) error
- func (k Keeper) TransferNFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, to sdk.AccAddress, ...) error
- func (k Keeper) UnmarshalJSON(bz []byte, ptr interface{}) error
- func (k Keeper) UpdateAccount(ctx sdk.Context, acc types.Account) error
- func (k Keeper) UpdateCollection(ctx sdk.Context, collection types.Collection) error
- func (k Keeper) UpdateToken(ctx sdk.Context, token types.Token) error
- func (k Keeper) UpdateTokenType(ctx sdk.Context, tokenType types.TokenType) error
- type MintKeeper
- type ProxyKeeper
- type SupplyKeeper
- type TokenKeeper
- type TokenTypeKeeper
- type TransferKeeper
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ApprovedValue = []byte{0x01}
)
View Source
var ChildExists = []byte{1}
Functions ¶
This section is empty.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) (acc types.Account, err error) GetOrNewAccount(ctx sdk.Context, addr sdk.AccAddress) (acc types.Account, err error) GetAccount(ctx sdk.Context, addr sdk.AccAddress) (acc types.Account, err error) SetAccount(ctx sdk.Context, acc types.Account) error UpdateAccount(ctx sdk.Context, acc types.Account) error GetBalance(ctx sdk.Context, tokenID string, addr sdk.AccAddress) (sdk.Int, error) }
type BankKeeper ¶
type BankKeeper interface { GetCoins(ctx sdk.Context, addr sdk.AccAddress) types.Coins HasCoins(ctx sdk.Context, addr sdk.AccAddress, amt types.Coins) bool SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt types.Coins) error SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt types.Coins) (types.Coins, error) AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt types.Coins) (types.Coins, error) SetCoins(ctx sdk.Context, addr sdk.AccAddress, amt types.Coins) error }
For the Token module
type BurnKeeper ¶
type BurnKeeper interface { BurnFT(ctx sdk.Context, from sdk.AccAddress, amount types.Coins) error BurnNFT(ctx sdk.Context, from sdk.AccAddress, tokenIDs ...string) error BurnFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, amount types.Coins) error BurnNFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, tokenIDs ...string) error }
type CollectionKeeper ¶
type CollectionKeeper interface { CreateCollection(ctx sdk.Context, collection types.Collection, owner sdk.AccAddress) error ExistCollection(ctx sdk.Context) bool GetCollection(ctx sdk.Context) (collection types.Collection, err error) SetCollection(ctx sdk.Context, collection types.Collection) error UpdateCollection(ctx sdk.Context, collection types.Collection) error }
type ComposeKeeper ¶
type ComposeKeeper interface { Attach(ctx sdk.Context, from sdk.AccAddress, toTokenID string, tokenID string) error AttachFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, toTokenID string, tokenID string) error Detach(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, tokenID string) error DetachFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, to sdk.AccAddress, tokenID string) error RootOf(ctx sdk.Context, tokenID string) (types.NFT, error) ParentOf(ctx sdk.Context, tokenID string) (types.NFT, error) ChildrenOf(ctx sdk.Context, tokenID string) (types.Tokens, error) }
type IssueKeeper ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func TestKeeper ¶
func TestKeeper() (sdk.Context, store.CommitMultiStore, Keeper)
func (Keeper) AddNFTOwner ¶
func (Keeper) AddPermission ¶
func (k Keeper) AddPermission(ctx sdk.Context, addr sdk.AccAddress, perm types.Permission)
func (Keeper) AttachFrom ¶
func (k Keeper) AttachFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, toTokenID string, tokenID string) error
func (Keeper) BurnFTFrom ¶
func (k Keeper) BurnFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, amount types.Coins) error
func (Keeper) BurnNFTFrom ¶
func (k Keeper) BurnNFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, tokenIDs ...string) error
func (Keeper) BurnSupply ¶
BurnCoins burns coins deletes coins from the balance of the module account. Panics if the name maps to a non-burner module account or if the amount is invalid.
func (Keeper) ChangeNFTOwner ¶
func (Keeper) ChildrenOf ¶
func (Keeper) CreateCollection ¶
func (k Keeper) CreateCollection(ctx sdk.Context, collection types.Collection, owner sdk.AccAddress) error
func (Keeper) DeleteApproved ¶
func (k Keeper) DeleteApproved(ctx sdk.Context, proxy sdk.AccAddress, approver sdk.AccAddress) error
func (Keeper) DeleteNFTOwner ¶
func (Keeper) DetachFrom ¶
func (k Keeper) DetachFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, tokenID string) error
nolint:dupl
func (Keeper) GetAccount ¶
func (Keeper) GetAllCollections ¶
func (k Keeper) GetAllCollections(ctx sdk.Context) types.Collections
func (Keeper) GetApprovers ¶
func (k Keeper) GetApprovers(ctx sdk.Context, proxy sdk.AccAddress) (accAds []sdk.AccAddress, err error)
func (Keeper) GetBalance ¶
func (Keeper) GetCollection ¶
func (Keeper) GetDepthFromRoot ¶
func (Keeper) GetDepthWidthTable ¶
Gets the depth-width(count) table (array)
lv0(1) lv1(2) lv2(3) lv3(2) lv4(1) token1 -+- token2 --- token4 --- token7
+- token3 -+- token5 --- token8 --- token9 +- token6
then returns [1, 2, 3, 2, 1] and len([1, 2, 3, 2, 1]) - 1 represents the depth of token1's children
func (Keeper) GetNFTCount ¶
func (Keeper) GetNFTCountInt ¶
func (Keeper) GetNFTsOwner ¶
func (Keeper) GetNextTokenIDNFT ¶
func (Keeper) GetNextTokenType ¶
func (Keeper) GetOrNewAccount ¶
func (Keeper) GetPermissions ¶
func (k Keeper) GetPermissions(ctx sdk.Context, addr sdk.AccAddress) types.Permissions
func (Keeper) GetTokenType ¶
func (Keeper) GetTokenTypes ¶
func (Keeper) GetTotalInt ¶
func (Keeper) GrantPermission ¶
func (k Keeper) GrantPermission(ctx sdk.Context, from, to sdk.AccAddress, perm types.Permission) error
func (Keeper) HasNFTOwner ¶
func (Keeper) HasPermission ¶
func (k Keeper) HasPermission(ctx sdk.Context, addr sdk.AccAddress, p types.Permission) bool
func (Keeper) IsApproved ¶
func (k Keeper) IsApproved(ctx sdk.Context, proxy sdk.AccAddress, approver sdk.AccAddress) bool
func (Keeper) MarshalJSON ¶
func (Keeper) MarshalJSONIndent ¶
func (Keeper) MintSupply ¶
MintCoins creates new coins from thin air and adds it to the module account. Panics if the name maps to a non-minter module account or if the amount is invalid.
func (Keeper) NewAccountWithAddress ¶
func (Keeper) RevokePermission ¶
func (k Keeper) RevokePermission(ctx sdk.Context, addr sdk.AccAddress, perm types.Permission) error
func (Keeper) SendCoins ¶
func (k Keeper) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt types.Coins) error
func (Keeper) SetApproved ¶
func (k Keeper) SetApproved(ctx sdk.Context, proxy sdk.AccAddress, approver sdk.AccAddress) error
func (Keeper) SetCollection ¶
func (Keeper) SetTokenType ¶
func (Keeper) SubtractCoins ¶
func (Keeper) TransferFT ¶
func (k Keeper) TransferFT(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, amount ...types.Coin) error
func (Keeper) TransferFTFrom ¶
func (k Keeper) TransferFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, to sdk.AccAddress, amount ...types.Coin) error
func (Keeper) TransferNFT ¶
func (k Keeper) TransferNFT(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, tokenIDs ...string) error
func (Keeper) TransferNFTFrom ¶
func (k Keeper) TransferNFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, to sdk.AccAddress, tokenIDs ...string) error
nolint:dupl
func (Keeper) UnmarshalJSON ¶
func (Keeper) UpdateAccount ¶
func (Keeper) UpdateCollection ¶
type MintKeeper ¶
type ProxyKeeper ¶
type ProxyKeeper interface { IsApproved(ctx sdk.Context, proxy sdk.AccAddress, approver sdk.AccAddress) bool SetApproved(ctx sdk.Context, proxy sdk.AccAddress, approver sdk.AccAddress) error DeleteApproved(ctx sdk.Context, proxy sdk.AccAddress, approver sdk.AccAddress) error }
type SupplyKeeper ¶
type SupplyKeeper interface { GetTotalInt(ctx sdk.Context, tokenID, target string) (supply sdk.Int, err error) GetSupply(ctx sdk.Context) (supply types.Supply) SetSupply(ctx sdk.Context, supply types.Supply) MintSupply(ctx sdk.Context, to sdk.AccAddress, amt types.Coins) error BurnSupply(ctx sdk.Context, from sdk.AccAddress, amt types.Coins) error }
type TokenKeeper ¶
type TokenKeeper interface { GetToken(ctx sdk.Context, tokenID string) (types.Token, error) HasToken(ctx sdk.Context, tokenID string) bool SetToken(ctx sdk.Context, token types.Token) error DeleteToken(ctx sdk.Context, tokenID string) error UpdateToken(ctx sdk.Context, token types.Token) error GetTokens(ctx sdk.Context) (tokens types.Tokens, err error) GetFT(ctx sdk.Context, tokenID string) (types.FT, error) GetFTs(ctx sdk.Context) (tokens types.Tokens, err error) GetNFT(ctx sdk.Context, tokenID string) (types.NFT, error) GetNFTCount(ctx sdk.Context, tokenType string) (sdk.Int, error) GetNFTCountInt(ctx sdk.Context, tokenType, target string) (sdk.Int, error) GetNFTs(ctx sdk.Context, tokenType string) (tokens types.Tokens, err error) GetNextTokenIDFT(ctx sdk.Context) (string, error) GetNextTokenIDNFT(ctx sdk.Context, tokenType string) (string, error) }
type TokenTypeKeeper ¶
type TokenTypeKeeper interface { GetNextTokenType(ctx sdk.Context) (tokenType string, err error) GetTokenTypes(ctx sdk.Context) (types.TokenTypes, error) GetTokenType(ctx sdk.Context, tokenType string) (types.TokenType, error) HasTokenType(ctx sdk.Context, tokenType string) bool SetTokenType(ctx sdk.Context, token types.TokenType) error UpdateTokenType(ctx sdk.Context, token types.TokenType) error }
type TransferKeeper ¶
type TransferKeeper interface { TransferFT(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, amount ...types.Coin) error TransferNFT(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, tokenID ...string) error TransferFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, to sdk.AccAddress, amount ...types.Coin) error TransferNFTFrom(ctx sdk.Context, proxy sdk.AccAddress, from sdk.AccAddress, to sdk.AccAddress, tokenID ...string) error }
Click to show internal directories.
Click to hide internal directories.