Class: Privy::Resources::Apps

Inherits:
Object
  • Object
show all
Defined in:
lib/privy/resources/apps.rb,
lib/privy/resources/apps/allowlist.rb

Overview

Operations related to app settings and allowlist management

Defined Under Namespace

Classes: Allowlist

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Apps

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 Apps.

Parameters:



79
80
81
82
# File 'lib/privy/resources/apps.rb', line 79

def initialize(client:)
  @client = client
  @allowlist = Privy::Resources::Apps::Allowlist.new(client: client)
end

Instance Attribute Details

#allowlistPrivy::Resources::Apps::Allowlist (readonly)

Operations related to app settings and allowlist management



9
10
11
# File 'lib/privy/resources/apps.rb', line 9

def allowlist
  @allowlist
end

Instance Method Details

#get(app_id, request_options: {}) ⇒ Privy::Models::AppResponse

Get the settings and configuration for an app.

Parameters:

  • app_id (String)

    The ID of the app.

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

Returns:

See Also:



22
23
24
25
26
27
28
29
# File 'lib/privy/resources/apps.rb', line 22

def get(app_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/apps/%1$s", app_id],
    model: Privy::AppResponse,
    options: params[:request_options]
  )
end

#get_gas_spend(end_timestamp:, start_timestamp:, wallet_ids:, request_options: {}) ⇒ Privy::Models::GasSpendResponseBody

Get aggregated Privy gas credits charged for a set of wallets over a time range. Maximum 100 wallet IDs and 30-day range per request.

Parameters:

  • end_timestamp (Float)
  • start_timestamp (Float)
  • wallet_ids (Array<String>)
  • request_options (Privy::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/privy/resources/apps.rb', line 44

def get_gas_spend(params)
  parsed, options = Privy::AppGetGasSpendParams.dump_request(params)
  query = Privy::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/apps/gas_spend",
    query: query,
    model: Privy::GasSpendResponseBody,
    options: options
  )
end

#get_test_credentials(app_id, request_options: {}) ⇒ Privy::Models::TestAccountsResponse

Get the test accounts and credentials for an app.

Parameters:

  • app_id (String)

    The ID of the app.

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

Returns:

See Also:



67
68
69
70
71
72
73
74
# File 'lib/privy/resources/apps.rb', line 67

def get_test_credentials(app_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/apps/%1$s/test_credentials", app_id],
    model: Privy::TestAccountsResponse,
    options: params[:request_options]
  )
end