keeper

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// event __CosmosNativeSendCrossmintRequest(
	//     uint256 recipientChainId,
	//     string fromTokenNft,
	//     string toTokenNft,
	//     string metadataHash,
	//     string fromOwner,
	//     string toOwner,
	//     string permitHash,
	//     string permitSignature
	// );
	SendCrossmintRequest abi.Event
	// `event __CosmosNativeCreateMetadata(
	// address owner,
	// string did,
	// string name,
	// string description,
	// string image,
	// string parent,
	// string  sources,
	// string  links)`
	CreateMetadata abi.Event
)
View Source
var (
	ReadOwnerQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ancon", "nft", "nfts"}, "", runtime.AssumeColonVerbOpt(true)))

	ReadCollectionQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ancon", "nft", "collections", "denom_id"}, "", runtime.AssumeColonVerbOpt(true)))

	ReadDenomQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ancon", "nft", "denoms", "denom_id"}, "", runtime.AssumeColonVerbOpt(true)))

	ReadDenomsQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ancon", "nft", "denoms"}, "", runtime.AssumeColonVerbOpt(true)))

	ReadGetNftQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ancon", "nft", "nfts", "denom_id", "token_id"}, "", runtime.AssumeColonVerbOpt(true)))
)
View Source
var (
	ReadMetadataProofQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"ancon", "proof", "cid", "path"}, "", runtime.AssumeColonVerbOpt(true)))
	ReadRoyaltyInfoQuery   = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"ancon", "royalty", "cid", "price"}, "", runtime.AssumeColonVerbOpt(true)))
	ReadWithPathQuery      = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2}, []string{"ancon", "cid", "path"}, "", runtime.AssumeColonVerbOpt(true)))
	ReadQuery              = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"ancon", "cid"}, "", runtime.AssumeColonVerbOpt(true)))
)
View Source
var (
	ReadResolveDidWebQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"user", "name", "did.json"}, "", runtime.AssumeColonVerbOpt(true)))

	ReadDidKeyQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"ancon", "didregistry", "name"}, "", runtime.AssumeColonVerbOpt(true)))

	ReadIdentifyOwnerQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"ancon", "didregistry", "address"}, "", runtime.AssumeColonVerbOpt(true)))

	ReadGetAttributesQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"ancon", "didregistry", "address", "attributes"}, "", runtime.AssumeColonVerbOpt(true)))

	ReadDelegateQuery = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ancon", "didregistry", "delegates", "id"}, "", runtime.AssumeColonVerbOpt(true)))
)
View Source
var (

	// event _anconSendCrossmintRequest(
	//     uint256 recipientChainId,
	//     string fromTokenNft,
	//     string toTokenNft,
	//     string metadataHash,
	//     string fromOwner,
	//     string toOwner,
	//     string permitHash,
	//     string permitSignature
	// );
	RecieveCrossmintCallback abi.Method
)

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the NFT module.

func CreateCidLink(hash []byte) cidlink.Link

CreateCidLink takes a hash eg ethereum hash and converts it to cid multihash

func CreateMetadataAbi

func CreateMetadataAbi() abi.ABI

func CreateMetadataAbiEvent

func CreateMetadataAbiEvent()

func ExecuteTransaction

func ExecuteTransaction(
	ctx sdk.Context,
	rq RecieveCrossmintRequest,
	walletAddress common.Address,
	client *ethclient.Client,
	chainID *big.Int,
	privateKey *ecdsa.PrivateKey,
	crossMintAddress common.Address,
	value int64,
) (string, error)

func GetLinkPrototype

func GetLinkPrototype() ipld.LinkPrototype

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func ParseCidLink(hash string) (cidlink.Link, error)

ParseCidLink parses a string cid multihash into a cidLink

func RecieveCrossmintCallbackMethod

func RecieveCrossmintCallbackMethod() abi.Method

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all supply invariants

func RegisterQueryAnconHandler

