@onramper/onramper-react-native 1.0.1 → 1.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  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 +42 -24
  5. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK +0 -0
  6. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  7. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2535 -2513
  8. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  9. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +42 -24
  10. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  11. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +42 -24
  12. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK +0 -0
  13. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
  14. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2535 -2513
  15. package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/OnramperSDK.yml +2502 -2482
  16. package/ios/OnramperCheckoutBridge.swift +3 -1
  17. package/ios/OnramperSDKBridge.swift +39 -2
  18. package/lib/typescript/commonjs/src/index.d.ts +1 -1
  19. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  20. package/lib/typescript/commonjs/src/types.d.ts +19 -14
  21. package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
  22. package/lib/typescript/module/src/index.d.ts +1 -1
  23. package/lib/typescript/module/src/index.d.ts.map +1 -1
  24. package/lib/typescript/module/src/types.d.ts +19 -14
  25. package/lib/typescript/module/src/types.d.ts.map +1 -1
  26. package/package.json +2 -2
  27. package/src/index.ts +2 -1
  28. package/src/types.ts +50 -23
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [1.1.0]
6
+
7
+ Bundles `OnramperSDK@1.1.0`. The SDK is pre-adoption, so breaking changes ship within the 1.x line.
8
+
9
+ ### Changed (breaking)
10
+ - `QuoteResponse` is now success-only: `quoteId`, `ramp`, `rate`, `payout`, `paymentMethod`, `networkFee`, and `transactionFee` are non-optional, and `errors` / the `QuoteError` type are removed. `getCheckoutRequirements()` rejects with `OnramperError` (e.g. `quoteUnavailable`) when a quote can't be priced, rather than resolving with a partial quote.
11
+ - `CheckoutRequest.destination` is now required (was optional).
12
+
13
+ ### Added
14
+ - Phone **reverification**: a `reverification` member on the `CheckoutRequirement` union (`field`, `requiredRecencyDays`, `lastVerifiedAt`), surfaced through the existing OnramperID flow — the native button handles it automatically. `requirementSatisfied` reports each resolved requirement type.
15
+ - `amountLimitSatisfied` on the `amount_limit` requirement.
16
+ - `UserInfoField.satisfied` and the typed `UserInfoFieldType` union (was `string`).
17
+ - New `docs/TYPE_REFERENCE.md` consolidating every client-facing type.
18
+
19
+ ### Fixed
20
+ - `CheckoutRequirement` is now serialized by the native bridge in the flat `{ type, ...fields }` shape the TypeScript union declares (previously the Swift `Codable` nesting `{ type, requirement: {...} }` leaked through).
21
+
5
22
  ## [1.0.0] — 2026-05-20
6
23
 
7
24
  ### Added
