Module pydena.models.blockchain
Expand source code
from pydantic import BaseModel
from typing import List
class Block(BaseModel):
coinbase: str = None
hash: str = None
parentHash: str = None
height: int = None
timestamp: int = None
root: str = None
identityRoot: str = None
ipfsCid: str = None
transactions: list = None
flags: list = None
isEmpty: bool = None
offlineAddress: str = None
class Transaction(BaseModel):
hash: str = None
type: str = None
from_: str = None
to: str = None
amount: str = None
tips: str = None
maxFee: str = None
nonce: int = None
epoch: int = None
payload: str = None
blockHash: str = None
usedFee: str = None
timestamp: int = None
class Config:
fields = {
'from_': 'from'
}
class Mempool(BaseModel):
results: list = []
class Sync(BaseModel):
syncing: bool = False
currentBlock: int = None
highestBlock: int = None
wrongTime: bool = False
genesisBlock: int = None
class AddressTxns(BaseModel):
transactions: List[Transaction] = []
token: str = None
class BurntCoin(BaseModel):
address: str = None
amount: str = None
key: int = None
class BurntCoins(BaseModel):
results: List[BurntCoin] = None
class FlipKeyword(BaseModel):
name: str = None
desc: str = None
class Config:
fields = {
'name': 'Name',
'desc': 'Desc'
}
Classes
class AddressTxns (**data: Any)
-
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
Expand source code
class AddressTxns(BaseModel): transactions: List[Transaction] = [] token: str = None
Ancestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var token : str
var transactions : List[Transaction]
class Block (**data: Any)
-
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
Expand source code
class Block(BaseModel): coinbase: str = None hash: str = None parentHash: str = None height: int = None timestamp: int = None root: str = None identityRoot: str = None ipfsCid: str = None transactions: list = None flags: list = None isEmpty: bool = None offlineAddress: str = None
Ancestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var coinbase : str
var flags : list
var hash : str
var height : int
var identityRoot : str
var ipfsCid : str
var isEmpty : bool
var offlineAddress : str
var parentHash : str
var root : str
var timestamp : int
var transactions : list
class BurntCoin (**data: Any)
-
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
Expand source code
class BurntCoin(BaseModel): address: str = None amount: str = None key: int = None
Ancestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var address : str
var amount : str
var key : int
class BurntCoins (**data: Any)
-
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
Expand source code
class BurntCoins(BaseModel): results: List[BurntCoin] = None
Ancestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var results : List[BurntCoin]
class FlipKeyword (**data: Any)
-
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
Expand source code
class FlipKeyword(BaseModel): name: str = None desc: str = None class Config: fields = { 'name': 'Name', 'desc': 'Desc' }
Ancestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var Config
var desc : str
var name : str
class Mempool (**data: Any)
-
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
Expand source code
class Mempool(BaseModel): results: list = []
Ancestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var results : list
class Sync (**data: Any)
-
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
Expand source code
class Sync(BaseModel): syncing: bool = False currentBlock: int = None highestBlock: int = None wrongTime: bool = False genesisBlock: int = None
Ancestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var currentBlock : int
var genesisBlock : int
var highestBlock : int
var syncing : bool
var wrongTime : bool
class Transaction (**data: Any)
-
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
Expand source code
class Transaction(BaseModel): hash: str = None type: str = None from_: str = None to: str = None amount: str = None tips: str = None maxFee: str = None nonce: int = None epoch: int = None payload: str = None blockHash: str = None usedFee: str = None timestamp: int = None class Config: fields = { 'from_': 'from' }
Ancestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var Config
var amount : str
var blockHash : str
var epoch : int
var from_ : str
var hash : str
var maxFee : str
var nonce : int
var payload : str
var timestamp : int
var tips : str
var to : str
var type : str
var usedFee : str