Documentation ¶
Index ¶
- func FirstPaymentOperationID(payments []Payment) string
- func InsertTestPayments(t *testing.T, ctx context.Context, payments []Payment, ...)
- func LastPaymentOperationID(payments []Payment) string
- func PrepareNamedQuery(ctx context.Context, connectionPool db.ConnectionPool, namedQuery string, ...) (string, []interface{}, error)
- type AccountModel
- type Models
- type Payment
- type PaymentModel
- func (m *PaymentModel) AddPayment(ctx context.Context, tx db.Transaction, payment Payment) error
- func (m *PaymentModel) GetLatestLedgerSynced(ctx context.Context, cursorName string) (uint32, error)
- func (m *PaymentModel) GetPaymentsPaginated(ctx context.Context, address string, beforeID, afterID string, sort SortOrder, ...) ([]Payment, bool, bool, error)
- func (m *PaymentModel) UpdateLatestLedgerSynced(ctx context.Context, cursorName string, ledger uint32) error
- type SortOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstPaymentOperationID ¶
func InsertTestPayments ¶
func LastPaymentOperationID ¶
func PrepareNamedQuery ¶
func PrepareNamedQuery(ctx context.Context, connectionPool db.ConnectionPool, namedQuery string, argsMap map[string]interface{}) (string, []interface{}, error)
PrepareNamedQuery prepares the given query replacing the named parameters with Postgres' bindvars. It returns an SQL Injection-safe query and the arguments array to be used alongside it.
Types ¶
type AccountModel ¶
type AccountModel struct {
DB db.ConnectionPool
}
func (*AccountModel) Delete ¶
func (m *AccountModel) Delete(ctx context.Context, address string) error
func (*AccountModel) Insert ¶
func (m *AccountModel) Insert(ctx context.Context, address string) error
func (*AccountModel) IsAccountFeeBumpEligible ¶
IsAccountFeeBumpEligible checks whether an account is eligible to have its transaction fee-bumped. Channel Accounts should be eligible because some of the transactions will have the channel accounts as the source account (i. e. create account sponsorship).
type Models ¶
type Models struct { Payments *PaymentModel Account *AccountModel }
type Payment ¶
type Payment struct { OperationID string `db:"operation_id" json:"operationId"` OperationType string `db:"operation_type" json:"operationType"` TransactionID string `db:"transaction_id" json:"transactionId"` TransactionHash string `db:"transaction_hash" json:"transactionHash"` FromAddress string `db:"from_address" json:"fromAddress"` ToAddress string `db:"to_address" json:"toAddress"` SrcAssetCode string `db:"src_asset_code" json:"srcAssetCode"` SrcAssetIssuer string `db:"src_asset_issuer" json:"srcAssetIssuer"` SrcAssetType string `db:"src_asset_type" json:"srcAssetType"` SrcAmount int64 `db:"src_amount" json:"srcAmount"` DestAssetCode string `db:"dest_asset_code" json:"destAssetCode"` DestAssetIssuer string `db:"dest_asset_issuer" json:"destAssetIssuer"` DestAssetType string `db:"dest_asset_type" json:"destAssetType"` DestAmount int64 `db:"dest_amount" json:"destAmount"` CreatedAt time.Time `db:"created_at" json:"createdAt"` Memo *string `db:"memo" json:"memo"` MemoType string `db:"memo_type" json:"memoType"` }
type PaymentModel ¶
type PaymentModel struct {
DB db.ConnectionPool
}
func (*PaymentModel) AddPayment ¶
func (m *PaymentModel) AddPayment(ctx context.Context, tx db.Transaction, payment Payment) error
func (*PaymentModel) GetLatestLedgerSynced ¶
func (*PaymentModel) GetPaymentsPaginated ¶
func (*PaymentModel) UpdateLatestLedgerSynced ¶
Click to show internal directories.
Click to hide internal directories.