Official Python SDK for the 01credit platform
Project description
credit01 — 01credit Python SDK
Official Python SDK for 01credit.
Install
pip install credit01
Quickstart
from credit01 import CreditClient
client = CreditClient(api_key="01l_live_xxx")
config = client.get_config()
decision = client.check(action="swap", amountUSD=250, venue="Uniswap V3")
if decision["result"] == "REVIEW":
resolution = client.wait_for_approval(decision["checkId"])
if resolution != "approved":
raise SystemExit("Operator denied the action")
Credit Flow
approval = client.request_credit(amount=30, chain_id=11155111)
if approval["approved"]:
draw = client.draw_credit(amount=30, chain_id=approval["chainId"])
outstanding = client.get_outstanding(draw["loanId"])
client.repay_credit(draw["loanId"], "0xrepay...")
Methods
get_config()is_kill_switch_active()set_status(status)update_metrics(**kwargs)report_transaction(**kwargs)log(level, message, **kwargs)log_batch(entries)request_credit(amount, chain_id=None)draw_credit(amount, chain_id=None)get_outstanding(loan_id)repay_credit(loan_id, tx_hash)check(**context)resolve(log_id, resolved_by)get_approval_status(check_id)wait_for_approval(check_id, timeout=300, interval=5)
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
credit01-0.1.1.tar.gz
(3.5 kB
view details)
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 credit01-0.1.1.tar.gz.
File metadata
- Download URL: credit01-0.1.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
665c53885c3170ec067ff96e330622bc008e4f242ec21fa5e9137a65b54e0578
|
|
| MD5 |
f7be2c2d7f22cdb51df3d497d2b98a3e
|
|
| BLAKE2b-256 |
dddf5ad47f7f8bf7fdd28a1b3a89a552b73658d9bef5e3d5c47779c365fd7bf7
|
File details
Details for the file credit01-0.1.1-py3-none-any.whl.
File metadata
- Download URL: credit01-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b91f6382312cc1823245fbfe3be80a98ef1e177059ebb451284fdf2e9f0ecb13
|
|
| MD5 |
400bf7730f09fc2dce923496f50e7f4e
|
|
| BLAKE2b-256 |
e0ee4138612e83a8d5494ed99c74676822e0b4a69f512bb91243ec75c7c71f40
|