models

package
v0.9.9-rc6 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const AccountKeyPrefix = "account:entry"

AccountKeyPrefix is a constant defining the prefix for the database keys of ethereum based address entries.

View Source
const ApiKeyPrefix = "acl:api_key:entry"

ApiKeyPrefix is a constant defining the prefix for the database keys of contract api key entries.

View Source
const AstKeyPrefix = "contract:ast:entry"

AstKeyPrefix is a constant defining the prefix for the database keys of contract metadata entries.

View Source
const CfgKeyPrefix = "contract:cfg:entry"

CfgKeyPrefix is a constant defining the prefix for the database keys of contract cfg entries.

View Source
const ConstructorKeyPrefix = "contract:constructor:entry"

ConstructorKeyPrefix is a constant defining the prefix for the database keys of contract constructor entries.

View Source
const ContractKeyPrefix = "contract:entry"

ContractKeyPrefix is a constant defining the prefix for the database keys of contract entries.

View Source
const EventKeyPrefix = "contract:event:entry"

EventKeyPrefix is a constant defining the prefix for the database keys of contract metadata entries.

View Source
const FunctionKeyPrefix = "contract:function:entry"

FunctionKeyPrefix is a constant defining the prefix for the database keys of contract metadata entries.

View Source
const MetadataKeyPrefix = "contract:metadata:entry"

MetadataKeyPrefix is a constant defining the prefix for the database keys of contract metadata entries.

View Source
const StandardKeyPrefix = "contract:standard:entry"

StandardKeyPrefix is a constant defining the prefix for the database keys of contract standard entries.

View Source
const TokenKeyPrefix = "contract:token:entry"

TokenKeyPrefix is a constant defining the prefix for the database keys of contract metadata entries.

View Source
const VariableKeyPrefix = "contract:variable:entry"

VariableKeyPrefix is a constant defining the prefix for the database keys of contract metadata entries.

Variables

This section is empty.

Functions

func AcquireLock

func AcquireLock(ctx context.Context, redisCache *cache.Redis, key string, ttl time.Duration) (bool, error)

func CheckIfLocked

func CheckIfLocked(ctx context.Context, redisCache *cache.Redis, key string) (bool, error)

func DecodeCursor

func DecodeCursor(encodedCursor string) (*big.Int, error)

func DeleteApiKeys

func DeleteApiKeys(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, apiKeys ...*ApiKey) error

DeleteApiKeys deletes the ApiKey instance from the Postgresql database.

func GetAccountKey

func GetAccountKey(networkId string, address string) string

func GetApiKey

func GetApiKey(id uuid.UUID, label string) string

func GetAstKey

func GetAstKey(networkId string, address string) string

func GetCfgKey

func GetCfgKey(networkId string, address string) string

func GetConstructorKey

func GetConstructorKey(networkId string, address string) string

func GetContractEventReferencesByReferenceIDs

func GetContractEventReferencesByReferenceIDs(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address, referenceIds []string) ([]string, error)

GetContractEventReferencesByReferenceIDs retrieves a multiple contract function from the database based on a unique combination of network_id and contract id.

func GetContractFunctionReferencesByIDs

func GetContractFunctionReferencesByIDs(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address, referenceIds []string) ([]string, error)

GetContractFunctionReferencesByIDs retrieves a multiple contract function from the database based on a unique combination of network_id and contract id.

func GetEventKey

func GetEventKey(networkId string, address string, referenceId string) string

func GetFunctionKey

func GetFunctionKey(networkId string, address string, referenceId string) string

func GetMetadataKey

func GetMetadataKey(networkId string, address string) string

func GetStandardKey

func GetStandardKey(networkId string, address string, standard standards.Standard) string

func GetTokenKey

func GetTokenKey(networkId string, address string) string

func GetVariableKey

func GetVariableKey(networkId string, address string, name string) string

func GetVariableNamesByContract

func GetVariableNamesByContract(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address) ([]string, error)

func ReleaseLock

func ReleaseLock(ctx context.Context, redisCache *cache.Redis, key string) error

func SaveAccounts

func SaveAccounts(ctx context.Context, redisCache *cache.Redis, dbAdapter *db.Postgres, accounts ...*Account) error

SaveAccounts performs an upsert (insert or update) of multiple Accounts instances in the Postgres database in a batched transaction.

func SaveApiKeys

func SaveApiKeys(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, apiKeys ...*ApiKey) error

SaveApiKeys saves the ApiKey instance to the Postgresql database.

func SaveAst

func SaveAst(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, asts ...*Ast) error

func SaveCfg

func SaveCfg(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, cfgs ...*Cfg) error

SaveCfg saves a Cfg instance to the Postgres database.

func SaveConstructors

func SaveConstructors(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, constructors ...*Constructor) error

SaveConstructors saves a list of Constructor instances or one to the Postgres database.

func SaveContract

func SaveContract(ctx context.Context, dbAdapter *db.Postgres, contracts ...*Contract) error

SaveContract performs an upsert (insert or update) of multiple Contract instances in the PostgreSQL database in a batched transaction.

func SaveEvents

func SaveEvents(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, events ...*Event) error

SaveEvents saves a Event instance to the Postgres database.

func SaveFunctions

func SaveFunctions(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, fns ...*Function) error

SaveFunctions saves a Function instance to the Postgres database.

func SaveMetadata

func SaveMetadata(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, metadatas ...*Metadata) error

SaveMetadata saves a batch of Metadata instances into the PostgreSQL database.

func SaveStandards

func SaveStandards(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, standards ...*Standard) error

SaveStandards saves a Standard instance (bulk) to the Postgres database.

func SaveToken

func SaveToken(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, tokens ...*Token) error

func SaveVariables

func SaveVariables(ctx context.Context, dbAdapter *db.Postgres, redisCache *cache.Redis, variables ...*Variable) error

SaveVariables saves a Variable instance to the Clickhouse database.

Types

type Account

type Account struct {
	Id                             uuid.UUID
	NetworkId                      types.BigInt
	CreationBlock                  types.BigInt
	CreationTxHash                 string
	Address                        string
	Name                           string
	ENS                            string
	Tags                           []string
	Type                           string
	Balance                        string
	Blacklisted                    bool
	BlacklistReasons               []string
	BlacklistContractReferences    []string
	BlacklistAccountReferences     []string
	BlacklistTransactionReferences []string
	CompletedStates                []string
	FailedStates                   []string
	Processed                      bool
	Partial                        bool
	CreatedAt                      time.Time
	UpdatedAt                      time.Time
}

func GetAccountByNetworkId

func GetAccountByNetworkId(ctx context.Context, db *db.Postgres, networkId *big.Int, address common.Address) (*Account, error)

func GetAccounts

func GetAccounts(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, limit uint, offset uint) ([]*Account, error)

GetAccounts retrieves a list of all accounts from the database based on a unique combination of network_id (paginated).

func GetAccountsByTags

func GetAccountsByTags(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, tags []string, limit uint, offset uint) ([]*Account, error)

GetAccountsByTags retrieves a list of all accounts from the database based on a unique combination of network_id and tags (paginated).

func (*Account) EncodeCursor

func (c *Account) EncodeCursor() string

func (*Account) GetKey

func (c *Account) GetKey() string

GetKey constructs and returns a unique key for the entry combining the prefix, network, networkID, and address.

func (*Account) IsCompleted

func (c *Account) IsCompleted() bool

type ApiKey

type ApiKey struct {
	Id                uuid.UUID `json:"id"`
	OrganizationId    uuid.UUID `json:"organizationId"`
	ProfileId         string    `json:"profileId"`
	Label             string    `json:"label"`
	Key               string    `json:"key"`
	Roles             []string  `json:"roles"`
	RateLimit         int32     `json:"rateLimit"`
	RateLimitDuration string    `json:"rateLimitDuration"`
	Enabled           bool      `json:"enabled"`
	Suspended         bool      `json:"suspended"`
	CreatedAt         time.Time `ch:"created_at"`
	UpdatedAt         time.Time `ch:"updated_at"`
}

func GetApiKeyByID

func GetApiKeyByID(ctx context.Context, dbAdapter *db.Postgres, id uuid.UUID) (*ApiKey, error)

func GetApiKeyByKey

