queries

package
v0.1.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchStatus

type BatchStatus string
const (
	BatchStatusSIGNED    BatchStatus = "SIGNED"
	BatchStatusBATCHED   BatchStatus = "BATCHED"
	BatchStatusFAILED    BatchStatus = "FAILED"
	BatchStatusCOMPLETED BatchStatus = "COMPLETED"
)

func (*BatchStatus) Scan

func (e *BatchStatus) Scan(src interface{}) error

type BillingAsset

type BillingAsset string
const (
	BillingAssetUsdc BillingAsset = "usdc"
)

func (*BillingAsset) Scan

func (e *BillingAsset) Scan(src interface{}) error

type ControlFlag

type ControlFlag struct {
	Key       string             `json:"key"`
	Enabled   bool               `json:"enabled"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Fee

type Fee struct {
	ID              int64              `json:"id"`
	PolicyID        pgtype.UUID        `json:"policy_id"`
	PublicKey       string             `json:"public_key"`
	TransactionType TransactionType    `json:"transaction_type"`
	Amount          int64              `json:"amount"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	FeeType         string             `json:"fee_type"`
	Metadata        []byte             `json:"metadata"`
	UnderlyingType  string             `json:"underlying_type"`
	UnderlyingID    string             `json:"underlying_id"`
}

type FeeBatch

type FeeBatch struct {
	ID             int64              `json:"id"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	TotalValue     int64              `json:"total_value"`
	Status         BatchStatus        `json:"status"`
	BatchCutoff    int32              `json:"batch_cutoff"`
	CollectionTxID pgtype.Text        `json:"collection_tx_id"`
}

type FeeBatchMember

type FeeBatchMember struct {
	BatchID int64 `json:"batch_id"`
	FeeID   int64 `json:"fee_id"`
}

type NullBatchStatus

type NullBatchStatus struct {
	BatchStatus BatchStatus `json:"batch_status"`
	Valid       bool        `json:"valid"` // Valid is true if BatchStatus is not NULL
}

func (*NullBatchStatus) Scan

func (ns *NullBatchStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullBatchStatus) Value

func (ns NullBatchStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullBillingAsset

type NullBillingAsset struct {
	BillingAsset BillingAsset `json:"billing_asset"`
	Valid        bool         `json:"valid"` // Valid is true if BillingAsset is not NULL
}

func (*NullBillingAsset) Scan

func (ns *NullBillingAsset) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullBillingAsset) Value

func (ns NullBillingAsset) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPluginCategory

type NullPluginCategory struct {
	PluginCategory PluginCategory `json:"plugin_category"`
	Valid          bool           `json:"valid"` // Valid is true if PluginCategory is not NULL
}

func (*NullPluginCategory) Scan

func (ns *NullPluginCategory) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPluginCategory) Value

func (ns NullPluginCategory) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPluginID

type NullPluginID struct {
	PluginID PluginID `json:"plugin_id"`
	Valid    bool     `json:"valid"` // Valid is true if PluginID is not NULL
}

func (*NullPluginID) Scan

func (ns *NullPluginID) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPluginID) Value

func (ns NullPluginID) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPricingAsset

type NullPricingAsset struct {
	PricingAsset PricingAsset `json:"pricing_asset"`
	Valid        bool         `json:"valid"` // Valid is true if PricingAsset is not NULL
}

func (*NullPricingAsset) Scan

func (ns *NullPricingAsset) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPricingAsset) Value

func (ns NullPricingAsset) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPricingFrequency

type NullPricingFrequency struct {
	PricingFrequency PricingFrequency `json:"pricing_frequency"`
	Valid            bool             `json:"valid"` // Valid is true if PricingFrequency is not NULL
}

func (*NullPricingFrequency) Scan

func (ns *NullPricingFrequency) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPricingFrequency) Value

func (ns NullPricingFrequency) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPricingMetric

type NullPricingMetric struct {
	PricingMetric PricingMetric `json:"pricing_metric"`
	Valid         bool          `json:"valid"` // Valid is true if PricingMetric is not NULL
}

func (*NullPricingMetric) Scan

func (ns *NullPricingMetric) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPricingMetric) Value

func (ns NullPricingMetric) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPricingType

type NullPricingType struct {
	PricingType PricingType `json:"pricing_type"`
	Valid       bool        `json:"valid"` // Valid is true if PricingType is not NULL
}

func (*NullPricingType) Scan

func (ns *NullPricingType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPricingType) Value

func (ns NullPricingType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTransactionType

type NullTransactionType struct {
	TransactionType TransactionType `json:"transaction_type"`
	Valid           bool            `json:"valid"` // Valid is true if TransactionType is not NULL
}

func (*NullTransactionType) Scan

func (ns *NullTransactionType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTransactionType) Value

func (ns NullTransactionType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTxIndexerStatus

type NullTxIndexerStatus struct {
	TxIndexerStatus TxIndexerStatus `json:"tx_indexer_status"`
	Valid           bool            `json:"valid"` // Valid is true if TxIndexerStatus is not NULL
}

func (*NullTxIndexerStatus) Scan

func (ns *NullTxIndexerStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTxIndexerStatus) Value

func (ns NullTxIndexerStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTxIndexerStatusOnchain

type NullTxIndexerStatusOnchain struct {
	TxIndexerStatusOnchain TxIndexerStatusOnchain `json:"tx_indexer_status_onchain"`
	Valid                  bool                   `json:"valid"` // Valid is true if TxIndexerStatusOnchain is not NULL
}

func (*NullTxIndexerStatusOnchain) Scan

func (ns *NullTxIndexerStatusOnchain) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTxIndexerStatusOnchain) Value

Value implements the driver Valuer interface.

type Plugin

type Plugin struct {
	ID             PluginID           `json:"id"`
	Title          string             `json:"title"`
	Description    string             `json:"description"`
	ServerEndpoint string             `json:"server_endpoint"`
	Category       PluginCategory     `json:"category"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
	LogoUrl        string             `json:"logo_url"`
	ThumbnailUrl   string             `json:"thumbnail_url"`
	Images         []byte             `json:"images"`
	Faqs           []byte             `json:"faqs"`
	Features       []byte             `json:"features"`
	Audited        bool               `json:"audited"`
}

type PluginApikey

type PluginApikey struct {
	ID        pgtype.UUID        `json:"id"`
	PluginID  PluginID           `json:"plugin_id"`
	Apikey    string             `json:"apikey"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
	Status    int32              `json:"status"`
}

type PluginCategory

type PluginCategory string
const (
	PluginCategoryAiAgent PluginCategory = "ai-agent"
	PluginCategoryPlugin  PluginCategory = "plugin"
	PluginCategoryApp     PluginCategory = "app"
)

func (*PluginCategory) Scan

func (e *PluginCategory) Scan(src interface{}) error

type PluginID

type PluginID string
const (
	PluginIDVultisigDca0000            PluginID = "vultisig-dca-0000"
	PluginIDVultisigPayroll0000        PluginID = "vultisig-payroll-0000"
	PluginIDVultisigFeesFeee           PluginID = "vultisig-fees-feee"
	PluginIDVultisigCopytrader0000     PluginID = "vultisig-copytrader-0000"
	PluginIDNbitsLabsMerkleE93d        PluginID = "nbits-labs-merkle-e93d"
	PluginIDVultisigRecurringSends0000 PluginID = "vultisig-recurring-sends-0000"
)

func (*PluginID) Scan

func (e *PluginID) Scan(src interface{}) error

type PluginInstallation

type PluginInstallation struct {
	PluginID    PluginID           `json:"plugin_id"`
	PublicKey   string             `json:"public_key"`
	InstalledAt pgtype.Timestamptz `json:"installed_at"`
}

type PluginPolicy

type PluginPolicy struct {
	ID            pgtype.UUID        `json:"id"`
	PublicKey     string             `json:"public_key"`
	PluginID      PluginID           `json:"plugin_id"`
	PluginVersion string             `json:"plugin_version"`
	PolicyVersion int32              `json:"policy_version"`
	Signature     string             `json:"signature"`
	Recipe        string             `json:"recipe"`
	Active        bool               `json:"active"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
	Deleted       bool               `json:"deleted"`
}

type PluginPolicyBilling

type PluginPolicyBilling struct {
	ID             pgtype.UUID          `json:"id"`
	Type           PricingType          `json:"type"`
	Frequency      NullPricingFrequency `json:"frequency"`
	StartDate      pgtype.Date          `json:"start_date"`
	Amount         int64                `json:"amount"`
	Asset          PricingAsset         `json:"asset"`
	PluginPolicyID pgtype.UUID          `json:"plugin_policy_id"`
}

type PluginPolicySync

