crypto_apis 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -10
  3. data/docs/AssetsApi.md +1 -1
  4. data/docs/AutomaticCoinsForwardingApi.md +1 -1
  5. data/docs/AutomaticTokensForwardingApi.md +1 -1
  6. data/docs/GetBlockDetailsByBlockHashRIBS.md +0 -2
  7. data/docs/GetBlockDetailsByBlockHeightRIBS.md +0 -2
  8. data/docs/GetLatestMinedBlockRIBS.md +0 -2
  9. data/docs/GetTransactionDetailsByTransactionIDRIBS.md +0 -2
  10. data/docs/InformativeApi.md +1 -1
  11. data/docs/InternalApi.md +1 -1
  12. data/docs/ListTransactionsByAddressRIBS.md +0 -2
  13. data/docs/ListTransactionsByBlockHashRIBS.md +0 -2
  14. data/docs/ListTransactionsByBlockHeightRIBS.md +0 -2
  15. data/docs/ManageSubscriptionsApi.md +1 -1
  16. data/docs/MetadataApi.md +1 -1
  17. data/docs/OmniLayerApi.md +6 -6
  18. data/docs/TokensApi.md +3 -3
  19. data/docs/UTXOBasedApi.md +1 -1
  20. data/docs/UnifiedEndpointsApi.md +3 -3
  21. data/docs/XRPRippleApi.md +3 -3
  22. data/docs/ZilliqaApi.md +3 -3
  23. data/lib/crypto_apis.rb +0 -9
  24. data/lib/crypto_apis/api/assets_api.rb +2 -2
  25. data/lib/crypto_apis/api/automatic_coins_forwarding_api.rb +2 -2
  26. data/lib/crypto_apis/api/automatic_tokens_forwarding_api.rb +2 -2
  27. data/lib/crypto_apis/api/create_subscriptions_for_api.rb +8 -8
  28. data/lib/crypto_apis/api/informative_api.rb +2 -2
  29. data/lib/crypto_apis/api/internal_api.rb +2 -2
  30. data/lib/crypto_apis/api/manage_subscriptions_api.rb +2 -2
  31. data/lib/crypto_apis/api/metadata_api.rb +2 -2
  32. data/lib/crypto_apis/api/omni_layer_api.rb +12 -12
  33. data/lib/crypto_apis/api/tokens_api.rb +6 -6
  34. data/lib/crypto_apis/api/unified_endpoints_api.rb +14 -14
  35. data/lib/crypto_apis/api/utxo_based_api.rb +2 -2
  36. data/lib/crypto_apis/api/xrp_ripple_api.rb +6 -6
  37. data/lib/crypto_apis/api/zilliqa_api.rb +6 -6
  38. data/lib/crypto_apis/models/get_block_details_by_block_hash_ribs.rb +0 -1
  39. data/lib/crypto_apis/models/get_block_details_by_block_height_ribs.rb +0 -1
  40. data/lib/crypto_apis/models/get_latest_mined_block_ribs.rb +0 -1
  41. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribs.rb +0 -1
  42. data/lib/crypto_apis/models/list_transactions_by_address_ribs.rb +0 -1
  43. data/lib/crypto_apis/models/list_transactions_by_block_hash_ribs.rb +0 -1
  44. data/lib/crypto_apis/models/list_transactions_by_block_height_ribs.rb +0 -1
  45. data/lib/crypto_apis/version.rb +1 -1
  46. data/spec/api/assets_api_spec.rb +1 -1
  47. data/spec/api/automatic_coins_forwarding_api_spec.rb +1 -1
  48. data/spec/api/automatic_tokens_forwarding_api_spec.rb +1 -1
  49. data/spec/api/informative_api_spec.rb +1 -1
  50. data/spec/api/internal_api_spec.rb +1 -1
  51. data/spec/api/manage_subscriptions_api_spec.rb +1 -1
  52. data/spec/api/metadata_api_spec.rb +1 -1
  53. data/spec/api/omni_layer_api_spec.rb +6 -6
  54. data/spec/api/tokens_api_spec.rb +3 -3
  55. data/spec/api/unified_endpoints_api_spec.rb +3 -3
  56. data/spec/api/utxo_based_api_spec.rb +1 -1
  57. data/spec/api/xrp_ripple_api_spec.rb +3 -3
  58. data/spec/api/zilliqa_api_spec.rb +3 -3
  59. metadata +2 -38
  60. data/docs/GetBlockDetailsByBlockHashRIBSBSC.md +0 -36
  61. data/docs/GetBlockDetailsByBlockHeightRIBSBSC.md +0 -34
  62. data/docs/GetLatestMinedBlockRIBSBSC.md +0 -34
  63. data/docs/GetTransactionDetailsByTransactionIDRIBSBSC.md +0 -28
  64. data/docs/GetTransactionDetailsByTransactionIDRIBSBSCGasPrice.md +0 -20
  65. data/docs/ListTransactionsByAddressRIBSBSC.md +0 -30
  66. data/docs/ListTransactionsByBlockHashRIBSBSC.md +0 -30
  67. data/docs/ListTransactionsByBlockHeightRIBSBSC.md +0 -28
  68. data/docs/ListTransactionsByBlockHeightRIBSBSCGasPrice.md +0 -20
  69. data/lib/crypto_apis/models/get_block_details_by_block_hash_ribsbsc.rb +0 -361
  70. data/lib/crypto_apis/models/get_block_details_by_block_height_ribsbsc.rb +0 -345
  71. data/lib/crypto_apis/models/get_latest_mined_block_ribsbsc.rb +0 -345
  72. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribsbsc.rb +0 -299
  73. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribsbsc_gas_price.rb +0 -238
  74. data/lib/crypto_apis/models/list_transactions_by_address_ribsbsc.rb +0 -314
  75. data/lib/crypto_apis/models/list_transactions_by_block_hash_ribsbsc.rb +0 -314
  76. data/lib/crypto_apis/models/list_transactions_by_block_height_ribsbsc.rb +0 -299
  77. data/lib/crypto_apis/models/list_transactions_by_block_height_ribsbsc_gas_price.rb +0 -238
  78. data/spec/models/get_block_details_by_block_hash_ribsbsc_spec.rb +0 -88
  79. data/spec/models/get_block_details_by_block_height_ribsbsc_spec.rb +0 -82
  80. data/spec/models/get_latest_mined_block_ribsbsc_spec.rb +0 -82
  81. data/spec/models/get_transaction_details_by_transaction_idribsbsc_gas_price_spec.rb +0 -40
  82. data/spec/models/get_transaction_details_by_transaction_idribsbsc_spec.rb +0 -64
  83. data/spec/models/list_transactions_by_address_ribsbsc_spec.rb +0 -70
  84. data/spec/models/list_transactions_by_block_hash_ribsbsc_spec.rb +0 -70
  85. data/spec/models/list_transactions_by_block_height_ribsbsc_gas_price_spec.rb +0 -40
  86. data/spec/models/list_transactions_by_block_height_ribsbsc_spec.rb +0 -64
