Documentation ¶
Index ¶
- type Config
- type CosmosClient
- type HubClient
- func (d *HubClient) GetBatchAtIndex(rollappID string, index uint64) (*settlement.ResultRetrieveBatch, error)
- func (d *HubClient) GetLatestBatch(rollappID string) (*settlement.ResultRetrieveBatch, error)
- func (d *HubClient) GetSequencers(rollappID string) ([]*types.Sequencer, error)
- func (d *HubClient) PostBatch(batch *types.Batch, daClient da.Client, daResult *da.ResultSubmitBatch) (settlement.PostBatchResp, error)
- func (d *HubClient) Start() error
- func (d *HubClient) Stop() error
- type LayerClient
- type Option
- type PostBatchResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { KeyringBackend cosmosaccount.KeyringBackend `json:"keyring_backend"` NodeAddress string `json:"node_address"` KeyRingHomeDir string `json:"keyring_home_dir"` DymAccountName string `json:"dym_account_name"` RollappID string `json:"rollapp_id"` GasLimit uint64 `json:"gas_limit"` GasPrices string `json:"gas_prices"` GasFees string `json:"gas_fees"` }
Config for the DymensionLayerClient
type CosmosClient ¶
type CosmosClient interface { Context() sdkclient.Context StartEventListener() error StopEventListener() error EventListenerQuit() <-chan struct{} SubscribeToEvents(ctx context.Context, subscriber string, query string, outCapacity ...int) (out <-chan ctypes.ResultEvent, err error) BroadcastTx(accountName string, msgs ...sdktypes.Msg) (cosmosclient.Response, error) GetRollappClient() rollapptypes.QueryClient GetSequencerClient() sequencertypes.QueryClient GetAccount(accountName string) (cosmosaccount.Account, error) }
CosmosClient is an interface for interacting with cosmos client chains. It is a wrapper around the cosmos client in order to provide with an interface which can be implemented by other clients and can easily be mocked for testing purposes. Currently it contains only the methods that are used by the dymension hub client.
func NewCosmosClient ¶
func NewCosmosClient(client cosmosclient.Client) CosmosClient
NewCosmosClient creates a new cosmos client
type HubClient ¶
type HubClient struct {
// contains filtered or unexported fields
}
HubClient is the client for the Dymension Hub.
func (*HubClient) GetBatchAtIndex ¶
func (d *HubClient) GetBatchAtIndex(rollappID string, index uint64) (*settlement.ResultRetrieveBatch, error)
GetBatchAtIndex returns the batch at the given index from the Dymension Hub.
func (*HubClient) GetLatestBatch ¶
func (d *HubClient) GetLatestBatch(rollappID string) (*settlement.ResultRetrieveBatch, error)
GetLatestBatch returns the latest batch from the Dymension Hub.
func (*HubClient) GetSequencers ¶
GetSequencers returns the sequence of the given rollapp.
func (*HubClient) PostBatch ¶
func (d *HubClient) PostBatch(batch *types.Batch, daClient da.Client, daResult *da.ResultSubmitBatch) (settlement.PostBatchResp, error)
PostBatch posts a batch to the Dymension Hub.
type LayerClient ¶
type LayerClient struct {
*settlement.BaseLayerClient
}
LayerClient is intended only for usage in tests.
type Option ¶
type Option func(*HubClient)
Option is a function that configures the HubClient.
func WithCosmosClient ¶
func WithCosmosClient(cosmosClient CosmosClient) Option
WithCosmosClient is an option that sets the CosmosClient.
type PostBatchResp ¶
type PostBatchResp struct {
// contains filtered or unexported fields
}
PostBatchResp is the response after posting a batch to the Dymension Hub.
func (PostBatchResp) GetCode ¶
func (d PostBatchResp) GetCode() uint32
GetCode returns the response code.
func (PostBatchResp) GetTxHash ¶
func (d PostBatchResp) GetTxHash() string
GetTxHash returns the transaction hash.