indexer

package
v0.0.0-...-241d3e1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	TotalOutputAmount uint64
	TotalOutputVtxos  int32
	ExpiresAt         int64
	Swept             bool
}

type ChainTx

type ChainTx struct {
	Txid string
	Type string
}

type ChainWithExpiry

type ChainWithExpiry struct {
	Txid      string
	Spends    []ChainTx
	ExpiresAt int64
}

type CommitmentTx

type CommitmentTx struct {
	StartedAt         int64
	EndedAt           int64
	TotalInputAmount  uint64
	TotalInputVtxos   int32
	TotalOutputAmount uint64
	TotalOutputVtxos  int32
	Batches           map[uint32]*Batch
}

type CommitmentTxLeavesResponse

type CommitmentTxLeavesResponse struct {
	Leaves []Outpoint
	Page   *PageResponse
}

type ConnectorsResponse

type ConnectorsResponse struct {
	Tree []TxNode
	Page *PageResponse
}

type ForfeitTxsResponse

type ForfeitTxsResponse struct {
	Txids []string
	Page  *PageResponse
}

type GetTxHistoryRequestOption

type GetTxHistoryRequestOption struct {
	RequestOption
	// contains filtered or unexported fields
}

func (*GetTxHistoryRequestOption) GetEndTime

func (o *GetTxHistoryRequestOption) GetEndTime() time.Time

func (*GetTxHistoryRequestOption) GetStartTime

func (o *GetTxHistoryRequestOption) GetStartTime() time.Time

func (*GetTxHistoryRequestOption) WithEndTime

func (o *GetTxHistoryRequestOption) WithEndTime(endTime time.Time)

func (*GetTxHistoryRequestOption) WithStartTime

func (o *GetTxHistoryRequestOption) WithStartTime(startTime time.Time)

type GetVtxosRequestOption

type GetVtxosRequestOption struct {
	RequestOption
	// contains filtered or unexported fields
}

func (*GetVtxosRequestOption) GetAddresses

func (o *GetVtxosRequestOption) GetAddresses() []string

func (*GetVtxosRequestOption) GetOutpoints

func (o *GetVtxosRequestOption) GetOutpoints() []string

func (*GetVtxosRequestOption) GetSpendableOnly

func (o *GetVtxosRequestOption) GetSpendableOnly() bool

func (*GetVtxosRequestOption) GetSpentOnly

func (o *GetVtxosRequestOption) GetSpentOnly() bool

func (*GetVtxosRequestOption) WithAddresses

func (o *GetVtxosRequestOption) WithAddresses(addresses []string) error

func (*GetVtxosRequestOption) WithOutpoints

func (o *GetVtxosRequestOption) WithOutpoints(outpoints []Outpoint) error

func (*GetVtxosRequestOption) WithSpendableOnly

func (o *GetVtxosRequestOption) WithSpendableOnly(spendableOnly bool)

func (*GetVtxosRequestOption) WithSpentOnly

func (o *GetVtxosRequestOption) WithSpentOnly(spentOnly bool)

type Indexer

type Indexer interface {
	GetCommitmentTx(ctx context.Context, txid string) (*CommitmentTx, error)
	GetCommitmentTxLeaves(ctx context.Context, txid string, opts ...RequestOption) (*CommitmentTxLeavesResponse, error)
	GetVtxoTree(ctx context.Context, batchOutpoint Outpoint, opts ...RequestOption) (*VtxoTreeResponse, error)
	GetVtxoTreeLeaves(ctx context.Context, batchOutpoint Outpoint, opts ...RequestOption) (*VtxoTreeLeavesResponse, error)
	GetForfeitTxs(ctx context.Context, txid string, opts ...RequestOption) (*ForfeitTxsResponse, error)
	GetConnectors(ctx context.Context, txid string, opts ...RequestOption) (*ConnectorsResponse, error)
	GetVtxos(ctx context.Context, opts ...GetVtxosRequestOption) (*VtxosResponse, error)
	GetTransactionHistory(ctx context.Context, address string, opts ...GetTxHistoryRequestOption) (*TxHistoryResponse, error)
	GetVtxoChain(ctx context.Context, outpoint Outpoint, opts ...RequestOption) (*VtxoChainResponse, error)
	GetVirtualTxs(ctx context.Context, txids []string, opts ...RequestOption) (*VirtualTxsResponse, error)
	GetSweptCommitmentTx(ctx context.Context, txid string) ([]string, error)
	SubscribeForScripts(ctx context.Context, subscriptionId string, scripts []string) (string, error)
	UnsubscribeForScripts(ctx context.Context, subscriptionId string, scripts []string) error
	GetSubscription(ctx context.Context, subscriptionId string) (<-chan *ScriptEvent, func(), error)
}

type Outpoint

type Outpoint struct {
	Txid string
	VOut uint32
}

type PageRequest

type PageRequest struct {
	Size  int32
	Index int32
}

type PageResponse

type PageResponse struct {
	Current int32
	Next    int32
	Total   int32
}

type RequestOption

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

func (*RequestOption) GetPage

func (o *RequestOption) GetPage() *PageRequest

func (*RequestOption) WithPage

func (o *RequestOption) WithPage(page *PageRequest)

type ScriptEvent

type ScriptEvent struct {
	Txid       string
	Scripts    []string
	NewVtxos   []Vtxo
	SpentVtxos []Vtxo
	Err        error
}

type TxHistoryRecord

type TxHistoryRecord struct {
	CommitmentTxid string
	VirtualTxid    string
	Type           TxType
	Amount         uint64
	CreatedAt      int64
	IsSettled      bool
	SettledBy      string
}

type TxHistoryResponse

type TxHistoryResponse struct {
	History []TxHistoryRecord
	Page    *PageResponse
}

type TxNode

type TxNode struct {
	Txid       string
	ParentTxid string
	Level      int32
	LevelIndex int32
}

type TxType

type TxType int
const (
	TxTypeUnspecified TxType = iota
	TxTypeReceived
	TxTypeSent
	TxTypeSweep
)

type VirtualTxsResponse

type VirtualTxsResponse struct {
	Txs  []string
	Page *PageResponse
}

type Vtxo

type Vtxo struct {
	Outpoint       Outpoint
	CreatedAt      int64
	ExpiresAt      int64
	Amount         uint64
	Script         string
	IsLeaf         bool
	IsSwept        bool
	IsSpent        bool
	SpentBy        string
	CommitmentTxid string
}

type VtxoChainResponse

type VtxoChainResponse struct {
	Chain              []ChainWithExpiry
	Depth              int32
	RootCommitmentTxid string
	Page               *PageResponse
}

type VtxoTreeLeavesResponse

type VtxoTreeLeavesResponse struct {
	Leaves []Outpoint
	Page   *PageResponse
}

type VtxoTreeResponse

type VtxoTreeResponse struct {
	Tree []TxNode
	Page *PageResponse
}

type VtxosResponse

type VtxosResponse struct {
	Vtxos []Vtxo
	Page  *PageResponse
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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