diff --git a/content/_code-samples/checks/py/cash_check.py b/content/_code-samples/checks/py/cash_check.py index 5356b06d10..d432dc8fe2 100644 --- a/content/_code-samples/checks/py/cash_check.py +++ b/content/_code-samples/checks/py/cash_check.py @@ -1,7 +1,7 @@ from xrpl.clients import JsonRpcClient from xrpl.models import CheckCash, IssuedCurrencyAmount from xrpl.transaction import submit_and_wait -from xrpl.utils import str_to_hex, xrp_to_drops +from xrpl.utils import xrp_to_drops from xrpl.wallet import generate_faucet_wallet # Connect to a network @@ -53,7 +53,7 @@ sender_wallet = generate_faucet_wallet(client=client) # Build check cash transaction check_txn = CheckCash(account=sender_wallet.address, check_id=check_id, amount=IssuedCurrencyAmount( - currency=str_to_hex(token), + currency=token, issuer=issuer, value=amount)) diff --git a/content/_code-samples/checks/py/create_check.py b/content/_code-samples/checks/py/create_check.py index 4e17a191ae..cf696df05d 100644 --- a/content/_code-samples/checks/py/create_check.py +++ b/content/_code-samples/checks/py/create_check.py @@ -3,7 +3,7 @@ from datetime import datetime, timedelta from xrpl.clients import JsonRpcClient from xrpl.models import CheckCreate, IssuedCurrencyAmount from xrpl.transaction import submit_and_wait -from xrpl.utils import datetime_to_ripple_time, str_to_hex, xrp_to_drops +from xrpl.utils import datetime_to_ripple_time, xrp_to_drops from xrpl.wallet import generate_faucet_wallet client = JsonRpcClient("https://s.altnet.rippletest.net:51234") # Connect to the testnetwork @@ -25,12 +25,12 @@ expiry_date = datetime_to_ripple_time(datetime.now() + timedelta(days=5)) sender_wallet = generate_faucet_wallet(client=client) # Build check create transaction -check_txn = CheckCreate(account=sender_wallet.address, destination=receiver_addr, -send_max=IssuedCurrencyAmount( - currency=str_to_hex(token), - issuer=issuer, - value=amount), - expiration=expiry_date) +check_txn = CheckCreate(account=sender_wallet.address, destination=check_receiver_addr, + send_max=IssuedCurrencyAmount( + currency=token_name, + issuer=token_issuer, + value=amount_to_deliver), + expiration=expiry_date) # Autofill, sign, then submit transaction and wait for result stxn_response = submit_and_wait(check_txn, client, sender_wallet) @@ -60,9 +60,9 @@ sender_wallet = generate_faucet_wallet(client=client) # Build check create transaction check_txn = CheckCreate(account=sender_wallet.address, - destination=receiver_addr, - send_max=xrp_to_drops(amount), - expiration=expiry_date) + destination=check_receiver_addr, + send_max=xrp_to_drops(amount_to_deliver), + expiration=expiry_date) # Autofill, sign, then submit transaction and wait for result stxn_response = submit_and_wait(check_txn, client, sender_wallet)