Skip to content

Commit

Permalink
Generated SDK #4496
Browse files Browse the repository at this point in the history
  • Loading branch information
fireblocks_dx_team committed Jul 3, 2024
1 parent 8ef3361 commit e571ccd
Show file tree
Hide file tree
Showing 19 changed files with 54 additions and 29 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
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
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
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
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
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
6 changes: 4 additions & 2 deletions test/test_network_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ def make_instance(self, include_optional) -> NetworkRecord:
sub_type = '',
id = '',
name = '',
wallet_id = '', ),
wallet_id = '',
trading_account = '', ),
destination = fireblocks.models.destination_transfer_peer_path_response.DestinationTransferPeerPathResponse(
type = 'VAULT_ACCOUNT',
sub_type = '',
id = '',
name = '',
wallet_id = '', ),
wallet_id = '',
trading_account = '', ),
tx_hash = '',
network_fee = '',
asset_id = '',
Expand Down
3 changes: 2 additions & 1 deletion test/test_source_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) -> SourceTransferPeerPathResponse:
sub_type = '',
id = '',
name = '',
wallet_id = ''
wallet_id = '',
trading_account = ''
)
else:
return SourceTransferPeerPathResponse(
Expand Down
15 changes: 10 additions & 5 deletions test/test_transaction_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ def make_instance(self, include_optional) -> TransactionResponse:
sub_type = '',
id = '',
name = '',
wallet_id = '', ),
wallet_id = '',
trading_account = '', ),
source_address = '',
tag = '',
destination = fireblocks.models.destination_transfer_peer_path_response.DestinationTransferPeerPathResponse(
type = 'VAULT_ACCOUNT',
sub_type = '',
id = '',
name = '',
wallet_id = '', ),
wallet_id = '',
trading_account = '', ),
destinations = [
fireblocks.models.transaction_response_destination.TransactionResponseDestination(
destination_address = null,
Expand All @@ -73,7 +75,8 @@ def make_instance(self, include_optional) -> TransactionResponse:
sub_type = '',
id = '',
name = '',
wallet_id = '', ),
wallet_id = '',
trading_account = '', ),
authorization_info = fireblocks.models.authorization_info.AuthorizationInfo(
allow_operator_as_authorizer = True,
logic = 'AND',
Expand Down Expand Up @@ -111,13 +114,15 @@ def make_instance(self, include_optional) -> TransactionResponse:
sub_type = '',
id = '',
name = '',
wallet_id = '', ),
wallet_id = '',
trading_account = '', ),
destination = fireblocks.models.destination_transfer_peer_path_response.DestinationTransferPeerPathResponse(
type = 'VAULT_ACCOUNT',
sub_type = '',
id = '',
name = '',
wallet_id = '', ),
wallet_id = '',
trading_account = '', ),
tx_hash = '',
network_fee = '',
asset_id = '',
Expand Down
3 changes: 2 additions & 1 deletion test/test_transaction_response_destination.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def make_instance(self, include_optional) -> TransactionResponseDestination:
sub_type = '',
id = '',
name = '',
wallet_id = '', ),
wallet_id = '',
trading_account = '', ),
authorization_info = fireblocks.models.authorization_info.AuthorizationInfo(
allow_operator_as_authorizer = True,
logic = 'AND',
Expand Down

0 comments on commit e571ccd

Please sign in to comment.