postgresdriver

package
v2.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCloudSQLPGXPool

func NewCloudSQLPGXPool(options CloudSQLConfig) (*pgxpool.Pool, func() error, error)

NewCloudSQLPGXPool - Creates a pool of connections to a Cloud SQL instance using the provided CloudSQLConfig. - Uses the Cloud SQL Connector for Go and pgx for the connections. - Establishes a dialer with the desired options (like using private IP). - For each acquired connection from the pool, custom enum types are registered. - Returns the established connection pool. - It is important to note that this function will return an error if both PublicIP and PrivateIP are provided in the CloudSQLConfig.

func NewPGXPool

func NewPGXPool(connectionString string) (*pgxpool.Pool, func() error, error)

NewPGXPool - Creates a pool of connections to a PostgreSQL database using the provided connection string. - Parses the connection string into a pgx pool configuration object. - For each acquired connection from the pool, custom enum types are registered. - Returns the established connection pool. - This function is ideal for creating multiple reusable connections to a PostgreSQL database, particularly useful for handling multiple concurrent database operations.

func NewPGXPoolListener

func NewPGXPoolListener(pool *pgxpool.Pool, outCh chan *types.Notification) *pgxlisten.Listener

NewPGXPoolListener creates a new pgxlisten.Listener with a connection from the provided pool and output channel.

Types

type Account

type Account struct {
	ID                      types.AccountID    `json:"id"`
	Name                    pgtype.Text        `json:"name"`
	IconURL                 pgtype.Text        `json:"icon_url"`
	PlanType                pgtype.Text        `json:"plan_type"`
	PartnerChainIDs         []string           `json:"partner_chain_ids"`
	PartnerThroughputLimit  pgtype.Int4        `json:"partner_throughput_limit"`
	PartnerApplicationLimit pgtype.Int4        `json:"partner_application_limit"`
	EnterpriseLimit         pgtype.Int4        `json:"enterprise_limit"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	UpdatedAt               pgtype.Timestamptz `json:"updated_at"`
	Deleted                 bool               `json:"deleted"`
	DeletedAt               pgtype.Timestamptz `json:"deleted_at"`
}

type AccountIntegration

type AccountIntegration struct {
	ID                   int32              `json:"id"`
	AccountID            types.AccountID    `json:"account_id"`
	StripeSubscriptionID pgtype.Text        `json:"stripe_subscription_id"`
	CovalentAPIKeyFree   pgtype.Text        `json:"covalent_api_key_free"`
	CovalentAPIKeyPaid   pgtype.Text        `json:"covalent_api_key_paid"`
	CreatedAt            pgtype.Timestamptz `json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `json:"updated_at"`
}

type AccountNotification added in v2.5.0

type AccountNotification struct {
	ID          int32                  `json:"id"`
	AccountID   types.AccountID        `json:"account_id"`
	Active      bool                   `json:"active"`
	Type        types.NotificationType `json:"type"`
	Destination pgtype.Text            `json:"destination"`
	Trigger     pgtype.Text            `json:"trigger"`
	Events      []string               `json:"events"`
	UpdatedAt   pgtype.Timestamptz     `json:"updated_at"`
}

type AccountUser added in v2.5.0

type AccountUser struct {
	ID        int32              `json:"id"`
	UserID    types.UserID       `json:"user_id"`
	AccountID types.AccountID    `json:"account_id"`
	RoleName  types.RoleName     `json:"role_name"`
	Accepted  bool               `json:"accepted"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type AddGlobalBlockedContractParams

type AddGlobalBlockedContractParams struct {
	BlockedAddress types.BlockedAddress `json:"blocked_address"`
	CreatedAt      pgtype.Timestamptz   `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz   `json:"updated_at"`
}

type AuthProvider

type AuthProvider string
const (
	AuthProviderAuth0 AuthProvider = "auth0"
)

func (*AuthProvider) Scan

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

type AuthType

type AuthType string
const (
	AuthTypeAuth0Github   AuthType = "auth0_github"
	AuthTypeAuth0Username AuthType = "auth0_username"
	AuthTypeAuth0Google   AuthType = "auth0_google"
)

func (*AuthType) Scan

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

type Chain

