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 = NoneAncestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var token : strvar 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 = NoneAncestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var coinbase : strvar flags : listvar hash : strvar height : intvar identityRoot : strvar ipfsCid : strvar isEmpty : boolvar offlineAddress : strvar parentHash : strvar root : strvar timestamp : intvar 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 = NoneAncestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var address : strvar amount : strvar 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] = NoneAncestors
- 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 Configvar desc : strvar 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 = NoneAncestors
- pydantic.main.BaseModel
- pydantic.utils.Representation
Class variables
var currentBlock : intvar genesisBlock : intvar highestBlock : intvar syncing : boolvar 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 Configvar amount : strvar blockHash : strvar epoch : intvar from_ : strvar hash : strvar maxFee : strvar nonce : intvar payload : strvar timestamp : intvar tips : strvar to : strvar type : strvar usedFee : str