Update tutorial nav

This commit is contained in:
ddawson
2024-02-29 14:17:51 -08:00
committed by Amarantha Kulkarni
parent 05c0191e5a
commit f0c5b6141a
120 changed files with 3169 additions and 532 deletions

View File

@@ -3,9 +3,17 @@ from xrpl.clients import JsonRpcClient
from xrpl.wallet import Wallet
from datetime import datetime
from xrpl.models.transactions import EscrowCreate, EscrowFinish
from os import urandom
from cryptoconditions import PreimageSha256
testnet_url = "https://s.altnet.rippletest.net:51234"
def generate_condition():
randy = urandom(32)
fulfillment = PreimageSha256(preimage=randy)
return (fulfillment.condition_binary.hex().upper(),
fulfillment.serialize_binary().hex().upper())
def add_seconds(numOfSeconds):
new_date = datetime.now()
if new_date != '':
@@ -18,6 +26,7 @@ def create_conditional_escrow(seed, amount, destination, cancel, condition):
wallet=Wallet.from_seed(seed)
client=JsonRpcClient(testnet_url)
cancel_date = add_seconds(cancel)
finish_date = cancel_date - 200
escrow_tx=xrpl.models.transactions.EscrowCreate(
account=wallet.address,