type Chain struct {
	ID             types.RelayChainID `json:"id"`
	Blockchain     pgtype.Text        `json:"blockchain"`
	Description    pgtype.Text        `json:"description"`
	EnforceResult  pgtype.Text        `json:"enforce_result"`
	Ticker         pgtype.Text        `json:"ticker"`
	Path           pgtype.Text        `json:"path"`
	IconURL        pgtype.Text        `json:"icon_url"`
	RequestTimeout pgtype.Int4        `json:"request_timeout"`
	LogLimitBlocks pgtype.Int4        `json:"log_limit_blocks"`
	AllowedMethods []string           `json:"allowed_methods"`
	Active         bool               `json:"active"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
	Deleted        pgtype.Bool        `json:"deleted"`
	DeletedAt      pgtype.Timestamptz `json:"deleted_at"`
}

type ChainAlias

type ChainAlias struct {
	ChainID   types.RelayChainID `json:"chain_id"`
	Alias     types.ChainAlias   `json:"alias"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type ChainAliasDomain

type ChainAliasDomain struct {
	ChainID   types.RelayChainID `json:"chain_id"`
	Alias     types.ChainAlias   `json:"alias"`
	Domains   []string           `json:"domains"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type ChainAltruist

type ChainAltruist struct {
	ID        int32               `json:"id"`
	ChainID   types.RelayChainID  `json:"chain_id"`
	URL       types.AltruistURL   `json:"url"`
	Auth      pgtype.Text         `json:"auth"`
	AuthType  types.ChainAuthType `json:"auth_type"`
	CreatedAt pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt pgtype.Timestamptz  `json:"updated_at"`
}

type ChainAuthType

type ChainAuthType string
const (
	ChainAuthTypeBasicAuth   ChainAuthType = "basic_auth"
	ChainAuthTypeBearerToken ChainAuthType = "bearer_token"
	ChainAuthTypeNone        ChainAuthType = "none"
)

func (*ChainAuthType) Scan

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

type ChainCheck

type ChainCheck struct {
	ID         int32                `json:"id"`
	ChainID    types.RelayChainID   `json:"chain_id"`
	Type       types.ChainCheckType `json:"type"`
	Payload    pgtype.Text          `json:"payload"`
	ResultKey  pgtype.Text          `json:"result_key"`
	Allowance  pgtype.Int4          `json:"allowance"`
	EVMChainID pgtype.Int4          `json:"evm_chain_id"`
	CreatedAt  pgtype.Timestamptz   `json:"created_at"`
	UpdatedAt  pgtype.Timestamptz   `json:"updated_at"`
}

type ChainCheckType

type ChainCheckType string
const (
	ChainCheckTypeArchival ChainCheckType = "archival"
	ChainCheckTypeChain    ChainCheckType = "chain"
	ChainCheckTypeMerge    ChainCheckType = "merge"
	ChainCheckTypeSync     ChainCheckType = "sync"
)

func (*ChainCheckType) Scan

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

type ChainConfig added in v2.8.0

type ChainConfig struct {
	ID              int32       `json:"id"`
	ChainID         pgtype.Text `json:"chain_id"`
	ValidRange      pgtype.Int4 `json:"valid_range"`
	LogLimitBlocks  pgtype.Int4 `json:"log_limit_blocks"`
	ArchivalChainID pgtype.Text `json:"archival_chain_id"`
}

type ChainRow

type ChainRow struct {
	ID             types.RelayChainID `json:"id"`
	IconURL        string             `json:"icon_url"`
	Blockchain     string             `json:"blockchain"`
	Description    string             `json:"description"`
	EnforceResult  string             `json:"enforce_result"`
	Ticker         string             `json:"ticker"`
	Path           pgtype.Text        `json:"path"`
	RequestTimeout pgtype.Int4        `json:"request_timeout"`
	LogLimitBlocks pgtype.Int4        `json:"log_limit_blocks"`
	AllowedMethods []string           `json:"allowed_methods"`
	Active         bool               `json:"active"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
	Deleted        pgtype.Bool        `json:"deleted"`
	DeletedAt      pgtype.Timestamptz `json:"deleted_at"`
	ChainAltruists []byte             `json:"chain_altruists"`
	ChainChecks    []byte             `json:"chain_checks"`
	ChainAliases   []string           `json:"chain_aliases"`
	// DEPRECATED - TODO remove when move to only store aliases is complete
	AliasDomainsMap []byte `json:"alias_domains_map"`
}

type ChainsGigastakeApplication

type ChainsGigastakeApplication struct {
	ChainID                types.RelayChainID   `json:"chain_id"`
	GigastakeApplicationID types.GigastakeAppID `json:"gigastake_application_id"`
}

type CheckAccountUserAcceptedParams

type CheckAccountUserAcceptedParams struct {
	UserID    types.UserID    `json:"user_id"`
	AccountID types.AccountID `json:"account_id"`
}

type CheckAccountUserExistsParams

type CheckAccountUserExistsParams struct {
	UserID    types.UserID    `json:"user_id"`
	AccountID types.AccountID `json:"account_id"`
}

type CheckAccountUserRoleParams

type CheckAccountUserRoleParams struct {
	UserID    types.UserID    `json:"user_id"`
	AccountID types.AccountID `json:"account_id"`
}

type CheckAliasExistsParams

type CheckAliasExistsParams struct {
	ChainID types.RelayChainID `json:"chain_id"`
	Alias   types.ChainAlias   `json:"alias"`
}

type CheckIfAppWhitelistExistsParams

type CheckIfAppWhitelistExistsParams struct {
	ApplicationID types.PortalAppID   `json:"application_id"`
	Type          types.WhitelistType `json:"type"`
	Value         string              `json:"value"`
}

type CheckUserProviderExistsParams

type CheckUserProviderExistsParams struct {
	Email types.Email    `json:"email"`
	Type  types.AuthType `json:"type"`
}

type CloudSQLConfig

type CloudSQLConfig struct {
	DBUser                 string
	DBPassword             string
	DBName                 string
	InstanceConnectionName string
	PublicIP               string
	PrivateIP              string
}

The PostgresDriver struct satisfies the Driver interface which defines all database driver methods

type ConfigOpenapi added in v2.11.0

type ConfigOpenapi struct {
	ID          int32              `json:"id"`
	ChainID     types.RelayChainID `json:"chain_id"`
	OpenApiSpec []byte             `json:"open_api_spec"`
}

type CreateUserNewSignUpParams

type CreateUserNewSignUpParams struct {
	ID             types.UserID         `json:"id"`
	Email          types.Email          `json:"email"`
	CreatedAt      pgtype.Timestamptz   `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz   `json:"updated_at"`
	Type           types.AuthType       `json:"type"`
	Provider       types.AuthProvider   `json:"provider"`
	ProviderUserID types.ProviderUserID `json:"provider_user_id"`
	Federated      bool                 `json:"federated"`
}

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 DeleteAccountParams

type DeleteAccountParams struct {
	ID        types.AccountID    `json:"id"`
	DeletedAt pgtype.Timestamptz `json:"deleted_at"`
}

type DeleteAccountUserParams

type DeleteAccountUserParams struct {
	AccountID types.AccountID `json:"account_id"`
	UserID    types.UserID    `json:"user_id"`
}

type DeleteChainAliasDomainParams

type DeleteChainAliasDomainParams struct {
	ChainID types.RelayChainID `json:"chain_id"`
	Alias   types.ChainAlias   `json:"alias"`
}

type DeleteChainAliasParams

type DeleteChainAliasParams struct {
	ChainID types.RelayChainID `json:"chain_id"`
	Alias   types.ChainAlias   `json:"alias"`
}

type DeletePortalAppParams

type DeletePortalAppParams struct {
	ID        types.PortalAppID  `json:"id"`
	DeletedAt pgtype.Timestamptz `json:"deleted_at"`
}

type DeleteUnusedChainAliasDomainsParams

type DeleteUnusedChainAliasDomainsParams struct {
	ChainID types.RelayChainID `json:"chain_id"`
	Aliases []string           `json:"aliases"`
}

type DeleteUnusedChainAliasParams

type DeleteUnusedChainAliasParams struct {
	ChainID types.RelayChainID `json:"chain_id"`
	Aliases []string           `json:"aliases"`
}

type DeleteUnusedChainAltruistsParams

type DeleteUnusedChainAltruistsParams struct {
	ChainID types.RelayChainID `json:"chain_id"`
	URLs    []string           `json:"urls"`
}

type DeleteUnusedChainChecksParams

type DeleteUnusedChainChecksParams struct {
	ChainID types.RelayChainID     `json:"chain_id"`
	Types   []types.ChainCheckType `json:"types"`
}

type Environment

type Environment string
const (
	EnvironmentProduction Environment = "production"
	EnvironmentCanary     Environment = "canary"
	EnvironmentStaging    Environment = "staging"
	EnvironmentTest       Environment = "test"
	EnvironmentLocal      Environment = "local"
)

func (*Environment) Scan

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

type GatewayConfig added in v2.14.0

type GatewayConfig struct {
	Version       int32             `json:"version"`
	Environment   types.Environment `json:"environment"`
	Description   string            `json:"description"`
	Configuration []byte            `json:"configuration"`
}

type GetAccountOwnerRow

type GetAccountOwnerRow struct {
	AccountID        types.AccountID `json:"account_id"`
	UserID           types.UserID    `json:"user_id"`
	Email            types.Email     `json:"email"`
	IconURL          pgtype.Text     `json:"icon_url"`
	UpdatesProduct   pgtype.Bool     `json:"updates_product"`
	UpdatesMarketing pgtype.Bool     `json:"updates_marketing"`
	BetaTester       pgtype.Bool     `json:"beta_tester"`
}

type GetUserDataFromAuthProviderUserIDRow

type GetUserDataFromAuthProviderUserIDRow struct {
	ID               types.UserID       `json:"id"`
	Email            types.Email        `json:"email"`
	SignedUp         bool               `json:"signed_up"`
	IconURL          pgtype.Text        `json:"icon_url"`
	UpdatesProduct   pgtype.Bool        `json:"updates_product"`
	UpdatesMarketing pgtype.Bool        `json:"updates_marketing"`
	BetaTester       pgtype.Bool        `json:"beta_tester"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	AuthProviders    []byte             `json:"auth_providers"`
}

type GetUserDataFromPortalUserIDRow

type GetUserDataFromPortalUserIDRow struct {
	ID               types.UserID       `json:"id"`
	Email            types.Email        `json:"email"`
	SignedUp         bool               `json:"signed_up"`
	IconURL          pgtype.Text        `json:"icon_url"`
	UpdatesProduct   pgtype.Bool        `json:"updates_product"`
	UpdatesMarketing pgtype.Bool        `json:"updates_marketing"`
	BetaTester       pgtype.Bool        `json:"beta_tester"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	AuthProviders    []byte             `json:"auth_providers"`
}

type GetUserFieldsRow

type GetUserFieldsRow struct {
	Email            types.Email `json:"email"`
	SignedUp         bool        `json:"signed_up"`
	IconURL          pgtype.Text `json:"icon_url"`
	UpdatesProduct   pgtype.Bool `json:"updates_product"`
	UpdatesMarketing pgtype.Bool `json:"updates_marketing"`
	BetaTester       pgtype.Bool `json:"beta_tester"`
}

type GigastakeApplication

type GigastakeApplication struct {
	ID              types.GigastakeAppID `json:"id"`
	ProtocolID      types.ProtocolID     `json:"protocol_id"`
	Name            string               `json:"name"`
	Address         string               `json:"address"`
	PublicKey       string               `json:"public_key"`
	ClientPublicKey string               `json:"client_public_key"`
	Signature       string               `json:"signature"`
	Version         string               `json:"version"`
	CreatedAt       pgtype.Timestamptz   `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz   `json:"updated_at"`
	Deleted         bool                 `json:"deleted"`
	DeletedAt       pgtype.Timestamptz   `json:"deleted_at"`
}

type GlobalBlockedContract

type GlobalBlockedContract struct {
	ID             int32                `json:"id"`
	BlockedAddress types.BlockedAddress `json:"blocked_address"`
	Active         bool                 `json:"active"`
	CreatedAt      pgtype.Timestamptz   `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz   `json:"updated_at"`
}

type InsertAccountParams

type InsertAccountParams struct {
	ID        types.AccountID    `json:"id"`
	PlanType  pgtype.Text        `json:"plan_type"`
	Name      pgtype.Text        `json:"name"`
	IconURL   pgtype.Text        `json:"icon_url"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type InsertAccountUserAccessNoUserParams

type InsertAccountUserAccessNoUserParams struct {
	ID        types.UserID       `json:"id"`
	Email     types.Email        `json:"email"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	AccountID types.AccountID    `json:"account_id"`
	RoleName  types.RoleName     `json:"role_name"`
}

type InsertAccountUserParams added in v2.5.0

type InsertAccountUserParams struct {
	UserID    types.UserID       `json:"user_id"`
	AccountID types.AccountID    `json:"account_id"`
	RoleName  types.RoleName     `json:"role_name"`
	Accepted  bool               `json:"accepted"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	Email     types.Email        `json:"email"`
}

type InsertChainAliasParams

type InsertChainAliasParams struct {
	ChainID   types.RelayChainID `json:"chain_id"`
	Alias     types.ChainAlias   `json:"alias"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type InsertChainParams

type InsertChainParams struct {
	ID             types.RelayChainID `json:"id"`
	IconURL        pgtype.Text        `json:"icon_url"`
	Blockchain     pgtype.Text        `json:"blockchain"`
	Description    pgtype.Text        `json:"description"`
	EnforceResult  pgtype.Text        `json:"enforce_result"`
	Path           pgtype.Text        `json:"path"`
	Ticker         pgtype.Text        `json:"ticker"`
	RequestTimeout pgtype.Int4        `json:"request_timeout"`
	LogLimitBlocks pgtype.Int4        `json:"log_limit_blocks"`
	AllowedMethods []string           `json:"allowed_methods"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
}

type InsertGigastakeAppParams

type InsertGigastakeAppParams struct {
	ID              types.GigastakeAppID `json:"id"`
	ProtocolID      types.ProtocolID     `json:"protocol_id"`
	Name            string               `json:"name"`
	Address         string               `json:"address"`
	PublicKey       string               `json:"public_key"`
	ClientPublicKey string               `json:"client_public_key"`
	Signature       string               `json:"signature"`
	Version         string               `json:"version"`
	CreatedAt       pgtype.Timestamptz   `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz   `json:"updated_at"`
	ChainIDs        []string             `json:"chain_ids"`
}

type InsertPortalApplicationAATParams

type InsertPortalApplicationAATParams struct {
	ID                  types.ProtocolAppID      `json:"id"`
	PortalApplicationID types.PortalAppID        `json:"portal_application_id"`
	Address             string                   `json:"address"`
	PublicKey           types.PortalAppPublicKey `json:"public_key"`
	PrivateKey          pgtype.Text              `json:"private_key"`
	ClientPublicKey     string                   `json:"client_public_key"`
	Signature           string                   `json:"signature"`
	Version             string                   `json:"version"`
}

type InsertPortalApplicationParams

type InsertPortalApplicationParams struct {
	ID          types.PortalAppID  `json:"id"`
	AccountID   pgtype.Text        `json:"account_id"`
	Name        string             `json:"name"`
	Description pgtype.Text        `json:"description"`
	AppEmoji    pgtype.Text        `json:"app_emoji"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
}

type InsertPortalApplicationSettingParams

type InsertPortalApplicationSettingParams struct {
	ApplicationID     types.PortalAppID `json:"application_id"`
	SecretKey         pgtype.Text       `json:"secret_key"`
	SecretKeyRequired pgtype.Bool       `json:"secret_key_required"`
	MonthlyRelayLimit int32             `json:"monthly_relay_limit"`
	Environment       pgtype.Text       `json:"environment"`
}

type Listener

type Listener interface {
	Handle(channel string, handler pgxlisten.Handler)
	Listen(ctx context.Context) error
}

Listener interface establishes the structure for handling and listening to PostgreSQL notifications.

type ListenerMock

type ListenerMock struct {
	Notify chan *pgconn.Notification
	// contains filtered or unexported fields
}

ListenerMock simulates a listener that receives notifications from a PostgreSQL database.

func NewListenerMock

func NewListenerMock(outCh chan *types.Notification) *ListenerMock

func (*ListenerMock) Handle

func (l *ListenerMock) Handle(channel string, handler pgxlisten.Handler)

func (*ListenerMock) Listen

func (l *ListenerMock) Listen(ctx context.Context) error

func (*ListenerMock) MockEvent

func (l *ListenerMock) MockEvent(mainTableAction, sideTablesAction types.Action, content types.SavedOnDB)

MockEvent simulates a database event by sending mock notifications to the ListenerMock's Notify channel. To exclude main or side table actions simply pass an empty string as the parameter.

func (*ListenerMock) NotificationChannel

func (l *ListenerMock) NotificationChannel() <-chan *pgconn.Notification

NotificationChannel returns a channel that receives pq.Notification instances.

type MethodValidator added in v2.8.0

type MethodValidator struct {
	ID        int32                  `json:"id"`
	Method    string                 `json:"method"`
	Validator NullValidatorMethodStr `json:"validator"`
}

type NotificationEvent

type NotificationEvent string
const (
	NotificationEventFull          NotificationEvent = "full"
	NotificationEventHalf          NotificationEvent = "half"
	NotificationEventQuarter       NotificationEvent = "quarter"
	NotificationEventSignedUp      NotificationEvent = "signedUp"
	NotificationEventThreeQuarters NotificationEvent = "threeQuarters"
)

func (*NotificationEvent) Scan

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

type NotificationType

type NotificationType string
const (
	NotificationTypeEmail   NotificationType = "email"
	NotificationTypePortal  NotificationType = "portal"
	NotificationTypeWebhook NotificationType = "webhook"
)

func (*NotificationType) Scan

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

type NullAuthProvider

type NullAuthProvider struct {
	AuthProvider AuthProvider `json:"auth_provider"`
	Valid        bool         `json:"valid"` // Valid is true if AuthProvider is not NULL
}

func (*NullAuthProvider) Scan

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

Scan implements the Scanner interface.

func (NullAuthProvider) Value

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

Value implements the driver Valuer interface.

type NullAuthType

type NullAuthType struct {
	AuthType AuthType `json:"auth_type"`
	Valid    bool     `json:"valid"` // Valid is true if AuthType is not NULL
}

func (*NullAuthType) Scan

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

Scan implements the Scanner interface.

func (NullAuthType) Value

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

Value implements the driver Valuer interface.

type NullChainAuthType

type NullChainAuthType struct {
	ChainAuthType ChainAuthType `json:"chain_auth_type"`
	Valid         bool          `json:"valid"` // Valid is true if ChainAuthType is not NULL
}

func (*NullChainAuthType) Scan

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

Scan implements the Scanner interface.

func (NullChainAuthType) Value

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

Value implements the driver Valuer interface.

type NullChainCheckType

type NullChainCheckType struct {
	ChainCheckType ChainCheckType `json:"chain_check_type"`
	Valid          bool           `json:"valid"` // Valid is true if ChainCheckType is not NULL
}

func (*NullChainCheckType) Scan

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

Scan implements the Scanner interface.

func (NullChainCheckType) Value

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

Value implements the driver Valuer interface.

type NullEnvironment

type NullEnvironment struct {
	Environment Environment `json:"environment"`
	Valid       bool        `json:"valid"` // Valid is true if Environment is not NULL
}

func (*NullEnvironment) Scan

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

Scan implements the Scanner interface.

func (NullEnvironment) Value

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

Value implements the driver Valuer interface.

type NullNotificationEvent

type NullNotificationEvent struct {
	NotificationEvent NotificationEvent `json:"notification_event"`
	Valid             bool              `json:"valid"` // Valid is true if NotificationEvent is not NULL
}

func (*NullNotificationEvent) Scan

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

Scan implements the Scanner interface.

func (NullNotificationEvent) Value

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

Value implements the driver Valuer interface.

type NullNotificationType

type NullNotificationType struct {
	NotificationType NotificationType `json:"notification_type"`
	Valid            bool             `json:"valid"` // Valid is true if NotificationType is not NULL
}

func (*NullNotificationType) Scan

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

Scan implements the Scanner interface.

func (NullNotificationType) Value

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

Value implements the driver Valuer interface.

type NullPermissions

type NullPermissions struct {
	Permissions Permissions `json:"permissions"`
	Valid       bool        `json:"valid"` // Valid is true if Permissions is not NULL
}

func (*NullPermissions) Scan

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

Scan implements the Scanner interface.

func (NullPermissions) Value

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

Value implements the driver Valuer interface.

type NullProtocolID added in v2.13.0

type NullProtocolID struct {
	ProtocolID ProtocolID `json:"protocol_id"`
	Valid      bool       `json:"valid"` // Valid is true if ProtocolID is not NULL
}

func (*NullProtocolID) Scan added in v2.13.0

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

Scan implements the Scanner interface.

func (NullProtocolID) Value added in v2.13.0

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

Value implements the driver Valuer interface.

type NullValidatorMethodStr added in v2.8.0

type NullValidatorMethodStr struct {
	ValidatorMethodStr ValidatorMethodStr `json:"validator_method_str"`
	Valid              bool               `json:"valid"` // Valid is true if ValidatorMethodStr is not NULL
}

func (*NullValidatorMethodStr) Scan added in v2.8.0

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

Scan implements the Scanner interface.

func (NullValidatorMethodStr) Value added in v2.8.0

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

Value implements the driver Valuer interface.

type NullWhitelistType

type NullWhitelistType struct {
	WhitelistType WhitelistType `json:"whitelist_type"`
	Valid         bool          `json:"valid"` // Valid is true if WhitelistType is not NULL
}

func (*NullWhitelistType) Scan

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

Scan implements the Scanner interface.

func (NullWhitelistType) Value

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

Value implements the driver Valuer interface.

type PGXNotificationHandler

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

PGXNotificationHandler structure for handling PostgreSQL notifications.

func (*PGXNotificationHandler) HandleNotification

func (h *PGXNotificationHandler) HandleNotification(ctx context.Context, n *pgconn.Notification, conn *pgx.Conn) error

HandleNotification handles incoming PostgreSQL notifications by parsing them in a separate goroutine.

type PayPlan

type PayPlan struct {
	Name              pgtype.Text        `json:"name"`
	Description       pgtype.Text        `json:"description"`
	PlanType          types.PayPlanType  `json:"plan_type"`
	ChainIDs          []string           `json:"chain_ids"`
	MonthlyRelayLimit int32              `json:"monthly_relay_limit"`
	ThroughputLimit   int32              `json:"throughput_limit"`
	ApplicationLimit  int32              `json:"application_limit"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	DailyLimit        pgtype.Int4        `json:"daily_limit"`
}

type Permissions

type Permissions string
const (
	PermissionsReadEndpoint     Permissions = "read:endpoint"
	PermissionsWriteEndpoint    Permissions = "write:endpoint"
	PermissionsDeleteEndpoint   Permissions = "delete:endpoint"
	PermissionsTransferEndpoint Permissions = "transfer:endpoint"
)

func (*Permissions) Scan

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

type PortalApplication

type PortalApplication struct {
	ID          types.PortalAppID  `json:"id"`
	AccountID   pgtype.Text        `json:"account_id"`
	Name        string             `json:"name"`
	AppEmoji    pgtype.Text        `json:"app_emoji"`
	Description pgtype.Text        `json:"description"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
	Deleted     bool               `json:"deleted"`
	DeletedAt   pgtype.Timestamptz `json:"deleted_at"`
}

type PortalApplicationAat

type PortalApplicationAat struct {
	ID                  types.ProtocolAppID      `json:"id"`
	PortalApplicationID types.PortalAppID        `json:"portal_application_id"`
	Address             string                   `json:"address"`
	PublicKey           types.PortalAppPublicKey `json:"public_key"`
	ClientPublicKey     string                   `json:"client_public_key"`
	Signature           string                   `json:"signature"`
	PrivateKey          pgtype.Text              `json:"private_key"`
	Version             string                   `json:"version"`
}

type PortalApplicationSetting

type PortalApplicationSetting struct {
	ID                int32              `json:"id"`
	ApplicationID     types.PortalAppID  `json:"application_id"`
	MonthlyRelayLimit int32              `json:"monthly_relay_limit"`
	Environment       pgtype.Text        `json:"environment"`
	FavoritedChainIDs []string           `json:"favorited_chain_ids"`
	SecretKey         pgtype.Text        `json:"secret_key"`
	SecretKeyRequired pgtype.Bool        `json:"secret_key_required"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type PortalApplicationWhitelist

type PortalApplicationWhitelist struct {
	ID            int32               `json:"id"`
	ApplicationID types.PortalAppID   `json:"application_id"`
	Type          types.WhitelistType `json:"type"`
	Value         string              `json:"value"`
	ChainID       pgtype.Text         `json:"chain_id"`
	CreatedAt     pgtype.Timestamptz  `json:"created_at"`
}

type PostgresDriver

type PostgresDriver struct {
	*Queries
	DB *pgxpool.Pool
	// contains filtered or unexported fields
}

The PostgresDriver struct satisfies the Driver interface which defines all database driver methods

func NewPostgresDriver

func NewPostgresDriver(pool *pgxpool.Pool, listener Listener, notificationChannel chan *types.Notification) (*PostgresDriver, chan error, error)

NewPostgresDriver - Creates an instance of PostgresDriver using the provided pgx connection, Listener, and notification channel. - Initiates the listening of notifications in a separate goroutine. - Returns the created PostgresDriver instance.

func (*PostgresDriver) CloseListener

func (d *PostgresDriver) CloseListener()

CloseListener closes the notification channel and stops listening for PostgreSQL notifications.

func (*PostgresDriver) DeletePortalUser

func (pg *PostgresDriver) DeletePortalUser(ctx context.Context, userID types.UserID) (types.UserID, error)

DeletePortalUser deletes a portal User from the DB. WARNING will do a hard delete. Will also delete the user's `account_user_access` and `user_auth_providers` rows.

func (*PostgresDriver) NotificationChannel

func (pg *PostgresDriver) NotificationChannel() <-chan *types.Notification

NotificationChannel returns receiver Notification channel

func (*PostgresDriver) Ping

func (d *PostgresDriver) Ping(ctx context.Context) error

Ping ensures the database connection is healthy

func (*PostgresDriver) ReadAccounts

func (pg *PostgresDriver) ReadAccounts(ctx context.Context, options types.DriverOptions) (map[types.AccountID]*types.Account, error)

ReadAccounts returns all Accounts in the database as Accounts structs

func (*PostgresDriver) ReadAllUsers

func (pg *PostgresDriver) ReadAllUsers(ctx context.Context) (map[types.UserID]*types.User, error)

ReadAllUsers returns all users in the database as a map of User structs by UserID

func (*PostgresDriver) ReadBlockedContracts

func (pg *PostgresDriver) ReadBlockedContracts(ctx context.Context) (types.GlobalBlockedContracts, error)

ReadBlockedContracts returns all GlobalBlockedContracts in the DB

func (*PostgresDriver) ReadChains

func (pg *PostgresDriver) ReadChains(ctx context.Context, options types.DriverOptions) (map[types.RelayChainID]*types.Chain, error)

ReadChains returns all Chains in the database as Chains structs

func (*PostgresDriver) ReadGigastakeApps

func (pg *PostgresDriver) ReadGigastakeApps(ctx context.Context, options types.DriverOptions) (map[types.GigastakeAppID]*types.GigastakeApp, error)

ReadGigastakeApps returns all gigastake applications in the database as GigastakeApp structs

func (*PostgresDriver) ReadPlans

func (pg *PostgresDriver) ReadPlans(ctx context.Context) (map[types.PayPlanType]*types.Plan, error)

ReadPlans returns all Chains in the database as Chains structs

func (*PostgresDriver) ReadPortalApps

func (pg *PostgresDriver) ReadPortalApps(ctx context.Context, options types.DriverOptions) (map[types.PortalAppID]*types.PortalApp, error)

ReadPortalApps returns all portal applications in the database as PortalApp structs

func (*PostgresDriver) ReadUserIDsMap

func (pg *PostgresDriver) ReadUserIDsMap(ctx context.Context) (map[types.ProviderUserID]types.UserID, error)

ReadUserIDsMap returns all user IDs in the database mapped by their provider user IDs

func (*PostgresDriver) RemoveAccountUser

func (pg *PostgresDriver) RemoveAccountUser(ctx context.Context, userID types.UserID, accountID types.AccountID) error

RemoveAccountUser deletes a AccountUser row for a given user and account ID.

func (*PostgresDriver) RemoveBlockedContract

func (pg *PostgresDriver) RemoveBlockedContract(ctx context.Context, blockedAddress types.BlockedAddress) error

RemoveBlockedContract deletes a blocked address from the global blocked contracts table.

func (*PostgresDriver) SetAccountDeleted

func (pg *PostgresDriver) SetAccountDeleted(ctx context.Context, accountID types.AccountID, deletedAt time.Time) error

SetAccountDeleted updates a single Account in the database's Deleted field to true

func (*PostgresDriver) SetAccountUserRole

func (pg *PostgresDriver) SetAccountUserRole(ctx context.Context, updateAccountUser types.UpdateAccountUserRole, updatedAt time.Time) error

SetAccountUserRole updates the role for an existing AccountUser row. If transferring ownership the account owner becomes an admin.

func (*PostgresDriver) SetChainActiveStatus

func (pg *PostgresDriver) SetChainActiveStatus(ctx context.Context, chainID types.RelayChainID, active bool, updatedAt time.Time) (bool, error)

func (*PostgresDriver) SetPortalAppDeleted

func (pg *PostgresDriver) SetPortalAppDeleted(ctx context.Context, portalAppID types.PortalAppID, deletedAt time.Time) error

SetPortalAppDeleted updates a single PortalApp in the database's Deleted field to true

func (*PostgresDriver) UpdateAcceptAccountUser

func (pg *PostgresDriver) UpdateAcceptAccountUser(ctx context.Context, acceptAccountUser types.UpdateAcceptAccountUser, updatedAt time.Time) error

UpdateAcceptAccountUser creates a new portal UserAuthProvider in the DB when a user accepts their team invite. If they accept their invite it also updates `users.signed_up` and `account_user_access.accepted` fields to true. If they have declined their invite it will delete their `account_user_access` row and their `users` row if they have not yet signed up with an auth provider.

func (*PostgresDriver) UpdateAccount

func (pg *PostgresDriver) UpdateAccount(ctx context.Context, update types.UpdateAccount, updatedAt time.Time) (*types.Account, error)

UpdateAccount updates a single Account in the database's PlanType field

func (*PostgresDriver) UpdateBlockedContractActive

func (pg *PostgresDriver) UpdateBlockedContractActive(ctx context.Context, blockedAddress types.BlockedAddress, active bool, updatedAt time.Time) error

UpdateBlockedContractActive activates or deactives a blocked address in the global blocked contracts table.

func (*PostgresDriver) UpdateChain

func (pg *PostgresDriver) UpdateChain(ctx context.Context, update types.UpdateChain, updatedAt time.Time) (*types.Chain, error)

UpdateChain updates a single Chain in the database

func (*PostgresDriver) UpdateGigastakeApp

func (pg *PostgresDriver) UpdateGigastakeApp(ctx context.Context, gigastakeAppUpdate types.UpdateGigastakeApp, updatedAt time.Time) error

UpdateGigastakeApp updates a single GigastakeApp in the database.

func (*PostgresDriver) UpdatePortalApp

func (pg *PostgresDriver) UpdatePortalApp(ctx context.Context, update types.UpdatePortalApp, updatedAt time.Time) error

UpdatePortalApp updates a single PortalApp in the database: Name field and its Notifications, Whitelists and Settings

func (*PostgresDriver) UpdateUser

func (pg *PostgresDriver) UpdateUser(ctx context.Context, update types.UpdateUser, updatedAt time.Time) (*types.User, error)

UpdateUser updates a User's fields in the DB.

func (*PostgresDriver) UpsertAccountIntegration

func (pg *PostgresDriver) UpsertAccountIntegration(ctx context.Context, integrations types.AccountIntegrations) (*types.AccountIntegrations, error)

UpsertAccountIntegration saves or updates input AccountIntegrations in the database

func (*PostgresDriver) WriteAccount

func (pg *PostgresDriver) WriteAccount(ctx context.Context, creatorID types.UserID, account types.Account, createdAt time.Time) (*types.Account, error)

WriteAccount creates a single Account in the database, including its OWNER's AccountUser row

func (*PostgresDriver) WriteAccountUser

func (pg *PostgresDriver) WriteAccountUser(ctx context.Context, createAccountUser types.CreateAccountUser, createdAt time.Time) (types.UserID, error)

WriteAccountUser saves a single input AccountUser to the database.

func (*PostgresDriver) WriteBlockedContract

func (pg *PostgresDriver) WriteBlockedContract(ctx context.Context, blockedAddress types.BlockedAddress, createdAt time.Time) error

WriteBlockedContract adds a new blocked address to the global blocked contracts table.

func (*PostgresDriver) WriteChain

func (pg *PostgresDriver) WriteChain(ctx context.Context, chain types.Chain, createdAt time.Time) (*types.Chain, error)

WriteChain creates a single Chain in the database

func (*PostgresDriver) WriteChainAndGigastakeApps

func (pg *PostgresDriver) WriteChainAndGigastakeApps(ctx context.Context, input types.NewChainInput, createdAt time.Time) (*types.NewChainInput, error)

WriteChainAndGigastakeApp creates a single Chain along with its GigastakeApps in the database as a single transaction. Used specifically for running the `new-chains-ci` and adding a new Chain along with one or more GigastakeApps.

func (*PostgresDriver) WriteGigastakeApp

func (pg *PostgresDriver) WriteGigastakeApp(ctx context.Context, gigastakeApp *types.GigastakeApp, createdAt time.Time) (*types.GigastakeApp, error)

WriteGigastakeApp creates a single GigastakeApp in the database

func (*PostgresDriver) WritePortalApp

func (pg *PostgresDriver) WritePortalApp(ctx context.Context, portalApp types.PortalApp, aat types.AAT, createdAt time.Time) (*types.PortalApp, error)

WritePortalApp creates a single PortalApp in the database, including its AAT and Settings rows

func (*PostgresDriver) WriteUserNewSignUp

func (pg *PostgresDriver) WriteUserNewSignUp(ctx context.Context, user types.CreateUser, createdAt time.Time) (*types.User, types.AccountID, error)

WriteUserNewSignUp creates a new portal User and UserAuthProviderin the DB from a CreateUser input when a new user signs up. If a brand new user is created they need to have a default account so we also create a default Account for them using the free tier plan. If a new account is created for the user, the account ID is returned; otherwise it is an empty string.

type Protocol added in v2.12.0

type Protocol struct {
	ID        ProtocolID         `json:"id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	Deleted   bool               `json:"deleted"`
	DeletedAt pgtype.Timestamptz `json:"deleted_at"`
}

type ProtocolID added in v2.13.0

type ProtocolID string
const (
	ProtocolIDMorseMainnet   ProtocolID = "morse-mainnet"
	ProtocolIDShannonMainnet ProtocolID = "shannon-mainnet"
	ProtocolIDShannonTestnet ProtocolID = "shannon-testnet"
)

func (*ProtocolID) Scan added in v2.13.0

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

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddGlobalBlockedContract

func (q *Queries) AddGlobalBlockedContract(ctx context.Context, arg AddGlobalBlockedContractParams) error

func (*Queries) CheckAccountExists

func (q *Queries) CheckAccountExists(ctx context.Context, id types.AccountID) (bool, error)

func (*Queries) CheckAccountUserAccepted

func (q *Queries) CheckAccountUserAccepted(ctx context.Context, arg CheckAccountUserAcceptedParams) (bool, error)

func (*Queries) CheckAccountUserExists

func (q *Queries) CheckAccountUserExists(ctx context.Context, arg CheckAccountUserExistsParams) (bool, error)

func (*Queries) CheckAccountUserRole

func (q *Queries) CheckAccountUserRole(ctx context.Context, arg CheckAccountUserRoleParams) (types.RoleName, error)

func (*Queries) CheckAliasExists

func (q *Queries) CheckAliasExists(ctx context.Context, arg CheckAliasExistsParams) (bool, error)

func (*Queries) CheckChainExists

func (q *Queries) CheckChainExists(ctx context.Context, id types.RelayChainID) (bool, error)

func (*Queries) CheckGigastakeAppNameExists added in v2.12.0

func (q *Queries) CheckGigastakeAppNameExists(ctx context.Context, name string) (bool, error)

func (*Queries) CheckIDExists

func (q *Queries) CheckIDExists(ctx context.Context, id string) (bool, error)

func (*Queries) CheckIfAppWhitelistExists

func (q *Queries) CheckIfAppWhitelistExists(ctx context.Context, arg CheckIfAppWhitelistExistsParams) (bool, error)

func (*Queries) CheckPlanExists

func (q *Queries) CheckPlanExists(ctx context.Context, planType types.PayPlanType) (bool, error)

func (*Queries) CheckPlanTypeExists

func (q *Queries) CheckPlanTypeExists(ctx context.Context, planType types.PayPlanType) (bool, error)

func (*Queries) CheckPortalAppExists

func (q *Queries) CheckPortalAppExists(ctx context.Context, id types.PortalAppID) (bool, error)

func (*Queries) CheckUserAccountExists

func (q *Queries) CheckUserAccountExists(ctx context.Context, userID types.UserID) (bool, error)

func (*Queries) CheckUserEmail

func (q *Queries) CheckUserEmail(ctx context.Context, id types.UserID) (types.Email, error)

func (*Queries) CheckUserExists

func (q *Queries) CheckUserExists(ctx context.Context, id types.UserID) (bool, error)

func (*Queries) CheckUserHasOwnAccount added in v2.7.1

func (q *Queries) CheckUserHasOwnAccount(ctx context.Context, userID types.UserID) (bool, error)

func (*Queries) CheckUserIDFromEmail

func (q *Queries) CheckUserIDFromEmail(ctx context.Context, email types.Email) (types.UserID, error)

func (*Queries) CheckUserProviderExists

func (q *Queries) CheckUserProviderExists(ctx context.Context, arg CheckUserProviderExistsParams) (bool, error)

func (*Queries) CreateUserNewSignUp

func (q *Queries) CreateUserNewSignUp(ctx context.Context, arg CreateUserNewSignUpParams) (types.UserID, error)

func (*Queries) DeleteAccount

func (q *Queries) DeleteAccount(ctx context.Context, arg DeleteAccountParams) error

func (*Queries) DeleteAccountUser

func (q *Queries) DeleteAccountUser(ctx context.Context, arg DeleteAccountUserParams) error

func (*Queries) DeleteChainAlias

func (q *Queries) DeleteChainAlias(ctx context.Context, arg DeleteChainAliasParams) error

func (*Queries) DeleteChainAliasDomain

func (q *Queries) DeleteChainAliasDomain(ctx context.Context, arg DeleteChainAliasDomainParams) error

func (*Queries) DeletePortalApp

func (q *Queries) DeletePortalApp(ctx context.Context, arg DeletePortalAppParams) error

func (*Queries) DeleteUnusedChainAlias

func (q *Queries) DeleteUnusedChainAlias(ctx context.Context, arg DeleteUnusedChainAliasParams) error

func (*Queries) DeleteUnusedChainAliasDomains

func (q *Queries) DeleteUnusedChainAliasDomains(ctx context.Context, arg DeleteUnusedChainAliasDomainsParams) error

func (*Queries) DeleteUnusedChainAltruists

func (q *Queries) DeleteUnusedChainAltruists(ctx context.Context, arg DeleteUnusedChainAltruistsParams) error

func (*Queries) DeleteUnusedChainChecks

func (q *Queries) DeleteUnusedChainChecks(ctx context.Context, arg DeleteUnusedChainChecksParams) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id types.UserID) (types.UserID, error)

func (*Queries) GetAccountOwner

func (q *Queries) GetAccountOwner(ctx context.Context, accountID types.AccountID) (GetAccountOwnerRow, error)

func (*Queries) GetGigastakeApplicationsCount added in v2.12.0

func (q *Queries) GetGigastakeApplicationsCount(ctx context.Context) (int64, error)

func (*Queries) GetInvitedUserID added in v2.15.1

func (q *Queries) GetInvitedUserID(ctx context.Context, email types.Email) (types.UserID, error)

func (*Queries) GetLastCreatedUserID

func (q *Queries) GetLastCreatedUserID(ctx context.Context) (types.UserID, error)

func (*Queries) GetPlanDailyLimit

func (q *Queries) GetPlanDailyLimit(ctx context.Context, planType types.PayPlanType) (pgtype.Int4, error)

func (*Queries) GetPortalUserID

func (q *Queries) GetPortalUserID(ctx context.Context, providerUserID types.ProviderUserID) (types.UserID, error)

func (*Queries) GetUserDataFromAuthProviderUserID

func (q *Queries) GetUserDataFromAuthProviderUserID(ctx context.Context, providerUserID types.ProviderUserID) (GetUserDataFromAuthProviderUserIDRow, error)

func (*Queries) GetUserDataFromPortalUserID

func (q *Queries) GetUserDataFromPortalUserID(ctx context.Context, id types.UserID) (GetUserDataFromPortalUserIDRow, error)

func (*Queries) GetUserFields

func (q *Queries) GetUserFields(ctx context.Context, id types.UserID) (GetUserFieldsRow, error)

func (*Queries) GetUserIDFromEmail added in v2.15.2

func (q *Queries) GetUserIDFromEmail(ctx context.Context, email types.Email) (types.UserID, error)

func (*Queries) InsertAccount

func (q *Queries) InsertAccount(ctx context.Context, arg InsertAccountParams) (Account, error)

func (*Queries) InsertAccountUser added in v2.5.0

func (q *Queries) InsertAccountUser(ctx context.Context, arg InsertAccountUserParams) (types.UserID, error)

func (*Queries) InsertAccountUserAccessNoUser

func (q *Queries) InsertAccountUserAccessNoUser(ctx context.Context, arg InsertAccountUserAccessNoUserParams) (types.UserID, error)

func (*Queries) InsertChain

func (q *Queries) InsertChain(ctx context.Context, arg InsertChainParams) (types.RelayChainID, error)

func (*Queries) InsertChainAlias

func (q *Queries) InsertChainAlias(ctx context.Context, arg InsertChainAliasParams) error

func (*Queries) InsertGigastakeApp

func (q *Queries) InsertGigastakeApp(ctx context.Context, arg InsertGigastakeAppParams) error

func (*Queries) InsertPortalApplication

func (q *Queries) InsertPortalApplication(ctx context.Context, arg InsertPortalApplicationParams) (PortalApplication, error)

func (*Queries) InsertPortalApplicationAAT

func (q *Queries) InsertPortalApplicationAAT(ctx context.Context, arg InsertPortalApplicationAATParams) (PortalApplicationAat, error)

func (*Queries) InsertPortalApplicationSetting

func (q *Queries) InsertPortalApplicationSetting(ctx context.Context, arg InsertPortalApplicationSettingParams) (PortalApplicationSetting, error)

func (*Queries) IsUserExisting added in v2.15.2

func (q *Queries) IsUserExisting(ctx context.Context, email types.Email) (bool, error)

func (*Queries) IsUserInvited added in v2.15.2

func (q *Queries) IsUserInvited(ctx context.Context, email types.Email) (bool, error)

func (*Queries) IsUserNew added in v2.15.2

func (q *Queries) IsUserNew(ctx context.Context, email types.Email) (bool, error)

func (*Queries) ReadGatewayConfig added in v2.14.0

func (q *Queries) ReadGatewayConfig(ctx context.Context) (map[types.Environment]types.GatewayConfig, error)

ReadGatewayConfig reads the raw JSON config from the database

func (*Queries) ReadOpenAPISpecs added in v2.11.0

func (q *Queries) ReadOpenAPISpecs(ctx context.Context) (map[types.RelayChainID]json.RawMessage, error)

ReadOpenAPISpecs reads the chain OpenAPI specs from the database

func (*Queries) ReadValidatorConfig added in v2.8.0

func (q *Queries) ReadValidatorConfig(ctx context.Context) (*types.ValidatorPluginConfig, error)

ReadValidatorConfig reads the method validator plugin config from the database

func (*Queries) RemoveGlobalBlockedContract

func (q *Queries) RemoveGlobalBlockedContract(ctx context.Context, blockedAddress types.BlockedAddress) (int32, error)

func (*Queries) SelectAccount

func (q *Queries) SelectAccount(ctx context.Context, id types.AccountID) (SelectAccountRow, error)

func (*Queries) SelectAccounts

func (q *Queries) SelectAccounts(ctx context.Context, dollar_1 bool) ([]SelectAccountsRow, error)

func (*Queries) SelectAllUsers

func (q *Queries) SelectAllUsers(ctx context.Context) ([]SelectAllUsersRow, error)

func (*Queries) SelectChain

func (q *Queries) SelectChain(ctx context.Context, id types.RelayChainID) (SelectChainRow, error)

func (*Queries) SelectChains

func (q *Queries) SelectChains(ctx context.Context, includeDeleted bool) ([]SelectChainsRow, error)

func (*Queries) SelectGigastakeApplications

func (q *Queries) SelectGigastakeApplications(ctx context.Context) ([]SelectGigastakeApplicationsRow, error)

func (*Queries) SelectGlobalBlockedContract

func (q *Queries) SelectGlobalBlockedContract(ctx context.Context) ([]SelectGlobalBlockedContractRow, error)

func (*Queries) SelectLatestConfigurations added in v2.14.0

func (q *Queries) SelectLatestConfigurations(ctx context.Context) ([]SelectLatestConfigurationsRow, error)

func (*Queries) SelectOpenAPISpecs added in v2.11.0

func (q *Queries) SelectOpenAPISpecs(ctx context.Context) ([]ConfigOpenapi, error)

func (*Queries) SelectPlans

func (q *Queries) SelectPlans(ctx context.Context) ([]SelectPlansRow, error)

func (*Queries) SelectPortalApplications

func (q *Queries) SelectPortalApplications(ctx context.Context, dollar_1 bool) ([]SelectPortalApplicationsRow, error)

func (*Queries) SelectUserIDs

func (q *Queries) SelectUserIDs(ctx context.Context) ([]SelectUserIDsRow, error)

func (*Queries) SelectUserPermissions

func (q *Queries) SelectUserPermissions(ctx context.Context) ([]SelectUserPermissionsRow, error)

func (*Queries) SelectValidatorChainConfig added in v2.8.0

func (q *Queries) SelectValidatorChainConfig(ctx context.Context) ([]SelectValidatorChainConfigRow, error)

func (*Queries) SelectValidatorMethodConfig added in v2.8.0

func (q *Queries) SelectValidatorMethodConfig(ctx context.Context) ([]SelectValidatorMethodConfigRow, error)

func (*Queries) SetGlobalBlockedContractActive

func (q *Queries) SetGlobalBlockedContractActive(ctx context.Context, arg SetGlobalBlockedContractActiveParams) (int32, error)

func (*Queries) UpdateAccountFields

func (q *Queries) UpdateAccountFields(ctx context.Context, arg UpdateAccountFieldsParams) error

func (*Queries) UpdateAccountOwnerToAdmin added in v2.5.0

func (q *Queries) UpdateAccountOwnerToAdmin(ctx context.Context, arg UpdateAccountOwnerToAdminParams) error

func (*Queries) UpdateAccountUserRole

func (q *Queries) UpdateAccountUserRole(ctx context.Context, arg UpdateAccountUserRoleParams) error

func (*Queries) UpdateChain

func (q *Queries) UpdateChain(ctx context.Context, arg UpdateChainParams) (types.RelayChainID, error)

func (*Queries) UpdateChainActive

func (q *Queries) UpdateChainActive(ctx context.Context, arg UpdateChainActiveParams) (bool, error)

func (*Queries) UpdateDeleteAccountNotification added in v2.5.0

func (q *Queries) UpdateDeleteAccountNotification(ctx context.Context, arg UpdateDeleteAccountNotificationParams) error

func (*Queries) UpdateDeleteWhitelists

func (q *Queries) UpdateDeleteWhitelists(ctx context.Context, arg UpdateDeleteWhitelistsParams) error

func (*Queries) UpdateGigastakeAppChainIDs added in v2.12.0

func (q *Queries) UpdateGigastakeAppChainIDs(ctx context.Context, arg UpdateGigastakeAppChainIDsParams) error

func (*Queries) UpdateInsertWhitelists

func (q *Queries) UpdateInsertWhitelists(ctx context.Context, arg UpdateInsertWhitelistsParams) error

func (*Queries) UpdatePortalAppFields

func (q *Queries) UpdatePortalAppFields(ctx context.Context, arg UpdatePortalAppFieldsParams) error

func (*Queries) UpdatePortalAppSettings

func (q *Queries) UpdatePortalAppSettings(ctx context.Context, arg UpdatePortalAppSettingsParams) error

func (*Queries) UpdateUpsertAccountNotification added in v2.5.0

func (q *Queries) UpdateUpsertAccountNotification(ctx context.Context, arg UpdateUpsertAccountNotificationParams) error

func (*Queries) UpdateUserAcceptedInvite

func (q *Queries) UpdateUserAcceptedInvite(ctx context.Context, arg UpdateUserAcceptedInviteParams) error

func (*Queries) UpdateUserDeclinedInvite

func (q *Queries) UpdateUserDeclinedInvite(ctx context.Context, arg UpdateUserDeclinedInviteParams) error

func (*Queries) UpdateUserFields

func (q *Queries) UpdateUserFields(ctx context.Context, arg UpdateUserFieldsParams) error

func (*Queries) UpsertAccountIntegrations

func (q *Queries) UpsertAccountIntegrations(ctx context.Context, arg UpsertAccountIntegrationsParams) (AccountIntegration, error)

func (*Queries) UpsertChainAliasDomains

func (q *Queries) UpsertChainAliasDomains(ctx context.Context, arg UpsertChainAliasDomainsParams) error

func (*Queries) UpsertChainAltruist

func (q *Queries) UpsertChainAltruist(ctx context.Context, arg UpsertChainAltruistParams) error

func (*Queries) UpsertChainCheck

func (q *Queries) UpsertChainCheck(ctx context.Context, arg UpsertChainCheckParams) error

func (*Queries) UpsertStripeSubID added in v2.5.0

func (q *Queries) UpsertStripeSubID(ctx context.Context, arg UpsertStripeSubIDParams) error

func (*Queries) WithTx

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

type SelectAccountRow

type SelectAccountRow struct {
	ID                      types.AccountID    `json:"id"`
	Name                    pgtype.Text        `json:"name"`
	IconURL                 pgtype.Text        `json:"icon_url"`
	PlanType                pgtype.Text        `json:"plan_type"`
	PartnerChainIDs         []string           `json:"partner_chain_ids"`
	PartnerThroughputLimit  pgtype.Int4        `json:"partner_throughput_limit"`
	PartnerApplicationLimit pgtype.Int4        `json:"partner_application_limit"`
	EnterpriseLimit         pgtype.Int4        `json:"enterprise_limit"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	UpdatedAt               pgtype.Timestamptz `json:"updated_at"`
	Deleted                 bool               `json:"deleted"`
	DeletedAt               pgtype.Timestamptz `json:"deleted_at"`
	StripeSubscriptionID    pgtype.Text        `json:"stripe_subscription_id"`
	CovalentAPIKeyFree      pgtype.Text        `json:"covalent_api_key_free"`
	CovalentAPIKeyPaid      pgtype.Text        `json:"covalent_api_key_paid"`
	Notifications           []byte             `json:"notifications"`
}

type SelectAccountsRow

type SelectAccountsRow struct {
	ID                      types.AccountID    `json:"id"`
	Name                    pgtype.Text        `json:"name"`
	IconURL                 pgtype.Text        `json:"icon_url"`
	PlanType                pgtype.Text        `json:"plan_type"`
	PartnerChainIDs         []string           `json:"partner_chain_ids"`
	PartnerThroughputLimit  pgtype.Int4        `json:"partner_throughput_limit"`
	PartnerApplicationLimit pgtype.Int4        `json:"partner_application_limit"`
	EnterpriseLimit         pgtype.Int4        `json:"enterprise_limit"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	UpdatedAt               pgtype.Timestamptz `json:"updated_at"`
	Deleted                 bool               `json:"deleted"`
	DeletedAt               pgtype.Timestamptz `json:"deleted_at"`
	StripeSubscriptionID    pgtype.Text        `json:"stripe_subscription_id"`
	CovalentAPIKeyFree      pgtype.Text        `json:"covalent_api_key_free"`
	CovalentAPIKeyPaid      pgtype.Text        `json:"covalent_api_key_paid"`
	Notifications           []byte             `json:"notifications"`
}

type SelectAllUsersRow

type SelectAllUsersRow struct {
	ID               types.UserID       `json:"id"`
	Email            types.Email        `json:"email"`
	SignedUp         bool               `json:"signed_up"`
	IconURL          pgtype.Text        `json:"icon_url"`
	UpdatesProduct   pgtype.Bool        `json:"updates_product"`
	UpdatesMarketing pgtype.Bool        `json:"updates_marketing"`
	BetaTester       pgtype.Bool        `json:"beta_tester"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	AuthProviders    []byte             `json:"auth_providers"`
}

type SelectChainRow

type SelectChainRow struct {
	ID              types.RelayChainID `json:"id"`
	Blockchain      pgtype.Text        `json:"blockchain"`
	Description     pgtype.Text        `json:"description"`
	EnforceResult   pgtype.Text        `json:"enforce_result"`
	Ticker          pgtype.Text        `json:"ticker"`
	Path            pgtype.Text        `json:"path"`
	IconURL         pgtype.Text        `json:"icon_url"`
	RequestTimeout  pgtype.Int4        `json:"request_timeout"`
	LogLimitBlocks  pgtype.Int4        `json:"log_limit_blocks"`
	AllowedMethods  []string           `json:"allowed_methods"`
	Active          bool               `json:"active"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
	Deleted         pgtype.Bool        `json:"deleted"`
	DeletedAt       pgtype.Timestamptz `json:"deleted_at"`
	ChainAltruists  []byte             `json:"chain_altruists"`
	ChainChecks     []byte             `json:"chain_checks"`
	AliasDomainsMap []byte             `json:"alias_domains_map"`
	ChainAliases    []string           `json:"chain_aliases"`
}

func (*SelectChainRow) ToChainRow

func (c *SelectChainRow) ToChainRow() *ChainRow

type SelectChainsRow

type SelectChainsRow struct {
	ID              types.RelayChainID `json:"id"`
	Blockchain      pgtype.Text        `json:"blockchain"`
	Description     pgtype.Text        `json:"description"`
	EnforceResult   pgtype.Text        `json:"enforce_result"`
	Ticker          pgtype.Text        `json:"ticker"`
	Path            pgtype.Text        `json:"path"`
	IconURL         pgtype.Text        `json:"icon_url"`
	RequestTimeout  pgtype.Int4        `json:"request_timeout"`
	LogLimitBlocks  pgtype.Int4        `json:"log_limit_blocks"`
	AllowedMethods  []string           `json:"allowed_methods"`
	Active          bool               `json:"active"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
	Deleted         pgtype.Bool        `json:"deleted"`
	DeletedAt       pgtype.Timestamptz `json:"deleted_at"`
	ChainAltruists  []byte             `json:"chain_altruists"`
	ChainChecks     []byte             `json:"chain_checks"`
	AliasDomainsMap []byte             `json:"alias_domains_map"`
	ChainAliases    []string           `json:"chain_aliases"`
}

func (*SelectChainsRow) ToChainRow

func (c *SelectChainsRow) ToChainRow() *ChainRow

type SelectGigastakeApplicationsRow

type SelectGigastakeApplicationsRow struct {
	ID              types.GigastakeAppID `json:"id"`
	Name            string               `json:"name"`
	ProtocolID      types.ProtocolID     `json:"protocol_id"`
	ChainIDs        []string             `json:"chain_ids"`
	CreatedAt       pgtype.Timestamptz   `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz   `json:"updated_at"`
	Deleted         bool                 `json:"deleted"`
	Address         string               `json:"address"`
	PublicKey       string               `json:"public_key"`
	ClientPublicKey string               `json:"client_public_key"`
	Signature       string               `json:"signature"`
	Version         string               `json:"version"`
}

type SelectGlobalBlockedContractRow

type SelectGlobalBlockedContractRow struct {
	ID             int32                `json:"id"`
	BlockedAddress types.BlockedAddress `json:"blocked_address"`
}

type SelectLatestConfigurationsRow added in v2.14.0

type SelectLatestConfigurationsRow struct {
	Environment   types.Environment `json:"environment"`
	Version       int32             `json:"version"`
	Description   string            `json:"description"`
	Configuration []byte            `json:"configuration"`
}

type SelectPlansRow

type SelectPlansRow struct {
	Name              pgtype.Text        `json:"name"`
	Description       pgtype.Text        `json:"description"`
	PlanType          types.PayPlanType  `json:"plan_type"`
	ChainIDs          []string           `json:"chain_ids"`
	MonthlyRelayLimit int32              `json:"monthly_relay_limit"`
	ThroughputLimit   int32              `json:"throughput_limit"`
	ApplicationLimit  int32              `json:"application_limit"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	DailyLimit        pgtype.Int4        `json:"daily_limit"`
}

type SelectPortalApplicationsRow

type SelectPortalApplicationsRow struct {
	ID                types.PortalAppID  `json:"id"`
	AccountID         pgtype.Text        `json:"account_id"`
	Name              string             `json:"name"`
	AppEmoji          pgtype.Text        `json:"app_emoji"`
	Description       pgtype.Text        `json:"description"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	Deleted           bool               `json:"deleted"`
	DeletedAt         pgtype.Timestamptz `json:"deleted_at"`
	SecretKey         pgtype.Text        `json:"secret_key"`
	SecretKeyRequired pgtype.Bool        `json:"secret_key_required"`
	MonthlyRelayLimit pgtype.Int4        `json:"monthly_relay_limit"`
	Environment       NullEnvironment    `json:"environment"`
	FavoritedChainIDs []string           `json:"favorited_chain_ids"`
	AATs              []byte             `json:"aats"`
	Whitelists        []byte             `json:"whitelists"`
}

type SelectUserIDsRow

type SelectUserIDsRow struct {
	UserID         types.UserID         `json:"user_id"`
	ProviderUserID types.ProviderUserID `json:"provider_user_id"`
}

type SelectUserPermissionsRow

type SelectUserPermissionsRow struct {
	UserID      types.UserID        `json:"user_id"`
	AccountID   types.AccountID     `json:"account_id"`
	RoleName    types.RoleName      `json:"role_name"`
	Accepted    bool                `json:"accepted"`
	Permissions []types.Permissions `json:"permissions"`
}

type SelectValidatorChainConfigRow added in v2.8.0

type SelectValidatorChainConfigRow struct {
	ChainID         pgtype.Text `json:"chain_id"`
	ValidRange      pgtype.Int4 `json:"valid_range"`
	LogLimitBlocks  pgtype.Int4 `json:"log_limit_blocks"`
	ArchivalChainID pgtype.Text `json:"archival_chain_id"`
}

type SelectValidatorMethodConfigRow added in v2.8.0

type SelectValidatorMethodConfigRow struct {
	Method    string                 `json:"method"`
	Validator NullValidatorMethodStr `json:"validator"`
}

type SetGlobalBlockedContractActiveParams

type SetGlobalBlockedContractActiveParams struct {
	BlockedAddress types.BlockedAddress `json:"blocked_address"`
	Active         bool                 `json:"active"`
	UpdatedAt      pgtype.Timestamptz   `json:"updated_at"`
}

type UpdateAccountFieldsParams

type UpdateAccountFieldsParams struct {
	Name                    pgtype.Text        `json:"name"`
	IconURL                 pgtype.Text        `json:"icon_url"`
	PlanType                pgtype.Text        `json:"plan_type"`
	PartnerChainIDs         []string           `json:"partner_chain_ids"`
	PartnerThroughputLimit  pgtype.Int4        `json:"partner_throughput_limit"`
	PartnerApplicationLimit pgtype.Int4        `json:"partner_application_limit"`
	EnterpriseLimit         pgtype.Int4        `json:"enterprise_limit"`
	UpdatedAt               pgtype.Timestamptz `json:"updated_at"`
	ID                      types.AccountID    `json:"id"`
}

type UpdateAccountOwnerToAdminParams added in v2.5.0

type UpdateAccountOwnerToAdminParams struct {
	AccountID types.AccountID    `json:"account_id"`
	UserID    types.UserID       `json:"user_id"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type UpdateAccountUserRoleParams

type UpdateAccountUserRoleParams struct {
	AccountID types.AccountID    `json:"account_id"`
	UserID    types.UserID       `json:"user_id"`
	RoleName  types.RoleName     `json:"role_name"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type UpdateChainActiveParams

type UpdateChainActiveParams struct {
	ID        types.RelayChainID `json:"id"`
	Active    bool               `json:"active"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type UpdateChainParams

type UpdateChainParams struct {
	ID             types.RelayChainID `json:"id"`
	Blockchain     pgtype.Text        `json:"blockchain"`
	IconURL        pgtype.Text        `json:"icon_url"`
	Description    pgtype.Text        `json:"description"`
	EnforceResult  pgtype.Text        `json:"enforce_result"`
	Path           pgtype.Text        `json:"path"`
	Ticker         pgtype.Text        `json:"ticker"`
	RequestTimeout pgtype.Int4        `json:"request_timeout"`
	LogLimitBlocks pgtype.Int4        `json:"log_limit_blocks"`
	AllowedMethods []string           `json:"allowed_methods"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
}

type UpdateDeleteAccountNotificationParams added in v2.5.0

type UpdateDeleteAccountNotificationParams struct {
	AccountID types.AccountID        `json:"account_id"`
	Type      types.NotificationType `json:"type"`
}

type UpdateDeleteWhitelistsParams

type UpdateDeleteWhitelistsParams struct {
	ApplicationID types.PortalAppID     `json:"application_id"`
	Types         []types.WhitelistType `json:"types"`
	Values        []string              `json:"values"`
	ChainIDs      []string              `json:"chain_ids"`
}

type UpdateGigastakeAppChainIDsParams added in v2.12.0

type UpdateGigastakeAppChainIDsParams struct {
	ID        types.GigastakeAppID `json:"id"`
	UpdatedAt pgtype.Timestamptz   `json:"updated_at"`
	ChainIDs  []string             `json:"chain_ids"`
}

type UpdateInsertWhitelistsParams

type UpdateInsertWhitelistsParams struct {
	ApplicationID types.PortalAppID     `json:"application_id"`
	Types         []types.WhitelistType `json:"types"`
	ChainIDs      []string              `json:"chain_ids"`
	Values        []string              `json:"values"`
	CreatedAt     pgtype.Timestamptz    `json:"created_at"`
}

type UpdatePortalAppFieldsParams

type UpdatePortalAppFieldsParams struct {
	ID          types.PortalAppID  `json:"id"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	AppEmoji    string             `json:"app_emoji"`
}

type UpdatePortalAppSettingsParams

type UpdatePortalAppSettingsParams struct {
	ApplicationID     types.PortalAppID  `json:"application_id"`
	SecretKey         pgtype.Text        `json:"secret_key"`
	SecretKeyRequired pgtype.Bool        `json:"secret_key_required"`
	MonthlyRelayLimit int32              `json:"monthly_relay_limit"`
	FavoritedChainIDs []string           `json:"favorited_chain_ids"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	Environment       pgtype.Text        `json:"environment"`
}

type UpdateUpsertAccountNotificationParams added in v2.5.0

type UpdateUpsertAccountNotificationParams struct {
	AccountID   types.AccountID           `json:"account_id"`
	UpdatedAt   pgtype.Timestamptz        `json:"updated_at"`
	Type        types.NotificationType    `json:"type"`
	Active      bool                      `json:"active"`
	Destination string                    `json:"destination"`
	Trigger     string                    `json:"trigger"`
	Events      []types.NotificationEvent `json:"events"`
}

type UpdateUserAcceptedInviteParams

type UpdateUserAcceptedInviteParams struct {
	UserID         types.UserID         `json:"user_id"`
	Type           types.AuthType       `json:"type"`
	Provider       types.AuthProvider   `json:"provider"`
	ProviderUserID types.ProviderUserID `json:"provider_user_id"`
	Federated      bool                 `json:"federated"`
	AccountID      types.AccountID      `json:"account_id"`
}

type UpdateUserDeclinedInviteParams

type UpdateUserDeclinedInviteParams struct {
	ID        types.UserID    `json:"id"`
	AccountID types.AccountID `json:"account_id"`
}

type UpdateUserFieldsParams

type UpdateUserFieldsParams struct {
	IconURL          pgtype.Text        `json:"icon_url"`
	UpdatesProduct   pgtype.Bool        `json:"updates_product"`
	UpdatesMarketing pgtype.Bool        `json:"updates_marketing"`
	BetaTester       pgtype.Bool        `json:"beta_tester"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	ID               types.UserID       `json:"id"`
}

type UpsertAccountIntegrationsParams

type UpsertAccountIntegrationsParams struct {
	AccountID            types.AccountID    `json:"account_id"`
	StripeSubscriptionID pgtype.Text        `json:"stripe_subscription_id"`
	CovalentAPIKeyFree   pgtype.Text        `json:"covalent_api_key_free"`
	CovalentAPIKeyPaid   pgtype.Text        `json:"covalent_api_key_paid"`
	CreatedAt            pgtype.Timestamptz `json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `json:"updated_at"`
}

type UpsertChainAliasDomainsParams

type UpsertChainAliasDomainsParams struct {
	ChainID   types.RelayChainID `json:"chain_id"`
	Alias     types.ChainAlias   `json:"alias"`
	Domains   []string           `json:"domains"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type UpsertChainAltruistParams

type UpsertChainAltruistParams struct {
	ChainID   types.RelayChainID  `json:"chain_id"`
	URL       types.AltruistURL   `json:"url"`
	Auth      pgtype.Text         `json:"auth"`
	AuthType  types.ChainAuthType `json:"auth_type"`
	CreatedAt pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt pgtype.Timestamptz  `json:"updated_at"`
}

type UpsertChainCheckParams

type UpsertChainCheckParams struct {
	ChainID    types.RelayChainID   `json:"chain_id"`
	Type       types.ChainCheckType `json:"type"`
	Payload    pgtype.Text          `json:"payload"`
	ResultKey  pgtype.Text          `json:"result_key"`
	Allowance  pgtype.Int4          `json:"allowance"`
	EVMChainID pgtype.Int4          `json:"evm_chain_id"`
	CreatedAt  pgtype.Timestamptz   `json:"created_at"`
	UpdatedAt  pgtype.Timestamptz   `json:"updated_at"`
}

type UpsertStripeSubIDParams added in v2.5.0

type UpsertStripeSubIDParams struct {
	AccountID            types.AccountID    `json:"account_id"`
	StripeSubscriptionID pgtype.Text        `json:"stripe_subscription_id"`
	UpdatedAt            pgtype.Timestamptz `json:"updated_at"`
}

type User

type User struct {
	ID               types.UserID       `json:"id"`
	Email            types.Email        `json:"email"`
	SignedUp         bool               `json:"signed_up"`
	IconURL          pgtype.Text        `json:"icon_url"`
	UpdatesProduct   pgtype.Bool        `json:"updates_product"`
	UpdatesMarketing pgtype.Bool        `json:"updates_marketing"`
	BetaTester       pgtype.Bool        `json:"beta_tester"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type UserAuthProvider

type UserAuthProvider struct {
	ID             int32                `json:"id"`
	UserID         types.UserID         `json:"user_id"`
	Type           types.AuthType       `json:"type"`
	Provider       types.AuthProvider   `json:"provider"`
	ProviderUserID types.ProviderUserID `json:"provider_user_id"`
	Federated      bool                 `json:"federated"`
	CreatedAt      pgtype.Timestamptz   `json:"created_at"`
}

type UserRole

type UserRole struct {
	RoleName    string              `json:"role_name"`
	Permissions []types.Permissions `json:"permissions"`
	CreatedAt   pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz  `json:"updated_at"`
}

type UserRow

type UserRow struct {
	ID               types.UserID       `json:"id"`
	Email            types.Email        `json:"email"`
	SignedUp         bool               `json:"signed_up"`
	IconURL          pgtype.Text        `json:"icon_url"`
	UpdatesProduct   pgtype.Bool        `json:"updates_product"`
	UpdatesMarketing pgtype.Bool        `json:"updates_marketing"`
	BetaTester       pgtype.Bool        `json:"beta_tester"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	AuthProviders    []byte             `json:"auth_providers"`
}

type ValidatorMethodStr added in v2.8.0

type ValidatorMethodStr string
const (
	ValidatorMethodStrBlockRange     ValidatorMethodStr = "blockRange"
	ValidatorMethodStrLogLimitBlocks ValidatorMethodStr = "logLimitBlocks"
	ValidatorMethodStrEthAddress     ValidatorMethodStr = "ethAddress"
)

func (*ValidatorMethodStr) Scan added in v2.8.0

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

type WhitelistType

type WhitelistType string
const (
	WhitelistTypeBlockchains WhitelistType = "blockchains"
	WhitelistTypeContracts   WhitelistType = "contracts"
	WhitelistTypeMethods     WhitelistType = "methods"
	WhitelistTypeOrigins     WhitelistType = "origins"
	WhitelistTypeUserAgents  WhitelistType = "userAgents"
)

func (*WhitelistType) Scan

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

Jump to

Keyboard shortcuts

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