privy_ruby 0.1.0 → 0.2.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.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/privy/client.rb +5 -4
  5. data/lib/privy/models/analytics_event_input.rb +2 -2
  6. data/lib/privy/models/bitcoin_address.rb +7 -0
  7. data/lib/privy/models/bridge_destination_asset.rb +1 -0
  8. data/lib/privy/models/bridge_fiat_virtual_account_destination.rb +6 -1
  9. data/lib/privy/models/bridge_fiat_virtual_account_request.rb +6 -2
  10. data/lib/privy/models/bridge_fiat_virtual_account_response.rb +2 -1
  11. data/lib/privy/models/bridge_fiat_virtual_account_source.rb +4 -1
  12. data/lib/privy/models/bridge_sandbox_fiat_virtual_account_request.rb +6 -2
  13. data/lib/privy/models/bridge_sandbox_fiat_virtual_account_response.rb +2 -1
  14. data/lib/privy/models/bridge_source_asset.rb +1 -0
  15. data/lib/privy/models/create_stripe_onramp_session_response.rb +16 -1
  16. data/lib/privy/models/device_verify_action.rb +16 -0
  17. data/lib/privy/models/device_verify_request_body.rb +27 -0
  18. data/lib/privy/models/device_verify_response.rb +18 -0
  19. data/lib/privy/models/evm_address.rb +7 -0
  20. data/lib/privy/models/evm_checksum_address.rb +7 -0
  21. data/lib/privy/models/gas.rb +35 -0
  22. data/lib/privy/models/hyperliquid_token_address.rb +7 -0
  23. data/lib/privy/models/linked_account_embedded_wallet.rb +1 -0
  24. data/lib/privy/models/oauth_grant.rb +54 -0
  25. data/lib/privy/models/oauth_grant_list_response.rb +18 -0
  26. data/lib/privy/models/oauth_grant_revoke_response.rb +30 -0
  27. data/lib/privy/models/oauth_token_authorization_code_request_body.rb +59 -0
  28. data/lib/privy/models/oauth_token_device_code_pending_error.rb +50 -0
  29. data/lib/privy/models/oauth_token_device_code_request_body.rb +36 -0
  30. data/lib/privy/models/oauth_token_grant_type.rb +17 -0
  31. data/lib/privy/models/oauth_token_refresh_token_request_body.rb +36 -0
  32. data/lib/privy/models/oauth_token_request_body.rb +24 -0
  33. data/lib/privy/models/oauth_token_success_response.rb +58 -0
  34. data/lib/privy/models/onramp_session_fees.rb +23 -0
  35. data/lib/privy/models/onramp_session_transaction_details.rb +59 -0
  36. data/lib/privy/models/solana_address.rb +7 -0
  37. data/lib/privy/models/swap_action_response.rb +38 -1
  38. data/lib/privy/models/swap_quote_request_body.rb +3 -3
  39. data/lib/privy/models/swap_quote_response.rb +18 -5
  40. data/lib/privy/models/swap_request_body.rb +3 -3
  41. data/lib/privy/models/token_transfer_destination.rb +2 -2
  42. data/lib/privy/models/transfer_action_response.rb +29 -3
  43. data/lib/privy/models/transfer_quote_request_body.rb +3 -2
  44. data/lib/privy/models/transfer_quote_response.rb +10 -1
  45. data/lib/privy/models/transfer_received_transaction_detail.rb +5 -0
  46. data/lib/privy/models/transfer_request_body.rb +3 -2
  47. data/lib/privy/models/transfer_sent_transaction_detail.rb +5 -0
  48. data/lib/privy/models/tron_address.rb +7 -0
  49. data/lib/privy/models/wallet_asset.rb +1 -0
  50. data/lib/privy/models/wallet_batch_create_response.rb +1 -0
  51. data/lib/privy/models/wallet_create_batch_params.rb +14 -0
  52. data/lib/privy/models/wallet_ethereum_asset.rb +1 -0
  53. data/lib/privy/models/wallets/balance_get_params.rb +11 -0
  54. data/lib/privy/models/wallets/balance_get_response.rb +5 -0
  55. data/lib/privy/models/wallets/transaction_get_params.rb +3 -0
  56. data/lib/privy/models.rb +46 -0
  57. data/lib/privy/resources/intents.rb +2 -1
  58. data/lib/privy/resources/wallets/swap.rb +2 -2
  59. data/lib/privy/resources/wallets.rb +25 -1
  60. data/lib/privy/version.rb +1 -1
  61. data/lib/privy.rb +24 -1
  62. data/rbi/privy/client.rbi +4 -3
  63. data/rbi/privy/models/analytics_event_input.rbi +3 -6
  64. data/rbi/privy/models/bitcoin_address.rbi +7 -0
  65. data/rbi/privy/models/bridge_destination_asset.rbi +1 -0
  66. data/rbi/privy/models/bridge_fiat_virtual_account_destination.rbi +8 -1
  67. data/rbi/privy/models/bridge_fiat_virtual_account_request.rbi +9 -1
  68. data/rbi/privy/models/bridge_fiat_virtual_account_response.rbi +2 -0
  69. data/rbi/privy/models/bridge_fiat_virtual_account_source.rbi +6 -1
  70. data/rbi/privy/models/bridge_sandbox_fiat_virtual_account_request.rbi +9 -1
  71. data/rbi/privy/models/bridge_sandbox_fiat_virtual_account_response.rbi +2 -0
  72. data/rbi/privy/models/bridge_source_asset.rbi +1 -0
  73. data/rbi/privy/models/create_stripe_onramp_session_response.rbi +61 -3
  74. data/rbi/privy/models/device_verify_action.rbi +22 -0
  75. data/rbi/privy/models/device_verify_request_body.rbi +44 -0
  76. data/rbi/privy/models/device_verify_response.rbi +28 -0
  77. data/rbi/privy/models/evm_address.rbi +7 -0
  78. data/rbi/privy/models/evm_checksum_address.rbi +7 -0
  79. data/rbi/privy/models/gas.rbi +46 -0
  80. data/rbi/privy/models/hyperliquid_token_address.rbi +7 -0
  81. data/rbi/privy/models/linked_account_embedded_wallet.rbi +1 -0
  82. data/rbi/privy/models/oauth_grant.rbi +78 -0
  83. data/rbi/privy/models/oauth_grant_list_response.rbi +32 -0
  84. data/rbi/privy/models/oauth_grant_revoke_response.rbi +58 -0
  85. data/rbi/privy/models/oauth_token_authorization_code_request_body.rbi +115 -0
  86. data/rbi/privy/models/oauth_token_device_code_pending_error.rbi +106 -0
  87. data/rbi/privy/models/oauth_token_device_code_request_body.rbi +78 -0
  88. data/rbi/privy/models/oauth_token_grant_type.rbi +29 -0
  89. data/rbi/privy/models/oauth_token_refresh_token_request_body.rbi +78 -0
  90. data/rbi/privy/models/oauth_token_request_body.rbi +23 -0
  91. data/rbi/privy/models/oauth_token_success_response.rbi +95 -0
  92. data/rbi/privy/models/onramp_session_fees.rbi +39 -0
  93. data/rbi/privy/models/onramp_session_transaction_details.rbi +95 -0
  94. data/rbi/privy/models/solana_address.rbi +7 -0
  95. data/rbi/privy/models/swap_action_response.rbi +84 -0
  96. data/rbi/privy/models/swap_quote_request_body.rbi +4 -4
  97. data/rbi/privy/models/swap_quote_response.rbi +19 -4
  98. data/rbi/privy/models/swap_request_body.rbi +4 -4
  99. data/rbi/privy/models/token_transfer_destination.rbi +2 -2
  100. data/rbi/privy/models/transfer_action_response.rbi +57 -2
  101. data/rbi/privy/models/transfer_quote_request_body.rbi +4 -2
  102. data/rbi/privy/models/transfer_quote_response.rbi +16 -3
  103. data/rbi/privy/models/transfer_received_transaction_detail.rbi +15 -0
  104. data/rbi/privy/models/transfer_request_body.rbi +4 -2
  105. data/rbi/privy/models/transfer_sent_transaction_detail.rbi +15 -0
  106. data/rbi/privy/models/tron_address.rbi +7 -0
  107. data/rbi/privy/models/wallet_asset.rbi +1 -0
  108. data/rbi/privy/models/wallet_batch_create_response.rbi +2 -19
  109. data/rbi/privy/models/wallet_batch_create_result.rbi +4 -4
  110. data/rbi/privy/models/wallet_create_batch_params.rbi +27 -0
  111. data/rbi/privy/models/wallet_ethereum_asset.rbi +1 -0
  112. data/rbi/privy/models/wallets/balance_get_params.rbi +22 -0
  113. data/rbi/privy/models/wallets/balance_get_response.rbi +15 -0
  114. data/rbi/privy/models/wallets/transaction_get_params.rbi +5 -0
  115. data/rbi/privy/models.rbi +51 -0
  116. data/rbi/privy/resources/intents.rbi +4 -1
  117. data/rbi/privy/resources/wallets/swap.rbi +2 -2
  118. data/rbi/privy/resources/wallets.rbi +19 -1
  119. data/sig/privy/client.rbs +2 -2
  120. data/sig/privy/models/analytics_event_input.rbs +4 -6
  121. data/sig/privy/models/bitcoin_address.rbs +5 -0
  122. data/sig/privy/models/create_stripe_onramp_session_response.rbs +29 -3
  123. data/sig/privy/models/device_verify_action.rbs +14 -0
  124. data/sig/privy/models/device_verify_request_body.rbs +22 -0
  125. data/sig/privy/models/device_verify_response.rbs +13 -0
  126. data/sig/privy/models/evm_address.rbs +5 -0
  127. data/sig/privy/models/evm_checksum_address.rbs +5 -0
  128. data/sig/privy/models/gas.rbs +21 -0
  129. data/sig/privy/models/hyperliquid_token_address.rbs +5 -0
  130. data/sig/privy/models/oauth_grant.rbs +45 -0
  131. data/sig/privy/models/oauth_grant_list_response.rbs +13 -0
  132. data/sig/privy/models/oauth_grant_revoke_response.rbs +28 -0
  133. data/sig/privy/models/oauth_token_authorization_code_request_body.rbs +56 -0
  134. data/sig/privy/models/oauth_token_device_code_pending_error.rbs +48 -0
  135. data/sig/privy/models/oauth_token_device_code_request_body.rbs +35 -0
  136. data/sig/privy/models/oauth_token_grant_type.rbs +18 -0
  137. data/sig/privy/models/oauth_token_refresh_token_request_body.rbs +35 -0
  138. data/sig/privy/models/oauth_token_request_body.rbs +14 -0
  139. data/sig/privy/models/oauth_token_success_response.rbs +49 -0
  140. data/sig/privy/models/onramp_session_fees.rbs +22 -0
  141. data/sig/privy/models/onramp_session_transaction_details.rbs +53 -0
  142. data/sig/privy/models/solana_address.rbs +5 -0
  143. data/sig/privy/models/swap_action_response.rbs +32 -0
  144. data/sig/privy/models/swap_quote_request_body.rbs +5 -5
  145. data/sig/privy/models/swap_quote_response.rbs +7 -0
  146. data/sig/privy/models/swap_request_body.rbs +5 -5
  147. data/sig/privy/models/transfer_action_response.rbs +23 -0
  148. data/sig/privy/models/transfer_quote_response.rbs +10 -3
  149. data/sig/privy/models/transfer_received_transaction_detail.rbs +15 -1
  150. data/sig/privy/models/transfer_sent_transaction_detail.rbs +15 -1
  151. data/sig/privy/models/tron_address.rbs +5 -0
  152. data/sig/privy/models/wallet_asset.rbs +2 -1
  153. data/sig/privy/models/wallet_create_batch_params.rbs +15 -0
  154. data/sig/privy/models/wallet_ethereum_asset.rbs +2 -1
  155. data/sig/privy/models/wallets/balance_get_params.rbs +10 -0
  156. data/sig/privy/models/wallets/balance_get_response.rbs +6 -0
  157. data/sig/privy/models/wallets/transaction_get_params.rbs +2 -0
  158. data/sig/privy/models.rbs +46 -0
  159. data/sig/privy/resources/wallets/swap.rbs +2 -2
  160. data/sig/privy/resources/wallets.rbs +5 -0
  161. metadata +71 -2
@@ -0,0 +1,78 @@
1
+ # typed: strong
2
+
3
+ module Privy
4
+ module Models
5
+ class OAuthTokenDeviceCodeRequestBody < Privy::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Privy::OAuthTokenDeviceCodeRequestBody,
10
+ Privy::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The device code received from the device authorization endpoint.
15
+ sig { returns(String) }
16
+ attr_accessor :device_code
17
+
18
+ sig do
19
+ returns(Privy::OAuthTokenDeviceCodeRequestBody::GrantType::OrSymbol)
20
+ end
21
+ attr_accessor :grant_type
22
+
23
+ # Request body for the urn:ietf:params:oauth:grant-type:device_code grant type
24
+ # (RFC 8628). Used by CLI clients to poll for authorization.
25
+ sig do
26
+ params(
27
+ device_code: String,
28
+ grant_type:
29
+ Privy::OAuthTokenDeviceCodeRequestBody::GrantType::OrSymbol
30
+ ).returns(T.attached_class)
31
+ end
32
+ def self.new(
33
+ # The device code received from the device authorization endpoint.
34
+ device_code:,
35
+ grant_type:
36
+ )
37
+ end
38
+
39
+ sig do
40
+ override.returns(
41
+ {
42
+ device_code: String,
43
+ grant_type:
44
+ Privy::OAuthTokenDeviceCodeRequestBody::GrantType::OrSymbol
45
+ }
46
+ )
47
+ end
48
+ def to_hash
49
+ end
50
+
51
+ module GrantType
52
+ extend Privy::Internal::Type::Enum
53
+
54
+ TaggedSymbol =
55
+ T.type_alias do
56
+ T.all(Symbol, Privy::OAuthTokenDeviceCodeRequestBody::GrantType)
57
+ end
58
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
59
+
60
+ URN_IETF_PARAMS_OAUTH_GRANT_TYPE_DEVICE_CODE =
61
+ T.let(
62
+ :"urn:ietf:params:oauth:grant-type:device_code",
63
+ Privy::OAuthTokenDeviceCodeRequestBody::GrantType::TaggedSymbol
64
+ )
65
+
66
+ sig do
67
+ override.returns(
68
+ T::Array[
69
+ Privy::OAuthTokenDeviceCodeRequestBody::GrantType::TaggedSymbol
70
+ ]
71
+ )
72
+ end
73
+ def self.values
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,29 @@
1
+ # typed: strong
2
+
3
+ module Privy
4
+ module Models
5
+ # The OAuth grant type for the token request.
6
+ module OAuthTokenGrantType
7
+ extend Privy::Internal::Type::Enum
8
+
9
+ TaggedSymbol = T.type_alias { T.all(Symbol, Privy::OAuthTokenGrantType) }
10
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11
+
12
+ AUTHORIZATION_CODE =
13
+ T.let(:authorization_code, Privy::OAuthTokenGrantType::TaggedSymbol)
14
+ URN_IETF_PARAMS_OAUTH_GRANT_TYPE_DEVICE_CODE =
15
+ T.let(
16
+ :"urn:ietf:params:oauth:grant-type:device_code",
17
+ Privy::OAuthTokenGrantType::TaggedSymbol
18
+ )
19
+ REFRESH_TOKEN =
20
+ T.let(:refresh_token, Privy::OAuthTokenGrantType::TaggedSymbol)
21
+
22
+ sig do
23
+ override.returns(T::Array[Privy::OAuthTokenGrantType::TaggedSymbol])
24
+ end
25
+ def self.values
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,78 @@
1
+ # typed: strong
2
+
3
+ module Privy
4
+ module Models
5
+ class OAuthTokenRefreshTokenRequestBody < Privy::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Privy::OAuthTokenRefreshTokenRequestBody,
10
+ Privy::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig do
15
+ returns(Privy::OAuthTokenRefreshTokenRequestBody::GrantType::OrSymbol)
16
+ end
17
+ attr_accessor :grant_type
18
+
19
+ # The refresh token to exchange for a new access token.
20
+ sig { returns(String) }
21
+ attr_accessor :refresh_token
22
+
23
+ # Request body for the refresh_token grant type. Rotates the refresh token and
24
+ # issues a new access token.
25
+ sig do
26
+ params(
27
+ grant_type:
28
+ Privy::OAuthTokenRefreshTokenRequestBody::GrantType::OrSymbol,
29
+ refresh_token: String
30
+ ).returns(T.attached_class)
31
+ end
32
+ def self.new(
33
+ grant_type:,
34
+ # The refresh token to exchange for a new access token.
35
+ refresh_token:
36
+ )
37
+ end
38
+
39
+ sig do
40
+ override.returns(
41
+ {
42
+ grant_type:
43
+ Privy::OAuthTokenRefreshTokenRequestBody::GrantType::OrSymbol,
44
+ refresh_token: String
45
+ }
46
+ )
47
+ end
48
+ def to_hash
49
+ end
50
+
51
+ module GrantType
52
+ extend Privy::Internal::Type::Enum
53
+
54
+ TaggedSymbol =
55
+ T.type_alias do
56
+ T.all(Symbol, Privy::OAuthTokenRefreshTokenRequestBody::GrantType)
57
+ end
58
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
59
+
60
+ REFRESH_TOKEN =
61
+ T.let(
62
+ :refresh_token,
63
+ Privy::OAuthTokenRefreshTokenRequestBody::GrantType::TaggedSymbol
64
+ )
65
+
66
+ sig do
67
+ override.returns(
68
+ T::Array[
69
+ Privy::OAuthTokenRefreshTokenRequestBody::GrantType::TaggedSymbol
70
+ ]
71
+ )
72
+ end
73
+ def self.values
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module Privy
4
+ module Models
5
+ # Request body for the OAuth token endpoint, discriminated by grant_type.
6
+ module OAuthTokenRequestBody
7
+ extend Privy::Internal::Type::Union
8
+
9
+ Variants =
10
+ T.type_alias do
11
+ T.any(
12
+ Privy::OAuthTokenAuthorizationCodeRequestBody,
13
+ Privy::OAuthTokenDeviceCodeRequestBody,
14
+ Privy::OAuthTokenRefreshTokenRequestBody
15
+ )
16
+ end
17
+
18
+ sig { override.returns(T::Array[Privy::OAuthTokenRequestBody::Variants]) }
19
+ def self.variants
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,95 @@
1
+ # typed: strong
2
+
3
+ module Privy
4
+ module Models
5
+ class OAuthTokenSuccessResponse < Privy::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Privy::OAuthTokenSuccessResponse, Privy::Internal::AnyHash)
9
+ end
10
+
11
+ # The issued access token.
12
+ sig { returns(String) }
13
+ attr_accessor :access_token
14
+
15
+ # The type of token issued.
16
+ sig { returns(Privy::OAuthTokenSuccessResponse::TokenType::OrSymbol) }
17
+ attr_accessor :token_type
18
+
19
+ # The lifetime in seconds of the access token.
20
+ sig { returns(T.nilable(Float)) }
21
+ attr_reader :expires_in
22
+
23
+ sig { params(expires_in: Float).void }
24
+ attr_writer :expires_in
25
+
26
+ # A refresh token for obtaining new access tokens. Issued for device_code and
27
+ # refresh_token grants.
28
+ sig { returns(T.nilable(String)) }
29
+ attr_reader :refresh_token
30
+
31
+ sig { params(refresh_token: String).void }
32
+ attr_writer :refresh_token
33
+
34
+ # Successful token response per RFC 6749 Section 5.1.
35
+ sig do
36
+ params(
37
+ access_token: String,
38
+ token_type: Privy::OAuthTokenSuccessResponse::TokenType::OrSymbol,
39
+ expires_in: Float,
40
+ refresh_token: String
41
+ ).returns(T.attached_class)
42
+ end
43
+ def self.new(
44
+ # The issued access token.
45
+ access_token:,
46
+ # The type of token issued.
47
+ token_type:,
48
+ # The lifetime in seconds of the access token.
49
+ expires_in: nil,
50
+ # A refresh token for obtaining new access tokens. Issued for device_code and
51
+ # refresh_token grants.
52
+ refresh_token: nil
53
+ )
54
+ end
55
+
56
+ sig do
57
+ override.returns(
58
+ {
59
+ access_token: String,
60
+ token_type: Privy::OAuthTokenSuccessResponse::TokenType::OrSymbol,
61
+ expires_in: Float,
62
+ refresh_token: String
63
+ }
64
+ )
65
+ end
66
+ def to_hash
67
+ end
68
+
69
+ # The type of token issued.
70
+ module TokenType
71
+ extend Privy::Internal::Type::Enum
72
+
73
+ TaggedSymbol =
74
+ T.type_alias do
75
+ T.all(Symbol, Privy::OAuthTokenSuccessResponse::TokenType)
76
+ end
77
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
78
+
79
+ BEARER =
80
+ T.let(
81
+ :Bearer,
82
+ Privy::OAuthTokenSuccessResponse::TokenType::TaggedSymbol
83
+ )
84
+
85
+ sig do
86
+ override.returns(
87
+ T::Array[Privy::OAuthTokenSuccessResponse::TokenType::TaggedSymbol]
88
+ )
89
+ end
90
+ def self.values
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,39 @@
1
+ # typed: strong
2
+
3
+ module Privy
4
+ module Models
5
+ class OnrampSessionFees < Privy::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Privy::OnrampSessionFees, Privy::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T.nilable(String)) }
12
+ attr_accessor :network_fee_amount
13
+
14
+ sig { returns(T.nilable(String)) }
15
+ attr_accessor :transaction_fee_amount
16
+
17
+ # Fee breakdown for a Stripe onramp transaction.
18
+ sig do
19
+ params(
20
+ network_fee_amount: T.nilable(String),
21
+ transaction_fee_amount: T.nilable(String)
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(network_fee_amount:, transaction_fee_amount:)
25
+ end
26
+
27
+ sig do
28
+ override.returns(
29
+ {
30
+ network_fee_amount: T.nilable(String),
31
+ transaction_fee_amount: T.nilable(String)
32
+ }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,95 @@
1
+ # typed: strong
2
+
3
+ module Privy
4
+ module Models
5
+ class OnrampSessionTransactionDetails < Privy::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Privy::OnrampSessionTransactionDetails,
10
+ Privy::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(T.nilable(String)) }
15
+ attr_accessor :destination_amount
16
+
17
+ sig { returns(T.nilable(String)) }
18
+ attr_accessor :destination_currency
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_accessor :destination_network
22
+
23
+ # Fee breakdown for a Stripe onramp transaction.
24
+ sig { returns(Privy::OnrampSessionTransactionDetails::Fees) }
25
+ attr_reader :fees
26
+
27
+ sig do
28
+ params(fees: Privy::OnrampSessionTransactionDetails::Fees::OrHash).void
29
+ end
30
+ attr_writer :fees
31
+
32
+ sig { returns(T.nilable(String)) }
33
+ attr_accessor :source_amount
34
+
35
+ sig { returns(T.nilable(String)) }
36
+ attr_accessor :source_currency
37
+
38
+ # Transaction details returned from a Stripe onramp session.
39
+ sig do
40
+ params(
41
+ destination_amount: T.nilable(String),
42
+ destination_currency: T.nilable(String),
43
+ destination_network: T.nilable(String),
44
+ fees: Privy::OnrampSessionTransactionDetails::Fees::OrHash,
45
+ source_amount: T.nilable(String),
46
+ source_currency: T.nilable(String)
47
+ ).returns(T.attached_class)
48
+ end
49
+ def self.new(
50
+ destination_amount:,
51
+ destination_currency:,
52
+ destination_network:,
53
+ # Fee breakdown for a Stripe onramp transaction.
54
+ fees:,
55
+ source_amount:,
56
+ source_currency:
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ destination_amount: T.nilable(String),
64
+ destination_currency: T.nilable(String),
65
+ destination_network: T.nilable(String),
66
+ fees: Privy::OnrampSessionTransactionDetails::Fees,
67
+ source_amount: T.nilable(String),
68
+ source_currency: T.nilable(String)
69
+ }
70
+ )
71
+ end
72
+ def to_hash
73
+ end
74
+
75
+ class Fees < Privy::Models::OnrampSessionFees
76
+ OrHash =
77
+ T.type_alias do
78
+ T.any(
79
+ Privy::OnrampSessionTransactionDetails::Fees,
80
+ Privy::Internal::AnyHash
81
+ )
82
+ end
83
+
84
+ # Fee breakdown for a Stripe onramp transaction.
85
+ sig { returns(T.attached_class) }
86
+ def self.new
87
+ end
88
+
89
+ sig { override.returns({}) }
90
+ def to_hash
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,7 @@
1
+ # typed: strong
2
+
3
+ module Privy
4
+ module Models
5
+ SolanaAddress = String
6
+ end
7
+ end
@@ -54,6 +54,32 @@ module Privy
54
54
  sig { params(destination_caip2: String).void }
55
55
  attr_writer :destination_caip2
56
56
 
57
+ # Estimated fee breakdown from the provider quote.
58
+ sig { returns(T.nilable(T::Array[Privy::FeeLineItem::Variants])) }
59
+ attr_reader :estimated_fees
60
+
61
+ sig do
62
+ params(
63
+ estimated_fees:
64
+ T::Array[
65
+ T.any(
66
+ Privy::RelayerFee::OrHash,
67
+ Privy::PrivyFee::OrHash,
68
+ Privy::DeveloperFee::OrHash
69
+ )
70
+ ]
71
+ ).void
72
+ end
73
+ attr_writer :estimated_fees
74
+
75
+ # Gas cost for a blockchain action. Includes both raw base-unit amount and a
76
+ # human-readable decimal string, plus the gas token symbol.
77
+ sig { returns(T.nilable(Privy::Gas)) }
78
+ attr_reader :estimated_gas
79
+
80
+ sig { params(estimated_gas: Privy::Gas::OrHash).void }
81
+ attr_writer :estimated_gas
82
+
57
83
  # A description of why a wallet action (or a step within a wallet action) failed.
58
84
  sig { returns(T.nilable(Privy::FailureReason)) }
59
85
  attr_reader :failure_reason
@@ -61,6 +87,32 @@ module Privy
61
87
  sig { params(failure_reason: Privy::FailureReason::OrHash).void }
