chainlink-apimatic-sdk 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +35 -60
- data/bin/console +4 -4
- data/lib/ccip_directory_and_configuration_rest_api_v1/api_helper.rb +10 -0
- data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/apis/base_api.rb +5 -5
- data/lib/ccip_directory_and_configuration_rest_api_v1/apis/chains_api.rb +69 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/apis/lanes_api.rb +75 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/apis/tokens_api.rb +51 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/client.rb +72 -0
- data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/configuration.rb +27 -41
- data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/exceptions/api_exception.rb +4 -4
- data/lib/ccip_directory_and_configuration_rest_api_v1/exceptions/error_response_exception.rb +57 -0
- data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/http/api_response.rb +4 -4
- data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_call_back.rb +10 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_method_enum.rb +10 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_request.rb +10 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_response.rb +10 -0
- data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/http/proxy_settings.rb +4 -4
- data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/logging/configuration/api_logging_configuration.rb +4 -4
- data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/logging/sdk_logger.rb +4 -4
- data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/models/base_model.rb +4 -4
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_api_response.rb +99 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_config_error.rb +100 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_details.rb +272 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_family.rb +64 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_info.rb +135 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb +144 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_type.rb +64 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/data.rb +171 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/enrich_fee_tokens.rb +36 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/environment.rb +36 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/environment3.rb +36 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/family.rb +64 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/fee_token_enriched.rb +130 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_api_response.rb +102 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_config_error.rb +102 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_details.rb +116 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb +119 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/off_ramp.rb +82 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/on_ramp.rb +95 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/output_key.rb +40 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/pool_type.rb +44 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/search_type.rb +46 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_api_response.rb +101 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_chain_data.rb +190 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_chain_info.rb +159 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_config_error.rb +91 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_details.rb +99 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_metadata.rb +119 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1/utilities/date_time_helper.rb +11 -0
- data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/utilities/file_wrapper.rb +4 -4
- data/lib/ccip_directory_and_configuration_rest_api_v1/utilities/union_type_lookup.rb +61 -0
- data/lib/ccip_directory_and_configuration_rest_api_v1.rb +112 -0
- metadata +51 -36
- data/lib/swagger_petstore_open_api30/api_helper.rb +0 -10
- data/lib/swagger_petstore_open_api30/apis/pet_api.rb +0 -287
- data/lib/swagger_petstore_open_api30/apis/store_api.rb +0 -131
- data/lib/swagger_petstore_open_api30/apis/user_api.rb +0 -233
- data/lib/swagger_petstore_open_api30/client.rb +0 -94
- data/lib/swagger_petstore_open_api30/exceptions/oauth_provider_exception.rb +0 -64
- data/lib/swagger_petstore_open_api30/http/auth/api_key.rb +0 -52
- data/lib/swagger_petstore_open_api30/http/auth/petstore_auth.rb +0 -112
- data/lib/swagger_petstore_open_api30/http/http_call_back.rb +0 -10
- data/lib/swagger_petstore_open_api30/http/http_method_enum.rb +0 -10
- data/lib/swagger_petstore_open_api30/http/http_request.rb +0 -10
- data/lib/swagger_petstore_open_api30/http/http_response.rb +0 -10
- data/lib/swagger_petstore_open_api30/models/api_response.rb +0 -118
- data/lib/swagger_petstore_open_api30/models/category.rb +0 -105
- data/lib/swagger_petstore_open_api30/models/oauth_provider_error.rb +0 -62
- data/lib/swagger_petstore_open_api30/models/oauth_scope_petstore_auth.rb +0 -36
- data/lib/swagger_petstore_open_api30/models/oauth_token.rb +0 -125
- data/lib/swagger_petstore_open_api30/models/order.rb +0 -167
- data/lib/swagger_petstore_open_api30/models/order_status.rb +0 -40
- data/lib/swagger_petstore_open_api30/models/pet.rb +0 -168
- data/lib/swagger_petstore_open_api30/models/pet_status.rb +0 -40
- data/lib/swagger_petstore_open_api30/models/tag.rb +0 -105
- data/lib/swagger_petstore_open_api30/models/user.rb +0 -182
- data/lib/swagger_petstore_open_api30/utilities/date_time_helper.rb +0 -11
- data/lib/swagger_petstore_open_api30/utilities/xml_utilities.rb +0 -12
- data/lib/swagger_petstore_open_api30.rb +0 -62
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# ccip_directory_and_configuration_rest_api_v1
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically
|
|
4
|
+
# generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CcipDirectoryAndConfigurationRestApiV1
|
|
7
|
+
# Chain details grouped by chain family
|
|
8
|
+
class Data < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# EVM chain details keyed by the specified output key
|
|
13
|
+
# @return [Hash[String, ChainDetails]]
|
|
14
|
+
attr_accessor :evm
|
|
15
|
+
|
|
16
|
+
# Solana chain details keyed by the specified output key
|
|
17
|
+
# @return [Hash[String, ChainDetails]]
|
|
18
|
+
attr_accessor :solana
|
|
19
|
+
|
|
20
|
+
# Aptos chain details keyed by the specified output key
|
|
21
|
+
# @return [Hash[String, ChainDetails]]
|
|
22
|
+
attr_accessor :aptos
|
|
23
|
+
|
|
24
|
+
# Sui chain details keyed by the specified output key
|
|
25
|
+
# @return [Hash[String, ChainDetails]]
|
|
26
|
+
attr_accessor :sui
|
|
27
|
+
|
|
28
|
+
# Tron chain details keyed by the specified output key
|
|
29
|
+
# @return [Hash[String, ChainDetails]]
|
|
30
|
+
attr_accessor :tron
|
|
31
|
+
|
|
32
|
+
# Canton chain details keyed by the specified output key
|
|
33
|
+
# @return [Hash[String, ChainDetails]]
|
|
34
|
+
attr_accessor :canton
|
|
35
|
+
|
|
36
|
+
# TON chain details keyed by the specified output key
|
|
37
|
+
# @return [Hash[String, ChainDetails]]
|
|
38
|
+
attr_accessor :ton
|
|
39
|
+
|
|
40
|
+
# Stellar chain details keyed by the specified output key
|
|
41
|
+
# @return [Hash[String, ChainDetails]]
|
|
42
|
+
attr_accessor :stellar
|
|
43
|
+
|
|
44
|
+
# Starknet chain details keyed by the specified output key
|
|
45
|
+
# @return [Hash[String, ChainDetails]]
|
|
46
|
+
attr_accessor :starknet
|
|
47
|
+
|
|
48
|
+
# A mapping from model property names to API property names.
|
|
49
|
+
def self.names
|
|
50
|
+
@_hash = {} if @_hash.nil?
|
|
51
|
+
@_hash['evm'] = 'evm'
|
|
52
|
+
@_hash['solana'] = 'solana'
|
|
53
|
+
@_hash['aptos'] = 'aptos'
|
|
54
|
+
@_hash['sui'] = 'sui'
|
|
55
|
+
@_hash['tron'] = 'tron'
|
|
56
|
+
@_hash['canton'] = 'canton'
|
|
57
|
+
@_hash['ton'] = 'ton'
|
|
58
|
+
@_hash['stellar'] = 'stellar'
|
|
59
|
+
@_hash['starknet'] = 'starknet'
|
|
60
|
+
@_hash
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# An array for optional fields
|
|
64
|
+
def self.optionals
|
|
65
|
+
%w[
|
|
66
|
+
evm
|
|
67
|
+
solana
|
|
68
|
+
aptos
|
|
69
|
+
sui
|
|
70
|
+
tron
|
|
71
|
+
canton
|
|
72
|
+
ton
|
|
73
|
+
stellar
|
|
74
|
+
starknet
|
|
75
|
+
]
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# An array for nullable fields
|
|
79
|
+
def self.nullables
|
|
80
|
+
[]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def initialize(evm: SKIP, solana: SKIP, aptos: SKIP, sui: SKIP, tron: SKIP,
|
|
84
|
+
canton: SKIP, ton: SKIP, stellar: SKIP, starknet: SKIP,
|
|
85
|
+
additional_properties: nil)
|
|
86
|
+
# Add additional model properties to the instance
|
|
87
|
+
additional_properties = {} if additional_properties.nil?
|
|
88
|
+
|
|
89
|
+
@evm = evm unless evm == SKIP
|
|
90
|
+
@solana = solana unless solana == SKIP
|
|
91
|
+
@aptos = aptos unless aptos == SKIP
|
|
92
|
+
@sui = sui unless sui == SKIP
|
|
93
|
+
@tron = tron unless tron == SKIP
|
|
94
|
+
@canton = canton unless canton == SKIP
|
|
95
|
+
@ton = ton unless ton == SKIP
|
|
96
|
+
@stellar = stellar unless stellar == SKIP
|
|
97
|
+
@starknet = starknet unless starknet == SKIP
|
|
98
|
+
@additional_properties = additional_properties
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Creates an instance of the object from a hash.
|
|
102
|
+
def self.from_hash(hash)
|
|
103
|
+
return nil unless hash
|
|
104
|
+
|
|
105
|
+
# Extract variables from the hash.
|
|
106
|
+
evm = ChainDetails.from_hash(hash['evm']) if hash['evm']
|
|
107
|
+
|
|
108
|
+
evm = SKIP unless hash.key?('evm')
|
|
109
|
+
solana = ChainDetails.from_hash(hash['solana']) if hash['solana']
|
|
110
|
+
|
|
111
|
+
solana = SKIP unless hash.key?('solana')
|
|
112
|
+
aptos = ChainDetails.from_hash(hash['aptos']) if hash['aptos']
|
|
113
|
+
|
|
114
|
+
aptos = SKIP unless hash.key?('aptos')
|
|
115
|
+
sui = ChainDetails.from_hash(hash['sui']) if hash['sui']
|
|
116
|
+
|
|
117
|
+
sui = SKIP unless hash.key?('sui')
|
|
118
|
+
tron = ChainDetails.from_hash(hash['tron']) if hash['tron']
|
|
119
|
+
|
|
120
|
+
tron = SKIP unless hash.key?('tron')
|
|
121
|
+
canton = ChainDetails.from_hash(hash['canton']) if hash['canton']
|
|
122
|
+
|
|
123
|
+
canton = SKIP unless hash.key?('canton')
|
|
124
|
+
ton = ChainDetails.from_hash(hash['ton']) if hash['ton']
|
|
125
|
+
|
|
126
|
+
ton = SKIP unless hash.key?('ton')
|
|
127
|
+
stellar = ChainDetails.from_hash(hash['stellar']) if hash['stellar']
|
|
128
|
+
|
|
129
|
+
stellar = SKIP unless hash.key?('stellar')
|
|
130
|
+
starknet = ChainDetails.from_hash(hash['starknet']) if hash['starknet']
|
|
131
|
+
|
|
132
|
+
starknet = SKIP unless hash.key?('starknet')
|
|
133
|
+
|
|
134
|
+
# Create a new hash for additional properties, removing known properties.
|
|
135
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
136
|
+
|
|
137
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
138
|
+
new_hash, proc { |value| value }
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
# Create object from extracted values.
|
|
142
|
+
Data.new(evm: evm,
|
|
143
|
+
solana: solana,
|
|
144
|
+
aptos: aptos,
|
|
145
|
+
sui: sui,
|
|
146
|
+
tron: tron,
|
|
147
|
+
canton: canton,
|
|
148
|
+
ton: ton,
|
|
149
|
+
stellar: stellar,
|
|
150
|
+
starknet: starknet,
|
|
151
|
+
additional_properties: additional_properties)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Provides a human-readable string representation of the object.
|
|
155
|
+
def to_s
|
|
156
|
+
class_name = self.class.name.split('::').last
|
|
157
|
+
"<#{class_name} evm: #{@evm}, solana: #{@solana}, aptos: #{@aptos}, sui: #{@sui}, tron:"\
|
|
158
|
+
" #{@tron}, canton: #{@canton}, ton: #{@ton}, stellar: #{@stellar}, starknet: #{@starknet},"\
|
|
159
|
+
" additional_properties: #{@additional_properties}>"
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
163
|
+
def inspect
|
|
164
|
+
class_name = self.class.name.split('::').last
|
|
165
|
+
"<#{class_name} evm: #{@evm.inspect}, solana: #{@solana.inspect}, aptos: #{@aptos.inspect},"\
|
|
166
|
+
" sui: #{@sui.inspect}, tron: #{@tron.inspect}, canton: #{@canton.inspect}, ton:"\
|
|
167
|
+
" #{@ton.inspect}, stellar: #{@stellar.inspect}, starknet: #{@starknet.inspect},"\
|
|
168
|
+
" additional_properties: #{@additional_properties}>"
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ccip_directory_and_configuration_rest_api_v1
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically
|
|
4
|
+
# generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CcipDirectoryAndConfigurationRestApiV1
|
|
7
|
+
# enrichFeeTokens.
|
|
8
|
+
class EnrichFeeTokens
|
|
9
|
+
ENRICH_FEE_TOKENS = [
|
|
10
|
+
# TODO: Write general description for ENUM_TRUE
|
|
11
|
+
ENUM_TRUE = 'true'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for ENUM_FALSE
|
|
14
|
+
ENUM_FALSE = 'false'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
ENRICH_FEE_TOKENS.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = ENUM_TRUE)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'enum_true' then ENUM_TRUE
|
|
30
|
+
when 'enum_false' then ENUM_FALSE
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ccip_directory_and_configuration_rest_api_v1
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically
|
|
4
|
+
# generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CcipDirectoryAndConfigurationRestApiV1
|
|
7
|
+
# The network environment
|
|
8
|
+
class Environment
|
|
9
|
+
ENVIRONMENT = [
|
|
10
|
+
# TODO: Write general description for MAINNET
|
|
11
|
+
MAINNET = 'mainnet'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for TESTNET
|
|
14
|
+
TESTNET = 'testnet'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
ENVIRONMENT.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = MAINNET)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'mainnet' then MAINNET
|
|
30
|
+
when 'testnet' then TESTNET
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ccip_directory_and_configuration_rest_api_v1
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically
|
|
4
|
+
# generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CcipDirectoryAndConfigurationRestApiV1
|
|
7
|
+
# environment3.
|
|
8
|
+
class Environment3
|
|
9
|
+
ENVIRONMENT3 = [
|
|
10
|
+
# TODO: Write general description for MAINNET
|
|
11
|
+
MAINNET = 'mainnet'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for TESTNET
|
|
14
|
+
TESTNET = 'testnet'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
ENVIRONMENT3.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = MAINNET)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'mainnet' then MAINNET
|
|
30
|
+
when 'testnet' then TESTNET
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# ccip_directory_and_configuration_rest_api_v1
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically
|
|
4
|
+
# generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CcipDirectoryAndConfigurationRestApiV1
|
|
7
|
+
# family.
|
|
8
|
+
class Family
|
|
9
|
+
FAMILY = [
|
|
10
|
+
# TODO: Write general description for EVM
|
|
11
|
+
EVM = 'evm'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for SOLANA
|
|
14
|
+
SOLANA = 'solana'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for APTOS
|
|
17
|
+
APTOS = 'aptos'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for SUI
|
|
20
|
+
SUI = 'sui'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for TRON
|
|
23
|
+
TRON = 'tron'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for CANTON
|
|
26
|
+
CANTON = 'canton'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for TON
|
|
29
|
+
TON = 'ton'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for STELLAR
|
|
32
|
+
STELLAR = 'stellar'.freeze,
|
|
33
|
+
|
|
34
|
+
# TODO: Write general description for STARKNET
|
|
35
|
+
STARKNET = 'starknet'.freeze
|
|
36
|
+
].freeze
|
|
37
|
+
|
|
38
|
+
def self.validate(value)
|
|
39
|
+
return false if value.nil?
|
|
40
|
+
|
|
41
|
+
FAMILY.include?(value)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def self.from_value(value, default_value = EVM)
|
|
45
|
+
return default_value if value.nil?
|
|
46
|
+
|
|
47
|
+
str = value.to_s.strip
|
|
48
|
+
|
|
49
|
+
case str.downcase
|
|
50
|
+
when 'evm' then EVM
|
|
51
|
+
when 'solana' then SOLANA
|
|
52
|
+
when 'aptos' then APTOS
|
|
53
|
+
when 'sui' then SUI
|
|
54
|
+
when 'tron' then TRON
|
|
55
|
+
when 'canton' then CANTON
|
|
56
|
+
when 'ton' then TON
|
|
57
|
+
when 'stellar' then STELLAR
|
|
58
|
+
when 'starknet' then STARKNET
|
|
59
|
+
else
|
|
60
|
+
default_value
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# ccip_directory_and_configuration_rest_api_v1
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically
|
|
4
|
+
# generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CcipDirectoryAndConfigurationRestApiV1
|
|
7
|
+
# FeeTokenEnriched Model.
|
|
8
|
+
class FeeTokenEnriched < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Token symbol (e.g., LINK, WETH)
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :symbol
|
|
15
|
+
|
|
16
|
+
# Token name (e.g., Chainlink, Wrapped Ether)
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :name
|
|
19
|
+
|
|
20
|
+
# Token contract address on this chain
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :address
|
|
23
|
+
|
|
24
|
+
# Number of decimals for the token
|
|
25
|
+
# @return [Integer]
|
|
26
|
+
attr_accessor :decimals
|
|
27
|
+
|
|
28
|
+
# A mapping from model property names to API property names.
|
|
29
|
+
def self.names
|
|
30
|
+
@_hash = {} if @_hash.nil?
|
|
31
|
+
@_hash['symbol'] = 'symbol'
|
|
32
|
+
@_hash['name'] = 'name'
|
|
33
|
+
@_hash['address'] = 'address'
|
|
34
|
+
@_hash['decimals'] = 'decimals'
|
|
35
|
+
@_hash
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for optional fields
|
|
39
|
+
def self.optionals
|
|
40
|
+
[]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for nullable fields
|
|
44
|
+
def self.nullables
|
|
45
|
+
[]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def initialize(symbol:, name:, address:, decimals:,
|
|
49
|
+
additional_properties: nil)
|
|
50
|
+
# Add additional model properties to the instance
|
|
51
|
+
additional_properties = {} if additional_properties.nil?
|
|
52
|
+
|
|
53
|
+
@symbol = symbol
|
|
54
|
+
@name = name
|
|
55
|
+
@address = address
|
|
56
|
+
@decimals = decimals
|
|
57
|
+
@additional_properties = additional_properties
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Creates an instance of the object from a hash.
|
|
61
|
+
def self.from_hash(hash)
|
|
62
|
+
return nil unless hash
|
|
63
|
+
|
|
64
|
+
# Extract variables from the hash.
|
|
65
|
+
symbol = hash.key?('symbol') ? hash['symbol'] : nil
|
|
66
|
+
name = hash.key?('name') ? hash['name'] : nil
|
|
67
|
+
address = hash.key?('address') ? hash['address'] : nil
|
|
68
|
+
decimals = hash.key?('decimals') ? hash['decimals'] : nil
|
|
69
|
+
|
|
70
|
+
# Create a new hash for additional properties, removing known properties.
|
|
71
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
72
|
+
|
|
73
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
74
|
+
new_hash, proc { |value| value }
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
# Create object from extracted values.
|
|
78
|
+
FeeTokenEnriched.new(symbol: symbol,
|
|
79
|
+
name: name,
|
|
80
|
+
address: address,
|
|
81
|
+
decimals: decimals,
|
|
82
|
+
additional_properties: additional_properties)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Validates an instance of the object from a given value.
|
|
86
|
+
# @param [FeeTokenEnriched | Hash] The value against the validation is performed.
|
|
87
|
+
def self.validate(value)
|
|
88
|
+
if value.instance_of? self
|
|
89
|
+
return (
|
|
90
|
+
APIHelper.valid_type?(value.symbol,
|
|
91
|
+
->(val) { val.instance_of? String }) and
|
|
92
|
+
APIHelper.valid_type?(value.name,
|
|
93
|
+
->(val) { val.instance_of? String }) and
|
|
94
|
+
APIHelper.valid_type?(value.address,
|
|
95
|
+
->(val) { val.instance_of? String }) and
|
|
96
|
+
APIHelper.valid_type?(value.decimals,
|
|
97
|
+
->(val) { val.instance_of? Integer })
|
|
98
|
+
)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
return false unless value.instance_of? Hash
|
|
102
|
+
|
|
103
|
+
(
|
|
104
|
+
APIHelper.valid_type?(value['symbol'],
|
|
105
|
+
->(val) { val.instance_of? String }) and
|
|
106
|
+
APIHelper.valid_type?(value['name'],
|
|
107
|
+
->(val) { val.instance_of? String }) and
|
|
108
|
+
APIHelper.valid_type?(value['address'],
|
|
109
|
+
->(val) { val.instance_of? String }) and
|
|
110
|
+
APIHelper.valid_type?(value['decimals'],
|
|
111
|
+
->(val) { val.instance_of? Integer })
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Provides a human-readable string representation of the object.
|
|
116
|
+
def to_s
|
|
117
|
+
class_name = self.class.name.split('::').last
|
|
118
|
+
"<#{class_name} symbol: #{@symbol}, name: #{@name}, address: #{@address}, decimals:"\
|
|
119
|
+
" #{@decimals}, additional_properties: #{@additional_properties}>"
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
123
|
+
def inspect
|
|
124
|
+
class_name = self.class.name.split('::').last
|
|
125
|
+
"<#{class_name} symbol: #{@symbol.inspect}, name: #{@name.inspect}, address:"\
|
|
126
|
+
" #{@address.inspect}, decimals: #{@decimals.inspect}, additional_properties:"\
|
|
127
|
+
" #{@additional_properties}>"
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# ccip_directory_and_configuration_rest_api_v1
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically
|
|
4
|
+
# generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CcipDirectoryAndConfigurationRestApiV1
|
|
7
|
+
# LaneApiResponse Model.
|
|
8
|
+
class LaneApiResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [LaneMetadata]
|
|
14
|
+
attr_accessor :metadata
|
|
15
|
+
|
|
16
|
+
# Lane data organized by dynamic lane keys (e.g., '1_to_56',
|
|
17
|
+
# 'ethereum-mainnet_to_polygon-mainnet')
|
|
18
|
+
# @return [Hash[String, LaneDetails]]
|
|
19
|
+
attr_accessor :data
|
|
20
|
+
|
|
21
|
+
# List of lanes that could not be configured
|
|
22
|
+
# @return [Array[LaneConfigError]]
|
|
23
|
+
attr_accessor :ignored
|
|
24
|
+
|
|
25
|
+
# A mapping from model property names to API property names.
|
|
26
|
+
def self.names
|
|
27
|
+
@_hash = {} if @_hash.nil?
|
|
28
|
+
@_hash['metadata'] = 'metadata'
|
|
29
|
+
@_hash['data'] = 'data'
|
|
30
|
+
@_hash['ignored'] = 'ignored'
|
|
31
|
+
@_hash
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# An array for optional fields
|
|
35
|
+
def self.optionals
|
|
36
|
+
[]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# An array for nullable fields
|
|
40
|
+
def self.nullables
|
|
41
|
+
[]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def initialize(metadata:, data:, ignored:, additional_properties: nil)
|
|
45
|
+
# Add additional model properties to the instance
|
|
46
|
+
additional_properties = {} if additional_properties.nil?
|
|
47
|
+
|
|
48
|
+
@metadata = metadata
|
|
49
|
+
@data = data
|
|
50
|
+
@ignored = ignored
|
|
51
|
+
@additional_properties = additional_properties
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Creates an instance of the object from a hash.
|
|
55
|
+
def self.from_hash(hash)
|
|
56
|
+
return nil unless hash
|
|
57
|
+
|
|
58
|
+
# Extract variables from the hash.
|
|
59
|
+
metadata = LaneMetadata.from_hash(hash['metadata']) if hash['metadata']
|
|
60
|
+
data = LaneDetails.from_hash(hash['data']) if hash['data']
|
|
61
|
+
|
|
62
|
+
data = nil unless hash.key?('data')
|
|
63
|
+
# Parameter is an array, so we need to iterate through it
|
|
64
|
+
ignored = nil
|
|
65
|
+
unless hash['ignored'].nil?
|
|
66
|
+
ignored = []
|
|
67
|
+
hash['ignored'].each do |structure|
|
|
68
|
+
ignored << (LaneConfigError.from_hash(structure) if structure)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
ignored = nil unless hash.key?('ignored')
|
|
73
|
+
|
|
74
|
+
# Create a new hash for additional properties, removing known properties.
|
|
75
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
76
|
+
|
|
77
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
78
|
+
new_hash, proc { |value| value }
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# Create object from extracted values.
|
|
82
|
+
LaneApiResponse.new(metadata: metadata,
|
|
83
|
+
data: data,
|
|
84
|
+
ignored: ignored,
|
|
85
|
+
additional_properties: additional_properties)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Provides a human-readable string representation of the object.
|
|
89
|
+
def to_s
|
|
90
|
+
class_name = self.class.name.split('::').last
|
|
91
|
+
"<#{class_name} metadata: #{@metadata}, data: #{@data}, ignored: #{@ignored},"\
|
|
92
|
+
" additional_properties: #{@additional_properties}>"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
96
|
+
def inspect
|
|
97
|
+
class_name = self.class.name.split('::').last
|
|
98
|
+
"<#{class_name} metadata: #{@metadata.inspect}, data: #{@data.inspect}, ignored:"\
|
|
99
|
+
" #{@ignored.inspect}, additional_properties: #{@additional_properties}>"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# ccip_directory_and_configuration_rest_api_v1
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically
|
|
4
|
+
# generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CcipDirectoryAndConfigurationRestApiV1
|
|
7
|
+
# LaneConfigError Model.
|
|
8
|
+
class LaneConfigError < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Source chain identifier that failed configuration
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :source_chain
|
|
15
|
+
|
|
16
|
+
# Destination chain identifier that failed configuration
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :destination_chain
|
|
19
|
+
|
|
20
|
+
# Human-readable reason for the configuration failure
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :reason
|
|
23
|
+
|
|
24
|
+
# List of missing or invalid configuration fields
|
|
25
|
+
# @return [Array[String]]
|
|
26
|
+
attr_accessor :missing_fields
|
|
27
|
+
|
|
28
|
+
# A mapping from model property names to API property names.
|
|
29
|
+
def self.names
|
|
30
|
+
@_hash = {} if @_hash.nil?
|
|
31
|
+
@_hash['source_chain'] = 'sourceChain'
|
|
32
|
+
@_hash['destination_chain'] = 'destinationChain'
|
|
33
|
+
@_hash['reason'] = 'reason'
|
|
34
|
+
@_hash['missing_fields'] = 'missingFields'
|
|
35
|
+
@_hash
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for optional fields
|
|
39
|
+
def self.optionals
|
|
40
|
+
[]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for nullable fields
|
|
44
|
+
def self.nullables
|
|
45
|
+
[]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def initialize(source_chain:, destination_chain:, reason:, missing_fields:,
|
|
49
|
+
additional_properties: nil)
|
|
50
|
+
# Add additional model properties to the instance
|
|
51
|
+
additional_properties = {} if additional_properties.nil?
|
|
52
|
+
|
|
53
|
+
@source_chain = source_chain
|
|
54
|
+
@destination_chain = destination_chain
|
|
55
|
+
@reason = reason
|
|
56
|
+
@missing_fields = missing_fields
|
|
57
|
+
@additional_properties = additional_properties
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Creates an instance of the object from a hash.
|
|
61
|
+
def self.from_hash(hash)
|
|
62
|
+
return nil unless hash
|
|
63
|
+
|
|
64
|
+
# Extract variables from the hash.
|
|
65
|
+
source_chain = hash.key?('sourceChain') ? hash['sourceChain'] : nil
|
|
66
|
+
destination_chain =
|
|
67
|
+
hash.key?('destinationChain') ? hash['destinationChain'] : nil
|
|
68
|
+
reason = hash.key?('reason') ? hash['reason'] : nil
|
|
69
|
+
missing_fields = hash.key?('missingFields') ? hash['missingFields'] : nil
|
|
70
|
+
|
|
71
|
+
# Create a new hash for additional properties, removing known properties.
|
|
72
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
73
|
+
|
|
74
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
75
|
+
new_hash, proc { |value| value }
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# Create object from extracted values.
|
|
79
|
+
LaneConfigError.new(source_chain: source_chain,
|
|
80
|
+
destination_chain: destination_chain,
|
|
81
|
+
reason: reason,
|
|
82
|
+
missing_fields: missing_fields,
|
|
83
|
+
additional_properties: additional_properties)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Provides a human-readable string representation of the object.
|
|
87
|
+
def to_s
|
|
88
|
+
class_name = self.class.name.split('::').last
|
|
89
|
+
"<#{class_name} source_chain: #{@source_chain}, destination_chain: #{@destination_chain},"\
|
|
90
|
+
" reason: #{@reason}, missing_fields: #{@missing_fields}, additional_properties:"\
|
|
91
|
+
" #{@additional_properties}>"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
95
|
+
def inspect
|
|
96
|
+
class_name = self.class.name.split('::').last
|
|
97
|
+
"<#{class_name} source_chain: #{@source_chain.inspect}, destination_chain:"\
|
|
98
|
+
" #{@destination_chain.inspect}, reason: #{@reason.inspect}, missing_fields:"\
|
|
99
|
+
" #{@missing_fields.inspect}, additional_properties: #{@additional_properties}>"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|