handler

package
v0.0.0-...-8369a04 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ParamTrue = "true"

Variables

View Source
var (
	ErrOutOfRange = errors.New("out of range")
	ErrLimit      = errors.New("limit")
	ErrOffset     = errors.New("offset")
)

Functions

func CreateAddress

func CreateAddress() http.HandlerFunc

func CreateTransaction

func CreateTransaction() http.HandlerFunc

func GetAccount

func GetAccount(ledger1 iLedger, mempool iMempool) http.HandlerFunc

func GetBlock

func GetBlock(blockchain storage.IBlockchain) http.HandlerFunc

func GetNft

func GetNft(nftStorage *nft.Storage) http.HandlerFunc

func GetNftMeta

func GetNftMeta(nftStorage *nft.Storage) http.HandlerFunc

func GetStructure

func GetStructure(ledger1 iLedger) http.HandlerFunc

func ListBlocks

func ListBlocks(blockchain storage.IBlockchain) http.HandlerFunc

func ListMempool

func ListMempool(mempool iMempool) http.HandlerFunc

func ListMempoolByAddress

func ListMempoolByAddress(mempool iMempool) http.HandlerFunc

func ListNft

func ListNft(nftStorage *nft.Storage) http.HandlerFunc

func ListNftsByAddress

func ListNftsByAddress(ledger1 *ledger.Ledger) http.HandlerFunc

func ListStructures

func ListStructures(ledger1 iLedger) http.HandlerFunc

func ListTransactionsByAddress

func ListTransactionsByAddress(blockchain storage.IBlockchain, index *storage.Index) http.HandlerFunc

func ListTransactionsByBlock

func ListTransactionsByBlock(blockchain storage.IBlockchain) http.HandlerFunc

func MethodNotAllowed

func MethodNotAllowed(allowMethod ...string) http.HandlerFunc

func NotFound

func NotFound() http.HandlerFunc

func ParseParams

func ParseParams(r *http.Request, totalCount int) (firstIndex, lastIndex int, err error)

func PushMempool

func PushMempool(mempool iMempool, nftMempool iNftMempool) http.HandlerFunc

func SubscribeAddress

func SubscribeAddress(event iEvents) http.HandlerFunc

func TxValidate

func TxValidate(transaction umi.Transaction) error

func TxValidateNft

func TxValidateNft(transaction []byte) error

Types

type CreateAddressRequest

type CreateAddressRequest struct {
	Prefix *string `json:"prefix,omitempty"`
	Seed   *[]byte `json:"seed,omitempty"`
}

type CreateAddressResponse

type CreateAddressResponse struct {
	Data  *string `json:"data,omitempty"`
	Error *Error  `json:"error,omitempty"`
}

type CreateTransactionRequest

type CreateTransactionRequest struct {
	Type             *string          `json:"type,omitempty"`
	SenderAddress    *string          `json:"senderAddress,omitempty"`
	RecipientAddress *string          `json:"recipientAddress,omitempty"`
	Amount           *uint64          `json:"amount,omitempty"`
	Prefix           *string          `json:"prefix,omitempty"`
	Description      *string          `json:"description,omitempty"`
	ProfitPercent    *uint16          `json:"profitPercent,omitempty"`
	FeePercent       *uint16          `json:"feePercent,omitempty"`
	Seed             *[]byte          `json:"seed,omitempty"`
	NftMeta          *json.RawMessage `json:"nftMeta,omitempty"`
	NftData          *[]byte          `json:"nftData,omitempty"`
}

type CreateTransactionResponse

type CreateTransactionResponse struct {
	Data  []byte `json:"data,omitempty"`
	Error *Error `json:"error,omitempty"`
}

type Error

type Error struct {
	Code    int32  `json:"code"`
	Message string `json:"message"`
}

func NewError

func NewError(code int32, message string) *Error

type GetAccountData

type GetAccountData struct {
	Type               string `json:"type"`
	ConfirmedBalance   uint64 `json:"confirmedBalance"`
	UnconfirmedBalance int64  `json:"unconfirmedBalance"`
	TransactionCount   uint64 `json:"transactionCount"`

	Balance      *uint64 `json:"balance,omitempty"`
	InterestRate *uint16 `json:"interestRate,omitempty"`
	UpdatedAt    *string `json:"updatedAt,omitempty"`

	CompositeBalance      *uint64 `json:"compositeBalance,omitempty"`
	CompositeInterestRate *uint16 `json:"compositeInterestRate,omitempty"`
	CompositeUpdatedAt    *string `json:"compositeUpdatedAt,omitempty"`

	DeductibleBalance      *uint64 `json:"deductibleBalance,omitempty"`
	DeductibleInterestRate *uint16 `json:"deductibleInterestRate,omitempty"`
	DeductibleUpdatedAt    *string `json:"deductibleUpdatedAt,omitempty"`
}

