diff --git a/apps/hip-3-pusher/src/scripts/claim_testnet_drip.py b/apps/hip-3-pusher/src/scripts/claim_testnet_drip.py new file mode 100644 index 0000000000..929416bcc1 --- /dev/null +++ b/apps/hip-3-pusher/src/scripts/claim_testnet_drip.py @@ -0,0 +1,43 @@ +import argparse +from pathlib import Path + +import httpx +from eth_account import Account +from hyperliquid.utils import constants + + +def main() -> None: + parser = argparse.ArgumentParser( + description="Claim testnet USDC drip (1000 USDC, once per address)" + ) + source = parser.add_mutually_exclusive_group(required=True) + source.add_argument( + "--private-key-file", + help="Path to private key file (address will be derived)", + ) + source.add_argument( + "--address", + help="Wallet address to claim drip for", + ) + + args = parser.parse_args() + + if args.private_key_file: + account = Account.from_key(Path(args.private_key_file).read_text().strip()) + address = account.address + else: + address = args.address + + print(f"Claiming testnet drip for: {address}") + print(f"Using testnet URL: {constants.TESTNET_API_URL}") + + response = httpx.post( + f"{constants.TESTNET_API_URL}/info", + json={"type": "claimDrip", "user": address}, + ) + response.raise_for_status() + print(f"Response: {response.text}") + + +if __name__ == "__main__": + main() diff --git a/apps/hip-3-pusher/src/scripts/get_balances.py b/apps/hip-3-pusher/src/scripts/get_balances.py index db65a7481b..af76d458b8 100644 --- a/apps/hip-3-pusher/src/scripts/get_balances.py +++ b/apps/hip-3-pusher/src/scripts/get_balances.py @@ -2,6 +2,7 @@ from hyperliquid.info import Info from hyperliquid.utils import constants +from hyperliquid.utils.types import Meta, SpotMeta def main() -> None: @@ -30,7 +31,12 @@ def main() -> None: print(f"Using {network_name} URL: {base_url}") print("address:", args.address) - info = Info(base_url=base_url, skip_ws=True) + info = Info( + base_url=base_url, + skip_ws=True, + meta=Meta(universe=[]), + spot_meta=SpotMeta(universe=[], tokens=[]), + ) print("calling clearinghouseState...") print(info.user_state(args.address)) print("calling spotClearinghouseState...") diff --git a/apps/hip-3-pusher/src/scripts/get_user_limit.py b/apps/hip-3-pusher/src/scripts/get_user_limit.py index 003f2bc61c..657cb10420 100644 --- a/apps/hip-3-pusher/src/scripts/get_user_limit.py +++ b/apps/hip-3-pusher/src/scripts/get_user_limit.py @@ -2,6 +2,7 @@ from hyperliquid.info import Info from hyperliquid.utils import constants +from hyperliquid.utils.types import Meta, SpotMeta def main() -> None: @@ -30,7 +31,12 @@ def main() -> None: print(f"Using {network_name} URL: {base_url}") print("address:", args.address) - info = Info(base_url=base_url, skip_ws=True) + info = Info( + base_url=base_url, + skip_ws=True, + meta=Meta(universe=[]), + spot_meta=SpotMeta(universe=[], tokens=[]), + ) print("calling userRateLimit...") print(info.user_rate_limit(args.address)) diff --git a/apps/hip-3-pusher/src/scripts/reserve.py b/apps/hip-3-pusher/src/scripts/reserve.py index 97c998e3ed..a40fa0358f 100644 --- a/apps/hip-3-pusher/src/scripts/reserve.py +++ b/apps/hip-3-pusher/src/scripts/reserve.py @@ -7,6 +7,7 @@ from hyperliquid.utils import constants from hyperliquid.utils.constants import MAINNET_API_URL from hyperliquid.utils.signing import get_timestamp_ms, sign_l1_action +from hyperliquid.utils.types import Meta, SpotMeta def reserve_request_weight(exchange: Exchange, weight: int) -> dict[str, Any]: @@ -69,7 +70,12 @@ def main() -> None: print(f"Using {network_name} URL: {base_url}") account = Account.from_key(Path(args.private_key_file).read_text().strip()) - exchange = Exchange(wallet=account, base_url=base_url) + exchange = Exchange( + wallet=account, + base_url=base_url, + meta=Meta(universe=[]), + spot_meta=SpotMeta(universe=[], tokens=[]), + ) print("address:", account.address) print("weight:", args.weight) diff --git a/apps/hip-3-pusher/src/scripts/send.py b/apps/hip-3-pusher/src/scripts/send.py index 0fd0b02069..4626712522 100644 --- a/apps/hip-3-pusher/src/scripts/send.py +++ b/apps/hip-3-pusher/src/scripts/send.py @@ -4,6 +4,7 @@ from eth_account import Account from hyperliquid.exchange import Exchange from hyperliquid.utils import constants +from hyperliquid.utils.types import Meta, SpotMeta def main() -> None: @@ -50,7 +51,12 @@ def main() -> None: print(f"Using {network_name} URL: {base_url}") sender_account = Account.from_key(Path(args.private_key_file).read_text().strip()) - sender_exchange = Exchange(wallet=sender_account, base_url=base_url) + sender_exchange = Exchange( + wallet=sender_account, + base_url=base_url, + meta=Meta(universe=[]), + spot_meta=SpotMeta(universe=[], tokens=[]), + ) print("sender address:", sender_account.address) print("recipient address:", args.recipient_address) print("amount:", args.amount) diff --git a/apps/hip-3-pusher/src/scripts/setoracle_subdeployer.py b/apps/hip-3-pusher/src/scripts/setoracle_subdeployer.py index c8c124110e..63f483afea 100644 --- a/apps/hip-3-pusher/src/scripts/setoracle_subdeployer.py +++ b/apps/hip-3-pusher/src/scripts/setoracle_subdeployer.py @@ -5,6 +5,7 @@ from hyperliquid.exchange import Exchange from hyperliquid.utils import constants from hyperliquid.utils.signing import get_timestamp_ms, sign_l1_action +from hyperliquid.utils.types import Meta, SpotMeta def main() -> None: @@ -59,7 +60,12 @@ def main() -> None: print(f"Using {network_name} URL: {base_url}") deployer_account = Account.from_key(Path(args.private_key_file).read_text().strip()) - deployer_exchange = Exchange(wallet=deployer_account, base_url=base_url) + deployer_exchange = Exchange( + wallet=deployer_account, + base_url=base_url, + meta=Meta(universe=[]), + spot_meta=SpotMeta(universe=[], tokens=[]), + ) print("deployer address:", deployer_account.address) print("dex:", args.dex) print("subdeployer address:", args.subdeployer_address) diff --git a/apps/hip-3-pusher/src/scripts/usd_class_transfer.py b/apps/hip-3-pusher/src/scripts/usd_class_transfer.py index 8da52a12f0..90da636a79 100644 --- a/apps/hip-3-pusher/src/scripts/usd_class_transfer.py +++ b/apps/hip-3-pusher/src/scripts/usd_class_transfer.py @@ -4,6 +4,7 @@ from eth_account import Account from hyperliquid.exchange import Exchange from hyperliquid.utils import constants +from hyperliquid.utils.types import Meta, SpotMeta def main() -> None: @@ -51,7 +52,12 @@ def main() -> None: print(f"Using {network_name} URL: {base_url}") account = Account.from_key(Path(args.private_key_file).read_text().strip()) - exchange = Exchange(wallet=account, base_url=base_url) + exchange = Exchange( + wallet=account, + base_url=base_url, + meta=Meta(universe=[]), + spot_meta=SpotMeta(universe=[], tokens=[]), + ) print("address:", account.address) print("amount:", args.amount) print("to_perp:", args.to_perp) diff --git a/apps/hip-3-pusher/src/scripts/user_set_abstraction.py b/apps/hip-3-pusher/src/scripts/user_set_abstraction.py index f1a5598ff3..cbccb16613 100644 --- a/apps/hip-3-pusher/src/scripts/user_set_abstraction.py +++ b/apps/hip-3-pusher/src/scripts/user_set_abstraction.py @@ -4,6 +4,7 @@ from eth_account import Account from hyperliquid.exchange import Exchange from hyperliquid.utils import constants +from hyperliquid.utils.types import Meta, SpotMeta def main() -> None: @@ -42,7 +43,12 @@ def main() -> None: print(f"Using {network_name} URL: {base_url}") account = Account.from_key(Path(args.private_key_file).read_text().strip()) - exchange = Exchange(wallet=account, base_url=base_url) + exchange = Exchange( + wallet=account, + base_url=base_url, + meta=Meta(universe=[]), + spot_meta=SpotMeta(universe=[], tokens=[]), + ) print("address:", account.address) print("abstraction", args.abstraction)