Skip to content

Commit 45a0dc4

Browse files
committed
Updating token_transfer.py
Signed-off-by: Raja Rathour <imraja729@gmail.com>
1 parent f431406 commit 45a0dc4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/transfer_token.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@
2222
load_dotenv()
2323
network_name = os.getenv('NETWORK', 'testnet').lower()
2424

25+
2526
def setup_client():
2627
"""Initialize and set up the client with operator account"""
2728
network = Network(network_name)
2829
print(f"Connecting to Hedera {network_name} network!")
2930
client = Client(network)
3031

3132
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', ''))
3435
client.set_operator(operator_id, operator_key)
3536
print(f"Client set up with operator id {client.operator_account_id}")
3637
return client, operator_id, operator_key
@@ -98,7 +99,7 @@ def associate_token(client, recipient_id, recipient_key, token_id):
9899
sys.exit(1)
99100

100101

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):
102103
"""Perform the token transfer"""
103104
print("\nSTEP 4: Transferring Token...")
104105
try:
@@ -142,7 +143,7 @@ def main():
142143
recipient_id, recipient_key = create_account(client, operator_key)
143144
token_id = create_token(client, operator_id, operator_key)
144145
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)
146147

147148

148149
if __name__ == "__main__":

0 commit comments

Comments
 (0)