Documentation ¶
Index ¶
- Constants
- func ArgAsCadence(a Argument) (cadence.Value, error)
- func MustDecodeArgs(aa []Argument) []cadence.Value
- type Argument
- type CadenceArgument
- 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 JSONRequest
- type JSONResponse
- type ProposalKeyJSON
- type Service
- type ServiceImpl
- func (s *ServiceImpl) Create(ctx context.Context, sync bool, proposerAddress string, code string, ...) (*jobs.Job, *Transaction, error)
- func (s *ServiceImpl) Details(ctx context.Context, transactionId string) (*Transaction, error)
- func (s *ServiceImpl) DetailsForAccount(ctx context.Context, tType Type, address, transactionId string) (*Transaction, error)
- func (s *ServiceImpl) ExecuteScript(ctx context.Context, code string, args []Argument) (cadence.Value, error)
- func (s *ServiceImpl) GetOrCreateTransaction(transactionId string) *Transaction
- func (s *ServiceImpl) List(limit, offset int) ([]Transaction, error)
- func (s *ServiceImpl) ListForAccount(tType Type, address string, limit, offset int) ([]Transaction, error)
- func (s *ServiceImpl) Sign(ctx context.Context, proposerAddress string, code string, args []Argument) (*SignedTransaction, error)
- func (s *ServiceImpl) UpdateTransaction(t *Transaction) error
- type ServiceOption
- type SignedTransaction
- type SignedTransactionJSONResponse
- type Store
- type Transaction
- type TransactionSignatureJSON
- type Type
Constants ¶
View Source
const TransactionJobType = "transaction"
Variables ¶
This section is empty.
Functions ¶
func MustDecodeArgs ¶ added in v0.8.0
Types ¶
type CadenceArgument ¶ added in v0.7.0
type CadenceArgument interface{}
type GormStore ¶
type GormStore struct {
// contains filtered or unexported fields
}
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 JSONRequest ¶ added in v0.8.0
Transaction JSON HTTP request
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 ProposalKeyJSON ¶ added in v0.7.0
type Service ¶
type Service interface { Create(ctx context.Context, sync bool, proposerAddress string, code string, args []Argument, tType Type) (*jobs.Job, *Transaction, error) Sign(ctx context.Context, proposerAddress string, code string, args []Argument) (*SignedTransaction, error) List(limit, offset int) ([]Transaction, error) ListForAccount(tType Type, address string, limit, offset int) ([]Transaction, error) Details(ctx context.Context, transactionId string) (*Transaction, error) DetailsForAccount(ctx context.Context, tType Type, address, transactionId string) (*Transaction, error) ExecuteScript(ctx context.Context, code string, args []Argument) (cadence.Value, error) UpdateTransaction(t *Transaction) error GetOrCreateTransaction(transactionId string) *Transaction }
func NewService ¶
func NewService( cfg *configs.Config, store Store, km keys.Manager, fc flow_helpers.FlowClient, wp jobs.WorkerPool, opts ...ServiceOption, ) Service
NewService initiates a new transaction service.
type ServiceImpl ¶ added in v0.10.0
type ServiceImpl struct {
// contains filtered or unexported fields
}
ServiceImpl defines the API for transaction HTTP handlers.
func (*ServiceImpl) Details ¶ added in v0.10.0
func (s *ServiceImpl) Details(ctx context.Context, transactionId string) (*Transaction, error)
Details returns a specific transaction.
func (*ServiceImpl) DetailsForAccount ¶ added in v0.10.0
func (s *ServiceImpl) DetailsForAccount(ctx context.Context, tType Type, address, transactionId string) (*Transaction, error)
DetailsForAccount returns a specific transaction.
func (*ServiceImpl) ExecuteScript ¶ added in v0.10.0
func (s *ServiceImpl) ExecuteScript(ctx context.Context, code string, args []Argument) (cadence.Value, error)
Execute a script
func (*ServiceImpl) GetOrCreateTransaction ¶ added in v0.10.0
func (s *ServiceImpl) GetOrCreateTransaction(transactionId string) *Transaction
func (*ServiceImpl) List ¶ added in v0.10.0
func (s *ServiceImpl) List(limit, offset int) ([]Transaction, error)
List returns all transactions in the datastore.
func (*ServiceImpl) ListForAccount ¶ added in v0.10.0
func (s *ServiceImpl) ListForAccount(tType Type, address string, limit, offset int) ([]Transaction, error)
ListForAccount returns all transactions in the datastore for a given account.
func (*ServiceImpl) Sign ¶ added in v0.10.0
func (s *ServiceImpl) Sign(ctx context.Context, proposerAddress string, code string, args []Argument) (*SignedTransaction, error)
func (*ServiceImpl) UpdateTransaction ¶ added in v0.10.0
func (s *ServiceImpl) UpdateTransaction(t *Transaction) error
type ServiceOption ¶ added in v0.9.0
type ServiceOption func(*ServiceImpl)
func WithTxRatelimiter ¶ added in v0.9.0
func WithTxRatelimiter(limiter ratelimit.Limiter) ServiceOption
type SignedTransaction ¶ added in v0.7.0
type SignedTransaction struct {
flow.Transaction
}
func (*SignedTransaction) ToJSONResponse ¶ added in v0.7.0
func (st *SignedTransaction) ToJSONResponse() (SignedTransactionJSONResponse, error)
type SignedTransactionJSONResponse ¶ added in v0.7.0
type SignedTransactionJSONResponse struct { Code string `json:"code"` Arguments [][]byte `json:"arguments"` ReferenceBlockID string `json:"referenceBlockId"` GasLimit uint64 `json:"gasLimit"` ProposalKey ProposalKeyJSON `json:"proposalKey"` Payer string `json:"payer"` Authorizers []string `json:"authorizers"` PayloadSignatures []TransactionSignatureJSON `json:"payloadSignatures"` EnvelopeSignatures []TransactionSignatureJSON `json:"envelopeSignatures"` }
Signatures JSON HTTP response
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.
func NewGormStore ¶
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"` FlowTransaction []byte `gorm:"column:flow_transaction;type:bytes"` 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 TransactionSignatureJSON ¶ added in v0.7.0
type Type ¶
type Type int
func StatusFromText ¶
func (Type) MarshalText ¶
func (*Type) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.