src.escrow package

Submodules

src.escrow.escrow_offer module

class src.escrow.escrow_offer.EscrowOffer(_id: bson.objectid.ObjectId, order: bson.objectid.ObjectId, buy: str, sell: str, type: str, escrow: str, time: float, init: Mapping[str, Any], counter: Mapping[str, Any], pending_input_from: Optional[int] = None, sum_currency: Optional[str] = None, sum_buy: Optional[bson.decimal128.Decimal128] = None, sum_sell: Optional[bson.decimal128.Decimal128] = None, sum_fee_up: Optional[bson.decimal128.Decimal128] = None, sum_fee_down: Optional[bson.decimal128.Decimal128] = None, insured: Optional[bson.decimal128.Decimal128] = None, react_time: Optional[float] = None, transaction_time: Optional[float] = None, cancel_time: Optional[float] = None, bank: Optional[str] = None, memo: Optional[str] = None, trx_id: Optional[str] = None, unsent: Optional[bool] = None)[source]

Bases: object

Class used to represent escrow offer.

Attributes correspond to fields in database document.

bank = None

Bank of fiat currency.

buy = None

Currency which order creator wants to buy.

cancel_time = None

Unix time stamp of offer cancellation.

counter = None

Object representing counteragent of escrow.

delete_document() → None[source]

Archive and delete corresponding document in database.

escrow = None

Currency which is held during exchange.

init = None

Object representing initiator of escrow.

insert_document() → None[source]

Convert self to document and insert to database.

insured = None

Amount of insured currency.

memo = None

Required memo in blockchain transaction.

order = None

Primary key value of corresponding order document.

pending_input_from = None

Telegram ID of user required to send message to bot.

react_time = None

Unix time stamp of counteragent first reaction to sent offer.

sell = None

Currency which order creator wants to sell.

sum_buy = None

Amount in buy currency.

sum_currency = None

Temporary field of currency in which user is sending amount.

sum_fee_down = None

Amount of held currency with agreed fee substracted.

sum_fee_up = None

Amount of held currency with agreed fee added.

sum_sell = None

Amount in sell currency.

time = None

Unix time stamp of offer creation.

transaction_time = None

Unix time stamp since which transaction should be checked.

trx_id = None

ID of verified transaction.

type = None

Type of offer. Field of currency which is held during exchange.

unsent = None

True if non-escrow token sender hasn’t confirmed their transfer.

update_document(update) → None[source]

Update corresponding document in database.

Parameters:update – Document with update operators or aggregation pipeline sent to MongoDB.
src.escrow.escrow_offer.asdict(instance)[source]

Represent class instance as dictionary excluding None values.

Module contents

src.escrow.close_blockchains()[source]

Run close() method on every blockchain instance.

src.escrow.connect_to_blockchains()[source]

Run connect() method on every blockchain instance.

src.escrow.get_escrow_instance(asset: str)[source]

Find blockchain instance which supports asset.