62
88
  attr_writer :failure_reason
63
89
 
90
+ # Actual fees paid for the swap. Populated after on-chain confirmation.
91
+ sig { returns(T.nilable(T::Array[Privy::FeeLineItem::Variants])) }
92
+ attr_reader :fees
93
+
94
+ sig do
95
+ params(
96
+ fees:
97
+ T::Array[
98
+ T.any(
99
+ Privy::RelayerFee::OrHash,
100
+ Privy::PrivyFee::OrHash,
101
+ Privy::DeveloperFee::OrHash
102
+ )
103
+ ]
104
+ ).void
105
+ end
106
+ attr_writer :fees
107
+
108
+ # Gas cost for a blockchain action. Includes both raw base-unit amount and a
109
+ # human-readable decimal string, plus the gas token symbol.
110
+ sig { returns(T.nilable(Privy::Gas)) }
111
+ attr_reader :gas
112
+
113
+ sig { params(gas: Privy::Gas::OrHash).void }
114
+ attr_writer :gas
115
+
64
116
  # The steps of the wallet action. Only returned if `?include=steps` is provided.
65
117
  sig { returns(T.nilable(T::Array[Privy::WalletActionStep::Variants])) }
66
118
  attr_reader :steps
@@ -94,7 +146,25 @@ module Privy
94
146
  type: Privy::SwapActionResponse::Type::OrSymbol,
95
147
  wallet_id: String,
96
148
  destination_caip2: String,
149
+ estimated_fees:
150
+ T::Array[
151
+ T.any(
152
+ Privy::RelayerFee::OrHash,
153
+ Privy::PrivyFee::OrHash,
154
+ Privy::DeveloperFee::OrHash
155
+ )
156
+ ],
157
+ estimated_gas: Privy::Gas::OrHash,
97
158
  failure_reason: Privy::FailureReason::OrHash,
159
+ fees:
160
+ T::Array[
161
+ T.any(
162
+ Privy::RelayerFee::OrHash,
163
+ Privy::PrivyFee::OrHash,
164
+ Privy::DeveloperFee::OrHash
165
+ )
166
+ ],
167
+ gas: Privy::Gas::OrHash,
98
168
  steps:
99
169
  T::Array[
100
170
  T.any(
@@ -128,8 +198,18 @@ module Privy
128
198
  wallet_id:,
129
199
  # Destination chain CAIP-2 identifier. Present for cross-chain swaps.
130
200
  destination_caip2: nil,
201
+ # Estimated fee breakdown from the provider quote.
202
+ estimated_fees: nil,
203
+ # Gas cost for a blockchain action. Includes both raw base-unit amount and a
204
+ # human-readable decimal string, plus the gas token symbol.
205
+ estimated_gas: nil,
131
206
  # A description of why a wallet action (or a step within a wallet action) failed.
132
207
  failure_reason: nil,
208
+ # Actual fees paid for the swap. Populated after on-chain confirmation.
209
+ fees: nil,
210
+ # Gas cost for a blockchain action. Includes both raw base-unit amount and a
211
+ # human-readable decimal string, plus the gas token symbol.
212
+ gas: nil,
133
213
  # The steps of the wallet action. Only returned if `?include=steps` is provided.
134
214
  steps: nil
135
215
  )
@@ -149,7 +229,11 @@ module Privy
149
229
  type: Privy::SwapActionResponse::Type::TaggedSymbol,
150
230
  wallet_id: String,
151
231
  destination_caip2: String,
232
+ estimated_fees: T::Array[Privy::FeeLineItem::Variants],
233
+ estimated_gas: Privy::Gas,
152
234
  failure_reason: Privy::FailureReason,
235
+ fees: T::Array[Privy::FeeLineItem::Variants],
236
+ gas: Privy::Gas,
153
237
  steps: T::Array[Privy::WalletActionStep::Variants]
154
238
  }
