proxy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

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

func New

func New(url string) *Proxy

func (*Proxy) AccountIdentifierFromPublicKey

func (oc *Proxy) AccountIdentifierFromPublicKey(pubKey *types.PublicKey) (*types.AccountIdentifier, error)

AccountIdentifierFromPublicKey returns the account identifier given the public key

func (*Proxy) Balances

func (oc *Proxy) Balances(ctx context.Context, addr string, height *int64) (res *types.AccountBalanceResponse, err error)

Balances fetches the balance of the given address if height is not nil, then the balance will be displayed at the provided height, otherwise last block balance will be returned

func (*Proxy) BlockByHash

func (oc *Proxy) BlockByHash(ctx context.Context, hash string) (*types.BlockResponse, error)

BlockByHashAlt gets a block and its transaction at the provided height

func (*Proxy) BlockByHeight

func (oc *Proxy) BlockByHeight(ctx context.Context, height int64) (*types.BlockResponse, error)

BlockByHeightAlt gets a block given its height, if height is nil then last block is returned

func (*Proxy) BlockTransactionsByHash

func (oc *Proxy) BlockTransactionsByHash(ctx context.Context, hash string) (*types.BlockTransactionResponse, error)

BlockTransactionsByHash gets the block, parent block and transactions given the block hash.

func (*Proxy) BlockTransactionsByHeight

func (oc *Proxy) BlockTransactionsByHeight(ctx context.Context, height *int64) (*types.BlockTransactionResponse, error)

BlockTransactionsByHash gets the block, parent block and transactions given the block hash.

func (*Proxy) Bootstrap

func (oc *Proxy) Bootstrap() error

Needed if the client needs to perform some action before connecting

func (*Proxy) ConstructionMetadataFromOptions

func (oc *Proxy) ConstructionMetadataFromOptions(ctx context.Context, options map[string]interface{}) (meta map[string]interface{}, err error)

ConstructionMetadataFromOptions

func (*Proxy) ConstructionPayload

func (oc *Proxy) ConstructionPayload(ctx context.Context, req *types.ConstructionPayloadsRequest) (resp *types.ConstructionPayloadsResponse, err error)

ConstructionPayload returns the construction payload given the request

func (*Proxy) CurrentBlock

func (oc *Proxy) CurrentBlock(ctx context.Context) (*types.BlockResponse, error)

func (*Proxy) GetTx

func (oc *Proxy) GetTx(ctx context.Context, hash string) (*types.Transaction, error)

GetTx gets a transaction given its hash

func (*Proxy) GetUnconfirmedTx

func (oc *Proxy) GetUnconfirmedTx(ctx context.Context, hash string) (*types.Transaction, error)

GetUnconfirmedTx gets an unconfirmed Tx given its hash NOTE(fdymylja): NOT IMPLEMENTED YET!

func (*Proxy) Mempool

func (oc *Proxy) Mempool(ctx context.Context) ([]*types.TransactionIdentifier, error)

Mempool returns the list of the current non confirmed transactions

func (*Proxy) OperationStatuses

func (oc *Proxy) OperationStatuses() []*types.OperationStatus

OperationsStatuses returns the list of statuses supported by the implementation

func (*Proxy) Peers

func (oc *Proxy) Peers(ctx context.Context) ([]*types.Peer, error)

Peers gets the peers currently connected to the node

func (*Proxy) PostTx

func (oc *Proxy) PostTx(txBytes []byte) (res *types.TransactionIdentifier, meta map[string]interface{}, err error)

PostTx posts txBytes to the node and returns the transaction identifier plus metadata related to the transaction itself.

func (*Proxy) PreprocessOperationsToOptions

func (oc *Proxy) PreprocessOperationsToOptions(ctx context.Context, req *types.ConstructionPreprocessRequest) (resp *types.ConstructionPreprocessResponse, err error)

PreprocessOperationsToOptions returns the options given the preprocess operations

func (*Proxy) Ready

func (oc *Proxy) Ready() error

Ready checks if the servicer constraints for queries are satisfied for example the node might still not be ready, it's useful in process when the rosetta instance might come up before the node itself the servicer must return nil if the node is ready

func (*Proxy) SignedTx

func (oc *Proxy) SignedTx(ctx context.Context, txBytes []byte, sigs []*types.Signature) (signedTxBytes []byte, err error)

SignedTx returns the signed transaction given the tx bytes (msgs) plus the signatures

func (*Proxy) Status

func (oc *Proxy) Status(ctx context.Context) (*types.SyncStatus, error)

Status returns the node status, such as sync data, version etc

func (*Proxy) SupportedOperations

func (oc *Proxy) SupportedOperations() []string

SupportedOperations lists the operations supported by the implementation

func (*Proxy) TxOperationsAndSignersAccountIdentifiers

func (oc *Proxy) TxOperationsAndSignersAccountIdentifiers(signed bool, hexBytes []byte) (ops []*types.Operation, signers []*types.AccountIdentifier, err error)

TxOperationsAndSignersAccountIdentifiers returns the operations related to a transaction and the account identifiers if the transaction is signed

func (*Proxy) Version

func (oc *Proxy) Version() string

Version returns the version of the node

Jump to

Keyboard shortcuts

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