Skip to content

Commit

Permalink
Generated SDK #9710
Browse files Browse the repository at this point in the history
  • Loading branch information
fireblocks_dx_team committed Jul 2, 2024
1 parent 8ef3361 commit c83a1e6
Show file tree
Hide file tree
Showing 25 changed files with 81 additions and 43 deletions.
2 changes: 1 addition & 1 deletion docs/AssetResponseOnchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Name | Type | Description | Notes
**name** | **str** | The asset name |
**address** | **str** | The asset address | [optional]
**decimals** | **float** | Number of decimals |
**standard** | **str** | The asset standard |
**standard** | **str** | The asset standard | [optional]

## Example

Expand Down
6 changes: 3 additions & 3 deletions docs/BlockchainsAssetsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ No authorization required
Register an asset

Register a new asset to a workspace and return the newly created asset's details. Currently supported chains are: - EVM based chains - Stellar - Algorand - TRON - NEAR
Register a new asset to a workspace and return the newly created asset's details. Currently supported chains are: - EVM based chains - Stellar - Algorand - TRON - NEAR - Solana

### Example

Expand Down Expand Up @@ -151,8 +151,8 @@ No authorization required
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A new asset has been created successfully | - |
**400** | - Listing an asset on the requested blockchain is not supported. Error code: 1000 - The asset address is invalid. Error code: 1003 - Self serve listing an asset on the requested blockchain is currently not supported, please contact support. Error code: 1004 | - |
**403** | - The asset creation quota reached. Error code: 1005 | - |
**400** | - Listing an asset on the requested blockchain is not supported. Error code: 1000 - The asset address is invalid. Error code: 1003 - Self serve listing an asset on the requested blockchain is currently not supported, please contact support. Error code: 1004 - Blockchain is deprecated. Error code: 1006 - The asset's standard is not supported. Error code: 1007 | - |
**403** | - The asset creation quota reached. Error code: 1005 - Tenant is not allowed to create testnet assets. Error code: 1008 - Tenant is not allowed to create mainnet assets. Error code: 1009 | - |
**404** | - Invalid address, could not get asset information. Error code 1003 | - |
**409** | - The asset is already supported globally. Error code: 1001 - The asset has already been added to this workspace. Error code: 1002 | - |
**500** | Failed to create asset | - |
Expand Down
8 changes: 4 additions & 4 deletions docs/CreateInternalTransferRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**asset** | **str** | | [optional]
**amount** | **str** | | [optional]
**source_type** | [**TradingAccountType**](TradingAccountType.md) | | [optional]
**dest_type** | [**TradingAccountType**](TradingAccountType.md) | | [optional]
**asset** | **str** | |
**amount** | **str** | |
**source_type** | [**TradingAccountType**](TradingAccountType.md) | |
**dest_type** | [**TradingAccountType**](TradingAccountType.md) | |

## Example

