avax

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxAggregateIntervalCount = 20000

	MinSearchQueryLength = 1
)

Variables

View Source
var (
	ErrAggregateIntervalCountTooLarge = errors.New("requesting too many intervals")
	ErrFailedToParseStringAsBigInt    = errors.New("failed to parse string to big.Int")
	ErrSearchQueryTooShort            = errors.New("search query too short")
)
View Source
var (
	MaxSerializationLen = (16 * 1024 * 1024) - 1

	// MaxMemoLen is the maximum number of bytes a memo can be in the database
	MaxMemoLen = 1024
)

Functions

This section is empty.

Types

type AddInsContainer added in v1.1.3

type AddInsContainer struct {
	Ins     []*avax.TransferableInput
	ChainID string
}

type AddOutsContainer added in v1.1.3

type AddOutsContainer struct {
	Outs    []*avax.TransferableOutput
	Stake   bool
	ChainID string
}

type Reader added in v1.1.2

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

func NewReader added in v1.1.2

func NewReader(networkID uint32, conns *servicesconn.Connections, chainConsumers map[string]services.Consumer, cChainCconsumer services.ConsumerCChain, sc *servicesctrl.Control) (*Reader, error)

func (*Reader) ATxDATA added in v1.2.0

func (r *Reader) ATxDATA(ctx context.Context, p *params.TxDataParam) ([]byte, error)

func (*Reader) AddressChains added in v1.1.2

func (r *Reader) AddressChains(ctx context.Context, p *params.AddressChainsParams) (*models.AddressChains, error)

func (*Reader) Aggregate added in v1.1.2

func (*Reader) CTxDATA added in v1.2.0

func (r *Reader) CTxDATA(ctx context.Context, p *params.TxDataParam) ([]byte, error)

func (*Reader) CacheAddressCounts added in v1.3.2

func (r *Reader) CacheAddressCounts() []*models.ChainCounts

func (*Reader) CacheAggregates added in v1.2.3

func (r *Reader) CacheAggregates(tag string) *models.AggregatesHistogram

func (*Reader) CacheAssetAggregates added in v1.2.3

func (r *Reader) CacheAssetAggregates() []*models.AssetAggregate

func (*Reader) CacheAssets added in v1.3.2

func (r *Reader) CacheAssets() []*models.Asset

func (*Reader) CacheTxCounts added in v1.4.0

func (r *Reader) CacheTxCounts() []*models.ChainCounts

func (*Reader) ETxDATA added in v1.2.0

func (r *Reader) ETxDATA(ctx context.Context, p *params.TxDataParam) ([]byte, error)

func (*Reader) GetAddress added in v1.1.2

func (*Reader) GetAsset added in v1.1.3

func (r *Reader) GetAsset(ctx context.Context, p *params.ListAssetsParams, idStrOrAlias string) (*models.Asset, error)

func (*Reader) GetBlock added in v1.1.3

func (r *Reader) GetBlock(ctx context.Context, id ids.ID) (*models.Block, error)

func (*Reader) GetOutput added in v1.1.2

func (r *Reader) GetOutput(ctx context.Context, id ids.ID) (*models.Output, error)

func (*Reader) GetTransaction added in v1.1.2

func (r *Reader) GetTransaction(ctx context.Context, id ids.ID, avaxAssetID ids.ID) (*models.Transaction, error)

func (*Reader) ListAddresses added in v1.1.2

func (r *Reader) ListAddresses(ctx context.Context, p *params.ListAddressesParams) (*models.AddressList, error)

func (*Reader) ListAssets added in v1.1.3

func (*Reader) ListBlocks added in v1.1.3

func (r *Reader) ListBlocks(ctx context.Context, params *params.ListBlocksParams) (*models.BlockList, error)

func (*Reader) ListCTransactions added in v1.2.3

func (*Reader) ListOutputs added in v1.1.2

func (r *Reader) ListOutputs(ctx context.Context, p *params.ListOutputsParams) (*models.OutputList, error)

func (*Reader) ListTransactions added in v1.1.2

func (r *Reader) ListTransactions(ctx context.Context, p *params.ListTransactionsParams, avaxAssetID ids.ID) (*models.TransactionList, error)

func (*Reader) PTxDATA added in v1.2.0

func (r *Reader) PTxDATA(ctx context.Context, p *params.TxDataParam) ([]byte, error)

