Python SDK for FKWallet API
Project description
fkwallet-sdk
Async Python SDK for the FKWallet API.
Features
- ✅ Fully async (
httpx+async/await) - ✅ Pydantic v2 models with full type hints
- ✅ SHA-256 request signing (GET & POST)
- ✅ Webhook signature verification
- ✅ Custom exceptions
- ✅ Typed status enums with helper properties
Installation
pip install fkwallet-sdk
Or with Poetry:
poetry add fkwallet-sdk
Quick Start
import asyncio
from fkwallet import FKWalletClient
async def main():
async with FKWalletClient(
public_key="YOUR_PUBLIC_KEY",
private_key="YOUR_PRIVATE_KEY",
) as client:
balance = await client.get_balance()
print(f"Balance: {balance.value} {balance.currency_code}")
asyncio.run(main())
API Reference
FKWalletClient
All methods are async and must be used inside an async with block.
| Method | Description |
|---|---|
get_balance() |
Current wallet balance |
get_history(date_from, date_to, page, limit) |
Transaction history |
get_currencies() |
List supported currencies |
get_payment_systems() |
List payment systems |
get_sbp_list() |
List SBP banks |
get_mobile_carrier_list() |
List mobile carriers |
create_withdrawal(request) |
Create withdrawal order |
get_withdrawal_status(order_id, type) |
Get withdrawal status |
create_transfer(request) |
Transfer to another wallet |
get_transfer(id) |
Get transfer status |
get_op_categories() |
Online product categories |
get_op_products(category_id) |
Products in a category |
create_op_order(request) |
Purchase online product |
get_op_status(order_id) |
Online product order status |
Webhook Verification
from fkwallet.webhook import verify_webhook
# In your web framework:
form_data = dict(await request.form())
verify_webhook(form_data, private_key="YOUR_PRIVATE_KEY")
# Raises FKWalletWebhookError on invalid signature
Status Enums
from fkwallet import WithdrawalStatus
status = WithdrawalStatus(2)
status.is_processing # True
status.is_terminal # False
status.is_error # False
Error Handling
from fkwallet import FKWalletAPIError
try:
result = await client.create_withdrawal(...)
except FKWalletAPIError as e:
print(e.message, e.status_code, e.raw)
Development
poetry install
poetry run pytest tests/ -v
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fkwallet_sdk-0.1.0.tar.gz.
File metadata
- Download URL: fkwallet_sdk-0.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0f6176f7871d043865d78758690269b5b912919444fd8b085e21d5809b2f072
|
|
| MD5 |
f4d3cbece1e5ae6588fd7b1ca4be1a9a
|
|
| BLAKE2b-256 |
dacc9d042ed7ac009ef07f5ef3cb0b1030be63c0f860ee32366cc0e7faabd903
|
Provenance
The following attestation bundles were made for fkwallet_sdk-0.1.0.tar.gz:
Publisher:
upload.yml on forestsnet/fkwallet-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fkwallet_sdk-0.1.0.tar.gz -
Subject digest:
f0f6176f7871d043865d78758690269b5b912919444fd8b085e21d5809b2f072 - Sigstore transparency entry: 1146477897
- Sigstore integration time:
-
Permalink:
forestsnet/fkwallet-sdk@ddb8def8426ce4bfcbea2d22ff37693a3df2ea75 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/forestsnet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload.yml@ddb8def8426ce4bfcbea2d22ff37693a3df2ea75 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fkwallet_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fkwallet_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09605cb097c234c6c272b245be7c5373f52ba9a5dd12a49d4334281d370bd9b8
|
|
| MD5 |
97b64bdac9d9752e0206344a523d3058
|
|
| BLAKE2b-256 |
36525d342c56a90872d050816731c5c3e8e49eeee4df64a128a9f46bd05f4e15
|
Provenance
The following attestation bundles were made for fkwallet_sdk-0.1.0-py3-none-any.whl:
Publisher:
upload.yml on forestsnet/fkwallet-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fkwallet_sdk-0.1.0-py3-none-any.whl -
Subject digest:
09605cb097c234c6c272b245be7c5373f52ba9a5dd12a49d4334281d370bd9b8 - Sigstore transparency entry: 1146477945
- Sigstore integration time:
-
Permalink:
forestsnet/fkwallet-sdk@ddb8def8426ce4bfcbea2d22ff37693a3df2ea75 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/forestsnet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload.yml@ddb8def8426ce4bfcbea2d22ff37693a3df2ea75 -
Trigger Event:
push
-
Statement type: