|
22 | 22 | load_dotenv() |
23 | 23 | network_name = os.getenv('NETWORK', 'testnet').lower() |
24 | 24 |
|
| 25 | + |
25 | 26 | def setup_client(): |
26 | 27 | """Initialize and set up the client with operator account""" |
27 | 28 | network = Network(network_name) |
28 | 29 | print(f"Connecting to Hedera {network_name} network!") |
29 | 30 | client = Client(network) |
30 | 31 |
|
31 | 32 | try: |
32 | | - operator_id = AccountId.from_string(os.getenv('OPERATOR_ID','')) |
33 | | - operator_key = PrivateKey.from_string(os.getenv('OPERATOR_KEY','')) |
| 33 | + operator_id = AccountId.from_string(os.getenv('OPERATOR_ID', '')) |
| 34 | + operator_key = PrivateKey.from_string(os.getenv('OPERATOR_KEY', '')) |
34 | 35 | client.set_operator(operator_id, operator_key) |
35 | 36 | print(f"Client set up with operator id {client.operator_account_id}") |
36 | 37 | return client, operator_id, operator_key |
@@ -98,7 +99,7 @@ def associate_token(client, recipient_id, recipient_key, token_id): |
98 | 99 | sys.exit(1) |
99 | 100 |
|
100 | 101 |
|
101 | | -def transfer_transaction(client, operator_id, operator_key, recipient_id, token_id): |
| 102 | +def transfer_tokens(client, operator_id, operator_key, recipient_id, token_id): |
102 | 103 | """Perform the token transfer""" |
103 | 104 | print("\nSTEP 4: Transferring Token...") |
104 | 105 | try: |
@@ -142,7 +143,7 @@ def main(): |
142 | 143 | recipient_id, recipient_key = create_account(client, operator_key) |
143 | 144 | token_id = create_token(client, operator_id, operator_key) |
144 | 145 | associate_token(client, recipient_id, recipient_key, token_id) |
145 | | - transfer_transaction(client, operator_id, operator_key, recipient_id, token_id) |
| 146 | + transfer_tokens(client, operator_id, operator_key, recipient_id, token_id) |
146 | 147 |
|
147 | 148 |
|
148 | 149 | if __name__ == "__main__": |
|
0 commit comments