bnb-staking-csvs-0.1.0.0: Generate CSV Exports of Your BNB Staking Rewards
Safe HaskellNone
LanguageHaskell2010

Lib

Description

Contains all the functionality of the app.

TODO: Should split out into BnbStaking sub-modules: Main, Binance, Csv

Synopsis

Documentation

run :: IO () Source #

Run the executable - parsing args, making queries, & printing the results.

CSV Data

data ExportData Source #

Datatype representing a single row in the CSV export.

Constructors

ExportData 

Fields

Instances

Instances details
Read ExportData Source # 
Instance details

Defined in Lib

Show ExportData Source # 
Instance details

Defined in Lib

Generic ExportData Source # 
Instance details

Defined in Lib

Associated Types

type Rep ExportData :: Type -> Type #

ToNamedRecord ExportData Source # 
Instance details

Defined in Lib

DefaultOrdered ExportData Source # 
Instance details

Defined in Lib

type Rep ExportData Source # 
Instance details

Defined in Lib

convertReward :: Reward -> IO ExportData Source #

Render a Reward into our target export data by converting to localtime(respecting DST), & formatting the amount column to 8 decimal places.

newtype MyZonedTime Source #

Wrapper type to support custom ToField instance.

Constructors

MyZonedTime 

Instances

Instances details
Read MyZonedTime Source # 
Instance details

Defined in Lib

Show MyZonedTime Source # 
Instance details

Defined in Lib

ToField MyZonedTime Source # 
Instance details

Defined in Lib

Methods

toField :: MyZonedTime -> Field #

Binance.org API

getAllRewards :: MonadHttp m => Text -> m [Reward] Source #

Fetch all rewards for the given Delegator PubKey.

makeRequest :: MonadHttp m => Endpoint a -> m a Source #

Make a request to an endpoint.

data Endpoint a where Source #

Represents all endpoints of the binance.org api, as well as their respective response data.

data RewardResponse Source #

Response of requesting a delegator's rewards.

Constructors

RewardResponse 

Fields

Instances

Instances details
Eq RewardResponse Source # 
Instance details

Defined in Lib

Read RewardResponse Source # 
Instance details

Defined in Lib

Show RewardResponse Source # 
Instance details

Defined in Lib

Generic RewardResponse Source # 
Instance details

Defined in Lib

Associated Types

type Rep RewardResponse :: Type -> Type #

FromJSON RewardResponse Source # 
Instance details

Defined in Lib

type Rep RewardResponse Source # 
Instance details

Defined in Lib

type Rep RewardResponse = D1 ('MetaData "RewardResponse" "Lib" "bnb-staking-csvs-0.1.0.0-GZHQSgXWMmF9fVyeQYmUMj" 'False) (C1 ('MetaCons "RewardResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "rrTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "rrRewards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Reward])))

data Reward Source #

A single staking reward.

Constructors

Reward 

Fields

Instances

Instances details
Eq Reward Source # 
Instance details

Defined in Lib

Methods

(==) :: Reward -> Reward -> Bool #

(/=) :: Reward -> Reward -> Bool #

Read Reward Source # 
Instance details

Defined in Lib

Show Reward Source # 
Instance details

Defined in Lib

Generic Reward Source # 
Instance details

Defined in Lib

Associated Types

type Rep Reward :: Type -> Type #

Methods

from :: Reward -> Rep Reward x #

to :: Rep Reward x -> Reward #

FromJSON Reward Source # 
Instance details

Defined in Lib

type Rep Reward Source # 
Instance details

Defined in Lib