pchain

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalance

type AccountBalance struct {
	Total              uint64
	Unlocked           uint64
	Staked             uint64
	LockedStakeable    uint64
	LockedNotStakeable uint64
}

AccountBalance contains P-chain account balances

type Backend

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

func NewBackend

func NewBackend(
	pClient client.PChainClient,
	indexerParser indexer.Parser,
	avaxAssetID ids.ID,
	networkIdentifier *types.NetworkIdentifier,
	avalancheNetworkID uint32,
) (*Backend, error)

NewBackend creates a P-chain service backend

func (*Backend) AccountBalance

AccountBalance implements /account/balance endpoint for P-chain

func (*Backend) AccountCoins

AccountCoins implements /account/coins endpoint for P-chain

func (*Backend) Block

func (b *Backend) Block(ctx context.Context, request *types.BlockRequest) (*types.BlockResponse, *types.Error)

Block implements the /block endpoint

func (*Backend) BlockTransaction

BlockTransaction implements the /block/transaction endpoint.

func (*Backend) CombineTx

func (*Backend) CombineTx(tx common.AvaxTx, signatures []*types.Signature) (common.AvaxTx, *types.Error)

CombineTx implements P-chain specific logic for combining unsigned transactions and signatures

func (*Backend) ConstructionCombine

ConstructionCombine implements /construction/combine endpoint for P-chain

func (*Backend) ConstructionDerive

ConstructionDerive implements /construction/derive endpoint for P-chain

func (*Backend) ConstructionHash

ConstructionHash implements /construction/hash endpoint for P-chain

func (*Backend) ConstructionMetadata

ConstructionMetadata implements /construction/metadata endpoint for P-chain

func (*Backend) ConstructionParse

ConstructionParse implements /construction/parse endpoint for P-chain

func (*Backend) ConstructionPayloads

ConstructionPayloads implements /construction/payloads endpoint for P-chain

func (*Backend) ConstructionPreprocess

ConstructionPreprocess implements /construction/preprocess endpoint for P-chain

func (*Backend) ConstructionSubmit

ConstructionSubmit implements /construction/submit endpoint for P-chain

func (*Backend) IssueTx

func (b *Backend) IssueTx(ctx context.Context, txByte []byte, options ...rpc.Option) (ids.ID, error)

IssueTx broadcasts given transaction on P-chain

func (*Backend) NetworkIdentifier

func (b *Backend) NetworkIdentifier() *types.NetworkIdentifier

NetworkIdentifier returns P-chain network identifier used by /network/list endpoint to list available networks

func (*Backend) NetworkOptions

NetworkOptions implements /network/options endpoint for P-chain

func (*Backend) NetworkStatus

NetworkStatus implements /network/status endpoint for P-chain

func (*Backend) ShouldHandleRequest

func (*Backend) ShouldHandleRequest(req interface{}) bool

ShouldHandleRequest returns whether a given request should be handled by this backend

Directories

Path Synopsis
Package indexer is a generated GoMock package.
Package indexer is a generated GoMock package.

Jump to

Keyboard shortcuts

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