type GetAccountResponse

type GetAccountResponse struct {
	Data  *GetAccountData `json:"data,omitempty"`
	Error *Error          `json:"error,omitempty"`
}

type GetBlockResponse

type GetBlockResponse struct {
	Data  *umi.Block `json:"data,omitempty"`
	Error *Error     `json:"error,omitempty"`
}

type GetNftMetaResponse

type GetNftMetaResponse struct {
	Data  *json.RawMessage `json:"data,omitempty"`
	Error *Error           `json:"error,omitempty"`
}

type GetNftRawResponse

type GetNftRawResponse struct {
	Data  *[]byte `json:"data,omitempty"`
	Error *Error  `json:"error,omitempty"`
}

type GetStructureResponse

type GetStructureResponse struct {
	Data  *ledger.Structure `json:"data,omitempty"`
	Error *Error            `json:"error,omitempty"`
}

type ListBlocksData

type ListBlocksData struct {
	TotalCount int         `json:"totalCount"`
	Items      []umi.Block `json:"items"`
}

type ListBlocksRawData

type ListBlocksRawData struct {
	TotalCount int      `json:"totalCount"`
	Items      [][]byte `json:"items"`
}

type ListBlocksRawResponse

type ListBlocksRawResponse struct {
	Data  *ListBlocksRawData `json:"data,omitempty"`
	Error *Error             `json:"error,omitempty"`
}

type ListBlocksResponse

type ListBlocksResponse struct {
	Data  *ListBlocksData `json:"data,omitempty"`
	Error *Error          `json:"error,omitempty"`
}

type ListMempoolData

type ListMempoolData struct {
	TotalCount int                `json:"totalCount"`
	Items      []*umi.Transaction `json:"items"`
}

type ListMempoolRawData

type ListMempoolRawData struct {
	TotalCount int      `json:"totalCount"`
	Items      [][]byte `json:"items"`
}

type ListMempoolRawResponse

type ListMempoolRawResponse struct {
	Data  *ListMempoolRawData `json:"data,omitempty"`
	Error *Error              `json:"error,omitempty"`
}

type ListMempoolResponse

type ListMempoolResponse struct {
	Data  *ListMempoolData `json:"data,omitempty"`
	Error *Error           `json:"error,omitempty"`
}

type ListNftRawResponse

type ListNftRawResponse struct {
	Data  *[][]byte `json:"data,omitempty"`
	Error *Error    `json:"error,omitempty"`
}

type ListNftsByAddressResponse

type ListNftsByAddressResponse struct {
	Data  *[]string `json:"data,omitempty"`
	Error *Error    `json:"error,omitempty"`
}

type ListStructuresData

type ListStructuresData struct {
	TotalCount int                 `json:"totalCount"`
	Items      []*ledger.Structure `json:"items"`
}

type ListStructuresResponse

type ListStructuresResponse struct {
	Data  *ListStructuresData `json:"data,omitempty"`
	Error *Error              `json:"error,omitempty"`
}

type ListTransactionsData

type ListTransactionsData struct {
	TotalCount int               `json:"totalCount"`
	Items      []umi.Transaction `json:"items"`
}

type ListTransactionsRawData

type ListTransactionsRawData struct {
	TotalCount int      `json:"totalCount"`
	Items      [][]byte `json:"items"`
}

type ListTransactionsRawResponse

type ListTransactionsRawResponse struct {
	Data  *ListTransactionsRawData `json:"data,omitempty"`
	Error *Error                   `json:"error,omitempty"`
}

type ListTransactionsResponse

type ListTransactionsResponse struct {
	Data  *ListTransactionsData `json:"data,omitempty"`
	Error *Error                `json:"error,omitempty"`
}

type PushMempoolResponse

type PushMempoolResponse struct {
	Data  *umi.Transaction `json:"data,omitempty"`
	Error *Error           `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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