type PluginPolicySync struct {
	ID        pgtype.UUID        `json:"id"`
	PolicyID  pgtype.UUID        `json:"policy_id"`
	PluginID  PluginID           `json:"plugin_id"`
	SyncType  int32              `json:"sync_type"`
	Signature pgtype.Text        `json:"signature"`
	Status    int32              `json:"status"`
	Reason    pgtype.Text        `json:"reason"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type PluginRating

type PluginRating struct {
	PluginID     PluginID           `json:"plugin_id"`
	AvgRating    pgtype.Numeric     `json:"avg_rating"`
	TotalRatings int32              `json:"total_ratings"`
	Rating1Count int32              `json:"rating_1_count"`
	Rating2Count int32              `json:"rating_2_count"`
	Rating3Count int32              `json:"rating_3_count"`
	Rating4Count int32              `json:"rating_4_count"`
	Rating5Count int32              `json:"rating_5_count"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type PluginTag

type PluginTag struct {
	PluginID PluginID    `json:"plugin_id"`
	TagID    pgtype.UUID `json:"tag_id"`
}

type Pricing

type Pricing struct {
	ID        pgtype.UUID          `json:"id"`
	Type      PricingType          `json:"type"`
	Frequency NullPricingFrequency `json:"frequency"`
	Amount    int64                `json:"amount"`
	Asset     PricingAsset         `json:"asset"`
	Metric    PricingMetric        `json:"metric"`
	PluginID  PluginID             `json:"plugin_id"`
	CreatedAt pgtype.Timestamptz   `json:"created_at"`
	UpdatedAt pgtype.Timestamptz   `json:"updated_at"`
}

type PricingAsset

type PricingAsset string
const (
	PricingAssetUsdc PricingAsset = "usdc"
)

func (*PricingAsset) Scan

func (e *PricingAsset) Scan(src interface{}) error

type PricingFrequency

type PricingFrequency string
const (
	PricingFrequencyDaily    PricingFrequency = "daily"
	PricingFrequencyWeekly   PricingFrequency = "weekly"
	PricingFrequencyBiweekly PricingFrequency = "biweekly"
	PricingFrequencyMonthly  PricingFrequency = "monthly"
)

func (*PricingFrequency) Scan

func (e *PricingFrequency) Scan(src interface{}) error

type PricingMetric

type PricingMetric string
const (
	PricingMetricFixed PricingMetric = "fixed"
)

func (*PricingMetric) Scan

func (e *PricingMetric) Scan(src interface{}) error

type PricingType

type PricingType string
const (
	PricingTypeOnce      PricingType = "once"
	PricingTypeRecurring PricingType = "recurring"
	PricingTypePerTx     PricingType = "per-tx"
)

func (*PricingType) Scan

func (e *PricingType) Scan(src interface{}) error

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) GetPluginByID

func (q *Queries) GetPluginByID(ctx context.Context, id PluginID) (*Plugin, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Review

type Review struct {
	ID        pgtype.UUID        `json:"id"`
	PluginID  NullPluginID       `json:"plugin_id"`
	PublicKey string             `json:"public_key"`
	Rating    int32              `json:"rating"`
	Comment   pgtype.Text        `json:"comment"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type Tag

type Tag struct {
	ID        pgtype.UUID        `json:"id"`
	Name      string             `json:"name"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type TransactionType

type TransactionType string
const (
	TransactionTypeDebit  TransactionType = "debit"
	TransactionTypeCredit TransactionType = "credit"
)

func (*TransactionType) Scan

func (e *TransactionType) Scan(src interface{}) error

type TxIndexer

type TxIndexer struct {
	ID            pgtype.UUID                `json:"id"`
	PluginID      string                     `json:"plugin_id"`
	TxHash        pgtype.Text                `json:"tx_hash"`
	ChainID       int32                      `json:"chain_id"`
	PolicyID      pgtype.UUID                `json:"policy_id"`
	TokenID       string                     `json:"token_id"`
	FromPublicKey string                     `json:"from_public_key"`
	ToPublicKey   string                     `json:"to_public_key"`
	ProposedTxHex string                     `json:"proposed_tx_hex"`
	Status        TxIndexerStatus            `json:"status"`
	StatusOnchain NullTxIndexerStatusOnchain `json:"status_onchain"`
	Lost          bool                       `json:"lost"`
	BroadcastedAt pgtype.Timestamp           `json:"broadcasted_at"`
	CreatedAt     pgtype.Timestamp           `json:"created_at"`
	UpdatedAt     pgtype.Timestamp           `json:"updated_at"`
	Amount        pgtype.Text                `json:"amount"`
}

type TxIndexerStatus

type TxIndexerStatus string
const (
	TxIndexerStatusPROPOSED TxIndexerStatus = "PROPOSED"
	TxIndexerStatusVERIFIED TxIndexerStatus = "VERIFIED"
	TxIndexerStatusSIGNED   TxIndexerStatus = "SIGNED"
)

func (*TxIndexerStatus) Scan

func (e *TxIndexerStatus) Scan(src interface{}) error

type TxIndexerStatusOnchain

type TxIndexerStatusOnchain string
const (
	TxIndexerStatusOnchainPENDING TxIndexerStatusOnchain = "PENDING"
	TxIndexerStatusOnchainSUCCESS TxIndexerStatusOnchain = "SUCCESS"
	TxIndexerStatusOnchainFAIL    TxIndexerStatusOnchain = "FAIL"
)

func (*TxIndexerStatusOnchain) Scan

func (e *TxIndexerStatusOnchain) Scan(src interface{}) error

type VaultToken

type VaultToken struct {
	ID         pgtype.UUID        `json:"id"`
	TokenID    string             `json:"token_id"`
	PublicKey  string             `json:"public_key"`
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	ExpiresAt  pgtype.Timestamptz `json:"expires_at"`
	LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
	RevokedAt  pgtype.Timestamptz `json:"revoked_at"`
	UpdatedAt  pgtype.Timestamptz `json:"updated_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL