providers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64StringToUint256

func Float64StringToUint256(s string, decimals int) (*uint256.Int, error)

Float64StringToUint256 converts a float64 string to a uint256.

func Float64ToUint256

func Float64ToUint256(val float64, decimals int) *uint256.Int

Float64ToBigInt converts a float64 to a uint256.

NOTE: MustFromBig will panic only if there is overflow when converting the big.Int to a uint256.Int. This should never happen since uint256 should be large enough to handle pricing data.

func GetWithContext

func GetWithContext(ctx context.Context, url string, reader ReadFn) error

GetWithContext provides logic for making an http get request, whose duration is bounded / controlled by a given context.

func GetWithContextAndHeader

func GetWithContextAndHeader(ctx context.Context, url string, reader ReadFn, reqfn ReqFn) error

GetWithContextAndHeader provides logic for making an http get request, whose duration is bounded / controlled by a given context, and also updating fields in the header of the request

Types

type ReadFn

type ReadFn func([]byte) error

ReadFn is a convenience type for reading from a HTTP response body

type ReqFn

type ReqFn func(*http.Request)

ReqFn is a convenience type for adding headers, etc. to an HTTP request header

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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