diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 4bb1fa77..f3aa5ad8 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -232,6 +232,12 @@ docs/ConnectedSingleAccount.md docs/ConnectedSingleAccountResponse.md docs/ConsoleUser.md docs/ConsoleUserApi.md +docs/Contact.md +docs/ContactApprovalRequest.md +docs/ContactTag.md +docs/ContactTagAttachmentPending.md +docs/ContactsApi.md +docs/ContactsPagedResponse.md docs/ContractAbiResponseDto.md docs/ContractAbiResponseDtoAbiInner.md docs/ContractAddressResponse.md @@ -1266,6 +1272,7 @@ fireblocks/api/compliance_api.py fireblocks/api/compliance_screening_configuration_api.py fireblocks/api/connected_accounts_beta_api.py fireblocks/api/console_user_api.py +fireblocks/api/contacts_api.py fireblocks/api/contract_interactions_api.py fireblocks/api/contract_templates_api.py fireblocks/api/contracts_api.py @@ -1542,6 +1549,11 @@ fireblocks/models/connected_accounts_response.py fireblocks/models/connected_single_account.py fireblocks/models/connected_single_account_response.py fireblocks/models/console_user.py +fireblocks/models/contact.py +fireblocks/models/contact_approval_request.py +fireblocks/models/contact_tag.py +fireblocks/models/contact_tag_attachment_pending.py +fireblocks/models/contacts_paged_response.py fireblocks/models/contract_abi_response_dto.py fireblocks/models/contract_abi_response_dto_abi_inner.py fireblocks/models/contract_address_response.py @@ -2773,6 +2785,12 @@ test/test_connected_single_account.py test/test_connected_single_account_response.py test/test_console_user.py test/test_console_user_api.py +test/test_contact.py +test/test_contact_approval_request.py +test/test_contact_tag.py +test/test_contact_tag_attachment_pending.py +test/test_contacts_api.py +test/test_contacts_paged_response.py test/test_contract_abi_response_dto.py test/test_contract_abi_response_dto_abi_inner.py test/test_contract_address_response.py diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index a7a15795..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,290 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v28.0.0](https://github.com/fireblocks/py-sdk/compare/v24.0.0...v28.0.0) - 2026-08-26 - -### Merged - -- Generated SDK #2791732002 [`#157`](https://github.com/fireblocks/py-sdk/pull/157) - -## [v24.0.0](https://github.com/fireblocks/py-sdk/compare/v23.0.0...v24.0.0) - 2026-07-23 - -### Merged - -- Generated SDK #2700459745 (major) [`#146`](https://github.com/fireblocks/py-sdk/pull/146) - -## [v23.0.0](https://github.com/fireblocks/py-sdk/compare/v22.0.0...v23.0.0) - 2026-07-01 - -### Merged - -- Generated SDK #1180 [`#145`](https://github.com/fireblocks/py-sdk/pull/145) - -## [v22.0.0](https://github.com/fireblocks/py-sdk/compare/v21.0.0...v22.0.0) - 2026-06-28 - -### Merged - -- Generated SDK #5347 [`#144`](https://github.com/fireblocks/py-sdk/pull/144) - -## [v21.0.0](https://github.com/fireblocks/py-sdk/compare/v20.0.0...v21.0.0) - 2026-06-11 - -### Merged - -- Generated SDK #5364 [`#142`](https://github.com/fireblocks/py-sdk/pull/142) - -## [v20.0.0](https://github.com/fireblocks/py-sdk/compare/v19.1.0...v20.0.0) - 2026-06-02 - -### Merged - -- Generated SDK #2839 (major) [`#141`](https://github.com/fireblocks/py-sdk/pull/141) - -## [v19.1.0](https://github.com/fireblocks/py-sdk/compare/v19.0.0...v19.1.0) - 2026-05-27 - -### Merged - -- Generated SDK #2710 (minor) [`#140`](https://github.com/fireblocks/py-sdk/pull/140) - -## [v19.0.0](https://github.com/fireblocks/py-sdk/compare/v18.0.0...v19.0.0) - 2026-05-17 - -### Merged - -- Generated SDK #7742 (major) [`#139`](https://github.com/fireblocks/py-sdk/pull/139) - -## [v18.0.0](https://github.com/fireblocks/py-sdk/compare/v17.0.0...v18.0.0) - 2026-05-07 - -### Merged - -- Generated SDK #3222 (major) [`#138`](https://github.com/fireblocks/py-sdk/pull/138) - -## [v17.0.0](https://github.com/fireblocks/py-sdk/compare/v16.0.0...v17.0.0) - 2026-04-20 - -### Merged - -- Generated SDK #9605 (major) [`#137`](https://github.com/fireblocks/py-sdk/pull/137) - -## [v16.0.0](https://github.com/fireblocks/py-sdk/compare/v15.0.0...v16.0.0) - 2026-04-06 - -### Merged - -- Generated SDK #3331 [`#135`](https://github.com/fireblocks/py-sdk/pull/135) - -## [v15.0.0](https://github.com/fireblocks/py-sdk/compare/v14.1.0...v15.0.0) - 2026-03-15 - -### Merged - -- Generated SDK #3733 (major) [`#129`](https://github.com/fireblocks/py-sdk/pull/129) - -## [v14.1.0](https://github.com/fireblocks/py-sdk/compare/v14.0.0...v14.1.0) - 2026-02-26 - -### Merged - -- Generated SDK #2167 [`#127`](https://github.com/fireblocks/py-sdk/pull/127) - -## [v14.0.0](https://github.com/fireblocks/py-sdk/compare/v13.0.0...v14.0.0) - 2026-02-03 - -### Merged - -- Generated SDK #4746 [`#123`](https://github.com/fireblocks/py-sdk/pull/123) - -## [v13.0.0](https://github.com/fireblocks/py-sdk/compare/v12.1.2...v13.0.0) - 2025-11-13 - -### Merged - -- Generated SDK #5834 [`#121`](https://github.com/fireblocks/py-sdk/pull/121) - -## [v12.1.2](https://github.com/fireblocks/py-sdk/compare/v12.1.1...v12.1.2) - 2025-10-22 - -### Merged - -- Generated SDK #8293 [`#120`](https://github.com/fireblocks/py-sdk/pull/120) - -## [v12.1.1](https://github.com/fireblocks/py-sdk/compare/v12.1.0...v12.1.1) - 2025-09-29 - -### Merged - -- Generated SDK #6061 [`#119`](https://github.com/fireblocks/py-sdk/pull/119) - -## [v12.1.0](https://github.com/fireblocks/py-sdk/compare/v12.0.0...v12.1.0) - 2025-09-09 - -### Merged - -- Generated SDK #4521 [`#118`](https://github.com/fireblocks/py-sdk/pull/118) - -## [v12.0.0](https://github.com/fireblocks/py-sdk/compare/v11.2.0...v12.0.0) - 2025-09-01 - -### Merged - -- Generated SDK #7741 [`#117`](https://github.com/fireblocks/py-sdk/pull/117) - -## [v11.2.0](https://github.com/fireblocks/py-sdk/compare/v11.1.0...v11.2.0) - 2025-08-18 - -### Merged - -- Generated SDK #3302 [`#116`](https://github.com/fireblocks/py-sdk/pull/116) - -## [v11.1.0](https://github.com/fireblocks/py-sdk/compare/v11.0.0...v11.1.0) - 2025-08-11 - -### Merged - -- Generated SDK #1782 [`#115`](https://github.com/fireblocks/py-sdk/pull/115) - -## [v11.0.0](https://github.com/fireblocks/py-sdk/compare/v10.4.0...v11.0.0) - 2025-07-15 - -### Merged - -- Generated SDK #5610 [`#114`](https://github.com/fireblocks/py-sdk/pull/114) - -## [v10.4.0](https://github.com/fireblocks/py-sdk/compare/v10.3.0...v10.4.0) - 2025-06-29 - -### Merged - -- Generated SDK #1492 [`#113`](https://github.com/fireblocks/py-sdk/pull/113) - -## [v10.3.0](https://github.com/fireblocks/py-sdk/compare/v10.2.0...v10.3.0) - 2025-06-18 - -### Merged - -- Generated SDK #4009 [`#112`](https://github.com/fireblocks/py-sdk/pull/112) - -## [v10.2.0](https://github.com/fireblocks/py-sdk/compare/v10.1.1...v10.2.0) - 2025-06-04 - -### Merged - -- Generated SDK #8912 [`#111`](https://github.com/fireblocks/py-sdk/pull/111) - -## [v10.1.1](https://github.com/fireblocks/py-sdk/compare/v10.1.0...v10.1.1) - 2025-05-18 - -### Merged - -- Generated SDK #5019 [`#110`](https://github.com/fireblocks/py-sdk/pull/110) - -## [v10.1.0](https://github.com/fireblocks/py-sdk/compare/v10.0.0...v10.1.0) - 2025-05-07 - -### Merged - -- Generated SDK #7076 [`#107`](https://github.com/fireblocks/py-sdk/pull/107) - -## [v10.0.0](https://github.com/fireblocks/py-sdk/compare/v9.0.1...v10.0.0) - 2025-04-20 - -### Merged - -- Generated SDK #4794 [`#105`](https://github.com/fireblocks/py-sdk/pull/105) - -## [v9.0.1](https://github.com/fireblocks/py-sdk/compare/v9.0.0...v9.0.1) - 2025-04-07 - -### Merged - -- Generated SDK #3065 [`#104`](https://github.com/fireblocks/py-sdk/pull/104) - -## [v9.0.0](https://github.com/fireblocks/py-sdk/compare/v8.0.0...v9.0.0) - 2025-03-27 - -### Merged - -- Generated SDK #619 [`#102`](https://github.com/fireblocks/py-sdk/pull/102) - -## [v8.0.0](https://github.com/fireblocks/py-sdk/compare/v7.1.0...v8.0.0) - 2025-03-17 - -### Merged - -- Generated SDK #645 [`#101`](https://github.com/fireblocks/py-sdk/pull/101) -- Generated SDK #726 [`#99`](https://github.com/fireblocks/py-sdk/pull/99) - -## [v7.1.0](https://github.com/fireblocks/py-sdk/compare/v7.0.1...v7.1.0) - 2025-02-25 - -### Merged - -- Generated SDK #9833 [`#96`](https://github.com/fireblocks/py-sdk/pull/96) - -## [v7.0.1](https://github.com/fireblocks/py-sdk/compare/v7.0.0...v7.0.1) - 2025-02-12 - -### Merged - -- Generated SDK #4262 [`#95`](https://github.com/fireblocks/py-sdk/pull/95) - -## [v7.0.0](https://github.com/fireblocks/py-sdk/compare/v6.0.0...v7.0.0) - 2025-02-02 - -### Merged - -- Generated SDK #538 [`#92`](https://github.com/fireblocks/py-sdk/pull/92) - -## [v6.0.0](https://github.com/fireblocks/py-sdk/compare/v5.0.0...v6.0.0) - 2025-01-08 - -### Merged - -- Generated SDK #8699 [`#89`](https://github.com/fireblocks/py-sdk/pull/89) - -## [v5.0.0](https://github.com/fireblocks/py-sdk/compare/v4.0.0...v5.0.0) - 2024-12-05 - -### Merged - -- Generated SDK #1430 [`#85`](https://github.com/fireblocks/py-sdk/pull/85) -- Update python-package.yml, deprecate macos-12 [`#86`](https://github.com/fireblocks/py-sdk/pull/86) - -## [v4.0.0](https://github.com/fireblocks/py-sdk/compare/v3.0.0...v4.0.0) - 2024-10-31 - -### Merged - -- Generated SDK #5184 [`#82`](https://github.com/fireblocks/py-sdk/pull/82) - -## [v3.0.0](https://github.com/fireblocks/py-sdk/compare/v2.1.0...v3.0.0) - 2024-09-17 - -### Merged - -- Generated SDK #237 [`#81`](https://github.com/fireblocks/py-sdk/pull/81) - -## [v2.1.0](https://github.com/fireblocks/py-sdk/compare/v2.0.0...v2.1.0) - 2024-07-25 - -### Merged - -- Generated SDK #6749 [`#78`](https://github.com/fireblocks/py-sdk/pull/78) - -## [v2.0.0](https://github.com/fireblocks/py-sdk/compare/v1.0.4...v2.0.0) - 2024-07-17 - -### Merged - -- Generated SDK #6152 [`#76`](https://github.com/fireblocks/py-sdk/pull/76) -- Generated SDK #7647 [`#73`](https://github.com/fireblocks/py-sdk/pull/73) -- Generated SDK #7984 [`#70`](https://github.com/fireblocks/py-sdk/pull/70) - -## [v1.0.4](https://github.com/fireblocks/py-sdk/compare/v1.0.3...v1.0.4) - 2024-06-26 - -### Merged - -- Generated SDK #5779 [`#69`](https://github.com/fireblocks/py-sdk/pull/69) -- Generated SDK #913 [`#68`](https://github.com/fireblocks/py-sdk/pull/68) -- Generated SDK #1353 [`#67`](https://github.com/fireblocks/py-sdk/pull/67) -- Generated SDK #9982 [`#66`](https://github.com/fireblocks/py-sdk/pull/66) -- Generated SDK #1362 [`#65`](https://github.com/fireblocks/py-sdk/pull/65) -- Generated SDK #3652 [`#64`](https://github.com/fireblocks/py-sdk/pull/64) - -## [v1.0.3](https://github.com/fireblocks/py-sdk/compare/v1.0.2...v1.0.3) - 2024-06-06 - -### Merged - -- Generated SDK #2648 [`#30`](https://github.com/fireblocks/py-sdk/pull/30) - -## [v1.0.2](https://github.com/fireblocks/py-sdk/compare/v0.0.2-beta...v1.0.2) - 2024-06-04 - -### Merged - -- version 1.0.2 [`#25`](https://github.com/fireblocks/py-sdk/pull/25) -- version 1.0.0 [`#24`](https://github.com/fireblocks/py-sdk/pull/24) - -## v0.0.2-beta - 2024-05-30 - -### Merged - -- version 0.0.2-beta [`#23`](https://github.com/fireblocks/py-sdk/pull/23) -- Update .bumpversion.cfg [`#14`](https://github.com/fireblocks/py-sdk/pull/14) -- Update setup.py [`#13`](https://github.com/fireblocks/py-sdk/pull/13) -- Bug Fixes [`#12`](https://github.com/fireblocks/py-sdk/pull/12) -- update support for beta in bumpversion [`#11`](https://github.com/fireblocks/py-sdk/pull/11) -- Update setup.py [`#10`](https://github.com/fireblocks/py-sdk/pull/10) -- Update setup.py [`#9`](https://github.com/fireblocks/py-sdk/pull/9) -- Added Idempotency & NCW headers support [`#7`](https://github.com/fireblocks/py-sdk/pull/7) -- Added Idempotency & NCW headers support [`#8`](https://github.com/fireblocks/py-sdk/pull/8) -- Update setup.py [`#5`](https://github.com/fireblocks/py-sdk/pull/5) -- API Support Updates [`#4`](https://github.com/fireblocks/py-sdk/pull/4) diff --git a/README.md b/README.md index 1b950d99..8241741a 100644 --- a/README.md +++ b/README.md @@ -310,6 +310,7 @@ Class | Method | HTTP request | Description *ConnectedAccountsBetaApi* | [**sync_connected_account_allowlist**](docs/ConnectedAccountsBetaApi.md#sync_connected_account_allowlist) | **POST** /connected_accounts/{accountId}/allowlist/sync | Sync allowlist for connected account *ConsoleUserApi* | [**create_console_user**](docs/ConsoleUserApi.md#create_console_user) | **POST** /management/users | Create console user *ConsoleUserApi* | [**get_console_users**](docs/ConsoleUserApi.md#get_console_users) | **GET** /management/users | Get console users +*ContactsApi* | [**get_contacts**](docs/ContactsApi.md#get_contacts) | **GET** /contacts | List contacts *ContractInteractionsApi* | [**decode_contract_data**](docs/ContractInteractionsApi.md#decode_contract_data) | **POST** /contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/decode | Decode a function call data, error, or event log *ContractInteractionsApi* | [**get_contract_address**](docs/ContractInteractionsApi.md#get_contract_address) | **GET** /contract_interactions/base_asset_id/{baseAssetId}/tx_hash/{txHash} | Get contract address by transaction hash *ContractInteractionsApi* | [**get_deployed_contract_abi**](docs/ContractInteractionsApi.md#get_deployed_contract_abi) | **GET** /contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/functions | Return deployed contract's ABI @@ -913,6 +914,11 @@ Class | Method | HTTP request | Description - [ConnectedSingleAccount](docs/ConnectedSingleAccount.md) - [ConnectedSingleAccountResponse](docs/ConnectedSingleAccountResponse.md) - [ConsoleUser](docs/ConsoleUser.md) + - [Contact](docs/Contact.md) + - [ContactApprovalRequest](docs/ContactApprovalRequest.md) + - [ContactTag](docs/ContactTag.md) + - [ContactTagAttachmentPending](docs/ContactTagAttachmentPending.md) + - [ContactsPagedResponse](docs/ContactsPagedResponse.md) - [ContractAbiResponseDto](docs/ContractAbiResponseDto.md) - [ContractAbiResponseDtoAbiInner](docs/ContractAbiResponseDtoAbiInner.md) - [ContractAddressResponse](docs/ContractAddressResponse.md) diff --git a/docs/Contact.md b/docs/Contact.md new file mode 100644 index 00000000..f033bdea --- /dev/null +++ b/docs/Contact.md @@ -0,0 +1,40 @@ +# Contact + +A contact in the workspace address book. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the contact | +**name** | **str** | The contact name, unique across the workspace | +**type** | **str** | Whether the contact is an external party or an account the workspace owns elsewhere | +**access_control** | **str** | The access control applied to the contact. Absent when none is set. | [optional] +**notes** | **str** | Free-text notes on the contact. Absent when none are set. | [optional] +**external_ref_id** | **str** | A customer-supplied reference id for the contact. Absent when none is set. | [optional] +**container_id** | **str** | The container holding the contact. Absent when the contact sits at the root. | [optional] +**updated_at** | **datetime** | The date and time the contact was last modified, in ISO-8601 | +**archived_at** | **datetime** | The date and time the contact was archived, in ISO-8601. Absent for live contacts, so this only carries a value when the request passed archived=true. | [optional] +**tags** | [**List[ContactTag]**](ContactTag.md) | The tags attached to the contact | +**pending_approval_request** | [**ContactApprovalRequest**](ContactApprovalRequest.md) | | + +## Example + +```python +from fireblocks.models.contact import Contact + +# TODO update the JSON string below +json = "{}" +# create an instance of Contact from a JSON string +contact_instance = Contact.from_json(json) +# print the JSON string representation of the object +print(Contact.to_json()) + +# convert the object into a dict +contact_dict = contact_instance.to_dict() +# create an instance of Contact from a dict +contact_from_dict = Contact.from_dict(contact_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContactApprovalRequest.md b/docs/ContactApprovalRequest.md new file mode 100644 index 00000000..041c888f --- /dev/null +++ b/docs/ContactApprovalRequest.md @@ -0,0 +1,31 @@ +# ContactApprovalRequest + +An approval request awaiting a quorum decision. Null when none is open. Carried both by a contact, for a quorum-gated write on the contact itself, and by an individual tag, for a change to the tag's own definition. An attach or detach of that tag to this contact is carried by the tag's `pendingAttachment` instead. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The approval request identifier | +**type** | **str** | The operation awaiting approval. Deliberately not an enumeration: the set is open across the surfaces that carry one, and includes contact operations such as CREATE_CONTACT and DELETE_CONTACT as well as changes to a tag itself. | + +## Example + +```python +from fireblocks.models.contact_approval_request import ContactApprovalRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ContactApprovalRequest from a JSON string +contact_approval_request_instance = ContactApprovalRequest.from_json(json) +# print the JSON string representation of the object +print(ContactApprovalRequest.to_json()) + +# convert the object into a dict +contact_approval_request_dict = contact_approval_request_instance.to_dict() +# create an instance of ContactApprovalRequest from a dict +contact_approval_request_from_dict = ContactApprovalRequest.from_dict(contact_approval_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContactTag.md b/docs/ContactTag.md new file mode 100644 index 00000000..98f3a6fc --- /dev/null +++ b/docs/ContactTag.md @@ -0,0 +1,36 @@ +# ContactTag + +A tag attached to the contact, with the display details resolved from the tagging service. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the tag | +**label** | **str** | The tag label | +**color** | **str** | The tag color in hex format. Absent when the tag has none. | [optional] +**description** | **str** | Description for the tag. Absent when the tag has none. | [optional] +**is_protected** | **bool** | Whether the tag is protected, meaning changes to it and to its attachments are approval-gated. | +**pending_approval_request** | [**ContactApprovalRequest**](ContactApprovalRequest.md) | | +**pending_attachment** | [**ContactTagAttachmentPending**](ContactTagAttachmentPending.md) | | + +## Example + +```python +from fireblocks.models.contact_tag import ContactTag + +# TODO update the JSON string below +json = "{}" +# create an instance of ContactTag from a JSON string +contact_tag_instance = ContactTag.from_json(json) +# print the JSON string representation of the object +print(ContactTag.to_json()) + +# convert the object into a dict +contact_tag_dict = contact_tag_instance.to_dict() +# create an instance of ContactTag from a dict +contact_tag_from_dict = ContactTag.from_dict(contact_tag_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContactTagAttachmentPending.md b/docs/ContactTagAttachmentPending.md new file mode 100644 index 00000000..a1c7650a --- /dev/null +++ b/docs/ContactTagAttachmentPending.md @@ -0,0 +1,31 @@ +# ContactTagAttachmentPending + +An attach or detach of this tag to this contact awaiting a quorum decision. Null when the attachment is settled. Distinct from the tag's own `pendingApprovalRequest`, which covers a change to the tag itself rather than to this pairing. When both are open, this is the one to act on from a contact: cancelling a change to the tag's own definition belongs to the tag surface, and `pendingApprovalRequest.id` must not be used to cancel an attachment. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **str** | The operation awaiting approval. ATTACH means the tag is not yet attached; DETACH means it is still attached, pending removal. | +**approval_request_id** | **str** | The identifier of the approval request gating the operation | [optional] + +## Example + +```python +from fireblocks.models.contact_tag_attachment_pending import ContactTagAttachmentPending + +# TODO update the JSON string below +json = "{}" +# create an instance of ContactTagAttachmentPending from a JSON string +contact_tag_attachment_pending_instance = ContactTagAttachmentPending.from_json(json) +# print the JSON string representation of the object +print(ContactTagAttachmentPending.to_json()) + +# convert the object into a dict +contact_tag_attachment_pending_dict = contact_tag_attachment_pending_instance.to_dict() +# create an instance of ContactTagAttachmentPending from a dict +contact_tag_attachment_pending_from_dict = ContactTagAttachmentPending.from_dict(contact_tag_attachment_pending_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContactsApi.md b/docs/ContactsApi.md new file mode 100644 index 00000000..44f74150 --- /dev/null +++ b/docs/ContactsApi.md @@ -0,0 +1,113 @@ +# fireblocks.ContactsApi + +All URIs are relative to *https://api.fireblocks.io/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_contacts**](ContactsApi.md#get_contacts) | **GET** /contacts | List contacts + + +# **get_contacts** +> ContactsPagedResponse get_contacts(page_cursor=page_cursor, page_size=page_size, include_total=include_total, name=name, types=types, container_id=container_id, archived=archived, access_control=access_control, include_tag_ids=include_tag_ids, exclude_tag_ids=exclude_tag_ids, sort_by=sort_by, order=order) + +List contacts + +Returns a paginated list of the workspace's address book contacts. + +Live contacts are returned by default; pass `archived=true` to return only the archived +ones. Results are sorted by `name` ascending unless `sortBy`/`order` say otherwise. +Because the sort column is the page cursor's leading key, a `pageCursor` must be replayed +with the same sort it was minted under, or the request is rejected. + +Endpoint Permissions: any workspace role may read the address book. Writes are role-gated. + + +### Example + + +```python +from fireblocks.models.contacts_paged_response import ContactsPagedResponse +from fireblocks.client import Fireblocks +from fireblocks.client_configuration import ClientConfiguration +from fireblocks.exceptions import ApiException +from fireblocks.base_path import BasePath +from pprint import pprint + +# load the secret key content from a file +with open('your_secret_key_file_path', 'r') as file: + secret_key_value = file.read() + +# build the configuration +configuration = ClientConfiguration( + api_key="your_api_key", + secret_key=secret_key_value, + base_path=BasePath.Sandbox, # or set it directly to a string "https://sandbox-api.fireblocks.io/v1" +) + + +# Enter a context with an instance of the API client +with Fireblocks(configuration) as fireblocks: + page_cursor = 'bmFtZS1BU0M=~QWNtZSBDb3Jw:NA==' # str | Cursor indicating the page position. Omit to fetch the first page. (optional) + page_size = 100 # int | Number of results per page (optional) (default to 100) + include_total = False # bool | Return the total count of matching contacts alongside the page. Counting is opt-in because it costs an extra pass over the filtered set; `total` is omitted from the response unless this is `true`. (optional) (default to False) + name = 'acme' # str | Filter by a case-insensitive substring of the contact name (optional) + types = ['[\"COUNTERPARTY\"]'] # List[str] | Filter by one or more contact types (optional) + container_id = '11111111-1111-1111-1111-111111111111' # str | Filter by the container holding the contact (optional) + archived = False # bool | Return only archived contacts instead of live ones (optional) (default to False) + access_control = 'WHITELIST' # str | Filter by the access control applied to the contact (optional) + include_tag_ids = ['[\"df4c0987-30da-4976-8dcf-bc2dd41ae331\"]'] # List[str] | List of tag IDs to include. Contacts with any of these tags will be included (optional) + exclude_tag_ids = ['[\"df4c0987-30da-4976-8dcf-bc2dd41ae331\"]'] # List[str] | List of tag IDs to exclude. Contacts with any of these tags will be filtered out (optional) + sort_by = name # str | The field to sort by (optional) (default to name) + order = ASC # str | The sort direction (optional) (default to ASC) + + try: + # List contacts + api_response = fireblocks.contacts.get_contacts(page_cursor=page_cursor, page_size=page_size, include_total=include_total, name=name, types=types, container_id=container_id, archived=archived, access_control=access_control, include_tag_ids=include_tag_ids, exclude_tag_ids=exclude_tag_ids, sort_by=sort_by, order=order).result() + print("The response of ContactsApi->get_contacts:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContactsApi->get_contacts: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_cursor** | **str**| Cursor indicating the page position. Omit to fetch the first page. | [optional] + **page_size** | **int**| Number of results per page | [optional] [default to 100] + **include_total** | **bool**| Return the total count of matching contacts alongside the page. Counting is opt-in because it costs an extra pass over the filtered set; `total` is omitted from the response unless this is `true`. | [optional] [default to False] + **name** | **str**| Filter by a case-insensitive substring of the contact name | [optional] + **types** | [**List[str]**](str.md)| Filter by one or more contact types | [optional] + **container_id** | **str**| Filter by the container holding the contact | [optional] + **archived** | **bool**| Return only archived contacts instead of live ones | [optional] [default to False] + **access_control** | **str**| Filter by the access control applied to the contact | [optional] + **include_tag_ids** | [**List[str]**](str.md)| List of tag IDs to include. Contacts with any of these tags will be included | [optional] + **exclude_tag_ids** | [**List[str]**](str.md)| List of tag IDs to exclude. Contacts with any of these tags will be filtered out | [optional] + **sort_by** | **str**| The field to sort by | [optional] [default to name] + **order** | **str**| The sort direction | [optional] [default to ASC] + +### Return type + +[**ContactsPagedResponse**](ContactsPagedResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A paginated list of contacts | * X-Request-ID -
| +**0** | Error Response | * X-Request-ID -
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ContactsPagedResponse.md b/docs/ContactsPagedResponse.md new file mode 100644 index 00000000..613928f0 --- /dev/null +++ b/docs/ContactsPagedResponse.md @@ -0,0 +1,31 @@ +# ContactsPagedResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[Contact]**](Contact.md) | The page of contacts | +**next** | **str** | Cursor to the next page; absent when the current page is the last. Opaque, and bound to the sort that minted it — replay it unchanged and keep sortBy/order steady across pages. | [optional] +**total** | **int** | The number of contacts matching the filters, ignoring pagination. Present only when the request passed `includeTotal=true`; the key is absent otherwise. | [optional] + +## Example + +```python +from fireblocks.models.contacts_paged_response import ContactsPagedResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ContactsPagedResponse from a JSON string +contacts_paged_response_instance = ContactsPagedResponse.from_json(json) +# print the JSON string representation of the object +print(ContactsPagedResponse.to_json()) + +# convert the object into a dict +contacts_paged_response_dict = contacts_paged_response_instance.to_dict() +# create an instance of ContactsPagedResponse from a dict +contacts_paged_response_from_dict = ContactsPagedResponse.from_dict(contacts_paged_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FailureReason.md b/docs/FailureReason.md index 9cf5f6f3..2585ee36 100644 --- a/docs/FailureReason.md +++ b/docs/FailureReason.md @@ -47,6 +47,8 @@ * `AMOUNT_BELOW_MINIMUM` (value: `'AMOUNT_BELOW_MINIMUM'`) +* `AMOUNT_ABOVE_MAXIMUM` (value: `'AMOUNT_ABOVE_MAXIMUM'`) + * `PII_MISSING` (value: `'PII_MISSING'`) * `EXTERNAL_SOURCE_NOT_SUPPORTED` (value: `'EXTERNAL_SOURCE_NOT_SUPPORTED'`) diff --git a/docs/ScreeningTRLinkMissingTrmDecision.md b/docs/ScreeningTRLinkMissingTrmDecision.md index 185c0fe0..5d94bd1b 100644 --- a/docs/ScreeningTRLinkMissingTrmDecision.md +++ b/docs/ScreeningTRLinkMissingTrmDecision.md @@ -23,8 +23,8 @@ Name | Type | Description | Notes **operation** | [**TransactionOperationEnum**](TransactionOperationEnum.md) | | [optional] **description** | **str** | Rule description | [optional] **is_default** | **bool** | Whether this is a default rule | [optional] [default to False] -**valid_before** | **float** | Unix timestamp when rule expires | [optional] -**valid_after** | **float** | Unix timestamp when rule becomes valid | [optional] +**valid_before** | **float** | Rule expires once this many seconds have elapsed since the wait/screening step started | [optional] +**valid_after** | **float** | Rule applies only after this many seconds have elapsed since the wait/screening step started | [optional] **action** | [**TRLinkMissingTrmActionEnum**](TRLinkMissingTrmActionEnum.md) | | **source** | **str** | TRLink missing TRM source | **timestamp** | **datetime** | Timestamp of the decision | [optional] diff --git a/docs/ScreeningTRLinkMissingTrmRule.md b/docs/ScreeningTRLinkMissingTrmRule.md index 93ac8f3c..4b102484 100644 --- a/docs/ScreeningTRLinkMissingTrmRule.md +++ b/docs/ScreeningTRLinkMissingTrmRule.md @@ -23,8 +23,8 @@ Name | Type | Description | Notes **operation** | [**TransactionOperationEnum**](TransactionOperationEnum.md) | | [optional] **description** | **str** | Rule description | [optional] **is_default** | **bool** | Whether this is a default rule | [optional] [default to False] -**valid_before** | **float** | Unix timestamp when rule expires | [optional] -**valid_after** | **float** | Unix timestamp when rule becomes valid | [optional] +**valid_before** | **float** | Rule expires once this many seconds have elapsed since the wait/screening step started | [optional] +**valid_after** | **float** | Rule applies only after this many seconds have elapsed since the wait/screening step started | [optional] **action** | [**TRLinkMissingTrmActionEnum**](TRLinkMissingTrmActionEnum.md) | | ## Example diff --git a/docs/ScreeningTRLinkPostScreeningRule.md b/docs/ScreeningTRLinkPostScreeningRule.md index eb463dba..381df45a 100644 --- a/docs/ScreeningTRLinkPostScreeningRule.md +++ b/docs/ScreeningTRLinkPostScreeningRule.md @@ -25,8 +25,8 @@ Name | Type | Description | Notes **is_default** | **bool** | Whether this is a default rule | [optional] [default to False] **provider_ident** | **str** | Provider identifier | [optional] **trm_status** | [**TRLinkTrmScreeningStatusEnum**](TRLinkTrmScreeningStatusEnum.md) | | [optional] -**valid_before** | **float** | Unix timestamp when rule expires | [optional] -**valid_after** | **float** | Unix timestamp when rule becomes valid | [optional] +**valid_before** | **float** | Rule expires once this many seconds have elapsed since the wait/screening step started | [optional] +**valid_after** | **float** | Rule applies only after this many seconds have elapsed since the wait/screening step started | [optional] **action** | [**TRLinkVerdictEnum**](TRLinkVerdictEnum.md) | | ## Example diff --git a/docs/SecurityFinding.md b/docs/SecurityFinding.md index 9155b31f..85760bce 100644 --- a/docs/SecurityFinding.md +++ b/docs/SecurityFinding.md @@ -7,7 +7,6 @@ A single FSPM finding Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique identifier of the finding | [optional] -**type** | **str** | The finding type identifier | [optional] **status** | **str** | Current status of the finding | [optional] **severity** | **str** | Severity level of the finding | [optional] **category** | **str** | Category of the finding | [optional] diff --git a/docs/SecurityFindingDetailed.md b/docs/SecurityFindingDetailed.md index e432d31d..88e6e6e1 100644 --- a/docs/SecurityFindingDetailed.md +++ b/docs/SecurityFindingDetailed.md @@ -7,7 +7,6 @@ A single FSPM finding, redacted to the public field set Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique identifier of the finding | -**type** | **str** | The finding type identifier | **status** | **str** | Current status of the finding | **severity** | **str** | Severity level of the finding | **category** | **str** | Category of the finding | diff --git a/docs/TRLinkMissingTrmDecision.md b/docs/TRLinkMissingTrmDecision.md index 6a00646c..a9a60afd 100644 --- a/docs/TRLinkMissingTrmDecision.md +++ b/docs/TRLinkMissingTrmDecision.md @@ -23,8 +23,8 @@ Name | Type | Description | Notes **operation** | [**TransactionOperationEnum**](TransactionOperationEnum.md) | | [optional] **description** | **str** | Rule description | [optional] **is_default** | **bool** | Whether this is a default rule | [optional] [default to False] -**valid_before** | **float** | Unix timestamp when rule expires | [optional] -**valid_after** | **float** | Unix timestamp when rule becomes valid | [optional] +**valid_before** | **float** | Rule expires once this many seconds have elapsed since the wait/screening step started | [optional] +**valid_after** | **float** | Rule applies only after this many seconds have elapsed since the wait/screening step started | [optional] **action** | [**TRLinkMissingTrmAction**](TRLinkMissingTrmAction.md) | | **source** | **str** | TRLink missing TRM source | **timestamp** | **datetime** | Timestamp of the decision | [optional] diff --git a/docs/TRLinkMissingTrmRule.md b/docs/TRLinkMissingTrmRule.md index ee79847a..9b85f3b0 100644 --- a/docs/TRLinkMissingTrmRule.md +++ b/docs/TRLinkMissingTrmRule.md @@ -23,8 +23,8 @@ Name | Type | Description | Notes **operation** | [**TransactionOperationEnum**](TransactionOperationEnum.md) | | [optional] **description** | **str** | Rule description | [optional] **is_default** | **bool** | Whether this is a default rule | [optional] [default to False] -**valid_before** | **float** | Unix timestamp when rule expires | [optional] -**valid_after** | **float** | Unix timestamp when rule becomes valid | [optional] +**valid_before** | **float** | Rule expires once this many seconds have elapsed since the wait/screening step started | [optional] +**valid_after** | **float** | Rule applies only after this many seconds have elapsed since the wait/screening step started | [optional] **action** | [**TRLinkMissingTrmAction**](TRLinkMissingTrmAction.md) | | ## Example diff --git a/docs/TRLinkMissingTrmRule2.md b/docs/TRLinkMissingTrmRule2.md index cfd9fb3b..aa2f27af 100644 --- a/docs/TRLinkMissingTrmRule2.md +++ b/docs/TRLinkMissingTrmRule2.md @@ -23,8 +23,8 @@ Name | Type | Description | Notes **operation** | **str** | Operation type | [optional] **description** | **str** | Rule description | [optional] **is_default** | **bool** | Whether this is a default rule | [optional] -**valid_before** | **int** | Rule is valid before this timestamp (milliseconds) | [optional] -**valid_after** | **int** | Rule is valid after this timestamp (milliseconds) | [optional] +**valid_before** | **float** | Rule expires once this many seconds have elapsed since the wait/screening step started | [optional] +**valid_after** | **float** | Rule applies only after this many seconds have elapsed since the wait/screening step started | [optional] **action** | [**TRLinkMissingTrmAction2**](TRLinkMissingTrmAction2.md) | | ## Example diff --git a/docs/TRLinkPostScreeningRule.md b/docs/TRLinkPostScreeningRule.md index 055e5b46..34c4a98c 100644 --- a/docs/TRLinkPostScreeningRule.md +++ b/docs/TRLinkPostScreeningRule.md @@ -25,8 +25,8 @@ Name | Type | Description | Notes **is_default** | **bool** | Whether this is a default rule | [optional] [default to False] **provider_ident** | **str** | Provider identifier | [optional] **trm_status** | [**TRLinkTrmScreeningStatus**](TRLinkTrmScreeningStatus.md) | | [optional] -**valid_before** | **float** | Unix timestamp when rule expires | [optional] -**valid_after** | **float** | Unix timestamp when rule becomes valid | [optional] +**valid_before** | **float** | Rule expires once this many seconds have elapsed since the wait/screening step started | [optional] +**valid_after** | **float** | Rule applies only after this many seconds have elapsed since the wait/screening step started | [optional] **action** | [**TRLinkVerdict**](TRLinkVerdict.md) | | ## Example diff --git a/docs/TRLinkPostScreeningRule2.md b/docs/TRLinkPostScreeningRule2.md index 932b6a27..fabf03ef 100644 --- a/docs/TRLinkPostScreeningRule2.md +++ b/docs/TRLinkPostScreeningRule2.md @@ -25,8 +25,8 @@ Name | Type | Description | Notes **is_default** | **bool** | Whether this is a default rule | [optional] **provider_ident** | **str** | TRP provider identifier | [optional] **trm_status** | [**TRLinkTrmStatus**](TRLinkTrmStatus.md) | | [optional] -**valid_before** | **int** | Rule is valid before this timestamp (milliseconds) | [optional] -**valid_after** | **int** | Rule is valid after this timestamp (milliseconds) | [optional] +**valid_before** | **float** | Rule expires once this many seconds have elapsed since the wait/screening step started | [optional] +**valid_after** | **float** | Rule applies only after this many seconds have elapsed since the wait/screening step started | [optional] **action** | [**TRLinkPostScreeningAction**](TRLinkPostScreeningAction.md) | | ## Example diff --git a/docs/TransactionRequest.md b/docs/TransactionRequest.md index c03a5231..9482cc72 100644 --- a/docs/TransactionRequest.md +++ b/docs/TransactionRequest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **operation** | [**TransactionOperation**](TransactionOperation.md) | | [optional] [default to TransactionOperation.TRANSFER] **note** | **str** | Custom note, not sent to the blockchain, to describe the transaction at your Fireblocks workspace. | [optional] **external_tx_id** | **str** | This parameter allows you to add a unique ID of your own to help prevent duplicate transactions. No specific format is required for this parameter. After you submit a transaction with an external ID, Fireblocks will automatically reject all future transactions with the same ID. Using an external ID primarily helps in situations where, even though a submitted transaction responds with an error due to an internet outage, the transaction was still sent to and processed on the blockchain. Use the [Get a specific transaction by external transaction ID](https://developers.fireblocks.com/reference/gettransactionbyexternalid) endpoint to validate whether these transactions have been processed. | [optional] +**fee_currency** | **str** | For Tempo-based transactions only, the asset used to pay the transaction's network fee, as an asset ID ([see supported assets](https://developers.fireblocks.com/api-reference/blockchains-&-assets/list-assets)). For any other blockchain, this value is ignored. This feature is currently in beta and might be subject to changes. | [optional] **asset_id** | **str** | The ID of the asset to transfer, for `TRANSFER`, `MINT` or `BURN` operations. [See the list of supported assets and their IDs on Fireblocks.](https://developers.fireblocks.com/reference/gettrlinksupportedasset#/) | [optional] **source** | [**SourceTransferPeerPath**](SourceTransferPeerPath.md) | | [optional] **destination** | [**DestinationTransferPeerPath**](DestinationTransferPeerPath.md) | | [optional] diff --git a/fireblocks/__init__.py b/fireblocks/__init__.py index 49c19ac1..ce16c0a2 100644 --- a/fireblocks/__init__.py +++ b/fireblocks/__init__.py @@ -14,7 +14,7 @@ Do not edit the class manually. """ # noqa: E501 -__version__ = "28.0.0" +__version__ = "0.0.0" # import apis into sdk package from fireblocks.api.api_user_api import ApiUserApi @@ -27,6 +27,7 @@ ) from fireblocks.api.connected_accounts_beta_api import ConnectedAccountsBetaApi from fireblocks.api.console_user_api import ConsoleUserApi +from fireblocks.api.contacts_api import ContactsApi from fireblocks.api.contract_interactions_api import ContractInteractionsApi from fireblocks.api.contract_templates_api import ContractTemplatesApi from fireblocks.api.contracts_api import ContractsApi @@ -409,6 +410,11 @@ ConnectedSingleAccountResponse, ) from fireblocks.models.console_user import ConsoleUser +from fireblocks.models.contact import Contact +from fireblocks.models.contact_approval_request import ContactApprovalRequest +from fireblocks.models.contact_tag import ContactTag +from fireblocks.models.contact_tag_attachment_pending import ContactTagAttachmentPending +from fireblocks.models.contacts_paged_response import ContactsPagedResponse from fireblocks.models.contract_abi_response_dto import ContractAbiResponseDto from fireblocks.models.contract_abi_response_dto_abi_inner import ( ContractAbiResponseDtoAbiInner, diff --git a/fireblocks/api/__init__.py b/fireblocks/api/__init__.py index 9b756c60..f3c62d44 100644 --- a/fireblocks/api/__init__.py +++ b/fireblocks/api/__init__.py @@ -9,6 +9,7 @@ from fireblocks.api.compliance_screening_configuration_api import ComplianceScreeningConfigurationApi from fireblocks.api.connected_accounts_beta_api import ConnectedAccountsBetaApi from fireblocks.api.console_user_api import ConsoleUserApi +from fireblocks.api.contacts_api import ContactsApi from fireblocks.api.contract_interactions_api import ContractInteractionsApi from fireblocks.api.contract_templates_api import ContractTemplatesApi from fireblocks.api.contracts_api import ContractsApi diff --git a/fireblocks/api/contacts_api.py b/fireblocks/api/contacts_api.py new file mode 100644 index 00000000..886c8543 --- /dev/null +++ b/fireblocks/api/contacts_api.py @@ -0,0 +1,274 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from concurrent.futures import Future +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from fireblocks.models.contacts_paged_response import ContactsPagedResponse + +from fireblocks.api_client import ApiClient, RequestSerialized +from fireblocks.api_response import ApiResponse +from fireblocks.rest import RESTResponseType +from fireblocks.validation_utils import validate_not_empty_string + + +class ContactsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_contacts( + self, + page_cursor: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1024)]], Field(description="Cursor indicating the page position. Omit to fetch the first page.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of results per page")] = None, + include_total: Annotated[Optional[StrictBool], Field(description="Return the total count of matching contacts alongside the page. Counting is opt-in because it costs an extra pass over the filtered set; `total` is omitted from the response unless this is `true`.")] = None, + name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Filter by a case-insensitive substring of the contact name")] = None, + types: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=2)]], Field(description="Filter by one or more contact types")] = None, + container_id: Annotated[Optional[StrictStr], Field(description="Filter by the container holding the contact")] = None, + archived: Annotated[Optional[StrictBool], Field(description="Return only archived contacts instead of live ones")] = None, + access_control: Annotated[Optional[StrictStr], Field(description="Filter by the access control applied to the contact")] = None, + include_tag_ids: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="List of tag IDs to include. Contacts with any of these tags will be included")] = None, + exclude_tag_ids: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="List of tag IDs to exclude. Contacts with any of these tags will be filtered out")] = None, + sort_by: Annotated[Optional[StrictStr], Field(description="The field to sort by")] = None, + order: Annotated[Optional[StrictStr], Field(description="The sort direction")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Future[ApiResponse[ContactsPagedResponse]]: + """List contacts + + Returns a paginated list of the workspace's address book contacts. Live contacts are returned by default; pass `archived=true` to return only the archived ones. Results are sorted by `name` ascending unless `sortBy`/`order` say otherwise. Because the sort column is the page cursor's leading key, a `pageCursor` must be replayed with the same sort it was minted under, or the request is rejected. Endpoint Permissions: any workspace role may read the address book. Writes are role-gated. + + :param page_cursor: Cursor indicating the page position. Omit to fetch the first page. + :type page_cursor: str + :param page_size: Number of results per page + :type page_size: int + :param include_total: Return the total count of matching contacts alongside the page. Counting is opt-in because it costs an extra pass over the filtered set; `total` is omitted from the response unless this is `true`. + :type include_total: bool + :param name: Filter by a case-insensitive substring of the contact name + :type name: str + :param types: Filter by one or more contact types + :type types: List[str] + :param container_id: Filter by the container holding the contact + :type container_id: str + :param archived: Return only archived contacts instead of live ones + :type archived: bool + :param access_control: Filter by the access control applied to the contact + :type access_control: str + :param include_tag_ids: List of tag IDs to include. Contacts with any of these tags will be included + :type include_tag_ids: List[str] + :param exclude_tag_ids: List of tag IDs to exclude. Contacts with any of these tags will be filtered out + :type exclude_tag_ids: List[str] + :param sort_by: The field to sort by + :type sort_by: str + :param order: The sort direction + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + + _param = self._get_contacts_serialize( + page_cursor=page_cursor, + page_size=page_size, + include_total=include_total, + name=name, + types=types, + container_id=container_id, + archived=archived, + access_control=access_control, + include_tag_ids=include_tag_ids, + exclude_tag_ids=exclude_tag_ids, + sort_by=sort_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ContactsPagedResponse", + 'default': "ErrorSchema", + } + + return self.api_client.call_api( + *_param, + _request_timeout=_request_timeout, + _response_types_map=_response_types_map, + ) + + def _get_contacts_serialize( + self, + page_cursor, + page_size, + include_total, + name, + types, + container_id, + archived, + access_control, + include_tag_ids, + exclude_tag_ids, + sort_by, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'types': 'multi', + 'includeTagIds': 'multi', + 'excludeTagIds': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page_cursor is not None: + + _query_params.append(('pageCursor', page_cursor)) + + if page_size is not None: + + _query_params.append(('pageSize', page_size)) + + if include_total is not None: + + _query_params.append(('includeTotal', include_total)) + + if name is not None: + + _query_params.append(('name', name)) + + if types is not None: + + _query_params.append(('types', types)) + + if container_id is not None: + + _query_params.append(('containerId', container_id)) + + if archived is not None: + + _query_params.append(('archived', archived)) + + if access_control is not None: + + _query_params.append(('accessControl', access_control)) + + if include_tag_ids is not None: + + _query_params.append(('includeTagIds', include_tag_ids)) + + if exclude_tag_ids is not None: + + _query_params.append(('excludeTagIds', exclude_tag_ids)) + + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/contacts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/fireblocks/client.py b/fireblocks/client.py index 3a45c7ae..d04f1068 100644 --- a/fireblocks/client.py +++ b/fireblocks/client.py @@ -24,6 +24,7 @@ ) from fireblocks.api.connected_accounts_beta_api import ConnectedAccountsBetaApi from fireblocks.api.console_user_api import ConsoleUserApi +from fireblocks.api.contacts_api import ContactsApi from fireblocks.api.contract_interactions_api import ContractInteractionsApi from fireblocks.api.contract_templates_api import ContractTemplatesApi from fireblocks.api.contracts_api import ContractsApi @@ -88,6 +89,7 @@ def __init__(self, configuration: ClientConfiguration = None): self._compliance_screening_configuration = None self._connected_accounts_beta = None self._console_user = None + self._contacts = None self._contract_interactions = None self._contract_templates = None self._contracts = None @@ -193,6 +195,12 @@ def console_user(self) -> ConsoleUserApi: self._console_user = ConsoleUserApi(self._api_client) return self._console_user + @property + def contacts(self) -> ContactsApi: + if self._contacts is None: + self._contacts = ContactsApi(self._api_client) + return self._contacts + @property def contract_interactions(self) -> ContractInteractionsApi: if self._contract_interactions is None: diff --git a/fireblocks/configuration.py b/fireblocks/configuration.py index e23bc1b9..c1a025c0 100644 --- a/fireblocks/configuration.py +++ b/fireblocks/configuration.py @@ -550,7 +550,7 @@ def to_debug_report(self) -> str: "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: 1.6.2\n" - "SDK Package Version: 28.0.0".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 0.0.0".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self) -> List[HostSetting]: diff --git a/fireblocks/models/__init__.py b/fireblocks/models/__init__.py index 3ab53f5e..b4f8ac5e 100644 --- a/fireblocks/models/__init__.py +++ b/fireblocks/models/__init__.py @@ -237,6 +237,11 @@ from fireblocks.models.connected_single_account import ConnectedSingleAccount from fireblocks.models.connected_single_account_response import ConnectedSingleAccountResponse from fireblocks.models.console_user import ConsoleUser +from fireblocks.models.contact import Contact +from fireblocks.models.contact_approval_request import ContactApprovalRequest +from fireblocks.models.contact_tag import ContactTag +from fireblocks.models.contact_tag_attachment_pending import ContactTagAttachmentPending +from fireblocks.models.contacts_paged_response import ContactsPagedResponse from fireblocks.models.contract_abi_response_dto import ContractAbiResponseDto from fireblocks.models.contract_abi_response_dto_abi_inner import ContractAbiResponseDtoAbiInner from fireblocks.models.contract_address_response import ContractAddressResponse diff --git a/fireblocks/models/contact.py b/fireblocks/models/contact.py new file mode 100644 index 00000000..0279d983 --- /dev/null +++ b/fireblocks/models/contact.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from fireblocks.models.contact_approval_request import ContactApprovalRequest +from fireblocks.models.contact_tag import ContactTag +from typing import Optional, Set +from typing_extensions import Self + +class Contact(BaseModel): + """ + A contact in the workspace address book. + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the contact") + name: StrictStr = Field(description="The contact name, unique across the workspace") + type: StrictStr = Field(description="Whether the contact is an external party or an account the workspace owns elsewhere") + access_control: Optional[StrictStr] = Field(default=None, description="The access control applied to the contact. Absent when none is set.", alias="accessControl") + notes: Optional[StrictStr] = Field(default=None, description="Free-text notes on the contact. Absent when none are set.") + external_ref_id: Optional[StrictStr] = Field(default=None, description="A customer-supplied reference id for the contact. Absent when none is set.", alias="externalRefId") + container_id: Optional[StrictStr] = Field(default=None, description="The container holding the contact. Absent when the contact sits at the root.", alias="containerId") + updated_at: datetime = Field(description="The date and time the contact was last modified, in ISO-8601", alias="updatedAt") + archived_at: Optional[datetime] = Field(default=None, description="The date and time the contact was archived, in ISO-8601. Absent for live contacts, so this only carries a value when the request passed archived=true.", alias="archivedAt") + tags: List[ContactTag] = Field(description="The tags attached to the contact") + pending_approval_request: Optional[ContactApprovalRequest] = Field(alias="pendingApprovalRequest") + __properties: ClassVar[List[str]] = ["id", "name", "type", "accessControl", "notes", "externalRefId", "containerId", "updatedAt", "archivedAt", "tags", "pendingApprovalRequest"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['COUNTERPARTY', 'OWN_ACCOUNT']): + raise ValueError("must be one of enum values ('COUNTERPARTY', 'OWN_ACCOUNT')") + return value + + @field_validator('access_control') + def access_control_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['WHITELIST', 'BLACKLIST']): + raise ValueError("must be one of enum values ('WHITELIST', 'BLACKLIST')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Contact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in tags (list) + _items = [] + if self.tags: + for _item_tags in self.tags: + if _item_tags: + _items.append(_item_tags.to_dict()) + _dict['tags'] = _items + # override the default output from pydantic by calling `to_dict()` of pending_approval_request + if self.pending_approval_request: + _dict['pendingApprovalRequest'] = self.pending_approval_request.to_dict() + # set to None if pending_approval_request (nullable) is None + # and model_fields_set contains the field + if self.pending_approval_request is None and "pending_approval_request" in self.model_fields_set: + _dict['pendingApprovalRequest'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Contact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "type": obj.get("type"), + "accessControl": obj.get("accessControl"), + "notes": obj.get("notes"), + "externalRefId": obj.get("externalRefId"), + "containerId": obj.get("containerId"), + "updatedAt": obj.get("updatedAt"), + "archivedAt": obj.get("archivedAt"), + "tags": [ContactTag.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None, + "pendingApprovalRequest": ContactApprovalRequest.from_dict(obj["pendingApprovalRequest"]) if obj.get("pendingApprovalRequest") is not None else None + }) + return _obj + + diff --git a/fireblocks/models/contact_approval_request.py b/fireblocks/models/contact_approval_request.py new file mode 100644 index 00000000..5cc627f0 --- /dev/null +++ b/fireblocks/models/contact_approval_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ContactApprovalRequest(BaseModel): + """ + An approval request awaiting a quorum decision. Null when none is open. Carried both by a contact, for a quorum-gated write on the contact itself, and by an individual tag, for a change to the tag's own definition. An attach or detach of that tag to this contact is carried by the tag's `pendingAttachment` instead. + """ # noqa: E501 + id: StrictStr = Field(description="The approval request identifier") + type: StrictStr = Field(description="The operation awaiting approval. Deliberately not an enumeration: the set is open across the surfaces that carry one, and includes contact operations such as CREATE_CONTACT and DELETE_CONTACT as well as changes to a tag itself.") + __properties: ClassVar[List[str]] = ["id", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ContactApprovalRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ContactApprovalRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type") + }) + return _obj + + diff --git a/fireblocks/models/contact_tag.py b/fireblocks/models/contact_tag.py new file mode 100644 index 00000000..11a75aea --- /dev/null +++ b/fireblocks/models/contact_tag.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fireblocks.models.contact_approval_request import ContactApprovalRequest +from fireblocks.models.contact_tag_attachment_pending import ContactTagAttachmentPending +from typing import Optional, Set +from typing_extensions import Self + +class ContactTag(BaseModel): + """ + A tag attached to the contact, with the display details resolved from the tagging service. + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the tag") + label: StrictStr = Field(description="The tag label") + color: Optional[StrictStr] = Field(default=None, description="The tag color in hex format. Absent when the tag has none.") + description: Optional[StrictStr] = Field(default=None, description="Description for the tag. Absent when the tag has none.") + is_protected: StrictBool = Field(description="Whether the tag is protected, meaning changes to it and to its attachments are approval-gated.", alias="isProtected") + pending_approval_request: Optional[ContactApprovalRequest] = Field(alias="pendingApprovalRequest") + pending_attachment: Optional[ContactTagAttachmentPending] = Field(alias="pendingAttachment") + __properties: ClassVar[List[str]] = ["id", "label", "color", "description", "isProtected", "pendingApprovalRequest", "pendingAttachment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ContactTag from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pending_approval_request + if self.pending_approval_request: + _dict['pendingApprovalRequest'] = self.pending_approval_request.to_dict() + # override the default output from pydantic by calling `to_dict()` of pending_attachment + if self.pending_attachment: + _dict['pendingAttachment'] = self.pending_attachment.to_dict() + # set to None if pending_approval_request (nullable) is None + # and model_fields_set contains the field + if self.pending_approval_request is None and "pending_approval_request" in self.model_fields_set: + _dict['pendingApprovalRequest'] = None + + # set to None if pending_attachment (nullable) is None + # and model_fields_set contains the field + if self.pending_attachment is None and "pending_attachment" in self.model_fields_set: + _dict['pendingAttachment'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ContactTag from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "label": obj.get("label"), + "color": obj.get("color"), + "description": obj.get("description"), + "isProtected": obj.get("isProtected"), + "pendingApprovalRequest": ContactApprovalRequest.from_dict(obj["pendingApprovalRequest"]) if obj.get("pendingApprovalRequest") is not None else None, + "pendingAttachment": ContactTagAttachmentPending.from_dict(obj["pendingAttachment"]) if obj.get("pendingAttachment") is not None else None + }) + return _obj + + diff --git a/fireblocks/models/contact_tag_attachment_pending.py b/fireblocks/models/contact_tag_attachment_pending.py new file mode 100644 index 00000000..bdfbbaeb --- /dev/null +++ b/fireblocks/models/contact_tag_attachment_pending.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ContactTagAttachmentPending(BaseModel): + """ + An attach or detach of this tag to this contact awaiting a quorum decision. Null when the attachment is settled. Distinct from the tag's own `pendingApprovalRequest`, which covers a change to the tag itself rather than to this pairing. When both are open, this is the one to act on from a contact: cancelling a change to the tag's own definition belongs to the tag surface, and `pendingApprovalRequest.id` must not be used to cancel an attachment. + """ # noqa: E501 + action: StrictStr = Field(description="The operation awaiting approval. ATTACH means the tag is not yet attached; DETACH means it is still attached, pending removal.") + approval_request_id: Optional[StrictStr] = Field(default=None, description="The identifier of the approval request gating the operation", alias="approvalRequestId") + __properties: ClassVar[List[str]] = ["action", "approvalRequestId"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ATTACH', 'DETACH']): + raise ValueError("must be one of enum values ('ATTACH', 'DETACH')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ContactTagAttachmentPending from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ContactTagAttachmentPending from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "action": obj.get("action"), + "approvalRequestId": obj.get("approvalRequestId") + }) + return _obj + + diff --git a/fireblocks/models/contacts_paged_response.py b/fireblocks/models/contacts_paged_response.py new file mode 100644 index 00000000..4e28a67e --- /dev/null +++ b/fireblocks/models/contacts_paged_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fireblocks.models.contact import Contact +from typing import Optional, Set +from typing_extensions import Self + +class ContactsPagedResponse(BaseModel): + """ + ContactsPagedResponse + """ # noqa: E501 + data: List[Contact] = Field(description="The page of contacts") + next: Optional[StrictStr] = Field(default=None, description="Cursor to the next page; absent when the current page is the last. Opaque, and bound to the sort that minted it — replay it unchanged and keep sortBy/order steady across pages.") + total: Optional[StrictInt] = Field(default=None, description="The number of contacts matching the filters, ignoring pagination. Present only when the request passed `includeTotal=true`; the key is absent otherwise.") + __properties: ClassVar[List[str]] = ["data", "next", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ContactsPagedResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ContactsPagedResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [Contact.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "next": obj.get("next"), + "total": obj.get("total") + }) + return _obj + + diff --git a/fireblocks/models/failure_reason.py b/fireblocks/models/failure_reason.py index 6bc27ad0..87fd8c60 100644 --- a/fireblocks/models/failure_reason.py +++ b/fireblocks/models/failure_reason.py @@ -49,6 +49,7 @@ class FailureReason(str, Enum): UNSUPPORTED_SOURCE_ASSET = 'UNSUPPORTED_SOURCE_ASSET' UNSUPPORTED_DESTINATION_ASSET = 'UNSUPPORTED_DESTINATION_ASSET' AMOUNT_BELOW_MINIMUM = 'AMOUNT_BELOW_MINIMUM' + AMOUNT_ABOVE_MAXIMUM = 'AMOUNT_ABOVE_MAXIMUM' PII_MISSING = 'PII_MISSING' EXTERNAL_SOURCE_NOT_SUPPORTED = 'EXTERNAL_SOURCE_NOT_SUPPORTED' UNSUPPORTED_REGION = 'UNSUPPORTED_REGION' diff --git a/fireblocks/models/screening_tr_link_missing_trm_decision.py b/fireblocks/models/screening_tr_link_missing_trm_decision.py index 2662e770..c0a6a90e 100644 --- a/fireblocks/models/screening_tr_link_missing_trm_decision.py +++ b/fireblocks/models/screening_tr_link_missing_trm_decision.py @@ -51,8 +51,8 @@ class ScreeningTRLinkMissingTrmDecision(BaseModel): operation: Optional[TransactionOperationEnum] = None description: Optional[StrictStr] = Field(default=None, description="Rule description") is_default: Optional[StrictBool] = Field(default=False, description="Whether this is a default rule", alias="isDefault") - valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule expires", alias="validBefore") - valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule becomes valid", alias="validAfter") + valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule expires once this many seconds have elapsed since the wait/screening step started", alias="validBefore") + valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule applies only after this many seconds have elapsed since the wait/screening step started", alias="validAfter") action: TRLinkMissingTrmActionEnum source: StrictStr = Field(description="TRLink missing TRM source") timestamp: Optional[datetime] = Field(default=None, description="Timestamp of the decision") diff --git a/fireblocks/models/screening_tr_link_missing_trm_rule.py b/fireblocks/models/screening_tr_link_missing_trm_rule.py index a7ba9cc9..9f182573 100644 --- a/fireblocks/models/screening_tr_link_missing_trm_rule.py +++ b/fireblocks/models/screening_tr_link_missing_trm_rule.py @@ -50,8 +50,8 @@ class ScreeningTRLinkMissingTrmRule(BaseModel): operation: Optional[TransactionOperationEnum] = None description: Optional[StrictStr] = Field(default=None, description="Rule description") is_default: Optional[StrictBool] = Field(default=False, description="Whether this is a default rule", alias="isDefault") - valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule expires", alias="validBefore") - valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule becomes valid", alias="validAfter") + valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule expires once this many seconds have elapsed since the wait/screening step started", alias="validBefore") + valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule applies only after this many seconds have elapsed since the wait/screening step started", alias="validAfter") action: TRLinkMissingTrmActionEnum __properties: ClassVar[List[str]] = ["customerId", "direction", "sourceType", "sourceSubType", "sourceAddress", "destType", "destSubType", "destAddress", "sourceId", "destId", "asset", "baseAsset", "amount", "networkProtocol", "operation", "description", "isDefault", "validBefore", "validAfter", "action"] diff --git a/fireblocks/models/screening_tr_link_post_screening_rule.py b/fireblocks/models/screening_tr_link_post_screening_rule.py index 91f50461..00467ee6 100644 --- a/fireblocks/models/screening_tr_link_post_screening_rule.py +++ b/fireblocks/models/screening_tr_link_post_screening_rule.py @@ -53,8 +53,8 @@ class ScreeningTRLinkPostScreeningRule(BaseModel): is_default: Optional[StrictBool] = Field(default=False, description="Whether this is a default rule", alias="isDefault") provider_ident: Optional[StrictStr] = Field(default=None, description="Provider identifier", alias="providerIdent") trm_status: Optional[TRLinkTrmScreeningStatusEnum] = Field(default=None, alias="trmStatus") - valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule expires", alias="validBefore") - valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule becomes valid", alias="validAfter") + valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule expires once this many seconds have elapsed since the wait/screening step started", alias="validBefore") + valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule applies only after this many seconds have elapsed since the wait/screening step started", alias="validAfter") action: TRLinkVerdictEnum __properties: ClassVar[List[str]] = ["customerId", "direction", "sourceType", "sourceSubType", "sourceAddress", "destType", "destSubType", "destAddress", "sourceId", "destId", "asset", "baseAsset", "amount", "networkProtocol", "operation", "description", "isDefault", "providerIdent", "trmStatus", "validBefore", "validAfter", "action"] diff --git a/fireblocks/models/security_finding.py b/fireblocks/models/security_finding.py index a12f02ce..ebc1e844 100644 --- a/fireblocks/models/security_finding.py +++ b/fireblocks/models/security_finding.py @@ -29,23 +29,12 @@ class SecurityFinding(BaseModel): A single FSPM finding """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the finding") - type: Optional[StrictStr] = Field(default=None, description="The finding type identifier") status: Optional[StrictStr] = Field(default=None, description="Current status of the finding") severity: Optional[StrictStr] = Field(default=None, description="Severity level of the finding") category: Optional[StrictStr] = Field(default=None, description="Category of the finding") created_at: Optional[datetime] = Field(default=None, description="When the finding was first detected", alias="createdAt") title: Optional[StrictStr] = Field(default=None, description="Human-readable title of the finding") - __properties: ClassVar[List[str]] = ["id", "type", "status", "severity", "category", "createdAt", "title"] - - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['API_USER_NOT_WHITELISTED', 'CONSOLE_IP_ALLOWLIST_DEACTIVATED', 'ADMIN_TH_SET_TO_ALL_AND_MORE_THAN_2_ADMINS', 'API_USERS_COUNT_PASSES_TH_AND_OWNER_NOT_MANDATORY', 'API_COSIGNER_WITH_NO_CALLBACK', 'API_USER_DIDNT_APPROVE_CCR_IN_X_DAYS', 'NON_VIEWER_DIDNT_INITIATE_APPROVE_OR_SIGN_TX_OR_CCR_LAST_X_DAYS', 'TH_SET_TO_1_AND_MORE_THAN_3_APPROVERS', 'ADMIN_TH_SET_TO_1_AND_MORE_THAN_3_ADMINS', 'NON_EVM_DAPP_CONNECTIONS_ENABLED_BUT_UNUSED', 'OTA_ENABLED_BUT_UNUSED', 'POLICY_NOT_UPDATED_RECENTLY', 'RAW_SIGNING_ENABLED_BUT_UNUSED', 'API_USER_UNUSED_FOR_90_DAYS', 'UNUSED_UNLIMITED_TOKEN_ALLOWANCES', 'UNUSED_WHITELISTED_ADDRESS', 'TRANSACTION_REPETITION_ATTACK', 'USER_EMAIL_DOMAIN_NON_BUSINESS', 'OUTDATED_MOBILE_APP_VERSION', 'SINGLE_HOP_DRAIN_ATTACK', 'LATERAL_MOVEMENT_DRAIN_ATTACK', 'WORKSPACE_USER_DORMANT_FOR_X_DAYS']): - raise ValueError("must be one of enum values ('API_USER_NOT_WHITELISTED', 'CONSOLE_IP_ALLOWLIST_DEACTIVATED', 'ADMIN_TH_SET_TO_ALL_AND_MORE_THAN_2_ADMINS', 'API_USERS_COUNT_PASSES_TH_AND_OWNER_NOT_MANDATORY', 'API_COSIGNER_WITH_NO_CALLBACK', 'API_USER_DIDNT_APPROVE_CCR_IN_X_DAYS', 'NON_VIEWER_DIDNT_INITIATE_APPROVE_OR_SIGN_TX_OR_CCR_LAST_X_DAYS', 'TH_SET_TO_1_AND_MORE_THAN_3_APPROVERS', 'ADMIN_TH_SET_TO_1_AND_MORE_THAN_3_ADMINS', 'NON_EVM_DAPP_CONNECTIONS_ENABLED_BUT_UNUSED', 'OTA_ENABLED_BUT_UNUSED', 'POLICY_NOT_UPDATED_RECENTLY', 'RAW_SIGNING_ENABLED_BUT_UNUSED', 'API_USER_UNUSED_FOR_90_DAYS', 'UNUSED_UNLIMITED_TOKEN_ALLOWANCES', 'UNUSED_WHITELISTED_ADDRESS', 'TRANSACTION_REPETITION_ATTACK', 'USER_EMAIL_DOMAIN_NON_BUSINESS', 'OUTDATED_MOBILE_APP_VERSION', 'SINGLE_HOP_DRAIN_ATTACK', 'LATERAL_MOVEMENT_DRAIN_ATTACK', 'WORKSPACE_USER_DORMANT_FOR_X_DAYS')") - return value + __properties: ClassVar[List[str]] = ["id", "status", "severity", "category", "createdAt", "title"] @field_validator('status') def status_validate_enum(cls, value): @@ -129,7 +118,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), - "type": obj.get("type"), "status": obj.get("status"), "severity": obj.get("severity"), "category": obj.get("category"), diff --git a/fireblocks/models/security_finding_detailed.py b/fireblocks/models/security_finding_detailed.py index 25337c6b..511a5451 100644 --- a/fireblocks/models/security_finding_detailed.py +++ b/fireblocks/models/security_finding_detailed.py @@ -30,7 +30,6 @@ class SecurityFindingDetailed(BaseModel): A single FSPM finding, redacted to the public field set """ # noqa: E501 id: StrictStr = Field(description="Unique identifier of the finding") - type: StrictStr = Field(description="The finding type identifier") status: StrictStr = Field(description="Current status of the finding") severity: StrictStr = Field(description="Severity level of the finding") category: StrictStr = Field(description="Category of the finding") @@ -43,14 +42,7 @@ class SecurityFindingDetailed(BaseModel): compliance_reqs: List[ComplianceRequirement] = Field(description="Compliance requirements this finding relates to", alias="complianceReqs") risk_explanation: StrictStr = Field(description="Explanation of the risk this finding represents", alias="riskExplanation") mitigation_guidance: StrictStr = Field(description="Guidance on how to mitigate this finding", alias="mitigationGuidance") - __properties: ClassVar[List[str]] = ["id", "type", "status", "severity", "category", "createdAt", "title", "statusUpdatedAt", "statusUpdatedByUserId", "statusUpdatedReason", "info", "complianceReqs", "riskExplanation", "mitigationGuidance"] - - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['API_USER_NOT_WHITELISTED', 'CONSOLE_IP_ALLOWLIST_DEACTIVATED', 'ADMIN_TH_SET_TO_ALL_AND_MORE_THAN_2_ADMINS', 'API_USERS_COUNT_PASSES_TH_AND_OWNER_NOT_MANDATORY', 'API_COSIGNER_WITH_NO_CALLBACK', 'API_USER_DIDNT_APPROVE_CCR_IN_X_DAYS', 'NON_VIEWER_DIDNT_INITIATE_APPROVE_OR_SIGN_TX_OR_CCR_LAST_X_DAYS', 'TH_SET_TO_1_AND_MORE_THAN_3_APPROVERS', 'ADMIN_TH_SET_TO_1_AND_MORE_THAN_3_ADMINS', 'NON_EVM_DAPP_CONNECTIONS_ENABLED_BUT_UNUSED', 'OTA_ENABLED_BUT_UNUSED', 'POLICY_NOT_UPDATED_RECENTLY', 'RAW_SIGNING_ENABLED_BUT_UNUSED', 'API_USER_UNUSED_FOR_90_DAYS', 'UNUSED_UNLIMITED_TOKEN_ALLOWANCES', 'UNUSED_WHITELISTED_ADDRESS', 'TRANSACTION_REPETITION_ATTACK', 'USER_EMAIL_DOMAIN_NON_BUSINESS', 'OUTDATED_MOBILE_APP_VERSION', 'SINGLE_HOP_DRAIN_ATTACK', 'LATERAL_MOVEMENT_DRAIN_ATTACK', 'WORKSPACE_USER_DORMANT_FOR_X_DAYS']): - raise ValueError("must be one of enum values ('API_USER_NOT_WHITELISTED', 'CONSOLE_IP_ALLOWLIST_DEACTIVATED', 'ADMIN_TH_SET_TO_ALL_AND_MORE_THAN_2_ADMINS', 'API_USERS_COUNT_PASSES_TH_AND_OWNER_NOT_MANDATORY', 'API_COSIGNER_WITH_NO_CALLBACK', 'API_USER_DIDNT_APPROVE_CCR_IN_X_DAYS', 'NON_VIEWER_DIDNT_INITIATE_APPROVE_OR_SIGN_TX_OR_CCR_LAST_X_DAYS', 'TH_SET_TO_1_AND_MORE_THAN_3_APPROVERS', 'ADMIN_TH_SET_TO_1_AND_MORE_THAN_3_ADMINS', 'NON_EVM_DAPP_CONNECTIONS_ENABLED_BUT_UNUSED', 'OTA_ENABLED_BUT_UNUSED', 'POLICY_NOT_UPDATED_RECENTLY', 'RAW_SIGNING_ENABLED_BUT_UNUSED', 'API_USER_UNUSED_FOR_90_DAYS', 'UNUSED_UNLIMITED_TOKEN_ALLOWANCES', 'UNUSED_WHITELISTED_ADDRESS', 'TRANSACTION_REPETITION_ATTACK', 'USER_EMAIL_DOMAIN_NON_BUSINESS', 'OUTDATED_MOBILE_APP_VERSION', 'SINGLE_HOP_DRAIN_ATTACK', 'LATERAL_MOVEMENT_DRAIN_ATTACK', 'WORKSPACE_USER_DORMANT_FOR_X_DAYS')") - return value + __properties: ClassVar[List[str]] = ["id", "status", "severity", "category", "createdAt", "title", "statusUpdatedAt", "statusUpdatedByUserId", "statusUpdatedReason", "info", "complianceReqs", "riskExplanation", "mitigationGuidance"] @field_validator('status') def status_validate_enum(cls, value): @@ -132,7 +124,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), - "type": obj.get("type"), "status": obj.get("status"), "severity": obj.get("severity"), "category": obj.get("category"), diff --git a/fireblocks/models/tr_link_missing_trm_decision.py b/fireblocks/models/tr_link_missing_trm_decision.py index 190d954e..ae5d48cd 100644 --- a/fireblocks/models/tr_link_missing_trm_decision.py +++ b/fireblocks/models/tr_link_missing_trm_decision.py @@ -51,8 +51,8 @@ class TRLinkMissingTrmDecision(BaseModel): operation: Optional[TransactionOperationEnum] = None description: Optional[StrictStr] = Field(default=None, description="Rule description") is_default: Optional[StrictBool] = Field(default=False, description="Whether this is a default rule", alias="isDefault") - valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule expires", alias="validBefore") - valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule becomes valid", alias="validAfter") + valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule expires once this many seconds have elapsed since the wait/screening step started", alias="validBefore") + valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule applies only after this many seconds have elapsed since the wait/screening step started", alias="validAfter") action: TRLinkMissingTrmAction source: StrictStr = Field(description="TRLink missing TRM source") timestamp: Optional[datetime] = Field(default=None, description="Timestamp of the decision") diff --git a/fireblocks/models/tr_link_missing_trm_rule.py b/fireblocks/models/tr_link_missing_trm_rule.py index 4b7da0b1..d3506944 100644 --- a/fireblocks/models/tr_link_missing_trm_rule.py +++ b/fireblocks/models/tr_link_missing_trm_rule.py @@ -50,8 +50,8 @@ class TRLinkMissingTrmRule(BaseModel): operation: Optional[TransactionOperationEnum] = None description: Optional[StrictStr] = Field(default=None, description="Rule description") is_default: Optional[StrictBool] = Field(default=False, description="Whether this is a default rule", alias="isDefault") - valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule expires", alias="validBefore") - valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule becomes valid", alias="validAfter") + valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule expires once this many seconds have elapsed since the wait/screening step started", alias="validBefore") + valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule applies only after this many seconds have elapsed since the wait/screening step started", alias="validAfter") action: TRLinkMissingTrmAction __properties: ClassVar[List[str]] = ["customerId", "direction", "sourceType", "sourceSubType", "sourceAddress", "destType", "destSubType", "destAddress", "sourceId", "destId", "asset", "baseAsset", "amount", "networkProtocol", "operation", "description", "isDefault", "validBefore", "validAfter", "action"] diff --git a/fireblocks/models/tr_link_missing_trm_rule2.py b/fireblocks/models/tr_link_missing_trm_rule2.py index 77d16a59..db22f2d7 100644 --- a/fireblocks/models/tr_link_missing_trm_rule2.py +++ b/fireblocks/models/tr_link_missing_trm_rule2.py @@ -18,8 +18,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union from fireblocks.models.screening_policy_amount import ScreeningPolicyAmount from fireblocks.models.tr_link_missing_trm_action2 import TRLinkMissingTrmAction2 from fireblocks.models.tr_link_transaction_direction import TRLinkTransactionDirection @@ -47,8 +47,8 @@ class TRLinkMissingTrmRule2(BaseModel): operation: Optional[StrictStr] = Field(default=None, description="Operation type") description: Optional[StrictStr] = Field(default=None, description="Rule description") is_default: Optional[StrictBool] = Field(default=None, description="Whether this is a default rule", alias="isDefault") - valid_before: Optional[StrictInt] = Field(default=None, description="Rule is valid before this timestamp (milliseconds)", alias="validBefore") - valid_after: Optional[StrictInt] = Field(default=None, description="Rule is valid after this timestamp (milliseconds)", alias="validAfter") + valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule expires once this many seconds have elapsed since the wait/screening step started", alias="validBefore") + valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule applies only after this many seconds have elapsed since the wait/screening step started", alias="validAfter") action: TRLinkMissingTrmAction2 __properties: ClassVar[List[str]] = ["customerId", "direction", "sourceType", "sourceSubType", "sourceAddress", "destType", "destSubType", "destAddress", "sourceId", "destId", "asset", "baseAsset", "amount", "networkProtocol", "operation", "description", "isDefault", "validBefore", "validAfter", "action"] diff --git a/fireblocks/models/tr_link_post_screening_rule.py b/fireblocks/models/tr_link_post_screening_rule.py index c711d14d..6bf98aa2 100644 --- a/fireblocks/models/tr_link_post_screening_rule.py +++ b/fireblocks/models/tr_link_post_screening_rule.py @@ -53,8 +53,8 @@ class TRLinkPostScreeningRule(BaseModel): is_default: Optional[StrictBool] = Field(default=False, description="Whether this is a default rule", alias="isDefault") provider_ident: Optional[StrictStr] = Field(default=None, description="Provider identifier", alias="providerIdent") trm_status: Optional[TRLinkTrmScreeningStatus] = Field(default=None, alias="trmStatus") - valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule expires", alias="validBefore") - valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Unix timestamp when rule becomes valid", alias="validAfter") + valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule expires once this many seconds have elapsed since the wait/screening step started", alias="validBefore") + valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule applies only after this many seconds have elapsed since the wait/screening step started", alias="validAfter") action: TRLinkVerdict __properties: ClassVar[List[str]] = ["customerId", "direction", "sourceType", "sourceSubType", "sourceAddress", "destType", "destSubType", "destAddress", "sourceId", "destId", "asset", "baseAsset", "amount", "networkProtocol", "operation", "description", "isDefault", "providerIdent", "trmStatus", "validBefore", "validAfter", "action"] diff --git a/fireblocks/models/tr_link_post_screening_rule2.py b/fireblocks/models/tr_link_post_screening_rule2.py index 786ee935..e53f0f5e 100644 --- a/fireblocks/models/tr_link_post_screening_rule2.py +++ b/fireblocks/models/tr_link_post_screening_rule2.py @@ -18,8 +18,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union from fireblocks.models.screening_policy_amount import ScreeningPolicyAmount from fireblocks.models.tr_link_post_screening_action import TRLinkPostScreeningAction from fireblocks.models.tr_link_transaction_direction import TRLinkTransactionDirection @@ -50,8 +50,8 @@ class TRLinkPostScreeningRule2(BaseModel): is_default: Optional[StrictBool] = Field(default=None, description="Whether this is a default rule", alias="isDefault") provider_ident: Optional[StrictStr] = Field(default=None, description="TRP provider identifier", alias="providerIdent") trm_status: Optional[TRLinkTrmStatus] = Field(default=None, alias="trmStatus") - valid_before: Optional[StrictInt] = Field(default=None, description="Rule is valid before this timestamp (milliseconds)", alias="validBefore") - valid_after: Optional[StrictInt] = Field(default=None, description="Rule is valid after this timestamp (milliseconds)", alias="validAfter") + valid_before: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule expires once this many seconds have elapsed since the wait/screening step started", alias="validBefore") + valid_after: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rule applies only after this many seconds have elapsed since the wait/screening step started", alias="validAfter") action: TRLinkPostScreeningAction __properties: ClassVar[List[str]] = ["customerId", "direction", "sourceType", "sourceSubType", "sourceAddress", "destType", "destSubType", "destAddress", "sourceId", "destId", "asset", "baseAsset", "amount", "networkProtocol", "operation", "description", "isDefault", "providerIdent", "trmStatus", "validBefore", "validAfter", "action"] diff --git a/fireblocks/models/transaction_request.py b/fireblocks/models/transaction_request.py index 69537dac..b2971111 100644 --- a/fireblocks/models/transaction_request.py +++ b/fireblocks/models/transaction_request.py @@ -45,6 +45,7 @@ class TransactionRequest(BaseModel): operation: Optional[TransactionOperation] = TransactionOperation.TRANSFER note: Optional[StrictStr] = Field(default=None, description="Custom note, not sent to the blockchain, to describe the transaction at your Fireblocks workspace.") external_tx_id: Optional[StrictStr] = Field(default=None, description="This parameter allows you to add a unique ID of your own to help prevent duplicate transactions. No specific format is required for this parameter. After you submit a transaction with an external ID, Fireblocks will automatically reject all future transactions with the same ID. Using an external ID primarily helps in situations where, even though a submitted transaction responds with an error due to an internet outage, the transaction was still sent to and processed on the blockchain. Use the [Get a specific transaction by external transaction ID](https://developers.fireblocks.com/reference/gettransactionbyexternalid) endpoint to validate whether these transactions have been processed.", alias="externalTxId") + fee_currency: Optional[StrictStr] = Field(default=None, description="For Tempo-based transactions only, the asset used to pay the transaction's network fee, as an asset ID ([see supported assets](https://developers.fireblocks.com/api-reference/blockchains-&-assets/list-assets)). For any other blockchain, this value is ignored. This feature is currently in beta and might be subject to changes.", alias="feeCurrency") asset_id: Optional[StrictStr] = Field(default=None, description="The ID of the asset to transfer, for `TRANSFER`, `MINT` or `BURN` operations. [See the list of supported assets and their IDs on Fireblocks.](https://developers.fireblocks.com/reference/gettrlinksupportedasset#/)", alias="assetId") source: Optional[SourceTransferPeerPath] = None destination: Optional[DestinationTransferPeerPath] = None @@ -72,7 +73,7 @@ class TransactionRequest(BaseModel): cpu_staking: Optional[TransactionRequestNetworkStaking] = Field(default=None, alias="cpuStaking") use_gasless: Optional[StrictBool] = Field(default=None, description="- Override the default gasless configuration by sending true\\false", alias="useGasless") configurations: Optional[TransactionConfigurations] = None - __properties: ClassVar[List[str]] = ["operation", "note", "externalTxId", "assetId", "source", "destination", "destinations", "amount", "treatAsGrossAmount", "forceSweep", "feeLevel", "fee", "priorityFee", "failOnLowFee", "maxFee", "maxTotalFee", "gasLimit", "gasPrice", "networkFee", "replaceTxByHash", "extraParameters", "utxoSelectionParams", "customerRefId", "travelRuleMessage", "travelRuleMessageId", "autoStaking", "networkStaking", "cpuStaking", "useGasless", "configurations"] + __properties: ClassVar[List[str]] = ["operation", "note", "externalTxId", "feeCurrency", "assetId", "source", "destination", "destinations", "amount", "treatAsGrossAmount", "forceSweep", "feeLevel", "fee", "priorityFee", "failOnLowFee", "maxFee", "maxTotalFee", "gasLimit", "gasPrice", "networkFee", "replaceTxByHash", "extraParameters", "utxoSelectionParams", "customerRefId", "travelRuleMessage", "travelRuleMessageId", "autoStaking", "networkStaking", "cpuStaking", "useGasless", "configurations"] @field_validator('fee_level') def fee_level_validate_enum(cls, value): @@ -187,6 +188,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "operation": obj.get("operation") if obj.get("operation") is not None else TransactionOperation.TRANSFER, "note": obj.get("note"), "externalTxId": obj.get("externalTxId"), + "feeCurrency": obj.get("feeCurrency"), "assetId": obj.get("assetId"), "source": SourceTransferPeerPath.from_dict(obj["source"]) if obj.get("source") is not None else None, "destination": DestinationTransferPeerPath.from_dict(obj["destination"]) if obj.get("destination") is not None else None, diff --git a/pyproject.toml b/pyproject.toml index db0092e4..08a27f53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireblocks" -version = "28.0.0" +version = "0.0.0" description = "Fireblocks API" authors = ["Fireblocks "] license = "MIT License" diff --git a/setup.py b/setup.py index d00321d7..8e55f57b 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "fireblocks" -VERSION = "28.0.0" +VERSION = "0.0.0" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", diff --git a/test/fireblocks/test_client.py b/test/fireblocks/test_client.py index 188f78a5..2ef0e66b 100644 --- a/test/fireblocks/test_client.py +++ b/test/fireblocks/test_client.py @@ -24,6 +24,7 @@ from fireblocks.api.compliance_screening_configuration_api import ComplianceScreeningConfigurationApi from fireblocks.api.connected_accounts_beta_api import ConnectedAccountsBetaApi from fireblocks.api.console_user_api import ConsoleUserApi +from fireblocks.api.contacts_api import ContactsApi from fireblocks.api.contract_interactions_api import ContractInteractionsApi from fireblocks.api.contract_templates_api import ContractTemplatesApi from fireblocks.api.contracts_api import ContractsApi @@ -107,6 +108,9 @@ def test_get_connected_accounts_beta(fireblocks_instance): def test_get_console_user(fireblocks_instance): assert isinstance(fireblocks_instance.console_user, ConsoleUserApi) +def test_get_contacts(fireblocks_instance): + assert isinstance(fireblocks_instance.contacts, ContactsApi) + def test_get_contract_interactions(fireblocks_instance): assert isinstance(fireblocks_instance.contract_interactions, ContractInteractionsApi) diff --git a/test/test_add_collateral_request_body.py b/test/test_add_collateral_request_body.py index 09b06bee..38e3bbe1 100644 --- a/test/test_add_collateral_request_body.py +++ b/test/test_add_collateral_request_body.py @@ -40,6 +40,7 @@ def make_instance(self, include_optional) -> AddCollateralRequestBody: operation = 'TRANSFER', note = 'Ticket 123', external_tx_id = '00000000-0000-0000-0000-000000000000', + fee_currency = 'PATHUSD_TEMPO_54V8', asset_id = 'ETH', source = fireblocks.models.source_transfer_peer_path.SourceTransferPeerPath( type = 'VAULT_ACCOUNT', diff --git a/test/test_add_connected_account_request.py b/test/test_add_connected_account_request.py index bfd323d9..2e6017b2 100644 --- a/test/test_add_connected_account_request.py +++ b/test/test_add_connected_account_request.py @@ -38,7 +38,7 @@ def make_instance(self, include_optional) -> AddConnectedAccountRequest: return AddConnectedAccountRequest( provider_id = 'BINANCE', display_name = 'My Binance Account', - creds = '[B@2670b08d', + creds = '[B@595629ea', api_key = 'api_key_abc123', main_account_id = 'acc-parent-001', account_id = 'provider-acc-001', @@ -47,7 +47,7 @@ def make_instance(self, include_optional) -> AddConnectedAccountRequest: else: return AddConnectedAccountRequest( provider_id = 'BINANCE', - creds = '[B@2670b08d', + creds = '[B@595629ea', api_key = 'api_key_abc123', ) """ diff --git a/test/test_contact.py b/test/test_contact.py new file mode 100644 index 00000000..913409b8 --- /dev/null +++ b/test/test_contact.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.contact import Contact + + +class TestContact(unittest.TestCase): + """Contact unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Contact: + """Test Contact + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Contact` + """ + model = Contact() + if include_optional: + return Contact( + id = '2f78ac4f-c409-4c56-9553-bc603fc0c932', + name = 'Acme Corp', + type = 'COUNTERPARTY', + access_control = 'WHITELIST', + notes = 'Primary OTC desk', + external_ref_id = 'crm-4471', + container_id = '11111111-1111-1111-1111-111111111111', + updated_at = '2026-08-06T12:00Z', + archived_at = '2026-08-07T11:00Z', + tags = [{"id":"df4c0987-30da-4976-8dcf-bc2dd41ae331","label":"VIP","color":"#FF5733","description":"Tag for VIP counterparties","isProtected":false,"pendingApprovalRequest":null,"pendingAttachment":null}], + pending_approval_request = fireblocks.models.contact_approval_request.ContactApprovalRequest( + id = '12345', + type = 'CREATE_CONTACT', ) + ) + else: + return Contact( + id = '2f78ac4f-c409-4c56-9553-bc603fc0c932', + name = 'Acme Corp', + type = 'COUNTERPARTY', + updated_at = '2026-08-06T12:00Z', + tags = [{"id":"df4c0987-30da-4976-8dcf-bc2dd41ae331","label":"VIP","color":"#FF5733","description":"Tag for VIP counterparties","isProtected":false,"pendingApprovalRequest":null,"pendingAttachment":null}], + pending_approval_request = fireblocks.models.contact_approval_request.ContactApprovalRequest( + id = '12345', + type = 'CREATE_CONTACT', ), + ) + """ + + def testContact(self): + """Test Contact""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_contact_approval_request.py b/test/test_contact_approval_request.py new file mode 100644 index 00000000..e7e33c06 --- /dev/null +++ b/test/test_contact_approval_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.contact_approval_request import ContactApprovalRequest + + +class TestContactApprovalRequest(unittest.TestCase): + """ContactApprovalRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ContactApprovalRequest: + """Test ContactApprovalRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ContactApprovalRequest` + """ + model = ContactApprovalRequest() + if include_optional: + return ContactApprovalRequest( + id = '12345', + type = 'CREATE_CONTACT' + ) + else: + return ContactApprovalRequest( + id = '12345', + type = 'CREATE_CONTACT', + ) + """ + + def testContactApprovalRequest(self): + """Test ContactApprovalRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_contact_tag.py b/test/test_contact_tag.py new file mode 100644 index 00000000..8778d506 --- /dev/null +++ b/test/test_contact_tag.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.contact_tag import ContactTag + + +class TestContactTag(unittest.TestCase): + """ContactTag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ContactTag: + """Test ContactTag + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ContactTag` + """ + model = ContactTag() + if include_optional: + return ContactTag( + id = 'df4c0987-30da-4976-8dcf-bc2dd41ae331', + label = 'VIP', + color = '#FF5733', + description = 'Tag for VIP counterparties', + is_protected = False, + pending_approval_request = fireblocks.models.contact_approval_request.ContactApprovalRequest( + id = '12345', + type = 'CREATE_CONTACT', ), + pending_attachment = fireblocks.models.contact_tag_attachment_pending.ContactTagAttachmentPending( + action = 'ATTACH', + approval_request_id = '12345', ) + ) + else: + return ContactTag( + id = 'df4c0987-30da-4976-8dcf-bc2dd41ae331', + label = 'VIP', + is_protected = False, + pending_approval_request = fireblocks.models.contact_approval_request.ContactApprovalRequest( + id = '12345', + type = 'CREATE_CONTACT', ), + pending_attachment = fireblocks.models.contact_tag_attachment_pending.ContactTagAttachmentPending( + action = 'ATTACH', + approval_request_id = '12345', ), + ) + """ + + def testContactTag(self): + """Test ContactTag""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_contact_tag_attachment_pending.py b/test/test_contact_tag_attachment_pending.py new file mode 100644 index 00000000..d093489d --- /dev/null +++ b/test/test_contact_tag_attachment_pending.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.contact_tag_attachment_pending import ContactTagAttachmentPending + + +class TestContactTagAttachmentPending(unittest.TestCase): + """ContactTagAttachmentPending unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ContactTagAttachmentPending: + """Test ContactTagAttachmentPending + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ContactTagAttachmentPending` + """ + model = ContactTagAttachmentPending() + if include_optional: + return ContactTagAttachmentPending( + action = 'ATTACH', + approval_request_id = '12345' + ) + else: + return ContactTagAttachmentPending( + action = 'ATTACH', + ) + """ + + def testContactTagAttachmentPending(self): + """Test ContactTagAttachmentPending""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_contacts_api.py b/test/test_contacts_api.py new file mode 100644 index 00000000..453150a0 --- /dev/null +++ b/test/test_contacts_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.api.contacts_api import ContactsApi + + +class TestContactsApi(unittest.TestCase): + """ContactsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ContactsApi() + + def tearDown(self) -> None: + pass + + def test_get_contacts(self) -> None: + """Test case for get_contacts + + List contacts + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_contacts_paged_response.py b/test/test_contacts_paged_response.py new file mode 100644 index 00000000..9adace57 --- /dev/null +++ b/test/test_contacts_paged_response.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.contacts_paged_response import ContactsPagedResponse + + +class TestContactsPagedResponse(unittest.TestCase): + """ContactsPagedResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ContactsPagedResponse: + """Test ContactsPagedResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ContactsPagedResponse` + """ + model = ContactsPagedResponse() + if include_optional: + return ContactsPagedResponse( + data = [{"id":"2f78ac4f-c409-4c56-9553-bc603fc0c932","name":"Acme Corp","type":"COUNTERPARTY","accessControl":"WHITELIST","notes":"Primary OTC desk","externalRefId":"crm-4471","containerId":"11111111-1111-1111-1111-111111111111","updatedAt":"2026-08-06T12:00:00.000Z","tags":[{"id":"df4c0987-30da-4976-8dcf-bc2dd41ae331","label":"VIP","color":"#FF5733","description":"Tag for VIP counterparties","isProtected":false,"pendingApprovalRequest":null,"pendingAttachment":null}],"pendingApprovalRequest":null}], + next = 'bmFtZS1BU0M=~QWNtZSBDb3Jw:NA==', + total = 42 + ) + else: + return ContactsPagedResponse( + data = [{"id":"2f78ac4f-c409-4c56-9553-bc603fc0c932","name":"Acme Corp","type":"COUNTERPARTY","accessControl":"WHITELIST","notes":"Primary OTC desk","externalRefId":"crm-4471","containerId":"11111111-1111-1111-1111-111111111111","updatedAt":"2026-08-06T12:00:00.000Z","tags":[{"id":"df4c0987-30da-4976-8dcf-bc2dd41ae331","label":"VIP","color":"#FF5733","description":"Tag for VIP counterparties","isProtected":false,"pendingApprovalRequest":null,"pendingAttachment":null}],"pendingApprovalRequest":null}], + ) + """ + + def testContactsPagedResponse(self): + """Test ContactsPagedResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_remove_collateral_request_body.py b/test/test_remove_collateral_request_body.py index e468cf30..6a1c563f 100644 --- a/test/test_remove_collateral_request_body.py +++ b/test/test_remove_collateral_request_body.py @@ -40,6 +40,7 @@ def make_instance(self, include_optional) -> RemoveCollateralRequestBody: operation = 'TRANSFER', note = 'Ticket 123', external_tx_id = '00000000-0000-0000-0000-000000000000', + fee_currency = 'PATHUSD_TEMPO_54V8', asset_id = 'ETH', source = fireblocks.models.source_transfer_peer_path.SourceTransferPeerPath( type = 'VAULT_ACCOUNT', diff --git a/test/test_screening_tr_link_missing_trm_decision.py b/test/test_screening_tr_link_missing_trm_decision.py index 92fe1be3..47a7a21b 100644 --- a/test/test_screening_tr_link_missing_trm_decision.py +++ b/test/test_screening_tr_link_missing_trm_decision.py @@ -59,8 +59,8 @@ def make_instance(self, include_optional) -> ScreeningTRLinkMissingTrmDecision: operation = 'TRANSFER', description = 'Rule for high-value BTC transfers', is_default = True, - valid_before = 1672531200000, - valid_after = 1640995200000, + valid_before = 1800, + valid_after = 1800, action = 'WAIT', source = 'policy', timestamp = '2023-10-05T14:48Z', diff --git a/test/test_screening_tr_link_missing_trm_rule.py b/test/test_screening_tr_link_missing_trm_rule.py index ef2a001f..39d1862a 100644 --- a/test/test_screening_tr_link_missing_trm_rule.py +++ b/test/test_screening_tr_link_missing_trm_rule.py @@ -59,8 +59,8 @@ def make_instance(self, include_optional) -> ScreeningTRLinkMissingTrmRule: operation = 'TRANSFER', description = 'Rule for high-value BTC transfers', is_default = True, - valid_before = 1672531200000, - valid_after = 1640995200000, + valid_before = 1800, + valid_after = 1800, action = 'WAIT' ) else: diff --git a/test/test_screening_tr_link_post_screening_rule.py b/test/test_screening_tr_link_post_screening_rule.py index 7938ccd5..1f00a22b 100644 --- a/test/test_screening_tr_link_post_screening_rule.py +++ b/test/test_screening_tr_link_post_screening_rule.py @@ -61,8 +61,8 @@ def make_instance(self, include_optional) -> ScreeningTRLinkPostScreeningRule: is_default = True, provider_ident = 'sumsub', trm_status = 'ACCEPTED', - valid_before = 1672531200000, - valid_after = 1640995200000, + valid_before = 1800, + valid_after = 1800, action = 'ACCEPT' ) else: diff --git a/test/test_security_finding.py b/test/test_security_finding.py index 2e0af1c2..34e5f84d 100644 --- a/test/test_security_finding.py +++ b/test/test_security_finding.py @@ -37,7 +37,6 @@ def make_instance(self, include_optional) -> SecurityFinding: if include_optional: return SecurityFinding( id = 'd7ca6101-a65e-4a9c-b6c1-b8bd697e0cd2', - type = 'API_COSIGNER_WITH_NO_CALLBACK', status = 'OPEN', severity = 'HIGH', category = 'USER_MANAGEMENT', diff --git a/test/test_security_finding_detailed.py b/test/test_security_finding_detailed.py index f949fc38..7fac96eb 100644 --- a/test/test_security_finding_detailed.py +++ b/test/test_security_finding_detailed.py @@ -36,34 +36,32 @@ def make_instance(self, include_optional) -> SecurityFindingDetailed: model = SecurityFindingDetailed() if include_optional: return SecurityFindingDetailed( - id = 'd7ca6101-a65e-4a9c-b6c1-b8bd697e0cd2', - type = 'API_COSIGNER_WITH_NO_CALLBACK', + id = '2f8a132e-623d-3a97-841f-2c5d9b7a3e60', status = 'OPEN', - severity = 'HIGH', + severity = 'MEDIUM', category = 'USER_MANAGEMENT', - created_at = '2026-07-28T11:37:05Z', - title = 'The API user 'Security admin api' is paired with a co-signer and has no callback', + created_at = '2026-07-21T07:49:28Z', + title = 'The API user 'Admin API' is missing an IP allowlist', status_updated_at = '2026-08-16T08:52:57Z', - status_updated_by_user_id = '00d77437-3e7a-4e39-8482-55115a7a0892', - status_updated_reason = 'False positive, callback is configured via a different mechanism', - info = {"apiKey":"e7c3f18c-3060-3748-3563-19c3dbb3fa88","apiUserName":"Security admin api","cosignerId":"02f53cfa-34a3-4393-a451-e13dfab3c157","cosignerName":"Production Co-Signer"}, + status_updated_by_user_id = '7c2e3a4f-144d-4f23-932c-518b3d7f1a09', + status_updated_reason = 'False positive, the API user only ever connects from a fixed, trusted network', + info = {"id":"2a6f3c4e-9d33-437e-8f2a-2c9b4d3e1f35","createdAt":"2026-05-12T12:06:26.242Z","email":"","enabled":true,"firstName":"Admin API","isWhitelisted":false,"lastName":"testd6","role":"ADMIN","status":"READY","tenantId":"6d13843c-4e2b-4a22-2c6f-3b8e3d4a7f52","userType":"API"}, compliance_reqs = [], - risk_explanation = 'An API user that is paired with a co-signer and does not have a callback implementation is vulnerable to auto-approving, allowing malicious transactions to proceed without review.', - mitigation_guidance = 'Add a callback implementation to the API user. Alternatively, if the API user is no longer needed, you can delete it. To do so, go to Developer Center > API Users, click the actions button (3 dots) next to the API user, and select Delete. Note that by default this action can only be performed by the workspace owner.' + risk_explanation = 'This API user has no IP allowlist, so it can be accessed from anywhere, increasing the risk of unauthorized activity.', + mitigation_guidance = 'Go to Developer Center > API Users, click the actions button (3 dots) next to the API user, and select 'Allowlist IP address'.' ) else: return SecurityFindingDetailed( - id = 'd7ca6101-a65e-4a9c-b6c1-b8bd697e0cd2', - type = 'API_COSIGNER_WITH_NO_CALLBACK', + id = '2f8a132e-623d-3a97-841f-2c5d9b7a3e60', status = 'OPEN', - severity = 'HIGH', + severity = 'MEDIUM', category = 'USER_MANAGEMENT', - created_at = '2026-07-28T11:37:05Z', - title = 'The API user 'Security admin api' is paired with a co-signer and has no callback', - info = {"apiKey":"e7c3f18c-3060-3748-3563-19c3dbb3fa88","apiUserName":"Security admin api","cosignerId":"02f53cfa-34a3-4393-a451-e13dfab3c157","cosignerName":"Production Co-Signer"}, + created_at = '2026-07-21T07:49:28Z', + title = 'The API user 'Admin API' is missing an IP allowlist', + info = {"id":"2a6f3c4e-9d33-437e-8f2a-2c9b4d3e1f35","createdAt":"2026-05-12T12:06:26.242Z","email":"","enabled":true,"firstName":"Admin API","isWhitelisted":false,"lastName":"testd6","role":"ADMIN","status":"READY","tenantId":"6d13843c-4e2b-4a22-2c6f-3b8e3d4a7f52","userType":"API"}, compliance_reqs = [], - risk_explanation = 'An API user that is paired with a co-signer and does not have a callback implementation is vulnerable to auto-approving, allowing malicious transactions to proceed without review.', - mitigation_guidance = 'Add a callback implementation to the API user. Alternatively, if the API user is no longer needed, you can delete it. To do so, go to Developer Center > API Users, click the actions button (3 dots) next to the API user, and select Delete. Note that by default this action can only be performed by the workspace owner.', + risk_explanation = 'This API user has no IP allowlist, so it can be accessed from anywhere, increasing the risk of unauthorized activity.', + mitigation_guidance = 'Go to Developer Center > API Users, click the actions button (3 dots) next to the API user, and select 'Allowlist IP address'.', ) """ diff --git a/test/test_tr_link_missing_trm_decision.py b/test/test_tr_link_missing_trm_decision.py index 28b035cf..0e9da1fc 100644 --- a/test/test_tr_link_missing_trm_decision.py +++ b/test/test_tr_link_missing_trm_decision.py @@ -57,8 +57,8 @@ def make_instance(self, include_optional) -> TRLinkMissingTrmDecision: operation = 'TRANSFER', description = '', is_default = True, - valid_before = 1672531200000, - valid_after = 1640995200000, + valid_before = 1800, + valid_after = 1800, action = 'WAIT', source = 'policy', timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), diff --git a/test/test_tr_link_missing_trm_rule.py b/test/test_tr_link_missing_trm_rule.py index 77a7f150..b54843c9 100644 --- a/test/test_tr_link_missing_trm_rule.py +++ b/test/test_tr_link_missing_trm_rule.py @@ -57,8 +57,8 @@ def make_instance(self, include_optional) -> TRLinkMissingTrmRule: operation = 'TRANSFER', description = '', is_default = True, - valid_before = 1672531200000, - valid_after = 1640995200000, + valid_before = 1800, + valid_after = 1800, action = 'WAIT' ) else: diff --git a/test/test_tr_link_missing_trm_rule2.py b/test/test_tr_link_missing_trm_rule2.py index 75e993e7..174ee065 100644 --- a/test/test_tr_link_missing_trm_rule2.py +++ b/test/test_tr_link_missing_trm_rule2.py @@ -53,8 +53,8 @@ def make_instance(self, include_optional) -> TRLinkMissingTrmRule2: operation = 'TRANSFER', description = 'Wait for TRM screening on inbound transactions', is_default = False, - valid_before = 1735689600000, - valid_after = 1704067200000, + valid_before = 1800, + valid_after = 1800, action = 'WAIT' ) else: diff --git a/test/test_tr_link_policy_response.py b/test/test_tr_link_policy_response.py index 22852811..3c562327 100644 --- a/test/test_tr_link_policy_response.py +++ b/test/test_tr_link_policy_response.py @@ -78,8 +78,8 @@ def make_instance(self, include_optional) -> TRLinkPolicyResponse: is_default = False, provider_ident = 'trm-provider-1', trm_status = 'ACCEPTED', - valid_before = 1735689600000, - valid_after = 1704067200000, + valid_before = 1800, + valid_after = 1800, action = 'ACCEPT', ) ], missing_trm_rules = [ @@ -101,8 +101,8 @@ def make_instance(self, include_optional) -> TRLinkPolicyResponse: operation = 'TRANSFER', description = 'Wait for TRM screening on inbound transactions', is_default = False, - valid_before = 1735689600000, - valid_after = 1704067200000, + valid_before = 1800, + valid_after = 1800, action = 'WAIT', ) ] ) @@ -150,8 +150,8 @@ def make_instance(self, include_optional) -> TRLinkPolicyResponse: is_default = False, provider_ident = 'trm-provider-1', trm_status = 'ACCEPTED', - valid_before = 1735689600000, - valid_after = 1704067200000, + valid_before = 1800, + valid_after = 1800, action = 'ACCEPT', ) ], missing_trm_rules = [ @@ -173,8 +173,8 @@ def make_instance(self, include_optional) -> TRLinkPolicyResponse: operation = 'TRANSFER', description = 'Wait for TRM screening on inbound transactions', is_default = False, - valid_before = 1735689600000, - valid_after = 1704067200000, + valid_before = 1800, + valid_after = 1800, action = 'WAIT', ) ], ) diff --git a/test/test_tr_link_post_screening_rule.py b/test/test_tr_link_post_screening_rule.py index cad2653a..3d6e45c8 100644 --- a/test/test_tr_link_post_screening_rule.py +++ b/test/test_tr_link_post_screening_rule.py @@ -59,8 +59,8 @@ def make_instance(self, include_optional) -> TRLinkPostScreeningRule: is_default = True, provider_ident = 'sumsub', trm_status = 'ACCEPTED', - valid_before = 1672531200000, - valid_after = 1640995200000, + valid_before = 1800, + valid_after = 1800, action = 'ACCEPT' ) else: diff --git a/test/test_tr_link_post_screening_rule2.py b/test/test_tr_link_post_screening_rule2.py index 59531516..f55f95f9 100644 --- a/test/test_tr_link_post_screening_rule2.py +++ b/test/test_tr_link_post_screening_rule2.py @@ -55,8 +55,8 @@ def make_instance(self, include_optional) -> TRLinkPostScreeningRule2: is_default = False, provider_ident = 'trm-provider-1', trm_status = 'ACCEPTED', - valid_before = 1735689600000, - valid_after = 1704067200000, + valid_before = 1800, + valid_after = 1800, action = 'ACCEPT' ) else: diff --git a/test/test_transaction_request.py b/test/test_transaction_request.py index ed1ede1c..3442ca87 100644 --- a/test/test_transaction_request.py +++ b/test/test_transaction_request.py @@ -39,6 +39,7 @@ def make_instance(self, include_optional) -> TransactionRequest: operation = 'TRANSFER', note = 'Ticket 123', external_tx_id = '00000000-0000-0000-0000-000000000000', + fee_currency = 'PATHUSD_TEMPO_54V8', asset_id = 'ETH', source = fireblocks.models.source_transfer_peer_path.SourceTransferPeerPath( type = 'VAULT_ACCOUNT',