ain.types module

class ain.types.AinOptions(rawResultMode: bool = None)

Bases: object

Class for the AIN blockchain options.

rawResultMode: bool | None

The flag of the using transaction raw result mode. If True, the raw result will return.

class ain.types.ECDSASignature(r: bytes, s: bytes, v: int)

Bases: object

Class for the ECDSA signature.

classmethod fromSignature(signature: bytes)

Converts signature format of the eth_sign RPC method to signature parameters.

Parameters:

signature – The eth_sign signature.

r: bytes
s: bytes
v: int
class ain.types.ECIESEncrypted(iv: bytes, ephemPublicKey: bytes, ciphertext: bytes, mac: bytes)

Bases: object

Class for the ECIES encrypted ciphertext.

ciphertext: bytes
ephemPublicKey: bytes
iv: bytes
mac: bytes
class ain.types.EvalOwnerInput(permission: Literal['branch_owner', 'write_function', 'write_owner', 'write_rule'], ref: str = None, address: str = None, is_global: bool = None)

Bases: object

Class for the eval owner input.

address: str | None

The AIN blockchain address of the sender.

is_global: bool | None

The flag of the using global reference path. If True, the given ref will be interpreted as a global path.

permission: Literal['branch_owner', 'write_function', 'write_owner', 'write_rule']

The type of the permission.

ref: str | None

The path that you want to make transaction.

class ain.types.EvalRuleInput(value: Any = None, ref: str = None, address: str = None, timestamp: int = None, is_global: bool = None)

Bases: object

Class for the eval rule input.

address: str | None

The AIN blockchain address of the sender.

is_global: bool | None

The flag of the using global reference path. If True, the given ref will be interpreted as a global path.

ref: str | None

The path that you want to make transaction.

timestamp: int | None

The unix time in milliseconds when the transaction has been created.

value: Any

The value that you want to set.

class ain.types.GetMultiOperation(type: Literal['GET'], op_list: List[GetOperation])

Bases: object

Class for the multiple get operation.

op_list: List[GetOperation]

The list of the get operations.

type: Literal['GET']

The type of the multiple get operation.

class ain.types.GetOperation(type: Literal['GET_VALUE', 'GET_RULE', 'GET_OWNER', 'GET_FUNCTION'], ref: str = None, is_global: bool = None)

Bases: object

Class for the get operation.

is_global: bool | None

The flag of the using global reference path. If True, the given ref will be interpreted as a global path.

ref: str | None

The path that you want to make transaction.

type: Literal['GET_VALUE', 'GET_RULE', 'GET_OWNER', 'GET_FUNCTION']

The type of the get operation.

class ain.types.GetOptions(is_global: bool = None, is_final: bool = None, is_shallow: bool = None, include_version: bool = None, include_tree_info: bool = None, include_proof: bool = None)

Bases: object

Class for the get transaction options.

include_proof: bool | None

The flag of the including proof hashes. If True, the result will include proof hashes.

include_tree_info: bool | None

The flag of the including tree info. If True, the result will include additional state tree information.

include_version: bool | None

The flag of the including version. If True, the result will include state versions.

is_final: bool | None

The flag of the getting finalized result. If True, the result will return finalized.

is_global: bool | None

The flag of the using global reference path. If True, the given ref will be interpreted as a global path.

is_shallow: bool | None

The flag of the getting shallow result. If True, the result will return only the keys of the children.

class ain.types.MatchInput(ref: str = None, is_global: bool = None)

Bases: object

Class for the match input.

is_global: bool | None

The flag of the using global reference path. If True, the given ref will be interpreted as a global path.

ref: str | None

The path that you want to make transaction.

class ain.types.SetMultiOperation(type: Literal['SET'], op_list: List[SetOperation])

Bases: object

Class for the multiple set operation.

op_list: List[SetOperation]

The list of the set operations.

type: Literal['SET']

The type of the multiple set operation.

class ain.types.SetMultiTransactionInput(op_list: List[SetOperation], parent_tx_hash: str = None, nonce: int = None, address: str = None, timestamp: int = None, gas_price: int = None)

Bases: TransactionInputBase

Class for the multiple set transaction input.

address: str | None

The AIN blockchain address of the sender.

gas_price: int | None

The gas price of the transaction.

nonce: int | None

The nonce of the transaction.

op_list: List[SetOperation]

The list of the set operations.

parent_tx_hash: str | None

The hash of the parent transaction. If transaction is not nested, this should not be given.

timestamp: int | None

The unix time in milliseconds when the transaction has been created.

class ain.types.SetOperation(type: Literal['SET_VALUE', 'INC_VALUE', 'DEC_VALUE', 'SET_RULE', 'SET_OWNER', 'SET_FUNCTION'], ref: str, value: Any = None, is_global: bool = None)

Bases: object

Class for the set operation.

is_global: bool | None

The flag of the using global reference path. If True, the given ref will be interpreted as a global path.

ref: str

The reference of the path.

type: Literal['SET_VALUE', 'INC_VALUE', 'DEC_VALUE', 'SET_RULE', 'SET_OWNER', 'SET_FUNCTION']

The type of the set operation.

value: Any | None

The value that you want to set.

class ain.types.StateInfoInput(ref: str = None)

Bases: object

Class for the state information input.

ref: str | None

The path that you want to query with.

class ain.types.Transaction

Bases: object

Class for the transaction.

address: str

The AIN blockchain address of the sender.

hash: str

The transaction hash.

signature: str

The signature of the transaction.

tx_body: TransactionBody

The transaction body.

class ain.types.TransactionBody(operation: SetOperation | SetMultiOperation, nonce: int, timestamp: int, gas_price: int = None, billing: str = None, parent_tx_hash: str = None)

Bases: TransactionBodyBase

Class for the transaction body.

billing: str | None

The billing app name and the billing ID. Must be formatted as <app_name>|<billing_id>

gas_price: int | None

The gas price of the transaction.

nonce: int

The nonce of the transaction.

operation: SetOperation | SetMultiOperation

The set operation.

parent_tx_hash: str | None

The hash of the parent transaction. If transaction is not nested, this should not be given.

timestamp: int

The unix time in milliseconds when the transaction has been created.

class ain.types.TransactionBodyBase

Bases: object

Class for the transaction body base.

operation: SetOperation | SetMultiOperation

The set operation.

parent_tx_hash: str | None

The hash of the parent transaction. If transaction is not nested, this should not be given.

class ain.types.TransactionInput(operation: SetOperation | SetMultiOperation, parent_tx_hash: str = None, nonce: int = None, address: str = None, timestamp: int = None, gas_price: int = None)

Bases: TransactionBodyBase, TransactionInputBase

Class for the transaction input.

address: str | None

The AIN blockchain address of the sender.

gas_price: int | None

The gas price of the transaction.

nonce: int | None

The nonce of the transaction.

operation: SetOperation | SetMultiOperation

The set operation.

parent_tx_hash: str | None

The hash of the parent transaction. If transaction is not nested, this should not be given.

timestamp: int | None

The unix time in milliseconds when the transaction has been created.

class ain.types.TransactionInputBase

Bases: object

Class for the transaction input base.

address: str | None

The AIN blockchain address of the sender.

gas_price: int | None

The gas price of the transaction.

nonce: int | None

The nonce of the transaction.

timestamp: int | None

The unix time in milliseconds when the transaction has been created.

class ain.types.ValueOnlyTransactionBodyBase

Bases: object

Class for the value only transaction body base.

is_global: bool | None

The flag of the using global reference path. If True, the given ref will be interpreted as a global path.

parent_tx_hash: str | None

The hash of the parent transaction. If transaction is not nested, this should not be given.

ref: str | None

The path that you want to make transaction.

value: Any | None

The value that you want to set.

class ain.types.ValueOnlyTransactionInput(parent_tx_hash: str = None, value: Any = None, ref: str = None, is_global: bool = None, nonce: int = None, address: str = None, timestamp: int = None, gas_price: int = None)

Bases: ValueOnlyTransactionBodyBase, TransactionInputBase

Class for the value only transaction input.

address: str | None

The AIN blockchain address of the sender.

gas_price: int | None

The gas price of the transaction.

is_global: bool | None

The flag of the using global reference path. If True, the given ref will be interpreted as a global path.

nonce: int | None

The nonce of the transaction.

parent_tx_hash: str | None

The hash of the parent transaction. If transaction is not nested, this should not be given.

ref: str | None

The path that you want to make transaction.

timestamp: int | None

The unix time in milliseconds when the transaction has been created.

value: Any | None

The value that you want to set.