diff --git a/python/hyperon/exts/snet_io/snet_gate.py b/python/hyperon/exts/snet_io/snet_gate.py index 6bce0ae24..3eb11b65b 100644 --- a/python/hyperon/exts/snet_io/snet_gate.py +++ b/python/hyperon/exts/snet_io/snet_gate.py @@ -14,21 +14,13 @@ def init_sdk(self, private_key=os.getenv("SNET_PRIVATE_KEY", '0' * 32), eth_rpc_endpoint=os.getenv("ETH_RPC_ENDPOINT"), email=os.getenv("SNET_EMAIL"), - identity_name="hyperon", - network="mainnet", - identity_type="key", concurrency=False, force_update=False): - config = { - "private_key": private_key, - "eth_rpc_endpoint": eth_rpc_endpoint, - "email": email, - "concurrency": concurrency, - "identity_name": identity_name, - "network": network, - "identity_type": identity_type, - "force_update": force_update - } + self.email = email + config = sdk.config.Config(private_key=private_key, + eth_rpc_endpoint=eth_rpc_endpoint, + concurrency=concurrency, + force_update=force_update) self.snet_sdk = sdk.SnetSDK(config) def organization_list(self): @@ -45,6 +37,7 @@ def create_service_client(self, org_id, service_id, service_client = self.snet_sdk.create_service_client( org_id=org_id, service_id=service_id, # group_name="default_group", + email=self.email, free_call_auth_token_bin=free_call_auth_token_bin, free_call_token_expiry_block=free_call_token_expiry_block) return ServiceCall(service_client) @@ -191,13 +184,14 @@ def get_service_messages(self): def get_operation_atom(self): return OperationAtom(self.service_details[1], self) - def generate_callers_text(self): - return pretty_print_atoms(self.generate_callers()) - def open_channel_and_deposit(self, amount, expiration): self.service_client.deposit_and_open_channel(amount, expiration) return [E()] + def generate_callers_text(self): + # TODO: pretty print + return "\n".join([repr(e) for e in self.generate_callers()]) + def _map_type(self, t): type_map = {'bool': 'Bool', 'string': 'String', @@ -241,4 +235,4 @@ def snet_atoms(): # TODO: new-sdk-atom return { 'snet-sdk': defaultSDKAtom, - } + } \ No newline at end of file diff --git a/python/hyperon/exts/snet_io/test_snet_call.metta b/python/hyperon/exts/snet_io/test_snet_call.metta index 7ecabda78..6cbdddb7e 100644 --- a/python/hyperon/exts/snet_io/test_snet_call.metta +++ b/python/hyperon/exts/snet_io/test_snet_call.metta @@ -45,7 +45,4 @@ (gen_gpt_2 "What was the largest dinosaur?" "universal" 0.5 2 100) ; possible usage of open_channel_and_deposit function. 100 is the amount of AGIX and 10000 is a payment channel's TTL in blocks -(snet-sdk open_channel_and_deposit &generative-lms 100 10000) - -; usage of generate_callers_text method -((py-dot &generative-lms generate_callers_text)) \ No newline at end of file +(snet-sdk open_channel_and_deposit &generative-lms 100 10000) \ No newline at end of file diff --git a/python/hyperon/exts/snet_io/test_snet_meta.metta b/python/hyperon/exts/snet_io/test_snet_meta.metta index 0d83b1620..74c692b50 100644 --- a/python/hyperon/exts/snet_io/test_snet_meta.metta +++ b/python/hyperon/exts/snet_io/test_snet_meta.metta @@ -31,5 +31,4 @@ ; (naint punctuation-restoration) returns a service caller now !((py-dot (naint punctuation-restoration) get_service_messages)) ; we can also get a list of all service methods as typed metta functions -!(naint punctuation-restoration methods) - +!(naint punctuation-restoration methods) \ No newline at end of file