Module

Network.Ethereum.Uport

Package
purescript-uport
Repository
f-o-a-m/purescript-uport

Re-exports from Network.Ethereum.Uport.Connect

#UPORT Source

data UPORT :: Effect

This effect is used to annotate code which possibly uses Uport lib for signing etherium transactions.

#OptionsBuilder Source

type OptionsBuilder eff = Options eff -> Options eff

Builder type for Options used to construct Connect

#Options Source

type Options eff = { appName :: Maybe AppName, clientId :: Maybe ClientId, network :: Maybe Network, signer :: Maybe (Signer eff) }

A Type used to create Connect

#Credentials Source

type Credentials eff = { clientId :: ClientId, network :: Network, signer :: Signer eff }

#Connect Source

data Connect :: Type

An instance of Connect class from uport-connect

#ClientId Source

newtype ClientId

Constructors

#AppName Source

newtype AppName

A type used for representing Uport application name

Constructors

#withNetwork Source

withNetwork :: forall eff. Network -> Options eff -> Options eff

A combinator used as part of OptionsBuilder, it set's network on which Connect will operate. Example:

connect
  $ withAppName (AppName "MyApp")
  >>> withNetwork rinkeby

#withCredentials Source

withCredentials :: forall eff. Credentials eff -> Options eff -> Options eff

A combinator used as part of OptionsBuilder, it set's Uport application credentials (used when signed requests are requried). Example:

connect
  $ withAppName (AppName "MyApp")
  >>> withCredentials myAppCredentials

#withAppName Source

withAppName :: forall eff. AppName -> Options eff -> Options eff

A combinator used as part of OptionsBuilder, it set's Uport application name. Example:

connect
  $ withAppName (AppName "MyApp")
  >>> withNetwork rinkeby

#optionsDefaults Source

optionsDefaults :: forall eff. OptionsBuilder eff

OptionsBuilder which could be used to create Connect using default options

#getProvider Source

getProvider :: forall eff. Connect -> Eff (uport :: UPORT | eff) Provider

Instantiates and returns a web3 styple provider wrapped with uPort functionality

#connect Source

connect :: forall eff. OptionsBuilder eff -> Eff (exception :: EXCEPTION, uport :: UPORT | eff) Connect

Re-exports from Network.Ethereum.Uport.Network

#NetworkR Source

type NetworkR = { id :: String, registry :: String, rpcUrl :: String }

Represents Network configuration object.

#Network Source

data Network :: Type

Type representing Etherium Network on which all operations will be performed.

#ropsten Source

ropsten :: Network

Predefined Network configuration value for "ropsten"

#rinkeby Source

rinkeby :: Network

Predefined Network configuration value for "rinkeby"

#mkNetwork Source

mkNetwork :: NetworkR -> Network

Constructs Network configuration object

mkNetwork
  { id: "0x1"
  , registry: "0xab5c8051b9a1df1aab0149f8b0630848b7ecabf6"
  , rpcUrl: "https://mainnet.infura.io"
  }

#mainnet Source

mainnet :: Network

Predefined Network configuration value for "mainnet"

#kovan Source

kovan :: Network

Predefined Network configuration value for "kovan"

Re-exports from Network.Ethereum.Uport.Signer

#SigningInput Source

newtype SigningInput

Input to signing function

Constructors

#Signer Source

data Signer :: # Effect -> Type

Signing function which will be used to sign JWT's in the credentials object. It could be constracted out of mkSigner or more low level function fromRawSigner.

#Signature Source

newtype Signature

Result of signing function.

Constructors

#RawSigner Source

type RawSigner eff = EffFn2 eff SigningInput (SignerCallback eff) Unit

Low level representation of Signer

#mkSigner Source

mkSigner :: forall eff. (SigningInput -> Aff eff Signature) -> Eff eff (Signer eff)

Takes Aff based signing function and retusn Signer.

#fromRawSigner Source

fromRawSigner :: forall eff. RawSigner eff -> Signer eff

Re-exports from Network.Ethereum.Uport.Signer.Simple

#PrivateKey Source

newtype PrivateKey

Type containing private key, passed to SimpleSigner function from uport module.

#simpleSigner Source

simpleSigner :: forall eff. PrivateKey -> Signer (exception :: EXCEPTION | eff)

Creates Signer from from PrivateKey using SimpleSigner function from uport module.

#mkPrivateKey Source

mkPrivateKey :: String -> PrivateKey

Constructs PrivateKey