types

package
v0.0.0-...-a41a74f Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeClaim        = "claim"
	EventTypeClaimFromEth = "claim_from_eth"
)
View Source
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"
)
View Source
const DefaultIndex uint64 = 1

DefaultIndex is the default global index

View Source
const TypeMsgAddClaim = "add_claim"
View Source
const TypeMsgClaimArkeo = "claim_arkeo"
View Source
const TypeMsgClaimEth = "claim_eth"
View Source
const TypeMsgTransferClaim = "transfer_claim"

Variables

View Source
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")
)
View Source
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),
	}
)
View Source
var (
	KeyClaimDenom            = []byte("ClaimDenom")
	DefaultClaimDenom string = "uarkeo"
)
View Source
var (
	KeyDurationUntilDecay                   = []byte("DurationUntilDecay")
	DefaultDurationUntilDecay time.Duration = time.Hour
)
View Source
var (
	KeyDurationOfDecay                   = []byte("DurationOfDecay")
	DefaultDurationOfDecay time.Duration = time.Hour
)
View Source
var (
	KeyAirdropStartTime               = []byte("AirdropStartTime")
	DeafultAirdropStartTime time.Time = time.Now().UTC()
)

Functions

func IsValidAddress

func IsValidAddress(address string, chain Chain) bool

func IsValidEthAddress

func IsValidEthAddress(address string) bool

isValidEthAddress checks if the provided string is a valid address or not.

func KeyPrefix

func KeyPrefix(p string) []byte

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

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

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.

Jump to

Keyboard shortcuts

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