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
@@ -1,18 +0,0 @@
1
- # CryptoApis::GenerateReceivingAddressRBData
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **item** | [**GenerateReceivingAddressRBDataItem**](GenerateReceivingAddressRBDataItem.md) | | |
8
-
9
- ## Example
10
-
11
- ```ruby
12
- require 'crypto_apis'
13
-
14
- instance = CryptoApis::GenerateReceivingAddressRBData.new(
15
- item: null
16
- )
17
- ```
18
-
@@ -1,18 +0,0 @@
1
- # CryptoApis::GenerateReceivingAddressRData
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **item** | [**GenerateReceivingAddressRI**](GenerateReceivingAddressRI.md) | | |
8
-
9
- ## Example
10
-
11
- ```ruby
12
- require 'crypto_apis'
13
-
14
- instance = CryptoApis::GenerateReceivingAddressRData.new(
15
- item: null
16
- )
17
- ```
18
-
@@ -1,87 +0,0 @@
1
- # CryptoApis::ValidatingApi
2
-
3
- All URIs are relative to *https://rest.cryptoapis.io/v2*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**validate_address**](ValidatingApi.md#validate_address) | **POST** /blockchain-tools/{blockchain}/{network}/addresses/validate | Validate Address |
8
-
9
-
10
- ## validate_address
11
-
12
- > <ValidateAddressR> validate_address(blockchain, network, opts)
13
-
14
- Validate Address
15
-
16
- This endpoint checks user public addresses whether they are valid or not.
17
-
18
- ### Examples
19
-
20
- ```ruby
21
- require 'time'
22
- require 'crypto_apis'
23
- # setup authorization
24
- CryptoApis.configure do |config|
25
- # Configure API key authorization: ApiKey
26
- config.api_key['ApiKey'] = 'YOUR API KEY'
27
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
28
- # config.api_key_prefix['ApiKey'] = 'Bearer'
29
- end
30
-
31
- api_instance = CryptoApis::ValidatingApi.new
32
- blockchain = 'bitcoin' # String | Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.
33
- network = 'mainnet' # String | Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - \"mainnet\" is the live network with actual data while networks like \"testnet\", \"ropsten\", \"rinkeby\" are test networks.
34
- opts = {
35
- context: 'context_example', # String | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user.
36
- validate_address_rb: CryptoApis::ValidateAddressRB.new({data: CryptoApis::ValidateAddressRBData.new({item: CryptoApis::ValidateAddressRBDataItem.new({address: 'mho4jHBcrNCncKt38trJahXakuaBnS7LK5'})})}) # ValidateAddressRB |
37
- }
38
-
39
- begin
40
- # Validate Address
41
- result = api_instance.validate_address(blockchain, network, opts)
42
- p result
43
- rescue CryptoApis::ApiError => e
44
- puts "Error when calling ValidatingApi->validate_address: #{e}"
45
- end
46
- ```
47
-
48
- #### Using the validate_address_with_http_info variant
49
-
50
- This returns an Array which contains the response data, status code and headers.
51
-
52
- > <Array(<ValidateAddressR>, Integer, Hash)> validate_address_with_http_info(blockchain, network, opts)
53
-
54
- ```ruby
55
- begin
56
- # Validate Address
57
- data, status_code, headers = api_instance.validate_address_with_http_info(blockchain, network, opts)
58
- p status_code # => 2xx
59
- p headers # => { ... }
60
- p data # => <ValidateAddressR>
61
- rescue CryptoApis::ApiError => e
62
- puts "Error when calling ValidatingApi->validate_address_with_http_info: #{e}"
63
- end
64
- ```
65
-
66
- ### Parameters
67
-
68
- | Name | Type | Description | Notes |
69
- | ---- | ---- | ----------- | ----- |
70
- | **blockchain** | **String** | Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. | |
71
- | **network** | **String** | Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - \&quot;mainnet\&quot; is the live network with actual data while networks like \&quot;testnet\&quot;, \&quot;ropsten\&quot;, \&quot;rinkeby\&quot; are test networks. | |
72
- | **context** | **String** | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. &#x60;context&#x60; is specified by the user. | [optional] |
73
- | **validate_address_rb** | [**ValidateAddressRB**](ValidateAddressRB.md) | | [optional] |
74
-
75
- ### Return type
76
-
77
- [**ValidateAddressR**](ValidateAddressR.md)
78
-
79
- ### Authorization
80
-
81
- [ApiKey](../README.md#ApiKey)
82
-
83
- ### HTTP request headers
84
-
85
- - **Content-Type**: application/json
86
- - **Accept**: application/json
87
-
@@ -1,108 +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 'cgi'
14
-
15
- module CryptoApis
16
- class ValidatingApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Validate Address
23
- # This endpoint checks user public addresses whether they are valid or not.
24
- # @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.
25
- # @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - \&quot;mainnet\&quot; is the live network with actual data while networks like \&quot;testnet\&quot;, \&quot;ropsten\&quot;, \&quot;rinkeby\&quot; are test networks.
26
- # @param [Hash] opts the optional parameters
27
- # @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. &#x60;context&#x60; is specified by the user.
28
- # @option opts [ValidateAddressRB] :validate_address_rb
29
- # @return [ValidateAddressR]
30
- def validate_address(blockchain, network, opts = {})
31
- data, _status_code, _headers = validate_address_with_http_info(blockchain, network, opts)
32
- data
33
- end
34
-
35
- # Validate Address
36
- # This endpoint checks user public addresses whether they are valid or not.
37
- # @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.
38
- # @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - \&quot;mainnet\&quot; is the live network with actual data while networks like \&quot;testnet\&quot;, \&quot;ropsten\&quot;, \&quot;rinkeby\&quot; are test networks.
39
- # @param [Hash] opts the optional parameters
40
- # @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. &#x60;context&#x60; is specified by the user.
41
- # @option opts [ValidateAddressRB] :validate_address_rb
42
- # @return [Array<(ValidateAddressR, Integer, Hash)>] ValidateAddressR data, response status code and response headers
43
- def validate_address_with_http_info(blockchain, network, opts = {})
44
- if @api_client.config.debugging
45
- @api_client.config.logger.debug 'Calling API: ValidatingApi.validate_address ...'
46
- end
47
- # verify the required parameter 'blockchain' is set
48
- if @api_client.config.client_side_validation && blockchain.nil?
49
- fail ArgumentError, "Missing the required parameter 'blockchain' when calling ValidatingApi.validate_address"
50
- end
51
- # verify enum value
52
- allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "ethereum", "ethereum-classic", "xrp"]
53
- if @api_client.config.client_side_validation && !allowable_values.include?(blockchain)
54
- fail ArgumentError, "invalid value for \"blockchain\", must be one of #{allowable_values}"
55
- end
56
- # verify the required parameter 'network' is set
57
- if @api_client.config.client_side_validation && network.nil?
58
- fail ArgumentError, "Missing the required parameter 'network' when calling ValidatingApi.validate_address"
59
- end
60
- # verify enum value
61
- allowable_values = ["mainnet", "testnet", "ropsten", "rinkeby", "mordor", "kotti"]
62
- if @api_client.config.client_side_validation && !allowable_values.include?(network)
63
- fail ArgumentError, "invalid value for \"network\", must be one of #{allowable_values}"
64
- end
65
- # resource path
66
- local_var_path = '/blockchain-tools/{blockchain}/{network}/addresses/validate'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s))
67
-
68
- # query parameters
69
- query_params = opts[:query_params] || {}
70
- query_params[:'context'] = opts[:'context'] if !opts[:'context'].nil?
71
-
72
- # header parameters
73
- header_params = opts[:header_params] || {}
74
- # HTTP header 'Accept' (if needed)
75
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
76
- # HTTP header 'Content-Type'
77
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
78
-
79
- # form parameters
80
- form_params = opts[:form_params] || {}
81
-
82
- # http body (model)
83
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'validate_address_rb'])
84
-
85
- # return_type
86
- return_type = opts[:debug_return_type] || 'ValidateAddressR'
87
-
88
- # auth_names
89
- auth_names = opts[:debug_auth_names] || ['ApiKey']
90
-
91
- new_options = opts.merge(
92
- :operation => :"ValidatingApi.validate_address",
93
- :header_params => header_params,
94
- :query_params => query_params,
95
- :form_params => form_params,
96
- :body => post_body,
97
- :auth_names => auth_names,
98
- :return_type => return_type
99
- )
100
-
101
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
102
- if @api_client.config.debugging
103
- @api_client.config.logger.debug "API called: ValidatingApi#validate_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
104
- end
105
- return data, status_code, headers
106
- end
107
- end
108
- end