cdp.openapi_client package¶
Subpackages¶
- cdp.openapi_client.api package
- Submodules
- cdp.openapi_client.api.evm_accounts_api module
EVMAccountsApi
EVMAccountsApi.create_evm_account()
EVMAccountsApi.create_evm_account_with_http_info()
EVMAccountsApi.create_evm_account_without_preload_content()
EVMAccountsApi.get_evm_account()
EVMAccountsApi.get_evm_account_by_name()
EVMAccountsApi.get_evm_account_by_name_with_http_info()
EVMAccountsApi.get_evm_account_by_name_without_preload_content()
EVMAccountsApi.get_evm_account_with_http_info()
EVMAccountsApi.get_evm_account_without_preload_content()
EVMAccountsApi.list_evm_accounts()
EVMAccountsApi.list_evm_accounts_with_http_info()
EVMAccountsApi.list_evm_accounts_without_preload_content()
EVMAccountsApi.send_evm_transaction()
EVMAccountsApi.send_evm_transaction_with_http_info()
EVMAccountsApi.send_evm_transaction_without_preload_content()
EVMAccountsApi.sign_evm_hash()
EVMAccountsApi.sign_evm_hash_with_http_info()
EVMAccountsApi.sign_evm_hash_without_preload_content()
EVMAccountsApi.sign_evm_message()
EVMAccountsApi.sign_evm_message_with_http_info()
EVMAccountsApi.sign_evm_message_without_preload_content()
EVMAccountsApi.sign_evm_transaction()
EVMAccountsApi.sign_evm_transaction_with_http_info()
EVMAccountsApi.sign_evm_transaction_without_preload_content()
- cdp.openapi_client.api.evm_smart_accounts_api module
EVMSmartAccountsApi
EVMSmartAccountsApi.create_evm_smart_account()
EVMSmartAccountsApi.create_evm_smart_account_with_http_info()
EVMSmartAccountsApi.create_evm_smart_account_without_preload_content()
EVMSmartAccountsApi.get_evm_smart_account()
EVMSmartAccountsApi.get_evm_smart_account_with_http_info()
EVMSmartAccountsApi.get_evm_smart_account_without_preload_content()
EVMSmartAccountsApi.get_user_operation()
EVMSmartAccountsApi.get_user_operation_with_http_info()
EVMSmartAccountsApi.get_user_operation_without_preload_content()
EVMSmartAccountsApi.list_evm_smart_accounts()
EVMSmartAccountsApi.list_evm_smart_accounts_with_http_info()
EVMSmartAccountsApi.list_evm_smart_accounts_without_preload_content()
EVMSmartAccountsApi.prepare_user_operation()
EVMSmartAccountsApi.prepare_user_operation_with_http_info()
EVMSmartAccountsApi.prepare_user_operation_without_preload_content()
EVMSmartAccountsApi.send_user_operation()
EVMSmartAccountsApi.send_user_operation_with_http_info()
EVMSmartAccountsApi.send_user_operation_without_preload_content()
- cdp.openapi_client.api.evm_token_balances_api module
- cdp.openapi_client.api.faucets_api module
- cdp.openapi_client.api.solana_accounts_api module
SolanaAccountsApi
SolanaAccountsApi.create_solana_account()
SolanaAccountsApi.create_solana_account_with_http_info()
SolanaAccountsApi.create_solana_account_without_preload_content()
SolanaAccountsApi.get_solana_account()
SolanaAccountsApi.get_solana_account_by_name()
SolanaAccountsApi.get_solana_account_by_name_with_http_info()
SolanaAccountsApi.get_solana_account_by_name_without_preload_content()
SolanaAccountsApi.get_solana_account_with_http_info()
SolanaAccountsApi.get_solana_account_without_preload_content()
SolanaAccountsApi.list_solana_accounts()
SolanaAccountsApi.list_solana_accounts_with_http_info()
SolanaAccountsApi.list_solana_accounts_without_preload_content()
SolanaAccountsApi.sign_solana_message()
SolanaAccountsApi.sign_solana_message_with_http_info()
SolanaAccountsApi.sign_solana_message_without_preload_content()
SolanaAccountsApi.sign_solana_transaction()
SolanaAccountsApi.sign_solana_transaction_with_http_info()
SolanaAccountsApi.sign_solana_transaction_without_preload_content()
- Module contents
- cdp.openapi_client.models package
- Submodules
- cdp.openapi_client.models.create_evm_account_request module
- cdp.openapi_client.models.create_evm_smart_account_request module
- cdp.openapi_client.models.create_solana_account_request module
CreateSolanaAccountRequest
CreateSolanaAccountRequest.from_dict()
CreateSolanaAccountRequest.from_json()
CreateSolanaAccountRequest.model_config
CreateSolanaAccountRequest.name
CreateSolanaAccountRequest.name_validate_regular_expression()
CreateSolanaAccountRequest.to_dict()
CreateSolanaAccountRequest.to_json()
CreateSolanaAccountRequest.to_str()
- cdp.openapi_client.models.error module
- cdp.openapi_client.models.error_type module
ErrorType
ErrorType.ALREADY_EXISTS
ErrorType.FAUCET_LIMIT_EXCEEDED
ErrorType.FORBIDDEN
ErrorType.IDEMPOTENCY_ERROR
ErrorType.INTERNAL_SERVER_ERROR
ErrorType.INVALID_REQUEST
ErrorType.INVALID_SIGNATURE
ErrorType.MALFORMED_TRANSACTION
ErrorType.NOT_FOUND
ErrorType.POLICY_VIOLATION
ErrorType.RATE_LIMIT_EXCEEDED
ErrorType.REQUEST_CANCELED
ErrorType.TIMED_OUT
ErrorType.UNAUTHORIZED
ErrorType.from_json()
- cdp.openapi_client.models.evm_account module
- cdp.openapi_client.models.evm_call module
- cdp.openapi_client.models.evm_smart_account module
EvmSmartAccount
EvmSmartAccount.address
EvmSmartAccount.address_validate_regular_expression()
EvmSmartAccount.from_dict()
EvmSmartAccount.from_json()
EvmSmartAccount.model_config
EvmSmartAccount.name
EvmSmartAccount.name_validate_regular_expression()
EvmSmartAccount.owners
EvmSmartAccount.to_dict()
EvmSmartAccount.to_json()
EvmSmartAccount.to_str()
- cdp.openapi_client.models.evm_user_operation module
EvmUserOperation
EvmUserOperation.calls
EvmUserOperation.from_dict()
EvmUserOperation.from_json()
EvmUserOperation.model_config
EvmUserOperation.network
EvmUserOperation.network_validate_enum()
EvmUserOperation.status
EvmUserOperation.status_validate_enum()
EvmUserOperation.to_dict()
EvmUserOperation.to_json()
EvmUserOperation.to_str()
EvmUserOperation.transaction_hash
EvmUserOperation.transaction_hash_validate_regular_expression()
EvmUserOperation.user_op_hash
EvmUserOperation.user_op_hash_validate_regular_expression()
- cdp.openapi_client.models.list_evm_accounts200_response module
ListEvmAccounts200Response
ListEvmAccounts200Response.accounts
ListEvmAccounts200Response.from_dict()
ListEvmAccounts200Response.from_json()
ListEvmAccounts200Response.model_config
ListEvmAccounts200Response.next_page_token
ListEvmAccounts200Response.to_dict()
ListEvmAccounts200Response.to_json()
ListEvmAccounts200Response.to_str()
- cdp.openapi_client.models.list_evm_smart_accounts200_response module
ListEvmSmartAccounts200Response
ListEvmSmartAccounts200Response.accounts
ListEvmSmartAccounts200Response.from_dict()
ListEvmSmartAccounts200Response.from_json()
ListEvmSmartAccounts200Response.model_config
ListEvmSmartAccounts200Response.next_page_token
ListEvmSmartAccounts200Response.to_dict()
ListEvmSmartAccounts200Response.to_json()
ListEvmSmartAccounts200Response.to_str()
- cdp.openapi_client.models.list_evm_token_balances200_response module
ListEvmTokenBalances200Response
ListEvmTokenBalances200Response.balances
ListEvmTokenBalances200Response.from_dict()
ListEvmTokenBalances200Response.from_json()
ListEvmTokenBalances200Response.model_config
ListEvmTokenBalances200Response.next_page_token
ListEvmTokenBalances200Response.to_dict()
ListEvmTokenBalances200Response.to_json()
ListEvmTokenBalances200Response.to_str()
- cdp.openapi_client.models.list_evm_token_balances_network module
- cdp.openapi_client.models.list_response module
- cdp.openapi_client.models.list_solana_accounts200_response module
ListSolanaAccounts200Response
ListSolanaAccounts200Response.accounts
ListSolanaAccounts200Response.from_dict()
ListSolanaAccounts200Response.from_json()
ListSolanaAccounts200Response.model_config
ListSolanaAccounts200Response.next_page_token
ListSolanaAccounts200Response.to_dict()
ListSolanaAccounts200Response.to_json()
ListSolanaAccounts200Response.to_str()
- cdp.openapi_client.models.prepare_user_operation_request module
PrepareUserOperationRequest
PrepareUserOperationRequest.calls
PrepareUserOperationRequest.from_dict()
PrepareUserOperationRequest.from_json()
PrepareUserOperationRequest.model_config
PrepareUserOperationRequest.network
PrepareUserOperationRequest.network_validate_enum()
PrepareUserOperationRequest.paymaster_url
PrepareUserOperationRequest.to_dict()
PrepareUserOperationRequest.to_json()
PrepareUserOperationRequest.to_str()
- cdp.openapi_client.models.request_evm_faucet200_response module
- cdp.openapi_client.models.request_evm_faucet_request module
RequestEvmFaucetRequest
RequestEvmFaucetRequest.address
RequestEvmFaucetRequest.address_validate_regular_expression()
RequestEvmFaucetRequest.from_dict()
RequestEvmFaucetRequest.from_json()
RequestEvmFaucetRequest.model_config
RequestEvmFaucetRequest.network
RequestEvmFaucetRequest.network_validate_enum()
RequestEvmFaucetRequest.to_dict()
RequestEvmFaucetRequest.to_json()
RequestEvmFaucetRequest.to_str()
RequestEvmFaucetRequest.token
RequestEvmFaucetRequest.token_validate_enum()
- cdp.openapi_client.models.request_solana_faucet200_response module
RequestSolanaFaucet200Response
RequestSolanaFaucet200Response.from_dict()
RequestSolanaFaucet200Response.from_json()
RequestSolanaFaucet200Response.model_config
RequestSolanaFaucet200Response.to_dict()
RequestSolanaFaucet200Response.to_json()
RequestSolanaFaucet200Response.to_str()
RequestSolanaFaucet200Response.transaction_signature
- cdp.openapi_client.models.request_solana_faucet_request module
RequestSolanaFaucetRequest
RequestSolanaFaucetRequest.address
RequestSolanaFaucetRequest.address_validate_regular_expression()
RequestSolanaFaucetRequest.from_dict()
RequestSolanaFaucetRequest.from_json()
RequestSolanaFaucetRequest.model_config
RequestSolanaFaucetRequest.to_dict()
RequestSolanaFaucetRequest.to_json()
RequestSolanaFaucetRequest.to_str()
RequestSolanaFaucetRequest.token
RequestSolanaFaucetRequest.token_validate_enum()
- cdp.openapi_client.models.send_evm_transaction200_response module
- cdp.openapi_client.models.send_evm_transaction_request module
SendEvmTransactionRequest
SendEvmTransactionRequest.from_dict()
SendEvmTransactionRequest.from_json()
SendEvmTransactionRequest.model_config
SendEvmTransactionRequest.network
SendEvmTransactionRequest.network_validate_enum()
SendEvmTransactionRequest.to_dict()
SendEvmTransactionRequest.to_json()
SendEvmTransactionRequest.to_str()
SendEvmTransactionRequest.transaction
- cdp.openapi_client.models.send_user_operation_request module
- cdp.openapi_client.models.sign_evm_hash200_response module
- cdp.openapi_client.models.sign_evm_hash_request module
- cdp.openapi_client.models.sign_evm_message200_response module
- cdp.openapi_client.models.sign_evm_message_request module
- cdp.openapi_client.models.sign_evm_transaction200_response module
- cdp.openapi_client.models.sign_evm_transaction_request module
- cdp.openapi_client.models.sign_solana_message200_response module
- cdp.openapi_client.models.sign_solana_message_request module
- cdp.openapi_client.models.sign_solana_transaction200_response module
SignSolanaTransaction200Response
SignSolanaTransaction200Response.from_dict()
SignSolanaTransaction200Response.from_json()
SignSolanaTransaction200Response.model_config
SignSolanaTransaction200Response.signed_transaction
SignSolanaTransaction200Response.to_dict()
SignSolanaTransaction200Response.to_json()
SignSolanaTransaction200Response.to_str()
- cdp.openapi_client.models.sign_solana_transaction_request module
- cdp.openapi_client.models.solana_account module
- cdp.openapi_client.models.token module
- cdp.openapi_client.models.token_amount module
- cdp.openapi_client.models.token_balance module
- Module contents
- cdp.openapi_client.test package
- Submodules
- cdp.openapi_client.test.test_create_evm_account_request module
- cdp.openapi_client.test.test_create_evm_smart_account_request module
- cdp.openapi_client.test.test_create_solana_account_request module
- cdp.openapi_client.test.test_error module
- cdp.openapi_client.test.test_error_type module
- cdp.openapi_client.test.test_evm_account module
- cdp.openapi_client.test.test_evm_accounts_api module
TestEVMAccountsApi
TestEVMAccountsApi.asyncSetUp()
TestEVMAccountsApi.asyncTearDown()
TestEVMAccountsApi.test_create_evm_account()
TestEVMAccountsApi.test_get_evm_account()
TestEVMAccountsApi.test_get_evm_account_by_name()
TestEVMAccountsApi.test_list_evm_accounts()
TestEVMAccountsApi.test_send_evm_transaction()
TestEVMAccountsApi.test_sign_evm_hash()
TestEVMAccountsApi.test_sign_evm_message()
TestEVMAccountsApi.test_sign_evm_transaction()
- cdp.openapi_client.test.test_evm_call module
- cdp.openapi_client.test.test_evm_smart_account module
- cdp.openapi_client.test.test_evm_smart_accounts_api module
TestEVMSmartAccountsApi
TestEVMSmartAccountsApi.asyncSetUp()
TestEVMSmartAccountsApi.asyncTearDown()
TestEVMSmartAccountsApi.test_create_evm_smart_account()
TestEVMSmartAccountsApi.test_get_evm_smart_account()
TestEVMSmartAccountsApi.test_get_user_operation()
TestEVMSmartAccountsApi.test_list_evm_smart_accounts()
TestEVMSmartAccountsApi.test_prepare_user_operation()
TestEVMSmartAccountsApi.test_send_user_operation()
- cdp.openapi_client.test.test_evm_token_balances_api module
- cdp.openapi_client.test.test_evm_user_operation module
- cdp.openapi_client.test.test_faucets_api module
- cdp.openapi_client.test.test_list_evm_accounts200_response module
- cdp.openapi_client.test.test_list_evm_smart_accounts200_response module
- cdp.openapi_client.test.test_list_evm_token_balances200_response module
- cdp.openapi_client.test.test_list_evm_token_balances_network module
- cdp.openapi_client.test.test_list_response module
- cdp.openapi_client.test.test_list_solana_accounts200_response module
- cdp.openapi_client.test.test_prepare_user_operation_request module
- cdp.openapi_client.test.test_request_evm_faucet200_response module
- cdp.openapi_client.test.test_request_evm_faucet_request module
- cdp.openapi_client.test.test_request_solana_faucet200_response module
- cdp.openapi_client.test.test_request_solana_faucet_request module
- cdp.openapi_client.test.test_send_evm_transaction200_response module
- cdp.openapi_client.test.test_send_evm_transaction_request module
- cdp.openapi_client.test.test_send_user_operation_request module
- cdp.openapi_client.test.test_sign_evm_hash200_response module
- cdp.openapi_client.test.test_sign_evm_hash_request module
- cdp.openapi_client.test.test_sign_evm_message200_response module
- cdp.openapi_client.test.test_sign_evm_message_request module
- cdp.openapi_client.test.test_sign_evm_transaction200_response module
- cdp.openapi_client.test.test_sign_evm_transaction_request module
- cdp.openapi_client.test.test_sign_solana_message200_response module
- cdp.openapi_client.test.test_sign_solana_message_request module
- cdp.openapi_client.test.test_sign_solana_transaction200_response module
- cdp.openapi_client.test.test_sign_solana_transaction_request module
- cdp.openapi_client.test.test_solana_account module
- cdp.openapi_client.test.test_solana_accounts_api module
TestSolanaAccountsApi
TestSolanaAccountsApi.asyncSetUp()
TestSolanaAccountsApi.asyncTearDown()
TestSolanaAccountsApi.test_create_solana_account()
TestSolanaAccountsApi.test_get_solana_account()
TestSolanaAccountsApi.test_get_solana_account_by_name()
TestSolanaAccountsApi.test_list_solana_accounts()
TestSolanaAccountsApi.test_sign_solana_message()
TestSolanaAccountsApi.test_sign_solana_transaction()
- cdp.openapi_client.test.test_token module
- cdp.openapi_client.test.test_token_amount module
- cdp.openapi_client.test.test_token_balance module
- Module contents
Submodules¶
cdp.openapi_client.api_client module¶
Coinbase Developer Platform APIs
The Coinbase Developer Platform APIs - leading the world’s transition onchain.
The version of the OpenAPI document: 2.0.0 Contact: cdp@coinbase.com Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class cdp.openapi_client.api_client.ApiClient(configuration=None, header_name=None, header_value=None, cookie=None)¶
Bases:
object
Generic API client for OpenAPI client library builds.
OpenAPI generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of the methods and models for each application are generated from the OpenAPI templates.
- Parameters:
configuration – .Configuration object for this client
header_name – a header to pass when making calls to the API.
header_value – a header value to pass when making calls to the API.
cookie – a cookie to include in the header when making calls to the API
- NATIVE_TYPES_MAPPING = {'bool': <class 'bool'>, 'date': <class 'datetime.date'>, 'datetime': <class 'datetime.datetime'>, 'decimal': <class 'decimal.Decimal'>, 'float': <class 'float'>, 'int': <class 'int'>, 'long': <class 'int'>, 'object': <class 'object'>, 'str': <class 'str'>}¶
- PRIMITIVE_TYPES = (<class 'float'>, <class 'bool'>, <class 'bytes'>, <class 'str'>, <class 'int'>)¶
- async call_api(method, url, header_params=None, body=None, post_params=None, _request_timeout=None)¶
Makes the HTTP request (synchronous) :type method: :param method: Method to call. :type url: :param url: Path to method endpoint. :type header_params: :param header_params: Header parameters to be
placed in the request header.
- Parameters:
body – Request body.
dict (post_params) – Request post form parameters, for application/x-www-form-urlencoded, multipart/form-data.
_request_timeout – timeout setting for this request.
- Return type:
- Returns:
RESTResponse
- async close()¶
- deserialize(response_text, response_type, content_type)¶
Deserializes response into an object.
- Parameters:
response – RESTResponse object to be deserialized.
response_type (
str
) – class literal for deserialized object, or string of class name.content_type (
Optional
[str
]) – content type of response.
- Returns:
deserialized object.
- files_parameters(files)¶
Builds form parameters.
- Parameters:
files (
Dict
[str
,Union
[str
,bytes
,List
[str
],List
[bytes
],Tuple
[str
,bytes
]]]) – File parameters.- Returns:
Form parameters with files.
- classmethod get_default()¶
Return new instance of ApiClient.
This method returns newly created, based on default constructor, object of ApiClient class or returns a copy of default ApiClient.
- Returns:
The ApiClient object.
- param_serialize(method, resource_path, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, auth_settings=None, collection_formats=None, _host=None, _request_auth=None)¶
Builds the HTTP request params needed by the request. :type method: :param method: Method to call. :type resource_path: :param resource_path: Path to method endpoint. :type path_params: :param path_params: Path parameters in the url. :type query_params: :param query_params: Query parameters in the url. :type header_params: :param header_params: Header parameters to be
placed in the request header.
- Parameters:
body – Request body.
dict (files) – Request post form parameters, for application/x-www-form-urlencoded, multipart/form-data.
list (auth_settings) – Auth Settings names for the request.
dict – key -> filename, value -> filepath, for multipart/form-data.
collection_formats – dict of collection formats for path, query, header, and post parameters.
_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.
- Return type:
Tuple
[str
,str
,Dict
[str
,str
],Optional
[str
],List
[str
]]- Returns:
tuple of form (path, http_method, query_params, header_params, body, post_params, files)
- parameters_to_tuples(params, collection_formats)¶
Get parameters as list of tuples, formatting collections.
- Parameters:
params – Parameters as dict or list of two-tuples
collection_formats (dict) – Parameter collection formats
- Returns:
Parameters as list of tuples, collections formatted
- parameters_to_url_query(params, collection_formats)¶
Get parameters as list of tuples, formatting collections.
- Parameters:
params – Parameters as dict or list of two-tuples
collection_formats (dict) – Parameter collection formats
- Returns:
URL query string (e.g. a=Hello%20World&b=123)
- response_deserialize(response_data, response_types_map=None)¶
Deserializes response into an object. :type response_data:
RESTResponse
:param response_data: RESTResponse object to be deserialized. :type response_types_map:Optional
[Dict
[str
,TypeVar
(T
)]] :param response_types_map: dict of response types. :rtype:ApiResponse
:return: ApiResponse
- sanitize_for_serialization(obj)¶
Builds a JSON POST object.
If obj is None, return None. If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date
convert to string in iso8601 format.
If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict.
- Parameters:
obj – The data to serialize.
- Returns:
The serialized form of data.
- select_header_accept(accepts)¶
Returns Accept based on an array of accepts provided.
- Parameters:
accepts (
List
[str
]) – List of headers.- Return type:
Optional
[str
]- Returns:
Accept (e.g. application/json).
- select_header_content_type(content_types)¶
Returns Content-Type based on an array of content_types provided.
- Parameters:
content_types – List of content-types.
- Returns:
Content-Type (e.g. application/json).
- classmethod set_default(default)¶
Set default instance of ApiClient.
It stores default ApiClient.
- Parameters:
default – object of ApiClient.
- set_default_header(header_name, header_value)¶
- update_params_for_auth(headers, queries, auth_settings, resource_path, method, body, request_auth=None)¶
Updates header and query params based on authentication setting.
- Parameters:
headers – Header parameters dict to be updated.
queries – Query parameters tuple list to be updated.
auth_settings – Authentication setting identifiers list.
- Return type:
None
- Resource_path:
A string representation of the HTTP request resource path.
- Method:
A string representation of the HTTP request method.
- Body:
A object representing the body of the HTTP request.
The object type is the return value of sanitize_for_serialization(). :type request_auth: :param request_auth: if set, the provided settings will
override the token in the configuration.
- property user_agent¶
User agent for this API client
cdp.openapi_client.api_response module¶
API response object.
- class cdp.openapi_client.api_response.ApiResponse(**data)¶
Bases:
BaseModel
,Generic
[T
]API response object
- data: T¶
- headers: Optional[Mapping[str, str]]¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- raw_data: StrictBytes¶
- status_code: StrictInt¶
cdp.openapi_client.cdp_api_client module¶
- class cdp.openapi_client.cdp_api_client.CdpApiClient(api_key_id, api_key_secret, wallet_secret=None, debugging=False, base_path='https://api.cdp.coinbase.com/platform', max_network_retries=3, source='sdk', source_version=<module 'cdp.__version__' from '/home/runner/work/cdp-sdk/cdp-sdk/python/cdp/__version__.py'>)¶
Bases:
ApiClient
CDP API Client that handles authentication and API calls for Coinbase.
- async call_api(method, url, header_params=None, body=None, post_params=None, _request_timeout=None)¶
Make the HTTP request (asynchronous).
- Return type:
- response_deserialize(response_data, response_types_map=None)¶
Deserialize the API response.
- Parameters:
response_data (
RESTResponse
) – REST response data.response_types_map (
Optional
[dict
[str
,TypeVar
(T
)]]) – Map of response types.
- Return type:
- Returns:
ApiResponse[ApiResponseT]
cdp.openapi_client.configuration module¶
Coinbase Developer Platform APIs
The Coinbase Developer Platform APIs - leading the world’s transition onchain.
The version of the OpenAPI document: 2.0.0 Contact: cdp@coinbase.com Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class cdp.openapi_client.configuration.APIKeyAuthSetting¶
Bases:
dict
-
in:
str
¶
-
key:
str
¶
-
type:
Literal
['api_key'
]¶
-
value:
Optional
[str
]¶
-
in:
- class cdp.openapi_client.configuration.AuthSettings¶
Bases:
dict
-
bearerAuth:
BearerFormatAuthSetting
¶
-
bearerAuth:
- class cdp.openapi_client.configuration.BasicAuthSetting¶
Bases:
dict
-
in:
Literal
['header'
]¶
-
key:
Literal
['Authorization'
]¶
-
type:
Literal
['basic'
]¶
-
value:
Optional
[str
]¶
-
in:
- class cdp.openapi_client.configuration.BearerAuthSetting¶
Bases:
dict
-
in:
Literal
['header'
]¶
-
key:
Literal
['Authorization'
]¶
-
type:
Literal
['bearer'
]¶
-
value:
str
¶
-
in:
- class cdp.openapi_client.configuration.BearerFormatAuthSetting¶
Bases:
dict
-
format:
Literal
['JWT'
]¶
-
in:
Literal
['header'
]¶
-
key:
Literal
['Authorization'
]¶
-
type:
Literal
['bearer'
]¶
-
value:
str
¶
-
format:
- class cdp.openapi_client.configuration.Configuration(host=None, api_key=None, api_key_prefix=None, username=None, password=None, access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ignore_operation_servers=False, ssl_ca_cert=None, retries=None, *, debug=None)¶
Bases:
object
This class contains various settings of the API client.
- Parameters:
host (
Optional
[str
]) – Base url.
- :param ignore_operation_servers
Boolean to ignore operation servers for the API client. Config will use host as the base url regardless of the operation servers.
- Parameters:
api_key (
Optional
[Dict
[str
,str
]]) – Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret.api_key_prefix (
Optional
[Dict
[str
,str
]]) – Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data.username (
Optional
[str
]) – Username for HTTP basic authentication.password (
Optional
[str
]) – Password for HTTP basic authentication.access_token (
Optional
[str
]) – Access token.server_index (
Optional
[int
]) – Index to servers configuration.server_variables (
Optional
[Dict
[str
,str
]]) – Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before.server_operation_index (
Optional
[Dict
[int
,int
]]) – Mapping from operation ID to an index to server configuration.server_operation_variables (
Optional
[Dict
[int
,Dict
[str
,str
]]]) – Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before.ssl_ca_cert (
Optional
[str
]) – str - the path to a file of concatenated CA certificates in PEM format.retries (
Optional
[int
]) – Number of retries for API requests.
- Example:
- access_token¶
Access token
- assert_hostname¶
Set this to True/False to enable/disable SSL hostname verification.
- auth_settings()¶
Gets Auth Settings dict for api client.
- Return type:
- Returns:
The Auth Settings information dict.
- cert_file¶
client certificate file
- connection_pool_maxsize¶
This value is passed to the aiohttp to limit simultaneous connections. Default values is 100, None means no-limit.
- date_format¶
date format
- datetime_format¶
datetime format
- property debug: bool¶
Debug status
- Parameters:
value – The debug status, True or False.
- Type:
bool
- get_api_key_with_prefix(identifier, alias=None)¶
Gets API key (with prefix if set).
- Parameters:
identifier (
str
) – The identifier of apiKey.alias (
Optional
[str
]) – The alternative identifier of apiKey.
- Return type:
Optional
[str
]- Returns:
The token for api key authentication.
- get_basic_auth_token()¶
Gets HTTP basic authentication header (string).
- Return type:
Optional
[str
]- Returns:
The token for basic HTTP authentication.
- classmethod get_default()¶
Return the default configuration.
This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default configuration.
- Return type:
Self
- Returns:
The configuration object.
- classmethod get_default_copy()¶
Deprecated. Please use get_default instead.
Deprecated. Please use get_default instead.
- Return type:
Self
- Returns:
The configuration object.
- get_host_from_settings(index, variables=None, servers=None)¶
Gets host URL based on the index and variables :type index:
Optional
[int
] :param index: array index of the host settings :type variables:Optional
[Dict
[str
,str
]] :param variables: hash of variable and the corresponding value :type servers:Optional
[List
[HostSetting
]] :param servers: an array of host settings or None :rtype:str
:return: URL based on host settings
- get_host_settings()¶
Gets an array of host settings
- Return type:
List
[HostSetting
]- Returns:
An array of host settings
- property host: str¶
Return generated host.
- ignore_operation_servers¶
Ignore operation servers
- key_file¶
client key file
- logger¶
Logging Settings
- property logger_file: str | None¶
Debug file location
-
logger_file_handler:
Optional
[FileHandler
]¶ Log file handler
- property logger_format: str¶
Log format
- logger_stream_handler¶
Log stream handler
- password¶
Password for HTTP basic authentication
-
proxy:
Optional
[str
]¶ Proxy URL
- proxy_headers¶
Proxy headers
- refresh_api_key_hook¶
function hook to refresh API key if expired
- retries¶
Adding retries to override urllib3 default value 3
- safe_chars_for_path_param¶
Safe chars for path_param
- server_operation_index¶
Default server index
- server_operation_variables¶
Default server variables
- classmethod set_default(default)¶
Set default instance of configuration.
It stores default configuration, which can be returned by get_default_copy method.
- Parameters:
default (
Optional
[Self
]) – object of Configuration- Return type:
None
- socket_options¶
Options to pass down to the underlying urllib3 socket
- ssl_ca_cert¶
Set this to customize the certificate file to verify the peer.
- temp_folder_path¶
Temp file folder for downloading files
- tls_server_name¶
SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server.
- to_debug_report()¶
Gets the essential information for debugging.
- Return type:
str
- Returns:
The report for debugging.
- username¶
Username for HTTP basic authentication
- verify_ssl¶
SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server.
- class cdp.openapi_client.configuration.GenericAuthSetting¶
Bases:
dict
-
in:
str
¶
-
key:
str
¶
-
type:
str
¶
-
value:
str
¶
-
in:
- class cdp.openapi_client.configuration.HTTPSignatureAuthSetting¶
Bases:
dict
-
in:
Literal
['header'
]¶
-
key:
Literal
['Authorization'
]¶
-
type:
Literal
['http-signature'
]¶
-
value:
None
¶
-
in:
- class cdp.openapi_client.configuration.HostSetting¶
Bases:
TypedDict
-
description:
str
¶
-
url:
str
¶
-
variables:
NotRequired
[Dict
[str
,HostSettingVariable
]]¶
-
description:
cdp.openapi_client.constants module¶
Specifies package level constants used throughout the package.
cdp.openapi_client.errors module¶
- exception cdp.openapi_client.errors.ApiError(http_code, error_type, error_message, correlation_id=None, error_link=None)¶
Bases:
Exception
A wrapper for API exceptions to provide more context.
- property correlation_id: str | None¶
Get the correlation ID.
- Returns:
The correlation ID.
- Return type:
str | None
- property error_link: str | None¶
Get the documentation URL for this error.
- Returns:
The URL to the error documentation.
- Return type:
str | None
- property error_message: str | None¶
Get the API error message.
- Returns:
The API error message.
- Return type:
str | None
- property error_type: str | None¶
Get the API error type.
- Returns:
The API error type.
- Return type:
str | None
- property http_code: int | None¶
Get the HTTP status code.
- Returns:
The HTTP status code.
- Return type:
int
- cdp.openapi_client.errors.is_openapi_error(obj)¶
Check if an object matches the OpenAPI error format.
- Parameters:
obj (
Any
) – The object to check- Returns:
True if the object is an OpenAPI error
- Return type:
bool
cdp.openapi_client.exceptions module¶
Coinbase Developer Platform APIs
The Coinbase Developer Platform APIs - leading the world’s transition onchain.
The version of the OpenAPI document: 2.0.0 Contact: cdp@coinbase.com Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- exception cdp.openapi_client.exceptions.ApiAttributeError(msg, path_to_item=None)¶
Bases:
OpenApiException
,AttributeError
- exception cdp.openapi_client.exceptions.ApiException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
OpenApiException
- classmethod from_response(*, http_resp, body, data)¶
- Return type:
Self
- exception cdp.openapi_client.exceptions.ApiKeyError(msg, path_to_item=None)¶
Bases:
OpenApiException
,KeyError
- exception cdp.openapi_client.exceptions.ApiTypeError(msg, path_to_item=None, valid_classes=None, key_type=None)¶
Bases:
OpenApiException
,TypeError
- exception cdp.openapi_client.exceptions.ApiValueError(msg, path_to_item=None)¶
Bases:
OpenApiException
,ValueError
- exception cdp.openapi_client.exceptions.BadRequestException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- exception cdp.openapi_client.exceptions.ConflictException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
Exception for HTTP 409 Conflict.
- exception cdp.openapi_client.exceptions.ForbiddenException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- exception cdp.openapi_client.exceptions.NotFoundException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- exception cdp.openapi_client.exceptions.OpenApiException¶
Bases:
Exception
The base exception class for all OpenAPIExceptions
- exception cdp.openapi_client.exceptions.ServiceException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- exception cdp.openapi_client.exceptions.UnauthorizedException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
- exception cdp.openapi_client.exceptions.UnprocessableEntityException(status=None, reason=None, http_resp=None, *, body=None, data=None)¶
Bases:
ApiException
Exception for HTTP 422 Unprocessable Entity.
- cdp.openapi_client.exceptions.render_path(path_to_item)¶
Returns a string representation of a path
cdp.openapi_client.rest module¶
Coinbase Developer Platform APIs
The Coinbase Developer Platform APIs - leading the world’s transition onchain.
The version of the OpenAPI document: 2.0.0 Contact: cdp@coinbase.com Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
- class cdp.openapi_client.rest.RESTClientObject(configuration)¶
Bases:
object
- async close()¶
- Return type:
None
- async request(method, url, headers=None, body=None, post_params=None, _request_timeout=None)¶
Execute request
- Parameters:
method – http request method
url – http request url
headers – http request headers
body – request json body, for application/json
post_params – request post parameters, application/x-www-form-urlencoded and multipart/form-data
_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.
Module contents¶
Coinbase Developer Platform APIs
The Coinbase Developer Platform APIs - leading the world’s transition onchain.
The version of the OpenAPI document: 2.0.0 Contact: cdp@coinbase.com Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.