Documentation ¶
Index ¶
- type Account
- func (a *Account) Call(txn []byte, bn *int64, fromArchival bool) (*string, error)
- func (a *Account) ChainId() (*common.Uint256, error)
- func (a *Account) Close()
- func (a *Account) GetBalance(addr []byte, bn *int64, fromArchival bool) (*common.Uint256, error)
- func (a *Account) GetCode(addr []byte, bn *int64, fromArchival bool) (*string, error)
- func (a *Account) GetStorageAt(args []byte, bn *int64, fromArchival bool) (*string, error)
- func (a *Account) GetTransactionCount(addr []byte, bn *int64, fromArchival bool) (*common.Uint256, error)
- func (a *Account) SendRawTransaction(txn []byte) (*string, error)
- type CRC32Mapper
- type RoundRobinMapper
- type TxnMapper
- type TxnProcessor
- type TxnQ
- type TxnReq
- type TxnResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func NewAccount ¶
func NewAccount(config *endpoint.EngineConfig) (*Account, error)
func (*Account) Close ¶
func (a *Account) Close()
Close gracefully stops the underlying TxnProcessor, also see TxnProcessor.Close()
func (*Account) GetBalance ¶
func (*Account) GetStorageAt ¶
func (*Account) GetTransactionCount ¶
type CRC32Mapper ¶
type CRC32Mapper struct{}
CRC32Mapper is a signer to key mapper implementation that uses crc32 hash to consistently distributes signers to keys. This ensures that same signers are mapped to same key
type RoundRobinMapper ¶
type RoundRobinMapper struct {
// contains filtered or unexported fields
}
RoundRobinMapper is a signer to key mapper implementation that equally distributes signers to keys
type TxnProcessor ¶
type TxnProcessor struct {
// contains filtered or unexported fields
}
func NewTxnProcessor ¶
func NewTxnProcessor(config *endpoint.EngineConfig, account *near.Account, archivalAccount *near.Account) (*TxnProcessor, error)
NewTxnProcessor creates and starts transaction processor which is responsible for sending received Eth transaction to Near in a controlled fashion. Also see, TxnProcessor.Submit(*TxnReq)
func (*TxnProcessor) Close ¶
func (tp *TxnProcessor) Close()
Close gracefully stops TxnProcessor, i.e.: waits for all received transactions to be completed.
func (*TxnProcessor) NewTxnReq ¶
func (tp *TxnProcessor) NewTxnReq(rawTxn []byte) (*TxnReq, error)
NewTxnReq creates a new TxnReq from the raw transaction bytes. It also performs Sender Address, Gas Limit and Gas Price validations.
func (*TxnProcessor) Submit ¶
func (tp *TxnProcessor) Submit(req *TxnReq) *TxnResp
Submit starts the transaction processing for TxnReq. It returns a pointer to TxnResp which is a handle to get actual transaction response. Also see, TxnResp.Get()
type TxnQ ¶
type TxnQ[T any] struct { // contains filtered or unexported fields }
func (*TxnQ[T]) Cancel ¶
func (q *TxnQ[T]) Cancel()
Cancel closes the underlying Q without waiting for workers to drain the Q
func (*TxnQ[T]) Close ¶
func (q *TxnQ[T]) Close()
Close closes the underlying Q but waits for workers to drain the Q
func (*TxnQ[T]) Enqueue ¶
func (q *TxnQ[T]) Enqueue(data *T)
Enqueue pushes data to Q, if Q is full it blocks until a worker pops a data from Q
func (*TxnQ[T]) StartWorker ¶
func (q *TxnQ[T]) StartWorker(worker func(*T))
StartWorker attaches the given function as a consumer of the TxnQ. Whenever a new data present on the Q this function, with data as function parameter, runs. Multiple workers which consume the same Q, can be started by calling this function.
func (*TxnQ[T]) TryEnqueue ¶
TryEnqueue tries to push data to Q, if Q is full it returns false, otherwise true
type TxnReq ¶
type TxnReq struct {
// contains filtered or unexported fields
}
func (*TxnReq) Expired ¶
Expired returns true if transaction request time plus account.timeoutSeconds is greater than the current time, otherwise false
func (*TxnReq) RespondWithStatus ¶
func (req *TxnReq) RespondWithStatus(status txnStatus)
type TxnResp ¶
type TxnResp struct {
// contains filtered or unexported fields
}
func (*TxnResp) Get ¶
Get is a blocking call which waits for transaction response with timeout. It returns the transaction response or error. Successive Get calls on same TxnResp returns same result which was received at first call
func (*TxnResp) SetWithStatus ¶
func (resp *TxnResp) SetWithStatus(status txnStatus)