Skip to content

Commit 2e9f1ce

Browse files
author
Louis Tao
committed
Version 0.2.0
1 parent b827942 commit 2e9f1ce

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/basic_set_referrer.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from hyperliquid.utils import constants
2+
import example_utils
3+
4+
5+
def main():
6+
address, info, exchange = example_utils.setup(constants.TESTNET_API_URL, skip_ws=True)
7+
8+
# Set the referrer code, for non-subaccount and non-vault addresses
9+
print(exchange.set_referrer("ASDFASDF"))
10+
11+
referral_state = info.query_referral_state(address)
12+
if "referredBy" in referral_state:
13+
print("referred by", referral_state["referredBy"])
14+
15+
16+
if __name__ == "__main__":
17+
main()

0 commit comments

Comments
 (0)