Documentation ¶
Index ¶
- type AccountBalance
- type Backend
- func (b *Backend) AccountBalance(ctx context.Context, req *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error)
- func (b *Backend) AccountCoins(ctx context.Context, req *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error)
- func (b *Backend) Block(ctx context.Context, request *types.BlockRequest) (*types.BlockResponse, *types.Error)
- func (b *Backend) BlockTransaction(ctx context.Context, request *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error)
- func (*Backend) CombineTx(tx common.AvaxTx, signatures []*types.Signature) (common.AvaxTx, *types.Error)
- func (b *Backend) ConstructionCombine(_ context.Context, req *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
- func (*Backend) ConstructionDerive(_ context.Context, req *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
- func (b *Backend) ConstructionHash(_ context.Context, req *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (b *Backend) ConstructionMetadata(ctx context.Context, req *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error)
- func (b *Backend) ConstructionParse(_ context.Context, req *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
- func (b *Backend) ConstructionPayloads(_ context.Context, req *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
- func (*Backend) ConstructionPreprocess(_ context.Context, req *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error)
- func (b *Backend) ConstructionSubmit(ctx context.Context, req *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (b *Backend) IssueTx(ctx context.Context, txByte []byte, options ...rpc.Option) (ids.ID, error)
- func (b *Backend) NetworkIdentifier() *types.NetworkIdentifier
- func (*Backend) NetworkOptions(_ context.Context, _ *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error)
- func (b *Backend) NetworkStatus(ctx context.Context, _ *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error)
- func (*Backend) ShouldHandleRequest(req interface{}) bool
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 ¶
func (b *Backend) AccountBalance(ctx context.Context, req *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error)
AccountBalance implements /account/balance endpoint for P-chain
func (*Backend) AccountCoins ¶
func (b *Backend) AccountCoins(ctx context.Context, req *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error)
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 ¶
func (b *Backend) BlockTransaction(ctx context.Context, request *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error)
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 ¶
func (b *Backend) ConstructionCombine(_ context.Context, req *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
ConstructionCombine implements /construction/combine endpoint for P-chain
func (*Backend) ConstructionDerive ¶
func (*Backend) ConstructionDerive(_ context.Context, req *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
ConstructionDerive implements /construction/derive endpoint for P-chain
func (*Backend) ConstructionHash ¶
func (b *Backend) ConstructionHash( _ context.Context, req *types.ConstructionHashRequest, ) (*types.TransactionIdentifierResponse, *types.Error)
ConstructionHash implements /construction/hash endpoint for P-chain
func (*Backend) ConstructionMetadata ¶
func (b *Backend) ConstructionMetadata( ctx context.Context, req *types.ConstructionMetadataRequest, ) (*types.ConstructionMetadataResponse, *types.Error)
ConstructionMetadata implements /construction/metadata endpoint for P-chain
func (*Backend) ConstructionParse ¶
func (b *Backend) ConstructionParse(_ context.Context, req *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
ConstructionParse implements /construction/parse endpoint for P-chain
func (*Backend) ConstructionPayloads ¶
func (b *Backend) ConstructionPayloads(_ context.Context, req *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
ConstructionPayloads implements /construction/payloads endpoint for P-chain
func (*Backend) ConstructionPreprocess ¶
func (*Backend) ConstructionPreprocess( _ context.Context, req *types.ConstructionPreprocessRequest, ) (*types.ConstructionPreprocessResponse, *types.Error)
ConstructionPreprocess implements /construction/preprocess endpoint for P-chain
func (*Backend) ConstructionSubmit ¶
func (b *Backend) ConstructionSubmit( ctx context.Context, req *types.ConstructionSubmitRequest, ) (*types.TransactionIdentifierResponse, *types.Error)
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 ¶
func (*Backend) NetworkOptions(_ context.Context, _ *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error)
NetworkOptions implements /network/options endpoint for P-chain
func (*Backend) NetworkStatus ¶
func (b *Backend) NetworkStatus(ctx context.Context, _ *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error)
NetworkStatus implements /network/status endpoint for P-chain
func (*Backend) ShouldHandleRequest ¶
ShouldHandleRequest returns whether a given request should be handled by this backend