Skip to content

Python Client Quickstart

The Python client is under python/postfiat_rpc.

Use From The Repo

PYTHONPATH=python python -m postfiat_rpc --endpoint 127.0.0.1:27650 --method status
PYTHONPATH=python python -m postfiat_rpc --endpoint 127.0.0.1:27650 --method ledger
PYTHONPATH=python python -m postfiat_rpc --endpoint 127.0.0.1:27650 --method fee

Account History

PYTHONPATH=python python -m postfiat_rpc \
  --endpoint 127.0.0.1:27650 \
  --method account_tx_history \
  --address <address> \
  --to-height 100 \
  --window-size 100

Wallet Functions

The canonical Python wallet helpers are exported from postfiat_rpc. For TrustSet, issued-token, escrow, NFT, offer, and atomic-swap examples, see XRP-Style Python Transactions. For smaller snippets, see Python Examples.

from postfiat_rpc import (
    PostFiatRpcClient,
    create_wallet,
    request_faucet_pft,
    send_pft,
)

client = PostFiatRpcClient("127.0.0.1:27650")
wallet = create_wallet(chain_id="postfiat-local", wallet_dir="wallets")  # the chain id of scripts/devnet-up

request_faucet_pft(
    data_dir="devnet/local/validator-0",
    to_address=wallet.address,
    amount=1_000,
)

result = send_pft(
    client,
    wallet=wallet,
    to_address="pfrecipient...",
    amount=100,
)
print(result.tx_id)

Smoke Evidence

The smoke reports (testnet-live-python-rpc-client-smoke, testnet-python-rpc-client-smoke, testnet-six-wallet-account-tx-smoke, testnet-python-wallet-functions-smoke) were archived outside the repository with the other generated reports (reports/README.md). The client's tests are in python/tests/.