Class: Privy::Resources::Wallets::Earn::Ethereum::Incentive

Inherits:
Object
  • Object
show all
Defined in:
lib/privy/resources/wallets/earn/ethereum/incentive.rb

Overview

Operations related to wallet actions

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Incentive

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

Parameters:



53
54
55
# File 'lib/privy/resources/wallets/earn/ethereum/incentive.rb', line 53

def initialize(client:)
  @client = client
end

Instance Method Details

#_claim(wallet_id, chain:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) ⇒ Privy::Models::EarnIncentiveClaimActionResponse

Some parameter documentations has been truncated, see Models::Wallets::Earn::Ethereum::IncentiveClaimParams for more details.

Claim incentive rewards for a wallet.

Parameters:

  • wallet_id (String)

    Path param: ID of the wallet.

  • chain (String)

    Body param: The blockchain network on which to perform the incentive claim. Supp

  • privy_authorization_signature (String)

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

  • privy_idempotency_key (String)

    Header param: Idempotency keys ensure API requests are executed only once within

  • privy_request_expiry (String)

    Header param: Request expiry. Value is a Unix timestamp in milliseconds represen

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

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/privy/resources/wallets/earn/ethereum/incentive.rb', line 32

def _claim(wallet_id, params)
  parsed, options = Privy::Wallets::Earn::Ethereum::IncentiveClaimParams.dump_request(params)
  header_params =
    {
      privy_authorization_signature: "privy-authorization-signature",
      privy_idempotency_key: "privy-idempotency-key",
      privy_request_expiry: "privy-request-expiry"
    }
  @client.request(
    method: :post,
    path: ["v1/wallets/%1$s/earn/ethereum/incentive/claim", wallet_id],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Privy::EarnIncentiveClaimActionResponse,
    options: options
  )
end