func RegisterQueryAnconHandler(ctx context.Context, mux *runtime.ServeMux, client types.QueryClient, abci rpcclient.ABCIClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryDidRegistryHandler

func RegisterQueryDidRegistryHandler(ctx context.Context, mux *runtime.ServeMux, client types.QueryClient, abci client.ABCIClient) error

func RegisterQueryNFTHandler

func RegisterQueryNFTHandler(ctx context.Context, mux *runtime.ServeMux, client types.QueryClient, abci client.ABCIClient) error

func SendCrossmintRequestAbi

func SendCrossmintRequestAbi() abi.ABI

func SendCrossmintRequestAbiEvent

func SendCrossmintRequestAbiEvent()

func SupplyInvariant

func SupplyInvariant(k Keeper) sdk.Invariant

SupplyInvariant checks that the total amount of NFTs on collections matches the total amount owned by addresses

Types

type AnconQueryRequestFunc

type AnconQueryRequestFunc func(ctx context.Context, marshaler runtime.Marshaler, client types.QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error)

AnconQueryRequestFunc

type CreateMetadataHook

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

func NewCreateMetadataHook

func NewCreateMetadataHook(anconprotocolKeeper Keeper) *CreateMetadataHook

func (CreateMetadataHook) PostTxProcessing

func (h CreateMetadataHook) PostTxProcessing(ctx sdk.Context, txHash common.Hash, logs []*ethtypes.Log) error

type Delegate

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

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.Codec,
	key sdk.StoreKey,
	memKey sdk.StoreKey,
	paramSpace paramstypes.Subspace,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,

	blockedAddrs map[string]bool,
	cms store.CommitMultiStore,
) Keeper

func NewTestKeeper

func NewTestKeeper(
	cdc codec.Codec,
	key sdk.StoreKey,
	memKey sdk.StoreKey,
	paramSpace paramstypes.Subspace,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,

	blockedAddrs map[string]bool,
) Keeper

func (*Keeper) AddDid

func (k *Keeper) AddDid(ctx sdk.Context, msg *types.MsgCreateDid) (*types.DIDOwner, error)

func (Keeper) AddFile

func (k Keeper) AddFile(ctx sdk.Context, msg *types.MsgFile) (string, error)

func (Keeper) AddMetadata

func (k Keeper) AddMetadata(ctx sdk.Context, msg *types.MsgMetadata) (string, error)

func (Keeper) AddRoyaltyInfo

func (k Keeper) AddRoyaltyInfo(ctx sdk.Context, msg *types.MsgRoyaltyInfo) (string, error)

func (Keeper) AddTrustedContent

func (k Keeper) AddTrustedContent(ctx sdk.Context, msg *types.MsgMintTrustedContent) (string, error)

func (Keeper) AddTrustedResource

func (k Keeper) AddTrustedResource(ctx sdk.Context, msg *types.MsgMintTrustedResource) (string, error)

func (*Keeper) ApplyAttribute

func (k *Keeper) ApplyAttribute(ctx sdk.Context, msg *types.MsgGrantAttribute) (types.Change, error)

func (*Keeper) ApplyChangeOwner

func (k *Keeper) ApplyChangeOwner(ctx sdk.Context, msg *types.MsgChangeOwner) (*types.Change, error)

ApplyChangeOwner = AppendOwner

func (*Keeper) ApplyDelegate

func (k *Keeper) ApplyDelegate(ctx sdk.Context, msg *types.MsgGrantDelegate) (types.Change, error)

func (Keeper) Authorize

func (k Keeper) Authorize(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) (types.BaseNFT, error)

Authorize checks if the sender is the owner of the given NFT Return the NFT if true, an error otherwise

func (Keeper) BuildDidKey

func (k Keeper) BuildDidKey(ctx sdk.Context, creator string) (*did.Doc, error)

BuildDidKey ....

func (Keeper) BuildDidWeb

func (k Keeper) BuildDidWeb(ctx sdk.Context, creator string) (*did.Doc, error)

BuildDidWeb ....

func (Keeper) BurnNFT

func (k Keeper) BurnNFT(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) error

BurnNFT deletes a specified NFT

func (Keeper) ChangeOwnerMetadata

func (k Keeper) ChangeOwnerMetadata(ctx sdk.Context, hash string, previousOwner, newOwner, chainId, recipientChainId string) (string, error)

func (Keeper) Collection

func (Keeper) CreateSendMetadataPacket

func (k Keeper) CreateSendMetadataPacket(ctx sdk.Context, sender sdk.AccAddress, packet *types.AguaclaraPacketData) (string, error)

func (Keeper) Denom

func (Keeper) Denoms

func (Keeper) EditNFT

func (k Keeper) EditNFT(
	ctx sdk.Context, denomID, tokenID, tokenNm,
	tokenURI, tokenData string, owner sdk.AccAddress,
) error

EditNFT updates an already existing NFT

func (*Keeper) EnsureModuleAccountPermissions

func (k *Keeper) EnsureModuleAccountPermissions(ctx sdk.Context) error

EnsureModuleAccountPermissions syncs the bep3 module account's permissions with those in the supply keeper.

func (*Keeper) GetChangeOwner

func (k *Keeper) GetChangeOwner(ctx sdk.Context, identity string) types.Change

func (Keeper) GetCollection

func (k Keeper) GetCollection(ctx sdk.Context, denomID string) (types.Collection, error)

GetCollection returns the collection by the specified denom ID

func (Keeper) GetCollections

func (k Keeper) GetCollections(ctx sdk.Context) (cs []types.Collection)

GetCollections returns all the collections

func (*Keeper) GetDIDOwner

func (k *Keeper) GetDIDOwner(ctx sdk.Context, owner string) types.DIDOwner

Get functions returns a documents from its id

func (*Keeper) GetDelegates

func (k *Keeper) GetDelegates(ctx sdk.Context, delegate string, delegateType string, o string) types.Delegate

func (Keeper) GetDenom

func (k Keeper) GetDenom(ctx sdk.Context, id string) (denom types.Denom, found bool)

GetDenom returns the denom by id

func (Keeper) GetDenoms

func (k Keeper) GetDenoms(ctx sdk.Context) (denoms []types.Denom)

GetDenoms returns all the denoms

func (Keeper) GetDid

func (k Keeper) GetDid(ctx sdk.Context, hash string) (datamodel.Node, error)

func (Keeper) GetDidKey

func (Keeper) GetDidRoute

func (k Keeper) GetDidRoute(ctx sdk.Context, name string) (datamodel.Node, error)

func (*Keeper) GetDidWebRoute

func (k *Keeper) GetDidWebRoute(ctx sdk.Context, vanityName string) types.DIDWebRoute

func (*Keeper) GetHTLCAccount

func (k *Keeper) GetHTLCAccount(ctx sdk.Context) authtypes.ModuleAccountI

GetHTLCAccount returns the HTLC module account

func (Keeper) GetLinkSystem

func (k Keeper) GetLinkSystem() linking.LinkSystem

func (Keeper) GetMetadata

func (k Keeper) GetMetadata(ctx sdk.Context, hash string, path string) (datamodel.Node, error)

func (Keeper) GetMetadataProof

func (k Keeper) GetMetadataProof(ctx sdk.Context, hash, path string) ([]byte, *ibc.MerkleProof, error)

func (Keeper) GetNFTs

func (k Keeper) GetNFTs(ctx sdk.Context, denom string) (nfts []exported.NFT)

GetNFTs returns all NFTs by the specified denom ID

func (Keeper) GetNft

func (*Keeper) GetObject

func (Keeper) GetOwner

func (k Keeper) GetOwner(ctx sdk.Context, address sdk.AccAddress, denom string) types.Owner

GetOwner gets all the ID collections owned by an address and denom ID

func (Keeper) GetOwners

func (k Keeper) GetOwners(ctx sdk.Context) (owners types.Owners)

GetOwners gets all the ID collections

func (Keeper) GetPaginateCollection

func (k Keeper) GetPaginateCollection(ctx sdk.Context, request *types.QueryCollectionRequest, denomID string) (types.Collection, *query.PageResponse, error)

GetPaginateCollection returns the collection by the specified denom ID

func (Keeper) GetProof

func (k Keeper) GetProof(ctx sdk.Context, hash, path string) ([]byte, *ibc.MerkleProof, error)

func (Keeper) GetTotalSupply

func (k Keeper) GetTotalSupply(ctx sdk.Context, denomID string) uint64

GetTotalSupply returns the number of NFTs by the specified denom ID

func (Keeper) GetTotalSupplyOfOwner

func (k Keeper) GetTotalSupplyOfOwner(ctx sdk.Context, id string, owner sdk.AccAddress) (supply uint64)

GetTotalSupplyOfOwner returns the amount of NFTs by the specified conditions

func (Keeper) GetVoucherProof

func (k Keeper) GetVoucherProof(ctx sdk.Context, path string, abci rpcclient.ABCIClient, voucherID string) (*ics23.ExistenceProof, error)

GetVoucherProof returns stored voucher proof

func (Keeper) Get_NFT

func (k Keeper) Get_NFT(ctx sdk.Context, denomID, tokenID string) (nft exported.NFT, err error)

GetNFT gets the the specified NFT

func (*Keeper) HasChangeOwner

func (k *Keeper) HasChangeOwner(ctx sdk.Context, identity string) bool

