steller

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) AccountDetail

func (cl *Client) AccountDetail(addr string) (horizon.Account, error)

func (*Client) GetEvents added in v1.9.2

func (cl *Client) GetEvents(ctx context.Context, eventFilter types.GetEventFilter) (*sorobanclient.LedgerEventResponse, error)

func (*Client) GetLatestLedger

func (cl *Client) GetLatestLedger(ctx context.Context) (*sorobanclient.LatestLedgerResponse, error)

func (*Client) GetTransaction

func (cl *Client) GetTransaction(ctx context.Context, txHash string) (*sorobanclient.TransactionResponse, error)

func (*Client) ParseTxnEvents added in v1.9.0

func (cl *Client) ParseTxnEvents(txn *horizon.Transaction, fl types.EventFilter) ([]types.Event, error)

func (*Client) SimulateTransaction

func (cl *Client) SimulateTransaction(txXDR string) (*sorobanclient.TxSimulationResult, error)

func (*Client) SubmitTransactionXDR

func (cl *Client) SubmitTransactionXDR(ctx context.Context, txXDR string) (*sorobanclient.TransactionResponse, error)

type Config

type Config struct {
	ChainID           string                         `json:"chain-id" yaml:"chain-id"`
	ChainName         string                         `json:"-t" yaml:"-"`
	HorizonUrl        string                         `json:"horizon-url" yaml:"horizon-url"`
	SorobanUrl        string                         `json:"soroban-url" yaml:"soroban-url"`
	Address           string                         `json:"address" yaml:"address"`
	Contracts         relayertypes.ContractConfigMap `json:"contracts" yaml:"contracts"`
	NID               string                         `json:"nid" yaml:"nid"`
	HomeDir           string                         `json:"home-dir" yaml:"home-dir"`
	MaxInclusionFee   uint64                         `json:"max-inclusion-fee" yaml:"max-inclusion-fee"` // in stroop: the smallest unit of a lumen, one ten-millionth of a lumen (.0000001 XLM).
	NetworkPassphrase string                         `json:"network-passphrase" yaml:"network-passphrase"`
	StartHeight       uint64                         `json:"start-height" yaml:"start-height"` // would be of highest priority
	Disabled          bool                           `json:"disabled" yaml:"disabled"`
	PollInterval      time.Duration                  `json:"poll-interval" yaml:"poll-interval"`
}

func (*Config) ContractsAddress added in v1.9.0

func (pc *Config) ContractsAddress() types.ContractConfigMap

func (*Config) Enabled

func (pc *Config) Enabled() bool

Enabled returns true if the chain is enabled

func (*Config) GetWallet

func (pc *Config) GetWallet() string

func (*Config) NewProvider

func (pc *Config) NewProvider(ctx context.Context, logger *zap.Logger, homePath string, debug bool, chainName string) (provider.ChainProvider, error)

func (*Config) SetWallet

func (pc *Config) SetWallet(addr string)

func (*Config) Validate

func (pc *Config) Validate() error

type IClient

type IClient interface {
	SimulateTransaction(txXDR string) (*sorobanclient.TxSimulationResult, error)

	SubmitTransactionXDR(ctx context.Context, txXDR string) (*sorobanclient.TransactionResponse, error)

	GetTransaction(ctx context.Context, txHash string) (*sorobanclient.TransactionResponse, error)

	AccountDetail(addr string) (horizon.Account, error)

	GetLatestLedger(ctx context.Context) (*sorobanclient.LatestLedgerResponse, error)

	GetEvents(ctx context.Context, eventFilter types.GetEventFilter) (*sorobanclient.LedgerEventResponse, error)

	ParseTxnEvents(txn *horizon.Transaction, fl types.EventFilter) ([]types.Event, error)
}

func NewClient

func NewClient(hClient *horizonclient.Client, srbClient *sorobanclient.Client) IClient

type Provider

type Provider struct {
	LastSavedHeightFunc func() uint64
	// contains filtered or unexported fields
}

func (*Provider) ClaimFee

func (p *Provider) ClaimFee(ctx context.Context) error

func (*Provider) Config

func (p *Provider) Config() provider.Config

func (*Provider) FetchTxMessages added in v1.9.0

func (p *Provider) FetchTxMessages(ctx context.Context, txHash string) ([]*relayertypes.Message, error)

func (*Provider) FinalityBlock

func (p *Provider) FinalityBlock(ctx context.Context) uint64

FinalityBlock returns the number of blocks the chain has to advance from current block inorder to consider it as final. In Steller ledgers are analogues to blocks and ledgers once published are final. So Steller doesn't need to be checked for block/ledger finality.

func (*Provider) GenerateMessages

func (p *Provider) GenerateMessages(ctx context.Context, fromHeight, toHeight uint64) ([]*relayertypes.Message, error)

func (*Provider) GetFee

func (p *Provider) GetFee(ctx context.Context, networkID string, responseFee bool) (uint64, error)

func (*Provider) ImportKeystore

func (p *Provider) ImportKeystore(ctx context.Context, keyPath, passphrase string) (string, error)

func (*Provider) Init

func (p *Provider) Init(ctx context.Context, homePath string, kms kms.KMS) error

func (*Provider) Listener

func (p *Provider) Listener(ctx context.Context, lastProcessedTx relayertypes.LastProcessedTx,
	blockInfo chan *relayertypes.BlockInfo) error

func (*Provider) MessageReceived

func (p *Provider) MessageReceived(ctx context.Context, key *relayertypes.MessageKey) (bool, error)

func (*Provider) NID

func (p *Provider) NID() string

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) NewKeystore

func (p *Provider) NewKeystore(password string) (string, error)

func (*Provider) QueryBalance

func (p *Provider) QueryBalance(ctx context.Context, addr string) (*relayertypes.Coin, error)

func (*Provider) QueryLatestHeight

func (p *Provider) QueryLatestHeight(ctx context.Context) (uint64, error)

func (*Provider) QueryTransactionReceipt

func (p *Provider) QueryTransactionReceipt(ctx context.Context, txHash string) (*relayertypes.Receipt, error)

func (*Provider) RestoreKeystore

func (p *Provider) RestoreKeystore(ctx context.Context) error

func (*Provider) RevertMessage

func (p *Provider) RevertMessage(ctx context.Context, sn *big.Int) error

func (*Provider) Route

func (p *Provider) Route(ctx context.Context, message *relayertypes.Message, callback relayertypes.TxResponseFunc) error

func (*Provider) SetAdmin

func (p *Provider) SetAdmin(ctx context.Context, admin string) error

func (*Provider) SetFee

func (p *Provider) SetFee(ctx context.Context, networkID string, msgFee, resFee *big.Int) error

func (*Provider) SetLastSavedHeightFunc

func (p *Provider) SetLastSavedHeightFunc(f func() uint64)

SetLastSavedBlockHeightFunc sets the function to save the last saved block height

func (*Provider) ShouldReceiveMessage

func (p *Provider) ShouldReceiveMessage(ctx context.Context, messagekey *relayertypes.Message) (bool, error)

func (*Provider) ShouldSendMessage

func (p *Provider) ShouldSendMessage(ctx context.Context, messageKey *relayertypes.Message) (bool, error)

func (*Provider) Type

func (p *Provider) Type() string

Type returns chain-type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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