155
239
  )
@@ -42,10 +42,10 @@ module Privy
42
42
 
43
43
  # Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted,
44
44
  # auto-slippage is used.
45
- sig { returns(T.nilable(Float)) }
45
+ sig { returns(T.nilable(Integer)) }
46
46
  attr_reader :slippage_bps
47
47
 
48
- sig { params(slippage_bps: Float).void }
48
+ sig { params(slippage_bps: Integer).void }
49
49
  attr_writer :slippage_bps
50
50
 
51
51
  # Input for requesting a token swap quote.
@@ -56,7 +56,7 @@ module Privy
56
56
  source: Privy::SwapSource::OrHash,
57
57
  amount_type: Privy::AmountType::OrSymbol,
58
58
  fee_configuration: Privy::FeeConfiguration::OrHash,
59
- slippage_bps: Float
59
+ slippage_bps: Integer
60
60
  ).returns(T.attached_class)
61
61
  end
62
62
  def self.new(
@@ -84,7 +84,7 @@ module Privy
84
84
  source: Privy::SwapSource,
85
85
  amount_type: Privy::AmountType::OrSymbol,
86
86
  fee_configuration: Privy::FeeConfiguration,
87
- slippage_bps: Float
87
+ slippage_bps: Integer
88
88
  }
89
89
  )
