chain

package
v0.0.0-...-838934d Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CosmosChain

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

CosmosChain is a struct for identifier blockchains and their forks

func (*CosmosChain) NewRequest

func (ec *CosmosChain) NewRequest(rpcURL string, txHex string) (PostRequest, error)

NewRequest takes an RPC URL and a hexadecimal transaction. Returns PostRequest for cosmos nodes

type ETHChain

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

ETHChain is a struct for identifier blockchains and their forks

func (*ETHChain) NewRequest

func (ec *ETHChain) NewRequest(rpcURL string, txHex string) (PostRequest, error)

NewRequest takes an RPC URL and a hexadecimal transaction. Returns PostRequest for ethereum nodes

type IChain

type IChain interface {
	// NewRequest takes an RPC URL and a hexadecimal transaction.
	// Returns PostRequest with the with values depending on the chain type
	NewRequest(rpcURL string, txHex string) (PostRequest, error)
}

IChain is an abstraction for a cryptocurrency It only enables creating raw transactions requests

func GetChain

func GetChain(ticker string) (IChain, error)

GetChain takes a ticker symbol for a supported chain and returns an interface for that chain

type PostRequest

type PostRequest struct {
	Body []byte
	URL  string
}

PostRequest is the common struct containing the body and url

Jump to

Keyboard shortcuts

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