From 0929d57cc8f491a1eb86ce50083443071f68acea Mon Sep 17 00:00:00 2001 From: Obiajulu <47371105+ObiajuluM@users.noreply.github.com> Date: Tue, 6 Sep 2022 21:17:24 -0700 Subject: [PATCH] Update create_escrow.py --- content/_code-samples/escrow/py/create_escrow.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/content/_code-samples/escrow/py/create_escrow.py b/content/_code-samples/escrow/py/create_escrow.py index c0fd8c9f64..ba1524d3d2 100644 --- a/content/_code-samples/escrow/py/create_escrow.py +++ b/content/_code-samples/escrow/py/create_escrow.py @@ -1,7 +1,10 @@ from xrpl.wallet import Wallet, generate_faucet_wallet +from xrpl.clients import JsonRpcClient +from datetime import datetime, timedelta from xrpl.utils import xrp_to_drops from xrpl.transaction import (safe_sign_and_autofill_transaction, send_reliable_submission) +from xrpl.utils import datetime_to_ripple_time from xrpl.models import EscrowCreate # Create Escrow @@ -12,12 +15,15 @@ amount = 10.000 # amount to escrow receiver_addr = "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe" # Example: send back to Testnet Faucet -claim_date = int # date when and after ecsrow can be claimed `xrpl.utils.datetime_to_ripple_time()` +# make claimable escrow after 3 days +claim_date = datetime_to_ripple_time(datetime.now() + timedelta(days=3)) -expiry_date = int # date when and after escrow expires `xrpl.utils.datetime_to_ripple_time()` +# escrow will expire after 5 days +expiry_date = datetime_to_ripple_time(datetime.now() + timedelta(days=5)) # optional field -condition = str # cryptic condition that must be met before escrow can be completed | see.... +# cryptic condition that must be met before escrow can be completed | see.... +condition = "A02580205A0E9E4018BE1A6E0F51D39B483122EFDF1DDEF3A4BE83BE71522F9E8CDAB179810120" # do not use in production # generate sender wallet with seed