Documentation ¶
Index ¶
Constants ¶
View Source
const ( QueryTransactionsByAddress = "transactions_by_address" QueryParams = "params" ModuleName = types.ModuleName StoreKey = ModuleName RouterKey = ModuleName QuerierRoute = ModuleName DefaultParamspace = ModuleName )
Defines bank module constants
Variables ¶
View Source
var AllowedTransactionsForAddition = []TransactionType{ TransactionGift, TransactionBackingReturned, TransactionChallengeReturned, TransactionUpvoteReturned, TransactionInterestArgumentCreation, TransactionInterestUpvoteReceived, TransactionInterestUpvoteGiven, TransactionRewardPayout, TransactionCuratorReward, }
View Source
var AllowedTransactionsForDeduction = []TransactionType{ TransactionBacking, TransactionChallenge, TransactionUpvote, TransactionInterestArgumentCreationSlashed, TransactionInterestUpvoteReceivedSlashed, TransactionInterestUpvoteGivenSlashed, TransactionStakeCreatorSlashed, TransactionStakeCuratorSlashed, }
View Source
var AllowedTransactionsForEarning = []TransactionType{ TransactionInterestArgumentCreation, TransactionInterestUpvoteReceived, TransactionInterestUpvoteGiven, }
View Source
var AllowedTransactionsForEarningDeduction = []TransactionType{ TransactionInterestArgumentCreationSlashed, TransactionInterestUpvoteReceivedSlashed, TransactionInterestUpvoteGivenSlashed, }
View Source
var TransactionTypeName = []string{ TransactionGift: "TransactionGift", TransactionBacking: "TransactionBacking", TransactionBackingReturned: "TransactionBackingReturned", TransactionChallenge: "TransactionChallenge", TransactionChallengeReturned: "TransactionChallengeReturned", TransactionUpvote: "TransactionUpvote", TransactionUpvoteReturned: "TransactionUpvoteReturned", TransactionInterestArgumentCreation: "TransactionInterestArgumentCreation", TransactionInterestUpvoteReceived: "TransactionInterestUpvoteReceived", TransactionInterestUpvoteGiven: "TransactionInterestUpvoteGiven", TransactionRewardPayout: "TransactionRewardPayout", TransactionInterestArgumentCreationSlashed: "TransactionInterestArgumentCreationSlashed", TransactionInterestUpvoteReceivedSlashed: "TransactionInterestUpvoteReceivedSlashed", TransactionInterestUpvoteGivenSlashed: "TransactionInterestUpvoteGivenSlashed", TransactionStakeCreatorSlashed: "TransactionStakeCreatorSlashed", TransactionStakeCuratorSlashed: "TransactionStakeCuratorSlashed", }
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter func(*Filters)
func FilterByTransactionType ¶
func FilterByTransactionType(transactionTypes ...TransactionType) Filter
func SortOrder ¶
func SortOrder(sortOrder SortOrderType) Filter
type Filters ¶
type Filters struct { TransactionTypes []TransactionType SortOrder SortOrderType Limit int Offset int }
func GetFilters ¶
type QueryTransactionsByAddressParams ¶
type QueryTransactionsByAddressParams struct { Address sdk.AccAddress `json:"address"` Types []TransactionType `json:"types,omitempty"` SortOrder SortOrderType `json:"sort_order,omitempty"` Limit int `json:"limit,omitempty"` Offset int `json:"offset,omitempty"` }
QueryTransactionsByAddress query transactions params for a specific address.
type SortOrderType ¶
type SortOrderType int8
const ( SortAsc SortOrderType = iota SortDesc )
func (SortOrderType) Valid ¶
func (t SortOrderType) Valid() bool
type Transaction ¶
type Transaction struct { ID uint64 `json:"id"` Type TransactionType `json:"type"` AppAccountAddress sdk.AccAddress `json:"app_account_address"` ReferenceID uint64 `json:"reference_id"` CommunityID string `json:"community_id"` Amount sdk.Coin `json:"amount"` CreatedTime time.Time `json:"created_time"` FromModuleAccount string `json:"sender_module_account"` ToModuleAccount string `json:"to_module_account"` }
Transaction stores data related to a transaction
type TransactionSetter ¶
type TransactionSetter func(*Transaction)
func FromModuleAccount ¶
func FromModuleAccount(moduleAccount string) TransactionSetter
func ToModuleAccount ¶
func ToModuleAccount(moduleAccount string) TransactionSetter
func WithCommunityID ¶
func WithCommunityID(communityID string) TransactionSetter
type TransactionType ¶
type TransactionType int8
TransactionType defines the type of transaction.
const ( TransactionGift TransactionType = iota TransactionBacking TransactionBackingReturned TransactionChallenge TransactionChallengeReturned TransactionUpvote TransactionUpvoteReturned TransactionInterestArgumentCreation TransactionInterestUpvoteReceived TransactionInterestUpvoteGiven TransactionRewardPayout TransactionInterestArgumentCreationSlashed TransactionInterestUpvoteReceivedSlashed TransactionInterestUpvoteGivenSlashed TransactionStakeCreatorSlashed TransactionStakeCuratorSlashed TransactionCuratorReward )
Types of transactions
func (TransactionType) AllowedForAddition ¶
func (t TransactionType) AllowedForAddition() bool
func (TransactionType) AllowedForDeduction ¶
func (t TransactionType) AllowedForDeduction() bool
func (TransactionType) OneOf ¶
func (t TransactionType) OneOf(types []TransactionType) bool
func (TransactionType) String ¶
func (t TransactionType) String() string
Click to show internal directories.
Click to hide internal directories.