Class: CcipDirectoryAndConfigurationRestApiV1::TokensApi
- Defined in:
- lib/ccip_directory_and_configuration_rest_api_v1/apis/tokens_api.rb
Overview
TokensApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#get_tokens(environment, token_id: nil, chain_id: nil, output_key: OutputKey::CHAINID) ⇒ ApiResponse
Returns information about Cross-Chain Interoperability Protocol (CCIP) supported tokens.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from CcipDirectoryAndConfigurationRestApiV1::BaseApi
Instance Method Details
#get_tokens(environment, token_id: nil, chain_id: nil, output_key: OutputKey::CHAINID) ⇒ ApiResponse
Returns information about Cross-Chain Interoperability Protocol (CCIP) supported tokens. The response includes token details organized by token symbol, with chain-specific information nested under each token and indexed by chain ID or selector (depending on the outputKey parameter). environment to query identifier (e.g., “LINK” for Chainlink token, or “LINK,ETH” for multiple tokens) token is supported (e.g., “1” for Ethereum, or “1,56” for Ethereum and BSC) organizing the response data
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/apis/tokens_api.rb', line 24 def get_tokens(environment, token_id: nil, chain_id: nil, output_key: OutputKey::CHAINID) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/tokens', Server::DEFAULT) .query_param(new_parameter(environment, key: 'environment') .is_required(true)) .query_param(new_parameter(token_id, key: 'token_id')) .query_param(new_parameter(chain_id, key: 'chain_id')) .query_param(new_parameter(output_key, key: 'outputKey')) .header_param(new_parameter('application/json', key: 'accept'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TokenApiResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Invalid request parameters', ErrorResponseException) .local_error('500', 'Internal server error', ErrorResponseException)) .execute end |