queries

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Name              string
	Index             int32
	Xpub              string
	DerivationPath    string
	NextExternalIndex int32
	NextInternalIndex int32
	FkWalletID        string
}

type AccountScriptInfo

type AccountScriptInfo struct {
	Script         string
	DerivationPath string
	FkAccountName  string
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type GetAllUtxosRow

type GetAllUtxosRow struct {
	ID                  int32
	TxID                string
	Vout                int32
	Value               int64
	Asset               string
	ValueCommitment     []byte
	AssetCommitment     []byte
	ValueBlinder        []byte
	AssetBlinder        []byte
	Script              []byte
	Nonce               []byte
	RangeProof          []byte
	SurjectionProof     []byte
	AccountName         string
	LockTimestamp       int64
	LockExpiryTimestamp int64
	ID_2                sql.NullInt32
	BlockHeight         sql.NullInt32
	BlockTime           sql.NullInt64
	BlockHash           sql.NullString
	Status              sql.NullInt32
	FkUtxoID            sql.NullInt32
}

type GetTransactionRow

type GetTransactionRow struct {
	TxID        string
	TxHex       string
	BlockHash   string
	BlockHeight int32
	ID          sql.NullInt32
	AccountName sql.NullString
	FkTxID      sql.NullString
}

type GetUtxoForKeyParams

type GetUtxoForKeyParams struct {
	TxID string
	Vout int32
}

type GetUtxoForKeyRow

type GetUtxoForKeyRow struct {
	ID                  int32
	TxID                string
	Vout                int32
	Value               int64
	Asset               string
	ValueCommitment     []byte
	AssetCommitment     []byte
	ValueBlinder        []byte
	AssetBlinder        []byte
	Script              []byte
	Nonce               []byte
	RangeProof          []byte
	SurjectionProof     []byte
	AccountName         string
	LockTimestamp       int64
	LockExpiryTimestamp int64
	ID_2                sql.NullInt32
	BlockHeight         sql.NullInt32
	BlockTime           sql.NullInt64
	BlockHash           sql.NullString
	Status              sql.NullInt32
	FkUtxoID            sql.NullInt32
}

type GetUtxosForAccountRow

type GetUtxosForAccountRow struct {
	ID                  int32
	TxID                string
	Vout                int32
	Value               int64
	Asset               string
	ValueCommitment     []byte
	AssetCommitment     []byte
	ValueBlinder        []byte
	AssetBlinder        []byte
	Script              []byte
	Nonce               []byte
	RangeProof          []byte
	SurjectionProof     []byte
	AccountName         string
	LockTimestamp       int64
	LockExpiryTimestamp int64
	ID_2                sql.NullInt32
	BlockHeight         sql.NullInt32
	BlockTime           sql.NullInt64
	BlockHash           sql.NullString
	Status              sql.NullInt32
	FkUtxoID            sql.NullInt32
}

type GetWalletAccountsAndScriptsRow

type GetWalletAccountsAndScriptsRow struct {
	Walletid              string
	EncryptedMnemonic     []byte
	PasswordHash          []byte
	BirthdayBlockHeight   int32
	RootPath              string
	NetworkName           string
	NextAccountIndex      int32
	Name                  sql.NullString
	Index                 sql.NullInt32
	Xpub                  sql.NullString
	AccountDerivationPath sql.NullString
	NextExternalIndex     sql.NullInt32
	NextInternalIndex     sql.NullInt32
	FkWalletID            sql.NullString
	Script                sql.NullString
	ScriptDerivationPath  sql.NullString
	FkAccountName         sql.NullString
}

type InsertAccountParams

type InsertAccountParams struct {
	Name              string
	Index             int32
	Xpub              string
	DerivationPath    string
	NextExternalIndex int32
	NextInternalIndex int32
	FkWalletID        string
}

type InsertAccountScriptsParams

type InsertAccountScriptsParams struct {
	Script         string
	DerivationPath string
	FkAccountName  string
}

type InsertTransactionInputAccountParams

type InsertTransactionInputAccountParams struct {
	AccountName string
	FkTxID      string
}

type InsertTransactionParams

type InsertTransactionParams struct {
	TxID        string
	TxHex       string
	BlockHash   string
	BlockHeight int32
}

type InsertUtxoParams

type InsertUtxoParams struct {
	TxID                string
	Vout                int32
	Value               int64
	Asset               string
	ValueCommitment     []byte
	AssetCommitment     []byte
	ValueBlinder        []byte
	AssetBlinder        []byte
	Script              []byte
	Nonce               []byte
	RangeProof          []byte
	SurjectionProof     []byte
	AccountName         string
	LockTimestamp       int64
	LockExpiryTimestamp int64
}

type InsertUtxoStatusParams

type InsertUtxoStatusParams struct {
	BlockHeight int32
	BlockTime   int64
	BlockHash   string
	Status      int32
	FkUtxoID    int32
}

type InsertWalletParams

type InsertWalletParams struct {
	ID                  string
	EncryptedMnemonic   []byte
	PasswordHash        []byte
	BirthdayBlockHeight int32
	RootPath            string
	NetworkName         string
	NextAccountIndex    int32
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeleteAccount

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

func (*Queries) DeleteAccountScripts

func (q *Queries) DeleteAccountScripts(ctx context.Context, fkAccountName string) error

func (*Queries) DeleteTransactionInputAccounts

func (q *Queries) DeleteTransactionInputAccounts(ctx context.Context, fkTxID string) error

func (*Queries) DeleteUtxoStatuses

func (q *Queries) DeleteUtxoStatuses(ctx context.Context, fkUtxoID int32) error

func (*Queries) DeleteUtxosForAccountName

func (q *Queries) DeleteUtxosForAccountName(ctx context.Context, accountName string) error

func (*Queries) GetAccount

func (q *Queries) GetAccount(ctx context.Context, name string) (Account, error)

func (*Queries) GetAllUtxos

func (q *Queries) GetAllUtxos(ctx context.Context) ([]GetAllUtxosRow, error)

func (*Queries) GetTransaction

func (q *Queries) GetTransaction(ctx context.Context, txID string) ([]GetTransactionRow, error)

func (*Queries) GetUtxoForKey

func (q *Queries) GetUtxoForKey(ctx context.Context, arg GetUtxoForKeyParams) ([]GetUtxoForKeyRow, error)

func (*Queries) GetUtxosForAccount

func (q *Queries) GetUtxosForAccount(ctx context.Context, accountName string) ([]GetUtxosForAccountRow, error)

func (*Queries) GetUtxosForAccountName

func (q *Queries) GetUtxosForAccountName(ctx context.Context, accountName string) ([]Utxo, error)

func (*Queries) GetWalletAccountsAndScripts

func (q *Queries) GetWalletAccountsAndScripts(ctx context.Context, id string) ([]GetWalletAccountsAndScriptsRow, error)

func (*Queries) InsertAccount

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

func (*Queries) InsertAccountScripts

func (q *Queries) InsertAccountScripts(ctx context.Context, arg []InsertAccountScriptsParams) (int64, error)

func (*Queries) InsertTransaction

func (q *Queries) InsertTransaction(ctx context.Context, arg InsertTransactionParams) (Transaction, error)

TRANSACTION

func (*Queries) InsertTransactionInputAccount

func (q *Queries) InsertTransactionInputAccount(ctx context.Context, arg InsertTransactionInputAccountParams) (TxInputAccount, error)

func (*Queries) InsertUtxo

func (q *Queries) InsertUtxo(ctx context.Context, arg InsertUtxoParams) (Utxo, error)

UTXO

func (*Queries) InsertUtxoStatus

func (q *Queries) InsertUtxoStatus(ctx context.Context, arg InsertUtxoStatusParams) (UtxoStatus, error)

func (*Queries) InsertWallet

func (q *Queries) InsertWallet(ctx context.Context, arg InsertWalletParams) (Wallet, error)

WALLET & ACCOUNT

func (*Queries) UpdateAccountIndexes

func (q *Queries) UpdateAccountIndexes(ctx context.Context, arg UpdateAccountIndexesParams) (Account, error)

func (*Queries) UpdateTransaction

func (q *Queries) UpdateTransaction(ctx context.Context, arg UpdateTransactionParams) (Transaction, error)

func (*Queries) UpdateUtxo

func (q *Queries) UpdateUtxo(ctx context.Context, arg UpdateUtxoParams) (Utxo, error)

func (*Queries) UpdateWallet

func (q *Queries) UpdateWallet(ctx context.Context, arg UpdateWalletParams) (Wallet, error)

func (*Queries) WithTx

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

type Transaction

type Transaction struct {
	TxID        string
	TxHex       string
	BlockHash   string
	BlockHeight int32
}

type TxInputAccount

type TxInputAccount struct {
	ID          int32
	AccountName string
	FkTxID      string
}

type UpdateAccountIndexesParams

type UpdateAccountIndexesParams struct {
	NextExternalIndex int32
	NextInternalIndex int32
	Name              string
}

type UpdateTransactionParams

type UpdateTransactionParams struct {
	TxHex       string
	BlockHash   string
	BlockHeight int32
	TxID        string
}

type UpdateUtxoParams

type UpdateUtxoParams struct {
	Value               int64
	Asset               string
	ValueCommitment     []byte
	AssetCommitment     []byte
	ValueBlinder        []byte
	AssetBlinder        []byte
	Script              []byte
	Nonce               []byte
	RangeProof          []byte
	SurjectionProof     []byte
	AccountName         string
	LockTimestamp       int64
	LockExpiryTimestamp int64
	TxID                string
	Vout                int32
}

type UpdateWalletParams

type UpdateWalletParams struct {
	ID                  string
	EncryptedMnemonic   []byte
	PasswordHash        []byte
	BirthdayBlockHeight int32
	RootPath            string
	NetworkName         string
	NextAccountIndex    int32
}

type Utxo

type Utxo struct {
	ID                  int32
	TxID                string
	Vout                int32
	Value               int64
	Asset               string
	ValueCommitment     []byte
	AssetCommitment     []byte
	ValueBlinder        []byte
	AssetBlinder        []byte
	Script              []byte
	Nonce               []byte
	RangeProof          []byte
	SurjectionProof     []byte
	AccountName         string
	LockTimestamp       int64
	LockExpiryTimestamp int64
}

type UtxoStatus

type UtxoStatus struct {
	ID          int32
	BlockHeight int32
	BlockTime   int64
	BlockHash   string
	Status      int32
	FkUtxoID    int32
}

type Wallet

type Wallet struct {
	ID                  string
	EncryptedMnemonic   []byte
	PasswordHash        []byte
	BirthdayBlockHeight int32
	RootPath            string
	NetworkName         string
	NextAccountIndex    int32
}

Jump to

Keyboard shortcuts

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