queries

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 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 {
	Namespace         string
	Index             int32
	Label             sql.NullString
	Xpub              string
	DerivationPath    string
	NextExternalIndex int32
	NextInternalIndex int32
	FkWalletID        string
	Unconf            sql.NullBool
}

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 ExternalScript added in v0.2.0

type ExternalScript struct {
	Account     string
	Script      string
	BlindingKey []byte
}

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
	TxID_2              sql.NullString
}

type GetTransactionRow

type GetTransactionRow struct {
	TxID        string
	TxHex       string
	BlockHash   string
	BlockHeight int32
	BlockTime   sql.NullInt64
	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
	TxID_2              sql.NullString
}

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
	TxID_2              sql.NullString
}

type GetWalletAccountsAndScriptsRow

type GetWalletAccountsAndScriptsRow struct {
	Walletid              string
	EncryptedMnemonic     []byte
	PasswordHash          []byte
	BirthdayBlockHeight   int32
	RootPath              string
	NetworkName           string
	NextAccountIndex      int32
	Namespace             sql.NullString
	Label                 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 {
	Namespace         string
	Label             sql.NullString
	Index             int32
	Xpub              string
	DerivationPath    string
	NextExternalIndex int32
	NextInternalIndex int32
	FkWalletID        string
}

type InsertAccountScriptsParams

type InsertAccountScriptsParams struct {
	Script         string
	DerivationPath string
	FkAccountName  string
}

type InsertScriptParams added in v0.2.0

type InsertScriptParams struct {
	Account     string
	Script      string
	BlindingKey []byte
}

type InsertTransactionInputAccountParams

type InsertTransactionInputAccountParams struct {
	AccountName string
	FkTxID      string
}

type InsertTransactionParams

type InsertTransactionParams struct {
	TxID        string
	TxHex       string
	BlockHash   string
	BlockHeight int32
	BlockTime   sql.NullInt64
}

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
	TxID        sql.NullString
}

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, namespace string) error

func (*Queries) DeleteAccountScripts

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

func (*Queries) DeleteScript added in v0.2.0

func (q *Queries) DeleteScript(ctx context.Context, account 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, namespace string) (Account, error)

func (*Queries) GetAllScripts added in v0.2.0

func (q *Queries) GetAllScripts(ctx context.Context) ([]ExternalScript, error)

func (*Queries) GetAllUtxos

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

func (*Queries) GetScript added in v0.2.0

func (q *Queries) GetScript(ctx context.Context, account string) (ExternalScript, 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) InsertScript added in v0.2.0

func (q *Queries) InsertScript(ctx context.Context, arg InsertScriptParams) error

EXTERNAL SCRIPT

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) ResetScripts added in v0.2.0

func (q *Queries) ResetScripts(ctx context.Context) error

func (*Queries) ResetTransactions added in v0.1.16

func (q *Queries) ResetTransactions(ctx context.Context) error

func (*Queries) ResetUtxos added in v0.1.16

func (q *Queries) ResetUtxos(ctx context.Context) error

func (*Queries) ResetWallet added in v0.1.16

func (q *Queries) ResetWallet(ctx context.Context) error

func (*Queries) UpdateAccount added in v0.1.16

func (q *Queries) UpdateAccount(ctx context.Context, arg UpdateAccountParams) (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
	BlockTime   sql.NullInt64
}

type TxInputAccount

type TxInputAccount struct {
	ID          int32
	AccountName string
	FkTxID      string
}

type UpdateAccountParams added in v0.1.16

type UpdateAccountParams struct {
	NextExternalIndex int32
	NextInternalIndex int32
	Label             sql.NullString
	Namespace         string
}

type UpdateTransactionParams

type UpdateTransactionParams struct {
	TxHex       string
	BlockHash   string
	BlockHeight int32
	BlockTime   sql.NullInt64
	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
	TxID        sql.NullString
}

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