Skip to main content

Multi-currency agent wallet with Stripe on-ramp for Kestrel Sovereign

Project description

kestrel-feature-wallet

Multi-currency agent wallet with Stripe on-ramp for Kestrel Sovereign. Supports FIL, USDC, and USDT with on-chain balance sync, economic gates, cryostasis threshold monitoring, and fiat-to-crypto conversions via Stripe.

Installation

uv pip install kestrel-feature-wallet

With EVM chain support:

uv pip install "kestrel-feature-wallet[evm]"

With Stripe on-ramp:

uv pip install "kestrel-feature-wallet[stripe]"

With x402 buyer support:

uv pip install "kestrel-feature-wallet[x402]"

For local tests:

uv pip install -e ".[all]"
uv run pytest

Dependencies

  • kestrel-sovereign-sdk
  • aiosqlite>=0.21.0
  • httpx>=0.27.0
  • cryptography>=45.0.5
  • Optional: web3>=7.0.0 (via [evm]), stripe>=10.0.0 (via [stripe]), x402[httpx]>=2.9.0 (via [x402])

Usage

Once installed, the WalletFeature is automatically discovered by kestrel-sovereign via the kestrel_sovereign.features entry point.

Configuration

Variable Description
KESTREL_DATA_KEY Enables encrypted private-key persistence for generated wallet keys
KESTREL_DB_PATH Base directory for wallet key and audit storage when no agent DB path is available
BASE_SEPOLIA_RPC Optional Base Sepolia RPC override; defaults to https://sepolia.base.org
BASE_MAINNET_RPC Optional Base Mainnet RPC override; defaults to https://mainnet.base.org
KESTREL_ALLOW_MAINNET Set to true or 1 only when the operator intentionally enables real-value mainnet transactions
KESTREL_X402_MAX_USDC_PER_REQUEST Maximum x402 USDC invoice the buyer will sign; defaults to 1
KESTREL_TX_DAILY_LIMIT_USD Daily mainnet spending limit; defaults to 100
STRIPE_API_KEY Stripe API key (for on-ramp)
STRIPE_WEBHOOK_SECRET Stripe webhook secret (for on-ramp)

Base L2 Commands

The Filecoin address and Base/EVM address are derived from the same secp256k1 key generated by !wallet-generate-address.

!wallet-address
!wallet-chain-balance base_sepolia USDC
!wallet-chain-balance base_sepolia native
!wallet-send-token <to> <amount> USDC base_sepolia

Base Mainnet (base_mainnet) is blocked unless KESTREL_ALLOW_MAINNET is explicitly enabled.

For direct ERC-20 transfers, the wallet needs Base Sepolia ETH for gas and Base Sepolia USDC for payments. For x402 exact payments through the default testnet facilitator, Base Sepolia USDC can be enough because settlement can be gas-sponsored by the facilitator. Filecoin Calibration FIL is a different testnet asset and cannot pay Base Sepolia x402 invoices. Current faucet references:

x402 Buyer

X402Buyer wraps the Python x402 SDK with the agent's EVM private key and returns payment receipt metadata for audit trails. It defaults to Base Sepolia and filters out Base Mainnet payment requirements unless KESTREL_ALLOW_MAINNET is explicitly enabled.

from kestrel_feature_wallet import X402Buyer

buyer = X402Buyer(private_key="0x...")
paid = await buyer.post_with_payment("https://example.com/paid-upload", content=b"...")
print(paid.response.status_code)
print(paid.receipt)

Core storage integrations should use this buyer primitive instead of handling private keys directly.

Development

uv pip install -e ".[test]"
uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kestrel_feature_wallet-0.1.2.tar.gz (72.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kestrel_feature_wallet-0.1.2-py3-none-any.whl (73.8 kB view details)

Uploaded Python 3

File details

Details for the file kestrel_feature_wallet-0.1.2.tar.gz.

File metadata

  • Download URL: kestrel_feature_wallet-0.1.2.tar.gz
  • Upload date:
  • Size: 72.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kestrel_feature_wallet-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4b8ff116e6ed8b57392b90973cea704276f49d8f04c785a1f3cf9ee67a9eb953
MD5 289fb12c8cf8a54f9e2631acc524aaca
BLAKE2b-256 cc554060d0ac40bb21671df662fe34a2e23e47e2545e9acb8a83d62221f1b4b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for kestrel_feature_wallet-0.1.2.tar.gz:

Publisher: publish.yml on KestrelSovereignAI/kestrel-feature-wallet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kestrel_feature_wallet-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for kestrel_feature_wallet-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc2a8072396fba960d766ef5be0fc5015959197d83887f43ec386fbd69654db
MD5 fc982594c5656d187f44fc1e0cd69f2e
BLAKE2b-256 3e00ca8e72a040127ff44d1d1b1d9d0e567d7a5aa7aef17f5db868af9073655e

See more details on using hashes here.

Provenance

The following attestation bundles were made for kestrel_feature_wallet-0.1.2-py3-none-any.whl:

Publisher: publish.yml on KestrelSovereignAI/kestrel-feature-wallet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page