indexerdb

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account added in v1.10.0

type Account struct {
	Account types.AccountID
	Balance int64
	Nonce   int64
}

type Block added in v1.9.0

type Block struct {
	Height   int64
	Time     time.Time
	DataHash []byte
}

type CreateAccountParams added in v1.10.0

type CreateAccountParams struct {
	Account types.AccountID
	Balance int64
	Nonce   int64
}

type CreateBlockParams added in v1.9.0

type CreateBlockParams struct {
	Height   int64
	Time     time.Time
	DataHash []byte
}

type CreateProcessParams

type CreateProcessParams struct {
	ID                types.ProcessID
	EntityID          types.EntityID
	StartBlock        int64
	EndBlock          int64
	StartDate         time.Time
	EndDate           time.Time
	BlockCount        int64
	VoteCount         int64
	HaveResults       bool
	FinalResults      bool
	CensusRoot        types.CensusRoot
	MaxCensusSize     int64
	CensusUri         string
	Metadata          string
	CensusOrigin      int64
	Status            int64
	Namespace         int64
	Envelope          string
	Mode              string
	VoteOpts          string
	PrivateKeys       string
	PublicKeys        string
	QuestionIndex     int64
	CreationTime      time.Time
	SourceBlockHeight int64
	SourceNetworkID   int64
	FromArchive       bool
	ChainID           string
	ResultsVotes      string
}

type CreateTokenFeeParams added in v1.9.0

type CreateTokenFeeParams struct {
	FromAccount []byte
	BlockHeight int64
	Reference   string
	Cost        int64
	TxType      string
	SpendTime   time.Time
}

type CreateTokenTransferParams

type CreateTokenTransferParams struct {
	TxHash       types.Hash
	BlockHeight  int64
	FromAccount  types.AccountID
	ToAccount    types.AccountID
	Amount       int64
	TransferTime time.Time
}

type CreateTransactionParams added in v1.8.0

type CreateTransactionParams struct {
	Hash        types.Hash
	BlockHeight int64
	BlockIndex  int64
	Type        string
}

type CreateVoteParams added in v1.8.0

type CreateVoteParams struct {
	Nullifier            types.Nullifier
	ProcessID            types.ProcessID
	BlockHeight          int64
	BlockIndex           int64
	Weight               string
	VoterID              state.VoterID
	OverwriteCount       int64
	EncryptionKeyIndexes string
	Package              string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetLastTransactionsParams added in v1.8.0

type GetLastTransactionsParams struct {
	Limit  int64
	Offset int64
}

type GetListAccountsParams added in v1.10.0

type GetListAccountsParams struct {
	Limit  int64
	Offset int64
}

type GetTokenFeesByFromAccountParams added in v1.9.0

type GetTokenFeesByFromAccountParams struct {
	FromAccount []byte
	Offset      int64
	Limit       int64
}

type GetTokenFeesByReferenceParams added in v1.9.0

type GetTokenFeesByReferenceParams struct {
	Reference string
	Offset    int64
	Limit     int64
}

type GetTokenFeesByTxTypeParams added in v1.9.0

type GetTokenFeesByTxTypeParams struct {
	TxType string
	Offset int64
	Limit  int64
}

type GetTokenFeesParams added in v1.9.0

type GetTokenFeesParams struct {
	Offset int64
	Limit  int64
}

type GetTokenTransfersByFromAccountParams

type GetTokenTransfersByFromAccountParams struct {
	FromAccount types.AccountID
	Offset      int64
	Limit       int64
}

type GetTokenTransfersByToAccountParams added in v1.10.0

type GetTokenTransfersByToAccountParams struct {
	ToAccount types.AccountID
	Offset    int64
	Limit     int64
}

type GetTxReferenceByBlockHeightAndBlockIndexParams added in v1.8.0

type GetTxReferenceByBlockHeightAndBlockIndexParams struct {
	BlockHeight int64
	BlockIndex  int64
}

type GetVoteRow added in v1.8.0

type GetVoteRow struct {
	Nullifier            types.Nullifier
	ProcessID            types.ProcessID
	BlockHeight          int64
	BlockIndex           int64
	Weight               string
	VoterID              state.VoterID
	OverwriteCount       int64
	EncryptionKeyIndexes string
	Package              string
	TxHash               types.Hash
	BlockTime            sql.NullTime
}

type Process

type Process struct {
	ID                 types.ProcessID
	EntityID           types.EntityID
	StartBlock         int64
	EndBlock           int64
	StartDate          time.Time
	EndDate            time.Time
	BlockCount         int64
	VoteCount          int64
	ChainID            string
	HaveResults        bool
	FinalResults       bool
	ResultsVotes       string
	ResultsWeight      string
	ResultsBlockHeight int64
	CensusRoot         types.CensusRoot
	MaxCensusSize      int64
	CensusUri          string
	Metadata           string
	CensusOrigin       int64
	Status             int64
	Namespace          int64
	Envelope           string
	Mode               string
	VoteOpts           string
	PrivateKeys        string
	PublicKeys         string
	QuestionIndex      int64
	CreationTime       time.Time
	SourceBlockHeight  int64
	SourceNetworkID    int64
	FromArchive        bool
}

type Queries

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

func New

func New(db DBTX) *Queries

func Prepare added in v1.9.0

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) Close added in v1.9.0

func (q *Queries) Close() error

func (*Queries) CountAccounts added in v1.10.0

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

func (*Queries) CountTokenTransfersByAccount added in v1.10.0

func (q *Queries) CountTokenTransfersByAccount(ctx context.Context, account types.AccountID) (int64, error)

func (*Queries) CountTransactions added in v1.8.0

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

func (*Queries) CountVotes added in v1.9.0

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

func (*Queries) CountVotesByProcessID added in v1.9.0

func (q *Queries) CountVotesByProcessID(ctx context.Context, processID types.ProcessID) (int64, error)

func (*Queries) CreateAccount added in v1.10.0

func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) (sql.Result, error)

func (*Queries) CreateBlock added in v1.9.0

func (q *Queries) CreateBlock(ctx context.Context, arg CreateBlockParams) (sql.Result, error)

func (*Queries) CreateProcess

func (q *Queries) CreateProcess(ctx context.Context, arg CreateProcessParams) (sql.Result, error)

func (*Queries) CreateTokenFee added in v1.9.0

func (q *Queries) CreateTokenFee(ctx context.Context, arg CreateTokenFeeParams) (sql.Result, error)

func (*Queries) CreateTokenTransfer

func (q *Queries) CreateTokenTransfer(ctx context.Context, arg CreateTokenTransferParams) (sql.Result, error)

func (*Queries) CreateTransaction added in v1.8.0

func (q *Queries) CreateTransaction(ctx context.Context, arg CreateTransactionParams) (sql.Result, error)

func (*Queries) CreateVote added in v1.8.0

func (q *Queries) CreateVote(ctx context.Context, arg CreateVoteParams) (sql.Result, error)

func (*Queries) GetBlock added in v1.9.0

func (q *Queries) GetBlock(ctx context.Context, height int64) (Block, error)

func (*Queries) GetEntityCount

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

func (*Queries) GetLastTransactions added in v1.8.0

func (q *Queries) GetLastTransactions(ctx context.Context, arg GetLastTransactionsParams) ([]Transaction, error)

func (*Queries) GetListAccounts added in v1.10.0

func (q *Queries) GetListAccounts(ctx context.Context, arg GetListAccountsParams) ([]Account, error)

func (*Queries) GetProcess

func (q *Queries) GetProcess(ctx context.Context, id types.ProcessID) (Process, error)

func (*Queries) GetProcessCount

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

func (*Queries) GetProcessIDsByFinalResults

func (q *Queries) GetProcessIDsByFinalResults(ctx context.Context, finalResults bool) ([]types.ProcessID, error)

func (*Queries) GetProcessStatus

func (q *Queries) GetProcessStatus(ctx context.Context, id types.ProcessID) (int64, error)

func (*Queries) GetTokenFees added in v1.9.0

func (q *Queries) GetTokenFees(ctx context.Context, arg GetTokenFeesParams) ([]TokenFee, error)

func (*Queries) GetTokenFeesByFromAccount added in v1.9.0

func (q *Queries) GetTokenFeesByFromAccount(ctx context.Context, arg GetTokenFeesByFromAccountParams) ([]TokenFee, error)

func (*Queries) GetTokenFeesByReference added in v1.9.0

func (q *Queries) GetTokenFeesByReference(ctx context.Context, arg GetTokenFeesByReferenceParams) ([]TokenFee, error)

func (*Queries) GetTokenFeesByTxType added in v1.9.0

func (q *Queries) GetTokenFeesByTxType(ctx context.Context, arg GetTokenFeesByTxTypeParams) ([]TokenFee, error)

func (*Queries) GetTokenTransfer

func (q *Queries) GetTokenTransfer(ctx context.Context, txHash types.Hash) (TokenTransfer, error)

func (*Queries) GetTokenTransfersByFromAccount

func (q *Queries) GetTokenTransfersByFromAccount(ctx context.Context, arg GetTokenTransfersByFromAccountParams) ([]TokenTransfer, error)

func (*Queries) GetTokenTransfersByToAccount added in v1.10.0

func (q *Queries) GetTokenTransfersByToAccount(ctx context.Context, arg GetTokenTransfersByToAccountParams) ([]TokenTransfer, error)

func (*Queries) GetTransaction added in v1.8.0

func (q *Queries) GetTransaction(ctx context.Context, id int64) (Transaction, error)

func (*Queries) GetTransactionByHash added in v1.8.0

func (q *Queries) GetTransactionByHash(ctx context.Context, hash types.Hash) (Transaction, error)

func (*Queries) GetTxReferenceByBlockHeightAndBlockIndex added in v1.8.0

func (q *Queries) GetTxReferenceByBlockHeightAndBlockIndex(ctx context.Context, arg GetTxReferenceByBlockHeightAndBlockIndexParams) (Transaction, error)

func (*Queries) GetVote added in v1.8.0

func (q *Queries) GetVote(ctx context.Context, nullifier types.Nullifier) (GetVoteRow, error)

func (*Queries) SearchEntities

func (q *Queries) SearchEntities(ctx context.Context, arg SearchEntitiesParams) ([]SearchEntitiesRow, error)

func (*Queries) SearchProcesses

func (q *Queries) SearchProcesses(ctx context.Context, arg SearchProcessesParams) ([]types.ProcessID, error)

func (*Queries) SearchVotes added in v1.8.0

func (q *Queries) SearchVotes(ctx context.Context, arg SearchVotesParams) ([]SearchVotesRow, error)

func (*Queries) SetProcessResultsCancelled

func (q *Queries) SetProcessResultsCancelled(ctx context.Context, arg SetProcessResultsCancelledParams) (sql.Result, error)

func (*Queries) SetProcessResultsReady

func (q *Queries) SetProcessResultsReady(ctx context.Context, arg SetProcessResultsReadyParams) (sql.Result, error)

func (*Queries) SetProcessVoteCount added in v1.10.0

func (q *Queries) SetProcessVoteCount(ctx context.Context, arg SetProcessVoteCountParams) (sql.Result, error)

func (*Queries) UpdateProcessEndBlock added in v1.9.0

func (q *Queries) UpdateProcessEndBlock(ctx context.Context, arg UpdateProcessEndBlockParams) (sql.Result, error)

func (*Queries) UpdateProcessFromState

func (q *Queries) UpdateProcessFromState(ctx context.Context, arg UpdateProcessFromStateParams) (sql.Result, error)

func (*Queries) UpdateProcessResultByID

func (q *Queries) UpdateProcessResultByID(ctx context.Context, arg UpdateProcessResultByIDParams) (sql.Result, error)

func (*Queries) UpdateProcessResults

func (q *Queries) UpdateProcessResults(ctx context.Context, arg UpdateProcessResultsParams) (sql.Result, error)

func (*Queries) WithTx

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

type SearchEntitiesParams

type SearchEntitiesParams struct {
	EntityIDSubstr interface{}
	Offset         int64
	Limit          int64
}

type SearchEntitiesRow added in v1.9.0

type SearchEntitiesRow struct {
	EntityID     types.EntityID
	ProcessCount int64
}

type SearchProcessesParams

type SearchProcessesParams struct {
	EntityID        interface{}
	Namespace       interface{}
	Status          interface{}
	SourceNetworkID interface{}
	IDSubstr        interface{}
	WithResults     interface{}
	Offset          int64
	Limit           int64
}

type SearchVotesParams added in v1.8.0

type SearchVotesParams struct {
	ProcessID       interface{}
	NullifierSubstr interface{}
	Offset          int64
	Limit           int64
}

type SearchVotesRow added in v1.8.0

type SearchVotesRow struct {
	Nullifier            types.Nullifier
	ProcessID            types.ProcessID
	BlockHeight          int64
	BlockIndex           int64
	Weight               string
	VoterID              state.VoterID
	OverwriteCount       int64
	EncryptionKeyIndexes string
	Package              string
	Hash                 types.Hash
}

type SetProcessResultsCancelledParams added in v1.10.0

type SetProcessResultsCancelledParams struct {
	EndDate time.Time
	ID      types.ProcessID
}

type SetProcessResultsReadyParams

type SetProcessResultsReadyParams struct {
	Votes       string
	Weight      string
	BlockHeight int64
	EndDate     time.Time
	ID          types.ProcessID
}

type SetProcessVoteCountParams added in v1.10.0

type SetProcessVoteCountParams struct {
	VoteCount int64
	ID        types.ProcessID
}

type TokenFee added in v1.9.0

type TokenFee struct {
	ID          int64
	BlockHeight int64
	FromAccount []byte
	Reference   string
	Cost        int64
	TxType      string
	SpendTime   time.Time
}

type TokenTransfer

type TokenTransfer struct {
	TxHash       types.Hash
	BlockHeight  int64
	FromAccount  types.AccountID
	ToAccount    types.AccountID
	Amount       int64
	TransferTime time.Time
}

type Transaction added in v1.8.0

type Transaction struct {
	ID          int64
	Hash        types.Hash
	BlockHeight int64
	BlockIndex  int64
	Type        string
}

type UpdateProcessEndBlockParams added in v1.9.0

type UpdateProcessEndBlockParams struct {
	EndBlock int64
	EndDate  time.Time
	ID       types.ProcessID
}

type UpdateProcessFromStateParams

type UpdateProcessFromStateParams struct {
	CensusRoot  types.CensusRoot
	CensusUri   string
	PrivateKeys string
	PublicKeys  string
	Metadata    string
	Status      int64
	StartDate   time.Time
	ID          types.ProcessID
}

type UpdateProcessResultByIDParams

type UpdateProcessResultByIDParams struct {
	Votes    string
	Weight   string
	VoteOpts string
	Envelope string
	ID       types.ProcessID
}

type UpdateProcessResultsParams

type UpdateProcessResultsParams struct {
	Votes       string
	Weight      string
	BlockHeight int64
	ID          types.ProcessID
}

Jump to

Keyboard shortcuts

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