@@ -67,7 +67,6 @@ def __init__(
6767 api_url : Optional [str ] = None ,
6868 chain_id : Optional [int ] = None ,
6969 account_id : Optional [int ] = None ,
70- wallet_address : Optional [str ] = None ,
7170 ):
7271 """
7372 Initialize the Reya Trading client.
@@ -103,8 +102,6 @@ def __init__(
103102 self ._config .chain_id = chain_id
104103 if account_id :
105104 self ._config .account_id = account_id
106- if wallet_address :
107- self ._config .wallet_address = wallet_address
108105
109106 # Create signature generator
110107 self ._signature_generator = SignatureGenerator (self ._config )
@@ -175,14 +172,19 @@ def config(self) -> TradingConfig:
175172 return self ._config
176173
177174 @property
178- def wallet_address (self ) -> Optional [str ]:
179- """Get the wallet address from config or signature generator."""
180- # First check if wallet address is directly provided in config
181- if self ._config .wallet_address :
182- return self ._config .wallet_address
175+ def signer_wallet_address (self ) -> str :
176+ """Get the signer wallet address (derived from private key)."""
177+ return self ._signature_generator .signer_wallet_address
183178
184- # Otherwise derive it from private key if available
185- return self ._signature_generator .public_address if self ._signature_generator else None
179+ @property
180+ def owner_wallet_address (self ) -> str :
181+ """
182+ Get the owner wallet address for querying wallet data.
183+
184+ Wallet that owns ACCOUNT_ID, the signer_wallet will either be the same as owner_wallet_address, or a wallet
185+ that was given permissions to trade on behalf ot he owner_wallet_address
186+ """
187+ return self ._config .owner_wallet_address
186188
187189 async def create_limit_order (self , params : LimitOrderParameters ) -> CreateOrderResponse :
188190 """
@@ -254,8 +256,6 @@ async def create_limit_order(self, params: LimitOrderParameters) -> CreateOrderR
254256 # Build the order request
255257 if self .config .account_id is None :
256258 raise ValueError ("Account ID is required for order creation" )
257- if self .config .wallet_address is None :
258- raise ValueError ("Wallet address is required for order creation" )
259259
260260 order_request = CreateOrderRequest (
261261 accountId = self .config .account_id ,
@@ -270,7 +270,7 @@ async def create_limit_order(self, params: LimitOrderParameters) -> CreateOrderR
270270 reduceOnly = params .reduce_only ,
271271 signature = signature ,
272272 nonce = str (nonce ),
273- signerWallet = self .config . wallet_address ,
273+ signerWallet = self .signer_wallet_address ,
274274 )
275275
276276 response = await self .orders .create_order (create_order_request = order_request )
@@ -329,8 +329,6 @@ async def create_trigger_order(self, params: TriggerOrderParameters) -> CreateOr
329329
330330 if self .config .account_id is None :
331331 raise ValueError ("Account ID is required for order creation" )
332- if self .config .wallet_address is None :
333- raise ValueError ("Wallet address is required for order creation" )
334332
335333 order_request = CreateOrderRequest (
336334 accountId = self .config .account_id ,
@@ -343,7 +341,7 @@ async def create_trigger_order(self, params: TriggerOrderParameters) -> CreateOr
343341 expiresAfter = None ,
344342 signature = signature ,
345343 nonce = str (nonce ),
346- signerWallet = self .config . wallet_address ,
344+ signerWallet = self .signer_wallet_address ,
347345 )
348346
349347 response = await self .orders .create_order (create_order_request = order_request )
@@ -379,111 +377,111 @@ async def get_positions(self, wallet_address: Optional[str] = None) -> list[Posi
379377 Get positions for a wallet address asynchronously.
380378
381379 Args:
382- wallet_address: Optional wallet address (defaults to current wallet )
380+ wallet_address: Optional wallet address (defaults to owner_wallet_address )
383381
384382 Returns:
385383 Positions data
386384
387385 Raises:
388386 ValueError: If no wallet address is available or API returns an error
389387 """
390- wallet = wallet_address or self .wallet_address
388+ wallet = wallet_address or self .owner_wallet_address
391389 if not wallet :
392390 raise ValueError ("No wallet address available. Private key must be provided." )
393391
394392 return await self .wallet .get_wallet_positions (address = wallet )
395393
396394 async def get_open_orders (self ) -> list [Order ]:
397395 """
398- Get open orders for the authenticated wallet asynchronously.
396+ Get open orders for the owner wallet asynchronously.
399397
400398 Returns:
401399 List of open orders
402400
403401 Raises:
404402 ValueError: If no wallet address is available or API returns an error
405403 """
406- wallet = self .wallet_address
404+ wallet = self .owner_wallet_address
407405 if not wallet :
408406 raise ValueError ("No wallet address available. Private key must be provided." )
409407
410408 return await self .wallet .get_wallet_open_orders (address = wallet )
411409
412410 async def get_configuration (self ) -> WalletConfiguration :
413411 """
414- Get account configuration asynchronously.
412+ Get account configuration for the owner wallet asynchronously.
415413
416414 Returns:
417415 Account configuration information
418416
419417 Raises:
420418 ValueError: If no wallet address is available or API returns an error
421419 """
422- wallet = self .wallet_address
420+ wallet = self .owner_wallet_address
423421 if not wallet :
424422 raise ValueError ("No wallet address available. Private key must be provided." )
425423
426424 return await self .wallet .get_wallet_configuration (address = wallet )
427425
428426 async def get_perp_executions (self ) -> PerpExecutionList :
429427 """
430- Get perp executions for the authenticated wallet asynchronously.
428+ Get perp executions for the owner wallet asynchronously.
431429
432430 Returns:
433431 Dictionary containing trades data and metadata
434432
435433 Raises:
436434 ValueError: If no wallet address is available or API returns an error
437435 """
438- wallet = self .wallet_address
436+ wallet = self .owner_wallet_address
439437 if not wallet :
440438 raise ValueError ("No wallet address available. Private key must be provided." )
441439
442440 return await self .wallet .get_wallet_perp_executions (address = wallet )
443441
444442 async def get_accounts (self ) -> list [Account ]:
445443 """
446- Get accounts for the authenticated wallet asynchronously.
444+ Get accounts for the owner wallet asynchronously.
447445
448446 Returns:
449447 Account information
450448
451449 Raises:
452450 ValueError: If no wallet address is available or API returns an error
453451 """
454- wallet = self .wallet_address
452+ wallet = self .owner_wallet_address
455453 if not wallet :
456454 raise ValueError ("No wallet address available. Private key must be provided." )
457455
458456 return await self .wallet .get_wallet_accounts (address = wallet )
459457
460458 async def get_account_balances (self ) -> list [AccountBalance ]:
461459 """
462- Get account balances for the authenticated wallet asynchronously.
460+ Get account balances for the owner wallet asynchronously.
463461
464462 Returns:
465463 Account balances
466464
467465 Raises:
468466 ValueError: If no wallet address is available or API returns an error
469467 """
470- wallet = self .wallet_address
468+ wallet = self .owner_wallet_address
471469 if not wallet :
472470 raise ValueError ("No wallet address available. Private key must be provided." )
473471
474472 return await self .wallet .get_wallet_account_balances (address = wallet )
475473
476474 async def get_spot_executions (self ) -> SpotExecutionList :
477475 """
478- Get spot executions (i.e. auto exchanges) for the authenticated wallet asynchronously.
476+ Get spot executions (i.e. auto exchanges) for the owner wallet asynchronously.
479477
480478 Returns:
481479 Spot executions
482480
483481 Raises:
484482 ValueError: If no wallet address is available or API returns an error
485483 """
486- wallet = self .wallet_address
484+ wallet = self .owner_wallet_address
487485 if not wallet :
488486 raise ValueError ("No wallet address available. Private key must be provided." )
489487
0 commit comments