Liquidswap Python SDK
Project description
liquidswap-sdk-python
Install
https://pypi.org/project/liquidswap-sdk/
pip install liquidswap-sdk
Functions
import
from liquidswap_sdk.client import LiquidSwapClient
new a client
liquidswap_client = LiquidSwapClient(node_url, tokens_mapping, wallet_path)
get the output amount from given input amount
liquidswap_client.calculate_rates("APTOS", "USDT", 1)
swap token
liquidswap_client.swap("APTOS", "USDT", 1, usdt_out)
get token balance
liquidswap_client.get_token_balance("APTOS")
register token
liquidswap_client.register("USDT")
How to use
-
create your config
-
add token addresses you want to trade to
tokens_mapping
-
make sure there is some APT in your wallet of
wallet_path
-
make yout own script! (check: example)
-
if you are ready to
mainnt
, change thenode_url
tohttps://fullnode.mainnet.aptoslabs.com/v1
WIP:
- convert_to_decimals
- calculate_rates
- swap
- create pypl package
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
Hashes for liquidswap_sdk-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61eb5aabb9a14898d8f313a062a0d193d84c41e35262420a8f3d865b5dcc77d9 |
|
MD5 | 6c15654f3f935a5324f7fe4938eccf3a |
|
BLAKE2b-256 | a42ac12b972c0193336cde248d2a8c17446d3bdbc878f5a92ce6ebd977fe0865 |