Documentation
¶
Index ¶
- func NewMsgApproveAction(creator string, actionID string) *actiontypes.MsgApproveAction
- func NewMsgDeregisterSupernode(creator, validatorAddress string) *supernodetypes.MsgDeregisterSupernode
- func NewMsgFinalizeAction(creator string, actionID string, actionType actiontypes.ActionType, ...) *actiontypes.MsgFinalizeAction
- func NewMsgRegisterSupernode(creator, validatorAddress, ipAddress, supernodeAccount, p2pPort string) *supernodetypes.MsgRegisterSupernode
- func NewMsgRequestAction(creator string, actionType actiontypes.ActionType, metadata string, ...) *actiontypes.MsgRequestAction
- func NewMsgStartSupernode(creator, validatorAddress string) *supernodetypes.MsgStartSupernode
- func NewMsgStopSupernode(creator, validatorAddress, reason string) *supernodetypes.MsgStopSupernode
- func NewMsgUpdateParams(authority string, params actiontypes.Params) *actiontypes.MsgUpdateParams
- func NewMsgUpdateSupernode(creator, validatorAddress, ipAddress, note, supernodeAccount, p2pPort string) *supernodetypes.MsgUpdateSupernode
- func NewSuperNodeMsgUpdateParams(authority string, params supernodetypes.Params) *supernodetypes.MsgUpdateParams
- type ActionClient
- func (a *ActionClient) GetAction(ctx context.Context, actionID string) (*types.Action, error)
- func (a *ActionClient) GetActionFee(ctx context.Context, dataSize int64) (string, error)
- func (a *ActionClient) ListActions(ctx context.Context, opts ...QueryOption) ([]*types.Action, error)
- func (a *ActionClient) ListActionsByBlockHeight(ctx context.Context, blockHeight int64, limit, offset uint64) ([]*types.Action, error)
- func (a *ActionClient) ListActionsBySuperNode(ctx context.Context, superNodeAddress string, limit, offset uint64) ([]*types.Action, error)
- func (a *ActionClient) ListActionsByType(ctx context.Context, actionType string, limit, offset uint64) ([]*types.Action, error)
- func (a *ActionClient) ListExpiredActions(ctx context.Context, limit, offset uint64) ([]*types.Action, error)
- func (a *ActionClient) Params(ctx context.Context) (*actiontypes.Params, error)
- func (a *ActionClient) QueryActionByMetadata(ctx context.Context, actionTypeStr, metadataQuery string, limit, offset uint64) ([]*types.Action, error)
- func (a *ActionClient) QueryActionByMetadataEnum(ctx context.Context, actionType actiontypes.ActionType, metadataQuery string, ...) ([]*types.Action, error)
- type AuditClient
- type ClaimClient
- type Client
- func (c *Client) ApproveActionTx(ctx context.Context, creator, actionID, memo string) (*types.ActionResult, error)
- func (c *Client) Broadcast(ctx context.Context, txBytes []byte, mode txtypes.BroadcastMode) (string, error)
- func (c *Client) BuildAndSignTx(ctx context.Context, msg sdk.Msg, memo string) ([]byte, error)
- func (c *Client) Close() error
- func (c *Client) DeregisterSupernodeTx(ctx context.Context, creator, validatorAddress, memo string) (*types.ActionResult, error)
- func (c *Client) ExtractEventAttribute(tx *txtypes.GetTxResponse, eventType, attrKey string) (string, error)
- func (c *Client) FinalizeActionTx(ctx context.Context, creator, actionID string, ...) (*types.ActionResult, error)
- func (c *Client) GetTx(ctx context.Context, hash string) (*txtypes.GetTxResponse, error)
- func (c *Client) RegisterSupernodeTx(ctx context.Context, ...) (*types.ActionResult, error)
- func (c *Client) RequestActionTx(ctx context.Context, creator string, actionType actiontypes.ActionType, ...) (*types.ActionResult, error)
- func (c *Client) Simulate(ctx context.Context, txBytes []byte) (uint64, error)
- func (c *Client) StartSupernodeTx(ctx context.Context, creator, validatorAddress, memo string) (*types.ActionResult, error)
- func (c *Client) StopSupernodeTx(ctx context.Context, creator, validatorAddress, reason, memo string) (*types.ActionResult, error)
- func (c *Client) UpdateActionParamsTx(ctx context.Context, authority string, params actiontypes.Params, memo string) (*types.ActionResult, error)
- func (c *Client) UpdateSuperNodeParamsTx(ctx context.Context, authority string, params supernodetypes.Params, ...) (*types.ActionResult, error)
- func (c *Client) UpdateSupernodeTx(ctx context.Context, ...) (*types.ActionResult, error)
- func (c *Client) WaitForTxInclusion(ctx context.Context, txHash string) (*txtypes.GetTxResponse, error)
- type Config
- type QueryOption
- func WithActionState(state actiontypes.ActionState) QueryOption
- func WithActionStateEnum(st actiontypes.ActionState) QueryOption
- func WithActionStateStr(s string) QueryOption
- func WithActionType(actionType actiontypes.ActionType) QueryOption
- func WithActionTypeEnum(t actiontypes.ActionType) QueryOption
- func WithActionTypeStr(s string) QueryOption
- func WithPagination(limit, offset uint64) QueryOption
- type SuperNodeClient
- func (s *SuperNodeClient) GetSuperNode(ctx context.Context, validatorAddr string) (*types.SuperNode, error)
- func (s *SuperNodeClient) GetSuperNodeBySuperNodeAddress(ctx context.Context, supernodeAddress string) (*types.SuperNode, error)
- func (s *SuperNodeClient) GetTopSuperNodesForBlock(ctx context.Context, blockHeight int32) ([]*supernodetypes.SuperNode, error)
- func (s *SuperNodeClient) GetTopSuperNodesForBlockWithOptions(ctx context.Context, blockHeight int32, limit int32, state string) ([]*types.SuperNode, error)
- func (s *SuperNodeClient) ListSuperNodes(ctx context.Context, limit, offset uint64) ([]*types.SuperNode, error)
- func (s *SuperNodeClient) Params(ctx context.Context) (*supernodetypes.Params, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgApproveAction ¶
func NewMsgApproveAction( creator string, actionID string, ) *actiontypes.MsgApproveAction
NewMsgApproveAction constructs a MsgApproveAction with the provided creator and actionID.
func NewMsgDeregisterSupernode ¶
func NewMsgDeregisterSupernode( creator, validatorAddress string, ) *supernodetypes.MsgDeregisterSupernode
NewMsgDeregisterSupernode constructs a MsgDeregisterSupernode.
func NewMsgFinalizeAction ¶
func NewMsgFinalizeAction( creator string, actionID string, actionType actiontypes.ActionType, metadata string, ) *actiontypes.MsgFinalizeAction
NewMsgFinalizeAction constructs a MsgFinalizeAction with the provided parameters.
func NewMsgRegisterSupernode ¶
func NewMsgRegisterSupernode( creator, validatorAddress, ipAddress, supernodeAccount, p2pPort string, ) *supernodetypes.MsgRegisterSupernode
NewMsgRegisterSupernode constructs a MsgRegisterSupernode.
func NewMsgRequestAction ¶
func NewMsgRequestAction( creator string, actionType actiontypes.ActionType, metadata string, price string, expiration string, ) *actiontypes.MsgRequestAction
NewMsgRequestAction constructs a MsgRequestAction with the provided parameters. Converts typed inputs to the string format required by the protobuf message.
func NewMsgStartSupernode ¶
func NewMsgStartSupernode( creator, validatorAddress string, ) *supernodetypes.MsgStartSupernode
NewMsgStartSupernode constructs a MsgStartSupernode.
func NewMsgStopSupernode ¶
func NewMsgStopSupernode( creator, validatorAddress, reason string, ) *supernodetypes.MsgStopSupernode
NewMsgStopSupernode constructs a MsgStopSupernode.
func NewMsgUpdateParams ¶
func NewMsgUpdateParams( authority string, params actiontypes.Params, ) *actiontypes.MsgUpdateParams
NewMsgUpdateParams constructs a MsgUpdateParams with the provided authority and params.
func NewMsgUpdateSupernode ¶
func NewMsgUpdateSupernode( creator, validatorAddress, ipAddress, note, supernodeAccount, p2pPort string, ) *supernodetypes.MsgUpdateSupernode
NewMsgUpdateSupernode constructs a MsgUpdateSupernode.
func NewSuperNodeMsgUpdateParams ¶
func NewSuperNodeMsgUpdateParams( authority string, params supernodetypes.Params, ) *supernodetypes.MsgUpdateParams
NewSuperNodeMsgUpdateParams constructs a SuperNode MsgUpdateParams with the provided authority and params.
Types ¶
type ActionClient ¶
type ActionClient struct {
// contains filtered or unexported fields
}
ActionClient provides action module operations
func (*ActionClient) GetActionFee ¶
GetActionFee calculates the fee for an action based on data size
func (*ActionClient) ListActions ¶
func (a *ActionClient) ListActions(ctx context.Context, opts ...QueryOption) ([]*types.Action, error)
ListActions lists actions with optional filters
func (*ActionClient) ListActionsByBlockHeight ¶
func (a *ActionClient) ListActionsByBlockHeight(ctx context.Context, blockHeight int64, limit, offset uint64) ([]*types.Action, error)
ListActionsByBlockHeight lists actions created at a specific block height with pagination.
func (*ActionClient) ListActionsBySuperNode ¶
func (a *ActionClient) ListActionsBySuperNode(ctx context.Context, superNodeAddress string, limit, offset uint64) ([]*types.Action, error)
ListActionsBySuperNode lists actions for a specific supernode address with pagination.
func (*ActionClient) ListActionsByType ¶
func (a *ActionClient) ListActionsByType(ctx context.Context, actionType string, limit, offset uint64) ([]*types.Action, error)
ListActionsByType provides a convenience wrapper accepting actionType as a string with pagination.
func (*ActionClient) ListExpiredActions ¶
func (a *ActionClient) ListExpiredActions(ctx context.Context, limit, offset uint64) ([]*types.Action, error)
ListExpiredActions lists expired actions with pagination.
func (*ActionClient) Params ¶
func (a *ActionClient) Params(ctx context.Context) (*actiontypes.Params, error)
Params retrieves the Action module parameters.
func (*ActionClient) QueryActionByMetadata ¶
func (a *ActionClient) QueryActionByMetadata(ctx context.Context, actionTypeStr, metadataQuery string, limit, offset uint64) ([]*types.Action, error)
QueryActionByMetadata queries actions by metadata and string ActionType with pagination.
func (*ActionClient) QueryActionByMetadataEnum ¶
func (a *ActionClient) QueryActionByMetadataEnum(ctx context.Context, actionType actiontypes.ActionType, metadataQuery string, limit, offset uint64) ([]*types.Action, error)
QueryActionByMetadataEnum queries actions by metadata and typed ActionType with pagination.
type ClaimClient ¶
type ClaimClient struct {
// contains filtered or unexported fields
}
ClaimClient provides claim module operations
type Client ¶
type Client struct {
// Module-specific clients
Action *ActionClient
SuperNode *SuperNodeClient
Claim *ClaimClient
Audit *AuditClient
// contains filtered or unexported fields
}
Client provides access to blockchain operations
func (*Client) ApproveActionTx ¶
func (c *Client) ApproveActionTx(ctx context.Context, creator, actionID, memo string) (*types.ActionResult, error)
ApproveActionTx builds, signs, broadcasts and confirms a MsgApproveAction.
func (*Client) Broadcast ¶
func (c *Client) Broadcast(ctx context.Context, txBytes []byte, mode txtypes.BroadcastMode) (string, error)
Broadcast broadcasts a signed transaction with a chosen broadcast mode
func (*Client) BuildAndSignTx ¶
BuildAndSignTx builds a transaction with one message, simulates gas, then signs it.
func (*Client) DeregisterSupernodeTx ¶
func (c *Client) DeregisterSupernodeTx(ctx context.Context, creator, validatorAddress, memo string) (*types.ActionResult, error)
DeregisterSupernodeTx de-registers an existing supernode.
func (*Client) ExtractEventAttribute ¶
func (c *Client) ExtractEventAttribute(tx *txtypes.GetTxResponse, eventType, attrKey string) (string, error)
ExtractEventAttribute extracts an attribute value from transaction events. It searches through TxResponse.Events for the first event matching eventType, then returns the value of the first attribute matching attrKey. Returns an error if the transaction, events, or matching event/attribute are not found.
func (*Client) FinalizeActionTx ¶
func (c *Client) FinalizeActionTx(ctx context.Context, creator, actionID string, actionType actiontypes.ActionType, metadata, memo string) (*types.ActionResult, error)
FinalizeActionTx builds, signs, broadcasts and confirms a MsgFinalizeAction.
func (*Client) RegisterSupernodeTx ¶
func (c *Client) RegisterSupernodeTx(ctx context.Context, creator, validatorAddress, ipAddress, supernodeAccount, p2pPort, memo string) (*types.ActionResult, error)
RegisterSupernodeTx registers a new supernode.
func (*Client) RequestActionTx ¶
func (c *Client) RequestActionTx(ctx context.Context, creator string, actionType actiontypes.ActionType, metadata, price, expiration, memo string) (*types.ActionResult, error)
RequestActionTx builds, signs, broadcasts and confirms a MsgRequestAction.
func (*Client) StartSupernodeTx ¶
func (c *Client) StartSupernodeTx(ctx context.Context, creator, validatorAddress, memo string) (*types.ActionResult, error)
StartSupernodeTx starts a supernode.
func (*Client) StopSupernodeTx ¶
func (c *Client) StopSupernodeTx(ctx context.Context, creator, validatorAddress, reason, memo string) (*types.ActionResult, error)
StopSupernodeTx stops a supernode with a reason.
func (*Client) UpdateActionParamsTx ¶
func (c *Client) UpdateActionParamsTx(ctx context.Context, authority string, params actiontypes.Params, memo string) (*types.ActionResult, error)
UpdateActionParamsTx builds, signs, broadcasts and confirms a MsgUpdateParams for the Action module.
func (*Client) UpdateSuperNodeParamsTx ¶
func (c *Client) UpdateSuperNodeParamsTx(ctx context.Context, authority string, params supernodetypes.Params, memo string) (*types.ActionResult, error)
UpdateSuperNodeParamsTx builds, signs, broadcasts and confirms a SuperNode MsgUpdateParams.
func (*Client) UpdateSupernodeTx ¶
func (c *Client) UpdateSupernodeTx(ctx context.Context, creator, validatorAddress, ipAddress, note, supernodeAccount, p2pPort, memo string) (*types.ActionResult, error)
UpdateSupernodeTx updates a supernode's info.
func (*Client) WaitForTxInclusion ¶
func (c *Client) WaitForTxInclusion(ctx context.Context, txHash string) (*txtypes.GetTxResponse, error)
WaitForTxInclusion waits for a transaction to reach a final state using a websocket subscriber when possible and falling back to periodic gRPC polling. A new waiter (and therefore a new websocket subscription) is created for each invocation, so sequential callers should expect a new CometBFT RPC client per call. Timeouts are driven entirely by the caller-provided context (the waiter timeout argument remains zero intentionally). It respects the context for cancellation or deadlines.
type Config ¶
type Config struct {
ChainID string
GRPCAddr string
RPCEndpoint string
Timeout time.Duration
MaxRecvMsgSize int
MaxSendMsgSize int
WaitTx clientconfig.WaitTxConfig
}
Config for blockchain client
type QueryOption ¶
type QueryOption interface {
ApplyToActionQuery(*actiontypes.QueryListActionsRequest)
}
QueryOption is a functional option for queries
func WithActionState ¶
func WithActionState(state actiontypes.ActionState) QueryOption
WithActionState filters by action state enum
func WithActionStateEnum ¶
func WithActionStateEnum(st actiontypes.ActionState) QueryOption
WithActionStateEnum is an alias for WithActionState for clarity
func WithActionStateStr ¶
func WithActionStateStr(s string) QueryOption
WithActionStateStr parses a string into an enum (case-insensitive), falling back to zero value if unknown
func WithActionType ¶
func WithActionType(actionType actiontypes.ActionType) QueryOption
WithActionType filters by action type enum
func WithActionTypeEnum ¶
func WithActionTypeEnum(t actiontypes.ActionType) QueryOption
WithActionTypeEnum is an alias for WithActionType for clarity
func WithActionTypeStr ¶
func WithActionTypeStr(s string) QueryOption
WithActionTypeStr parses a string into an enum (case-insensitive), falling back to zero value if unknown
func WithPagination ¶
func WithPagination(limit, offset uint64) QueryOption
WithPagination sets pagination parameters
type SuperNodeClient ¶
type SuperNodeClient struct {
// contains filtered or unexported fields
}
SuperNodeClient provides supernode module operations
func (*SuperNodeClient) GetSuperNode ¶
func (s *SuperNodeClient) GetSuperNode(ctx context.Context, validatorAddr string) (*types.SuperNode, error)
GetSuperNode retrieves a supernode by validator address
func (*SuperNodeClient) GetSuperNodeBySuperNodeAddress ¶
func (s *SuperNodeClient) GetSuperNodeBySuperNodeAddress(ctx context.Context, supernodeAddress string) (*types.SuperNode, error)
GetSuperNodeBySuperNodeAddress retrieves a supernode by its supernode account address.
func (*SuperNodeClient) GetTopSuperNodesForBlock ¶
func (s *SuperNodeClient) GetTopSuperNodesForBlock(ctx context.Context, blockHeight int32) ([]*supernodetypes.SuperNode, error)
GetTopSuperNodesForBlock retrieves top supernodes for a specific block
func (*SuperNodeClient) GetTopSuperNodesForBlockWithOptions ¶
func (s *SuperNodeClient) GetTopSuperNodesForBlockWithOptions(ctx context.Context, blockHeight int32, limit int32, state string) ([]*types.SuperNode, error)
GetTopSuperNodesForBlockWithOptions retrieves top supernodes for a block with optional limit and state filter.
func (*SuperNodeClient) ListSuperNodes ¶
func (s *SuperNodeClient) ListSuperNodes(ctx context.Context, limit, offset uint64) ([]*types.SuperNode, error)
ListSuperNodes returns a paginated list of supernodes (converted to SDK types).
func (*SuperNodeClient) Params ¶
func (s *SuperNodeClient) Params(ctx context.Context) (*supernodetypes.Params, error)
Params retrieves the SuperNode module parameters.