Documentation
¶
Index ¶
- func BuildICAPacketData(msgs []*codectypes.Any) (icatypes.InterchainAccountPacketData, error)
- func BuildMsgSendTx(owner, connectionID string, relativeTimeout uint64, ...) (*controllertypes.MsgSendTx, error)
- func CreateApproveActionMessage(_ context.Context, actionID string, opts ...ApproveOption) (*actiontypes.MsgApproveAction, error)
- func CreateRequestActionMessage(_ context.Context, creator string, filePath string, opts ...UploadOption) (*actiontypes.MsgRequestAction, []byte, error)
- func PackApproveForICA(msg *actiontypes.MsgApproveAction) ([]byte, error)
- func PackRequestForICA(msg *actiontypes.MsgRequestAction) ([]byte, error)
- func SendApproveActionMessage(ctx context.Context, msg *actiontypes.MsgApproveAction, opts ...ApproveOption) (string, error)
- type ApproveOption
- type ApproveOptions
- type Client
- func (c *Client) Close() error
- func (c *Client) CreateApproveActionMessage(_ context.Context, creator string, actionID string) (*actiontypes.MsgApproveAction, error)
- func (c *Client) CreateRequestActionMessage(ctx context.Context, creator string, filePath string, options *UploadOptions) (*actiontypes.MsgRequestAction, []byte, error)
- func (c *Client) Download(ctx context.Context, actionID string, outputDir string, opts ...DownloadOption) (*types.DownloadResult, error)
- func (c *Client) SendApproveActionMessage(ctx context.Context, bc *blockchain.Client, msg *actiontypes.MsgApproveAction, ...) (*types.ActionResult, error)
- func (c *Client) SendRequestActionMessage(ctx context.Context, bc *blockchain.Client, msg *actiontypes.MsgRequestAction, ...) (*types.ActionResult, error)
- func (c *Client) SetLogger(logger sdklog.Logger)
- func (c *Client) SubscribeToAllEvents(ctx context.Context, handler sdkEvent.Handler) error
- func (c *Client) SubscribeToEvents(ctx context.Context, eventType sdkEvent.EventType, handler sdkEvent.Handler) error
- func (c *Client) Upload(ctx context.Context, creator string, bc *blockchain.Client, filePath string, ...) (*types.CascadeResult, error)
- func (c *Client) UploadToSupernode(ctx context.Context, actionID string, filePath string) (string, error)
- type Config
- type DownloadOption
- type DownloadOptions
- type TaskInfo
- type TaskManager
- type UploadOption
- type UploadOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildICAPacketData ¶
func BuildICAPacketData(msgs []*codectypes.Any) (icatypes.InterchainAccountPacketData, error)
BuildICAPacketData builds InterchainAccountPacketData for EXECUTE_TX with provided Any messages.
func BuildMsgSendTx ¶
func BuildMsgSendTx(owner, connectionID string, relativeTimeout uint64, packet icatypes.InterchainAccountPacketData) (*controllertypes.MsgSendTx, error)
BuildMsgSendTx constructs the controller-side MsgSendTx using provided owner/connection and packet data.
func CreateApproveActionMessage ¶
func CreateApproveActionMessage(_ context.Context, actionID string, opts ...ApproveOption) (*actiontypes.MsgApproveAction, error)
CreateApproveActionMessage builds a MsgApproveAction using options for creator address. Required: WithApproveCreator(...)
func CreateRequestActionMessage ¶
func CreateRequestActionMessage(_ context.Context, creator string, filePath string, opts ...UploadOption) (*actiontypes.MsgRequestAction, []byte, error)
CreateRequestActionMessage is a package-level helper that builds a MsgRequestAction for Cascade using only local file information (no network calls). It returns the constructed message and the metadata bytes used inside it.
This function mirrors (*Client).CreateRequestActionMessage but avoids depending on SuperNode SDK; it prepares minimal metadata from the provided file path so it can be used in offline ICA examples/tests.
func PackApproveForICA ¶
func PackApproveForICA(msg *actiontypes.MsgApproveAction) ([]byte, error)
PackApproveForICA packs a Lumera MsgApproveAction into protobuf Any bytes suitable for ICS-27 MsgSendTx.
func PackRequestForICA ¶
func PackRequestForICA(msg *actiontypes.MsgRequestAction) ([]byte, error)
PackRequestForICA packs a Lumera MsgRequestAction into protobuf Any bytes suitable for embedding into an ICS-27 controller transaction (MsgSendTx) on a remote chain.
The returned bytes are the protobuf serialization of google.protobuf.Any, with type_url set to the Lumera MsgRequestAction URL and value set to the message bytes.
func SendApproveActionMessage ¶
func SendApproveActionMessage(ctx context.Context, msg *actiontypes.MsgApproveAction, opts ...ApproveOption) (string, error)
SendApproveActionMessage signs, simulates and broadcasts the approve message using the provided blockchain client option. Returns tx hash.
Types ¶
type ApproveOption ¶
type ApproveOption func(*ApproveOptions)
func WithApproveBlockchain ¶
func WithApproveBlockchain(bc *blockchain.Client) ApproveOption
WithApproveBlockchain provides the blockchain client used for signing/broadcasting
func WithApproveCreator ¶
func WithApproveCreator(creator string) ApproveOption
WithApproveCreator sets the creator (Lumera account / ICA host address) for approve helpers
func WithApproveMemo ¶
func WithApproveMemo(memo string) ApproveOption
WithApproveMemo sets an optional memo (idempotency key or note)
type ApproveOptions ¶
type ApproveOptions struct {
Creator string
Memo string
Blockchain *blockchain.Client
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides access to cascade operations (wraps SuperNode SDK)
func (*Client) CreateApproveActionMessage ¶
func (c *Client) CreateApproveActionMessage(_ context.Context, creator string, actionID string) (*actiontypes.MsgApproveAction, error)
CreateApproveActionMessage constructs a MsgApproveAction without broadcasting it.
func (*Client) CreateRequestActionMessage ¶
func (c *Client) CreateRequestActionMessage(ctx context.Context, creator string, filePath string, options *UploadOptions) (*actiontypes.MsgRequestAction, []byte, error)
CreateRequestActionMessage builds Cascade metadata and constructs a MsgRequestAction without broadcasting it. Returns the built Cosmos message and the serialized metadata bytes used in the message.
func (*Client) Download ¶
func (c *Client) Download(ctx context.Context, actionID string, outputDir string, opts ...DownloadOption) (*types.DownloadResult, error)
Download downloads a file from Cascade
func (*Client) SendApproveActionMessage ¶
func (c *Client) SendApproveActionMessage(ctx context.Context, bc *blockchain.Client, msg *actiontypes.MsgApproveAction, memo string) (*types.ActionResult, error)
SendApproveActionMessage signs, simulates and broadcasts the provided approve message.
func (*Client) SendRequestActionMessage ¶
func (c *Client) SendRequestActionMessage(ctx context.Context, bc *blockchain.Client, msg *actiontypes.MsgRequestAction, memo string, options *UploadOptions) (*types.ActionResult, error)
SendRequestActionMessage signs, simulates and broadcasts the provided request message. "memo" can be used to pass an optional filename or idempotency key.
func (*Client) SubscribeToAllEvents ¶
SubscribeToAllEvents subscribes to all event types
func (*Client) SubscribeToEvents ¶
func (c *Client) SubscribeToEvents(ctx context.Context, eventType sdkEvent.EventType, handler sdkEvent.Handler) error
SubscribeToEvents subscribes to specific event types
func (*Client) Upload ¶
func (c *Client) Upload(ctx context.Context, creator string, bc *blockchain.Client, filePath string, opts ...UploadOption) (*types.CascadeResult, error)
Upload provides a one-shot convenience helper that performs:
- CreateRequestActionMessage
- SendRequestActionMessage
- UploadToSupernode
type Config ¶
type Config struct {
ChainID string
GRPCAddr string
Address string
KeyName string
Timeout time.Duration
}
Config for a cascade client
type DownloadOption ¶
type DownloadOption func(*DownloadOptions)
DownloadOption is a functional option for Download
type TaskManager ¶
type TaskManager struct {
// contains filtered or unexported fields
}
TaskManager manages task lifecycle
func NewTaskManager ¶
func NewTaskManager(client snsdk.Client) *TaskManager
NewTaskManager creates a new task manager
type UploadOption ¶
type UploadOption func(*UploadOptions)
UploadOption is a functional option for Upload
type UploadOptions ¶
type UploadOptions struct {
ID string // optional custom ID for the upload
Public bool // whether the uploaded file will be accessible publicly
}
UploadOptions configures cascade upload