Documentation ¶
Index ¶
- func BuildTransaction(accountID, networkPassphrase string, operation, memo interface{}) (transaction *xdr.Transaction, err error)
- func TransactionHash(tx *xdr.Transaction, networkPassphrase string) ([32]byte, error)
- type Account
- type TransactionSubmitter
- func (ts *TransactionSubmitter) InitAccount(seed string) (err error)
- func (ts *TransactionSubmitter) LoadAccount(seed string) (*Account, error)
- func (ts *TransactionSubmitter) SignAndSubmitRawTransaction(paymentID *string, seed string, tx *xdr.Transaction) (response horizon.SubmitTransactionResponse, err error)
- func (ts *TransactionSubmitter) SubmitTransaction(paymentID *string, seed string, operation, memo interface{}) (response horizon.SubmitTransactionResponse, err error)
- type TransactionSubmitterInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTransaction ¶
func BuildTransaction(accountID, networkPassphrase string, operation, memo interface{}) (transaction *xdr.Transaction, err error)
BuildTransaction is used in compliance server. The sequence number in built transaction will be equal 0!
func TransactionHash ¶
func TransactionHash(tx *xdr.Transaction, networkPassphrase string) ([32]byte, error)
TransactionHash returns transaction hash for a given Transaction based on the network
Types ¶
type TransactionSubmitter ¶
type TransactionSubmitter struct { Horizon horizon.HorizonInterface Accounts map[string]*Account // seed => *Account AccountsMutex sync.Mutex EntityManager db.EntityManagerInterface Network build.Network // contains filtered or unexported fields }
TransactionSubmitter submits transactions to Stellar Network
func NewTransactionSubmitter ¶
func NewTransactionSubmitter( horizon horizon.HorizonInterface, entityManager db.EntityManagerInterface, networkPassphrase string, now func() time.Time, ) (ts TransactionSubmitter)
NewTransactionSubmitter creates a new TransactionSubmitter
func (*TransactionSubmitter) InitAccount ¶
func (ts *TransactionSubmitter) InitAccount(seed string) (err error)
InitAccount loads an account and returns error if it fails
func (*TransactionSubmitter) LoadAccount ¶
func (ts *TransactionSubmitter) LoadAccount(seed string) (*Account, error)
LoadAccount loads current state of Stellar account and creates a map entry if it didn't exist
func (*TransactionSubmitter) SignAndSubmitRawTransaction ¶
func (ts *TransactionSubmitter) SignAndSubmitRawTransaction(paymentID *string, seed string, tx *xdr.Transaction) (response horizon.SubmitTransactionResponse, err error)
SignAndSubmitRawTransaction will: - update sequence number of the transaction to the current one, - sign it, - submit it to the network.
func (*TransactionSubmitter) SubmitTransaction ¶
func (ts *TransactionSubmitter) SubmitTransaction(paymentID *string, seed string, operation, memo interface{}) (response horizon.SubmitTransactionResponse, err error)
SubmitTransaction builds and submits transaction to Stellar network
type TransactionSubmitterInterface ¶
type TransactionSubmitterInterface interface { SubmitTransaction(paymentID *string, seed string, operation, memo interface{}) (response horizon.SubmitTransactionResponse, err error) SignAndSubmitRawTransaction(paymentID *string, seed string, tx *xdr.Transaction) (response horizon.SubmitTransactionResponse, err error) }
TransactionSubmitterInterface helps mocking TransactionSubmitter