Documentation ¶
Index ¶
- type AccountData
- type AccountState
- type AccountStatus
- type AllotmentStrategy
- type Client
- type Connector
- type Input
- type IssuancePaymentStrategy
- type Output
- type Outputs
- type PayloadIssuanceData
- type ServerInfo
- type ServerInfos
- type WebClient
- func (c *WebClient) APIForEpoch(index iotago.EpochIndex) iotago.API
- func (c *WebClient) APIForSlot(index iotago.SlotIndex) iotago.API
- func (c *WebClient) APIForTime(t time.Time) iotago.API
- func (c *WebClient) APIForVersion(version iotago.Version) (iotago.API, error)
- func (c *WebClient) Client() *nodeclient.Client
- func (c *WebClient) CommittedAPI() iotago.API
- func (c *WebClient) GetBlockIssuance(slotIndex ...iotago.SlotIndex) (resp *apimodels.IssuanceBlockHeaderResponse, err error)
- func (c *WebClient) GetCongestion(accountID iotago.AccountID) (resp *apimodels.CongestionResponse, err error)
- func (c *WebClient) GetOutput(outputID iotago.OutputID) iotago.Output
- func (c *WebClient) GetOutputConfirmationState(outputID iotago.OutputID) string
- func (c *WebClient) GetTransaction(txID iotago.TransactionID) (tx *iotago.SignedTransaction, err error)
- func (c *WebClient) GetTransactionConfirmationState(txID iotago.TransactionID) string
- func (c *WebClient) Indexer() (nodeclient.IndexerClient, error)
- func (c *WebClient) LatestAPI() iotago.API
- func (c *WebClient) PostBlock(block *iotago.ProtocolBlock) (blockID iotago.BlockID, err error)
- func (c *WebClient) PostData(data []byte) (blkID string, err error)
- func (c *WebClient) URL() string
- type WebClients
- func (c *WebClients) AddClient(url string, setters ...options.Option[WebClient])
- func (c *WebClients) Clients(...bool) []Client
- func (c *WebClients) GetClient() Client
- func (c *WebClients) GetClients(numOfClt int) []Client
- func (c *WebClients) RemoveClient(url string)
- func (c *WebClients) ServerStatus(cltIdx int) (status *ServerInfo, err error)
- func (c *WebClients) ServersStatuses() ServerInfos
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountData ¶
type AccountData struct { Alias string Status AccountStatus Account blockhandler.Account OutputID iotago.OutputID Index uint64 }
type AccountState ¶
type AccountState struct { Alias string `serix:"0,lengthPrefixType=uint8"` AccountID iotago.AccountID `serix:"2"` PrivateKey ed25519.PrivateKey `serix:"3,lengthPrefixType=uint8"` OutputID iotago.OutputID `serix:"4"` Index uint64 `serix:"5"` }
func AccountStateFromAccountData ¶
func AccountStateFromAccountData(acc *AccountData) *AccountState
func (*AccountState) ToAccountData ¶
func (a *AccountState) ToAccountData() *AccountData
type AccountStatus ¶
type AccountStatus uint8
const ( AccountPending AccountStatus = iota AccountReady )
type AllotmentStrategy ¶
type AllotmentStrategy uint8
const ( AllotmentStrategyNone AllotmentStrategy = iota AllotmentStrategyMinCost AllotmentStrategyAll )
type Client ¶
type Client interface { Client() *nodeclient.Client Indexer() (nodeclient.IndexerClient, error) // URL returns a client API url. URL() (cltID string) // PostBlock sends a block to the Tangle via a given client. PostBlock(block *iotago.ProtocolBlock) (iotago.BlockID, error) // PostData sends the given data (payload) by creating a block in the backend. PostData(data []byte) (blkID string, err error) // GetTransactionConfirmationState returns the AcceptanceState of a given transaction ID. GetTransactionConfirmationState(txID iotago.TransactionID) string // GetOutput gets the output of a given outputID. GetOutput(outputID iotago.OutputID) iotago.Output // GetOutputConfirmationState gets the first unspent outputs of a given address. GetOutputConfirmationState(outputID iotago.OutputID) string // GetTransaction gets the transaction. GetTransaction(txID iotago.TransactionID) (resp *iotago.SignedTransaction, err error) // GetBlockIssuance returns the latest commitment and data needed to create a new block. GetBlockIssuance(...iotago.SlotIndex) (resp *apimodels.IssuanceBlockHeaderResponse, err error) // GetCongestion returns congestion data such as rmc or issuing readiness. GetCongestion(id iotago.AccountID) (resp *apimodels.CongestionResponse, err error) iotago.APIProvider }
type Connector ¶
type Connector interface { // ServersStatuses retrieves the connected server status for each client. ServersStatuses() ServerInfos // ServerStatus retrieves the connected server status. ServerStatus(cltIdx int) (status *ServerInfo, err error) // Clients returns list of all clients. Clients(...bool) []Client // GetClients returns the numOfClt client instances that were used the longest time ago. GetClients(numOfClt int) []Client // AddClient adds a client to WebClients based on provided GoShimmerAPI url. AddClient(url string, setters ...options.Option[WebClient]) // RemoveClient removes a client with the provided url from the WebClients. RemoveClient(url string) // GetClient returns the client instance that was used the longest time ago. GetClient() Client }
type IssuancePaymentStrategy ¶
type IssuancePaymentStrategy struct { AllotmentStrategy AllotmentStrategy IssuerAlias string }
type Output ¶
type Output struct { OutputID iotago.OutputID Address iotago.Address Index uint64 Balance iotago.BaseToken OutputStruct iotago.Output }
Output contains details of an output ID.
type PayloadIssuanceData ¶
type PayloadIssuanceData struct { Payload iotago.Payload CongestionResponse *apimodels.CongestionResponse }
type ServerInfo ¶
type ServerInfos ¶
type ServerInfos []*ServerInfo
type WebClient ¶
type WebClient struct {
// contains filtered or unexported fields
}
WebClient contains a GoShimmer web API to interact with a node.
func NewWebClient ¶
NewWebClient creates Connector from provided iota-core API urls.
func (*WebClient) APIForEpoch ¶
func (c *WebClient) APIForEpoch(index iotago.EpochIndex) iotago.API
func (*WebClient) APIForVersion ¶
func (*WebClient) Client ¶
func (c *WebClient) Client() *nodeclient.Client
func (*WebClient) CommittedAPI ¶
func (*WebClient) GetBlockIssuance ¶
func (*WebClient) GetCongestion ¶
func (*WebClient) GetOutputConfirmationState ¶
GetOutputConfirmationState gets the first unspent outputs of a given address.
func (*WebClient) GetTransaction ¶
func (c *WebClient) GetTransaction(txID iotago.TransactionID) (tx *iotago.SignedTransaction, err error)
GetTransaction gets the transaction.
func (*WebClient) GetTransactionConfirmationState ¶
func (c *WebClient) GetTransactionConfirmationState(txID iotago.TransactionID) string
GetTransactionConfirmationState returns the AcceptanceState of a given transaction ID.
func (*WebClient) Indexer ¶
func (c *WebClient) Indexer() (nodeclient.IndexerClient, error)
type WebClients ¶
type WebClients struct {
// contains filtered or unexported fields
}
WebClients is responsible for handling connections via GoShimmerAPI.
func NewWebClients ¶
func NewWebClients(urls []string, setters ...options.Option[WebClient]) *WebClients
NewWebClients creates Connector from provided GoShimmerAPI urls.
func (*WebClients) AddClient ¶
func (c *WebClients) AddClient(url string, setters ...options.Option[WebClient])
AddClient adds client to WebClients based on provided GoShimmerAPI url.
func (*WebClients) Clients ¶
func (c *WebClients) Clients(...bool) []Client
Clients returns list of all clients.
func (*WebClients) GetClient ¶
func (c *WebClients) GetClient() Client
GetClient returns the client instance that was used the longest time ago.
func (*WebClients) GetClients ¶
func (c *WebClients) GetClients(numOfClt int) []Client
GetClients returns the numOfClt client instances that were used the longest time ago.
func (*WebClients) RemoveClient ¶
func (c *WebClients) RemoveClient(url string)
RemoveClient removes client with the provided url from the WebClients.
func (*WebClients) ServerStatus ¶
func (c *WebClients) ServerStatus(cltIdx int) (status *ServerInfo, err error)
ServerStatus retrieves the connected server status.
func (*WebClients) ServersStatuses ¶
func (c *WebClients) ServersStatuses() ServerInfos
ServersStatuses retrieves the connected server status for each client.