@@ -1,36 +0,0 @@
1
- # CryptoApis::GetBlockDetailsByBlockHashRIBSBSC
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **difficulty** | **String** | Represents a mathematical value of how hard it is to find a valid hash for this block. | |
8
- | **nonce** | **Integer** | Represents a random value that can be adjusted to satisfy the Proof of Work. | |
9
- | **size** | **Integer** | Represents the total size of the block in Bytes. | |
10
- | **extra_data** | **String** | Numeric representation of the block extra data | |
11
- | **gas_limit** | **String** | Numeric representation of the block gas limit | |
12
- | **gas_used** | **String** | Numeric representation of the block gas used | |
13
- | **mined_in_seconds** | **Integer** | Numeric representation of the block gas limit | |
14
- | **sha3_uncles** | **String** | Numeric representation of the block sha3 uncles | |
15
- | **total_difficulty** | **String** | Numeric representation of the block total difficulty | |
16
- | **uncles** | **Array<String>** | | |
17
-
18
- ## Example
19
-
20
- ```ruby
21
- require 'crypto_apis'
22
-
23
- instance = CryptoApis::GetBlockDetailsByBlockHashRIBSBSC.new(
24
- difficulty: 209515044.4071968,
25
- nonce: 1535290446,
26
- size: 53598,
27
- extra_data: null,
28
- gas_limit: null,
29
- gas_used: null,
30
- mined_in_seconds: null,
31
- sha3_uncles: null,
32
- total_difficulty: null,
33
- uncles: null
34
- )
35
- ```
36
-
@@ -1,34 +0,0 @@
1
- # CryptoApis::GetBlockDetailsByBlockHeightRIBSBSC
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **difficulty** | **String** | Represents a mathematical value of how hard it is to find a valid hash for this block. | |
8
- | **nonce** | **Integer** | Represents a random value that can be adjusted to satisfy the Proof of Work | |
9
- | **size** | **Integer** | Represents the total size of the block in Bytes. | |
10
- | **extra_data** | **String** | Numeric representation of the block extra data | |
11
- | **gas_limit** | **String** | Numeric representation of the block gas limit | |
12
- | **gas_used** | **String** | Numeric representation of the block gas used | |
13
- | **mined_in_seconds** | **String** | Numeric representation of the block gas limit | |
14
- | **sha3_uncles** | **String** | Numeric representation of the block sha3 uncles | |
15
- | **total_difficulty** | **String** | Numeric representation of the block total difficulty | |
16
-
17
- ## Example
18
-
19
- ```ruby
20
- require 'crypto_apis'
21
-
22
- instance = CryptoApis::GetBlockDetailsByBlockHeightRIBSBSC.new(
23
- difficulty: 209515044.4071968,
24
- nonce: 1535290446,
25
- size: 3892,
26
- extra_data: null,
27
- gas_limit: null,
28
- gas_used: null,
29
- mined_in_seconds: null,
30
- sha3_uncles: null,
31
- total_difficulty: null
32
- )
33
- ```
34
-
@@ -1,34 +0,0 @@
1
- # CryptoApis::GetLatestMinedBlockRIBSBSC
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **difficulty** | **String** | Represents a mathematical value of how hard it is to find a valid hash for this block. | |
8
- | **nonce** | **Integer** | Represents a random value that can be adjusted to satisfy the proof of work | |
9
- | **size** | **Integer** | Represents the total size of the block in Bytes. | |
10
- | **extra_data** | **String** | Numeric representation of the block extra data | |
11
- | **gas_limit** | **String** | Numeric representation of the block gas limit | |
12
- | **gas_used** | **String** | Numeric representation of the block gas used | |
13
- | **mined_in_seconds** | **Integer** | Numeric representation of the block gas limit | |
14
- | **sha3_uncles** | **String** | Numeric representation of the block sha3 uncles | |
15
- | **total_difficulty** | **String** | Numeric representation of the block total difficulty | |
16
-
17
- ## Example
18
-
19
- ```ruby
20
- require 'crypto_apis'
21
-
22
- instance = CryptoApis::GetLatestMinedBlockRIBSBSC.new(
23
- difficulty: 21448277761059.71,
24
- nonce: 2113101077,
25
- size: 1408113,
26
- extra_data: 0xd883010001846765746888676f312e31342e34856c696e757800000000000000eb8c4ee17a97af3c7d18e6cfb87d25bf9a483933d393b4fce778c9a7d64eab76471a8ab92c3a7d131c0f9cfbbd9a54b438c80b491c7a579da0e37db6ca823eda01,
27
- gas_limit: 30000000,
28
- gas_used: 686304,
29
- mined_in_seconds: 3,
30
- sha3_uncles: 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347,
31
- total_difficulty: 2437536
32
- )
33
- ```
34
-
@@ -1,28 +0,0 @@
1
- # CryptoApis::GetTransactionDetailsByTransactionIDRIBSBSC
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **contract** | **String** | Numeric representation of the transaction contract | |
8
- | **gas_limit** | **String** | String representation of the transaction gas | |
9
- | **gas_price** | [**GetTransactionDetailsByTransactionIDRIBSBSCGasPrice**](GetTransactionDetailsByTransactionIDRIBSBSCGasPrice.md) | | |
10
- | **gas_used** | **String** | Numeric representation of the transaction gas used | |
11
- | **input_data** | **String** | Numeric representation of the transaction input | |
12
- | **nonce** | **String** | Numeric representation of the transaction nonce | |
13
-
14
- ## Example
15
-
16
- ```ruby
17
- require 'crypto_apis'
18
-
19
- instance = CryptoApis::GetTransactionDetailsByTransactionIDRIBSBSC.new(
20
- contract: null,
21
- gas_limit: null,
22
- gas_price: null,
23
- gas_used: null,
24
- input_data: null,
25
- nonce: null
26
- )
27
- ```
28
-
@@ -1,20 +0,0 @@
1
- # CryptoApis::GetTransactionDetailsByTransactionIDRIBSBSCGasPrice
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **amount** | **String** | Numeric representation of the transaction gas price | |
8
- | **unit** | **String** | | |
9
-
10
- ## Example
11
-
12
- ```ruby
13
- require 'crypto_apis'
14
-
15
- instance = CryptoApis::GetTransactionDetailsByTransactionIDRIBSBSCGasPrice.new(
16
- amount: null,
17
- unit: BNB
18
- )
19
- ```
20
-
@@ -1,30 +0,0 @@
1
- # CryptoApis::ListTransactionsByAddressRIBSBSC
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **contract** | **String** | Numeric representation of the transaction contract | |
8
- | **gas_limit** | **String** | String representation of the transaction gas | |
9
- | **gas_price** | [**GetTransactionDetailsByTransactionIDRIBSBSCGasPrice**](GetTransactionDetailsByTransactionIDRIBSBSCGasPrice.md) | | |
10
- | **gas_used** | **String** | Numeric representation of the transaction gas used | |
11
- | **input_data** | **String** | Numeric representation of the transaction input | |
12
- | **nonce** | **Integer** | Numeric representation of the transaction nonce | |
13
- | **transaction_status** | **String** | String representation of the transaction status | |
14
-
15
- ## Example
16
-
17
- ```ruby
18
- require 'crypto_apis'
19
-
20
- instance = CryptoApis::ListTransactionsByAddressRIBSBSC.new(
21
- contract: null,
22
- gas_limit: null,
23
- gas_price: null,
24
- gas_used: null,
25
- input_data: null,
26
- nonce: null,
27
- transaction_status: null
28
- )
29
- ```
30
-
@@ -1,30 +0,0 @@
1
- # CryptoApis::ListTransactionsByBlockHashRIBSBSC
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **contract** | **String** | Numeric representation of the transaction contract | |
8
- | **gas_limit** | **String** | String representation of the transaction gas | |
9
- | **gas_price** | [**GetTransactionDetailsByTransactionIDRIBSBSCGasPrice**](GetTransactionDetailsByTransactionIDRIBSBSCGasPrice.md) | | |
10
- | **gas_used** | **String** | Numeric representation of the transaction gas used | |
11
- | **input_data** | **String** | Numeric representation of the transaction input | |
12
- | **nonce** | **String** | Numeric representation of the transaction nonce | |
13
- | **transaction_status** | **String** | String representation of the transaction status | |
14
-
15
- ## Example
16
-
17
- ```ruby
18
- require 'crypto_apis'
19
-
20
- instance = CryptoApis::ListTransactionsByBlockHashRIBSBSC.new(
21
- contract: null,
22
- gas_limit: null,
23
- gas_price: null,
24
- gas_used: null,
25
- input_data: null,
26
- nonce: null,
27
- transaction_status: null
28
- )
29
- ```
30
-
@@ -1,28 +0,0 @@
1
- # CryptoApis::ListTransactionsByBlockHeightRIBSBSC
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **contract** | **String** | Numeric representation of the transaction contract | |
8
- | **gas_limit** | **String** | String representation of the transaction gas | |
9
- | **gas_price** | [**ListTransactionsByBlockHeightRIBSBSCGasPrice**](ListTransactionsByBlockHeightRIBSBSCGasPrice.md) | | |
10
- | **gas_used** | **String** | Numeric representation of the transaction gas used | |
11
- | **input_data** | **String** | Numeric representation of the transaction input | |
12
- | **nonce** | **String** | Numeric representation of the transaction nonce | |
13
-
14
- ## Example
15
-
16
- ```ruby
17
- require 'crypto_apis'
18
-
19
- instance = CryptoApis::ListTransactionsByBlockHeightRIBSBSC.new(
20
- contract: null,
21
- gas_limit: 21000,
22
- gas_price: null,
23
- gas_used: 21000,
24
- input_data: null,
25
- nonce: 15
26
- )
27
- ```
28
-
@@ -1,20 +0,0 @@
1
- # CryptoApis::ListTransactionsByBlockHeightRIBSBSCGasPrice
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **amount** | **String** | Numeric representation of the transaction gas price | |
8
- | **unit** | **String** | | |
9
-
10
- ## Example
11
-
12
- ```ruby
13
- require 'crypto_apis'
14
-
15
- instance = CryptoApis::ListTransactionsByBlockHeightRIBSBSCGasPrice.new(
16
- amount: 17000000000,
17
- unit: BNB
18
- )
19
- ```
20
-
@@ -1,361 +0,0 @@
1
- =begin
2
- #CryptoAPIs
3
-
4
- #Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of their blockchain applications. Crypto APIs 2.0 provides unified endpoints and data, raw data, automatic tokens and coins forwardings, callback functionalities, and much more.
5
-
6
- The version of the OpenAPI document: 2.0.0
7
- Contact: developers@cryptoapis.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.1-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module CryptoApis
17
- # Binance Smart Chain
18
- class GetBlockDetailsByBlockHashRIBSBSC
19
- # Represents a mathematical value of how hard it is to find a valid hash for this block.
20
- attr_accessor :difficulty
21
-
22
- # Represents a random value that can be adjusted to satisfy the Proof of Work.
23
- attr_accessor :nonce
24
-
25
- # Represents the total size of the block in Bytes.
26
- attr_accessor :size
27
-
28
- # Numeric representation of the block extra data
29
- attr_accessor :extra_data
30
-
31
- # Numeric representation of the block gas limit
32
- attr_accessor :gas_limit
33
-
34
- # Numeric representation of the block gas used
35
- attr_accessor :gas_used
36
-
37
- # Numeric representation of the block gas limit
38
- attr_accessor :mined_in_seconds
39
-
40
- # Numeric representation of the block sha3 uncles
41
- attr_accessor :sha3_uncles
42
-
43
- # Numeric representation of the block total difficulty
44
- attr_accessor :total_difficulty
45
-
46
- attr_accessor :uncles
47
-
48
- # Attribute mapping from ruby-style variable name to JSON key.
49
- def self.attribute_map
50
- {
51
- :'difficulty' => :'difficulty',
52
- :'nonce' => :'nonce',
53
- :'size' => :'size',
54
- :'extra_data' => :'extraData',
55
- :'gas_limit' => :'gasLimit',
56
- :'gas_used' => :'gasUsed',
57
- :'mined_in_seconds' => :'minedInSeconds',
58
- :'sha3_uncles' => :'sha3Uncles',
59
- :'total_difficulty' => :'totalDifficulty',
60
- :'uncles' => :'uncles'
61
- }
62
- end
63
-
64
- # Returns all the JSON keys this model knows about
65
- def self.acceptable_attributes
66
- attribute_map.values
67
- end
68
-
69
- # Attribute type mapping.
70
- def self.openapi_types
71
- {
72
- :'difficulty' => :'String',
73
- :'nonce' => :'Integer',
74
- :'size' => :'Integer',
75
- :'extra_data' => :'String',
76
- :'gas_limit' => :'String',
77
- :'gas_used' => :'String',
78
- :'mined_in_seconds' => :'Integer',
79
- :'sha3_uncles' => :'String',
80
- :'total_difficulty' => :'String',
81
- :'uncles' => :'Array<String>'
82
- }
83
- end
84
-
85
- # List of attributes with nullable: true
86
- def self.openapi_nullable
87
- Set.new([
88
- ])
89
- end
90
-
91
- # Initializes the object
92
- # @param [Hash] attributes Model attributes in the form of hash
93
- def initialize(attributes = {})
94
- if (!attributes.is_a?(Hash))
95
- fail ArgumentError, "The input argument (attributes) must be a hash in `CryptoApis::GetBlockDetailsByBlockHashRIBSBSC` initialize method"
96
- end
97
-
98
- # check to see if the attribute exists and convert string to symbol for hash key
99
- attributes = attributes.each_with_object({}) { |(k, v), h|
100
- if (!self.class.attribute_map.key?(k.to_sym))
101
- fail ArgumentError, "`#{k}` is not a valid attribute in `CryptoApis::GetBlockDetailsByBlockHashRIBSBSC`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
102
- end
103
- h[k.to_sym] = v
104
- }
105
-
106
- if attributes.key?(:'difficulty')
107
- self.difficulty = attributes[:'difficulty']
108
- end
109
-
110
- if attributes.key?(:'nonce')
111
- self.nonce = attributes[:'nonce']
112
- end
113
-
114
- if attributes.key?(:'size')
115
- self.size = attributes[:'size']
116
- end
117
-
118
- if attributes.key?(:'extra_data')
119
- self.extra_data = attributes[:'extra_data']
120
- end
121
-
122
- if attributes.key?(:'gas_limit')
123
- self.gas_limit = attributes[:'gas_limit']
124
- end
125
-
126
- if attributes.key?(:'gas_used')
127
- self.gas_used = attributes[:'gas_used']
128
- end
129
-
130
- if attributes.key?(:'mined_in_seconds')
131
- self.mined_in_seconds = attributes[:'mined_in_seconds']
132
- end
133
-
134
- if attributes.key?(:'sha3_uncles')
135
- self.sha3_uncles = attributes[:'sha3_uncles']
136
- end
137
-
138
- if attributes.key?(:'total_difficulty')
139
- self.total_difficulty = attributes[:'total_difficulty']
140
- end
141
-
142
- if attributes.key?(:'uncles')
143
- if (value = attributes[:'uncles']).is_a?(Array)
144
- self.uncles = value
145
- end
146
- end
147
- end
148
-
149
- # Show invalid properties with the reasons. Usually used together with valid?
150
- # @return Array for valid properties with the reasons
151
- def list_invalid_properties
152
- invalid_properties = Array.new
153
- if @difficulty.nil?
154
- invalid_properties.push('invalid value for "difficulty", difficulty cannot be nil.')
155
- end
156
-
157
- if @nonce.nil?
158
- invalid_properties.push('invalid value for "nonce", nonce cannot be nil.')
159
- end
160
-
161
- if @size.nil?
162
- invalid_properties.push('invalid value for "size", size cannot be nil.')
163
- end
164
-
165
- if @extra_data.nil?
166
- invalid_properties.push('invalid value for "extra_data", extra_data cannot be nil.')
167
- end
168
-
169
- if @gas_limit.nil?
170
- invalid_properties.push('invalid value for "gas_limit", gas_limit cannot be nil.')
171
- end
172
-
173
- if @gas_used.nil?
174
- invalid_properties.push('invalid value for "gas_used", gas_used cannot be nil.')
175
- end
176
-
177
- if @mined_in_seconds.nil?
178
- invalid_properties.push('invalid value for "mined_in_seconds", mined_in_seconds cannot be nil.')
179
- end
180
-
181
- if @sha3_uncles.nil?
182
- invalid_properties.push('invalid value for "sha3_uncles", sha3_uncles cannot be nil.')
183
- end
184
-
185
- if @total_difficulty.nil?
186
- invalid_properties.push('invalid value for "total_difficulty", total_difficulty cannot be nil.')
187
- end
188
-
189
- if @uncles.nil?
190
- invalid_properties.push('invalid value for "uncles", uncles cannot be nil.')
191
- end
192
-
193
- invalid_properties
194
- end
195
-
196
- # Check to see if the all the properties in the model are valid
197
- # @return true if the model is valid
198
- def valid?
199
- return false if @difficulty.nil?
200
- return false if @nonce.nil?
201
- return false if @size.nil?
202
- return false if @extra_data.nil?
203
- return false if @gas_limit.nil?
204
- return false if @gas_used.nil?
205
- return false if @mined_in_seconds.nil?
206
- return false if @sha3_uncles.nil?
207
- return false if @total_difficulty.nil?
208
- return false if @uncles.nil?
209
- true
210
- end
211
-
212
- # Checks equality by comparing each attribute.
213
- # @param [Object] Object to be compared
214
- def ==(o)
215
- return true if self.equal?(o)
216
- self.class == o.class &&
217
- difficulty == o.difficulty &&
218
- nonce == o.nonce &&
219
- size == o.size &&
220
- extra_data == o.extra_data &&
221
- gas_limit == o.gas_limit &&
222
- gas_used == o.gas_used &&
223
- mined_in_seconds == o.mined_in_seconds &&
224
- sha3_uncles == o.sha3_uncles &&
225
- total_difficulty == o.total_difficulty &&
226
- uncles == o.uncles
227
- end
228
-
229
- # @see the `==` method
230
- # @param [Object] Object to be compared
231
- def eql?(o)
232
- self == o
233
- end
234
-
235
- # Calculates hash code according to all attributes.
236
- # @return [Integer] Hash code
237
- def hash
238
- [difficulty, nonce, size, extra_data, gas_limit, gas_used, mined_in_seconds, sha3_uncles, total_difficulty, uncles].hash
239
- end
240
-
241
- # Builds the object from hash
242
- # @param [Hash] attributes Model attributes in the form of hash
243
- # @return [Object] Returns the model itself
244
- def self.build_from_hash(attributes)
245
- new.build_from_hash(attributes)
246
- end
247
-
248
- # Builds the object from hash
249
- # @param [Hash] attributes Model attributes in the form of hash
250
- # @return [Object] Returns the model itself
251
- def build_from_hash(attributes)
252
- return nil unless attributes.is_a?(Hash)
253
- self.class.openapi_types.each_pair do |key, type|
254
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
255
- self.send("#{key}=", nil)
256
- elsif type =~ /\AArray<(.*)>/i
257
- # check to ensure the input is an array given that the attribute
258
- # is documented as an array but the input is not
259
- if attributes[self.class.attribute_map[key]].is_a?(Array)
260
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
261
- end
262
- elsif !attributes[self.class.attribute_map[key]].nil?
263
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
264
- end
265
- end
266
-
267
- self
268
- end
269
-
270
- # Deserializes the data based on type
271
- # @param string type Data type
272
- # @param string value Value to be deserialized
273
- # @return [Object] Deserialized data
274
- def _deserialize(type, value)
275
- case type.to_sym
276
- when :Time
277
- Time.parse(value)
278
- when :Date
279
- Date.parse(value)
280
- when :String
281
- value.to_s
282
- when :Integer
283
- value.to_i
284
- when :Float
285
- value.to_f
286
- when :Boolean
287
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
288
- true
289
- else
290
- false
291
- end
292
- when :Object
293
- # generic object (usually a Hash), return directly
294
- value
295
- when /\AArray<(?<inner_type>.+)>\z/
296
- inner_type = Regexp.last_match[:inner_type]
297
- value.map { |v| _deserialize(inner_type, v) }
298
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
299
- k_type = Regexp.last_match[:k_type]
300
- v_type = Regexp.last_match[:v_type]
301
- {}.tap do |hash|
302
- value.each do |k, v|
303
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
304
- end
305
- end
306
- else # model
307
- # models (e.g. Pet) or oneOf
308
- klass = CryptoApis.const_get(type)
309
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
310
- end
311
- end
312
-
313
- # Returns the string representation of the object
314
- # @return [String] String presentation of the object
315
- def to_s
316
- to_hash.to_s
317
- end
318
-
319
- # to_body is an alias to to_hash (backward compatibility)
320
- # @return [Hash] Returns the object in the form of hash
321
- def to_body
322
- to_hash
323
- end
324
-
325
- # Returns the object in the form of hash
326
- # @return [Hash] Returns the object in the form of hash
327
- def to_hash
328
- hash = {}
329
- self.class.attribute_map.each_pair do |attr, param|
330
- value = self.send(attr)
331
- if value.nil?
332
- is_nullable = self.class.openapi_nullable.include?(attr)
333
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
334
- end
335
-
336
- hash[param] = _to_hash(value)
337
- end
338
- hash
339
- end
340
-
341
- # Outputs non-array value in the form of hash
342
- # For object, use to_hash. Otherwise, just return the value
343
- # @param [Object] value Any valid value
344
- # @return [Hash] Returns the value in the form of hash
345
- def _to_hash(value)
346
- if value.is_a?(Array)
347
- value.compact.map { |v| _to_hash(v) }
348
- elsif value.is_a?(Hash)
349
- {}.tap do |hash|
350
- value.each { |k, v| hash[k] = _to_hash(v) }
351
- end
352
- elsif value.respond_to? :to_hash
353
- value.to_hash
354
- else
355
- value
356
- end
357
- end
358
-
359
- end
360
-
361
- end