Class: Privy::Models::SwapActionResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/privy/models/swap_action_response.rb

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, caip2:, created_at:, input_amount:, input_token:, output_amount:, output_token:, status:, type:, wallet_id:, failure_reason: nil, steps: nil) ⇒ Object

Response for a swap action.

Parameters:



# File 'lib/privy/models/swap_action_response.rb', line 77

Instance Attribute Details

#caip2String

CAIP-2 chain identifier for the swap.

Returns:

  • (String)


16
# File 'lib/privy/models/swap_action_response.rb', line 16

required :caip2, String

#created_atTime

ISO 8601 timestamp of when the wallet action was created.

Returns:

  • (Time)


22
# File 'lib/privy/models/swap_action_response.rb', line 22

required :created_at, Time

#failure_reasonPrivy::Models::FailureReason?

A description of why a wallet action (or a step within a wallet action) failed.



69
# File 'lib/privy/models/swap_action_response.rb', line 69

optional :failure_reason, -> { Privy::FailureReason }

#idString

The ID of the wallet action.

Returns:

  • (String)


10
# File 'lib/privy/models/swap_action_response.rb', line 10

required :id, String

#input_amountString?

Exact base-unit amount of input token. Populated after on-chain confirmation.

Returns:

  • (String, nil)


28
# File 'lib/privy/models/swap_action_response.rb', line 28

required :input_amount, String, nil?: true

#input_tokenString

Token address or “native” for the token being sold.

Returns:

  • (String)


34
# File 'lib/privy/models/swap_action_response.rb', line 34

required :input_token, String

#output_amountString?

Exact base-unit amount of output token. Populated after on-chain confirmation.

Returns:

  • (String, nil)


40
# File 'lib/privy/models/swap_action_response.rb', line 40

required :output_amount, String, nil?: true

#output_tokenString

Token address or “native” for the token being bought.

Returns:

  • (String)


46
# File 'lib/privy/models/swap_action_response.rb', line 46

required :output_token, String

#statusSymbol, Privy::Models::WalletActionStatus

Status of a wallet action.



52
# File 'lib/privy/models/swap_action_response.rb', line 52

required :status, enum: -> { Privy::WalletActionStatus }

#typeSymbol, Privy::Models::SwapActionResponse::Type



57
# File 'lib/privy/models/swap_action_response.rb', line 57

required :type, enum: -> { Privy::SwapActionResponse::Type }

#wallet_idString

The ID of the wallet involved in the action.

Returns:

  • (String)


63
# File 'lib/privy/models/swap_action_response.rb', line 63

required :wallet_id, String