MCPcopy Create free account
hub / github.com/canopy-network/canopy / keystore_get_key

Function keystore_get_key

plugin/python/tutorial/rpc_test.py:92–103  ·  view source on GitHub ↗

Get key info from the keystore.

(rpc_url: str, address: str, password: str)

Source from the content-addressed store, hash-verified

90
91
92def keystore_get_key(rpc_url: str, address: str, password: str) -> KeyGroup:
93 """Get key info from the keystore."""
94 req_json = json.dumps({"address": address, "password": password})
95 resp_body = post_raw_json(f"{rpc_url}/v1/admin/keystore-get", req_json)
96 parsed = json.loads(resp_body)
97
98 # Handle potential field name variations
99 return KeyGroup(
100 address=parsed.get('address') or parsed.get('Address') or address,
101 public_key=parsed.get('publicKey') or parsed.get('PublicKey') or parsed.get('public_key'),
102 private_key=parsed.get('privateKey') or parsed.get('PrivateKey') or parsed.get('private_key'),
103 )
104
105
106def get_height(rpc_url: str) -> int:

Callers 1

test_plugin_transactionsFunction · 0.85

Calls 3

post_raw_jsonFunction · 0.85
KeyGroupClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected