Class: Privy::Models::Wallets::SwapActionResponse

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

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:, destination_address: nil, destination_caip2: nil, estimated_fees: nil, estimated_gas: nil, failure_reason: nil, fees: nil, gas: nil, steps: nil) ⇒ Object

Some parameter documentations has been truncated, see Privy::Models::Wallets::SwapActionResponse for more details.

Response for a swap action.

Parameters:



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

Instance Attribute Details

#caip2String

CAIP-2 chain identifier for the swap.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :caip2, String

#created_atTime

ISO 8601 timestamp of when the wallet action was created.

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :created_at, Time

#destination_addressString?

Recipient address on the destination chain. Present for cross-chain swaps. May differ from the source wallet address when swapping between chain types (e.g. EVM to Solana).

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :destination_address, String

#destination_caip2String?

Destination chain CAIP-2 identifier. Present for cross-chain swaps.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :destination_caip2, String

#estimated_feesArray<Privy::Models::RelayerFee, Privy::Models::PrivyFee, Privy::Models::DeveloperFee>?

Estimated fee breakdown from the provider quote. Only present for cross-chain swaps. Populated after on-chain confirmation.

Parameters:

  • value (::Array[Privy::Models::fee_line_item], nil)

Returns:



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

optional :estimated_fees, -> { Privy::Internal::Type::ArrayOf[union: Privy::FeeLineItem] }, nil?: true

#estimated_gasPrivy::Models::Gas?

Gas cost for a blockchain action. Includes both raw base-unit amount and a human-readable decimal string, plus the gas token symbol.

Parameters:

Returns:



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

optional :estimated_gas, -> { Privy::Gas }, nil?: true

#failure_reasonPrivy::Models::Wallets::FailureReason?

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



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

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

#feesArray<Privy::Models::RelayerFee, Privy::Models::PrivyFee, Privy::Models::DeveloperFee>?

Actual fees paid for the swap. Populated after on-chain confirmation. Only present for cross-chain swaps.

Parameters:

  • value (::Array[Privy::Models::fee_line_item], nil)

Returns:



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

optional :fees, -> { Privy::Internal::Type::ArrayOf[union: Privy::FeeLineItem] }, nil?: true

#gasPrivy::Models::Gas?

Gas cost for a blockchain action. Includes both raw base-unit amount and a human-readable decimal string, plus the gas token symbol.

Parameters:

Returns:



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

optional :gas, -> { Privy::Gas }, nil?: true

#idString

The ID of the wallet action.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#input_amountString?

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

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :input_amount, String, nil?: true

#input_tokenString

Token address or "native" for the token being sold.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :input_token, String

#output_amountString?

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

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :output_amount, String, nil?: true

#output_tokenString

Token address or "native" for the token being bought.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :output_token, String

#statusSymbol, Privy::Models::Wallets::WalletActionStatus

Status of a wallet action.

Parameters:

  • value (Privy::Models::Wallets::wallet_action_status)

Returns:



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

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

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

Parameters:

  • value (Privy::Models::Wallets::SwapActionResponse::type_)

Returns:



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

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

#wallet_idString

The ID of the wallet involved in the action.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :wallet_id, String

Instance Method Details

#to_hash{

Returns:

  • ({)


96
# File 'sig/privy/models/wallets/swap_action_response.rbs', line 96

def to_hash: -> {