Documentation
¶
Index ¶
- Variables
- func AllFromRowsStream[T any](ch <-chan RowsStream[T]) ([]T, error)
- func GetRowsStream[T any](ctx context.Context, pool *pgxpool.Pool, ...) <-chan RowsStream[T]
- type CreateTxDto
- type PostgresTxIndexStore
- func (p *PostgresTxIndexStore) CountByPolicyID(c context.Context, policyID uuid.UUID) (uint32, error)
- func (p *PostgresTxIndexStore) CreateTx(c context.Context, req CreateTxDto) (Tx, error)
- func (p *PostgresTxIndexStore) GetByPolicyID(c context.Context, policyID uuid.UUID, skip, take uint32) <-chan RowsStream[Tx]
- func (p *PostgresTxIndexStore) GetPendingTxs(ctx context.Context) <-chan RowsStream[Tx]
- func (p *PostgresTxIndexStore) GetTxByID(c context.Context, id uuid.UUID) (Tx, error)
- func (p *PostgresTxIndexStore) GetTxsInTimeRange(c context.Context, policyID uuid.UUID, from, to time.Time) <-chan RowsStream[Tx]
- func (p *PostgresTxIndexStore) SetLost(c context.Context, id uuid.UUID) error
- func (p *PostgresTxIndexStore) SetOnChainStatus(c context.Context, id uuid.UUID, status rpc.TxOnChainStatus) error
- func (p *PostgresTxIndexStore) SetSignedAndBroadcasted(c context.Context, id uuid.UUID, txHash string) error
- func (p *PostgresTxIndexStore) SetStatus(c context.Context, id uuid.UUID, status TxStatus) error
- type RowsStream
- type Tx
- type TxIndexerRepo
- type TxStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoTx = errors.New("transaction not found")
Functions ¶
func AllFromRowsStream ¶
func AllFromRowsStream[T any](ch <-chan RowsStream[T]) ([]T, error)
Types ¶
type CreateTxDto ¶
type PostgresTxIndexStore ¶
type PostgresTxIndexStore struct {
// contains filtered or unexported fields
}
func NewPostgresTxIndexStore ¶
func NewPostgresTxIndexStore(c context.Context, dsn string) (*PostgresTxIndexStore, error)
func NewRepo ¶
func NewRepo(pool *pgxpool.Pool) *PostgresTxIndexStore
func (*PostgresTxIndexStore) CountByPolicyID ¶
func (*PostgresTxIndexStore) CreateTx ¶
func (p *PostgresTxIndexStore) CreateTx(c context.Context, req CreateTxDto) (Tx, error)
func (*PostgresTxIndexStore) GetByPolicyID ¶
func (p *PostgresTxIndexStore) GetByPolicyID( c context.Context, policyID uuid.UUID, skip, take uint32, ) <-chan RowsStream[Tx]
func (*PostgresTxIndexStore) GetPendingTxs ¶
func (p *PostgresTxIndexStore) GetPendingTxs(ctx context.Context) <-chan RowsStream[Tx]
func (*PostgresTxIndexStore) GetTxsInTimeRange ¶
func (p *PostgresTxIndexStore) GetTxsInTimeRange( c context.Context, policyID uuid.UUID, from, to time.Time, ) <-chan RowsStream[Tx]
func (*PostgresTxIndexStore) SetOnChainStatus ¶
func (p *PostgresTxIndexStore) SetOnChainStatus(c context.Context, id uuid.UUID, status rpc.TxOnChainStatus) error
func (*PostgresTxIndexStore) SetSignedAndBroadcasted ¶
type RowsStream ¶
type Tx ¶
type Tx struct {
ID uuid.UUID `json:"id" validate:"required"`
PluginID types.PluginID `json:"plugin_id" validate:"required"`
TxHash *string `json:"tx_hash"`
ChainID int `json:"chain_id" validate:"required"`
PolicyID uuid.UUID `json:"policy_id" validate:"required"`
TokenID string `json:"token_id" validate:"required"`
FromPublicKey string `json:"from_public_key" validate:"required"`
ToPublicKey string `json:"to_public_key" validate:"required"`
ProposedTxHex string `json:"proposed_tx_hex" validate:"required"`
Status TxStatus `json:"status" validate:"required"`
StatusOnChain *rpc.TxOnChainStatus `json:"status_onchain"`
Lost bool `json:"lost"`
BroadcastedAt *time.Time `json:"broadcasted_at"`
CreatedAt time.Time `json:"created_at" validate:"required"`
UpdatedAt time.Time `json:"updated_at" validate:"required"`
}
type TxIndexerRepo ¶
type TxIndexerRepo interface {
SetStatus(ctx context.Context, id uuid.UUID, status TxStatus) error
SetLost(ctx context.Context, id uuid.UUID) error
SetSignedAndBroadcasted(ctx context.Context, id uuid.UUID, txHash string) error
SetOnChainStatus(ctx context.Context, id uuid.UUID, status rpc.TxOnChainStatus) error
GetPendingTxs(ctx context.Context) <-chan RowsStream[Tx]
CreateTx(ctx context.Context, req CreateTxDto) (Tx, error)
GetTxByID(ctx context.Context, id uuid.UUID) (Tx, error)
GetTxsInTimeRange(ctx context.Context, policyID uuid.UUID, from, to time.Time) <-chan RowsStream[Tx]
GetByPolicyID(ctx context.Context, policyID uuid.UUID, skip, take uint32) <-chan RowsStream[Tx]
CountByPolicyID(ctx context.Context, policyID uuid.UUID) (uint32, error)
}
Click to show internal directories.
Click to hide internal directories.