postgres

package
v0.0.0-...-2b2340b Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const QUERY_RELAYDATA = `` /* 2146-byte string literal not displayed */
View Source
const QUERY_RELAYDATA_COUNT = `SELECT COUNT(*) FROM "relay_data" rd`
View Source
const QUERY_VAULT_RELAYDATA = `` /* 1023-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandExecuted

type CommandExecuted struct {
	ID               string `gorm:"primaryKey"`
	SourceChain      sql.NullString
	DestinationChain sql.NullString
	TxHash           sql.NullString
	BlockNumber      sql.NullInt32
	LogIndex         sql.NullInt32
	CommandId        sql.NullString
	Status           sql.NullInt32
	ReferenceTxHash  sql.NullString
	Amount           sql.NullString
}

type ContractCall

type ContractCall struct {
	ID                   string `gorm:"primaryKey"`
	CreatedAt            sql.NullTime
	UpdatedAt            sql.NullTime
	BlockNumber          sql.NullInt32 `gorm:"column:block_number"`
	LogIndex             sql.NullInt32
	ContractAddress      sql.NullString
	Payload              sql.NullString
	PayloadHash          sql.NullString
	SourceAddress        sql.NullString
	DestUserAddress      sql.NullString
	DestContractAddress  sql.NullString //Same as ContractAddress
	Amount               sql.NullString
	ContractCallApproved ContractCallApproved `gorm:"foreignKey:ID;references:ID"`
	CommandExecuted      CommandExecuted      `gorm:"foreignKey:ID;references:ID"`
	StakerPublicKey      sql.NullString
	SenderAddress        sql.NullString
	RelayDataID          string
	TxHash               sql.NullString
	TxHex                []byte
}

type ContractCallApproved

type ContractCallApproved struct {
	ID               string `gorm:"primaryKey"`
	CreatedAt        sql.NullTime
	UpdatedAt        sql.NullTime
	SourceChain      sql.NullString
	DestinationChain sql.NullString
	TxHash           sql.NullString
	BlockNumber      sql.NullInt32
	LogIndex         sql.NullInt32
	SourceAddress    sql.NullString
	ContractAddress  sql.NullString
	SourceTxHash     sql.NullString
	SourceEventIndex sql.NullInt64
	PayloadHash      sql.NullString
	CommandId        sql.NullString
}

type ContractCallWithToken

type ContractCallWithToken struct {
	ID                  string `gorm:"primaryKey"`
	CreatedAt           sql.NullTime
	UpdatedAt           sql.NullTime
	BlockNumber         sql.NullInt32
	ContractAddress     sql.NullString
	Payload             sql.NullString
	PayloadHash         sql.NullString
	SourceAddress       sql.NullString
	DestUserAddress     sql.NullString
	DestContractAddress sql.NullString
	Amount              sql.NullString
	Symbol              sql.NullString
	RelayDataID         uint `gorm:"foreignKey:ID;references:ID"`
}

type ContractCallWithTokenApproved

type ContractCallWithTokenApproved struct {
	ID               string `gorm:"primaryKey"`
	CreatedAt        sql.NullTime
	UpdatedAt        sql.NullTime
	SourceChain      sql.NullString
	DestinationChain sql.NullString
	TxHash           sql.NullString
	BlockNumber      sql.NullInt32
	LogIndex         sql.NullInt32
	SourceAddress    sql.NullString
	ContractAddress  sql.NullString
	SourceTxHash     sql.NullString
	SourceEventIndex sql.NullInt64
	PayloadHash      sql.NullString
	CommandId        sql.NullString
}

type IndexerClient

type IndexerClient struct {
	PgClient *PostgresClient
}

func (*IndexerClient) FindBlockEventsByAttribute

func (c *IndexerClient) FindBlockEventsByAttribute(ctx context.Context, attribute string, values []string, options *Options) ([]models.BlockEvent, *types.Error)

func (*IndexerClient) FindEventAttributes

func (c *IndexerClient) FindEventAttributes(ctx context.Context, eventIds []uint) (map[uint]MapBlockEventAttributes, *types.Error)

func (*IndexerClient) FindEventsByType

func (c *IndexerClient) FindEventsByType(ctx context.Context, options *Options) ([]models.BlockEvent, *types.Error)

func (*IndexerClient) FindEventsByTypes

func (c *IndexerClient) FindEventsByTypes(ctx context.Context, options *Options) ([]models.BlockEvent, *types.Error)

type MapBlockEventAttributes

type MapBlockEventAttributes map[string]string

type Options

type Options struct {
	Size         int
	Offset       int
	EventId      string
	EventType    string
	EventTypes   []string
	StakerPubkey string
}

type PostgresClient

type PostgresClient struct {
	DbName string
	Db     *gorm.DB
	// contains filtered or unexported fields
}

type RelayData

type RelayData struct {
	ID                      string `gorm:"primaryKey"`
	PacketSequence          sql.NullInt32
	ExecuteHash             sql.NullString
	Status                  sql.NullInt32
	From                    sql.NullString
	To                      sql.NullString
	CreatedAt               sql.NullTime
	UpdatedAt               sql.NullTime
	ContractCallID          sql.NullInt32 `gorm:"foreignKey:ID;references:ID"`
	ContractCall            ContractCall  `gorm:"foreignKey:ID;references:ID"`
	ContractCallWithTokenID sql.NullInt32 `gorm:"foreignKey:ID;references:ID"`
}

func (RelayData) TableName

func (RelayData) TableName() string

type RelayDataStatus

type RelayDataStatus string
const (
	Pending   RelayDataStatus = "Pending"
	Approved  RelayDataStatus = "Approved"
	Success   RelayDataStatus = "Success"
	Failed    RelayDataStatus = "Failed"
	Undefined RelayDataStatus = "Undefined"
)

func ToReadableStatus

func ToReadableStatus(status int) RelayDataStatus

type RelayerClient

type RelayerClient struct {
	PgClient *PostgresClient
}

func (*RelayerClient) GetContractCallParams

func (c *RelayerClient) GetContractCallParams(ctx context.Context, messageIds []string) (map[string]ContractCall, *types.Error)

func (*RelayerClient) GetExecutedVaultBonding

func (c *RelayerClient) GetExecutedVaultBonding(ctx context.Context, options *Options) ([]RelayData, *types.Error)

func (*RelayerClient) GetRelayerDatas

func (c *RelayerClient) GetRelayerDatas(ctx context.Context, options *Options) ([]RelayData, int, *types.Error)

type ScalarClient

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

func NewScalarClient

func NewScalarClient(scalarPostgresClient *PostgresClient) *ScalarClient

func (*ScalarClient) DeleteDApp

func (s *ScalarClient) DeleteDApp(ID string) error

func (*ScalarClient) GetCustodialByName

func (s *ScalarClient) GetCustodialByName(name string) (*models.Custodial, error)

func (*ScalarClient) GetCustodialByNames

func (s *ScalarClient) GetCustodialByNames(names []string) ([]*models.Custodial, error)

func (*ScalarClient) GetCustodialGroupByID

func (s *ScalarClient) GetCustodialGroupByID(id uint) (*models.CustodialGroup, error)

func (*ScalarClient) GetCustodialGroupByName

func (s *ScalarClient) GetCustodialGroupByName(name string) (*models.CustodialGroup, error)

func (*ScalarClient) GetCustodialGroups

func (s *ScalarClient) GetCustodialGroups() ([]*models.CustodialGroup, error)

func (*ScalarClient) GetCustodials

func (s *ScalarClient) GetCustodials() ([]*models.Custodial, error)

func (*ScalarClient) GetDApps

func (s *ScalarClient) GetDApps() ([]*models.DApp, error)

func (*ScalarClient) GetShortenCustodialGroups

func (s *ScalarClient) GetShortenCustodialGroups() ([]*models.ShortenCustodialGroup, error)

func (*ScalarClient) InitDApps

func (s *ScalarClient) InitDApps(cfg config.InitDAppsConfig) error

func (*ScalarClient) SaveCustodial

func (s *ScalarClient) SaveCustodial(custodial *models.Custodial) error

func (*ScalarClient) SaveCustodialGroup

func (s *ScalarClient) SaveCustodialGroup(custodialGroup *models.CustodialGroup) error

func (*ScalarClient) SaveDApp

func (s *ScalarClient) SaveDApp(dApp *models.DApp) error

func (*ScalarClient) ToggleDApp

func (s *ScalarClient) ToggleDApp(ID string) error

func (*ScalarClient) UpdateDApp

func (s *ScalarClient) UpdateDApp(dApp *models.DApp) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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