You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try:
sub_accounts = sub_account_api.list_sub_accounts()
for sub_account in sub_accounts:
api_keys = sub_account_api.list_sub_account_keys(sub_account.user_id)
api_keys = sub_account_api.get_sub_account_key(sub_account.user_id,key="some key")
if not api_keys:
sub_account_key = gate_api.SubAccountKey(ip_whitelist=["176.110.0.0/16"])
api_keys = sub_account_api.create_sub_account_keys(
sub_account.user_id, sub_account_key
)
print(f"Created API key for Sub Account: {sub_account.login_name}")
for api_key in api_keys:
sub_configuration = gate_api.Configuration(
key=api_key.key, secret=????? - HOW CAN I GET SECRET KEY SUBACCOUNT?
)
sub_api_client = gate_api.ApiClient(sub_configuration)
sub_wallet_api = gate_api.WalletApi(sub_api_client)
deposit_address = sub_wallet_api.get_deposit_address(currency=token)
print(
f"Sub Account: {sub_account.user_id}, Deposit Address for {token} on {network}: {deposit_address.address}"
)
except GateApiException as e:
print(f"Gate API Exception: {e}")
except ApiException as e:
print(f"API Exception: {e}")`
The text was updated successfully, but these errors were encountered:
after creating access keys to the sub account, you need to get the deposit address
is it possible to get the sub account replenishment address through the main account keys?
`import gate_api
import os
from gate_api.exceptions import ApiException, GateApiException
from dotenv import load_dotenv
load_dotenv()
API_KEY = os.getenv("GATE_API_KEY")
API_SECRET = os.getenv("GATE_API_SECRET")
configuration = gate_api.Configuration(key=API_KEY, secret=API_SECRET)
api_client = gate_api.ApiClient(configuration)
sub_account_api = gate_api.SubAccountApi(api_client)
token = "TON"
network = "TON"
try:
sub_accounts = sub_account_api.list_sub_accounts()
for sub_account in sub_accounts:
api_keys = sub_account_api.list_sub_account_keys(sub_account.user_id)
api_keys = sub_account_api.get_sub_account_key(sub_account.user_id,key="some key")
if not api_keys:
sub_account_key = gate_api.SubAccountKey(ip_whitelist=["176.110.0.0/16"])
api_keys = sub_account_api.create_sub_account_keys(
sub_account.user_id, sub_account_key
)
print(f"Created API key for Sub Account: {sub_account.login_name}")
except GateApiException as e:
print(f"Gate API Exception: {e}")
except ApiException as e:
print(f"API Exception: {e}")`
The text was updated successfully, but these errors were encountered: