Documentation
¶
Index ¶
- func New(transaction *Transaction, referenceBlockID flow.Identifier, ...) error
- type GormStore
- func (s *GormStore) GetOrCreateTransaction(txId string) (t *Transaction)
- func (s *GormStore) InsertTransaction(t *Transaction) error
- func (s *GormStore) Transaction(txId string) (t Transaction, err error)
- func (s *GormStore) TransactionForAccount(tType Type, address, txId string) (t Transaction, err error)
- func (s *GormStore) Transactions(o datastore.ListOptions) (tt []Transaction, err error)
- func (s *GormStore) TransactionsForAccount(tType Type, address string, o datastore.ListOptions) (tt []Transaction, err error)
- func (s *GormStore) UpdateTransaction(t *Transaction) error
- type JSONResponse
- type Service
- func (s *Service) Create(c context.Context, sync bool, proposerAddress string, raw templates.Raw, ...) (*jobs.Job, *Transaction, error)
- func (s *Service) Details(ctx context.Context, transactionId string) (*Transaction, error)
- func (s *Service) DetailsForAccount(ctx context.Context, tType Type, address, transactionId string) (*Transaction, error)
- func (s *Service) ExecuteScript(ctx context.Context, raw templates.Raw) (cadence.Value, error)
- func (s *Service) GetOrCreateTransaction(transactionId string) *Transaction
- func (s *Service) List(limit, offset int) ([]Transaction, error)
- func (s *Service) ListForAccount(tType Type, address string, limit, offset int) ([]Transaction, error)
- func (s *Service) UpdateTransaction(t *Transaction) error
- type Store
- type Transaction
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New( transaction *Transaction, referenceBlockID flow.Identifier, builder *templates.TransactionBuilder, tType Type, proposer, payer keys.Authorizer, authorizers []keys.Authorizer) error
Types ¶
type GormStore ¶
type GormStore struct {
// contains filtered or unexported fields
}
func NewGormStore ¶
func (*GormStore) GetOrCreateTransaction ¶
func (s *GormStore) GetOrCreateTransaction(txId string) (t *Transaction)
func (*GormStore) InsertTransaction ¶
func (s *GormStore) InsertTransaction(t *Transaction) error
func (*GormStore) Transaction ¶
func (s *GormStore) Transaction(txId string) (t Transaction, err error)
func (*GormStore) TransactionForAccount ¶ added in v0.6.0
func (s *GormStore) TransactionForAccount(tType Type, address, txId string) (t Transaction, err error)
func (*GormStore) Transactions ¶
func (s *GormStore) Transactions(o datastore.ListOptions) (tt []Transaction, err error)
func (*GormStore) TransactionsForAccount ¶ added in v0.6.0
func (s *GormStore) TransactionsForAccount(tType Type, address string, o datastore.ListOptions) (tt []Transaction, err error)
func (*GormStore) UpdateTransaction ¶
func (s *GormStore) UpdateTransaction(t *Transaction) error
type JSONResponse ¶ added in v0.6.0
type JSONResponse struct { TransactionId string `json:"transactionId"` TransactionType Type `json:"transactionType"` Events []flow.Event `json:"events,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
Transaction JSON HTTP response
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service defines the API for transaction HTTP handlers.
func NewService ¶
func NewService( cfg *configs.Config, store Store, km keys.Manager, fc *client.Client, wp *jobs.WorkerPool, ) *Service
NewService initiates a new transaction service.
func (*Service) DetailsForAccount ¶ added in v0.6.0
func (s *Service) DetailsForAccount(ctx context.Context, tType Type, address, transactionId string) (*Transaction, error)
DetailsForAccount returns a specific transaction.
func (*Service) ExecuteScript ¶
Execute a script
func (*Service) GetOrCreateTransaction ¶
func (s *Service) GetOrCreateTransaction(transactionId string) *Transaction
func (*Service) List ¶
func (s *Service) List(limit, offset int) ([]Transaction, error)
List returns all transactions in the datastore.
func (*Service) ListForAccount ¶ added in v0.6.0
func (s *Service) ListForAccount(tType Type, address string, limit, offset int) ([]Transaction, error)
ListForAccount returns all transactions in the datastore for a given account.
func (*Service) UpdateTransaction ¶
func (s *Service) UpdateTransaction(t *Transaction) error
type Store ¶
type Store interface { Transactions(opt datastore.ListOptions) ([]Transaction, error) Transaction(txId string) (Transaction, error) TransactionsForAccount(tType Type, address string, opt datastore.ListOptions) ([]Transaction, error) TransactionForAccount(tType Type, address, txId string) (Transaction, error) GetOrCreateTransaction(txId string) *Transaction InsertTransaction(*Transaction) error UpdateTransaction(*Transaction) error }
Store manages data regarding transactions.
type Transaction ¶
type Transaction struct { TransactionId string `gorm:"column:transaction_id;primaryKey"` TransactionType Type `gorm:"column:transaction_type;index"` ProposerAddress string `gorm:"column:proposer_address;index"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index"` Events []flow.Event `gorm:"-"` }
Transaction is the database model for all transactions.
func (Transaction) TableName ¶ added in v0.6.0
func (Transaction) TableName() string
func (Transaction) ToJSONResponse ¶ added in v0.6.0
func (t Transaction) ToJSONResponse() JSONResponse
type Type ¶
type Type int
func StatusFromText ¶
func (Type) MarshalText ¶
func (*Type) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.