This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
client.js.map
1 lines (1 loc) · 6.4 KB
/
client.js.map
1
{"version": 3, "mappings": "AAAA,QAAA,SAAA;AACA,QAAA,QAAA;AACA,QAAA,OAAA;AAEA,QAAA,cAAA;AACA,QAAA,YAAA;AACA,QAAA,iBAAA;AACA,QAAA,QAAA;AACA,QAAA,OAAA;AACA,QAAA,mBAAA;AACA,QAAA,oBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,mBAAA,SAAoBA,OAApB;IAEI;;QACIC,MAAM,MACFC,SAAA,EADE,EAEF,WAFE,EAGFC,mBAAA,CAAoB,IAAAC,UAApB,CAHE;QAKN,OAAO,IAAAC,KAAA,CAAUJ,GAAV;IANX;IAQA,kBAAA;QACI,OAAO,IAAAK,aAAA,WACGC,MAAAC,IAAA,CAAW,OAAX,EAAoB,IAAAC,MAApB,UACFF,MAAAC,IAAA,CAAW,KAAX,EAAkB,IAAAE,IAAlB,EAFD;IADX;IAMA,2BAAmC,IAAnC,WAAgD,IAAhD,aAA+D,IAA/D,cAA+E,IAA/E;QASJ;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QACQ,OAAO,IAAAC,cAAA,cACMC,oBACFC,oBACEC,uBACCC,oBACJ,IAAAN,eACF,IAAAC,KAND;IAVX;IAmBA;QAKJ;QAAA;QAAA;QAAA;QAAA;QACQ,OAAO,IAAAC,cAAA,cACM,CAACK,OAAD,YACH,IAAAP,eACF,IAAAC,KAHD;IANX;IAYA,qBAA6B,IAA7B;QAKJ;QAAA;QAAA;QAAA;QAAA;;QACQO,UAAU,CAAAC,UAAA,GAAA,CAAc,IAAAR,IAAAS,gBAAA,EAAd;QACV,OAAO,IAAAV,MAAAW,UAAA,CAAqBH,OAArB,CAAA;IAPX;IASA;QACI,OAAQ,CAAA,IAAAI,OAAA,CAAQ,IAAAC,QAAA,EAAA,CAAe,SAAf,CAAR,CAAA,EAAA,SAAqC,CAAA,EAAA,EAAM,CAAN,CAArC,CAAAC,SAAA,CAAuD,IAAAF,OAAA,CAAQ,UAAR,CAAvD;IADZ;IAGA;QAIJ;QAAA;QAAA;QAAA;;QACQG,YAAY,IAAAf,MAAAgB,MAAAC,QAAAC,UAAA;QACZC,KAAK,IAAAnB,MAAAoB,KAAAC,OAAA,EAAA,CAAyB,WAAzB;QACLC,KAAKC,QAAAC,SAAA,CAAkBL,EAAlB,EAAsB,oBAAtB;QACLM,cAAcV,SAAA,CAAU,qBAAV,CAAA,CAAiC,CAAjC;QACd,OAAO,gBAAA,CAAK,CAAAO,EAAA,EAAA,CAAKC,QAAA,CAAS,IAAT,EAAe,CAAf,EAAkB,CAAlB,CAAL,CAAAG,cAAA,EAAL,CAAA,EAAA,gBAAmD,CAAID,WAAJ,CAAnD;IATX;IAWA,+CACuDE,QADvD;QAEI,OAAO,IAAAC,iBAAA,aACKC,sBACF,IAAA7B,eACF,IAAAC,iBACI6B,QAJL;IAFX;IASA;QAKJ;QAAA;QAAA;QAAA;QAAA;QACQ,OAAO,IAAAC,wBAAA,CAA6BF,WAA7B;IANX;IAQA;QAMJ;QAAA;QAAA;QAAA;QAAA;QAAA;QACQ,OAAO,IAAAE,wBAAA,CAA6BF,WAA7B,cAAkDG,qBAAlD;IAPX;AAvFJ;;;AAgGA", "sources": ["client.py"], "names": ["Interop", "res", "super.__repr__", "get_class_docstring", "this.__class__", "\"\\n\".join", "PyTezosClient", "kwargs", "kwargs.get", "this.shell", "this.key", "OperationGroup", "protocol", "branch", "contents", "signature", "content", "address", "account_id", "this.key.public_key_hash", "this.shell.contracts", "Decimal", "this.account", "(new Decimal(this.account()[\"balance\"]) / Math.pow(10, 6)).quantize", "constants", "this.shell.block", "this.shell.block.context", "this.shell.block.context.constants", "ts", "this.shell.head", "this.shell.head.header", "dt", "datetime", "datetime.strptime", "first_delay", "(dt - datetime(1970, 1, 1)).total_seconds", "Contract", "ContractInterface", "contract_id", "factory", "this._get_contract_interface", "NonFungibleTokenImpl"], "sourcesContent": ["from functools import lru_cache\nfrom datetime import datetime\nfrom decimal import Decimal\n\nfrom pytezos.operation.group import OperationGroup\nfrom pytezos.operation.content import ContentMixin\nfrom pytezos.michelson.interface import ContractInterface\nfrom pytezos.michelson.contract import Contract\nfrom pytezos.interop import Interop\nfrom pytezos.tools.docstring import get_class_docstring\nfrom pytezos.standards.non_fungible_token import NonFungibleTokenImpl\n\n\nclass PyTezosClient(Interop, ContentMixin):\n\n def __repr__(self):\n res = [\n super(PyTezosClient, self).__repr__(),\n '\\nHelpers',\n get_class_docstring(self.__class__)\n ]\n return '\\n'.join(res)\n\n def _spawn(self, **kwargs):\n return PyTezosClient(\n shell=kwargs.get('shell', self.shell),\n key=kwargs.get('key', self.key)\n )\n\n def operation_group(self, protocol=None, branch=None, contents=None, signature=None) -> OperationGroup:\n \"\"\"\n Create new operation group (multiple contents).\n You can leave all fields empty in order to create an empty operation group.\n :param protocol: Leave None for autocomplete, otherwise you know what to do\n :param branch: Leave None for autocomplete\n :param contents: List of operation contents (optional)\n :param signature: Can be set later\n :return: OperationGroup\n \"\"\"\n return OperationGroup(\n protocol=protocol,\n branch=branch,\n contents=contents,\n signature=signature,\n shell=self.shell,\n key=self.key\n )\n\n def operation(self, content: dict) -> OperationGroup:\n \"\"\"\n Create an operation group with single content\n :param content: Operation body (depending on `kind`)\n :return: OperationGroup\n \"\"\"\n return OperationGroup(\n contents=[content],\n shell=self.shell,\n key=self.key\n )\n\n def account(self, account_id=None) -> dict:\n \"\"\"\n Shortcut for RPC contract request\n :param account_id: tz/KT address, leave None to show info about current key\n :return: dict\n \"\"\"\n address = account_id or self.key.public_key_hash()\n return self.shell.contracts[address]()\n\n def balance(self) -> Decimal:\n return (Decimal(self.account()['balance']) / 10 ** 6).quantize(Decimal('0.000001'))\n\n def now(self) -> int:\n \"\"\"\n Timestamp of the current head (UTC)\n :return: int\n \"\"\"\n constants = self.shell.block.context.constants() # cached\n ts = self.shell.head.header()['timestamp']\n dt = datetime.strptime(ts, '%Y-%m-%dT%H:%M:%SZ')\n first_delay = constants['time_between_blocks'][0]\n return int((dt - datetime(1970, 1, 1)).total_seconds()) + int(first_delay)\n\n @lru_cache(maxsize=None)\n def _get_contract_interface(self, contract_id, factory=Contract):\n return ContractInterface(\n address=contract_id,\n shell=self.shell,\n key=self.key,\n factory=factory\n )\n\n def contract(self, contract_id) -> ContractInterface:\n \"\"\"\n Get a high-level interface for a given smart contract id.\n :param contract_id: KT address of a smart contract\n :return: ContractInterface\n \"\"\"\n return self._get_contract_interface(contract_id)\n\n def nft_app(self, contract_id) -> ContractInterface:\n \"\"\"\n Get a high-level NFT interface for a given smart contract id.\n Read more at https://nft.stove-labs.com/\n :param contract_id: KT address of a smart contract\n :return: ContractInterface\n \"\"\"\n return self._get_contract_interface(contract_id, factory=NonFungibleTokenImpl)\n\n__all__ = [ \"PyTezosClient\" ]\n"]}