Copyright | Aleksandr Krupenkin 2016-2024 |
---|---|
License | Apache-2.0 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | unportable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Network.Polkadot
Description
A scalable, interoperable & secure network protocol for the next web.
Synopsis
- query :: (JsonRpc m, Decode a) => Text -> Text -> [Argument] -> m (Either String a)
- data Argument where
- module Codec.Scale
- module Network.Polkadot.Primitives
- class Pair a where
- class Verify a where
- verify :: (IdentifyAccount s, ByteArrayAccess ba) => a -> ba -> s -> Bool
- class Pair a => MultiPair a where
- multi_address :: a -> MultiAddress a
- multi_signer :: a -> MultiSigner a
- multi_sign :: ByteArrayAccess ba => a -> ba -> MultiSignature a
- data Ed25519
- data Ecdsa
- class Ss58Codec a where
- from_ss58check :: ByteString -> Either String a
- to_ss58check :: a -> ByteString
- to_ss58check_with_version :: Word16 -> a -> ByteString
- from_ss58check_with_version :: Word16 -> ByteString -> Either String a
- class IdentifyAccount a where
- into_account :: a -> AccountId a
- module Network.Polkadot.Extrinsic
- module Network.Polkadot.Call
Query blockchain storage.
Arguments
:: (JsonRpc m, Decode a) | |
=> Text | Module name. |
-> Text | Storage method name. |
-> [Argument] | Arguments (for mappings). |
-> m (Either String a) | Decoded storage item. |
Query data from blockchain via getStorage
RPC call.
General type wrapper for SCALE encodable storage index argument.
Base types and codecs.
module Codec.Scale
module Network.Polkadot.Primitives
Class suitable for typical cryptographic PKI key pair type.
Associated Types
The type which is used to encode a public key.
The type used to represent a signature. Can be created from a key pair and a message and verified with the message and a public key.
Methods
Generate new secure (random) key pair.
from_seed :: ByteArrayAccess ba => ba -> Either String a Source #
Generate new key pair from the provided seed
.
from_phrase :: Text -> Maybe Text -> Either String a Source #
Generate key pair from given recovery phrase and password.
public :: a -> PublicKey a Source #
Get a public key.
sign :: ByteArrayAccess ba => a -> ba -> Signature a Source #
Sign a message.
Instances
Pair Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
Pair Ed25519 Source # | |
Defined in Network.Polkadot.Crypto |
Means of signature verification.
Methods
Arguments
:: (IdentifyAccount s, ByteArrayAccess ba) | |
=> a | Message signature. |
-> ba | Message content. |
-> s | Type of the signer. |
-> Bool | Returns |
Verify a message.
class Pair a => MultiPair a where Source #
Multiple cryptographic type support.
Methods
multi_address :: a -> MultiAddress a Source #
Derive universal account address.
multi_signer :: a -> MultiSigner a Source #
Derive universal signer account identifier.
multi_sign :: ByteArrayAccess ba => a -> ba -> MultiSignature a Source #
Sign message and derive universal signature.
Instances
MultiPair Ecdsa Source # | |
Defined in Network.Polkadot.Crypto Associated Types type MultiAddress Ecdsa Source # type MultiSigner Ecdsa Source # type MultiSignature Ecdsa Source # Methods multi_address :: Ecdsa -> MultiAddress Ecdsa Source # multi_signer :: Ecdsa -> MultiSigner Ecdsa Source # multi_sign :: ByteArrayAccess ba => Ecdsa -> ba -> MultiSignature Ecdsa Source # | |
MultiPair Ed25519 Source # | |
Defined in Network.Polkadot.Crypto Associated Types type MultiAddress Ed25519 Source # type MultiSigner Ed25519 Source # type MultiSignature Ed25519 Source # Methods multi_address :: Ed25519 -> MultiAddress Ed25519 Source # multi_signer :: Ed25519 -> MultiSigner Ed25519 Source # multi_sign :: ByteArrayAccess ba => Ed25519 -> ba -> MultiSignature Ed25519 Source # |
Ed25519 cryptographic pair.
Instances
Show Ed25519 Source # | |
Eq Ed25519 Source # | |
MultiPair Ed25519 Source # | |
Defined in Network.Polkadot.Crypto Associated Types type MultiAddress Ed25519 Source # type MultiSigner Ed25519 Source # type MultiSignature Ed25519 Source # Methods multi_address :: Ed25519 -> MultiAddress Ed25519 Source # multi_signer :: Ed25519 -> MultiSigner Ed25519 Source # multi_sign :: ByteArrayAccess ba => Ed25519 -> ba -> MultiSignature Ed25519 Source # | |
Pair Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
type MultiAddress Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
type MultiSignature Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
type MultiSigner Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
type PublicKey Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
type Signature Ed25519 Source # | |
Defined in Network.Polkadot.Crypto |
ECDSA cryptographic pair.
Instances
Show Ecdsa Source # | |
Eq Ecdsa Source # | |
MultiPair Ecdsa Source # | |
Defined in Network.Polkadot.Crypto Associated Types type MultiAddress Ecdsa Source # type MultiSigner Ecdsa Source # type MultiSignature Ecdsa Source # Methods multi_address :: Ecdsa -> MultiAddress Ecdsa Source # multi_signer :: Ecdsa -> MultiSigner Ecdsa Source # multi_sign :: ByteArrayAccess ba => Ecdsa -> ba -> MultiSignature Ecdsa Source # | |
Pair Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
type MultiAddress Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
type MultiSignature Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
type MultiSigner Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
type PublicKey Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
type Signature Ecdsa Source # | |
Defined in Network.Polkadot.Crypto |
Extrinsic sign & send functions.
class Ss58Codec a where Source #
Key that can be encoded to/from SS58.
See https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)#address-type for information on the codec.
Minimal complete definition
Methods
from_ss58check :: ByteString -> Either String a Source #
Some if the string is a properly encoded SS58Check address (default prefix).
to_ss58check :: a -> ByteString Source #
Return the ss58-check string for this key (default prefix).
to_ss58check_with_version :: Word16 -> a -> ByteString Source #
Return the ss58-check string for this key.
from_ss58check_with_version :: Word16 -> ByteString -> Either String a Source #
Some if the string is a properly encoded SS58Check address (default prefix).
Instances
Ss58Codec AccountId Source # | |
Defined in Network.Polkadot.Account Methods from_ss58check :: ByteString -> Either String AccountId Source # to_ss58check :: AccountId -> ByteString Source # to_ss58check_with_version :: Word16 -> AccountId -> ByteString Source # from_ss58check_with_version :: Word16 -> ByteString -> Either String AccountId Source # |
class IdentifyAccount a where Source #
Some type that is able to be collapsed into an account ID.
It is not possible to recreate the original value from the account ID.
Instances
IdentifyAccount MultiSigner Source # | |
Defined in Network.Polkadot.Account Associated Types type AccountId MultiSigner Source # Methods into_account :: MultiSigner -> AccountId MultiSigner Source # |
module Network.Polkadot.Extrinsic
module Network.Polkadot.Call