Documentation ¶
Index ¶
- func NewCloudSQLPGXPool(options CloudSQLConfig) (*pgxpool.Pool, func() error, error)
- func NewPGXPool(connectionString string) (*pgxpool.Pool, func() error, error)
- func NewPGXPoolListener(pool *pgxpool.Pool, outCh chan *types.Notification) *pgxlisten.Listener
- type Account
- type AccountIntegration
- type AccountNotification
- type AccountUser
- type AddGlobalBlockedContractParams
- type AuthProvider
- type AuthType
- type Chain
- type ChainAlias
- type ChainAliasDomain
- type ChainAltruist
- type ChainAuthType
- type ChainCheck
- type ChainCheckType
- type ChainConfig
- type ChainRow
- type ChainsGigastakeApplication
- type CheckAccountUserAcceptedParams
- type CheckAccountUserExistsParams
- type CheckAccountUserRoleParams
- type CheckAliasExistsParams
- type CheckIfAppWhitelistExistsParams
- type CheckUserProviderExistsParams
- type CloudSQLConfig
- type ConfigOpenapi
- type CreateUserNewSignUpParams
- type DBTX
- type DeleteAccountParams
- type DeleteAccountUserParams
- type DeleteChainAliasDomainParams
- type DeleteChainAliasParams
- type DeletePortalAppParams
- type DeleteUnusedChainAliasDomainsParams
- type DeleteUnusedChainAliasParams
- type DeleteUnusedChainAltruistsParams
- type DeleteUnusedChainChecksParams
- type Environment
- type GatewayConfig
- type GetAccountOwnerRow
- type GetUserDataFromAuthProviderUserIDRow
- type GetUserDataFromPortalUserIDRow
- type GetUserFieldsRow
- type GigastakeApplication
- type GlobalBlockedContract
- type InsertAccountParams
- type InsertAccountUserAccessNoUserParams
- type InsertAccountUserParams
- type InsertChainAliasParams
- type InsertChainParams
- type InsertGigastakeAppParams
- type InsertPortalApplicationAATParams
- type InsertPortalApplicationParams
- type InsertPortalApplicationSettingParams
- type Listener
- type ListenerMock
- func (l *ListenerMock) Handle(channel string, handler pgxlisten.Handler)
- func (l *ListenerMock) Listen(ctx context.Context) error
- func (l *ListenerMock) MockEvent(mainTableAction, sideTablesAction types.Action, content types.SavedOnDB)
- func (l *ListenerMock) NotificationChannel() <-chan *pgconn.Notification
- type MethodValidator
- type NotificationEvent
- type NotificationType
- type NullAuthProvider
- type NullAuthType
- type NullChainAuthType
- type NullChainCheckType
- type NullEnvironment
- type NullNotificationEvent
- type NullNotificationType
- type NullPermissions
- type NullProtocolID
- type NullValidatorMethodStr
- type NullWhitelistType
- type PGXNotificationHandler
- type PayPlan
- type Permissions
- type PortalApplication
- type PortalApplicationAat
- type PortalApplicationSetting
- type PortalApplicationWhitelist
- type PostgresDriver
- func (d *PostgresDriver) CloseListener()
- func (pg *PostgresDriver) DeletePortalUser(ctx context.Context, userID types.UserID) (types.UserID, error)
- func (pg *PostgresDriver) NotificationChannel() <-chan *types.Notification
- func (d *PostgresDriver) Ping(ctx context.Context) error
- func (pg *PostgresDriver) ReadAccounts(ctx context.Context, options types.DriverOptions) (map[types.AccountID]*types.Account, error)
- func (pg *PostgresDriver) ReadAllUsers(ctx context.Context) (map[types.UserID]*types.User, error)
- func (pg *PostgresDriver) ReadBlockedContracts(ctx context.Context) (types.GlobalBlockedContracts, error)
- func (pg *PostgresDriver) ReadChains(ctx context.Context, options types.DriverOptions) (map[types.RelayChainID]*types.Chain, error)
- func (pg *PostgresDriver) ReadGigastakeApps(ctx context.Context, options types.DriverOptions) (map[types.GigastakeAppID]*types.GigastakeApp, error)
- func (pg *PostgresDriver) ReadPlans(ctx context.Context) (map[types.PayPlanType]*types.Plan, error)
- func (pg *PostgresDriver) ReadPortalApps(ctx context.Context, options types.DriverOptions) (map[types.PortalAppID]*types.PortalApp, error)
- func (pg *PostgresDriver) ReadUserIDsMap(ctx context.Context) (map[types.ProviderUserID]types.UserID, error)
- func (pg *PostgresDriver) RemoveAccountUser(ctx context.Context, userID types.UserID, accountID types.AccountID) error
- func (pg *PostgresDriver) RemoveBlockedContract(ctx context.Context, blockedAddress types.BlockedAddress) error
- func (pg *PostgresDriver) SetAccountDeleted(ctx context.Context, accountID types.AccountID, deletedAt time.Time) error
- func (pg *PostgresDriver) SetAccountUserRole(ctx context.Context, updateAccountUser types.UpdateAccountUserRole, ...) error
- func (pg *PostgresDriver) SetChainActiveStatus(ctx context.Context, chainID types.RelayChainID, active bool, ...) (bool, error)
- func (pg *PostgresDriver) SetPortalAppDeleted(ctx context.Context, portalAppID types.PortalAppID, deletedAt time.Time) error
- func (pg *PostgresDriver) UpdateAcceptAccountUser(ctx context.Context, acceptAccountUser types.UpdateAcceptAccountUser, ...) error
- func (pg *PostgresDriver) UpdateAccount(ctx context.Context, update types.UpdateAccount, updatedAt time.Time) (*types.Account, error)
- func (pg *PostgresDriver) UpdateBlockedContractActive(ctx context.Context, blockedAddress types.BlockedAddress, active bool, ...) error
- func (pg *PostgresDriver) UpdateChain(ctx context.Context, update types.UpdateChain, updatedAt time.Time) (*types.Chain, error)
- func (pg *PostgresDriver) UpdateGigastakeApp(ctx context.Context, gigastakeAppUpdate types.UpdateGigastakeApp, ...) error
- func (pg *PostgresDriver) UpdatePortalApp(ctx context.Context, update types.UpdatePortalApp, updatedAt time.Time) error
- func (pg *PostgresDriver) UpdateUser(ctx context.Context, update types.UpdateUser, updatedAt time.Time) (*types.User, error)
- func (pg *PostgresDriver) UpsertAccountIntegration(ctx context.Context, integrations types.AccountIntegrations) (*types.AccountIntegrations, error)
- func (pg *PostgresDriver) WriteAccount(ctx context.Context, creatorID types.UserID, account types.Account, ...) (*types.Account, error)
- func (pg *PostgresDriver) WriteAccountUser(ctx context.Context, createAccountUser types.CreateAccountUser, ...) (types.UserID, error)
- func (pg *PostgresDriver) WriteBlockedContract(ctx context.Context, blockedAddress types.BlockedAddress, createdAt time.Time) error
- func (pg *PostgresDriver) WriteChain(ctx context.Context, chain types.Chain, createdAt time.Time) (*types.Chain, error)
- func (pg *PostgresDriver) WriteChainAndGigastakeApps(ctx context.Context, input types.NewChainInput, createdAt time.Time) (*types.NewChainInput, error)
- func (pg *PostgresDriver) WriteGigastakeApp(ctx context.Context, gigastakeApp *types.GigastakeApp, createdAt time.Time) (*types.GigastakeApp, error)
- func (pg *PostgresDriver) WritePortalApp(ctx context.Context, portalApp types.PortalApp, aat types.AAT, ...) (*types.PortalApp, error)
- func (pg *PostgresDriver) WriteUserNewSignUp(ctx context.Context, user types.CreateUser, createdAt time.Time) (*types.User, types.AccountID, error)
- type Protocol
- type ProtocolID
- type Queries
- func (q *Queries) AddGlobalBlockedContract(ctx context.Context, arg AddGlobalBlockedContractParams) error
- func (q *Queries) CheckAccountExists(ctx context.Context, id types.AccountID) (bool, error)
- func (q *Queries) CheckAccountUserAccepted(ctx context.Context, arg CheckAccountUserAcceptedParams) (bool, error)
- func (q *Queries) CheckAccountUserExists(ctx context.Context, arg CheckAccountUserExistsParams) (bool, error)
- func (q *Queries) CheckAccountUserRole(ctx context.Context, arg CheckAccountUserRoleParams) (types.RoleName, error)
- func (q *Queries) CheckAliasExists(ctx context.Context, arg CheckAliasExistsParams) (bool, error)
- func (q *Queries) CheckChainExists(ctx context.Context, id types.RelayChainID) (bool, error)
- func (q *Queries) CheckGigastakeAppNameExists(ctx context.Context, name string) (bool, error)
- func (q *Queries) CheckIDExists(ctx context.Context, id string) (bool, error)
- func (q *Queries) CheckIfAppWhitelistExists(ctx context.Context, arg CheckIfAppWhitelistExistsParams) (bool, error)
- func (q *Queries) CheckPlanExists(ctx context.Context, planType types.PayPlanType) (bool, error)
- func (q *Queries) CheckPlanTypeExists(ctx context.Context, planType types.PayPlanType) (bool, error)
- func (q *Queries) CheckPortalAppExists(ctx context.Context, id types.PortalAppID) (bool, error)
- func (q *Queries) CheckUserAccountExists(ctx context.Context, userID types.UserID) (bool, error)
- func (q *Queries) CheckUserEmail(ctx context.Context, id types.UserID) (types.Email, error)
- func (q *Queries) CheckUserExists(ctx context.Context, id types.UserID) (bool, error)
- func (q *Queries) CheckUserHasOwnAccount(ctx context.Context, userID types.UserID) (bool, error)
- func (q *Queries) CheckUserIDFromEmail(ctx context.Context, email types.Email) (types.UserID, error)
- func (q *Queries) CheckUserProviderExists(ctx context.Context, arg CheckUserProviderExistsParams) (bool, error)
- func (q *Queries) CreateUserNewSignUp(ctx context.Context, arg CreateUserNewSignUpParams) (types.UserID, error)
- func (q *Queries) DeleteAccount(ctx context.Context, arg DeleteAccountParams) error
- func (q *Queries) DeleteAccountUser(ctx context.Context, arg DeleteAccountUserParams) error
- func (q *Queries) DeleteChainAlias(ctx context.Context, arg DeleteChainAliasParams) error
- func (q *Queries) DeleteChainAliasDomain(ctx context.Context, arg DeleteChainAliasDomainParams) error
- func (q *Queries) DeletePortalApp(ctx context.Context, arg DeletePortalAppParams) error
- func (q *Queries) DeleteUnusedChainAlias(ctx context.Context, arg DeleteUnusedChainAliasParams) error
- func (q *Queries) DeleteUnusedChainAliasDomains(ctx context.Context, arg DeleteUnusedChainAliasDomainsParams) error
- func (q *Queries) DeleteUnusedChainAltruists(ctx context.Context, arg DeleteUnusedChainAltruistsParams) error
- func (q *Queries) DeleteUnusedChainChecks(ctx context.Context, arg DeleteUnusedChainChecksParams) error
- func (q *Queries) DeleteUser(ctx context.Context, id types.UserID) (types.UserID, error)
- func (q *Queries) GetAccountOwner(ctx context.Context, accountID types.AccountID) (GetAccountOwnerRow, error)
- func (q *Queries) GetGigastakeApplicationsCount(ctx context.Context) (int64, error)
- func (q *Queries) GetInvitedUserID(ctx context.Context, email types.Email) (types.UserID, error)
- func (q *Queries) GetLastCreatedUserID(ctx context.Context) (types.UserID, error)
- func (q *Queries) GetPlanDailyLimit(ctx context.Context, planType types.PayPlanType) (pgtype.Int4, error)
- func (q *Queries) GetPortalUserID(ctx context.Context, providerUserID types.ProviderUserID) (types.UserID, error)
- func (q *Queries) GetUserDataFromAuthProviderUserID(ctx context.Context, providerUserID types.ProviderUserID) (GetUserDataFromAuthProviderUserIDRow, error)
- func (q *Queries) GetUserDataFromPortalUserID(ctx context.Context, id types.UserID) (GetUserDataFromPortalUserIDRow, error)
- func (q *Queries) GetUserFields(ctx context.Context, id types.UserID) (GetUserFieldsRow, error)
- func (q *Queries) GetUserIDFromEmail(ctx context.Context, email types.Email) (types.UserID, error)
- func (q *Queries) InsertAccount(ctx context.Context, arg InsertAccountParams) (Account, error)
- func (q *Queries) InsertAccountUser(ctx context.Context, arg InsertAccountUserParams) (types.UserID, error)
- func (q *Queries) InsertAccountUserAccessNoUser(ctx context.Context, arg InsertAccountUserAccessNoUserParams) (types.UserID, error)
- func (q *Queries) InsertChain(ctx context.Context, arg InsertChainParams) (types.RelayChainID, error)
- func (q *Queries) InsertChainAlias(ctx context.Context, arg InsertChainAliasParams) error
- func (q *Queries) InsertGigastakeApp(ctx context.Context, arg InsertGigastakeAppParams) error
- func (q *Queries) InsertPortalApplication(ctx context.Context, arg InsertPortalApplicationParams) (PortalApplication, error)
- func (q *Queries) InsertPortalApplicationAAT(ctx context.Context, arg InsertPortalApplicationAATParams) (PortalApplicationAat, error)
- func (q *Queries) InsertPortalApplicationSetting(ctx context.Context, arg InsertPortalApplicationSettingParams) (PortalApplicationSetting, error)
- func (q *Queries) IsUserExisting(ctx context.Context, email types.Email) (bool, error)
- func (q *Queries) IsUserInvited(ctx context.Context, email types.Email) (bool, error)
- func (q *Queries) IsUserNew(ctx context.Context, email types.Email) (bool, error)
- func (q *Queries) ReadGatewayConfig(ctx context.Context) (map[types.Environment]types.GatewayConfig, error)
- func (q *Queries) ReadOpenAPISpecs(ctx context.Context) (map[types.RelayChainID]json.RawMessage, error)
- func (q *Queries) ReadValidatorConfig(ctx context.Context) (*types.ValidatorPluginConfig, error)
- func (q *Queries) RemoveGlobalBlockedContract(ctx context.Context, blockedAddress types.BlockedAddress) (int32, error)
- func (q *Queries) SelectAccount(ctx context.Context, id types.AccountID) (SelectAccountRow, error)
- func (q *Queries) SelectAccounts(ctx context.Context, dollar_1 bool) ([]SelectAccountsRow, error)
- func (q *Queries) SelectAllUsers(ctx context.Context) ([]SelectAllUsersRow, error)
- func (q *Queries) SelectChain(ctx context.Context, id types.RelayChainID) (SelectChainRow, error)
- func (q *Queries) SelectChains(ctx context.Context, includeDeleted bool) ([]SelectChainsRow, error)
- func (q *Queries) SelectGigastakeApplications(ctx context.Context) ([]SelectGigastakeApplicationsRow, error)
- func (q *Queries) SelectGlobalBlockedContract(ctx context.Context) ([]SelectGlobalBlockedContractRow, error)
- func (q *Queries) SelectLatestConfigurations(ctx context.Context) ([]SelectLatestConfigurationsRow, error)
- func (q *Queries) SelectOpenAPISpecs(ctx context.Context) ([]ConfigOpenapi, error)
- func (q *Queries) SelectPlans(ctx context.Context) ([]SelectPlansRow, error)
- func (q *Queries) SelectPortalApplications(ctx context.Context, dollar_1 bool) ([]SelectPortalApplicationsRow, error)
- func (q *Queries) SelectUserIDs(ctx context.Context) ([]SelectUserIDsRow, error)
- func (q *Queries) SelectUserPermissions(ctx context.Context) ([]SelectUserPermissionsRow, error)
- func (q *Queries) SelectValidatorChainConfig(ctx context.Context) ([]SelectValidatorChainConfigRow, error)
- func (q *Queries) SelectValidatorMethodConfig(ctx context.Context) ([]SelectValidatorMethodConfigRow, error)
- func (q *Queries) SetGlobalBlockedContractActive(ctx context.Context, arg SetGlobalBlockedContractActiveParams) (int32, error)
- func (q *Queries) UpdateAccountFields(ctx context.Context, arg UpdateAccountFieldsParams) error
- func (q *Queries) UpdateAccountOwnerToAdmin(ctx context.Context, arg UpdateAccountOwnerToAdminParams) error
- func (q *Queries) UpdateAccountUserRole(ctx context.Context, arg UpdateAccountUserRoleParams) error
- func (q *Queries) UpdateChain(ctx context.Context, arg UpdateChainParams) (types.RelayChainID, error)
- func (q *Queries) UpdateChainActive(ctx context.Context, arg UpdateChainActiveParams) (bool, error)
- func (q *Queries) UpdateDeleteAccountNotification(ctx context.Context, arg UpdateDeleteAccountNotificationParams) error
- func (q *Queries) UpdateDeleteWhitelists(ctx context.Context, arg UpdateDeleteWhitelistsParams) error
- func (q *Queries) UpdateGigastakeAppChainIDs(ctx context.Context, arg UpdateGigastakeAppChainIDsParams) error
- func (q *Queries) UpdateInsertWhitelists(ctx context.Context, arg UpdateInsertWhitelistsParams) error
- func (q *Queries) UpdatePortalAppFields(ctx context.Context, arg UpdatePortalAppFieldsParams) error
- func (q *Queries) UpdatePortalAppSettings(ctx context.Context, arg UpdatePortalAppSettingsParams) error
- func (q *Queries) UpdateUpsertAccountNotification(ctx context.Context, arg UpdateUpsertAccountNotificationParams) error
- func (q *Queries) UpdateUserAcceptedInvite(ctx context.Context, arg UpdateUserAcceptedInviteParams) error
- func (q *Queries) UpdateUserDeclinedInvite(ctx context.Context, arg UpdateUserDeclinedInviteParams) error
- func (q *Queries) UpdateUserFields(ctx context.Context, arg UpdateUserFieldsParams) error
- func (q *Queries) UpsertAccountIntegrations(ctx context.Context, arg UpsertAccountIntegrationsParams) (AccountIntegration, error)
- func (q *Queries) UpsertChainAliasDomains(ctx context.Context, arg UpsertChainAliasDomainsParams) error
- func (q *Queries) UpsertChainAltruist(ctx context.Context, arg UpsertChainAltruistParams) error
- func (q *Queries) UpsertChainCheck(ctx context.Context, arg UpsertChainCheckParams) error
- func (q *Queries) UpsertStripeSubID(ctx context.Context, arg UpsertStripeSubIDParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type SelectAccountRow
- type SelectAccountsRow
- type SelectAllUsersRow
- type SelectChainRow
- type SelectChainsRow
- type SelectGigastakeApplicationsRow
- type SelectGlobalBlockedContractRow
- type SelectLatestConfigurationsRow
- type SelectPlansRow
- type SelectPortalApplicationsRow
- type SelectUserIDsRow
- type SelectUserPermissionsRow
- type SelectValidatorChainConfigRow
- type SelectValidatorMethodConfigRow
- type SetGlobalBlockedContractActiveParams
- type UpdateAccountFieldsParams
- type UpdateAccountOwnerToAdminParams
- type UpdateAccountUserRoleParams
- type UpdateChainActiveParams
- type UpdateChainParams
- type UpdateDeleteAccountNotificationParams
- type UpdateDeleteWhitelistsParams
- type UpdateGigastakeAppChainIDsParams
- type UpdateInsertWhitelistsParams
- type UpdatePortalAppFieldsParams
- type UpdatePortalAppSettingsParams
- type UpdateUpsertAccountNotificationParams
- type UpdateUserAcceptedInviteParams
- type UpdateUserDeclinedInviteParams
- type UpdateUserFieldsParams
- type UpsertAccountIntegrationsParams
- type UpsertChainAliasDomainsParams
- type UpsertChainAltruistParams
- type UpsertChainCheckParams
- type UpsertStripeSubIDParams
- type User
- type UserAuthProvider
- type UserRole
- type UserRow
- type ValidatorMethodStr
- type WhitelistType
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 ¶
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 ¶
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 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 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 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 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 DeleteAccountParams ¶
type DeleteAccountParams struct { ID types.AccountID `json:"id"` DeletedAt pgtype.Timestamptz `json:"deleted_at"` }
type DeleteAccountUserParams ¶
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 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 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) 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 ¶
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 ¶
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 (*Queries) AddGlobalBlockedContract ¶
func (q *Queries) AddGlobalBlockedContract(ctx context.Context, arg AddGlobalBlockedContractParams) error
func (*Queries) CheckAccountExists ¶
func (*Queries) CheckAccountUserAccepted ¶
func (*Queries) CheckAccountUserExists ¶
func (*Queries) CheckAccountUserRole ¶
func (*Queries) CheckAliasExists ¶
func (*Queries) CheckChainExists ¶
func (*Queries) CheckGigastakeAppNameExists ¶ added in v2.12.0
func (*Queries) CheckIDExists ¶
func (*Queries) CheckIfAppWhitelistExists ¶
func (*Queries) CheckPlanExists ¶
func (*Queries) CheckPlanTypeExists ¶
func (*Queries) CheckPortalAppExists ¶
func (*Queries) CheckUserAccountExists ¶
func (*Queries) CheckUserEmail ¶
func (*Queries) CheckUserExists ¶
func (*Queries) CheckUserHasOwnAccount ¶ added in v2.7.1
func (*Queries) CheckUserIDFromEmail ¶
func (*Queries) CheckUserProviderExists ¶
func (*Queries) CreateUserNewSignUp ¶
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 (*Queries) GetAccountOwner ¶
func (*Queries) GetGigastakeApplicationsCount ¶ added in v2.12.0
func (*Queries) GetInvitedUserID ¶ added in v2.15.1
func (*Queries) GetLastCreatedUserID ¶
func (*Queries) GetPlanDailyLimit ¶
func (*Queries) GetPortalUserID ¶
func (*Queries) GetUserDataFromAuthProviderUserID ¶
func (q *Queries) GetUserDataFromAuthProviderUserID(ctx context.Context, providerUserID types.ProviderUserID) (GetUserDataFromAuthProviderUserIDRow, error)
func (*Queries) GetUserDataFromPortalUserID ¶
func (*Queries) GetUserFields ¶
func (*Queries) GetUserIDFromEmail ¶ added in v2.15.2
func (*Queries) InsertAccount ¶
func (*Queries) InsertAccountUser ¶ added in v2.5.0
func (*Queries) InsertAccountUserAccessNoUser ¶
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 (*Queries) IsUserInvited ¶ added in v2.15.2
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
ReadValidatorConfig reads the method validator plugin config from the database
func (*Queries) RemoveGlobalBlockedContract ¶
func (*Queries) SelectAccount ¶
func (*Queries) SelectAccounts ¶
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 (*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 (*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 (*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 (*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
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 SelectValidatorChainConfigRow ¶ added in v2.8.0
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 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 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 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