@onramper/onramper-react-native 1.1.0 → 1.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 (56) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +2 -0
  3. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  4. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftinterface +28 -3
  5. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK +0 -0
  6. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/PrivacyInfo.xcprivacy +36 -0
  7. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/PrivacyInfo.xcprivacy +36 -0
  8. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  9. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2660 -2517
  10. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  11. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +28 -3
  12. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  13. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +28 -3
  14. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK +0 -0
  15. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK_OnramperSDK.bundle/PrivacyInfo.xcprivacy +36 -0
  16. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/PrivacyInfo.xcprivacy +36 -0
  17. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  18. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2660 -2517
  19. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/OnramperSDK.yml +2627 -2484
  20. package/ios/HybridOnramperNitro.swift +20 -4
  21. package/ios/OnramperCheckoutBridge.swift +33 -0
  22. package/lib/commonjs/OnramperClient.js +12 -2
  23. package/lib/commonjs/OnramperClient.js.map +1 -1
  24. package/lib/module/OnramperClient.js +12 -2
  25. package/lib/module/OnramperClient.js.map +1 -1
  26. package/lib/typescript/commonjs/src/OnramperClient.d.ts +12 -2
  27. package/lib/typescript/commonjs/src/OnramperClient.d.ts.map +1 -1
  28. package/lib/typescript/commonjs/src/index.d.ts +1 -1
  29. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  30. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts +1 -1
  31. package/lib/typescript/commonjs/src/specs/OnramperNitro.nitro.d.ts.map +1 -1
  32. package/lib/typescript/commonjs/src/types.d.ts +7 -0
  33. package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
  34. package/lib/typescript/module/src/OnramperCheckoutButtonView.d.ts +1 -1
  35. package/lib/typescript/module/src/OnramperCheckoutButtonView.d.ts.map +1 -1
  36. package/lib/typescript/module/src/OnramperClient.d.ts +14 -4
  37. package/lib/typescript/module/src/OnramperClient.d.ts.map +1 -1
  38. package/lib/typescript/module/src/OnramperNative.d.ts +1 -1
  39. package/lib/typescript/module/src/OnramperNative.d.ts.map +1 -1
  40. package/lib/typescript/module/src/events.d.ts +2 -2
  41. package/lib/typescript/module/src/events.d.ts.map +1 -1
  42. package/lib/typescript/module/src/index.d.ts +8 -8
  43. package/lib/typescript/module/src/index.d.ts.map +1 -1
  44. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts +1 -1
  45. package/lib/typescript/module/src/specs/OnramperNitro.nitro.d.ts.map +1 -1
  46. package/lib/typescript/module/src/types.d.ts +8 -1
  47. package/lib/typescript/module/src/types.d.ts.map +1 -1
  48. package/nitrogen/generated/ios/c++/HybridOnramperNitroSpecSwift.hpp +2 -2
  49. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec.swift +1 -1
  50. package/nitrogen/generated/ios/swift/HybridOnramperNitroSpec_cxx.swift +2 -2
  51. package/nitrogen/generated/shared/c++/HybridOnramperNitroSpec.hpp +1 -1
  52. package/package.json +3 -3
  53. package/src/OnramperClient.ts +17 -1
  54. package/src/index.ts +1 -0
  55. package/src/specs/OnramperNitro.nitro.ts +5 -2
  56. package/src/types.ts +25 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,42 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [1.2.0]
6
+
7
+ Bundles `OnramperSDK@1.2.0`.
8
+
9
+ ### Added
10
+
11
+ - Client-supplied **user-field prefill**. `getCheckoutRequirements()` accepts an optional third argument carrying values you already know about the user, and the OnramperID sign-in and additional-info screens arrive pre-populated instead of blank. New exported type: `OnramperUserPrefill` — `email`, `firstName`, `lastName`, `phoneNumber`, all optional; supply only what you know.
12
+
13
+ ```ts
14
+ const { button, quote } = await client.getCheckoutRequirements(request, style, {
15
+ firstName: 'Ada',
16
+ lastName: 'Lovelace',
17
+ phoneNumber: '+3712345678', // E.164
18
+ });
19
+ ```
20
+
21
+ Prefill is **best-effort and never blocks sign-in.** If it can't be applied, the login flow opens normally without it. No error surfaces to your app, and there is nothing to handle. Prefill values are never logged at any `logLevel`.
22
+
23
+ A prefilled phone number is always a *candidate*: the user still verifies it, and a number already verified on the account takes precedence.
24
+
25
+ **Supply `email` only when you are confident** it is the address the user will sign in with. It identifies which account the other values belong to, so it is not merely another prefilled value: when it matches the account that signs in, the remaining values may be applied automatically; when it does not match, the whole prefill is dropped — which is strictly worse than omitting `email`, where the values are still offered to the user for confirmation.
26
+
27
+ Prefill is enabled per integration. Talk to your Onramper representative before relying on it — without it enabled, sign-in simply proceeds without prefill.
28
+
29
+ - Both example apps gained a prefill panel (a send/don't-send switch plus editable fields) so the flow can be exercised on device. `email` and `phoneNumber` start blank deliberately.
30
+
31
+ ### Changed
32
+
33
+ - `getCheckoutRequirements(request, buttonStyle?)` gains a trailing `prefill?` parameter and is now `getCheckoutRequirements(request, buttonStyle?, prefill?)`. Existing call sites are unaffected; no migration is required. (The Swift SDK places `prefill` before `buttonStyle`, where argument labels keep it non-breaking — JavaScript has no labels, so the wrapper appends it instead.)
34
+
35
+ ## [1.1.1]
36
+ Minor version bundling security enhancements from Onramper iOS SDK v1.1.1
37
+
38
+ ### Changed (breaking)
39
+ - All clients should upgrade to this version. This version includes a new security paradigm for backend communications that is required.
40
+
5
41
  ## [1.1.0]
6
42
 
7
43
  Bundles `OnramperSDK@1.1.0`. The SDK is pre-adoption, so breaking changes ship within the 1.x line.
package/README.md CHANGED
@@ -58,6 +58,8 @@ return (
58
58
 
59
59
  The button renders natively and presents login + payment sheets internally. ToS is rendered inside the button view.
60
60
 
61
+ Already know the user? Pass a third `prefill` argument (`email`, `firstName`, `lastName`, `phoneNumber` — all optional) to have the OnramperID screens arrive pre-populated. It's best-effort and never blocks sign-in. See [prefilling known user values](docs/GETTING_STARTED.md#prefilling-known-user-values) — note the caveat on `email` before supplying it.
62
+
61
63
  ## Checkout events
62
64
 
63
65
  The SwiftUI `OnramperCheckoutButton` does not expose external callback hooks; checkout outcomes flow via the module-level event stream:
@@ -119,11 +119,12 @@ extension OnramperSDK.OnramperDelegate {
119
119
  public struct CheckoutFinalizeRequest : Swift.Codable, Swift.Sendable {
120
120
  public let headlessCheckoutId: Swift.String
121
121
  public let quote: OnramperSDK.QuoteResponse
122
+ public let encryption: OnramperSDK.EncryptedPayload
122
123
  public let onramperTransactionData: OnramperSDK.OnramperTransactionData
123
124
  public var requirementCompletions: [OnramperSDK.RequirementCompletion]?
124
125
  public var partnerContext: Swift.String?
125
126
  #if compiler(>=5.3) && $NonescapableTypes
126
- public init(headlessCheckoutId: Swift.String, quote: OnramperSDK.QuoteResponse, onramperTransactionData: OnramperSDK.OnramperTransactionData, requirementCompletions: [OnramperSDK.RequirementCompletion]? = nil, partnerContext: Swift.String? = nil)
127
+ public init(headlessCheckoutId: Swift.String, quote: OnramperSDK.QuoteResponse, encryption: OnramperSDK.EncryptedPayload, onramperTransactionData: OnramperSDK.OnramperTransactionData, requirementCompletions: [OnramperSDK.RequirementCompletion]? = nil, partnerContext: Swift.String? = nil)
127
128
  #endif
128
129
  public func encode(to encoder: any Swift.Encoder) throws
129
130
  public init(from decoder: any Swift.Decoder) throws
@@ -210,9 +211,10 @@ public struct WalletInfo : Swift.Codable, Swift.Sendable, Swift.Equatable {
210
211
  }
211
212
  public struct CheckoutIntentResponse : Swift.Codable, Swift.Sendable {
212
213
  public let quote: OnramperSDK.QuoteResponse
214
+ public let encryption: OnramperSDK.EncryptedPayload
213
215
  public let headlessCheckoutId: Swift.String
214
216
  public let checkoutRequirements: [OnramperSDK.CheckoutRequirement]
215
- public init(quote: OnramperSDK.QuoteResponse, headlessCheckoutId: Swift.String, checkoutRequirements: [OnramperSDK.CheckoutRequirement])
217
+ public init(quote: OnramperSDK.QuoteResponse, encryption: OnramperSDK.EncryptedPayload, headlessCheckoutId: Swift.String, checkoutRequirements: [OnramperSDK.CheckoutRequirement])
216
218
  public init(from decoder: any Swift.Decoder) throws
217
219
  public func encode(to encoder: any Swift.Encoder) throws
218
220
  }
@@ -351,6 +353,27 @@ extension OnramperSDK.CheckoutRequirement : Swift.Codable {
351
353
  public init(from decoder: any Swift.Decoder) throws
352
354
  public func encode(to encoder: any Swift.Encoder) throws
353
355
  }
356
+ public struct EncryptedPayload : Swift.Codable, Swift.Sendable, Swift.Equatable {
357
+ public let v: Swift.Int
358
+ public let alg: Swift.String
359
+ public let iv: Swift.String
360
+ public let ciphertext: Swift.String
361
+ public let authTag: Swift.String
362
+ public init(v: Swift.Int, alg: Swift.String, iv: Swift.String, ciphertext: Swift.String, authTag: Swift.String)
363
+ public static func == (a: OnramperSDK.EncryptedPayload, b: OnramperSDK.EncryptedPayload) -> Swift.Bool
364
+ public func encode(to encoder: any Swift.Encoder) throws
365
+ public init(from decoder: any Swift.Decoder) throws
366
+ }
367
+ public struct OnramperUserPrefill : Swift.Sendable, Swift.Equatable {
368
+ public var email: Swift.String?
369
+ public var firstName: Swift.String?
370
+ public var lastName: Swift.String?
371
+ public var phoneNumber: Swift.String?
372
+ #if compiler(>=5.3) && $NonescapableTypes
373
+ public init(email: Swift.String? = nil, firstName: Swift.String? = nil, lastName: Swift.String? = nil, phoneNumber: Swift.String? = nil)
374
+ #endif
375
+ public static func == (a: OnramperSDK.OnramperUserPrefill, b: OnramperSDK.OnramperUserPrefill) -> Swift.Bool
376
+ }
354
377
  public struct QuoteResponse : Swift.Codable, Swift.Sendable, Swift.Equatable {
355
378
  public let quoteId: Swift.String
356
379
  public let ramp: Swift.String
@@ -437,7 +460,9 @@ public enum RenderType : Swift.String, Swift.Codable, Swift.Sendable {
437
460
  }
438
461
  @_Concurrency.MainActor convenience public init(configuration: OnramperSDK.OnramperConfiguration)
439
462
  @_Concurrency.MainActor final public func initialize(sessionId: Swift.String, sessionToken: Swift.String) async throws
440
- @_Concurrency.MainActor final public func getCheckoutRequirements(_ request: OnramperSDK.CheckoutIntentRequest, buttonStyle: OnramperSDK.CheckoutButtonStyle = CheckoutButtonStyle()) async throws -> OnramperSDK.CheckoutRequirementsResult
463
+ #if compiler(>=5.3) && $NonescapableTypes
464
+ @_Concurrency.MainActor final public func getCheckoutRequirements(_ request: OnramperSDK.CheckoutIntentRequest, prefill: OnramperSDK.OnramperUserPrefill? = nil, buttonStyle: OnramperSDK.CheckoutButtonStyle = CheckoutButtonStyle()) async throws -> OnramperSDK.CheckoutRequirementsResult
465
+ #endif
441
466
  @_Concurrency.MainActor final public func reset() async
442
467
  @_Concurrency.MainActor final public func signOut() async
443
468
  public typealias ObjectWillChangePublisher = Combine.ObservableObjectPublisher
@@ -16,6 +16,42 @@
16
16
  <key>NSPrivacyCollectedDataTypeTracking</key>
17
17
  <false/>
18
18
  </dict>
19
+ <dict>
20
+ <key>NSPrivacyCollectedDataType</key>
21
+ <string>NSPrivacyCollectedDataTypeEmailAddress</string>
22
+ <key>NSPrivacyCollectedDataTypePurposes</key>
23
+ <array>
24
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
25
+ </array>
26
+ <key>NSPrivacyCollectedDataTypeLinked</key>
27
+ <true/>
28
+ <key>NSPrivacyCollectedDataTypeTracking</key>
29
+ <false/>
30
+ </dict>
31
+ <dict>
32
+ <key>NSPrivacyCollectedDataType</key>
33
+ <string>NSPrivacyCollectedDataTypeName</string>
34
+ <key>NSPrivacyCollectedDataTypePurposes</key>
35
+ <array>
36
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
37
+ </array>
38
+ <key>NSPrivacyCollectedDataTypeLinked</key>
39
+ <true/>
40
+ <key>NSPrivacyCollectedDataTypeTracking</key>
41
+ <false/>
42
+ </dict>
43
+ <dict>
44
+ <key>NSPrivacyCollectedDataType</key>
45
+ <string>NSPrivacyCollectedDataTypePhoneNumber</string>
46
+ <key>NSPrivacyCollectedDataTypePurposes</key>
47
+ <array>
48
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
49
+ </array>
50
+ <key>NSPrivacyCollectedDataTypeLinked</key>
51
+ <true/>
52
+ <key>NSPrivacyCollectedDataTypeTracking</key>
53
+ <false/>
54
+ </dict>
19
55
  </array>
20
56
  <key>NSPrivacyAccessedAPITypes</key>
21
57
  <array/>
@@ -16,6 +16,42 @@
16
16
  <key>NSPrivacyCollectedDataTypeTracking</key>
17
17
  <false/>
18
18
  </dict>
19
+ <dict>
20
+ <key>NSPrivacyCollectedDataType</key>
21
+ <string>NSPrivacyCollectedDataTypeEmailAddress</string>
22
+ <key>NSPrivacyCollectedDataTypePurposes</key>
23
+ <array>
24
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
25
+ </array>
26
+ <key>NSPrivacyCollectedDataTypeLinked</key>
27
+ <true/>
28
+ <key>NSPrivacyCollectedDataTypeTracking</key>
29
+ <false/>
30
+ </dict>
31
+ <dict>
32
+ <key>NSPrivacyCollectedDataType</key>
33
+ <string>NSPrivacyCollectedDataTypeName</string>
34
+ <key>NSPrivacyCollectedDataTypePurposes</key>
35
+ <array>
36
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
37
+ </array>
38
+ <key>NSPrivacyCollectedDataTypeLinked</key>
39
+ <true/>
40
+ <key>NSPrivacyCollectedDataTypeTracking</key>
41
+ <false/>
42
+ </dict>
43
+ <dict>
44
+ <key>NSPrivacyCollectedDataType</key>
45
+ <string>NSPrivacyCollectedDataTypePhoneNumber</string>
46
+ <key>NSPrivacyCollectedDataTypePurposes</key>
47
+ <array>
48
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
49
+ </array>
50
+ <key>NSPrivacyCollectedDataTypeLinked</key>
51
+ <true/>
52
+ <key>NSPrivacyCollectedDataTypeTracking</key>
53
+ <false/>
54
+ </dict>
19
55
  </array>
20
56
  <key>NSPrivacyAccessedAPITypes</key>
21
57
  <array/>