Skip to content

Commit aa3f297

Browse files
author
Roman
committed
add hotkey into subtensor calls
1 parent f0d9365 commit aa3f297

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

bittensor/core/async_subtensor.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3785,6 +3785,7 @@ async def add_liquidity(
37853785
liquidity: Balance,
37863786
price_low: Balance,
37873787
price_high: Balance,
3788+
hotkey: Optional[str] = None,
37883789
wait_for_inclusion: bool = True,
37893790
wait_for_finalization: bool = False,
37903791
period: Optional[int] = None,
@@ -3798,6 +3799,8 @@ async def add_liquidity(
37983799
liquidity: The amount of liquidity to be added.
37993800
price_low: The lower bound of the price tick range. In TAO.
38003801
price_high: The upper bound of the price tick range. In TAO.
3802+
hotkey: The hotkey with staked TAO in Alpha. If not passed then the wallet hotkey is used. Defaults to
3803+
`None`.
38013804
wait_for_inclusion: Whether to wait for the extrinsic to be included in a block. Defaults to True.
38023805
wait_for_finalization: Whether to wait for finalization of the extrinsic. Defaults to False.
38033806
period: The number of blocks during which the transaction will remain valid after it's submitted. If
@@ -3819,6 +3822,7 @@ async def add_liquidity(
38193822
liquidity=liquidity,
38203823
price_low=price_low,
38213824
price_high=price_high,
3825+
hotkey=hotkey,
38223826
wait_for_inclusion=wait_for_inclusion,
38233827
wait_for_finalization=wait_for_finalization,
38243828
period=period,
@@ -3992,6 +3996,7 @@ async def modify_liquidity(
39923996
netuid: int,
39933997
position_id: int,
39943998
liquidity_delta: Balance,
3999+
hotkey: Optional[str] = None,
39954000
wait_for_inclusion: bool = True,
39964001
wait_for_finalization: bool = False,
39974002
period: Optional[int] = None,
@@ -4003,6 +4008,8 @@ async def modify_liquidity(
40034008
netuid: The UID of the target subnet for which the call is being initiated.
40044009
position_id: The id of the position record in the pool.
40054010
liquidity_delta: The amount of liquidity to be added or removed (add if positive or remove if negative).
4011+
hotkey: The hotkey with staked TAO in Alpha. If not passed then the wallet hotkey is used. Defaults to
4012+
`None`.
40064013
wait_for_inclusion: Whether to wait for the extrinsic to be included in a block. Defaults to True.
40074014
wait_for_finalization: Whether to wait for finalization of the extrinsic. Defaults to False.
40084015
period: The number of blocks during which the transaction will remain valid after it's submitted. If
@@ -4049,6 +4056,7 @@ async def modify_liquidity(
40494056
netuid=netuid,
40504057
position_id=position_id,
40514058
liquidity_delta=liquidity_delta,
4059+
hotkey=hotkey,
40524060
wait_for_inclusion=wait_for_inclusion,
40534061
wait_for_finalization=wait_for_finalization,
40544062
period=period,
@@ -4200,6 +4208,7 @@ async def remove_liquidity(
42004208
wallet: "Wallet",
42014209
netuid: int,
42024210
position_id: int,
4211+
hotkey: Optional[str] = None,
42034212
wait_for_inclusion: bool = True,
42044213
wait_for_finalization: bool = False,
42054214
period: Optional[int] = None,
@@ -4210,6 +4219,8 @@ async def remove_liquidity(
42104219
wallet: The wallet used to sign the extrinsic (must be unlocked).
42114220
netuid: The UID of the target subnet for which the call is being initiated.
42124221
position_id: The id of the position record in the pool.
4222+
hotkey: The hotkey with staked TAO in Alpha. If not passed then the wallet hotkey is used. Defaults to
4223+
`None`.
42134224
wait_for_inclusion: Whether to wait for the extrinsic to be included in a block. Defaults to True.
42144225
wait_for_finalization: Whether to wait for finalization of the extrinsic. Defaults to False.
42154226
period: The number of blocks during which the transaction will remain valid after it's submitted. If
@@ -4231,6 +4242,7 @@ async def remove_liquidity(
42314242
wallet=wallet,
42324243
netuid=netuid,
42334244
position_id=position_id,
4245+
hotkey=hotkey,
42344246
wait_for_inclusion=wait_for_inclusion,
42354247
wait_for_finalization=wait_for_finalization,
42364248
period=period,

bittensor/core/subtensor.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,6 +3002,7 @@ def add_liquidity(
30023002
liquidity: Balance,
30033003
price_low: Balance,
30043004
price_high: Balance,
3005+
hotkey: Optional[str] = None,
30053006
wait_for_inclusion: bool = True,
30063007
wait_for_finalization: bool = False,
30073008
period: Optional[int] = None,
@@ -3015,6 +3016,8 @@ def add_liquidity(
30153016
liquidity: The amount of liquidity to be added.
30163017
price_low: The lower bound of the price tick range. In TAO.
30173018
price_high: The upper bound of the price tick range. In TAO.
3019+
hotkey: The hotkey with staked TAO in Alpha. If not passed then the wallet hotkey is used. Defaults to
3020+
`None`.
30183021
wait_for_inclusion: Whether to wait for the extrinsic to be included in a block. Defaults to True.
30193022
wait_for_finalization: Whether to wait for finalization of the extrinsic. Defaults to False.
30203023
period: The number of blocks during which the transaction will remain valid after it's submitted. If
@@ -3036,6 +3039,7 @@ def add_liquidity(
30363039
liquidity=liquidity,
30373040
price_low=price_low,
30383041
price_high=price_high,
3042+
hotkey=hotkey,
30393043
wait_for_inclusion=wait_for_inclusion,
30403044
wait_for_finalization=wait_for_finalization,
30413045
period=period,
@@ -3214,6 +3218,7 @@ def modify_liquidity(
32143218
netuid: int,
32153219
position_id: int,
32163220
liquidity_delta: Balance,
3221+
hotkey: Optional[str] = None,
32173222
wait_for_inclusion: bool = True,
32183223
wait_for_finalization: bool = False,
32193224
period: Optional[int] = None,
@@ -3225,6 +3230,8 @@ def modify_liquidity(
32253230
netuid: The UID of the target subnet for which the call is being initiated.
32263231
position_id: The id of the position record in the pool.
32273232
liquidity_delta: The amount of liquidity to be added or removed (add if positive or remove if negative).
3233+
hotkey: The hotkey with staked TAO in Alpha. If not passed then the wallet hotkey is used. Defaults to
3234+
`None`.
32283235
wait_for_inclusion: Whether to wait for the extrinsic to be included in a block. Defaults to True.
32293236
wait_for_finalization: Whether to wait for finalization of the extrinsic. Defaults to False.
32303237
period: The number of blocks during which the transaction will remain valid after it's submitted. If
@@ -3271,6 +3278,7 @@ def modify_liquidity(
32713278
netuid=netuid,
32723279
position_id=position_id,
32733280
liquidity_delta=liquidity_delta,
3281+
hotkey=hotkey,
32743282
wait_for_inclusion=wait_for_inclusion,
32753283
wait_for_finalization=wait_for_finalization,
32763284
period=period,
@@ -3421,6 +3429,7 @@ def remove_liquidity(
34213429
wallet: "Wallet",
34223430
netuid: int,
34233431
position_id: int,
3432+
hotkey: Optional[str] = None,
34243433
wait_for_inclusion: bool = True,
34253434
wait_for_finalization: bool = False,
34263435
period: Optional[int] = None,
@@ -3431,6 +3440,8 @@ def remove_liquidity(
34313440
wallet: The wallet used to sign the extrinsic (must be unlocked).
34323441
netuid: The UID of the target subnet for which the call is being initiated.
34333442
position_id: The id of the position record in the pool.
3443+
hotkey: The hotkey with staked TAO in Alpha. If not passed then the wallet hotkey is used. Defaults to
3444+
`None`.
34343445
wait_for_inclusion: Whether to wait for the extrinsic to be included in a block. Defaults to True.
34353446
wait_for_finalization: Whether to wait for finalization of the extrinsic. Defaults to False.
34363447
period: The number of blocks during which the transaction will remain valid after it's submitted. If
@@ -3452,6 +3463,7 @@ def remove_liquidity(
34523463
wallet=wallet,
34533464
netuid=netuid,
34543465
position_id=position_id,
3466+
hotkey=hotkey,
34553467
wait_for_inclusion=wait_for_inclusion,
34563468
wait_for_finalization=wait_for_finalization,
34573469
period=period,

0 commit comments

Comments
 (0)