func (*Keeper) HasDelegates

func (k *Keeper) HasDelegates(ctx sdk.Context, delegate string, delegateType string, o string) bool

Has functions checks if the documents exists in the store

func (Keeper) HasDenomID

func (k Keeper) HasDenomID(ctx sdk.Context, id string) bool

HasDenomID returns whether the specified denom ID exists

func (*Keeper) HasDidWebName

func (k *Keeper) HasDidWebName(ctx sdk.Context, vn string) bool

func (*Keeper) HasDidWebRoute

func (k *Keeper) HasDidWebRoute(ctx sdk.Context, didWebRoute *types.DIDWebRoute) bool

func (Keeper) HasNFT

func (k Keeper) HasNFT(ctx sdk.Context, denomID, tokenID string) bool

HasNFT checks if the specified NFT exists

func (*Keeper) HasOwner

func (k *Keeper) HasOwner(ctx sdk.Context, o string) bool

func (Keeper) IssueDenom

func (k Keeper) IssueDenom(ctx sdk.Context,
	id, name, schema, symbol string,
	creator sdk.AccAddress,
	mintRestricted, updateRestricted bool,
) error

IssueDenom issues a denom according to the given params

func (*Keeper) Logger

func (k *Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger

func (Keeper) MintNFT

func (k Keeper) MintNFT(
	ctx sdk.Context, denomID, tokenID, tokenNm,
	tokenURI, tokenData string, owner sdk.AccAddress,
) error

MintNFT mints an NFT and manages the NFT's existence within Collections and Owners

func (Keeper) Owner

func (Keeper) Read

func (Keeper) ReadDelegate

func (Keeper) ReadFile

func (Keeper) ReadMetadataProof

func (k Keeper) ReadMetadataProof(goCtx context.Context, req *types.QueryProofMetadataRequest) (*types.QueryProofResponse, error)

func (Keeper) ReadRoyaltyInfo

func (Keeper) ReadWithPath

func (*Keeper) RemoveAttribute

func (k *Keeper) RemoveAttribute(ctx sdk.Context, msg *types.MsgRevokeDelegate)

func (*Keeper) RemoveDelegate

func (k *Keeper) RemoveDelegate(ctx sdk.Context, msg *types.MsgRevokeDelegate)

func (Keeper) ResolveDidWeb

func (Keeper) Resource

func (*Keeper) SetChange

func (k *Keeper) SetChange(ctx sdk.Context, c types.Change)

func (Keeper) SetCollection

func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection) error

SetCollection saves all NFTs and returns an error if there already exists

func (*Keeper) SetDelegate

func (k *Keeper) SetDelegate(ctx sdk.Context, msg *types.Delegate)

func (Keeper) SetDenom

func (k Keeper) SetDenom(ctx sdk.Context, denom types.Denom) error

SetDenom is responsible for saving the definition of denom

func (*Keeper) SetDid

func (k *Keeper) SetDid(ctx sdk.Context, msg *did.Doc) (string, error)

IPLD Store DID Type is Web

func (*Keeper) SetDidWebRoute

func (k *Keeper) SetDidWebRoute(ctx sdk.Context, didWebRoute *types.DIDWebRoute)

func (*Keeper) SetOwner

func (k *Keeper) SetOwner(ctx sdk.Context, o types.DIDOwner)

func (Keeper) TransferDenomOwner

func (k Keeper) TransferDenomOwner(
	ctx sdk.Context, denomID string, srcOwner, dstOwner sdk.AccAddress,
) error

TransferDenomOwner transfers the ownership of the given denom to the new owner

func (Keeper) TransferOwner

func (k Keeper) TransferOwner(
	ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI,
	tokenData string, srcOwner, dstOwner sdk.AccAddress,
) error

TransferOwner transfers the ownership of the given NFT to the new owner

func (Keeper) UpdateDenom

func (k Keeper) UpdateDenom(ctx sdk.Context, denom types.Denom) error

UpdateDenom is responsible for updating the definition of denom

type RecieveCrossmintRequest

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

type SendCrossmintRequestHook

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

func NewSendCrossmintRequestHook

func NewSendCrossmintRequestHook(anconprotocolKeeper Keeper) *SendCrossmintRequestHook

func (SendCrossmintRequestHook) PostTxProcessing

func (h SendCrossmintRequestHook) PostTxProcessing(ctx sdk.Context, txHash common.Hash, logs []*ethtypes.Log) error

type VerifyCredential

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

Jump to

Keyboard shortcuts

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