Skip to main content

A Python client for OKX OS APIs

Project description

okxos

okxos 是一个基于 OKX OS API 的 Python 异步客户端库,使用 httpx 实现 HTTP 请求封装,支持 Wallet API、DEX API、Marketplace API 和 DeFi API 的功能,旨在为开发者提供简便快捷的 Web3 应用开发解决方案。

功能特性

  • Wallet API: 支持链查询、实时币价、代币转账等功能。
  • DEX API: 支持链信息查询、交易聚合等功能。
  • Marketplace API: 提供 NFT 市场功能(未来支持)。
  • DeFi API: 查询协议列表、投资产品信息等。

安装

pip install okxos

快速开始

from okxos import OKXClient, WalletAPI, DEXAPI, MarketplaceAPI, DeFiAPI

# 初始化客户端
client = OKXClient(
    api_key="your_api_key",
    secret_key="your_secret_key",
    passphrase="your_passphrase",
    project_id="your_project_id",
)

# 初始化 WalletAPI
wallet_api = WalletAPI(client)
# 调用 WalletAPI 获取支持的链列表
result = wallet_api.get_supported_chains()

# 初始化 DEXAPI
dex_api = DEXAPI(client)
# 调用 DEXAPI 获取指定链上的所有币种列表
result = dex_api.get_all_tokens(chain_id="1")

# 初始化 MarketplaceAPI
marketplace_api = MarketplaceAPI(client)
# 调用 MarketplaceAPI 获取合集信息
result = marketplace_api.get_collection_info(runes_id="1")

# 初始化 DeFiAPI
defi_api = DeFiAPI(client)
# 调用 DeFiAPI 获取支持的协议列表
result = defi_api.get_protocol_list()

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

okxos-0.1.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

okxos-0.1.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file okxos-0.1.3.tar.gz.

File metadata

  • Download URL: okxos-0.1.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for okxos-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c09e48922e6a8ea4f610703b03764cbd18f251aaf0e85aa676eae3e244678415
MD5 efdd129e2fb7cf776c557c708e5084f6
BLAKE2b-256 fe6671d27e4a282c4609ca6ca5e2ade46a782ae36cb1ca8baedddd97fa23f0b1

See more details on using hashes here.

File details

Details for the file okxos-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: okxos-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for okxos-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 af9a38fe803b06a18e45f155cc2d8e0da143f45e1454e33c4f0f0da4ffea8017
MD5 c6098a300ef19eee35fa3af9e613435d
BLAKE2b-256 a4ffd8c38bfb1fa8133191a336142dbb7c5f41869d3c5f0ee1701ed9d86ee5dd

See more details on using hashes here.

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