service

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOffline

func NewOffline(network *types.NetworkIdentifier, client crgtypes.Client) (crgtypes.API, error)

NewOffline instantiates the instance of an offline network whilst the offline network does not support the DataAPI, it supports a subset of the construction API.

func NewOnlineNetwork

func NewOnlineNetwork(network *types.NetworkIdentifier, client crgtypes.Client) (crgtypes.API, error)

NewOnlineNetwork builds a single network adapter. It will get the Genesis block on the beginning to avoid calling it everytime.

Types

type OfflineNetwork

type OfflineNetwork struct {
	OnlineNetwork
}

OfflineNetwork implements an offline data API which is basically a data API that constantly returns errors, because it cannot be used if offline

func (OfflineNetwork) AccountBalance

Implement DataAPI in offline mode, which means no method is available

func (OfflineNetwork) Block

func (OfflineNetwork) Mempool

func (OfflineNetwork) NetworkStatus

type OnlineNetwork

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

OnlineNetwork groups together all the components required for the full rosetta implementation

func (OnlineNetwork) AccountBalance

AccountBalance retrieves the account balance of an address rosetta requires us to fetch the block information too

func (OnlineNetwork) AccountCoins

AccountsCoins - relevant only for UTXO based chain see https://www.rosetta-api.org/docs/AccountApi.html#accountcoins

func (OnlineNetwork) Block

Block gets the transactions in the given block

func (OnlineNetwork) BlockTransaction

BlockTransaction gets the given transaction in the specified block, we do not need to check the block itself too due to the fact that tendermint achieves instant finality

func (OnlineNetwork) ConstructionCombine

ConstructionCombine Combine creates a network-specific transaction from an unsigned transaction and an array of provided signatures. The signed transaction returned from this method will be sent to the /construction/submit endpoint by the caller.

func (OnlineNetwork) ConstructionDerive

ConstructionDerive Derive returns the AccountIdentifier associated with a public key.

func (OnlineNetwork) ConstructionHash

ConstructionHash TransactionHash returns the network-specific transaction hash for a signed transaction.

func (OnlineNetwork) ConstructionMetadata

ConstructionMetadata Get any information required to construct a transaction for a specific network (i.e. ChainID, Gas, Memo, ...).

func (OnlineNetwork) ConstructionParse

ConstructionParse Parse is called on both unsigned and signed transactions to understand the intent of the formulated transaction. This is run as a sanity check before signing (after /construction/payloads) and before broadcast (after /construction/combine).

func (OnlineNetwork) ConstructionPayloads

ConstructionPayloads Payloads is called with an array of operations and the response from /construction/metadata. It returns an unsigned transaction blob and a collection of payloads that must be signed by particular AccountIdentifiers using a certain SignatureType.

func (OnlineNetwork) ConstructionPreprocess

ConstructionPreprocess Preprocess is called prior to /construction/payloads to construct a request for any metadata that is needed for transaction construction given (i.e. account nonce).

func (OnlineNetwork) ConstructionSubmit

ConstructionSubmit Submit a pre-signed transaction to the node. This call does not block on the transaction being included in a block. Rather, it returns immediately with an indication of whether or not the transaction was included in the mempool.

func (OnlineNetwork) Mempool

Mempool fetches the transactions contained in the mempool

func (OnlineNetwork) MempoolTransaction

MempoolTransaction fetches a single transaction in the mempool NOTE: it is not implemented yet

func (OnlineNetwork) NetworkList

func (OnlineNetwork) NetworkOptions

func (OnlineNetwork) NetworkStatus

Jump to

Keyboard shortcuts

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