(address: Address, password: str, server: str)
| 27 | "--server", help="Matrix server to connect to", default="https://transport01.raiden.network" |
| 28 | ) |
| 29 | def matrix_api_shell(address: Address, password: str, server: str) -> None: |
| 30 | am = AccountManager(os.path.expanduser("~/.ethereum/keystore")) |
| 31 | signer = LocalSigner(am.get_privkey(to_checksum_address(address), password)) |
| 32 | server_name = server.split("//")[1] |
| 33 | matrix_password = encode_hex(signer.sign(server_name.encode())) |
| 34 | |
| 35 | api = GMatrixHttpApi(server) |
| 36 | resp = api.login( |
| 37 | "m.login.password", user=to_normalized_address(address), password=matrix_password |
| 38 | ) |
| 39 | api.token = resp["access_token"] |
| 40 | IPython.embed(header=f"Use the `api` object to interact with matrix on {server}.") |
| 41 | |
| 42 | |
| 43 | if __name__ == "__main__": |
no test coverage detected