Skip to content

Tags: aleph-im/aleph-sdk-python

Tags

2.3.0

Toggle 2.3.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feature: list, create and revoke authorizations (#272)

Added methods to `AlephClient` to interact with the authorization system
of Aleph Cloud. This enables to delegate specific operations to
addresses other than your own, whether it is to enable other people to
perform specific actions on your behalf or simply avoid signing messages
frequently from your main token-holding wallet.

2.2.0

Toggle 2.2.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Feature: aleph settings services (#248)

* Problem: Ledger wallet users cannot use Aleph to send transactions.

Solution: Implement Ledger use on SDK to allow using them.

* Fix: Solved linting and types issues for code quality.

* Feature: aleph settings services

* Feature: use settings aggregates instead of hardcoded crn version

* Fix: we should give crn_version instead of fetching it here

* fix: linting issue

* Fix: crn_version should be optional and given

* Apply suggestion from @nesitor

Co-authored-by: nesitor <[email protected]>

* Fix: use settings.ALEPH_AGGREGATE_ADDRESS instead of hardcoded address for pricing and settings

* fix: linting

* fix: missing typing for ALEPH_AGGREGATE_ADDRESS in settings

---------

Co-authored-by: Andres D. Molins <[email protected]>
Co-authored-by: nesitor <[email protected]>

2.1.0

Toggle 2.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Upgrade `aleph_message` version to `1.0.5` (#240)

* Fix: Upgrade `aleph_message` version to `1.0.5`.

* Fix: Solve model_validator signature with the proper one

2.0.5

Toggle 2.0.5's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Feature: ipv4 and missing service (#221)

* Feature: base client service

* Feature: CRN service for client

* Feature: DNS service for client

* Feature: Scheduler service for client

* Feature: Port_forwarder service for client

* Feature: new settings `DNS_API` `CRN_URL_UPDATE` `CRN_LIST_URL` `CRN_VERSION` `SCHEDULER_URL`

* feature: new Exception for custom service

* fix: parse_obj is deprecated need to use model_validate

* feat: utils func sanitize_url

* feature: Utils client service

* fix: lint issue http_port_forwarder.py

* feature: Services types

* Feature: AlephHttpClient load default service and allow new method `register_service` to add any service on top

* Feature: AuthenticatedAlephHttpClient load default service and allow new method `register_authenticated_service` to add any service on top

* feat: new unit test for client services

* fix: import

* fix: domains service not existing yet

* fix: unit test

* fix: remove domains for units test service

* refactor: No __init__ needed

* Refactor: renaming class / change folder struct

* fix: port forwarder import

* fix: linting format import

* Feature: client.dns.get_public_dns_by_host

* fix: this functions not used / wrong place

* fix: linting FMT issue

* feat: use new filter on dns api ?item_hash=

* fix: get_scheduler_node become get_nodes since we already on client.scheduler

* fix: rename get_ports to get_address_ports, get_port to get_ports

* fix: we should also ensure that the mlessage is not being removed when getting instance allocations

* fix: new unit test, some name change

* fix: remove unit test for now will fix them

2.0.4

Toggle 2.0.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Feature: Added last aleph-message version with 2 new EVM chains (#223)

2.0.3

Toggle 2.0.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Feature: Implement 2 new messages statuses and 3 new EVM chains. (#220)

2.0.2

Toggle 2.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: Pydantic v2 errors on unknown env vars (#216)

2.0.1

Toggle 2.0.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix: Increase superfluid fork dependency version (#214)

2.0.0

Toggle 2.0.0's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
Upgrade pydantic version (#179)

* Migrate to Pydantic v2, update model validation and fix async issues

- Migrated to Pydantic v2:
  - Replaced deprecated `parse_obj()` and `parse_raw()` with
`model_validate()` and `model_validate_json()`.
  - Replaced `.dict()` with `.model_dump()` for serializing models to dictionaries.
  - Updated `validator` to `field_validator` and `root_validator` to
`model_validator` to comply with Pydantic v2 syntax changes.

- Fixed asyncio issues:
  - Added `await` for asynchronous methods like `raise_for_status()`
in `RemoteAccount` and other HTTP operations to avoid `RuntimeWarning`.

- Updated config handling:
  - Used `ClassVar` for constants in `Settings` and other configuration classes.
  - Replaced `Config` with `ConfigDict` in Pydantic models
to follow v2 conventions.
  - Added default values for missing fields in chain configurations
(`CHAINS_SEPOLIA_ACTIVE`, etc.).

- Adjusted signature handling:
  - Updated the signing logic to prepend `0x` in the `BaseAccount` signature
generation to ensure correct Ethereum address formatting.

- Minor fixes:
  - Resolved issue with extra fields not being allowed by default
by specifying `extra="allow"` or `extra="forbid"` where necessary.
  - Fixed tests to account for changes in model validation and
serialization behavior.
  - Added `pydantic-settings` as a new dependency for configuration management.

* fix: lint tests were failing

- Updated all instances of **extra_fields to ensure proper handling of
Optional dictionaries using `(extra_fields or {})` pattern.
- Added proper return statements in `AlephHttpClient.get_message_status`
to return parsed JSON data as a `MessageStatus` object.
- Updated `Settings` class in `conf.py` to correct DNS resolvers type
and simplify the `model_config` definition.
- Refactored `parse_volume` to ensure correct handling of Mapping types
and MachineVolume types, avoiding TypeErrors.
- Improved field validation and model validation in `SignedPubKeyHeader` by
using correct Pydantic v2 validation decorators and ensuring compatibility with the new model behavior.
- Applied formatting and consistency fixes for `model_dump` usage and indentation improvements in test files.

* feat: add pyproject-fmt

* fix: run pyproject-fmt

* Post-SOL fixes (#178)

* Missing chain field on auth

* Fix Signature of Solana operation for CRN

* Add export_private_key func for accounts

* Improve _load_account

* Add chain arg to _load_account

* Increase default HTTP_REQUEST_TIMEOUT

* Typing

---------

Co-authored-by: Olivier Le Thanh Duong <[email protected]>

* Migrate to Pydantic v2, update model validation and fix async issues

- Migrated to Pydantic v2:
  - Replaced deprecated `parse_obj()` and `parse_raw()` with
`model_validate()` and `model_validate_json()`.
  - Replaced `.dict()` with `.model_dump()` for serializing models to dictionaries.
  - Updated `validator` to `field_validator` and `root_validator` to
`model_validator` to comply with Pydantic v2 syntax changes.

- Fixed asyncio issues:
  - Added `await` for asynchronous methods like `raise_for_status()`
in `RemoteAccount` and other HTTP operations to avoid `RuntimeWarning`.

- Updated config handling:
  - Used `ClassVar` for constants in `Settings` and other configuration classes.
  - Replaced `Config` with `ConfigDict` in Pydantic models
to follow v2 conventions.
  - Added default values for missing fields in chain configurations
(`CHAINS_SEPOLIA_ACTIVE`, etc.).

- Adjusted signature handling:
  - Updated the signing logic to prepend `0x` in the `BaseAccount` signature
generation to ensure correct Ethereum address formatting.

- Minor fixes:
  - Resolved issue with extra fields not being allowed by default
by specifying `extra="allow"` or `extra="forbid"` where necessary.
  - Fixed tests to account for changes in model validation and
serialization behavior.
  - Added `pydantic-settings` as a new dependency for configuration management.

* fix: add explicit float type for HTTP_REQUEST_TIMEOUT to comply with Pydantic v2 requirements

Pydantic v2 requires explicit type annotations for fields, so added `float`
to ensure proper validation of HTTP_REQUEST_TIMEOUT.

* Fix: Linting tests did not pass:

* Fix: Project don't use the good version of aleph-message

There were changes made on aleph-message on the main branch about
pydantic version. Using the version by the url and then change it
later after the release.

* fix: Wrong aleph-message version

* Fix: list[str] rise an error in ubuntu 20.04

Using List from typing instead to assure the compatibility between python3.8 and above

* style: isort

* fix: Hugo comments

* Add pydantic for better mypy tests + Fixes

* fix: Changing version of aleph-message

* style: Missing type for URL

* style: Missing type for URL

* fix: Changing version of aleph-message and fix mypy

Changing the version from the branch to the main of aleph-message
mypy rose some errors about missing name argument, so setting the as None because
they are optional

* fix: Changing version of aleph-message

* fix: Changing version of pytezos

* Changes for new pricing system (#199)

- Move/improve flow code parts from CLI to SDK
- Add utils functions
- Add `make_instance_content` and `make_program_content`
- Refactor `create_instance` and `create_program`
- Add `get_estimated_price`
- Fixes for mypy/ruff/pytest
- Minor improvements
- Remove firecracker rootfs hashes for instances

* Migrate to Pydantic v2, update model validation and fix async issues

- Migrated to Pydantic v2:
  - Replaced deprecated `parse_obj()` and `parse_raw()` with
`model_validate()` and `model_validate_json()`.
  - Replaced `.dict()` with `.model_dump()` for serializing models to dictionaries.
  - Updated `validator` to `field_validator` and `root_validator` to
`model_validator` to comply with Pydantic v2 syntax changes.

- Fixed asyncio issues:
  - Added `await` for asynchronous methods like `raise_for_status()`
in `RemoteAccount` and other HTTP operations to avoid `RuntimeWarning`.

- Updated config handling:
  - Used `ClassVar` for constants in `Settings` and other configuration classes.
  - Replaced `Config` with `ConfigDict` in Pydantic models
to follow v2 conventions.
  - Added default values for missing fields in chain configurations
(`CHAINS_SEPOLIA_ACTIVE`, etc.).

- Adjusted signature handling:
  - Updated the signing logic to prepend `0x` in the `BaseAccount` signature
generation to ensure correct Ethereum address formatting.

- Minor fixes:
  - Resolved issue with extra fields not being allowed by default
by specifying `extra="allow"` or `extra="forbid"` where necessary.
  - Fixed tests to account for changes in model validation and
serialization behavior.
  - Added `pydantic-settings` as a new dependency for configuration management.

* fix: lint tests were failing

- Updated all instances of **extra_fields to ensure proper handling of
Optional dictionaries using `(extra_fields or {})` pattern.
- Added proper return statements in `AlephHttpClient.get_message_status`
to return parsed JSON data as a `MessageStatus` object.
- Updated `Settings` class in `conf.py` to correct DNS resolvers type
and simplify the `model_config` definition.
- Refactored `parse_volume` to ensure correct handling of Mapping types
and MachineVolume types, avoiding TypeErrors.
- Improved field validation and model validation in `SignedPubKeyHeader` by
using correct Pydantic v2 validation decorators and ensuring compatibility with the new model behavior.
- Applied formatting and consistency fixes for `model_dump` usage and indentation improvements in test files.

* Migrate to Pydantic v2, update model validation and fix async issues

- Migrated to Pydantic v2:
  - Replaced deprecated `parse_obj()` and `parse_raw()` with
`model_validate()` and `model_validate_json()`.
  - Replaced `.dict()` with `.model_dump()` for serializing models to dictionaries.
  - Updated `validator` to `field_validator` and `root_validator` to
`model_validator` to comply with Pydantic v2 syntax changes.

- Fixed asyncio issues:
  - Added `await` for asynchronous methods like `raise_for_status()`
in `RemoteAccount` and other HTTP operations to avoid `RuntimeWarning`.

- Updated config handling:
  - Used `ClassVar` for constants in `Settings` and other configuration classes.
  - Replaced `Config` with `ConfigDict` in Pydantic models
to follow v2 conventions.
  - Added default values for missing fields in chain configurations
(`CHAINS_SEPOLIA_ACTIVE`, etc.).

- Adjusted signature handling:
  - Updated the signing logic to prepend `0x` in the `BaseAccount` signature
generation to ensure correct Ethereum address formatting.

- Minor fixes:
  - Resolved issue with extra fields not being allowed by default
by specifying `extra="allow"` or `extra="forbid"` where necessary.
  - Fixed tests to account for changes in model validation and
serialization behavior.
  - Added `pydantic-settings` as a new dependency for configuration management.

* Fix: Linting tests did not pass:

* fix: Wrong aleph-message version

* fix: Hugo comments

* Add pydantic for better mypy tests + Fixes

* fix: Changing version of aleph-message

* style: Missing type for URL

* fix: Changing version of aleph-message and fix mypy

Changing the version from the branch to the main of aleph-message
mypy rose some errors about missing name argument, so setting the as None because
they are optional

* fix: Changing version of aleph-message

* Fix: Missing pydantic_core and wrong version of tezos

* Fix: Access to PersistentVolumeSizeMib is incompatible after migrating to Pydantic2

Using model_validate to access it

* Fix: Wrong name given to the variable

* Style: isort

* Fix: PersistentVolumeSizeMib no longer exist

This class has been deleted from aleph_message and the size is now inside
the PersistentVolume class

* Fix: Update last `aleph-message` version and use again `PersistentVolumeSizeMib` class

* fix: invalid signature cause by `0x` + signature.hex()

* fix: add '0x' to the signature if not here (error happenings only on unit test)

* Refactor: Apply the `.hex()` quick fix on the ETHAccount class instead on the base one as other chains can be affected.

* fix: pydantic model should use `.model_dump()` instead of `dict()`

* fix: add dummy signature for unauthenticated price estimates

When estimating prices without authentication, there's no valid signature available.
This fix uses a dummy signature so that message validation passes in these cases.

---------

Co-authored-by: Laurent Peuch <[email protected]>
Co-authored-by: philogicae <[email protected]>
Co-authored-by: Olivier Le Thanh Duong <[email protected]>
Co-authored-by: philogicae <[email protected]>
Co-authored-by: Andres D. Molins <[email protected]>
Co-authored-by: 1yam <[email protected]>
Co-authored-by: Andres D. Molins <[email protected]>

1.4.0

Toggle 1.4.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Changes for new pricing system (#199)

- Move/improve flow code parts from CLI to SDK
- Add utils functions
- Add `make_instance_content` and `make_program_content`
- Refactor `create_instance` and `create_program`
- Add `get_estimated_price`
- Fixes for mypy/ruff/pytest
- Minor improvements
- Remove firecracker rootfs hashes for instances