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
/
interop.js.map
1 lines (1 loc) · 5.9 KB
/
interop.js.map
1
{"version": 3, "mappings": "AAAA,QAAA,MAAA,EAAA,UAAA;AAEA,QAAA,OAAA,EAAA,UAAA,EAAA,UAAA,EAAA,WAAA,EAAA,SAAA,EAAA,OAAA,EAAA,IAAA,EAAA,OAAA;AACA,QAAA,GAAA,EAAA,YAAA;AACA,QAAA,MAAA,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,aAAA,SAAcA,GAAd;IAEI;QACI;QACA,IAAAC,QAAYC;IAFhB;IAIA;;QACIC,MAAM,MACFC,SAAA,EADE,uBAGF,IAAAC,gBAAA,EAHE;;;QAKN,OAAO,IAAAC,KAAA,CAAUH,GAAV;IANX;IAQA;QACI,OAAO,IAAAF;IADX;IAGA;QACI,MAAMM;IADV;IAGA,wBAAgC,IAAhC,iBAAmD,IAAnD;QACI,MAAMA;IADV;IAGA,wBAAgC,KAAhC;QACI,MAAMA;IADV;IAGA;QACI,MAAMA;IADV;AA1BJ;AA8BA,aAAA;IAEI;;QACIJ,MAAM,MACFC,SAAA,EADE,EAEF,cAFE,EAGF,uCAHE,EAIF,+DAJE;QAMN,OAAO,IAAAE,KAAA,CAAUH,GAAV;IAPX;IASA,oBAAyB,IAAzB,QAAmC,IAAnC;;QACI,IAAG,CAAAK,KAAA,IAAA,CAAS,IAAT,CAAH;YACIA,QAAQC;QADZ;QAGA,IAAG,UAAWD,MAAX,IAAA,SAAA,IAAA,EAAWA,KAAX,WAAA,OAAA,EAAH;YACIE,WAAW,CACP,SADO,EACIC,OADJ,EAEP,YAFO,EAEOC,UAFP,EAGP,aAHO,EAGQC,WAHR,EAIP,SAJO,EAIIC,OAJJ,EAKP,YALO,EAKOC,SAAAC,WALP,EAMP,cANO,EAMSC,IAAAC,QANT;YAQX,cAAG,CAAAV,KAAA,EAASE,QA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"\\n\".join", "NotImplementedError", "shell", "default_shell", "networks", "mainnet", "babylonnet", "carthagenet", "zeronet", "localhost", "localhost.sandboxnet", "pool", "pool.mainnet", "this.shell", "ShellQuery", "RpcNode", "key", "is_installed", "default_key", "default_key_hash", "is_key", "this.key", "Key.from_encoded_key", "is_pkh", "KeyHash", "exists", "expanduser", "Key.from_faucet", "Key.from_alias", "this._spawn"], "sourcesContent": ["from os.path import exists, expanduser\n\nfrom pytezos.rpc import ShellQuery, RpcNode, mainnet, babylonnet, carthagenet, zeronet, localhost, pool\nfrom pytezos.crypto import Key, is_installed\nfrom pytezos.encoding import is_key, is_pkh\n\ndefault_shell = 'carthagenet'\ndefault_key = 'edsk33N474hxzA4sKeWVM6iuGNGDpX2mGwHNxEA4UbWS8sW3Ta3NKH' # please, use responsibly\ndefault_key_hash = 'tz1cnQZXoznhduu4MVWfJF6GSyP6mMHMbbWa'\n\n\nclass KeyHash(Key):\n\n def __init__(self, public_key_hash):\n JS('super(KeyHash, self).__init__(0) // TODO(*) Im still python')\n self._pkh = public_key_hash\n\n def __repr__(self):\n res = [\n super(Key, self).__repr__(),\n f'\\nPublic key hash',\n self.public_key_hash()\n ]\n return '\\n'.join(res)\n\n def public_key_hash(self):\n return self._pkh\n\n def public_key(self):\n raise NotImplementedError\n\n def secret_key(self, passphrase=None, ed25519_seed=True):\n raise NotImplementedError\n\n def sign(self, message, generic=False):\n raise NotImplementedError\n\n def verify(self, signature, message):\n raise NotImplementedError\n\n\nclass Interop():\n\n def __repr__(self):\n res = [\n super(Interop, self).__repr__(),\n '\\nProperties',\n f'.key # {self.key.public_key_hash()}',\n f'.shell # {self.shell.node.uri} ({self.shell.node.network})'\n ]\n return '\\n'.join(res)\n\n def __init__(self, shell=None, key=None):\n if shell is None:\n shell = default_shell\n\n if isinstance(shell, str):\n networks = {\n 'mainnet': mainnet,\n 'babylonnet': babylonnet,\n 'carthagenet': carthagenet,\n 'zeronet': zeronet,\n 'sandboxnet': localhost.sandboxnet,\n 'mainnet-pool': pool.mainnet\n }\n if shell in networks:\n self.shell = networks[shell]\n else:\n self.shell = ShellQuery(node=RpcNode(uri=shell))\n elif isinstance(shell, ShellQuery):\n self.shell = shell\n else:\n raise NotImplementedError(shell)\n\n if key is None:\n key = default_key if is_installed() else default_key_hash\n\n if isinstance(key, str):\n if is_key(key):\n self.key = Key.from_encoded_key(key)\n elif is_pkh(key):\n self.key = KeyHash(key)\n elif exists(expanduser(key)):\n self.key = Key.from_faucet(key)\n else:\n self.key = Key.from_alias(key)\n elif isinstance(key, Key):\n self.key = key\n else:\n raise NotImplementedError(key)\n\n def _spawn(self, **kwargs):\n raise NotImplementedError\n\n def using(self, shell: ShellQuery = None, key: Key = None):\n \"\"\"\n Change current rpc endpoint and account (private key)\n :param shell: one of 'babylonnet', 'mainnet', 'zeronet', or RPC node uri, or instance of `ShellQuery`\n :param key: base58 encoded key, path to the faucet file, alias from tezos-client, or instance of `Key`\n :return: A copy of current object with changes applied\n \"\"\"\n return self._spawn(shell=shell, key=key)\n\n__all__ = [\"Interop\", \"KeyHash\", \"default_shell\", \"default_key\", \"default_key_hash\"]\n"]}