Skip to content

Commit 6055280

Browse files
committed
chore: example updates receipt refactor
Signed-off-by: exploreriii <[email protected]>
1 parent 0e7c651 commit 6055280

34 files changed

+52
-52
lines changed

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ print(f"Transaction ID: {record.transaction_id}")
924924
print(f"Transaction Fee: {record.transaction_fee}")
925925
print(f"Transaction Hash: {record.transaction_hash}")
926926
print(f"Transaction Memo: {record.transaction_memo}")
927-
print(f"Transaction Account ID: {record.receipt.accountId}")
927+
print(f"Transaction Account ID: {record.receipt.account_id}")
928928
```
929929
#### Method Chaining:
930930
```
@@ -938,5 +938,5 @@ print(f"Transaction ID: {record.transaction_id}")
938938
print(f"Transaction Fee: {record.transaction_fee}")
939939
print(f"Transaction Hash: {record.transaction_hash}")
940940
print(f"Transaction Memo: {record.transaction_memo}")
941-
print(f"Transaction Account ID: {record.receipt.accountId}")
941+
print(f"Transaction Account ID: {record.receipt.account_id}")
942942
```

examples/account_create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def create_new_account():
4242
status_message = ResponseCode(receipt.status).name
4343
raise Exception(f"Transaction failed with status: {status_message}")
4444

45-
new_account_id = receipt.accountId
45+
new_account_id = receipt.account_id
4646
if new_account_id is not None:
4747
print(f"Account creation successful. New Account ID: {new_account_id}")
4848
print(f"New Account Private Key: {new_account_private_key.to_string()}")

examples/logging_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def show_logging_workflow():
6060

6161
try:
6262
receipt = transaction.execute(client)
63-
print(f"Account creation with client trace level logging successful. Account ID: {receipt.accountId}")
63+
print(f"Account creation with client trace level logging successful. Account ID: {receipt.account_id}")
6464
except Exception as e:
6565
print(f"Account creation failed: {str(e)}")
6666

@@ -78,7 +78,7 @@ def show_logging_workflow():
7878

7979
try:
8080
receipt = transaction.execute(client)
81-
print(f"Account creation with disabled logging successful. Account ID: {receipt.accountId}")
81+
print(f"Account creation with disabled logging successful. Account ID: {receipt.account_id}")
8282
except Exception as e:
8383
print(f"Account creation failed: {str(e)}")
8484

examples/query_account_info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def create_test_account(client, operator_key):
5252
print(f"Account creation failed with status: {ResponseCode(receipt.status).name}")
5353
sys.exit(1)
5454

55-
new_account_id = receipt.accountId
55+
new_account_id = receipt.account_id
5656
print(f"\nTest account created with ID: {new_account_id}")
5757

5858
return new_account_id, new_account_private_key
@@ -79,7 +79,7 @@ def create_fungible_token(client, operator_id, operator_key):
7979
print(f"Token creation failed with status: {ResponseCode(receipt.status).name}")
8080
sys.exit(1)
8181

82-
token_id = receipt.tokenId
82+
token_id = receipt.token_id
8383
print(f"\nFungible token created with ID: {token_id}")
8484

8585
return token_id
@@ -110,7 +110,7 @@ def create_nft(client, account_id, account_private_key):
110110
sys.exit(1)
111111

112112
# Get token ID from receipt
113-
nft_token_id = receipt.tokenId
113+
nft_token_id = receipt.token_id
114114
print(f"\nNFT created with ID: {nft_token_id}")
115115

116116
return nft_token_id

examples/query_balance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def create_account_and_transfer():
3535
).freeze_with(client)
3636
transaction.sign(operator_key)
3737
receipt = transaction.execute(client)
38-
new_account_id = receipt.accountId
38+
new_account_id = receipt.account_id
3939

4040
# Check balance
4141
balance_query = CryptoGetAccountBalanceQuery().set_account_id(new_account_id)

examples/query_nft_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def create_nft(client, operator_id, operator_key):
5555
sys.exit(1)
5656

5757
# Get token ID from receipt
58-
nft_token_id = receipt.tokenId
58+
nft_token_id = receipt.token_id
5959
print(f"NFT created with ID: {nft_token_id}")
6060

6161
return nft_token_id

examples/query_record.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def create_account_transaction(client):
5252
sys.exit(1)
5353

5454
# Get the new account ID and transaction ID from receipt
55-
new_account_id = receipt.accountId
55+
new_account_id = receipt.account_id
5656
transaction_id = receipt.transaction_id
5757

5858
print(f"Account created with ID: {new_account_id}")
@@ -80,7 +80,7 @@ def create_fungible_token(client: 'Client', account_id, account_private_key):
8080
print(f"Fungible token creation failed with status: {ResponseCode(receipt.status).name}")
8181
sys.exit(1)
8282

83-
token_id = receipt.tokenId
83+
token_id = receipt.token_id
8484
print(f"\nFungible token created with ID: {token_id}")
8585

8686
return token_id
@@ -130,7 +130,7 @@ def print_transaction_record(record):
130130
print(f"Transaction Fee: {record.transaction_fee}")
131131
print(f"Transaction Hash: {record.transaction_hash.hex()}")
132132
print(f"Transaction Memo: {record.transaction_memo}")
133-
print(f"Transaction Account ID: {record.receipt.accountId}")
133+
print(f"Transaction Account ID: {record.receipt.account_id}")
134134

135135
print(f"\nTransfers made in the transaction:")
136136
for account_id, amount in record.transfers.items():

examples/query_token_info_fungible.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def create_fungible_token(client, operator_id, operator_key):
5252
sys.exit(1)
5353

5454
# Get token ID from receipt
55-
token_id = receipt.tokenId
55+
token_id = receipt.token_id
5656
print(f"Fungible token created with ID: {token_id}")
5757

5858
return token_id

examples/query_token_info_nft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def create_nft(client, operator_id, operator_key):
5252
sys.exit(1)
5353

5454
# Get token ID from receipt
55-
nft_token_id = receipt.tokenId
55+
nft_token_id = receipt.token_id
5656
print(f"NFT created with ID: {nft_token_id}")
5757

5858
return nft_token_id

examples/token_associate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def create_and_associate_token():
5050
.set_initial_balance(Hbar.from_tinybars(100_000_000)) # 1 Hbar
5151
)
5252
receipt = tx.execute(client)
53-
recipient_id = receipt.accountId
53+
recipient_id = receipt.account_id
5454
print(f"✅ Success! Created new account with ID: {recipient_id}")
5555
except Exception as e:
5656
print(f"❌ Error creating new account: {e}")
@@ -69,7 +69,7 @@ def create_and_associate_token():
6969
.set_treasury_account_id(operator_id)
7070
)
7171
receipt = tx.execute(client)
72-
token_id = receipt.tokenId
72+
token_id = receipt.token_id
7373
print(f"✅ Success! Created token with ID: {token_id}")
7474
except Exception as e:
7575
print(f"❌ Error creating token: {e}")

0 commit comments

Comments
 (0)