Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func IsValidAddress(address string, chain Chain) bool
- func IsValidEthAddress(address string) bool
- func KeyPrefix(p string) []byte
- func ParamKeyTable() paramtypes.KeyTable
- func RegisterCodec(cdc *codec.LegacyAmino)
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- type AccountKeeper
- type BankKeeper
Constants ¶
const ( EventTypeClaim = "claim" EventTypeClaimFromEth = "claim_from_eth" )
const ( // ModuleName defines the module name ModuleName = "claimarkeo" // append arkeo to avoid namespace collisions with comsos claim module // StoreKey defines the primary module store key StoreKey = ModuleName // RouterKey defines the module's message routing key RouterKey = ModuleName // MemStoreKey defines the in-memory store key MemStoreKey = "mem_claim" // ClaimRecordsStorePrefix defines the store prefix for the claim records (by arkeo address) ClaimRecordsArkeoStorePrefix = "claimrecordsarkeo" // ClaimRecordsStorePrefix defines the store prefix for the claim records (by eth address) ClaimRecordsEthStorePrefix = "claimrecordsethereum" )
const DefaultIndex uint64 = 1
DefaultIndex is the default global index
const TypeMsgAddClaim = "add_claim"
const TypeMsgClaimArkeo = "claim_arkeo"
const TypeMsgClaimEth = "claim_eth"
const TypeMsgTransferClaim = "transfer_claim"
Variables ¶
var ( Amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) )
var ( ErrAirdropEnded = errors.Register(ModuleName, 1, "Airdrop has ended") ErrNoClaimableAmount = errors.Register(ModuleName, 2, "No Claimable Arkeo") ErrInvalidSignature = errors.Register(ModuleName, 3, "Invalid signature") ErrClaimRecordNotTransferrable = errors.Register(ModuleName, 4, "Claim record can not be transferred") )
var ( EIP712Types = apitypes.Types{ "Claim": []apitypes.Type{ {Name: "address", Type: "address"}, {Name: "arkeoAddress", Type: "string"}, {Name: "amount", Type: "string"}, }, "EIP712Domain": []apitypes.Type{ {Name: "name", Type: "string"}, {Name: "chainId", Type: "uint256"}, {Name: "version", Type: "string"}, }, } EIP712Domain = apitypes.TypedDataDomain{ Name: "ArkdropClaim", Version: "1", ChainId: math.NewHexOrDecimal256(1), } )
var ( KeyClaimDenom = []byte("ClaimDenom") DefaultClaimDenom string = "uarkeo" )
var ( KeyDurationUntilDecay = []byte("DurationUntilDecay") DefaultDurationUntilDecay time.Duration = time.Hour )
Functions ¶
func IsValidAddress ¶
func IsValidEthAddress ¶
isValidEthAddress checks if the provided string is a valid address or not.
func ParamKeyTable ¶
func ParamKeyTable() paramtypes.KeyTable
ParamKeyTable the param key table for launch module
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
func RegisterQueryHandler ¶
RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandlerClient ¶
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) 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 RegisterQueryHandlerFromEndpoint ¶
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryHandlerServer ¶
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI SetModuleAccount(ctx sdk.Context, macc types.ModuleAccountI) GetModuleAddress(name string) sdk.AccAddress }
AccountKeeper defines the expected account keeper used for simulations (noalias)
type BankKeeper ¶
type BankKeeper interface { SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error }
BankKeeper defines the expected interface needed to retrieve account balances.