Skip to content

Add SubAccount functionality using L1 keys as Auth#26

Merged
ex10ded merged 14 commits intomainfrom
add_sub_accounts_with_l1
Aug 8, 2024
Merged

Add SubAccount functionality using L1 keys as Auth#26
ex10ded merged 14 commits intomainfrom
add_sub_accounts_with_l1

Conversation

@ex10ded
Copy link
Copy Markdown
Contributor

@ex10ded ex10ded commented Aug 4, 2024

This pull request includes significant updates to the SDK documentation, examples, and tests to support new features and configurations introduced in version 0.3.0. The most important changes include the addition of new SDK environment configurations, onboarding processes, and deposit functionalities, as well as updates to the tests to reflect these changes.

Documentation Updates:

  • Added detailed descriptions of the new SDK environment configurations, onboarding processes, and deposit functionalities in README.md.

Example Scripts:

  • Introduced a new example script onboarding_example.py to demonstrate the onboarding process using the updated SDK.

Test Updates:

Configuration Updates:

  • Updated the project version to 0.3.0 in pyproject.toml to reflect the new release.

get_onboarding_payload,
get_sub_account_creation_payload,
)
from x10.utils.http import ( # WrappedApiResponse,; send_get_request,; send_patch_request,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# WrappedApiResponse,; send_get_request,; send_patch_request,

remove?

ACTIVE_ACCOUNT_HEADER = "X-X10-ACTIVE-ACCOUNT"


class SubAccountExists(Exception):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inherit from from x10.errors import X10Error to preserve hierarchy?

return response_data.key


async def do_something():
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Comment thread x10/utils/http.py Outdated
ApiResponseType = TypeVar("ApiResponseType", bound=Union[int, X10BaseModel, Sequence[X10BaseModel]])


class RateLimitException(Exception):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inherit from from x10.errors import X10Error?

Comment thread x10/utils/http.py Outdated
pass


class NotAuthorizedException(Exception):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inherit from from x10.errors import X10Error?

Comment thread x10/utils/http.py
*,
api_key: Optional[str] = None,
request_headers: Optional[Dict[str, str]] = None,
response_code_to_exception: Optional[Dict[int, Type[Exception]]] = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will convert this to a constant mapping to be applied to every response.

Comment thread x10/perpetual/contract.py
ERC20_ABI = "erc20.json"


def call_stark_perpetual_deposit(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns None. Is it expected?

@ex10ded ex10ded force-pushed the add_sub_accounts_with_l1 branch from b30a235 to 50e0eec Compare August 6, 2024 15:28
@ex10ded ex10ded merged commit 9145718 into main Aug 8, 2024
0xsumatt pushed a commit to 0xsumatt/x10_python_sdk that referenced this pull request Mar 31, 2025
…h_l1

Add SubAccount functionality using L1 keys as Auth
@alexex10 alexex10 deleted the add_sub_accounts_with_l1 branch June 23, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants