Class: Privy::Resources::Wallets::Earn::Ethereum
- Inherits:
-
Object
- Object
- Privy::Resources::Wallets::Earn::Ethereum
- Defined in:
- lib/privy/resources/wallets/earn/ethereum.rb,
lib/privy/resources/wallets/earn/ethereum/incentive.rb
Overview
Operations related to wallet actions
Defined Under Namespace
Classes: Incentive
Instance Attribute Summary collapse
-
#incentive ⇒ Privy::Resources::Wallets::Earn::Ethereum::Incentive
readonly
Operations related to wallet actions.
Instance Method Summary collapse
-
#_deposit(wallet_id, vault_id:, amount: nil, raw_amount: nil, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) ⇒ Privy::Models::EarnDepositActionResponse
Some parameter documentations has been truncated, see Models::Wallets::Earn::EthereumDepositParams for more details.
-
#_withdraw(wallet_id, vault_id:, amount: nil, raw_amount: nil, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) ⇒ Privy::Models::EarnWithdrawActionResponse
Some parameter documentations has been truncated, see Models::Wallets::Earn::EthereumWithdrawParams for more details.
-
#initialize(client:) ⇒ Ethereum
constructor
private
A new instance of Ethereum.
Constructor Details
#initialize(client:) ⇒ Ethereum
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 Ethereum.
104 105 106 107 |
# File 'lib/privy/resources/wallets/earn/ethereum.rb', line 104 def initialize(client:) @client = client @incentive = Privy::Resources::Wallets::Earn::Ethereum::Incentive.new(client: client) end |
Instance Attribute Details
#incentive ⇒ Privy::Resources::Wallets::Earn::Ethereum::Incentive (readonly)
Operations related to wallet actions
11 12 13 |
# File 'lib/privy/resources/wallets/earn/ethereum.rb', line 11 def incentive @incentive end |
Instance Method Details
#_deposit(wallet_id, vault_id:, amount: nil, raw_amount: nil, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) ⇒ Privy::Models::EarnDepositActionResponse
Some parameter documentations has been truncated, see Models::Wallets::Earn::EthereumDepositParams for more details.
Deposit assets into an ERC-4626 vault.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/privy/resources/wallets/earn/ethereum.rb', line 39 def _deposit(wallet_id, params) parsed, = Privy::Wallets::Earn::EthereumDepositParams.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/deposit", wallet_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Privy::EarnDepositActionResponse, options: ) end |
#_withdraw(wallet_id, vault_id:, amount: nil, raw_amount: nil, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) ⇒ Privy::Models::EarnWithdrawActionResponse
Some parameter documentations has been truncated, see Models::Wallets::Earn::EthereumWithdrawParams for more details.
Withdraw assets from an ERC-4626 vault.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/privy/resources/wallets/earn/ethereum.rb', line 83 def _withdraw(wallet_id, params) parsed, = Privy::Wallets::Earn::EthereumWithdrawParams.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/withdraw", wallet_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Privy::EarnWithdrawActionResponse, options: ) end |