crypto_apis 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +51 -15
  3. data/docs/BroadcastLocallySignedTransactionR.md +24 -0
  4. data/docs/BroadcastLocallySignedTransactionRB.md +20 -0
  5. data/docs/BroadcastLocallySignedTransactionRBData.md +18 -0
  6. data/docs/BroadcastLocallySignedTransactionRBDataItem.md +22 -0
  7. data/docs/BroadcastLocallySignedTransactionRData.md +18 -0
  8. data/docs/BroadcastLocallySignedTransactionRI.md +18 -0
  9. data/docs/BroadcastTransactionFail.md +24 -0
  10. data/docs/BroadcastTransactionFailData.md +22 -0
  11. data/docs/BroadcastTransactionFailDataItem.md +24 -0
  12. data/docs/BroadcastTransactionSuccess.md +24 -0
  13. data/docs/BroadcastTransactionSuccessData.md +22 -0
  14. data/docs/BroadcastTransactionSuccessDataItem.md +22 -0
  15. data/docs/CreateCoinsTransactionRequestFromAddressRBDataItem.md +6 -2
  16. data/docs/CreateCoinsTransactionRequestFromAddressRI.md +4 -0
  17. data/docs/CreateCoinsTransactionRequestFromWalletRBDataItem.md +7 -3
  18. data/docs/{CreateCoinsTransactionRequestFromWalletRBDataItemDestinations.md → CreateCoinsTransactionRequestFromWalletRBDataItemRecipients.md} +3 -3
  19. data/docs/CreateCoinsTransactionRequestFromWalletRI.md +4 -0
  20. data/docs/CreateTokensTransactionRequestFromAddressRBDataItem.md +6 -2
  21. data/docs/CreateTokensTransactionRequestFromAddressRI.md +4 -0
  22. data/docs/FeaturesApi.md +167 -0
  23. data/docs/{ListReceivingAddressesR.md → GenerateDepositAddressR.md} +3 -3
  24. data/docs/{GenerateReceivingAddressRB.md → GenerateDepositAddressRB.md} +3 -3
  25. data/docs/GenerateDepositAddressRBData.md +18 -0
  26. data/docs/{GenerateReceivingAddressRBDataItem.md → GenerateDepositAddressRBDataItem.md} +2 -2
  27. data/docs/GenerateDepositAddressRData.md +18 -0
  28. data/docs/{GenerateReceivingAddressRI.md → GenerateDepositAddressRI.md} +2 -2
  29. data/docs/GeneratingApi.md +16 -16
  30. data/docs/GetAddressDetailsRIConfirmedBalance.md +2 -2
  31. data/docs/GetAddressDetailsRITotalReceived.md +2 -2
  32. data/docs/GetAddressDetailsRITotalSpent.md +2 -2
  33. data/docs/GetBlockDetailsByBlockHashRIBS.md +2 -0
  34. data/docs/GetBlockDetailsByBlockHashRIBSBSC.md +36 -0
  35. data/docs/GetBlockDetailsByBlockHeightRIBS.md +2 -0
  36. data/docs/GetBlockDetailsByBlockHeightRIBSBSC.md +34 -0
  37. data/docs/GetLatestMinedBlockRIBS.md +2 -0
  38. data/docs/GetLatestMinedBlockRIBSBSC.md +34 -0
  39. data/docs/GetTransactionDetailsByTransactionIDRIBS.md +2 -0
  40. data/docs/GetTransactionDetailsByTransactionIDRIBSBSC.md +28 -0
  41. data/docs/GetTransactionDetailsByTransactionIDRIBSBSCGasPrice.md +20 -0
  42. data/docs/GetTransactionDetailsByTransactionIDRIFee.md +1 -1
  43. data/docs/InformativeApi.md +15 -15
  44. data/docs/{GenerateReceivingAddressR.md → ListDepositAddressesR.md} +3 -3
  45. data/docs/{ListReceivingAddressesRData.md → ListDepositAddressesRData.md} +3 -3
  46. data/docs/{ListReceivingAddressesRI.md → ListDepositAddressesRI.md} +2 -2
  47. data/docs/ListTransactionsByAddressRIBS.md +2 -0
  48. data/docs/ListTransactionsByAddressRIBSBSC.md +30 -0
  49. data/docs/ListTransactionsByBlockHashRIBS.md +2 -0
  50. data/docs/ListTransactionsByBlockHashRIBSBSC.md +30 -0
  51. data/docs/ListTransactionsByBlockHashRIFee.md +1 -1
  52. data/docs/ListTransactionsByBlockHeightRIBS.md +2 -0
  53. data/docs/ListTransactionsByBlockHeightRIBSBSC.md +28 -0
  54. data/docs/ListTransactionsByBlockHeightRIBSBSCGasPrice.md +20 -0
  55. data/docs/ListXRPRippleTransactionsByAddressRI.md +2 -4
  56. data/docs/TransactionRequestApproval.md +24 -0
  57. data/docs/TransactionRequestApprovalData.md +22 -0
  58. data/docs/TransactionRequestApprovalDataItem.md +28 -0
  59. data/docs/TransactionRequestBroadcasted.md +24 -0
  60. data/docs/TransactionRequestBroadcastedData.md +22 -0
  61. data/docs/TransactionRequestBroadcastedDataItem.md +30 -0
  62. data/docs/TransactionRequestFail.md +24 -0
  63. data/docs/TransactionRequestFailData.md +22 -0
  64. data/docs/TransactionRequestFailDataItem.md +30 -0
  65. data/docs/TransactionRequestMined.md +24 -0
  66. data/docs/TransactionRequestMinedData.md +22 -0
  67. data/docs/TransactionRequestRejection.md +24 -0
  68. data/docs/TransactionRequestRejectionData.md +22 -0
  69. data/docs/TransactionRequestRejectionDataItem.md +28 -0
  70. data/docs/TransactionsApi.md +10 -10
  71. data/docs/XRPRippleApi.md +3 -1
  72. data/lib/crypto_apis.rb +46 -11
  73. data/lib/crypto_apis/api/features_api.rb +194 -0
  74. data/lib/crypto_apis/api/generating_api.rb +17 -17
  75. data/lib/crypto_apis/api/informative_api.rb +18 -18
  76. data/lib/crypto_apis/api/transactions_api.rb +10 -10
  77. data/lib/crypto_apis/api/unified_endpoints_api.rb +7 -7
  78. data/lib/crypto_apis/api/xrp_ripple_api.rb +7 -0
  79. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_r.rb +263 -0
  80. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_r_data.rb +223 -0
  81. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_rb.rb +233 -0
  82. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_rb_data.rb +223 -0
  83. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_rb_data_item.rb +249 -0
  84. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_ri.rb +224 -0
  85. data/lib/crypto_apis/models/broadcast_transaction_fail.rb +268 -0
  86. data/lib/crypto_apis/models/broadcast_transaction_fail_data.rb +254 -0
  87. data/lib/crypto_apis/models/broadcast_transaction_fail_data_item.rb +270 -0
  88. data/lib/crypto_apis/models/broadcast_transaction_success.rb +268 -0
  89. data/lib/crypto_apis/models/broadcast_transaction_success_data.rb +254 -0
  90. data/lib/crypto_apis/models/broadcast_transaction_success_data_item.rb +255 -0
  91. data/lib/crypto_apis/models/create_coins_transaction_request_from_address_rb_data_item.rb +30 -10
  92. data/lib/crypto_apis/models/create_coins_transaction_request_from_address_ri.rb +21 -1
  93. data/lib/crypto_apis/models/create_coins_transaction_request_from_wallet_rb_data_item.rb +38 -18
  94. data/lib/crypto_apis/models/{create_coins_transaction_request_from_wallet_rb_data_item_destinations.rb → create_coins_transaction_request_from_wallet_rb_data_item_recipients.rb} +4 -4
  95. data/lib/crypto_apis/models/create_coins_transaction_request_from_wallet_ri.rb +21 -1
  96. data/lib/crypto_apis/models/create_tokens_transaction_request_from_address_rb_data_item.rb +30 -10
  97. data/lib/crypto_apis/models/create_tokens_transaction_request_from_address_ri.rb +31 -1
  98. data/lib/crypto_apis/models/{list_receiving_addresses_r.rb → generate_deposit_address_r.rb} +4 -4
  99. data/lib/crypto_apis/models/{generate_receiving_address_r_data.rb → generate_deposit_address_r_data.rb} +4 -4
  100. data/lib/crypto_apis/models/{generate_receiving_address_rb.rb → generate_deposit_address_rb.rb} +4 -4
  101. data/lib/crypto_apis/models/{generate_receiving_address_rb_data.rb → generate_deposit_address_rb_data.rb} +4 -4
  102. data/lib/crypto_apis/models/{generate_receiving_address_rb_data_item.rb → generate_deposit_address_rb_data_item.rb} +3 -3
  103. data/lib/crypto_apis/models/{list_receiving_addresses_ri.rb → generate_deposit_address_ri.rb} +3 -3
  104. data/lib/crypto_apis/models/get_address_details_ri_confirmed_balance.rb +0 -1
  105. data/lib/crypto_apis/models/get_address_details_ri_total_received.rb +0 -1
  106. data/lib/crypto_apis/models/get_address_details_ri_total_spent.rb +0 -1
  107. data/lib/crypto_apis/models/get_block_details_by_block_hash_ribs.rb +1 -0
  108. data/lib/crypto_apis/models/get_block_details_by_block_hash_ribsbsc.rb +361 -0
  109. data/lib/crypto_apis/models/get_block_details_by_block_height_ribs.rb +1 -0
  110. data/lib/crypto_apis/models/get_block_details_by_block_height_ribsbsc.rb +345 -0
  111. data/lib/crypto_apis/models/get_latest_mined_block_ribs.rb +1 -0
  112. data/lib/crypto_apis/models/get_latest_mined_block_ribsbsc.rb +345 -0
  113. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idri_fee.rb +0 -1
  114. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribs.rb +1 -0
  115. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribsbsc.rb +299 -0
  116. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribsbsc_gas_price.rb +238 -0
  117. data/lib/crypto_apis/models/{generate_receiving_address_r.rb → list_deposit_addresses_r.rb} +4 -4
  118. data/lib/crypto_apis/models/{list_receiving_addresses_r_data.rb → list_deposit_addresses_r_data.rb} +4 -4
  119. data/lib/crypto_apis/models/{generate_receiving_address_ri.rb → list_deposit_addresses_ri.rb} +3 -3
  120. data/lib/crypto_apis/models/list_transactions_by_address_ribs.rb +1 -0
  121. data/lib/crypto_apis/models/list_transactions_by_address_ribsbsc.rb +314 -0
  122. data/lib/crypto_apis/models/list_transactions_by_block_hash_ri_fee.rb +0 -1
  123. data/lib/crypto_apis/models/list_transactions_by_block_hash_ribs.rb +1 -0
  124. data/lib/crypto_apis/models/list_transactions_by_block_hash_ribsbsc.rb +314 -0
  125. data/lib/crypto_apis/models/list_transactions_by_block_height_ribs.rb +1 -0
  126. data/lib/crypto_apis/models/list_transactions_by_block_height_ribsbsc.rb +299 -0
  127. data/lib/crypto_apis/models/list_transactions_by_block_height_ribsbsc_gas_price.rb +238 -0
  128. data/lib/crypto_apis/models/list_xrp_ripple_transactions_by_address_ri.rb +1 -16
  129. data/lib/crypto_apis/models/transaction_request_approval.rb +268 -0
  130. data/lib/crypto_apis/models/transaction_request_approval_data.rb +254 -0
  131. data/lib/crypto_apis/models/transaction_request_approval_data_item.rb +300 -0
  132. data/lib/crypto_apis/models/transaction_request_broadcasted.rb +268 -0
  133. data/lib/crypto_apis/models/transaction_request_broadcasted_data.rb +254 -0
  134. data/lib/crypto_apis/models/transaction_request_broadcasted_data_item.rb +315 -0
  135. data/lib/crypto_apis/models/transaction_request_fail.rb +268 -0
  136. data/lib/crypto_apis/models/transaction_request_fail_data.rb +254 -0
  137. data/lib/crypto_apis/models/transaction_request_fail_data_item.rb +315 -0
  138. data/lib/crypto_apis/models/transaction_request_mined.rb +268 -0
  139. data/lib/crypto_apis/models/transaction_request_mined_data.rb +254 -0
  140. data/lib/crypto_apis/models/transaction_request_rejection.rb +268 -0
  141. data/lib/crypto_apis/models/transaction_request_rejection_data.rb +254 -0
  142. data/lib/crypto_apis/models/transaction_request_rejection_data_item.rb +300 -0
  143. data/lib/crypto_apis/version.rb +1 -1
  144. data/spec/api/{validating_api_spec.rb → features_api_spec.rb} +21 -6
  145. data/spec/api/generating_api_spec.rb +5 -5
  146. data/spec/api/informative_api_spec.rb +5 -5
  147. data/spec/api/transactions_api_spec.rb +1 -1
  148. data/spec/api/xrp_ripple_api_spec.rb +1 -0
  149. data/spec/models/broadcast_locally_signed_transaction_r_data_spec.rb +34 -0
  150. data/spec/models/broadcast_locally_signed_transaction_r_spec.rb +52 -0
  151. data/spec/models/broadcast_locally_signed_transaction_rb_data_item_spec.rb +46 -0
  152. data/spec/models/broadcast_locally_signed_transaction_rb_data_spec.rb +34 -0
  153. data/spec/models/broadcast_locally_signed_transaction_rb_spec.rb +40 -0
  154. data/spec/models/broadcast_locally_signed_transaction_ri_spec.rb +34 -0
  155. data/spec/models/broadcast_transaction_fail_data_item_spec.rb +52 -0
  156. data/spec/models/broadcast_transaction_fail_data_spec.rb +46 -0
  157. data/spec/models/broadcast_transaction_fail_spec.rb +52 -0
  158. data/spec/models/broadcast_transaction_success_data_item_spec.rb +46 -0
  159. data/spec/models/broadcast_transaction_success_data_spec.rb +46 -0
  160. data/spec/models/broadcast_transaction_success_spec.rb +52 -0
  161. data/spec/models/create_coins_transaction_request_from_address_rb_data_item_spec.rb +13 -1
  162. data/spec/models/create_coins_transaction_request_from_address_ri_spec.rb +12 -0
  163. data/spec/models/{create_coins_transaction_request_from_wallet_rb_data_item_destinations_spec.rb → create_coins_transaction_request_from_wallet_rb_data_item_recipients_spec.rb} +6 -6
  164. data/spec/models/create_coins_transaction_request_from_wallet_rb_data_item_spec.rb +13 -1
  165. data/spec/models/create_coins_transaction_request_from_wallet_ri_spec.rb +12 -0
  166. data/spec/models/create_tokens_transaction_request_from_address_rb_data_item_spec.rb +13 -1
  167. data/spec/models/create_tokens_transaction_request_from_address_ri_spec.rb +12 -0
  168. data/spec/models/{generate_receiving_address_r_data_spec.rb → generate_deposit_address_r_data_spec.rb} +6 -6
  169. data/spec/models/{list_receiving_addresses_r_spec.rb → generate_deposit_address_r_spec.rb} +6 -6
  170. data/spec/models/{generate_receiving_address_rb_data_item_spec.rb → generate_deposit_address_rb_data_item_spec.rb} +6 -6
  171. data/spec/models/{generate_receiving_address_rb_data_spec.rb → generate_deposit_address_rb_data_spec.rb} +6 -6
  172. data/spec/models/{generate_receiving_address_rb_spec.rb → generate_deposit_address_rb_spec.rb} +6 -6
  173. data/spec/models/{list_receiving_addresses_ri_spec.rb → generate_deposit_address_ri_spec.rb} +6 -6
  174. data/spec/models/get_block_details_by_block_hash_ribsbsc_spec.rb +88 -0
  175. data/spec/models/get_block_details_by_block_height_ribsbsc_spec.rb +82 -0
  176. data/spec/models/get_latest_mined_block_ribsbsc_spec.rb +82 -0
  177. data/spec/models/get_transaction_details_by_transaction_idribsbsc_gas_price_spec.rb +40 -0
  178. data/spec/models/get_transaction_details_by_transaction_idribsbsc_spec.rb +64 -0
  179. data/spec/models/{list_receiving_addresses_r_data_spec.rb → list_deposit_addresses_r_data_spec.rb} +6 -6
  180. data/spec/models/{generate_receiving_address_r_spec.rb → list_deposit_addresses_r_spec.rb} +6 -6
  181. data/spec/models/{generate_receiving_address_ri_spec.rb → list_deposit_addresses_ri_spec.rb} +6 -6
  182. data/spec/models/list_transactions_by_address_ribsbsc_spec.rb +70 -0
  183. data/spec/models/list_transactions_by_block_hash_ribsbsc_spec.rb +70 -0
  184. data/spec/models/list_transactions_by_block_height_ribsbsc_gas_price_spec.rb +40 -0
  185. data/spec/models/list_transactions_by_block_height_ribsbsc_spec.rb +64 -0
  186. data/spec/models/list_xrp_ripple_transactions_by_address_ri_spec.rb +0 -6
  187. data/spec/models/transaction_request_approval_data_item_spec.rb +64 -0
  188. data/spec/models/transaction_request_approval_data_spec.rb +46 -0
  189. data/spec/models/transaction_request_approval_spec.rb +52 -0
  190. data/spec/models/transaction_request_broadcasted_data_item_spec.rb +70 -0
  191. data/spec/models/transaction_request_broadcasted_data_spec.rb +46 -0
  192. data/spec/models/transaction_request_broadcasted_spec.rb +52 -0
  193. data/spec/models/transaction_request_fail_data_item_spec.rb +70 -0
  194. data/spec/models/transaction_request_fail_data_spec.rb +46 -0
  195. data/spec/models/transaction_request_fail_spec.rb +52 -0
  196. data/spec/models/transaction_request_mined_data_spec.rb +46 -0
  197. data/spec/models/transaction_request_mined_spec.rb +52 -0
  198. data/spec/models/transaction_request_rejection_data_item_spec.rb +64 -0
  199. data/spec/models/transaction_request_rejection_data_spec.rb +46 -0
  200. data/spec/models/transaction_request_rejection_spec.rb +52 -0
  201. metadata +186 -46
  202. data/docs/GenerateReceivingAddressRBData.md +0 -18
  203. data/docs/GenerateReceivingAddressRData.md +0 -18
  204. data/docs/ValidatingApi.md +0 -87
  205. data/lib/crypto_apis/api/validating_api.rb +0 -108
