forked from hyperliquid-dex/hyperliquid-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_send_asset.py
More file actions
24 lines (16 loc) · 760 Bytes
/
basic_send_asset.py
File metadata and controls
24 lines (16 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import example_utils
from hyperliquid.utils import constants
SOURCE_DEX = ""
DESTINATION_DEX = "test"
def main():
address, info, exchange = example_utils.setup(constants.TESTNET_API_URL, skip_ws=True)
if exchange.account_address != exchange.wallet.address:
raise Exception("Agents do not have permission to perform internal transfers")
# Transfer 1.23 USDC from SOURCE_DEX to the zero address on DESTINATION_DEX for demonstration purposes
# Note that the collateral token for SOURCE_DEX and DESTINATION_DEX must match
transfer_result = exchange.send_asset(
"0x0000000000000000000000000000000000000000", SOURCE_DEX, DESTINATION_DEX, "USDC", 1.23
)
print(transfer_result)
if __name__ == "__main__":
main()