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: 29 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeBondProvider    = "arkeo.arkeo.EventBondProvider"
	EventTypeModProvider     = "arkeo.arkeo.EventModProvider"
	EventTypeOpenContract    = "arkeo.arkeo.EventOpenContract"
	EventTypeSettleContract  = "arkeo.arkeo.EventSettleContract"
	EventTypeCloseContract   = "arkeo.arkeo.EventCloseContract"
	EventTypeValidatorPayout = "arkeo.arkeo.EventValidatorPayout"
)
View Source
const (
	// ModuleName defines the module name
	ModuleName   = "arkeo"
	ReserveName  = "arkeo-reserve"
	ProviderName = "providers"
	ContractName = "contracts"

	// 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_arkeo"
)
View Source
const DefaultIndex uint64 = 1

DefaultIndex is the default global index

View Source
const TypeMsgBondProvider = "bond_provider"
View Source
const TypeMsgClaimContractIncome = "claim_contract_income"
View Source
const TypeMsgCloseContract = "close_contract"
View Source
const TypeMsgModProvider = "mod_provider"
View Source
const TypeMsgOpenContract = "open_contract"
View Source
const TypeMsgSetVersion = "set_version"

Variables

View Source
var (
	ErrProviderBadSigner                      = errors.Register(ModuleName, 2, "unauthorized: bad provider pubkey and signer")
	ErrProviderAlreadyExists                  = errors.Register(ModuleName, 3, "provider already exists")
	ErrInsufficientFunds                      = errors.Register(ModuleName, 4, "insufficient funds")
	ErrInvalidBond                            = errors.Register(ModuleName, 5, "invalid bond")
	ErrInvalidModProviderMetdataURI           = errors.Register(ModuleName, 6, "invalid mod provider metadata uri")
	ErrInvalidModProviderMaxContractDuration  = errors.Register(ModuleName, 7, "invalid mod provider max contract duration")
	ErrInvalidModProviderMinContractDuration  = errors.Register(ModuleName, 8, "invalid mod provider min contract duration")
	ErrInvalidModProviderStatus               = errors.Register(ModuleName, 9, "invalid mod provider bad provider status")
	ErrInvalidModProviderNoBond               = errors.Register(ModuleName, 10, "no bond")
	ErrDisabledHandler                        = errors.Register(ModuleName, 11, "disabled handler")
	ErrInvalidService                         = errors.Register(ModuleName, 12, "invalid service")
	ErrOpenContractBadProviderStatus          = errors.Register(ModuleName, 13, "provider must have status 'online'")
	ErrOpenContractDuration                   = errors.Register(ModuleName, 14, "invalid contract duration")
	ErrOpenContractMismatchRate               = errors.Register(ModuleName, 15, "mismatch contract rate")
	ErrOpenContractAlreadyOpen                = errors.Register(ModuleName, 16, "contract is already open")
	ErrOpenContractRate                       = errors.Register(ModuleName, 17, "invalid contract rate")
	ErrInvalidContractType                    = errors.Register(ModuleName, 18, "invalid contract type")
	ErrInvalidPubKey                          = errors.Register(ModuleName, 19, "invalid pubkey")
	ErrCloseContractAlreadyClosed             = errors.Register(ModuleName, 20, "contract is already closed")
	ErrCloseContractUnauthorized              = errors.Register(ModuleName, 21, "unauthorized to close contract")
	ErrOpenContractMismatchSettlementDuration = errors.Register(ModuleName, 22, "mismatch contract settlement duration")
	ErrClaimContractIncomeBadNonce            = errors.Register(ModuleName, 23, "nonce must be greater than zero")
	ErrClaimContractIncomeClosed              = errors.Register(ModuleName, 24, "contract is settled")
	ErrClaimContractIncomeInvalidSignature    = errors.Register(ModuleName, 25, "invalid signature")
	ErrProviderNotFound                       = errors.Register(ModuleName, 26, "provider not found")
	ErrContractNotFound                       = errors.Register(ModuleName, 27, "contract not found")
	ErrInvalidModProviderSettlementDuration   = errors.Register(ModuleName, 28, "invalid mod provider settlement duration")
	ErrInvalidModProviderRate                 = errors.Register(ModuleName, 29, "bad provider rate")
	ErrInvariantBondModule                    = errors.Register(ModuleName, 30, "bond module invariant")
	ErrInvariantContractModule                = errors.Register(ModuleName, 31, "contract module invariant")
	ErrInvariantMaxSupply                     = errors.Register(ModuleName, 32, "max supply invariant")
	ErrInvalidAuthorization                   = errors.Register(ModuleName, 33, "invalid authorization")
	ErrInvalidVersion                         = errors.Register(ModuleName, 34, "version cannot be zero or lower")
)

x/arkeo module sentinel errors

Functions

func GetBytesToSign

func GetBytesToSign(contractId uint64, nonce int64) []byte

func GetRandomBech32Addr

func GetRandomBech32Addr() cosmos.AccAddress

GetRandomBech32Addr is an account address used for test

func GetRandomPubKey

func GetRandomPubKey() common.PubKey

func GetRandomTxID

func GetRandomTxID() string

GetRandomTxID create a random tx id for test purpose

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
}

AccountKeeper defines the expected account keeper used for simulations (noalias)

type BankKeeper

type BankKeeper interface {
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

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