Skip to content

Commit 242f208

Browse files
committed
add python
1 parent 6a99945 commit 242f208

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

python/generate.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from xrpl.clients import JsonRpcClient
2+
from xrpl.wallet import generate_faucet_wallet
3+
4+
def create_test_wallet():
5+
"""
6+
Creates and funds a new test wallet on XRPL testnet
7+
"""
8+
# Define the network client
9+
client = JsonRpcClient("https://s.altnet.rippletest.net:51234")
10+
11+
# Create a test wallet with test XRP
12+
test_wallet = generate_faucet_wallet(client)
13+
14+
# Print wallet details
15+
print("\n=== XRPL Test Wallet Details ===")
16+
print(f"Public Key: {test_wallet.public_key}")
17+
print(f"Private Key: {test_wallet.private_key}")
18+
print(f"Classic Address: {test_wallet.classic_address}")
19+
print(f"Seed: {test_wallet.seed}")
20+
print("==============================\n")
21+
22+
return test_wallet
23+
24+
if __name__ == "__main__":
25+
print("Creating and funding a test wallet...")
26+
test_wallet = create_test_wallet()
27+
print("Done!")

0 commit comments

Comments
 (0)