func (*Reader) RawTransaction added in v1.2.3

func (r *Reader) RawTransaction(ctx context.Context, id ids.ID) (*models.RawTx, error)

func (*Reader) Search added in v1.1.2

func (r *Reader) Search(ctx context.Context, p *params.SearchParams, avaxAssetID ids.ID) (*models.SearchResults, error)

func (*Reader) TxfeeAggregate added in v1.1.2

type ReaderAggregate added in v1.2.3

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

type ReaderAggregateTxList added in v1.4.5

type ReaderAggregateTxList struct {
	Lock       sync.RWMutex
	Txs        []*models.Transaction
	TxsMap     map[models.StringID]*models.Transaction
	TxsByChain map[models.StringID][]*models.Transaction
}

func (*ReaderAggregateTxList) FindTxs added in v1.4.5

func (t *ReaderAggregateTxList) FindTxs(chainIDs []string, limit int) []*models.Transaction

func (*ReaderAggregateTxList) First added in v1.4.5

func (*ReaderAggregateTxList) Get added in v1.4.5

func (*ReaderAggregateTxList) IsProcessed added in v1.4.5

func (t *ReaderAggregateTxList) IsProcessed() bool

func (*ReaderAggregateTxList) Set added in v1.4.5

func (t *ReaderAggregateTxList) Set(txs []*models.Transaction)

type Writer

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

func NewWriter

func NewWriter(chainID string, avaxAssetID ids.ID) *Writer

func (*Writer) InsertAddressFromPublicKey

func (w *Writer) InsertAddressFromPublicKey(
	ctx services.ConsumerCtx,
	publicKey crypto.PublicKey,
) error

func (*Writer) InsertOutput

func (w *Writer) InsertOutput(
	ctx services.ConsumerCtx,
	txID ids.ID,
	idx uint32,
	assetID ids.ID,
	out *secp256k1fx.TransferOutput,
	outputType models.OutputType,
	groupID uint32,
	payload []byte,
	stakeLocktime uint64,
	chainID string,
	stake bool,
	frozen bool,
	stakeableout bool,
	genesisutxo bool,
) error

func (*Writer) InsertOutputAddress

func (w *Writer) InsertOutputAddress(
	ctx services.ConsumerCtx,
	outputID ids.ID,
	address ids.ShortID,
	sig []byte,
	txID ids.ID,
	idx uint32,
	chainID string,
) error

func (*Writer) InsertTransaction

func (w *Writer) InsertTransaction(
	ctx services.ConsumerCtx,
	txBytes []byte,
	unsignedBytes []byte,
	baseTx *avax.BaseTx,
	creds []verify.Verifiable,
	txType models.TransactionType,
	addIns *AddInsContainer,
	addOuts *AddOutsContainer,
	addlOutTxfee uint64,
	genesis bool,
) error

func (*Writer) InsertTransactionBase added in v1.1.3

func (w *Writer) InsertTransactionBase(
	ctx services.ConsumerCtx,
	txID ids.ID,
	chainID string,
	txType string,
	memo []byte,
	txBytes []byte,
	txfee uint64,
	genesis bool,
	networkID uint32,
) error

func (*Writer) InsertTransactionIns added in v1.1.3

func (w *Writer) InsertTransactionIns(
	idx int,
	ctx services.ConsumerCtx,
	totalin uint64,
	in *avax.TransferableInput,
	txID ids.ID,
	creds []verify.Verifiable,
	unsignedBytes []byte,
	chainID string,
) (uint64, error)

func (*Writer) InsertTransactionOuts added in v1.1.3

func (w *Writer) InsertTransactionOuts(
	idx uint32,
	ctx services.ConsumerCtx,
	totalout uint64,
	out *avax.TransferableOutput,
	txID ids.ID,
	chainID string,
	stake bool,
	genesisutxo bool,
) (uint64, error)

func (*Writer) ProcessStateOut added in v1.1.3

func (w *Writer) ProcessStateOut(
	ctx services.ConsumerCtx,
	out verify.State,
	txID ids.ID,
	outputCount uint32,
	assetID ids.ID,
	amount uint64,
	totalout uint64,
	chainID string,
	stake bool,
	genesisutxo bool,
) (uint64, uint64, error)

Jump to

Keyboard shortcuts

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