func GetApiKeyByKey(ctx context.Context, dbAdapter *db.Postgres, key string) (*ApiKey, error)

func GetApiKeyByProfileId

func GetApiKeyByProfileId(ctx context.Context, dbAdapter *db.Postgres, id string) (*ApiKey, error)

func GetApiKeys

func GetApiKeys(ctx context.Context, dbAdapter *db.Postgres, limit int) ([]ApiKey, error)

func (*ApiKey) EncodeCursor

func (a *ApiKey) EncodeCursor() string

func (*ApiKey) GenerateKey

func (a *ApiKey) GenerateKey(length int) error

func (*ApiKey) GetKey

func (a *ApiKey) GetKey() string

type Ast

type Ast struct {
	Id                  uuid.UUID
	NetworkId           types.BigInt
	ContractAddress     string
	UnitsCount          int64
	ContractsCount      int64
	InterfacesCount     int64
	LibrariesCount      int64
	StateVariablesCount int64
	FunctionsCount      int64
	EventsCount         int64
	Processed           bool
	Partial             bool
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

func GetAstByContractAddress

func GetAstByContractAddress(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address) (*Ast, error)

GetAstByContractAddress retrieves a single contract ast from the database based on a unique combination of network_id and contract id.

func (*Ast) EncodeCursor

func (c *Ast) EncodeCursor() string

func (*Ast) GetKey

func (c *Ast) GetKey() string

func (*Ast) IsCompleted

func (c *Ast) IsCompleted() bool

type Cfg

type Cfg struct {
	Id              uuid.UUID
	NetworkId       types.BigInt
	ContractAddress string
	Mermaid         string
	Processed       bool
	Partial         bool
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

func GetCfgByContractAddress

func GetCfgByContractAddress(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address) (*Cfg, error)

func GetCfgs

func GetCfgs(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, limit uint, offset uint) ([]*Cfg, error)

GetCfgs retrieves a list of all accounts from the database based on a unique combination of network_id (paginated).

func (*Cfg) EncodeCursor

func (c *Cfg) EncodeCursor() string

func (*Cfg) GetKey

func (c *Cfg) GetKey() string

func (*Cfg) IsCompleted

func (c *Cfg) IsCompleted() bool

type Constructor

type Constructor struct {
	Id              uuid.UUID
	NetworkId       types.BigInt
	ContractAddress string
	Signature       string
	Arguments       string
	ArgumentsRaw    string
	Abi             string
	Unit            string
	Processed       bool
	Partial         bool
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

func GetConstructorByContract

func GetConstructorByContract(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address) (*Constructor, error)

func GetConstructors

func GetConstructors(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, limit uint, offset uint) ([]*Constructor, error)

GetConstructors retrieves a list of all constructors from the database based on a unique combination of network_id (paginated).

func GetConstructorsByContract

func GetConstructorsByContract(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, limit uint, offset uint) ([]*Constructor, error)

GetConstructorsByContract retrieves a list of all constructors from the database based on a unique combination of network_id and contract address (paginated).

func (*Constructor) EncodeCursor

func (c *Constructor) EncodeCursor() string

func (*Constructor) GetKey

func (c *Constructor) GetKey() string

func (*Constructor) IsCompleted

func (c *Constructor) IsCompleted() bool

type Contract

type Contract struct {
	Id                   uuid.UUID
	NetworkId            types.BigInt
	BlockNumber          types.BigInt
	BlockHash            types.Hash
	TransactionHash      types.Hash
	DeployerAddress      types.Address
	Address              types.Address
	Name                 string
	Standards            []string
	Proxy                bool
	License              string
	CompilerVersion      string
	SolgoVersion         string
	Optimized            bool
	OptimizationRuns     uint64
	EVMVersion           string
	ABI                  string
	EntryUnitName        string
	Verified             bool
	SourcesProvider      string
	VerificationProvider string
	ExecutionBytecode    string
	Bytecode             string
	SafetyState          string
	SourceAvailable      bool
	SelfDestructed       bool
	ProxyImplementations []string
	CompletedStates      []string
	FailedStates         []string
	Processed            bool
	Partial              bool
	CreatedAt            time.Time
	UpdatedAt            time.Time
	ReprocessAttempt     int32
	LastReprocessAttempt time.Time
}

func GetContractByAddress

func GetContractByAddress(ctx context.Context, db *db.Postgres, networkId *big.Int, address common.Address) (*Contract, error)

GetContractByAddress retrieves a single contract from the database based on a unique combination of network_id, block_number, and address.

func GetContractByTransactionHash

func GetContractByTransactionHash(ctx context.Context, db *db.Postgres, networkId *big.Int, hash common.Hash) (*Contract, error)

GetContractByTransactionHash retrieves a single contract from the database based on a unique combination of network_id, block_number, and address.

func GetContracts

func GetContracts(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, limit uint, offset uint) ([]*Contract, error)

GetContracts retrieves a list of all contracts from the database based on a unique combination of network_id and pagination.

func GetContractsByBlockNumber

func GetContractsByBlockNumber(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, blockNumber *big.Int, limit uint, offset uint) ([]*Contract, error)

GetContractsByBlockNumber retrieves a list of all contracts from the database based on a unique combination of network_id and pagination.

func GetContractsByDeployerAddress

func GetContractsByDeployerAddress(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, deployer common.Address, limit uint, offset uint) ([]*Contract, error)

GetContractsByDeployerAddress retrieves a list of all contracts from the database based on a unique combination of network_id and pagination.

func GetContractsByStandards

func GetContractsByStandards(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, standards []string, limit uint, offset uint) ([]*Contract, error)

GetContractsByStandards retrieves a list of all contracts from the database based on a unique combination of network_id and pagination.

func (*Contract) EncodeCursor

func (c *Contract) EncodeCursor() string

func (*Contract) GetKey

func (c *Contract) GetKey() string

GetKey constructs and returns a unique key for the entry combining the prefix, network, networkID, and address.

func (*Contract) IsCompleted

func (c *Contract) IsCompleted() bool

type DbStat

type DbStat struct {
	TableName    string    `json:"tableName" doc:"Name of the table."`                       // Name of the table.
	TotalRows    big.Int   `json:"totalRows" doc:"Total number of rows in the table."`       // Total number of rows in the table.
	TotalBytes   big.Float `json:"totalSizeInBytes" doc:"Total size of the table in bytes."` // Total size of the table in bytes.
	TotalBytesMb big.Float `json:"totalSizeInMb" doc:"Total size of the table in MB."`       // Total size of the table in MB.
}

DbStat represents statistical data for a database table.

type DbStats

type DbStats struct {
	Database          string    `json:"database" doc:"Name of the database."`                          // Name of the database.
	Dialect           string    `json:"dialect" doc:"Dialect used by the database"`                    // Dialect used by the database
	Tables            []*DbStat `json:"tables" doc:"Statistical data for each table in the database."` // Statistical data for each table in the database.
	DatabaseSizeBytes big.Float `json:"databaseSizeBytes" doc:"Total size of the database in bytes."`  // Total size of the database in bytes.
	DatabaseSizeMb    big.Float `json:"databaseSizeMb" doc:"Total size of the database in MB."`        // Total size of the database in MB.
}

DbStats represents statistical data for a database.

func GetDatabaseStats

func GetDatabaseStats(ctx context.Context, dbAdapter *db.Postgres, opts *options.Dialect, roles []string) (*DbStats, error)

GetDatabaseStats retrieves full database statistics (mostly just counts). WARN: Due to the speed of the query, it is going to return approximate counts and bytes

type Event

type Event struct {
	Id              uuid.UUID
	NetworkId       types.BigInt
	ContractAddress string
	ReferenceId     string
	Name            string
	Signature       string
	SignatureRaw    string
	SignatureBytes  string
	Anonymous       bool
	Abi             string
	Unit            string
	Processed       bool
	Partial         bool
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

func GetContractEventBySignature

func GetContractEventBySignature(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address, signature common.Hash) (*Event, error)

GetContractEventBySignature retrieves a single contract event from the database based on a unique combination of network_id, contract id and log signature (topic 0).

func GetEventBySignature

func GetEventBySignature(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, signature common.Hash) (*Event, error)

func GetEvents

func GetEvents(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, limit uint, offset uint) ([]*Event, error)

GetEvents retrieves a list of all functions from the database based on a unique combination of network_id (paginated).

func GetEventsByContract

func GetEventsByContract(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, limit uint, offset uint) ([]*Event, error)

func GetEventsByContractAndName

func GetEventsByContractAndName(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, names []string, limit uint, offset uint) ([]*Event, error)

func GetEventsBySignature

func GetEventsBySignature(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, signature common.Hash, limit uint, offset uint) ([]*Event, error)

GetEventsBySignature retrieves a list of events from the database based on a unique combination of network_id and signature.

func (*Event) EncodeCursor

func (c *Event) EncodeCursor() string

func (*Event) GetKey

func (c *Event) GetKey() string

func (*Event) IsCompleted

func (c *Event) IsCompleted() bool

type Function

type Function struct {
	Id              uuid.UUID
	NetworkId       types.BigInt
	ContractAddress string
	ReferenceId     string
	Name            string
	Signature       string
	SignatureRaw    string
	SignatureBytes  string
	Abi             string
	Implemented     bool
	Visibility      string
	Mutability      string
	Virtual         bool
	Unit            string
	Processed       bool
	Partial         bool
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

func GetContractFunctionBySignature

func GetContractFunctionBySignature(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address, signature string) (*Function, error)

GetContractFunctionBySignature retrieves a single contract function from the database based on a unique combination of network_id and contract id and signature.

func GetFunctionBySignature

func GetFunctionBySignature(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, signature string) (*Function, error)

GetFunctionBySignature retrieves a single function from the database based on a unique combination of network_id and contract id and signature.

func GetFunctions

func GetFunctions(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, limit uint, offset uint) ([]*Function, error)

GetFunctions retrieves a list of all functions from the database based on a unique combination of network_id (paginated).

func GetFunctionsByContract

func GetFunctionsByContract(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, limit uint, offset uint) ([]*Function, error)

GetFunctionsByContract retrieves a list of all functions from the database based on a unique combination of network_id and contract address (paginated).

func GetFunctionsByContractAndName

func GetFunctionsByContractAndName(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, names []string, limit uint, offset uint) ([]*Function, error)

GetFunctionsByContractAndName retrieves a list of all functions from the database based on a unique combination of network_id, contract address and function name (paginated).

func GetFunctionsBySignature

func GetFunctionsBySignature(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, signature string, limit uint, offset uint) ([]*Function, error)

GetFunctionsBySignature retrieves a list of functions from the database based on a unique combination of network_id and signature.

func (*Function) EncodeCursor

func (c *Function) EncodeCursor() string

func (*Function) GetKey

func (c *Function) GetKey() string

func (*Function) IsCompleted

func (c *Function) IsCompleted() bool

type Metadata

type Metadata struct {
	Id              uuid.UUID
	NetworkId       types.BigInt
	ContractAddress string
	CborLength      int16
	AuxBytes        string
	Ipfs            string
	Bzzr0           string
	Bzzr1           string
	SolcVersion     string
	Metadata        string
	Processed       bool
	Partial         bool
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

func GetContractMetadataByAddress

func GetContractMetadataByAddress(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address) (*Metadata, error)

GetContractMetadataByAddress retrieves a single contract metadata from the database based on a unique combination of network_id and contract address.

func (*Metadata) EncodeCursor

func (c *Metadata) EncodeCursor() string

func (*Metadata) GetKey

func (c *Metadata) GetKey() string

GetKey constructs and returns a unique key for the entry combining the prefix, network, networkID, and address.

func (*Metadata) IsCompleted

func (c *Metadata) IsCompleted() bool

type Standard

type Standard struct {
	Id               uuid.UUID
	NetworkId        types.BigInt
	ContractAddress  string
	Name             string
	Type             standards.Standard
	Confidence       string
	ConfidencePoints float64
	DiscoveredTokens int64
	MaximumTokens    int64
	Threshold        float64
	Unit             string
	Processed        bool
	Partial          bool
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

func GetStandardByContractAndType

func GetStandardByContractAndType(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address, standardType standards.Standard) (*Standard, error)

func GetStandards

func GetStandards(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, limit uint, offset uint) ([]*Standard, error)

GetStandards retrieves a list of all contracts from the database based on a unique combination of network_id and pagination.

func GetStandardsByConfidences

func GetStandardsByConfidences(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, confidences []string, limit uint, offset uint) ([]*Standard, error)

func GetStandardsByContract

func GetStandardsByContract(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, limit uint, offset uint) ([]*Standard, error)

func GetStandardsByContractAndConfidences

func GetStandardsByContractAndConfidences(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, confidences []string, limit uint, offset uint) ([]*Standard, error)

func GetStandardsByContractAndTypes

func GetStandardsByContractAndTypes(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, types []string, limit uint, offset uint) ([]*Standard, error)

func GetStandardsByContractAndTypesAndConfidences

func GetStandardsByContractAndTypesAndConfidences(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, types []string, confidences []string, limit uint, offset uint) ([]*Standard, error)

func GetStandardsByTypes

func GetStandardsByTypes(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, types []string, limit uint, offset uint) ([]*Standard, error)

func GetStandardsByTypesAndConfidences

func GetStandardsByTypesAndConfidences(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, types []string, confidences []string, limit uint, offset uint) ([]*Standard, error)

func (*Standard) EncodeCursor

func (c *Standard) EncodeCursor() string

func (*Standard) GetKey

func (c *Standard) GetKey() string

func (*Standard) IsCompleted

func (c *Standard) IsCompleted() bool

type Token

type Token struct {
	Id              uuid.UUID
	NetworkId       types.BigInt
	ContractAddress string
	Name            string
	Symbol          string
	Decimals        int64
	TotalSupply     string
	Valid           bool
	CompletedStates []string
	FailedStates    []string
	Processed       bool
	Partial         bool
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

func GetTokenByContractAddress

func GetTokenByContractAddress(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, addr common.Address) (*Token, error)

GetTokenByContractAddress retrieves a single token from the database based on a unique combination of network_id and contract address.

func GetTokens

func GetTokens(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, limit uint, offset uint) ([]*Token, error)

GetTokens retrieves a list of all tokens from the database based on a unique combination of network_id.

func GetTokensBySymbol

func GetTokensBySymbol(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, symbol string, limit uint, offset uint) ([]*Token, error)

GetTokensBySymbol retrieves a list of tokens from the database based on a unique combination of network_id and symbol.

func (*Token) EncodeCursor

func (c *Token) EncodeCursor() string

func (*Token) GetKey

func (c *Token) GetKey() string

func (*Token) IsCompleted

func (c *Token) IsCompleted() bool

type Variable

type Variable struct {
	Id              uuid.UUID
	NetworkId       types.BigInt
	ContractAddress string
	Name            string
	Type            string
	StateMutability string
	Visibility      string
	IsConstant      bool
	IsAddress       bool
	IsContract      bool
	IsArray         bool
	IsDynamicArray  bool
	IsMapping       bool
	IsStruct        bool
	StorageIndex    int64
	StorageSize     int64
	StorageOffset   int64
	Unit            string
	Processed       bool
	Partial         bool
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

func GetVariables

func GetVariables(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, limit uint, offset uint) ([]*Variable, error)

GetVariables retrieves a list of all variables from the database based on a unique combination of network_id and pagination.

func GetVariablesByContract

func GetVariablesByContract(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, limit uint, offset uint) ([]*Variable, error)

func GetVariablesByContractAndName

func GetVariablesByContractAndName(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, name string, limit uint, offset uint) ([]*Variable, error)

func GetVariablesByContractAndStorageIndex

func GetVariablesByContractAndStorageIndex(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, address common.Address, index int64, limit uint, offset uint) ([]*Variable, error)

func GetVariablesByName

func GetVariablesByName(ctx context.Context, dbAdapter *db.Postgres, networkId *big.Int, name string, limit uint, offset uint) ([]*Variable, error)

func (*Variable) EncodeCursor

func (c *Variable) EncodeCursor() string

func (*Variable) GetKey

func (c *Variable) GetKey() string

func (*Variable) IsCompleted

func (c *Variable) IsCompleted() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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