90
90
  end
@@ -16,7 +16,8 @@ module Privy
16
16
  sig { returns(String) }
17
17
  attr_accessor :est_output_amount
18
18
 
19
- # Estimated gas cost in base units of the native token.
19
+ # Estimated gas cost in base units of the native token. @deprecated For
20
+ # cross-chain swaps, use estimated_gas instead.
20
21
  sig { returns(String) }
21
22
  attr_accessor :gas_estimate
22
23
 
@@ -43,7 +44,7 @@ module Privy
43
44
  sig { params(destination_caip2: String).void }
44
45
  attr_writer :destination_caip2
45
46
 
46
- # Estimated fees in USD.
47
+ # Estimated fees for the swap. Only present for cross-chain swaps.
47
48
  sig { returns(T.nilable(T::Array[Privy::FeeLineItem::Variants])) }
48
49
  attr_reader :estimated_fees
49
50
 
@@ -61,6 +62,14 @@ module Privy
61
62
  end
62
63
  attr_writer :estimated_fees
63
64
 
65
+ # Gas cost for a blockchain action. Includes both raw base-unit amount and a
66
+ # human-readable decimal string, plus the gas token symbol.
67
+ sig { returns(T.nilable(Privy::Gas)) }
68
+ attr_reader :estimated_gas
69
+
70
+ sig { params(estimated_gas: Privy::Gas::OrHash).void }
71
+ attr_writer :estimated_gas
72
+
64
73
  # Quote expiry as Unix timestamp (seconds). Present for cross-chain quotes.