@@ -18,7 +18,6 @@ module CryptoApis
18
18
  # Defines the total balance of the address that is confirmed. It doesn't include unconfirmed transactions.
19
19
  attr_accessor :amount
20
20
 
21
- # Defines the unit of the confirmed balance amount, e.g. BTC, ETH, XRP.
22
21
  attr_accessor :unit
23
22
 
24
23
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -18,7 +18,6 @@ module CryptoApis
18
18
  # Defines the total amount of all coins received to the address, based on confirmed transactions.
19
19
  attr_accessor :amount
20
20
 
21
- # Defines the unit of the received amount, e.g. BTC, ETH, XRP.
22
21
  attr_accessor :unit
23
22
 
24
23
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -18,7 +18,6 @@ module CryptoApis
18
18
  # Defines the total amount of all spent by this address coins, based on confirmed transactions.
19
19
  attr_accessor :amount
20
20
 
21
- # Defines the unit of the spent amount, e.g. BTC, ETH, XRP.
22
21
  attr_accessor :unit
23
22
 
24
23
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -21,6 +21,7 @@ module CryptoApis
21
21
  [
22
22
  :'GetBlockDetailsByBlockHashRIBSB',
23
23
  :'GetBlockDetailsByBlockHashRIBSBC',
24
+ :'GetBlockDetailsByBlockHashRIBSBSC',
24
25
  :'GetBlockDetailsByBlockHashRIBSD',
25
26
  :'GetBlockDetailsByBlockHashRIBSD2',
26
27
  :'GetBlockDetailsByBlockHashRIBSE',
@@ -0,0 +1,361 @@
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
@@ -21,6 +21,7 @@ module CryptoApis
21
21
  [
22
22
  :'GetBlockDetailsByBlockHeightRIBSB',
23
23
  :'GetBlockDetailsByBlockHeightRIBSBC',
24
+ :'GetBlockDetailsByBlockHeightRIBSBSC',
24
25
  :'GetBlockDetailsByBlockHeightRIBSD',
25
26
  :'GetBlockDetailsByBlockHeightRIBSD2',
26
27
  :'GetBlockDetailsByBlockHeightRIBSE',
@@ -0,0 +1,345 @@
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 GetBlockDetailsByBlockHeightRIBSBSC
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
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'difficulty' => :'difficulty',
50
+ :'nonce' => :'nonce',
51
+ :'size' => :'size',
52
+ :'extra_data' => :'extraData',
53
+ :'gas_limit' => :'gasLimit',
54
+ :'gas_used' => :'gasUsed',
55
+ :'mined_in_seconds' => :'minedInSeconds',
56
+ :'sha3_uncles' => :'sha3Uncles',
57
+ :'total_difficulty' => :'totalDifficulty'
58
+ }
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'difficulty' => :'String',
70
+ :'nonce' => :'Integer',
71
+ :'size' => :'Integer',
72
+ :'extra_data' => :'String',
73
+ :'gas_limit' => :'String',
74
+ :'gas_used' => :'String',
75
+ :'mined_in_seconds' => :'String',
76
+ :'sha3_uncles' => :'String',
77
+ :'total_difficulty' => :'String'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ ])
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CryptoApis::GetBlockDetailsByBlockHeightRIBSBSC` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!self.class.attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CryptoApis::GetBlockDetailsByBlockHeightRIBSBSC`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'difficulty')
103
+ self.difficulty = attributes[:'difficulty']
104
+ end
105
+
106
+ if attributes.key?(:'nonce')
107
+ self.nonce = attributes[:'nonce']
108
+ end
109
+
110
+ if attributes.key?(:'size')
111
+ self.size = attributes[:'size']
112
+ end
113
+
114
+ if attributes.key?(:'extra_data')
115
+ self.extra_data = attributes[:'extra_data']
116
+ end
117
+
118
+ if attributes.key?(:'gas_limit')
119
+ self.gas_limit = attributes[:'gas_limit']
120
+ end
121
+
122
+ if attributes.key?(:'gas_used')
123
+ self.gas_used = attributes[:'gas_used']
124
+ end
125
+
126
+ if attributes.key?(:'mined_in_seconds')
127
+ self.mined_in_seconds = attributes[:'mined_in_seconds']
128
+ end
129
+
130
+ if attributes.key?(:'sha3_uncles')
131
+ self.sha3_uncles = attributes[:'sha3_uncles']
132
+ end
133
+
134
+ if attributes.key?(:'total_difficulty')
135
+ self.total_difficulty = attributes[:'total_difficulty']
136
+ end
137
+ end
138
+
139
+ # Show invalid properties with the reasons. Usually used together with valid?
140
+ # @return Array for valid properties with the reasons
141
+ def list_invalid_properties
142
+ invalid_properties = Array.new
143
+ if @difficulty.nil?
144
+ invalid_properties.push('invalid value for "difficulty", difficulty cannot be nil.')
145
+ end
146
+
147
+ if @nonce.nil?
148
+ invalid_properties.push('invalid value for "nonce", nonce cannot be nil.')
149
+ end
150
+
151
+ if @size.nil?
152
+ invalid_properties.push('invalid value for "size", size cannot be nil.')
153
+ end
154
+
155
+ if @extra_data.nil?
156
+ invalid_properties.push('invalid value for "extra_data", extra_data cannot be nil.')
157
+ end
158
+
159
+ if @gas_limit.nil?
160
+ invalid_properties.push('invalid value for "gas_limit", gas_limit cannot be nil.')
161
+ end
162
+
163
+ if @gas_used.nil?
164
+ invalid_properties.push('invalid value for "gas_used", gas_used cannot be nil.')
165
+ end
166
+
167
+ if @mined_in_seconds.nil?
168
+ invalid_properties.push('invalid value for "mined_in_seconds", mined_in_seconds cannot be nil.')
169
+ end
170
+
171
+ if @sha3_uncles.nil?
172
+ invalid_properties.push('invalid value for "sha3_uncles", sha3_uncles cannot be nil.')
173
+ end
174
+
175
+ if @total_difficulty.nil?
176
+ invalid_properties.push('invalid value for "total_difficulty", total_difficulty cannot be nil.')
177
+ end
178
+
179
+ invalid_properties
180
+ end
181
+
182
+ # Check to see if the all the properties in the model are valid
183
+ # @return true if the model is valid
184
+ def valid?
185
+ return false if @difficulty.nil?
186
+ return false if @nonce.nil?
187
+ return false if @size.nil?
188
+ return false if @extra_data.nil?
189
+ return false if @gas_limit.nil?
190
+ return false if @gas_used.nil?
191
+ return false if @mined_in_seconds.nil?
192
+ return false if @sha3_uncles.nil?
193
+ return false if @total_difficulty.nil?
194
+ true
195
+ end
196
+
197
+ # Checks equality by comparing each attribute.
198
+ # @param [Object] Object to be compared
199
+ def ==(o)
200
+ return true if self.equal?(o)
201
+ self.class == o.class &&
202
+ difficulty == o.difficulty &&
203
+ nonce == o.nonce &&
204
+ size == o.size &&
205
+ extra_data == o.extra_data &&
206
+ gas_limit == o.gas_limit &&
207
+ gas_used == o.gas_used &&
208
+ mined_in_seconds == o.mined_in_seconds &&
209
+ sha3_uncles == o.sha3_uncles &&
210
+ total_difficulty == o.total_difficulty
211
+ end
212
+
213
+ # @see the `==` method
214
+ # @param [Object] Object to be compared
215
+ def eql?(o)
216
+ self == o
217
+ end
218
+
219
+ # Calculates hash code according to all attributes.
220
+ # @return [Integer] Hash code
221
+ def hash
222
+ [difficulty, nonce, size, extra_data, gas_limit, gas_used, mined_in_seconds, sha3_uncles, total_difficulty].hash
223
+ end
224
+
225
+ # Builds the object from hash
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ # @return [Object] Returns the model itself
228
+ def self.build_from_hash(attributes)
229
+ new.build_from_hash(attributes)
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+ self.class.openapi_types.each_pair do |key, type|
238
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
239
+ self.send("#{key}=", nil)
240
+ elsif type =~ /\AArray<(.*)>/i
241
+ # check to ensure the input is an array given that the attribute
242
+ # is documented as an array but the input is not
243
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
244
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
245
+ end
246
+ elsif !attributes[self.class.attribute_map[key]].nil?
247
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
248
+ end
249
+ end
250
+
251
+ self
252
+ end
253
+
254
+ # Deserializes the data based on type
255
+ # @param string type Data type
256
+ # @param string value Value to be deserialized
257
+ # @return [Object] Deserialized data
258
+ def _deserialize(type, value)
259
+ case type.to_sym
260
+ when :Time
261
+ Time.parse(value)
262
+ when :Date
263
+ Date.parse(value)
264
+ when :String
265
+ value.to_s
266
+ when :Integer
267
+ value.to_i
268
+ when :Float
269
+ value.to_f
270
+ when :Boolean
271
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
272
+ true
273
+ else
274
+ false
275
+ end
276
+ when :Object
277
+ # generic object (usually a Hash), return directly
278
+ value
279
+ when /\AArray<(?<inner_type>.+)>\z/
280
+ inner_type = Regexp.last_match[:inner_type]
281
+ value.map { |v| _deserialize(inner_type, v) }
282
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
283
+ k_type = Regexp.last_match[:k_type]
284
+ v_type = Regexp.last_match[:v_type]
285
+ {}.tap do |hash|
286
+ value.each do |k, v|
287
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
288
+ end
289
+ end
290
+ else # model
291
+ # models (e.g. Pet) or oneOf
292
+ klass = CryptoApis.const_get(type)
293
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
294
+ end
295
+ end
296
+
297
+ # Returns the string representation of the object
298
+ # @return [String] String presentation of the object
299
+ def to_s
300
+ to_hash.to_s
301
+ end
302
+
303
+ # to_body is an alias to to_hash (backward compatibility)
304
+ # @return [Hash] Returns the object in the form of hash
305
+ def to_body
306
+ to_hash
307
+ end
308
+
309
+ # Returns the object in the form of hash
310
+ # @return [Hash] Returns the object in the form of hash
311
+ def to_hash
312
+ hash = {}
313
+ self.class.attribute_map.each_pair do |attr, param|
314
+ value = self.send(attr)
315
+ if value.nil?
316
+ is_nullable = self.class.openapi_nullable.include?(attr)
317
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
318
+ end
319
+
320
+ hash[param] = _to_hash(value)
321
+ end
322
+ hash
323
+ end
324
+
325
+ # Outputs non-array value in the form of hash
326
+ # For object, use to_hash. Otherwise, just return the value
327
+ # @param [Object] value Any valid value
328
+ # @return [Hash] Returns the value in the form of hash
329
+ def _to_hash(value)
330
+ if value.is_a?(Array)
331
+ value.compact.map { |v| _to_hash(v) }
332
+ elsif value.is_a?(Hash)
333
+ {}.tap do |hash|
334
+ value.each { |k, v| hash[k] = _to_hash(v) }
335
+ end
336
+ elsif value.respond_to? :to_hash
337
+ value.to_hash
338
+ else
339
+ value
340
+ end
341
+ end
342
+
343
+ end
344
+
345
+ end