Class: Privy::Resources::Wallets::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/privy/resources/wallets/actions.rb,
sig/privy/resources/wallets/actions.rbs

Overview

Operations related to wallet actions

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Actions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Actions.

Parameters:



52
53
54
# File 'lib/privy/resources/wallets/actions.rb', line 52

def initialize(client:)
  @client = client
end

Instance Method Details

#get(action_id, wallet_id:, include: nil, privy_authorization_signature: nil, request_options: {}) ⇒ Privy::Models::Wallets::SwapActionResponse, ...

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

Get the current status of a wallet action by its ID. Use ?include=steps to include step-level details.

Parameters:

  • action_id (String)

    Path param: ID of the wallet action.

  • wallet_id (String)

    Path param: ID of the wallet.

  • include (Symbol, Privy::Models::Wallets::WalletActionInclude)

    Query param: Expandable relations to include on a wallet action response.

  • privy_authorization_signature (String)

    Header param: Request authorization signature. If multiple signatures are requir

  • request_options (Privy::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/privy/resources/wallets/actions.rb', line 29

def get(action_id, params)
  query_params = [:include]
  parsed, options = Privy::Wallets::ActionGetParams.dump_request(params)
  query = Privy::Internal::Util.encode_query_params(parsed.slice(*query_params))
  wallet_id =
    parsed.delete(:wallet_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/wallets/%1$s/actions/%2$s", wallet_id, action_id],
    query: query,
    headers: parsed.except(*query_params).transform_keys(
      privy_authorization_signature: "privy-authorization-signature"
    ),
    model: Privy::Wallets::WalletActionResponse,
    options: options
  )
end