65
74
  sig { returns(T.nilable(Float)) }
66
75
  attr_reader :expires_at
@@ -87,6 +96,7 @@ module Privy
87
96
  Privy::DeveloperFee::OrHash
88
97
  )
89
98
  ],
99
+ estimated_gas: Privy::Gas::OrHash,
90
100
  expires_at: Float
91
101
  ).returns(T.attached_class)
92
102
  end
@@ -95,7 +105,8 @@ module Privy
95
105
  caip2:,
96
106
  # Estimated amount of output token in base units.
97
107
  est_output_amount:,
98
- # Estimated gas cost in base units of the native token.
108
+ # Estimated gas cost in base units of the native token. @deprecated For
109
+ # cross-chain swaps, use estimated_gas instead.
99
110
  gas_estimate:,
100
111
  # Amount of input token in base units.
101
112
  input_amount:,
@@ -107,8 +118,11 @@ module Privy
107
118
  output_token:,
108
119
  # Destination chain CAIP-2 identifier for cross-chain swaps.
109
120
  destination_caip2: nil,
110
- # Estimated fees in USD.
121
+ # Estimated fees for the swap. Only present for cross-chain swaps.
111
122
  estimated_fees: nil,
123
+ # Gas cost for a blockchain action. Includes both raw base-unit amount and a
124
+ # human-readable decimal string, plus the gas token symbol.
125
+ estimated_gas: nil,
112
126
  # Quote expiry as Unix timestamp (seconds). Present for cross-chain quotes.
113
127
  expires_at: nil
114
128
  )
@@ -126,6 +140,7 @@ module Privy
126
140
  output_token: String,
127
141
  destination_caip2: String,
128
142
  estimated_fees: T::Array[Privy::FeeLineItem::Variants],
143
+ estimated_gas: Privy::Gas,
129
144
  expires_at: Float
130
145
  }
131
146
  )
@@ -39,10 +39,10 @@ module Privy
39
39
  attr_writer :fee_configuration
40
40
 
41
41
  # Maximum slippage tolerance in basis points (e.g., 50 for 0.5%).
42
- sig { returns(T.nilable(Float)) }
42
+ sig { returns(T.nilable(Integer)) }
43
43
  attr_reader :slippage_bps
44
44
 
45
- sig { params(slippage_bps: Float).void }
45
+ sig { params(slippage_bps: Integer).void }
46
46
  attr_writer :slippage_bps
47
47
 
48
48
  # Input for executing a token swap.
@@ -53,7 +53,7 @@ module Privy
53
53
  source: Privy::SwapSource::OrHash,
54
54
  amount_type: Privy::AmountType::OrSymbol,
55
55
  fee_configuration: Privy::FeeConfiguration::OrHash,
56
- slippage_bps: Float
56
+ slippage_bps: Integer
57
57
  ).returns(T.attached_class)
58
58
  end
59
59
  def self.new(
@@ -80,7 +80,7 @@ module Privy
80
80
  source: Privy::SwapSource,
81
81
  amount_type: Privy::AmountType::OrSymbol,
82
82
  fee_configuration: Privy::FeeConfiguration,
83
- slippage_bps: Float
83
+ slippage_bps: Integer
84
84
  }
85
85
  )
86
86
  end