Expand Down
1 change: 1 addition & 0 deletions docs/DestinationTransferPeerPathResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Name | Type | Description | Notes
**id** | **str** | The ID of the peer. You can retrieve the ID of each venue object using the endpoints for [listing vault accounts](https://developers.fireblocks.com/reference/get_vault-accounts-paged), [listing exchange account](https://developers.fireblocks.com/reference/get_exchange-accounts), [listing fiat accounts](https://developers.fireblocks.com/reference/get_fiat-accounts), [listing internal wallets](https://developers.fireblocks.com/reference/get_internal-wallets), [listing external wallets](https://developers.fireblocks.com/reference/get_external-wallets), [listing network connections](https://developers.fireblocks.com/reference/get_network-connections). For the other types, this parameter is not needed. | [optional]
**name** | **str** | The name of the peer. | [optional]
**wallet_id** | **str** | | [optional]
**trading_account** | **str** | If this transaction is an exchange internal transfer, this field will be populated with the type of that trading account. | [optional]

## Example

Expand Down
1 change: 1 addition & 0 deletions docs/InternalTransferResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**success** | **bool** | Indicates whether the transfer was successful |
**id** | **str** | The transaction ID of the internal transfer | [optional]

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/RegisterNewAssetRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**blockchain_id** | **str** | Native asset ID of the blockchain |
**address** | **str** | Asset address. - For EVM based chains this should be the token contract address. - For Stellar (XLM) this should be the issuer address. - For Algorand (ALGO) this should be the asset ID. - For TRON (TRX) this should be the token contract address. - For NEAR this will be the token address. |
**address** | **str** | Asset address. - EVM-based chains: token contract address - Stellar (XLM): issuer address - Algorand (ALGO): asset ID - TRON (TRX): token contract address - NEAR: token address - Solana: token's mint account address |
**symbol** | **str** | Required for Stellar only, asset code is expected. | [optional]

## Example
Expand Down
1 change: 1 addition & 0 deletions docs/SourceTransferPeerPathResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Name | Type | Description | Notes
**id** | **str** | The ID of the peer. You can retrieve the ID of each venue object using the endpoints for [listing vault accounts](https://developers.fireblocks.com/reference/get_vault-accounts-paged), [listing exchange account](https://developers.fireblocks.com/reference/get_exchange-accounts), [listing fiat accounts](https://developers.fireblocks.com/reference/get_fiat-accounts), [listing internal wallets](https://developers.fireblocks.com/reference/get_internal-wallets), [listing external wallets](https://developers.fireblocks.com/reference/get_external-wallets), [listing network connections](https://developers.fireblocks.com/reference/get_network-connections). For the other types, this parameter is not needed. | [optional]
**name** | **str** | The name of the peer. | [optional]
**wallet_id** | **str** | | [optional]
**trading_account** | **str** | If this transaction is an exchange internal transfer, this field will be populated with the type of that trading account. | [optional]

## Example

Expand Down
2 changes: 1 addition & 1 deletion fireblocks/api/blockchains_assets_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def register_new_asset(
) -> Future[ApiResponse[AssetResponse]]:
"""Register an asset
Register a new asset to a workspace and return the newly created asset's details. Currently supported chains are: - EVM based chains - Stellar - Algorand - TRON - NEAR
Register a new asset to a workspace and return the newly created asset's details. Currently supported chains are: - EVM based chains - Stellar - Algorand - TRON - NEAR - Solana
:param idempotency_key: A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.
:type idempotency_key: str
Expand Down
2 changes: 1 addition & 1 deletion fireblocks/models/asset_response_onchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AssetResponseOnchain(BaseModel):
name: StrictStr = Field(description="The asset name")
address: Optional[StrictStr] = Field(default=None, description="The asset address")
decimals: Union[StrictFloat, StrictInt] = Field(description="Number of decimals")
standard: StrictStr = Field(description="The asset standard")
standard: Optional[StrictStr] = Field(default=None, description="The asset standard")
__properties: ClassVar[List[str]] = ["symbol", "name", "address", "decimals", "standard"]

model_config = ConfigDict(
Expand Down
4 changes: 2 additions & 2 deletions fireblocks/models/collection_ownership_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class CollectionOwnershipResponse(BaseModel):
@field_validator('blockchain_descriptor')
def blockchain_descriptor_validate_enum(cls, value):
"""Validates the enum"""
if value not in set(['ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH']):
raise ValueError("must be one of enum values ('ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH')")
if value not in set(['ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH', 'BASECHAIN_ETH_TEST3']):
raise ValueError("must be one of enum values ('ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH', 'BASECHAIN_ETH_TEST3')")
return value

model_config = ConfigDict(
Expand Down
10 changes: 5 additions & 5 deletions fireblocks/models/create_internal_transfer_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import json

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from fireblocks.models.trading_account_type import TradingAccountType
from typing import Optional, Set
from typing_extensions import Self
Expand All @@ -28,10 +28,10 @@ class CreateInternalTransferRequest(BaseModel):
"""
CreateInternalTransferRequest
""" # noqa: E501
asset: Optional[StrictStr] = None
amount: Optional[StrictStr] = None
source_type: Optional[TradingAccountType] = Field(default=None, alias="sourceType")
dest_type: Optional[TradingAccountType] = Field(default=None, alias="destType")
asset: StrictStr
amount: StrictStr
source_type: TradingAccountType = Field(alias="sourceType")
dest_type: TradingAccountType = Field(alias="destType")
__properties: ClassVar[List[str]] = ["asset", "amount", "sourceType", "destType"]

model_config = ConfigDict(
Expand Down
11 changes: 9 additions & 2 deletions fireblocks/models/destination_transfer_peer_path_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class DestinationTransferPeerPathResponse(BaseModel):
id: Optional[StrictStr] = Field(default=None, description="The ID of the peer. You can retrieve the ID of each venue object using the endpoints for [listing vault accounts](https://developers.fireblocks.com/reference/get_vault-accounts-paged), [listing exchange account](https://developers.fireblocks.com/reference/get_exchange-accounts), [listing fiat accounts](https://developers.fireblocks.com/reference/get_fiat-accounts), [listing internal wallets](https://developers.fireblocks.com/reference/get_internal-wallets), [listing external wallets](https://developers.fireblocks.com/reference/get_external-wallets), [listing network connections](https://developers.fireblocks.com/reference/get_network-connections). For the other types, this parameter is not needed.")
name: Optional[StrictStr] = Field(default=None, description="The name of the peer.")
wallet_id: Optional[StrictStr] = Field(default=None, alias="walletId")
__properties: ClassVar[List[str]] = ["type", "subType", "id", "name", "walletId"]
trading_account: Optional[StrictStr] = Field(default=None, description="If this transaction is an exchange internal transfer, this field will be populated with the type of that trading account.", alias="tradingAccount")
__properties: ClassVar[List[str]] = ["type", "subType", "id", "name", "walletId", "tradingAccount"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -79,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.id is None and "id" in self.model_fields_set:
_dict['id'] = None

# set to None if trading_account (nullable) is None
# and model_fields_set contains the field
if self.trading_account is None and "trading_account" in self.model_fields_set:
_dict['tradingAccount'] = None

return _dict

@classmethod
Expand All @@ -95,7 +101,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"subType": obj.get("subType"),
"id": obj.get("id"),
"name": obj.get("name"),
"walletId": obj.get("walletId")
"walletId": obj.get("walletId"),
"tradingAccount": obj.get("tradingAccount")
})
return _obj

Expand Down
15 changes: 11 additions & 4 deletions fireblocks/models/internal_transfer_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing import Any, ClassVar, Dict, List
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -28,7 +28,8 @@ class InternalTransferResponse(BaseModel):
InternalTransferResponse
""" # noqa: E501
success: StrictBool = Field(description="Indicates whether the transfer was successful")
__properties: ClassVar[List[str]] = ["success"]
id: Optional[StrictStr] = Field(default=None, description="The transaction ID of the internal transfer")
__properties: ClassVar[List[str]] = ["success", "id"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if id (nullable) is None
# and model_fields_set contains the field
if self.id is None and "id" in self.model_fields_set:
_dict['id'] = None

return _dict

@classmethod
Expand All @@ -81,7 +87,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
return cls.model_validate(obj)

_obj = cls.model_validate({
"success": obj.get("success")
"success": obj.get("success"),
"id": obj.get("id")
})
return _obj

Expand Down
2 changes: 1 addition & 1 deletion fireblocks/models/register_new_asset_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class RegisterNewAssetRequest(BaseModel):
RegisterNewAssetRequest
""" # noqa: E501
blockchain_id: StrictStr = Field(description="Native asset ID of the blockchain", alias="blockchainId")
address: StrictStr = Field(description="Asset address. - For EVM based chains this should be the token contract address. - For Stellar (XLM) this should be the issuer address. - For Algorand (ALGO) this should be the asset ID. - For TRON (TRX) this should be the token contract address. - For NEAR this will be the token address. ")
address: StrictStr = Field(description="Asset address. - EVM-based chains: token contract address - Stellar (XLM): issuer address - Algorand (ALGO): asset ID - TRON (TRX): token contract address - NEAR: token address - Solana: token's mint account address ")
symbol: Optional[StrictStr] = Field(default=None, description="Required for Stellar only, asset code is expected.")
__properties: ClassVar[List[str]] = ["blockchainId", "address", "symbol"]

Expand Down
11 changes: 9 additions & 2 deletions fireblocks/models/source_transfer_peer_path_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class SourceTransferPeerPathResponse(BaseModel):
id: Optional[StrictStr] = Field(default=None, description="The ID of the peer. You can retrieve the ID of each venue object using the endpoints for [listing vault accounts](https://developers.fireblocks.com/reference/get_vault-accounts-paged), [listing exchange account](https://developers.fireblocks.com/reference/get_exchange-accounts), [listing fiat accounts](https://developers.fireblocks.com/reference/get_fiat-accounts), [listing internal wallets](https://developers.fireblocks.com/reference/get_internal-wallets), [listing external wallets](https://developers.fireblocks.com/reference/get_external-wallets), [listing network connections](https://developers.fireblocks.com/reference/get_network-connections). For the other types, this parameter is not needed.")
name: Optional[StrictStr] = Field(default=None, description="The name of the peer.")
wallet_id: Optional[StrictStr] = Field(default=None, alias="walletId")
__properties: ClassVar[List[str]] = ["type", "subType", "id", "name", "walletId"]
trading_account: Optional[StrictStr] = Field(default=None, description="If this transaction is an exchange internal transfer, this field will be populated with the type of that trading account.", alias="tradingAccount")
__properties: ClassVar[List[str]] = ["type", "subType", "id", "name", "walletId", "tradingAccount"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -79,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.id is None and "id" in self.model_fields_set:
_dict['id'] = None

# set to None if trading_account (nullable) is None
# and model_fields_set contains the field
if self.trading_account is None and "trading_account" in self.model_fields_set:
_dict['tradingAccount'] = None

return _dict

@classmethod
Expand All @@ -95,7 +101,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"subType": obj.get("subType"),
"id": obj.get("id"),
"name": obj.get("name"),
"walletId": obj.get("walletId")
"walletId": obj.get("walletId"),
"tradingAccount": obj.get("tradingAccount")
})
return _obj

Expand Down
4 changes: 2 additions & 2 deletions fireblocks/models/token_ownership_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class TokenOwnershipResponse(BaseModel):
@field_validator('blockchain_descriptor')
def blockchain_descriptor_validate_enum(cls, value):
"""Validates the enum"""
if value not in set(['ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH']):
raise ValueError("must be one of enum values ('ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH')")
if value not in set(['ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH', 'BASECHAIN_ETH_TEST3']):
raise ValueError("must be one of enum values ('ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH', 'BASECHAIN_ETH_TEST3')")
return value

@field_validator('status')
Expand Down
4 changes: 2 additions & 2 deletions fireblocks/models/token_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class TokenResponse(BaseModel):
@field_validator('blockchain_descriptor')
def blockchain_descriptor_validate_enum(cls, value):
"""Validates the enum"""
if value not in set(['ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH']):
raise ValueError("must be one of enum values ('ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH')")
if value not in set(['ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH', 'BASECHAIN_ETH_TEST3']):
raise ValueError("must be one of enum values ('ETH', 'ETH_TEST3', 'ETH_TEST5', 'ETH_TEST6', 'POLYGON', 'POLYGON_TEST_MUMBAI', 'AMOY_POLYGON_TEST', 'XTZ', 'XTZ_TEST', 'BASECHAIN_ETH', 'BASECHAIN_ETH_TEST3')")
return value

model_config = ConfigDict(
Expand Down
1 change: 0 additions & 1 deletion test/test_asset_response_onchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def make_instance(self, include_optional) -> AssetResponseOnchain:
symbol = 'TST3',
name = 'Test 3',
decimals = 18,
standard = 'ERC20',
)
"""

Expand Down
4 changes: 4 additions & 0 deletions test/test_create_internal_transfer_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def make_instance(self, include_optional) -> CreateInternalTransferRequest:
)
else:
return CreateInternalTransferRequest(
asset = '',
amount = '',
source_type = 'COIN_FUTURES',
dest_type = 'COIN_FUTURES',
)
"""

Expand Down
3 changes: 2 additions & 1 deletion test/test_destination_transfer_peer_path_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def make_instance(self, include_optional) -> DestinationTransferPeerPathResponse
sub_type = '',
id = '',
name = '',
wallet_id = ''
wallet_id = '',
trading_account = ''
)
else:
return DestinationTransferPeerPathResponse(
Expand Down
3 changes: 2 additions & 1 deletion test/test_internal_transfer_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def make_instance(self, include_optional) -> InternalTransferResponse:
model = InternalTransferResponse()
if include_optional:
return InternalTransferResponse(
success = True
success = True,
id = ''
)
else:
return InternalTransferResponse(
Expand Down
Loading

0 comments on commit c83a1e6

Please sign in to comment.