privy_ruby 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +1 -1
- data/lib/privy/base58.rb +41 -0
- data/lib/privy/client.rb +8 -0
- data/lib/privy/cryptography.rb +34 -0
- data/lib/privy/models/create_link_auth_intent_input.rb +17 -0
- data/lib/privy/models/create_link_auth_intent_response.rb +36 -0
- data/lib/privy/models/create_stripe_onramp_session_input.rb +33 -0
- data/lib/privy/models/create_stripe_onramp_session_response.rb +23 -0
- data/lib/privy/models/device_authorization_response.rb +63 -0
- data/lib/privy/models/earn_incentive_reward_entry.rb +50 -0
- data/lib/privy/models/earn_incentive_rewards_query.rb +18 -0
- data/lib/privy/models/earn_incentive_rewards_response.rb +19 -0
- data/lib/privy/models/exchange_stripe_tokens_input.rb +23 -0
- data/lib/privy/models/exchange_stripe_tokens_response.rb +17 -0
- data/lib/privy/models/fiat_onramp_provider.rb +2 -0
- data/lib/privy/models/fiat_onramp_stripe_sdk_session_response.rb +45 -0
- data/lib/privy/models/fiat_onramp_url_session_response.rb +39 -0
- data/lib/privy/models/get_fiat_onramp_url_response.rb +12 -14
- data/lib/privy/models/get_stripe_crypto_customer_response.rb +39 -0
- data/lib/privy/models/kraken_embed_custom_order_cancelled_webhook_payload.rb +66 -0
- data/lib/privy/models/kraken_embed_custom_order_executed_webhook_payload.rb +54 -0
- data/lib/privy/models/kraken_embed_custom_order_execution_failed_webhook_payload.rb +67 -0
- data/lib/privy/models/link_auth_intent_created.rb +35 -0
- data/lib/privy/models/link_auth_intent_no_account.rb +27 -0
- data/lib/privy/models/list_stripe_consumer_wallets_response.rb +17 -0
- data/lib/privy/models/list_stripe_payment_tokens_response.rb +17 -0
- data/lib/privy/models/onramp_session_params.rb +61 -0
- data/lib/privy/models/refresh_stripe_quote_response.rb +18 -0
- data/lib/privy/models/rule_delete_intent_response.rb +63 -0
- data/lib/privy/models/rule_intent_response.rb +0 -1
- data/lib/privy/models/rule_mutate_intent_response.rb +64 -0
- data/lib/privy/models/stripe_consumer_wallet.rb +29 -0
- data/lib/privy/models/stripe_crypto_customer_active.rb +39 -0
- data/lib/privy/models/stripe_crypto_customer_expired.rb +33 -0
- data/lib/privy/models/stripe_crypto_customer_none.rb +27 -0
- data/lib/privy/models/stripe_onramp_checkout_response.rb +25 -0
- data/lib/privy/models/stripe_onramp_session_status.rb +17 -0
- data/lib/privy/models/stripe_payment_token.rb +23 -0
- data/lib/privy/models/stripe_quote.rb +17 -0
- data/lib/privy/models/stripe_transaction_details.rb +17 -0
- data/lib/privy/models/stripe_verification.rb +23 -0
- data/lib/privy/models/swap_action_response.rb +9 -1
- data/lib/privy/models/swap_destination.rb +13 -4
- data/lib/privy/models/swap_quote_destination.rb +15 -4
- data/lib/privy/models/swap_quote_request_body.rb +9 -1
- data/lib/privy/models/swap_quote_response.rb +25 -1
- data/lib/privy/models/swap_request_body.rb +9 -1
- data/lib/privy/models/wallets/swap_execute_params.rb +45 -0
- data/lib/privy/models/wallets/swap_quote_params.rb +36 -0
- data/lib/privy/models.rb +71 -4
- data/lib/privy/public_api/privy_client.rb +2 -1
- data/lib/privy/public_api/services/earn/ethereum/incentive.rb +61 -0
- data/lib/privy/public_api/services/earn/ethereum.rb +131 -0
- data/lib/privy/public_api/services/earn.rb +18 -0
- data/lib/privy/public_api/services/key_quorums.rb +7 -1
- data/lib/privy/public_api/services/policies.rb +21 -3
- data/lib/privy/public_api/services/transactions.rb +14 -0
- data/lib/privy/public_api/services/wallets.rb +153 -1
- data/lib/privy/resources/intents.rb +6 -6
- data/lib/privy/resources/oauth.rb +14 -0
- data/lib/privy/resources/onramps.rb +14 -0
- data/lib/privy/resources/wallets/swap.rb +105 -0
- data/lib/privy/resources/wallets.rb +10 -2
- data/lib/privy/version.rb +1 -1
- data/lib/privy/wallet_entropy.rb +60 -0
- data/lib/privy.rb +47 -4
- data/rbi/privy/client.rbi +6 -0
- data/rbi/privy/models/create_link_auth_intent_input.rbi +27 -0
- data/rbi/privy/models/create_link_auth_intent_response.rbi +68 -0
- data/rbi/privy/models/create_stripe_onramp_session_input.rbi +55 -0
- data/rbi/privy/models/create_stripe_onramp_session_response.rbi +30 -0
- data/rbi/privy/models/device_authorization_response.rbi +81 -0
- data/rbi/privy/models/earn_incentive_reward_entry.rbi +73 -0
- data/rbi/privy/models/earn_incentive_rewards_query.rbi +28 -0
- data/rbi/privy/models/earn_incentive_rewards_response.rbi +35 -0
- data/rbi/privy/models/exchange_stripe_tokens_input.rbi +33 -0
- data/rbi/privy/models/exchange_stripe_tokens_response.rbi +24 -0
- data/rbi/privy/models/fiat_onramp_provider.rbi +3 -0
- data/rbi/privy/models/fiat_onramp_stripe_sdk_session_response.rbi +78 -0
- data/rbi/privy/models/fiat_onramp_url_session_response.rbi +65 -0
- data/rbi/privy/models/get_fiat_onramp_url_response.rbi +12 -15
- data/rbi/privy/models/get_stripe_crypto_customer_response.rbi +81 -0
- data/rbi/privy/models/kraken_embed_custom_order_cancelled_webhook_payload.rbi +111 -0
- data/rbi/privy/models/kraken_embed_custom_order_executed_webhook_payload.rbi +101 -0
- data/rbi/privy/models/kraken_embed_custom_order_execution_failed_webhook_payload.rbi +111 -0
- data/rbi/privy/models/link_auth_intent_created.rbi +60 -0
- data/rbi/privy/models/link_auth_intent_no_account.rbi +54 -0
- data/rbi/privy/models/list_stripe_consumer_wallets_response.rbi +31 -0
- data/rbi/privy/models/list_stripe_payment_tokens_response.rbi +31 -0
- data/rbi/privy/models/onramp_session_params.rbi +76 -0
- data/rbi/privy/models/refresh_stripe_quote_response.rbi +33 -0
- data/rbi/privy/models/rule_delete_intent_response.rbi +113 -0
- data/rbi/privy/models/rule_mutate_intent_response.rbi +113 -0
- data/rbi/privy/models/stripe_consumer_wallet.rbi +38 -0
- data/rbi/privy/models/stripe_crypto_customer_active.rbi +68 -0
- data/rbi/privy/models/stripe_crypto_customer_expired.rbi +63 -0
- data/rbi/privy/models/stripe_crypto_customer_none.rbi +53 -0
- data/rbi/privy/models/stripe_onramp_checkout_response.rbi +51 -0
- data/rbi/privy/models/stripe_onramp_session_status.rbi +26 -0
- data/rbi/privy/models/stripe_payment_token.rbi +27 -0
- data/rbi/privy/models/stripe_quote.rbi +22 -0
- data/rbi/privy/models/stripe_transaction_details.rbi +24 -0
- data/rbi/privy/models/stripe_verification.rbi +27 -0
- data/rbi/privy/models/swap_action_response.rbi +17 -27
- data/rbi/privy/models/swap_destination.rbi +26 -7
- data/rbi/privy/models/swap_quote_destination.rbi +30 -7
- data/rbi/privy/models/swap_quote_request_body.rbi +11 -0
- data/rbi/privy/models/swap_quote_response.rbi +54 -3
- data/rbi/privy/models/swap_request_body.rbi +11 -0
- data/rbi/privy/models/wallets/swap_execute_params.rbi +71 -0
- data/rbi/privy/models/wallets/swap_quote_params.rbi +58 -0
- data/rbi/privy/models.rbi +76 -5
- data/rbi/privy/resources/intents.rbi +3 -3
- data/rbi/privy/resources/oauth.rbi +12 -0
- data/rbi/privy/resources/onramps.rbi +12 -0
- data/rbi/privy/resources/wallets/swap.rbi +94 -0
- data/rbi/privy/resources/wallets.rbi +9 -2
- data/sig/privy/client.rbs +4 -0
- data/sig/privy/models/create_link_auth_intent_input.rbs +15 -0
- data/sig/privy/models/create_link_auth_intent_response.rbs +26 -0
- data/sig/privy/models/create_stripe_onramp_session_input.rbs +30 -0
- data/sig/privy/models/create_stripe_onramp_session_response.rbs +16 -0
- data/sig/privy/models/device_authorization_response.rbs +45 -0
- data/sig/privy/models/earn_incentive_reward_entry.rbs +42 -0
- data/sig/privy/models/earn_incentive_rewards_query.rbs +13 -0
- data/sig/privy/models/earn_incentive_rewards_response.rbs +16 -0
- data/sig/privy/models/exchange_stripe_tokens_input.rbs +19 -0
- data/sig/privy/models/exchange_stripe_tokens_response.rbs +13 -0
- data/sig/privy/models/fiat_onramp_provider.rbs +4 -0
- data/sig/privy/models/fiat_onramp_stripe_sdk_session_response.rbs +45 -0
- data/sig/privy/models/fiat_onramp_url_session_response.rbs +40 -0
- data/sig/privy/models/get_fiat_onramp_url_response.rbs +6 -8
- data/sig/privy/models/get_stripe_crypto_customer_response.rbs +29 -0
- data/sig/privy/models/kraken_embed_custom_order_cancelled_webhook_payload.rbs +50 -0
- data/sig/privy/models/kraken_embed_custom_order_executed_webhook_payload.rbs +45 -0
- data/sig/privy/models/kraken_embed_custom_order_execution_failed_webhook_payload.rbs +50 -0
- data/sig/privy/models/link_auth_intent_created.rbs +32 -0
- data/sig/privy/models/link_auth_intent_no_account.rbs +26 -0
- data/sig/privy/models/list_stripe_consumer_wallets_response.rbs +14 -0
- data/sig/privy/models/list_stripe_payment_tokens_response.rbs +14 -0
- data/sig/privy/models/onramp_session_params.rbs +50 -0
- data/sig/privy/models/refresh_stripe_quote_response.rbs +13 -0
- data/sig/privy/models/rule_delete_intent_response.rbs +66 -0
- data/sig/privy/models/rule_mutate_intent_response.rbs +66 -0
- data/sig/privy/models/stripe_consumer_wallet.rbs +22 -0
- data/sig/privy/models/stripe_crypto_customer_active.rbs +40 -0
- data/sig/privy/models/stripe_crypto_customer_expired.rbs +35 -0
- data/sig/privy/models/stripe_crypto_customer_none.rbs +28 -0
- data/sig/privy/models/stripe_onramp_checkout_response.rbs +29 -0
- data/sig/privy/models/stripe_onramp_session_status.rbs +15 -0
- data/sig/privy/models/stripe_payment_token.rbs +15 -0
- data/sig/privy/models/stripe_quote.rbs +13 -0
- data/sig/privy/models/stripe_transaction_details.rbs +13 -0
- data/sig/privy/models/stripe_verification.rbs +15 -0
- data/sig/privy/models/swap_action_response.rbs +7 -0
- data/sig/privy/models/swap_destination.rbs +16 -3
- data/sig/privy/models/swap_quote_destination.rbs +16 -3
- data/sig/privy/models/swap_quote_request_body.rbs +9 -0
- data/sig/privy/models/swap_quote_response.rbs +26 -3
- data/sig/privy/models/swap_request_body.rbs +9 -0
- data/sig/privy/models/wallets/swap_execute_params.rbs +44 -0
- data/sig/privy/models/wallets/swap_quote_params.rbs +34 -0
- data/sig/privy/models.rbs +69 -5
- data/sig/privy/resources/intents.rbs +3 -3
- data/sig/privy/resources/oauth.rbs +7 -0
- data/sig/privy/resources/onramps.rbs +7 -0
- data/sig/privy/resources/wallets/swap.rbs +34 -0
- data/sig/privy/resources/wallets.rbs +2 -0
- metadata +125 -8
- data/lib/privy/models/gas_sponsorship_configuration.rb +0 -29
- data/lib/privy/models/gas_sponsorship_configuration_input.rb +0 -29
- data/rbi/privy/models/gas_sponsorship_configuration.rbi +0 -48
- data/rbi/privy/models/gas_sponsorship_configuration_input.rbi +0 -60
- data/sig/privy/models/gas_sponsorship_configuration.rbs +0 -30
- data/sig/privy/models/gas_sponsorship_configuration_input.rbs +0 -36
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Privy
|
|
4
|
+
module Models
|
|
5
|
+
class StripePaymentToken < Privy::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute id
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :id, String
|
|
10
|
+
|
|
11
|
+
# @!attribute type
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :type, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(id:, type:)
|
|
17
|
+
# A saved payment token.
|
|
18
|
+
#
|
|
19
|
+
# @param id [String]
|
|
20
|
+
# @param type [String]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Privy
|
|
4
|
+
module Models
|
|
5
|
+
class StripeQuote < Privy::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute expires_at
|
|
7
|
+
#
|
|
8
|
+
# @return [Float]
|
|
9
|
+
required :expires_at, Float
|
|
10
|
+
|
|
11
|
+
# @!method initialize(expires_at:)
|
|
12
|
+
# A refreshed quote.
|
|
13
|
+
#
|
|
14
|
+
# @param expires_at [Float]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Privy
|
|
4
|
+
module Models
|
|
5
|
+
class StripeTransactionDetails < Privy::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute last_error
|
|
7
|
+
#
|
|
8
|
+
# @return [String, nil]
|
|
9
|
+
optional :last_error, String, nil?: true
|
|
10
|
+
|
|
11
|
+
# @!method initialize(last_error: nil)
|
|
12
|
+
# Transaction details from checkout.
|
|
13
|
+
#
|
|
14
|
+
# @param last_error [String, nil]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Privy
|
|
4
|
+
module Models
|
|
5
|
+
class StripeVerification < Privy::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute name
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :name, String
|
|
10
|
+
|
|
11
|
+
# @!attribute status
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :status, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(name:, status:)
|
|
17
|
+
# A verification entry on a CryptoCustomer.
|
|
18
|
+
#
|
|
19
|
+
# @param name [String]
|
|
20
|
+
# @param status [String]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -62,6 +62,12 @@ module Privy
|
|
|
62
62
|
# @return [String]
|
|
63
63
|
required :wallet_id, String
|
|
64
64
|
|
|
65
|
+
# @!attribute destination_caip2
|
|
66
|
+
# Destination chain CAIP-2 identifier. Present for cross-chain swaps.
|
|
67
|
+
#
|
|
68
|
+
# @return [String, nil]
|
|
69
|
+
optional :destination_caip2, String
|
|
70
|
+
|
|
65
71
|
# @!attribute failure_reason
|
|
66
72
|
# A description of why a wallet action (or a step within a wallet action) failed.
|
|
67
73
|
#
|
|
@@ -74,7 +80,7 @@ module Privy
|
|
|
74
80
|
# @return [Array<Privy::Models::EvmTransactionWalletActionStep, Privy::Models::EvmUserOperationWalletActionStep, Privy::Models::SvmTransactionWalletActionStep, Privy::Models::ExternalTransactionWalletActionStep>, nil]
|
|
75
81
|
optional :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] }
|
|
76
82
|
|
|
77
|
-
# @!method initialize(id:, caip2:, created_at:, input_amount:, input_token:, output_amount:, output_token:, status:, type:, wallet_id:, failure_reason: nil, steps: nil)
|
|
83
|
+
# @!method initialize(id:, caip2:, created_at:, input_amount:, input_token:, output_amount:, output_token:, status:, type:, wallet_id:, destination_caip2: nil, failure_reason: nil, steps: nil)
|
|
78
84
|
# Response for a swap action.
|
|
79
85
|
#
|
|
80
86
|
# @param id [String] The ID of the wallet action.
|
|
@@ -97,6 +103,8 @@ module Privy
|
|
|
97
103
|
#
|
|
98
104
|
# @param wallet_id [String] The ID of the wallet involved in the action.
|
|
99
105
|
#
|
|
106
|
+
# @param destination_caip2 [String] Destination chain CAIP-2 identifier. Present for cross-chain swaps.
|
|
107
|
+
#
|
|
100
108
|
# @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed.
|
|
101
109
|
#
|
|
102
110
|
# @param steps [Array<Privy::Models::EvmTransactionWalletActionStep, Privy::Models::EvmUserOperationWalletActionStep, Privy::Models::SvmTransactionWalletActionStep, Privy::Models::ExternalTransactionWalletActionStep>] The steps of the wallet action. Only returned if `?include=steps` is provided.
|
|
@@ -10,13 +10,20 @@ module Privy
|
|
|
10
10
|
required :asset_address, String
|
|
11
11
|
|
|
12
12
|
# @!attribute caip2
|
|
13
|
-
# CAIP-2 chain identifier for the destination.
|
|
14
|
-
#
|
|
13
|
+
# CAIP-2 chain identifier for the destination. Defaults to source chain if
|
|
14
|
+
# omitted. Specify a different chain for cross-chain swaps.
|
|
15
15
|
#
|
|
16
16
|
# @return [String, nil]
|
|
17
17
|
optional :caip2, String
|
|
18
18
|
|
|
19
|
-
# @!
|
|
19
|
+
# @!attribute destination_address
|
|
20
|
+
# Address to receive the output tokens. Defaults to the swapping wallet address.
|
|
21
|
+
# Required when swapping between different chain types (e.g. EVM to Solana).
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :destination_address, String
|
|
25
|
+
|
|
26
|
+
# @!method initialize(asset_address:, caip2: nil, destination_address: nil)
|
|
20
27
|
# Some parameter documentations has been truncated, see
|
|
21
28
|
# {Privy::Models::SwapDestination} for more details.
|
|
22
29
|
#
|
|
@@ -24,7 +31,9 @@ module Privy
|
|
|
24
31
|
#
|
|
25
32
|
# @param asset_address [String] Token contract address to buy, or "native" for the chain's native token.
|
|
26
33
|
#
|
|
27
|
-
# @param caip2 [String] CAIP-2 chain identifier for the destination.
|
|
34
|
+
# @param caip2 [String] CAIP-2 chain identifier for the destination. Defaults to source chain if omitted
|
|
35
|
+
#
|
|
36
|
+
# @param destination_address [String] Address to receive the output tokens. Defaults to the swapping wallet address. R
|
|
28
37
|
end
|
|
29
38
|
end
|
|
30
39
|
end
|
|
@@ -10,13 +10,22 @@ module Privy
|
|
|
10
10
|
required :asset_address, String
|
|
11
11
|
|
|
12
12
|
# @!attribute caip2
|
|
13
|
-
# CAIP-2 chain identifier for the destination.
|
|
14
|
-
#
|
|
13
|
+
# CAIP-2 chain identifier for the destination. Defaults to source chain if
|
|
14
|
+
# omitted. Will result in a cross-chain swap if source and destination chains
|
|
15
|
+
# differ.
|
|
15
16
|
#
|
|
16
17
|
# @return [String, nil]
|
|
17
18
|
optional :caip2, String
|
|
18
19
|
|
|
19
|
-
# @!
|
|
20
|
+
# @!attribute destination_address
|
|
21
|
+
# Address to receive the output tokens. Defaults to the swapping wallet address.
|
|
22
|
+
# Required when swapping between chains with different address types (e.g. EVM to
|
|
23
|
+
# Solana).
|
|
24
|
+
#
|
|
25
|
+
# @return [String, nil]
|
|
26
|
+
optional :destination_address, String
|
|
27
|
+
|
|
28
|
+
# @!method initialize(asset_address:, caip2: nil, destination_address: nil)
|
|
20
29
|
# Some parameter documentations has been truncated, see
|
|
21
30
|
# {Privy::Models::SwapQuoteDestination} for more details.
|
|
22
31
|
#
|
|
@@ -24,7 +33,9 @@ module Privy
|
|
|
24
33
|
#
|
|
25
34
|
# @param asset_address [String] Token contract address to buy, or "native" for the chain's native token.
|
|
26
35
|
#
|
|
27
|
-
# @param caip2 [String] CAIP-2 chain identifier for the destination.
|
|
36
|
+
# @param caip2 [String] CAIP-2 chain identifier for the destination. Defaults to source chain if omitted
|
|
37
|
+
#
|
|
38
|
+
# @param destination_address [String] Address to receive the output tokens. Defaults to the swapping wallet address. R
|
|
28
39
|
end
|
|
29
40
|
end
|
|
30
41
|
end
|
|
@@ -27,6 +27,12 @@ module Privy
|
|
|
27
27
|
# @return [Symbol, Privy::Models::AmountType, nil]
|
|
28
28
|
optional :amount_type, enum: -> { Privy::AmountType }
|
|
29
29
|
|
|
30
|
+
# @!attribute fee_configuration
|
|
31
|
+
# Total fees assessed on a transfer, in BPS
|
|
32
|
+
#
|
|
33
|
+
# @return [Privy::Models::FeeConfiguration, nil]
|
|
34
|
+
optional :fee_configuration, -> { Privy::FeeConfiguration }
|
|
35
|
+
|
|
30
36
|
# @!attribute slippage_bps
|
|
31
37
|
# Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted,
|
|
32
38
|
# auto-slippage is used.
|
|
@@ -34,7 +40,7 @@ module Privy
|
|
|
34
40
|
# @return [Float, nil]
|
|
35
41
|
optional :slippage_bps, Float
|
|
36
42
|
|
|
37
|
-
# @!method initialize(base_amount:, destination:, source:, amount_type: nil, slippage_bps: nil)
|
|
43
|
+
# @!method initialize(base_amount:, destination:, source:, amount_type: nil, fee_configuration: nil, slippage_bps: nil)
|
|
38
44
|
# Some parameter documentations has been truncated, see
|
|
39
45
|
# {Privy::Models::SwapQuoteRequestBody} for more details.
|
|
40
46
|
#
|
|
@@ -48,6 +54,8 @@ module Privy
|
|
|
48
54
|
#
|
|
49
55
|
# @param amount_type [Symbol, Privy::Models::AmountType] Whether the amount refers to the input token or output token.
|
|
50
56
|
#
|
|
57
|
+
# @param fee_configuration [Privy::Models::FeeConfiguration] Total fees assessed on a transfer, in BPS
|
|
58
|
+
#
|
|
51
59
|
# @param slippage_bps [Float] Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted, auto
|
|
52
60
|
end
|
|
53
61
|
end
|
|
@@ -45,7 +45,25 @@ module Privy
|
|
|
45
45
|
# @return [String]
|
|
46
46
|
required :output_token, String
|
|
47
47
|
|
|
48
|
-
# @!
|
|
48
|
+
# @!attribute destination_caip2
|
|
49
|
+
# Destination chain CAIP-2 identifier for cross-chain swaps.
|
|
50
|
+
#
|
|
51
|
+
# @return [String, nil]
|
|
52
|
+
optional :destination_caip2, String
|
|
53
|
+
|
|
54
|
+
# @!attribute estimated_fees
|
|
55
|
+
# Estimated fees in USD.
|
|
56
|
+
#
|
|
57
|
+
# @return [Array<Privy::Models::RelayerFee, Privy::Models::PrivyFee, Privy::Models::DeveloperFee>, nil]
|
|
58
|
+
optional :estimated_fees, -> { Privy::Internal::Type::ArrayOf[union: Privy::FeeLineItem] }
|
|
59
|
+
|
|
60
|
+
# @!attribute expires_at
|
|
61
|
+
# Quote expiry as Unix timestamp (seconds). Present for cross-chain quotes.
|
|
62
|
+
#
|
|
63
|
+
# @return [Float, nil]
|
|
64
|
+
optional :expires_at, Float
|
|
65
|
+
|
|
66
|
+
# @!method initialize(caip2:, est_output_amount:, gas_estimate:, input_amount:, input_token:, minimum_output_amount:, output_token:, destination_caip2: nil, estimated_fees: nil, expires_at: nil)
|
|
49
67
|
# Pricing data for a token swap.
|
|
50
68
|
#
|
|
51
69
|
# @param caip2 [String] Chain identifier.
|
|
@@ -61,6 +79,12 @@ module Privy
|
|
|
61
79
|
# @param minimum_output_amount [String] Minimum output amount accounting for slippage, in base units.
|
|
62
80
|
#
|
|
63
81
|
# @param output_token [String] Token address being bought.
|
|
82
|
+
#
|
|
83
|
+
# @param destination_caip2 [String] Destination chain CAIP-2 identifier for cross-chain swaps.
|
|
84
|
+
#
|
|
85
|
+
# @param estimated_fees [Array<Privy::Models::RelayerFee, Privy::Models::PrivyFee, Privy::Models::DeveloperFee>] Estimated fees in USD.
|
|
86
|
+
#
|
|
87
|
+
# @param expires_at [Float] Quote expiry as Unix timestamp (seconds). Present for cross-chain quotes.
|
|
64
88
|
end
|
|
65
89
|
end
|
|
66
90
|
end
|
|
@@ -27,13 +27,19 @@ module Privy
|
|
|
27
27
|
# @return [Symbol, Privy::Models::AmountType, nil]
|
|
28
28
|
optional :amount_type, enum: -> { Privy::AmountType }
|
|
29
29
|
|
|
30
|
+
# @!attribute fee_configuration
|
|
31
|
+
# Total fees assessed on a transfer, in BPS
|
|
32
|
+
#
|
|
33
|
+
# @return [Privy::Models::FeeConfiguration, nil]
|
|
34
|
+
optional :fee_configuration, -> { Privy::FeeConfiguration }
|
|
35
|
+
|
|
30
36
|
# @!attribute slippage_bps
|
|
31
37
|
# Maximum slippage tolerance in basis points (e.g., 50 for 0.5%).
|
|
32
38
|
#
|
|
33
39
|
# @return [Float, nil]
|
|
34
40
|
optional :slippage_bps, Float
|
|
35
41
|
|
|
36
|
-
# @!method initialize(base_amount:, destination:, source:, amount_type: nil, slippage_bps: nil)
|
|
42
|
+
# @!method initialize(base_amount:, destination:, source:, amount_type: nil, fee_configuration: nil, slippage_bps: nil)
|
|
37
43
|
# Some parameter documentations has been truncated, see
|
|
38
44
|
# {Privy::Models::SwapRequestBody} for more details.
|
|
39
45
|
#
|
|
@@ -47,6 +53,8 @@ module Privy
|
|
|
47
53
|
#
|
|
48
54
|
# @param amount_type [Symbol, Privy::Models::AmountType] Whether the amount refers to the input token or output token.
|
|
49
55
|
#
|
|
56
|
+
# @param fee_configuration [Privy::Models::FeeConfiguration] Total fees assessed on a transfer, in BPS
|
|
57
|
+
#
|
|
50
58
|
# @param slippage_bps [Float] Maximum slippage tolerance in basis points (e.g., 50 for 0.5%).
|
|
51
59
|
end
|
|
52
60
|
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Privy
|
|
4
|
+
module Models
|
|
5
|
+
module Wallets
|
|
6
|
+
# @see Privy::Resources::Wallets::Swap#execute
|
|
7
|
+
class SwapExecuteParams < Privy::Models::SwapRequestBody
|
|
8
|
+
extend Privy::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Privy::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute wallet_id
|
|
12
|
+
# ID of the wallet.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :wallet_id, String
|
|
16
|
+
|
|
17
|
+
# @!attribute privy_authorization_signature
|
|
18
|
+
# Request authorization signature. If multiple signatures are required, they
|
|
19
|
+
# should be comma separated.
|
|
20
|
+
#
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
optional :privy_authorization_signature, String
|
|
23
|
+
|
|
24
|
+
# @!attribute privy_idempotency_key
|
|
25
|
+
# Idempotency keys ensure API requests are executed only once within a 24-hour
|
|
26
|
+
# window.
|
|
27
|
+
#
|
|
28
|
+
# @return [String, nil]
|
|
29
|
+
optional :privy_idempotency_key, String
|
|
30
|
+
|
|
31
|
+
# @!method initialize(wallet_id:, privy_authorization_signature: nil, privy_idempotency_key: nil, request_options: {})
|
|
32
|
+
# Some parameter documentations has been truncated, see
|
|
33
|
+
# {Privy::Models::Wallets::SwapExecuteParams} for more details.
|
|
34
|
+
#
|
|
35
|
+
# @param wallet_id [String] ID of the wallet.
|
|
36
|
+
#
|
|
37
|
+
# @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul
|
|
38
|
+
#
|
|
39
|
+
# @param privy_idempotency_key [String] Idempotency keys ensure API requests are executed only once within a 24-hour win
|
|
40
|
+
#
|
|
41
|
+
# @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}]
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Privy
|
|
4
|
+
module Models
|
|
5
|
+
module Wallets
|
|
6
|
+
# @see Privy::Resources::Wallets::Swap#quote
|
|
7
|
+
class SwapQuoteParams < Privy::Models::SwapQuoteRequestBody
|
|
8
|
+
extend Privy::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Privy::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute wallet_id
|
|
12
|
+
# ID of the wallet.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :wallet_id, String
|
|
16
|
+
|
|
17
|
+
# @!attribute privy_authorization_signature
|
|
18
|
+
# Request authorization signature. If multiple signatures are required, they
|
|
19
|
+
# should be comma separated.
|
|
20
|
+
#
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
optional :privy_authorization_signature, String
|
|
23
|
+
|
|
24
|
+
# @!method initialize(wallet_id:, privy_authorization_signature: nil, request_options: {})
|
|
25
|
+
# Some parameter documentations has been truncated, see
|
|
26
|
+
# {Privy::Models::Wallets::SwapQuoteParams} for more details.
|
|
27
|
+
#
|
|
28
|
+
# @param wallet_id [String] ID of the wallet.
|
|
29
|
+
#
|
|
30
|
+
# @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul
|
|
31
|
+
#
|
|
32
|
+
# @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}]
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
data/lib/privy/models.rb
CHANGED
|
@@ -256,10 +256,18 @@ module Privy
|
|
|
256
256
|
|
|
257
257
|
CreateAccountInput = Privy::Models::CreateAccountInput
|
|
258
258
|
|
|
259
|
+
CreateLinkAuthIntentInput = Privy::Models::CreateLinkAuthIntentInput
|
|
260
|
+
|
|
261
|
+
CreateLinkAuthIntentResponse = Privy::Models::CreateLinkAuthIntentResponse
|
|
262
|
+
|
|
259
263
|
CreateOrganizationSecretResponse = Privy::Models::CreateOrganizationSecretResponse
|
|
260
264
|
|
|
261
265
|
CreateOrUpdateFiatCustomerRequestInput = Privy::Models::CreateOrUpdateFiatCustomerRequestInput
|
|
262
266
|
|
|
267
|
+
CreateStripeOnrampSessionInput = Privy::Models::CreateStripeOnrampSessionInput
|
|
268
|
+
|
|
269
|
+
CreateStripeOnrampSessionResponse = Privy::Models::CreateStripeOnrampSessionResponse
|
|
270
|
+
|
|
263
271
|
CrossAppConnection = Privy::Models::CrossAppConnection
|
|
264
272
|
|
|
265
273
|
CrossAppConnectionsResponse = Privy::Models::CrossAppConnectionsResponse
|
|
@@ -303,6 +311,8 @@ module Privy
|
|
|
303
311
|
|
|
304
312
|
DeveloperFee = Privy::Models::DeveloperFee
|
|
305
313
|
|
|
314
|
+
DeviceAuthorizationResponse = Privy::Models::DeviceAuthorizationResponse
|
|
315
|
+
|
|
306
316
|
EarnAsset = Privy::Models::EarnAsset
|
|
307
317
|
|
|
308
318
|
EarnDepositActionResponse = Privy::Models::EarnDepositActionResponse
|
|
@@ -313,6 +323,12 @@ module Privy
|
|
|
313
323
|
|
|
314
324
|
EarnIncentiveClaimRequestBody = Privy::Models::EarnIncentiveClaimRequestBody
|
|
315
325
|
|
|
326
|
+
EarnIncentiveRewardEntry = Privy::Models::EarnIncentiveRewardEntry
|
|
327
|
+
|
|
328
|
+
EarnIncentiveRewardsQuery = Privy::Models::EarnIncentiveRewardsQuery
|
|
329
|
+
|
|
330
|
+
EarnIncentiveRewardsResponse = Privy::Models::EarnIncentiveRewardsResponse
|
|
331
|
+
|
|
316
332
|
EarnIncetiveClaimRewardEntry = Privy::Models::EarnIncetiveClaimRewardEntry
|
|
317
333
|
|
|
318
334
|
EarnWithdrawActionResponse = Privy::Models::EarnWithdrawActionResponse
|
|
@@ -474,6 +490,10 @@ module Privy
|
|
|
474
490
|
|
|
475
491
|
EvmWalletActionStepStatus = Privy::Models::EvmWalletActionStepStatus
|
|
476
492
|
|
|
493
|
+
ExchangeStripeTokensInput = Privy::Models::ExchangeStripeTokensInput
|
|
494
|
+
|
|
495
|
+
ExchangeStripeTokensResponse = Privy::Models::ExchangeStripeTokensResponse
|
|
496
|
+
|
|
477
497
|
ExportPrivateKeyRpcInput = Privy::Models::ExportPrivateKeyRpcInput
|
|
478
498
|
|
|
479
499
|
ExportPrivateKeyRpcResponse = Privy::Models::ExportPrivateKeyRpcResponse
|
|
@@ -570,8 +590,12 @@ module Privy
|
|
|
570
590
|
|
|
571
591
|
FiatOnrampSource = Privy::Models::FiatOnrampSource
|
|
572
592
|
|
|
593
|
+
FiatOnrampStripeSDKSessionResponse = Privy::Models::FiatOnrampStripeSDKSessionResponse
|
|
594
|
+
|
|
573
595
|
FiatOnrampTransactionStatus = Privy::Models::FiatOnrampTransactionStatus
|
|
574
596
|
|
|
597
|
+
FiatOnrampURLSessionResponse = Privy::Models::FiatOnrampURLSessionResponse
|
|
598
|
+
|
|
575
599
|
FiatVirtualAccountRequest = Privy::Models::FiatVirtualAccountRequest
|
|
576
600
|
|
|
577
601
|
FiatVirtualAccountResponse = Privy::Models::FiatVirtualAccountResponse
|
|
@@ -594,10 +618,6 @@ module Privy
|
|
|
594
618
|
|
|
595
619
|
GasSpendResponseBody = Privy::Models::GasSpendResponseBody
|
|
596
620
|
|
|
597
|
-
GasSponsorshipConfiguration = Privy::Models::GasSponsorshipConfiguration
|
|
598
|
-
|
|
599
|
-
GasSponsorshipConfigurationInput = Privy::Models::GasSponsorshipConfigurationInput
|
|
600
|
-
|
|
601
621
|
GetByWalletAddressRequestBody = Privy::Models::GetByWalletAddressRequestBody
|
|
602
622
|
|
|
603
623
|
GetFiatCustomerRequestInput = Privy::Models::GetFiatCustomerRequestInput
|
|
@@ -614,6 +634,8 @@ module Privy
|
|
|
614
634
|
|
|
615
635
|
GetFiatOnrampURLResponse = Privy::Models::GetFiatOnrampURLResponse
|
|
616
636
|
|
|
637
|
+
GetStripeCryptoCustomerResponse = Privy::Models::GetStripeCryptoCustomerResponse
|
|
638
|
+
|
|
617
639
|
GuestAuthenticateRequestBody = Privy::Models::GuestAuthenticateRequestBody
|
|
618
640
|
|
|
619
641
|
HDInitInput = Privy::Models::HDInitInput
|
|
@@ -720,6 +742,15 @@ module Privy
|
|
|
720
742
|
|
|
721
743
|
KrakenEmbedCustomOrderAmount = Privy::Models::KrakenEmbedCustomOrderAmount
|
|
722
744
|
|
|
745
|
+
KrakenEmbedCustomOrderCancelledWebhookPayload =
|
|
746
|
+
Privy::Models::KrakenEmbedCustomOrderCancelledWebhookPayload
|
|
747
|
+
|
|
748
|
+
KrakenEmbedCustomOrderExecutedWebhookPayload =
|
|
749
|
+
Privy::Models::KrakenEmbedCustomOrderExecutedWebhookPayload
|
|
750
|
+
|
|
751
|
+
KrakenEmbedCustomOrderExecutionFailedWebhookPayload =
|
|
752
|
+
Privy::Models::KrakenEmbedCustomOrderExecutionFailedWebhookPayload
|
|
753
|
+
|
|
723
754
|
KrakenEmbedCustomOrderOccurrence = Privy::Models::KrakenEmbedCustomOrderOccurrence
|
|
724
755
|
|
|
725
756
|
KrakenEmbedCustomOrderOccurrenceExecutedAction =
|
|
@@ -832,6 +863,10 @@ module Privy
|
|
|
832
863
|
|
|
833
864
|
KrakenEmbedUserVerifiedWebhookPayload = Privy::Models::KrakenEmbedUserVerifiedWebhookPayload
|
|
834
865
|
|
|
866
|
+
LinkAuthIntentCreated = Privy::Models::LinkAuthIntentCreated
|
|
867
|
+
|
|
868
|
+
LinkAuthIntentNoAccount = Privy::Models::LinkAuthIntentNoAccount
|
|
869
|
+
|
|
835
870
|
LinkedAccount = Privy::Models::LinkedAccount
|
|
836
871
|
|
|
837
872
|
LinkedAccountAppleInput = Privy::Models::LinkedAccountAppleInput
|
|
@@ -940,6 +975,10 @@ module Privy
|
|
|
940
975
|
|
|
941
976
|
LinkJwtInput = Privy::Models::LinkJwtInput
|
|
942
977
|
|
|
978
|
+
ListStripeConsumerWalletsResponse = Privy::Models::ListStripeConsumerWalletsResponse
|
|
979
|
+
|
|
980
|
+
ListStripePaymentTokensResponse = Privy::Models::ListStripePaymentTokensResponse
|
|
981
|
+
|
|
943
982
|
MfaDisabledWebhookPayload = Privy::Models::MfaDisabledWebhookPayload
|
|
944
983
|
|
|
945
984
|
MfaEnabledWebhookPayload = Privy::Models::MfaEnabledWebhookPayload
|
|
@@ -1034,6 +1073,8 @@ module Privy
|
|
|
1034
1073
|
|
|
1035
1074
|
OnrampProvider = Privy::Models::OnrampProvider
|
|
1036
1075
|
|
|
1076
|
+
OnrampSessionParams = Privy::Models::OnrampSessionParams
|
|
1077
|
+
|
|
1037
1078
|
OptionalRefreshTokenInput = Privy::Models::OptionalRefreshTokenInput
|
|
1038
1079
|
|
|
1039
1080
|
OrganizationSecretIDInput = Privy::Models::OrganizationSecretIDInput
|
|
@@ -1207,6 +1248,8 @@ module Privy
|
|
|
1207
1248
|
|
|
1208
1249
|
RecoveryType = Privy::Models::RecoveryType
|
|
1209
1250
|
|
|
1251
|
+
RefreshStripeQuoteResponse = Privy::Models::RefreshStripeQuoteResponse
|
|
1252
|
+
|
|
1210
1253
|
RelayerFee = Privy::Models::RelayerFee
|
|
1211
1254
|
|
|
1212
1255
|
ResponsePasskeyInitAuthenticate = Privy::Models::ResponsePasskeyInitAuthenticate
|
|
@@ -1219,6 +1262,8 @@ module Privy
|
|
|
1219
1262
|
|
|
1220
1263
|
RpcIntentResponse = Privy::Models::RpcIntentResponse
|
|
1221
1264
|
|
|
1265
|
+
RuleDeleteIntentResponse = Privy::Models::RuleDeleteIntentResponse
|
|
1266
|
+
|
|
1222
1267
|
RuleIntentCreateRequestDetails = Privy::Models::RuleIntentCreateRequestDetails
|
|
1223
1268
|
|
|
1224
1269
|
RuleIntentDeleteRequestDetails = Privy::Models::RuleIntentDeleteRequestDetails
|
|
@@ -1229,6 +1274,8 @@ module Privy
|
|
|
1229
1274
|
|
|
1230
1275
|
RuleIntentUpdateRequestDetails = Privy::Models::RuleIntentUpdateRequestDetails
|
|
1231
1276
|
|
|
1277
|
+
RuleMutateIntentResponse = Privy::Models::RuleMutateIntentResponse
|
|
1278
|
+
|
|
1232
1279
|
SeedPhraseExportInput = Privy::Models::SeedPhraseExportInput
|
|
1233
1280
|
|
|
1234
1281
|
SeedPhraseExportResponse = Privy::Models::SeedPhraseExportResponse
|
|
@@ -1423,6 +1470,26 @@ module Privy
|
|
|
1423
1470
|
|
|
1424
1471
|
SparkWalletLeaf = Privy::Models::SparkWalletLeaf
|
|
1425
1472
|
|
|
1473
|
+
StripeConsumerWallet = Privy::Models::StripeConsumerWallet
|
|
1474
|
+
|
|
1475
|
+
StripeCryptoCustomerActive = Privy::Models::StripeCryptoCustomerActive
|
|
1476
|
+
|
|
1477
|
+
StripeCryptoCustomerExpired = Privy::Models::StripeCryptoCustomerExpired
|
|
1478
|
+
|
|
1479
|
+
StripeCryptoCustomerNone = Privy::Models::StripeCryptoCustomerNone
|
|
1480
|
+
|
|
1481
|
+
StripeOnrampCheckoutResponse = Privy::Models::StripeOnrampCheckoutResponse
|
|
1482
|
+
|
|
1483
|
+
StripeOnrampSessionStatus = Privy::Models::StripeOnrampSessionStatus
|
|
1484
|
+
|
|
1485
|
+
StripePaymentToken = Privy::Models::StripePaymentToken
|
|
1486
|
+
|
|
1487
|
+
StripeQuote = Privy::Models::StripeQuote
|
|
1488
|
+
|
|
1489
|
+
StripeTransactionDetails = Privy::Models::StripeTransactionDetails
|
|
1490
|
+
|
|
1491
|
+
StripeVerification = Privy::Models::StripeVerification
|
|
1492
|
+
|
|
1426
1493
|
SuccessResponse = Privy::Models::SuccessResponse
|
|
1427
1494
|
|
|
1428
1495
|
SuiCommandName = Privy::Models::SuiCommandName
|
|
@@ -12,7 +12,7 @@ module Privy
|
|
|
12
12
|
attr_reader :api
|
|
13
13
|
|
|
14
14
|
# Service accessors.
|
|
15
|
-
attr_reader :wallets, :users, :policies, :key_quorums, :jwt_exchange
|
|
15
|
+
attr_reader :wallets, :users, :policies, :key_quorums, :transactions, :jwt_exchange
|
|
16
16
|
|
|
17
17
|
# @return [Privy::PrivyRequestExpiryOptions]
|
|
18
18
|
attr_reader :request_expiry_options
|
|
@@ -48,6 +48,7 @@ module Privy
|
|
|
48
48
|
@users = Privy::Services::Users.new(client: @api, privy_client: self)
|
|
49
49
|
@policies = Privy::Services::Policies.new(client: @api, privy_client: self)
|
|
50
50
|
@key_quorums = Privy::Services::KeyQuorums.new(client: @api, privy_client: self)
|
|
51
|
+
@transactions = Privy::Services::Transactions.new(client: @api, privy_client: self)
|
|
51
52
|
@jwt_exchange = Privy::JwtExchangeService.new(
|
|
52
53
|
wallets_resource: @api.wallets,
|
|
53
54
|
cache_max_capacity: authorization_key_cache_max_capacity
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Privy
|
|
4
|
+
module Services
|
|
5
|
+
class Earn
|
|
6
|
+
class Ethereum
|
|
7
|
+
class Incentive < Privy::Resources::Wallets::Earn::Ethereum::Incentive
|
|
8
|
+
attr_reader :privy_client
|
|
9
|
+
|
|
10
|
+
def initialize(client:, privy_client:)
|
|
11
|
+
super(client: client)
|
|
12
|
+
@privy_client = privy_client
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Claim incentive rewards for a wallet.
|
|
16
|
+
#
|
|
17
|
+
# @example Claim rewards on Base
|
|
18
|
+
# client.wallets.earn.ethereum.incentive.claim("wallet-id", earn_incentive_claim_params: {
|
|
19
|
+
# chain: "base"
|
|
20
|
+
# }, authorization_context: ctx)
|
|
21
|
+
#
|
|
22
|
+
# @param wallet_id [String] ID of the wallet to claim rewards for.
|
|
23
|
+
# @param earn_incentive_claim_params [Hash] Body parameters for the incentive claim operation.
|
|
24
|
+
# @option earn_incentive_claim_params [String] :chain Blockchain network on which to perform the incentive claim.
|
|
25
|
+
# @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned wallets.
|
|
26
|
+
# @param idempotency_key [String, nil] Ensures the request is executed only once.
|
|
27
|
+
# @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the
|
|
28
|
+
# request expires. Defaults to the value computed by the client's
|
|
29
|
+
# PrivyRequestExpiryOptions.
|
|
30
|
+
# @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries).
|
|
31
|
+
#
|
|
32
|
+
# @return [Privy::Models::EarnIncentiveClaimActionResponse]
|
|
33
|
+
def claim(
|
|
34
|
+
wallet_id,
|
|
35
|
+
earn_incentive_claim_params:,
|
|
36
|
+
authorization_context: nil,
|
|
37
|
+
idempotency_key: nil,
|
|
38
|
+
request_expiry: nil,
|
|
39
|
+
request_options: nil
|
|
40
|
+
)
|
|
41
|
+
prepared = Privy::Authorization.prepare_request(
|
|
42
|
+
privy_client,
|
|
43
|
+
method: :post,
|
|
44
|
+
url: Privy::Authorization.signed_url(
|
|
45
|
+
privy_client,
|
|
46
|
+
"v1/wallets/#{wallet_id}/earn/ethereum/incentive/claim"
|
|
47
|
+
),
|
|
48
|
+
body: earn_incentive_claim_params,
|
|
49
|
+
authorization_context: authorization_context,
|
|
50
|
+
idempotency_key: idempotency_key,
|
|
51
|
+
request_expiry: privy_client.compute_request_expiry(request_expiry)
|
|
52
|
+
)
|
|
53
|
+
combined_params = earn_incentive_claim_params.merge(request_options: request_options)
|
|
54
|
+
Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers)
|
|
55
|
+
_claim(wallet_id, combined_params)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|