gemini-exports-0.1.0.1: Generate CSV Exports of Your Gemini Trades, Transfers, & Earn Transactions
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Gemini

Description

Request functions & response types for the Gemini Exchange API.

Synopsis

Documentation

data GeminiApiM a Source #

Monad in which Gemini API requests are run.

Instances

Instances details
MonadIO GeminiApiM Source # 
Instance details

Defined in Web.Gemini

Methods

liftIO :: IO a -> GeminiApiM a #

Applicative GeminiApiM Source # 
Instance details

Defined in Web.Gemini

Methods

pure :: a -> GeminiApiM a #

(<*>) :: GeminiApiM (a -> b) -> GeminiApiM a -> GeminiApiM b #

liftA2 :: (a -> b -> c) -> GeminiApiM a -> GeminiApiM b -> GeminiApiM c #

(*>) :: GeminiApiM a -> GeminiApiM b -> GeminiApiM b #

(<*) :: GeminiApiM a -> GeminiApiM b -> GeminiApiM a #

Functor GeminiApiM Source # 
Instance details

Defined in Web.Gemini

Methods

fmap :: (a -> b) -> GeminiApiM a -> GeminiApiM b #

(<$) :: a -> GeminiApiM b -> GeminiApiM a #

Monad GeminiApiM Source # 
Instance details

Defined in Web.Gemini

Methods

(>>=) :: GeminiApiM a -> (a -> GeminiApiM b) -> GeminiApiM b #

(>>) :: GeminiApiM a -> GeminiApiM b -> GeminiApiM b #

return :: a -> GeminiApiM a #

MonadCatch GeminiApiM Source # 
Instance details

Defined in Web.Gemini

Methods

catch :: (HasCallStack, Exception e) => GeminiApiM a -> (e -> GeminiApiM a) -> GeminiApiM a #

MonadThrow GeminiApiM Source # 
Instance details

Defined in Web.Gemini

Methods

throwM :: (HasCallStack, Exception e) => e -> GeminiApiM a #

MonadHttp GeminiApiM Source #

Use MonadHttp from the Req monad.

Instance details

Defined in Web.Gemini

MonadReader GeminiConfig GeminiApiM Source # 
Instance details

Defined in Web.Gemini

runApi :: GeminiConfig -> GeminiApiM a -> IO a Source #

Run a series of API requests with the given Config.

Requests

Symbol Details

getSymbolDetails :: MonadHttp m => Text -> m SymbolDetails Source #

Fetch the details on a supported symbol.

data SymbolDetails Source #

Currency & Precision details for a Trade Symbol.

Instances

Instances details
FromJSON SymbolDetails Source # 
Instance details

Defined in Web.Gemini

Generic SymbolDetails Source # 
Instance details

Defined in Web.Gemini

Associated Types

type Rep SymbolDetails :: Type -> Type #

Read SymbolDetails Source # 
Instance details

Defined in Web.Gemini

Show SymbolDetails Source # 
Instance details

Defined in Web.Gemini

Eq SymbolDetails Source # 
Instance details

Defined in Web.Gemini

Ord SymbolDetails Source # 
Instance details

Defined in Web.Gemini

type Rep SymbolDetails Source # 
Instance details

Defined in Web.Gemini

type Rep SymbolDetails = D1 ('MetaData "SymbolDetails" "Web.Gemini" "gemini-exports-0.1.0.1-3qyaT9xFK2SEfk12AkkdQs" 'False) (C1 ('MetaCons "SymbolDetails" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sdSymbol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "sdBaseCurrency") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "sdBasePrecision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Scientific) :*: (S1 ('MetaSel ('Just "sdQuoteCurrency") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "sdQuotePrecision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Scientific)))))

Trade History

getMyTrades Source #

Arguments

:: Maybe (UTCTime, UTCTime)

Optional (start, end) ranges for fetching.

-> GeminiApiM [Trade] 

Fetch all my Gemini Trades

data Trade Source #

A single, completed Trade.

Instances

Instances details
FromJSON Trade Source # 
Instance details

Defined in Web.Gemini

Generic Trade Source # 
Instance details

Defined in Web.Gemini

Associated Types

type Rep Trade :: Type -> Type #

Methods

from :: Trade -> Rep Trade x #

to :: Rep Trade x -> Trade #

Read Trade Source # 
Instance details

Defined in Web.Gemini

Show Trade Source # 
Instance details

Defined in Web.Gemini

Methods

showsPrec :: Int -> Trade -> ShowS #

show :: Trade -> String #

showList :: [Trade] -> ShowS #

Eq Trade Source # 
Instance details

Defined in Web.Gemini

Methods

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

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

Ord Trade Source # 
Instance details

Defined in Web.Gemini

Methods

compare :: Trade -> Trade -> Ordering #

(<) :: Trade -> Trade -> Bool #

(<=) :: Trade -> Trade -> Bool #

(>) :: Trade -> Trade -> Bool #

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

max :: Trade -> Trade -> Trade #

min :: Trade -> Trade -> Trade #

type Rep Trade Source # 
Instance details

Defined in Web.Gemini

Transfer History

getMyTransfers Source #

Arguments

:: Maybe (UTCTime, UTCTime)

Optional (start, end) ranges for fetching.

-> GeminiApiM [Transfer] 

Fetch all my Gemini Transfers

data Transfer Source #

A single fiat or cryptocurrency transfer, credit, deposit, or withdrawal.

Instances

Instances details
FromJSON Transfer Source # 
Instance details

Defined in Web.Gemini

Generic Transfer Source # 
Instance details

Defined in Web.Gemini

Associated Types

type Rep Transfer :: Type -> Type #

Methods

from :: Transfer -> Rep Transfer x #

to :: Rep Transfer x -> Transfer #

Read Transfer Source # 
Instance details

Defined in Web.Gemini

Show Transfer Source # 
Instance details

Defined in Web.Gemini

Eq Transfer Source # 
Instance details

Defined in Web.Gemini

Ord Transfer Source # 
Instance details

Defined in Web.Gemini

type Rep Transfer Source # 
Instance details

Defined in Web.Gemini

Earn History

getMyEarnTransactions :: Maybe (UTCTime, UTCTime) -> GeminiApiM [EarnTransaction] Source #

Fetch all my Gemini Earn Transactions

data EarnHistory Source #

Earn Transactions grouped by a Provider/Borrower.

Instances

Instances details
FromJSON EarnHistory Source # 
Instance details

Defined in Web.Gemini

data EarnTransaction Source #

A single Earn transaction.

Instances

Instances details
FromJSON EarnTransaction Source # 
Instance details

Defined in Web.Gemini

Generic EarnTransaction Source # 
Instance details

Defined in Web.Gemini

Associated Types

type Rep EarnTransaction :: Type -> Type #

Read EarnTransaction Source # 
Instance details

Defined in Web.Gemini

Show EarnTransaction Source # 
Instance details

Defined in Web.Gemini

Eq EarnTransaction Source # 
Instance details

Defined in Web.Gemini

Ord EarnTransaction Source # 
Instance details

Defined in Web.Gemini

type Rep EarnTransaction Source # 
Instance details

Defined in Web.Gemini

Helpers

protectedGeminiRequest :: (MonadHttp m, HttpMethod method, HttpBodyAllowed (AllowsBody method) (ProvidesBody NoReqBody), ToJSON body, FromJSON response, MonadReader GeminiConfig m) => method -> Url scheme -> body -> m (JsonResponse response) Source #

Run a request that requires authorization against the Gemini API.

retryWithRateLimit :: (MonadHttp m, MonadCatch m) => m a -> m a Source #

Attempt a request & retry if a 429 RateLimited error is returned. We attempt to parse the retry wait time from the message field but fallback to one second.

createSignature Source #

Arguments

:: GeminiConfig

API Credentials

-> ByteString

Base64-encoded request body.

-> ByteString 

Generate a HMAC SHA384 signature for an authorized API request.

makeNonce :: MonadIO m => m Integer Source #

Generate a nonce for authorized requests from the current timestamp in milliseconds.