web3-polkadot-1.0.1.0: Polkadot support for Haskell Web3 library.
CopyrightAleksandr Krupenkin 2016-2024
LicenseApache-2.0
Maintainermail@akru.me
Stabilityexperimental
Portabilityunportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.Polkadot

Description

A scalable, interoperable & secure network protocol for the next web.

Synopsis

Query blockchain storage.

query Source #

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.

data Argument where Source #

General type wrapper for SCALE encodable storage index argument.

Constructors

Argument 

Fields

Instances

Instances details
Encode Argument Source # 
Instance details

Defined in Network.Polkadot.Storage.Key

Methods

put :: Putter Argument #

Base types and codecs.

class Pair a where Source #

Class suitable for typical cryptographic PKI key pair type.

Associated Types

type PublicKey a Source #

The type which is used to encode a public key.

type Signature a Source #

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 :: IO a Source #

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.

class Verify a where Source #

Means of signature verification.

Methods

verify Source #

Arguments

:: (IdentifyAccount s, ByteArrayAccess ba) 
=> a

Message signature.

-> ba

Message content.

-> s

Type of the signer.

-> Bool

Returns true if signature is valid for the value.

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.

data Ed25519 Source #

Ed25519 cryptographic pair.

Instances

Instances details
Show Ed25519 Source # 
Instance details

Defined in Network.Polkadot.Crypto

Eq Ed25519 Source # 
Instance details

Defined in Network.Polkadot.Crypto

Methods

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

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

MultiPair Ed25519 Source # 
Instance details

Defined in Network.Polkadot.Crypto

Pair Ed25519 Source # 
Instance details

Defined in Network.Polkadot.Crypto

Associated Types

type PublicKey Ed25519 Source #

type Signature Ed25519 Source #

type MultiAddress Ed25519 Source # 
Instance details

Defined in Network.Polkadot.Crypto

type MultiSignature Ed25519 Source # 
Instance details

Defined in Network.Polkadot.Crypto

type MultiSigner Ed25519 Source # 
Instance details

Defined in Network.Polkadot.Crypto

type PublicKey Ed25519 Source # 
Instance details

Defined in Network.Polkadot.Crypto

type Signature Ed25519 Source # 
Instance details

Defined in Network.Polkadot.Crypto

data Ecdsa Source #

ECDSA cryptographic pair.

Instances

Instances details
Show Ecdsa Source # 
Instance details

Defined in Network.Polkadot.Crypto

Methods

showsPrec :: Int -> Ecdsa -> ShowS #

show :: Ecdsa -> String #

showList :: [Ecdsa] -> ShowS #

Eq Ecdsa Source # 
Instance details

Defined in Network.Polkadot.Crypto

Methods

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

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

MultiPair Ecdsa Source # 
Instance details

Defined in Network.Polkadot.Crypto

Pair Ecdsa Source # 
Instance details

Defined in Network.Polkadot.Crypto

Associated Types

type PublicKey Ecdsa Source #

type Signature Ecdsa Source #

type MultiAddress Ecdsa Source # 
Instance details

Defined in Network.Polkadot.Crypto

type MultiSignature Ecdsa Source # 
Instance details

Defined in Network.Polkadot.Crypto

type MultiSigner Ecdsa Source # 
Instance details

Defined in Network.Polkadot.Crypto

type PublicKey Ecdsa Source # 
Instance details

Defined in Network.Polkadot.Crypto

type Signature Ecdsa Source # 
Instance details

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.

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).

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.

Methods

into_account :: a -> AccountId a Source #

Transform into an account.

Instances

Instances details
IdentifyAccount MultiSigner Source # 
Instance details

Defined in Network.Polkadot.Account

Associated Types

type AccountId MultiSigner Source #