aws-sdk-managedblockchainquery 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,834 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ require 'seahorse/client/plugins/content_length.rb'
11
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
12
+ require 'aws-sdk-core/plugins/logging.rb'
13
+ require 'aws-sdk-core/plugins/param_converter.rb'
14
+ require 'aws-sdk-core/plugins/param_validator.rb'
15
+ require 'aws-sdk-core/plugins/user_agent.rb'
16
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
17
+ require 'aws-sdk-core/plugins/retry_errors.rb'
18
+ require 'aws-sdk-core/plugins/global_configuration.rb'
19
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
20
+ require 'aws-sdk-core/plugins/endpoint_discovery.rb'
21
+ require 'aws-sdk-core/plugins/endpoint_pattern.rb'
22
+ require 'aws-sdk-core/plugins/response_paging.rb'
23
+ require 'aws-sdk-core/plugins/stub_responses.rb'
24
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
25
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
26
+ require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
27
+ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
+ require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
+ require 'aws-sdk-core/plugins/http_checksum.rb'
30
+ require 'aws-sdk-core/plugins/checksum_algorithm.rb'
31
+ require 'aws-sdk-core/plugins/request_compression.rb'
32
+ require 'aws-sdk-core/plugins/defaults_mode.rb'
33
+ require 'aws-sdk-core/plugins/recursion_detection.rb'
34
+ require 'aws-sdk-core/plugins/sign.rb'
35
+ require 'aws-sdk-core/plugins/protocols/rest_json.rb'
36
+
37
+ Aws::Plugins::GlobalConfiguration.add_identifier(:managedblockchainquery)
38
+
39
+ module Aws::ManagedBlockchainQuery
40
+ # An API client for ManagedBlockchainQuery. To construct a client, you need to configure a `:region` and `:credentials`.
41
+ #
42
+ # client = Aws::ManagedBlockchainQuery::Client.new(
43
+ # region: region_name,
44
+ # credentials: credentials,
45
+ # # ...
46
+ # )
47
+ #
48
+ # For details on configuring region and credentials see
49
+ # the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
50
+ #
51
+ # See {#initialize} for a full list of supported configuration options.
52
+ class Client < Seahorse::Client::Base
53
+
54
+ include Aws::ClientStubs
55
+
56
+ @identifier = :managedblockchainquery
57
+
58
+ set_api(ClientApi::API)
59
+
60
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
61
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
62
+ add_plugin(Aws::Plugins::Logging)
63
+ add_plugin(Aws::Plugins::ParamConverter)
64
+ add_plugin(Aws::Plugins::ParamValidator)
65
+ add_plugin(Aws::Plugins::UserAgent)
66
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
67
+ add_plugin(Aws::Plugins::RetryErrors)
68
+ add_plugin(Aws::Plugins::GlobalConfiguration)
69
+ add_plugin(Aws::Plugins::RegionalEndpoint)
70
+ add_plugin(Aws::Plugins::EndpointDiscovery)
71
+ add_plugin(Aws::Plugins::EndpointPattern)
72
+ add_plugin(Aws::Plugins::ResponsePaging)
73
+ add_plugin(Aws::Plugins::StubResponses)
74
+ add_plugin(Aws::Plugins::IdempotencyToken)
75
+ add_plugin(Aws::Plugins::JsonvalueConverter)
76
+ add_plugin(Aws::Plugins::ClientMetricsPlugin)
77
+ add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
78
+ add_plugin(Aws::Plugins::TransferEncoding)
79
+ add_plugin(Aws::Plugins::HttpChecksum)
80
+ add_plugin(Aws::Plugins::ChecksumAlgorithm)
81
+ add_plugin(Aws::Plugins::RequestCompression)
82
+ add_plugin(Aws::Plugins::DefaultsMode)
83
+ add_plugin(Aws::Plugins::RecursionDetection)
84
+ add_plugin(Aws::Plugins::Sign)
85
+ add_plugin(Aws::Plugins::Protocols::RestJson)
86
+ add_plugin(Aws::ManagedBlockchainQuery::Plugins::Endpoints)
87
+
88
+ # @overload initialize(options)
89
+ # @param [Hash] options
90
+ # @option options [required, Aws::CredentialProvider] :credentials
91
+ # Your AWS credentials. This can be an instance of any one of the
92
+ # following classes:
93
+ #
94
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
95
+ # credentials.
96
+ #
97
+ # * `Aws::SharedCredentials` - Used for loading static credentials from a
98
+ # shared file, such as `~/.aws/config`.
99
+ #
100
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
101
+ #
102
+ # * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
103
+ # assume a role after providing credentials via the web.
104
+ #
105
+ # * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
106
+ # access token generated from `aws login`.
107
+ #
108
+ # * `Aws::ProcessCredentials` - Used for loading credentials from a
109
+ # process that outputs to stdout.
110
+ #
111
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
112
+ # from an EC2 IMDS on an EC2 instance.
113
+ #
114
+ # * `Aws::ECSCredentials` - Used for loading credentials from
115
+ # instances running in ECS.
116
+ #
117
+ # * `Aws::CognitoIdentityCredentials` - Used for loading credentials
118
+ # from the Cognito Identity service.
119
+ #
120
+ # When `:credentials` are not configured directly, the following
121
+ # locations will be searched for credentials:
122
+ #
123
+ # * `Aws.config[:credentials]`
124
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
125
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
126
+ # * `~/.aws/credentials`
127
+ # * `~/.aws/config`
128
+ # * EC2/ECS IMDS instance profile - When used by default, the timeouts
129
+ # are very aggressive. Construct and pass an instance of
130
+ # `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
131
+ # enable retries and extended timeouts. Instance profile credential
132
+ # fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
133
+ # to true.
134
+ #
135
+ # @option options [required, String] :region
136
+ # The AWS region to connect to. The configured `:region` is
137
+ # used to determine the service `:endpoint`. When not passed,
138
+ # a default `:region` is searched for in the following locations:
139
+ #
140
+ # * `Aws.config[:region]`
141
+ # * `ENV['AWS_REGION']`
142
+ # * `ENV['AMAZON_REGION']`
143
+ # * `ENV['AWS_DEFAULT_REGION']`
144
+ # * `~/.aws/credentials`
145
+ # * `~/.aws/config`
146
+ #
147
+ # @option options [String] :access_key_id
148
+ #
149
+ # @option options [Boolean] :active_endpoint_cache (false)
150
+ # When set to `true`, a thread polling for endpoints will be running in
151
+ # the background every 60 secs (default). Defaults to `false`.
152
+ #
153
+ # @option options [Boolean] :adaptive_retry_wait_to_fill (true)
154
+ # Used only in `adaptive` retry mode. When true, the request will sleep
155
+ # until there is sufficent client side capacity to retry the request.
156
+ # When false, the request will raise a `RetryCapacityNotAvailableError` and will
157
+ # not retry instead of sleeping.
158
+ #
159
+ # @option options [Boolean] :client_side_monitoring (false)
160
+ # When `true`, client-side metrics will be collected for all API requests from
161
+ # this client.
162
+ #
163
+ # @option options [String] :client_side_monitoring_client_id ("")
164
+ # Allows you to provide an identifier for this client which will be attached to
165
+ # all generated client side metrics. Defaults to an empty string.
166
+ #
167
+ # @option options [String] :client_side_monitoring_host ("127.0.0.1")
168
+ # Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
169
+ # side monitoring agent is running on, where client metrics will be published via UDP.
170
+ #
171
+ # @option options [Integer] :client_side_monitoring_port (31000)
172
+ # Required for publishing client metrics. The port that the client side monitoring
173
+ # agent is running on, where client metrics will be published via UDP.
174
+ #
175
+ # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
176
+ # Allows you to provide a custom client-side monitoring publisher class. By default,
177
+ # will use the Client Side Monitoring Agent Publisher.
178
+ #
179
+ # @option options [Boolean] :convert_params (true)
180
+ # When `true`, an attempt is made to coerce request parameters into
181
+ # the required types.
182
+ #
183
+ # @option options [Boolean] :correct_clock_skew (true)
184
+ # Used only in `standard` and adaptive retry modes. Specifies whether to apply
185
+ # a clock skew correction and retry requests with skewed client clocks.
186
+ #
187
+ # @option options [String] :defaults_mode ("legacy")
188
+ # See {Aws::DefaultsModeConfiguration} for a list of the
189
+ # accepted modes and the configuration defaults that are included.
190
+ #
191
+ # @option options [Boolean] :disable_host_prefix_injection (false)
192
+ # Set to true to disable SDK automatically adding host prefix
193
+ # to default service endpoint when available.
194
+ #
195
+ # @option options [Boolean] :disable_request_compression (false)
196
+ # When set to 'true' the request body will not be compressed
197
+ # for supported operations.
198
+ #
199
+ # @option options [String] :endpoint
200
+ # The client endpoint is normally constructed from the `:region`
201
+ # option. You should only configure an `:endpoint` when connecting
202
+ # to test or custom endpoints. This should be a valid HTTP(S) URI.
203
+ #
204
+ # @option options [Integer] :endpoint_cache_max_entries (1000)
205
+ # Used for the maximum size limit of the LRU cache storing endpoints data
206
+ # for endpoint discovery enabled operations. Defaults to 1000.
207
+ #
208
+ # @option options [Integer] :endpoint_cache_max_threads (10)
209
+ # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
210
+ #
211
+ # @option options [Integer] :endpoint_cache_poll_interval (60)
212
+ # When :endpoint_discovery and :active_endpoint_cache is enabled,
213
+ # Use this option to config the time interval in seconds for making
214
+ # requests fetching endpoints information. Defaults to 60 sec.
215
+ #
216
+ # @option options [Boolean] :endpoint_discovery (false)
217
+ # When set to `true`, endpoint discovery will be enabled for operations when available.
218
+ #
219
+ # @option options [Boolean] :ignore_configured_endpoint_urls
220
+ # Setting to true disables use of endpoint URLs provided via environment
221
+ # variables and the shared configuration file.
222
+ #
223
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
224
+ # The log formatter.
225
+ #
226
+ # @option options [Symbol] :log_level (:info)
227
+ # The log level to send messages to the `:logger` at.
228
+ #
229
+ # @option options [Logger] :logger
230
+ # The Logger instance to send log messages to. If this option
231
+ # is not set, logging will be disabled.
232
+ #
233
+ # @option options [Integer] :max_attempts (3)
234
+ # An integer representing the maximum number attempts that will be made for
235
+ # a single request, including the initial attempt. For example,
236
+ # setting this value to 5 will result in a request being retried up to
237
+ # 4 times. Used in `standard` and `adaptive` retry modes.
238
+ #
239
+ # @option options [String] :profile ("default")
240
+ # Used when loading credentials from the shared credentials file
241
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
242
+ #
243
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
244
+ # The minimum size in bytes that triggers compression for request
245
+ # bodies. The value must be non-negative integer value between 0
246
+ # and 10485780 bytes inclusive.
247
+ #
248
+ # @option options [Proc] :retry_backoff
249
+ # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
250
+ # This option is only used in the `legacy` retry mode.
251
+ #
252
+ # @option options [Float] :retry_base_delay (0.3)
253
+ # The base delay in seconds used by the default backoff function. This option
254
+ # is only used in the `legacy` retry mode.
255
+ #
256
+ # @option options [Symbol] :retry_jitter (:none)
257
+ # A delay randomiser function used by the default backoff function.
258
+ # Some predefined functions can be referenced by name - :none, :equal, :full,
259
+ # otherwise a Proc that takes and returns a number. This option is only used
260
+ # in the `legacy` retry mode.
261
+ #
262
+ # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
263
+ #
264
+ # @option options [Integer] :retry_limit (3)
265
+ # The maximum number of times to retry failed requests. Only
266
+ # ~ 500 level server errors and certain ~ 400 level client errors
267
+ # are retried. Generally, these are throttling errors, data
268
+ # checksum errors, networking errors, timeout errors, auth errors,
269
+ # endpoint discovery, and errors from expired credentials.
270
+ # This option is only used in the `legacy` retry mode.
271
+ #
272
+ # @option options [Integer] :retry_max_delay (0)
273
+ # The maximum number of seconds to delay between retries (0 for no limit)
274
+ # used by the default backoff function. This option is only used in the
275
+ # `legacy` retry mode.
276
+ #
277
+ # @option options [String] :retry_mode ("legacy")
278
+ # Specifies which retry algorithm to use. Values are:
279
+ #
280
+ # * `legacy` - The pre-existing retry behavior. This is default value if
281
+ # no retry mode is provided.
282
+ #
283
+ # * `standard` - A standardized set of retry rules across the AWS SDKs.
284
+ # This includes support for retry quotas, which limit the number of
285
+ # unsuccessful retries a client can make.
286
+ #
287
+ # * `adaptive` - An experimental retry mode that includes all the
288
+ # functionality of `standard` mode along with automatic client side
289
+ # throttling. This is a provisional mode that may change behavior
290
+ # in the future.
291
+ #
292
+ #
293
+ # @option options [String] :sdk_ua_app_id
294
+ # A unique and opaque application ID that is appended to the
295
+ # User-Agent header as app/<sdk_ua_app_id>. It should have a
296
+ # maximum length of 50.
297
+ #
298
+ # @option options [String] :secret_access_key
299
+ #
300
+ # @option options [String] :session_token
301
+ #
302
+ # @option options [Boolean] :stub_responses (false)
303
+ # Causes the client to return stubbed responses. By default
304
+ # fake responses are generated and returned. You can specify
305
+ # the response data to return or errors to raise by calling
306
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
307
+ #
308
+ # ** Please note ** When response stubbing is enabled, no HTTP
309
+ # requests are made, and retries are disabled.
310
+ #
311
+ # @option options [Aws::TokenProvider] :token_provider
312
+ # A Bearer Token Provider. This can be an instance of any one of the
313
+ # following classes:
314
+ #
315
+ # * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
316
+ # tokens.
317
+ #
318
+ # * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
319
+ # access token generated from `aws login`.
320
+ #
321
+ # When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
322
+ # will be used to search for tokens configured for your profile in shared configuration files.
323
+ #
324
+ # @option options [Boolean] :use_dualstack_endpoint
325
+ # When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
326
+ # will be used if available.
327
+ #
328
+ # @option options [Boolean] :use_fips_endpoint
329
+ # When set to `true`, fips compatible endpoints will be used if available.
330
+ # When a `fips` region is used, the region is normalized and this config
331
+ # is set to `true`.
332
+ #
333
+ # @option options [Boolean] :validate_params (true)
334
+ # When `true`, request parameters are validated before
335
+ # sending the request.
336
+ #
337
+ # @option options [Aws::ManagedBlockchainQuery::EndpointProvider] :endpoint_provider
338
+ # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::ManagedBlockchainQuery::EndpointParameters`
339
+ #
340
+ # @option options [URI::HTTP,String] :http_proxy A proxy to send
341
+ # requests through. Formatted like 'http://proxy.com:123'.
342
+ #
343
+ # @option options [Float] :http_open_timeout (15) The number of
344
+ # seconds to wait when opening a HTTP session before raising a
345
+ # `Timeout::Error`.
346
+ #
347
+ # @option options [Float] :http_read_timeout (60) The default
348
+ # number of seconds to wait for response data. This value can
349
+ # safely be set per-request on the session.
350
+ #
351
+ # @option options [Float] :http_idle_timeout (5) The number of
352
+ # seconds a connection is allowed to sit idle before it is
353
+ # considered stale. Stale connections are closed and removed
354
+ # from the pool before making a request.
355
+ #
356
+ # @option options [Float] :http_continue_timeout (1) The number of
357
+ # seconds to wait for a 100-continue response before sending the
358
+ # request body. This option has no effect unless the request has
359
+ # "Expect" header set to "100-continue". Defaults to `nil` which
360
+ # disables this behaviour. This value can safely be set per
361
+ # request on the session.
362
+ #
363
+ # @option options [Float] :ssl_timeout (nil) Sets the SSL timeout
364
+ # in seconds.
365
+ #
366
+ # @option options [Boolean] :http_wire_trace (false) When `true`,
367
+ # HTTP debug output will be sent to the `:logger`.
368
+ #
369
+ # @option options [Boolean] :ssl_verify_peer (true) When `true`,
370
+ # SSL peer certificates are verified when establishing a
371
+ # connection.
372
+ #
373
+ # @option options [String] :ssl_ca_bundle Full path to the SSL
374
+ # certificate authority bundle file that should be used when
375
+ # verifying peer certificates. If you do not pass
376
+ # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
377
+ # will be used if available.
378
+ #
379
+ # @option options [String] :ssl_ca_directory Full path of the
380
+ # directory that contains the unbundled SSL certificate
381
+ # authority files for verifying peer certificates. If you do
382
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
383
+ # system default will be used if available.
384
+ #
385
+ def initialize(*args)
386
+ super
387
+ end
388
+
389
+ # @!group API Operations
390
+
391
+ # Gets the token balance for a batch of tokens by using the
392
+ # `GetTokenBalance` action for every token in the request.
393
+ #
394
+ # <note markdown="1"> Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155
395
+ # token standards are supported.
396
+ #
397
+ # </note>
398
+ #
399
+ # @option params [Array<Types::BatchGetTokenBalanceInputItem>] :get_token_balance_inputs
400
+ # An array of `GetTokenBalanceInput` objects whose balance is being
401
+ # requested.
402
+ #
403
+ # @return [Types::BatchGetTokenBalanceOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
404
+ #
405
+ # * {Types::BatchGetTokenBalanceOutput#token_balances #token_balances} => Array&lt;Types::BatchGetTokenBalanceOutputItem&gt;
406
+ # * {Types::BatchGetTokenBalanceOutput#errors #errors} => Array&lt;Types::BatchGetTokenBalanceErrorItem&gt;
407
+ #
408
+ # @example Request syntax with placeholder values
409
+ #
410
+ # resp = client.batch_get_token_balance({
411
+ # get_token_balance_inputs: [
412
+ # {
413
+ # token_identifier: { # required
414
+ # network: "ETHEREUM_MAINNET", # required, accepts ETHEREUM_MAINNET, BITCOIN_MAINNET
415
+ # contract_address: "ChainAddress",
416
+ # token_id: "QueryTokenId",
417
+ # },
418
+ # owner_identifier: { # required
419
+ # address: "ChainAddress", # required
420
+ # },
421
+ # at_blockchain_instant: {
422
+ # time: Time.now,
423
+ # },
424
+ # },
425
+ # ],
426
+ # })
427
+ #
428
+ # @example Response structure
429
+ #
430
+ # resp.token_balances #=> Array
431
+ # resp.token_balances[0].owner_identifier.address #=> String
432
+ # resp.token_balances[0].token_identifier.network #=> String, one of "ETHEREUM_MAINNET", "BITCOIN_MAINNET"
433
+ # resp.token_balances[0].token_identifier.contract_address #=> String
434
+ # resp.token_balances[0].token_identifier.token_id #=> String
435
+ # resp.token_balances[0].balance #=> String
436
+ # resp.token_balances[0].at_blockchain_instant.time #=> Time
437
+ # resp.token_balances[0].last_updated_time.time #=> Time
438
+ # resp.errors #=> Array
439
+ # resp.errors[0].token_identifier.network #=> String, one of "ETHEREUM_MAINNET", "BITCOIN_MAINNET"
440
+ # resp.errors[0].token_identifier.contract_address #=> String
441
+ # resp.errors[0].token_identifier.token_id #=> String
442
+ # resp.errors[0].owner_identifier.address #=> String
443
+ # resp.errors[0].at_blockchain_instant.time #=> Time
444
+ # resp.errors[0].error_code #=> String
445
+ # resp.errors[0].error_message #=> String
446
+ # resp.errors[0].error_type #=> String, one of "VALIDATION_EXCEPTION", "RESOURCE_NOT_FOUND_EXCEPTION"
447
+ #
448
+ # @see http://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/BatchGetTokenBalance AWS API Documentation
449
+ #
450
+ # @overload batch_get_token_balance(params = {})
451
+ # @param [Hash] params ({})
452
+ def batch_get_token_balance(params = {}, options = {})
453
+ req = build_request(:batch_get_token_balance, params)
454
+ req.send_request(options)
455
+ end
456
+
457
+ # Gets the balance of a specific token, including native tokens, for a
458
+ # given address (wallet or contract) on the blockchain.
459
+ #
460
+ # <note markdown="1"> Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155
461
+ # token standards are supported.
462
+ #
463
+ # </note>
464
+ #
465
+ # @option params [required, Types::TokenIdentifier] :token_identifier
466
+ # The container for the identifier for the token, including the unique
467
+ # token ID and its blockchain network.
468
+ #
469
+ # @option params [required, Types::OwnerIdentifier] :owner_identifier
470
+ # The container for the identifier for the owner.
471
+ #
472
+ # @option params [Types::BlockchainInstant] :at_blockchain_instant
473
+ # The time for when the TokenBalance is requested or the current time if
474
+ # a time is not provided in the request.
475
+ #
476
+ # <note markdown="1"> This time will only be recorded up to the second.
477
+ #
478
+ # </note>
479
+ #
480
+ # @return [Types::GetTokenBalanceOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
481
+ #
482
+ # * {Types::GetTokenBalanceOutput#owner_identifier #owner_identifier} => Types::OwnerIdentifier
483
+ # * {Types::GetTokenBalanceOutput#token_identifier #token_identifier} => Types::TokenIdentifier
484
+ # * {Types::GetTokenBalanceOutput#balance #balance} => String
485
+ # * {Types::GetTokenBalanceOutput#at_blockchain_instant #at_blockchain_instant} => Types::BlockchainInstant
486
+ # * {Types::GetTokenBalanceOutput#last_updated_time #last_updated_time} => Types::BlockchainInstant
487
+ #
488
+ # @example Request syntax with placeholder values
489
+ #
490
+ # resp = client.get_token_balance({
491
+ # token_identifier: { # required
492
+ # network: "ETHEREUM_MAINNET", # required, accepts ETHEREUM_MAINNET, BITCOIN_MAINNET
493
+ # contract_address: "ChainAddress",
494
+ # token_id: "QueryTokenId",
495
+ # },
496
+ # owner_identifier: { # required
497
+ # address: "ChainAddress", # required
498
+ # },
499
+ # at_blockchain_instant: {
500
+ # time: Time.now,
501
+ # },
502
+ # })
503
+ #
504
+ # @example Response structure
505
+ #
506
+ # resp.owner_identifier.address #=> String
507
+ # resp.token_identifier.network #=> String, one of "ETHEREUM_MAINNET", "BITCOIN_MAINNET"
508
+ # resp.token_identifier.contract_address #=> String
509
+ # resp.token_identifier.token_id #=> String
510
+ # resp.balance #=> String
511
+ # resp.at_blockchain_instant.time #=> Time
512
+ # resp.last_updated_time.time #=> Time
513
+ #
514
+ # @see http://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/GetTokenBalance AWS API Documentation
515
+ #
516
+ # @overload get_token_balance(params = {})
517
+ # @param [Hash] params ({})
518
+ def get_token_balance(params = {}, options = {})
519
+ req = build_request(:get_token_balance, params)
520
+ req.send_request(options)
521
+ end
522
+
523
+ # Get the details of a transaction.
524
+ #
525
+ # @option params [required, String] :transaction_hash
526
+ # The hash of the transaction. It is generated whenever a transaction is
527
+ # verified and added to the blockchain.
528
+ #
529
+ # @option params [required, String] :network
530
+ # The blockchain network where the transaction occurred.
531
+ #
532
+ # @return [Types::GetTransactionOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
533
+ #
534
+ # * {Types::GetTransactionOutput#transaction #transaction} => Types::Transaction
535
+ #
536
+ # @example Request syntax with placeholder values
537
+ #
538
+ # resp = client.get_transaction({
539
+ # transaction_hash: "QueryTransactionHash", # required
540
+ # network: "ETHEREUM_MAINNET", # required, accepts ETHEREUM_MAINNET, BITCOIN_MAINNET
541
+ # })
542
+ #
543
+ # @example Response structure
544
+ #
545
+ # resp.transaction.network #=> String, one of "ETHEREUM_MAINNET", "BITCOIN_MAINNET"
546
+ # resp.transaction.block_hash #=> String
547
+ # resp.transaction.transaction_hash #=> String
548
+ # resp.transaction.block_number #=> String
549
+ # resp.transaction.transaction_timestamp #=> Time
550
+ # resp.transaction.transaction_index #=> Integer
551
+ # resp.transaction.number_of_transactions #=> Integer
552
+ # resp.transaction.status #=> String, one of "FINAL", "FAILED"
553
+ # resp.transaction.to #=> String
554
+ # resp.transaction.from #=> String
555
+ # resp.transaction.contract_address #=> String
556
+ # resp.transaction.gas_used #=> String
557
+ # resp.transaction.cumulative_gas_used #=> String
558
+ # resp.transaction.effective_gas_price #=> String
559
+ # resp.transaction.signature_v #=> Integer
560
+ # resp.transaction.signature_r #=> String
561
+ # resp.transaction.signature_s #=> String
562
+ # resp.transaction.transaction_fee #=> String
563
+ # resp.transaction.transaction_id #=> String
564
+ #
565
+ # @see http://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/GetTransaction AWS API Documentation
566
+ #
567
+ # @overload get_transaction(params = {})
568
+ # @param [Hash] params ({})
569
+ def get_transaction(params = {}, options = {})
570
+ req = build_request(:get_transaction, params)
571
+ req.send_request(options)
572
+ end
573
+
574
+ # This action returns the following for a given a blockchain network:
575
+ #
576
+ # * Lists all token balances owned by an address (either a contact
577
+ # address or a wallet address).
578
+ #
579
+ # * Lists all token balances for all tokens created by a contract.
580
+ #
581
+ # * Lists all token balances for a given token.
582
+ #
583
+ # <note markdown="1"> You must always specify the network property of the `tokenFilter` when
584
+ # using this operation.
585
+ #
586
+ # </note>
587
+ #
588
+ # @option params [Types::OwnerFilter] :owner_filter
589
+ # The contract or wallet address on the blockchain network by which to
590
+ # filter the request. You must specify the `address` property of the
591
+ # `ownerFilter` when listing balances of tokens owned by the address.
592
+ #
593
+ # @option params [required, Types::TokenFilter] :token_filter
594
+ # The contract address or a token identifier on the blockchain network
595
+ # by which to filter the request. You must specify the contractAddress
596
+ # property of this container when listing tokens minted by a contract.
597
+ #
598
+ # <note markdown="1"> You must always specify the network property of this container when
599
+ # using this operation.
600
+ #
601
+ # </note>
602
+ #
603
+ # @option params [String] :next_token
604
+ # The pagination token that indicates the next set of results to
605
+ # retrieve.
606
+ #
607
+ # @option params [Integer] :max_results
608
+ # The maximum number of token balances to return.
609
+ #
610
+ # @return [Types::ListTokenBalancesOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
611
+ #
612
+ # * {Types::ListTokenBalancesOutput#token_balances #token_balances} => Array&lt;Types::TokenBalance&gt;
613
+ # * {Types::ListTokenBalancesOutput#next_token #next_token} => String
614
+ #
615
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
616
+ #
617
+ # @example Request syntax with placeholder values
618
+ #
619
+ # resp = client.list_token_balances({
620
+ # owner_filter: {
621
+ # address: "ChainAddress", # required
622
+ # },
623
+ # token_filter: { # required
624
+ # network: "ETHEREUM_MAINNET", # required, accepts ETHEREUM_MAINNET, BITCOIN_MAINNET
625
+ # contract_address: "ChainAddress",
626
+ # token_id: "QueryTokenId",
627
+ # },
628
+ # next_token: "NextToken",
629
+ # max_results: 1,
630
+ # })
631
+ #
632
+ # @example Response structure
633
+ #
634
+ # resp.token_balances #=> Array
635
+ # resp.token_balances[0].owner_identifier.address #=> String
636
+ # resp.token_balances[0].token_identifier.network #=> String, one of "ETHEREUM_MAINNET", "BITCOIN_MAINNET"
637
+ # resp.token_balances[0].token_identifier.contract_address #=> String
638
+ # resp.token_balances[0].token_identifier.token_id #=> String
639
+ # resp.token_balances[0].balance #=> String
640
+ # resp.token_balances[0].at_blockchain_instant.time #=> Time
641
+ # resp.token_balances[0].last_updated_time.time #=> Time
642
+ # resp.next_token #=> String
643
+ #
644
+ # @see http://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTokenBalances AWS API Documentation
645
+ #
646
+ # @overload list_token_balances(params = {})
647
+ # @param [Hash] params ({})
648
+ def list_token_balances(params = {}, options = {})
649
+ req = build_request(:list_token_balances, params)
650
+ req.send_request(options)
651
+ end
652
+
653
+ # An array of `TransactionEvent` objects. Each object contains details
654
+ # about the transaction event.
655
+ #
656
+ # @option params [required, String] :transaction_hash
657
+ # The hash of the transaction. It is generated whenever a transaction is
658
+ # verified and added to the blockchain.
659
+ #
660
+ # @option params [required, String] :network
661
+ # The blockchain network where the transaction events occurred.
662
+ #
663
+ # @option params [String] :next_token
664
+ # The pagination token that indicates the next set of results to
665
+ # retrieve.
666
+ #
667
+ # @option params [Integer] :max_results
668
+ # The maximum number of transaction events to list.
669
+ #
670
+ # <note markdown="1"> Even if additional results can be retrieved, the request can return
671
+ # less results than `maxResults` or an empty array of results.
672
+ #
673
+ # To retrieve the next set of results, make another request with the
674
+ # returned `nextToken` value. The value of `nextToken` is `null` when
675
+ # there are no more results to return
676
+ #
677
+ # </note>
678
+ #
679
+ # @return [Types::ListTransactionEventsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
680
+ #
681
+ # * {Types::ListTransactionEventsOutput#events #events} => Array&lt;Types::TransactionEvent&gt;
682
+ # * {Types::ListTransactionEventsOutput#next_token #next_token} => String
683
+ #
684
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
685
+ #
686
+ # @example Request syntax with placeholder values
687
+ #
688
+ # resp = client.list_transaction_events({
689
+ # transaction_hash: "QueryTransactionHash", # required
690
+ # network: "ETHEREUM_MAINNET", # required, accepts ETHEREUM_MAINNET, BITCOIN_MAINNET
691
+ # next_token: "NextToken",
692
+ # max_results: 1,
693
+ # })
694
+ #
695
+ # @example Response structure
696
+ #
697
+ # resp.events #=> Array
698
+ # resp.events[0].network #=> String, one of "ETHEREUM_MAINNET", "BITCOIN_MAINNET"
699
+ # resp.events[0].transaction_hash #=> String
700
+ # resp.events[0].event_type #=> String, one of "ERC20_TRANSFER", "ERC20_MINT", "ERC20_BURN", "ERC20_DEPOSIT", "ERC20_WITHDRAWAL", "ERC721_TRANSFER", "ERC1155_TRANSFER", "BITCOIN_VIN", "BITCOIN_VOUT", "INTERNAL_ETH_TRANSFER", "ETH_TRANSFER"
701
+ # resp.events[0].from #=> String
702
+ # resp.events[0].to #=> String
703
+ # resp.events[0].value #=> String
704
+ # resp.events[0].contract_address #=> String
705
+ # resp.events[0].token_id #=> String
706
+ # resp.events[0].transaction_id #=> String
707
+ # resp.events[0].vout_index #=> Integer
708
+ # resp.next_token #=> String
709
+ #
710
+ # @see http://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTransactionEvents AWS API Documentation
711
+ #
712
+ # @overload list_transaction_events(params = {})
713
+ # @param [Hash] params ({})
714
+ def list_transaction_events(params = {}, options = {})
715
+ req = build_request(:list_transaction_events, params)
716
+ req.send_request(options)
717
+ end
718
+
719
+ # Lists all of the transactions on a given wallet address or to a
720
+ # specific contract.
721
+ #
722
+ # @option params [required, String] :address
723
+ # The address (either a contract or wallet), whose transactions are
724
+ # being requested.
725
+ #
726
+ # @option params [required, String] :network
727
+ # The blockchain network where the transactions occurred.
728
+ #
729
+ # @option params [Types::BlockchainInstant] :from_blockchain_instant
730
+ # The container for time.
731
+ #
732
+ # @option params [Types::BlockchainInstant] :to_blockchain_instant
733
+ # The container for time.
734
+ #
735
+ # @option params [Types::ListTransactionsSort] :sort
736
+ # Sorts items in an ascending order if the first page starts at
737
+ # `fromTime`. Sorts items in a descending order if the first page starts
738
+ # at `toTime`.
739
+ #
740
+ # @option params [String] :next_token
741
+ # The pagination token that indicates the next set of results to
742
+ # retrieve.
743
+ #
744
+ # @option params [Integer] :max_results
745
+ # The maximum number of transactions to list.
746
+ #
747
+ # <note markdown="1"> Even if additional results can be retrieved, the request can return
748
+ # less results than `maxResults` or an empty array of results.
749
+ #
750
+ # To retrieve the next set of results, make another request with the
751
+ # returned `nextToken` value. The value of `nextToken` is `null` when
752
+ # there are no more results to return
753
+ #
754
+ # </note>
755
+ #
756
+ # @return [Types::ListTransactionsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
757
+ #
758
+ # * {Types::ListTransactionsOutput#transactions #transactions} => Array&lt;Types::TransactionOutputItem&gt;
759
+ # * {Types::ListTransactionsOutput#next_token #next_token} => String
760
+ #
761
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
762
+ #
763
+ # @example Request syntax with placeholder values
764
+ #
765
+ # resp = client.list_transactions({
766
+ # address: "ChainAddress", # required
767
+ # network: "ETHEREUM_MAINNET", # required, accepts ETHEREUM_MAINNET, BITCOIN_MAINNET
768
+ # from_blockchain_instant: {
769
+ # time: Time.now,
770
+ # },
771
+ # to_blockchain_instant: {
772
+ # time: Time.now,
773
+ # },
774
+ # sort: {
775
+ # sort_by: "TRANSACTION_TIMESTAMP", # accepts TRANSACTION_TIMESTAMP
776
+ # sort_order: "ASCENDING", # accepts ASCENDING, DESCENDING
777
+ # },
778
+ # next_token: "NextToken",
779
+ # max_results: 1,
780
+ # })
781
+ #
782
+ # @example Response structure
783
+ #
784
+ # resp.transactions #=> Array
785
+ # resp.transactions[0].transaction_hash #=> String
786
+ # resp.transactions[0].network #=> String, one of "ETHEREUM_MAINNET", "BITCOIN_MAINNET"
787
+ # resp.transactions[0].transaction_timestamp #=> Time
788
+ # resp.next_token #=> String
789
+ #
790
+ # @see http://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTransactions AWS API Documentation
791
+ #
792
+ # @overload list_transactions(params = {})
793
+ # @param [Hash] params ({})
794
+ def list_transactions(params = {}, options = {})
795
+ req = build_request(:list_transactions, params)
796
+ req.send_request(options)
797
+ end
798
+
799
+ # @!endgroup
800
+
801
+ # @param params ({})
802
+ # @api private
803
+ def build_request(operation_name, params = {})
804
+ handlers = @handlers.for(operation_name)
805
+ context = Seahorse::Client::RequestContext.new(
806
+ operation_name: operation_name,
807
+ operation: config.api.operation(operation_name),
808
+ client: self,
809
+ params: params,
810
+ config: config)
811
+ context[:gem_name] = 'aws-sdk-managedblockchainquery'
812
+ context[:gem_version] = '1.0.0'
813
+ Seahorse::Client::Request.new(handlers, context)
814
+ end
815
+
816
+ # @api private
817
+ # @deprecated
818
+ def waiter_names
819
+ []
820
+ end
821
+
822
+ class << self
823
+
824
+ # @api private
825
+ attr_reader :identifier
826
+
827
+ # @api private
828
+ def errors_module
829
+ Errors
830
+ end
831
+
832
+ end
833
+ end
834
+ end