Add SubAccount functionality using L1 keys as Auth#26
Merged
Conversation
alexex10
reviewed
Aug 5, 2024
| get_onboarding_payload, | ||
| get_sub_account_creation_payload, | ||
| ) | ||
| from x10.utils.http import ( # WrappedApiResponse,; send_get_request,; send_patch_request, |
Contributor
There was a problem hiding this comment.
# WrappedApiResponse,; send_get_request,; send_patch_request,
remove?
| ACTIVE_ACCOUNT_HEADER = "X-X10-ACTIVE-ACCOUNT" | ||
|
|
||
|
|
||
| class SubAccountExists(Exception): |
Contributor
There was a problem hiding this comment.
Inherit from from x10.errors import X10Error to preserve hierarchy?
| return response_data.key | ||
|
|
||
|
|
||
| async def do_something(): |
| ApiResponseType = TypeVar("ApiResponseType", bound=Union[int, X10BaseModel, Sequence[X10BaseModel]]) | ||
|
|
||
|
|
||
| class RateLimitException(Exception): |
Contributor
There was a problem hiding this comment.
Inherit from from x10.errors import X10Error?
| pass | ||
|
|
||
|
|
||
| class NotAuthorizedException(Exception): |
Contributor
There was a problem hiding this comment.
Inherit from from x10.errors import X10Error?
| *, | ||
| api_key: Optional[str] = None, | ||
| request_headers: Optional[Dict[str, str]] = None, | ||
| response_code_to_exception: Optional[Dict[int, Type[Exception]]] = None, |
Contributor
There was a problem hiding this comment.
I think we will convert this to a constant mapping to be applied to every response.
alexex10
reviewed
Aug 5, 2024
| ERC20_ABI = "erc20.json" | ||
|
|
||
|
|
||
| def call_stark_perpetual_deposit( |
Contributor
There was a problem hiding this comment.
It returns None. Is it expected?
b30a235 to
50e0eec
Compare
…dd_sub_accounts_with_l1
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
README.md.Example Scripts:
onboarding_example.pyto demonstrate the onboarding process using the updated SDK.Test Updates:
tests/fixtures/accounts.py: Changedaccount_idtoidin the account fixtures. [1] [2]tests/perpetual/test_l2_key_derivation.py: Addedsigning_domainparameter toget_l2_keys_from_l1_account.tests/perpetual/test_onboarding_payload.py: Updated tests to includesigning_domainandkey_pairin the onboarding payload. [1] [2] [3]tests/perpetual/test_trading_client.py: ReplacedEndpointConfigwithdataclasses.replace(TESTNET_CONFIG, api_base_url=url)in test configurations. [1] [2] [3]tests/perpetual/test_transfer_object.py: Updated transfer object creation to use new parameters and configuration. [1] [2]tests/perpetual/test_withdrawal_object.py: Updated withdrawal object creation to use new parameters and configuration. [1] [2]tests/utils/test_http.py: Added a new parameter to the URL generation test.Configuration Updates:
pyproject.tomlto reflect the new release.