Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Namecoin
Description
Namecoin utility library
Synopsis
- data RPCRequest = RPCRequest {}
- data RPCResponse = RPCResponse {}
- data RPCError = RPCError {}
- rpcRequest :: String -> String -> [String] -> IO (Error Value)
- data Name = Name {}
- nameList :: String -> IO (Error [Name])
- nameUpdate :: String -> Name -> IO Int
- uri :: Text -> Error String
JSON-RPC client
data RPCRequest Source #
JSON-RPC 1.0 request record
Constructors
RPCRequest | |
Instances
FromJSON RPCRequest Source # | |
Defined in Namecoin | |
ToJSON RPCRequest Source # | |
Defined in Namecoin Methods toJSON :: RPCRequest -> Value # toEncoding :: RPCRequest -> Encoding # toJSONList :: [RPCRequest] -> Value # toEncodingList :: [RPCRequest] -> Encoding # | |
Generic RPCRequest Source # | |
type Rep RPCRequest Source # | |
Defined in Namecoin type Rep RPCRequest = D1 ('MetaData "RPCRequest" "Namecoin" "namecoin-update-0.2.3.0-inplace" 'False) (C1 ('MetaCons "RPCRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "method") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "params") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String])))) |
data RPCResponse Source #
JSON-RPC 1.0 response record
Constructors
RPCResponse | |
Instances
FromJSON RPCResponse Source # | |
Defined in Namecoin | |
ToJSON RPCResponse Source # | |
Defined in Namecoin Methods toJSON :: RPCResponse -> Value # toEncoding :: RPCResponse -> Encoding # toJSONList :: [RPCResponse] -> Value # toEncodingList :: [RPCResponse] -> Encoding # | |
Generic RPCResponse Source # | |
type Rep RPCResponse Source # | |
Defined in Namecoin type Rep RPCResponse = D1 ('MetaData "RPCResponse" "Namecoin" "namecoin-update-0.2.3.0-inplace" 'False) (C1 ('MetaCons "RPCResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "result") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value) :*: S1 ('MetaSel ('Just "rpcError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe RPCError))))) |
Namecoin API error record
Constructors
RPCError | |
Instances
FromJSON RPCError Source # | |
ToJSON RPCError Source # | |
Generic RPCError Source # | |
type Rep RPCError Source # | |
Defined in Namecoin type Rep RPCError = D1 ('MetaData "RPCError" "Namecoin" "namecoin-update-0.2.3.0-inplace" 'False) (C1 ('MetaCons "RPCError" 'PrefixI 'True) (S1 ('MetaSel ('Just "code") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) |
Arguments
:: String | the URI of the JSON-RPC endpoint |
-> String | the method name |
-> [String] | the method parameters |
-> IO (Error Value) | and error or the wanted result |
Execute an RPC method
Name operations
Namecoin API Value record
Constructors
Name | |
Instances
FromJSON Name Source # | |
Generic Name Source # | |
Show Name Source # | |
type Rep Name Source # | |
Defined in Namecoin type Rep Name = D1 ('MetaData "Name" "Namecoin" "namecoin-update-0.2.3.0-inplace" 'False) (C1 ('MetaCons "Name" 'PrefixI 'True) (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "expires_in") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))) |
nameUpdate :: String -> Name -> IO Int Source #
Issue an udpate for a name (confirming its current value)