package/README.md CHANGED
@@ -50,7 +50,7 @@ const { button, quote } = await client.getCheckoutRequirements({
50
50
 
51
51
  return (
52
52
  <View>
53
- <Text>Rate: {quote.rate ?? 'unavailable'}</Text>
53
+ <Text>Rate: {quote.rate}</Text>
54
54
  {button}
55
55
  </View>
56
56
  );
@@ -184,7 +184,7 @@ public struct CheckoutIntentRequest : Swift.Codable, Swift.Sendable {
184
184
  }
185
185
  public struct OnramperTransactionData : Swift.Codable, Swift.Sendable {
186
186
  public let source: Swift.String
187
- public var destination: Swift.String?
187
+ public var destination: Swift.String
188
188
  public let amount: Swift.Double
189
189
  public let type: OnramperSDK.TransactionType
190
190
  public let country: Swift.String?
@@ -192,7 +192,7 @@ public struct OnramperTransactionData : Swift.Codable, Swift.Sendable {
192
192
  public let paymentMethod: Swift.String
193
193
  public let wallet: OnramperSDK.WalletInfo
194
194
  #if compiler(>=5.3) && $NonescapableTypes
195
- public init(source: Swift.String, destination: Swift.String? = nil, amount: Swift.Double, type: OnramperSDK.TransactionType, country: Swift.String? = nil, subdivision: Swift.String? = nil, paymentMethod: Swift.String, wallet: OnramperSDK.WalletInfo)
195
+ public init(source: Swift.String, destination: Swift.String, amount: Swift.Double, type: OnramperSDK.TransactionType, country: Swift.String? = nil, subdivision: Swift.String? = nil, paymentMethod: Swift.String, wallet: OnramperSDK.WalletInfo)
196
196
  #endif
197
197
  public func encode(to encoder: any Swift.Encoder) throws
198
198
  public init(from decoder: any Swift.Decoder) throws
@@ -220,6 +220,7 @@ public enum CheckoutRequirementType : Swift.String, Swift.Codable, Swift.Sendabl
220
220
  case tos
221
221
  case amountLimit
222
222
  case userInfo
223
+ case reverification
223
224
  #if compiler(>=5.3) && $NonescapableTypes
224
225
  public init?(rawValue: Swift.String)
225
226
  #endif
@@ -268,12 +269,13 @@ public struct AmountLimitRequirement : Swift.Codable, Swift.Sendable, Swift.Equa
268
269
  public let providerId: Swift.String
269
270
  public let minAmountLimit: Swift.Double?
270
271
  public let maxAmountLimit: Swift.Double?
272
+ public let amountLimitSatisfied: Swift.Bool
271
273
  #if compiler(>=5.3) && $NonescapableTypes
272
- public init(providerId: Swift.String, minAmountLimit: Swift.Double? = nil, maxAmountLimit: Swift.Double? = nil)
274
+ public init(providerId: Swift.String, minAmountLimit: Swift.Double? = nil, maxAmountLimit: Swift.Double? = nil, amountLimitSatisfied: Swift.Bool)
273
275
  #endif
276
+ public init(from decoder: any Swift.Decoder) throws
274
277
  public static func == (a: OnramperSDK.AmountLimitRequirement, b: OnramperSDK.AmountLimitRequirement) -> Swift.Bool
275
278
  public func encode(to encoder: any Swift.Encoder) throws
276
- public init(from decoder: any Swift.Decoder) throws
277
279
  }
278
280
  public enum UserInfoFieldType : Swift.String, Swift.Codable, Swift.Sendable {
279
281
  case firstName
@@ -312,10 +314,34 @@ public struct UserInfoRequirement : Swift.Codable, Swift.Sendable, Swift.Equatab
312
314
  public func encode(to encoder: any Swift.Encoder) throws
313
315
  public init(from decoder: any Swift.Decoder) throws
314
316
  }
317
+ public enum ReverificationField : Swift.String, Swift.Codable, Swift.Sendable {
318
+ case email
319
+ case phone
320
+ #if compiler(>=5.3) && $NonescapableTypes
321
+ public init?(rawValue: Swift.String)
322
+ #endif
323
+ public typealias RawValue = Swift.String
324
+ public var rawValue: Swift.String {
325
+ get
326
+ }
327
+ }
328
+ public struct ReverificationRequirement : Swift.Codable, Swift.Sendable, Swift.Equatable {
329
+ public let providerId: Swift.String
330
+ public let field: OnramperSDK.ReverificationField
331
+ public let requiredRecencyDays: Swift.Int
332
+ public let lastVerifiedAt: Swift.String?
333
+ #if compiler(>=5.3) && $NonescapableTypes
334
+ public init(providerId: Swift.String, field: OnramperSDK.ReverificationField, requiredRecencyDays: Swift.Int, lastVerifiedAt: Swift.String? = nil)
335
+ #endif
336
+ public static func == (a: OnramperSDK.ReverificationRequirement, b: OnramperSDK.ReverificationRequirement) -> Swift.Bool
337
+ public func encode(to encoder: any Swift.Encoder) throws
338
+ public init(from decoder: any Swift.Decoder) throws
339
+ }
315
340
  public enum CheckoutRequirement : Swift.Sendable, Swift.Equatable {
316
341
  case tos(OnramperSDK.ToSRequirement)
317
342
  case amountLimit(OnramperSDK.AmountLimitRequirement)
318
343
  case userInfo(OnramperSDK.UserInfoRequirement)
344
+ case reverification(OnramperSDK.ReverificationRequirement)
319
345
  public var type: OnramperSDK.CheckoutRequirementType {
320
346
  get
321
347
  }
@@ -326,17 +352,16 @@ extension OnramperSDK.CheckoutRequirement : Swift.Codable {
326
352
  public func encode(to encoder: any Swift.Encoder) throws
327
353
  }
328
354
  public struct QuoteResponse : Swift.Codable, Swift.Sendable, Swift.Equatable {
329
- public let quoteId: Swift.String?
330
- public let ramp: Swift.String?
331
- public let rate: Swift.Double?
332
- public let networkFee: Swift.Double?
333
- public let transactionFee: Swift.Double?
334
- public let payout: Swift.Double?
335
- public let paymentMethod: Swift.String?
355
+ public let quoteId: Swift.String
356
+ public let ramp: Swift.String
357
+ public let rate: Swift.Double
358
+ public let payout: Swift.Double
359
+ public let paymentMethod: Swift.String
360
+ public let networkFee: Swift.Double
361
+ public let transactionFee: Swift.Double
336
362
  public let recommendations: [Swift.String]?
337
- public let errors: [OnramperSDK.QuoteError]?
338
363
  #if compiler(>=5.3) && $NonescapableTypes
339
- public init(quoteId: Swift.String? = nil, ramp: Swift.String? = nil, rate: Swift.Double? = nil, networkFee: Swift.Double? = nil, transactionFee: Swift.Double? = nil, payout: Swift.Double? = nil, paymentMethod: Swift.String? = nil, recommendations: [Swift.String]? = nil, errors: [OnramperSDK.QuoteError]? = nil)
364
+ public init(quoteId: Swift.String, ramp: Swift.String, rate: Swift.Double, payout: Swift.Double, paymentMethod: Swift.String, networkFee: Swift.Double, transactionFee: Swift.Double, recommendations: [Swift.String]? = nil)
340
365
  #endif
341
366
  public static func == (a: OnramperSDK.QuoteResponse, b: OnramperSDK.QuoteResponse) -> Swift.Bool
342
367
  public func encode(to encoder: any Swift.Encoder) throws
@@ -353,16 +378,6 @@ public enum TransactionType : Swift.String, Swift.Codable, Swift.Sendable {
353
378
  get
354
379
  }
355
380
  }
356
- public struct QuoteError : Swift.Codable, Swift.Sendable, Swift.Equatable {
357
- public let type: Swift.String?
358
- public let message: Swift.String?
359
- #if compiler(>=5.3) && $NonescapableTypes
360
- public init(type: Swift.String? = nil, message: Swift.String? = nil)
361
- #endif
362
- public static func == (a: OnramperSDK.QuoteError, b: OnramperSDK.QuoteError) -> Swift.Bool
363
- public func encode(to encoder: any Swift.Encoder) throws
364
- public init(from decoder: any Swift.Decoder) throws
365
- }
366
381
  public enum CheckoutPaymentType : Swift.String, Swift.Codable, Swift.Sendable {
367
382
  case applePay
368
383
  case revolutPay
@@ -385,7 +400,7 @@ public enum RenderType : Swift.String, Swift.Codable, Swift.Sendable {
385
400
  get
386
401
  }
387
402
  }
388
- @_hasMissingDesignatedInitializers @_Concurrency.MainActor final public class OnramperClient : Foundation.ObservableObject {
403
+ @_hasMissingDesignatedInitializers @_Concurrency.MainActor final public class OnramperClient : Combine.ObservableObject {
389
404
  @Combine.Published @_projectedValueProperty($state) @_Concurrency.MainActor final public var state: OnramperSDK.OnramperState {
390
405
  get
391
406
  }
@@ -530,6 +545,9 @@ extension OnramperSDK.CheckoutRequirementType : Swift.RawRepresentable {}
530
545
  extension OnramperSDK.UserInfoFieldType : Swift.Equatable {}
531
546
  extension OnramperSDK.UserInfoFieldType : Swift.Hashable {}
532
547
  extension OnramperSDK.UserInfoFieldType : Swift.RawRepresentable {}
548
+ extension OnramperSDK.ReverificationField : Swift.Equatable {}
549
+ extension OnramperSDK.ReverificationField : Swift.Hashable {}
550
+ extension OnramperSDK.ReverificationField : Swift.RawRepresentable {}
533
551
  extension OnramperSDK.TransactionType : Swift.Equatable {}
534
552
  extension OnramperSDK.TransactionType : Swift.Hashable {}
535
553
  extension OnramperSDK.TransactionType : Swift.RawRepresentable {}