@onramper/onramper-react-native 1.0.1 → 1.1.1
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.
- package/CHANGELOG.md +17 -0
- package/README.md +1 -1
- package/ios/Frameworks/OnramperSDK.xcframework/Info.plist +5 -5
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios.swiftinterface +57 -26
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/OnramperSDK.framework/OnramperSDK +0 -0
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2578 -2513
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +57 -26
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/Modules/OnramperSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +57 -26
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/OnramperSDK.framework/OnramperSDK +0 -0
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/DWARF/OnramperSDK +0 -0
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/OnramperSDK.yml +2578 -2513
- package/ios/Frameworks/OnramperSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/OnramperSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/OnramperSDK.yml +2545 -2482
- package/ios/OnramperCheckoutBridge.swift +3 -1
- package/ios/OnramperSDKBridge.swift +39 -2
- package/lib/typescript/commonjs/src/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types.d.ts +19 -14
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
- package/lib/typescript/module/src/OnramperCheckoutButtonView.d.ts +1 -1
- package/lib/typescript/module/src/OnramperCheckoutButtonView.d.ts.map +1 -1
- package/lib/typescript/module/src/OnramperClient.d.ts +3 -3
- package/lib/typescript/module/src/OnramperClient.d.ts.map +1 -1
- package/lib/typescript/module/src/OnramperNative.d.ts +1 -1
- package/lib/typescript/module/src/OnramperNative.d.ts.map +1 -1
- package/lib/typescript/module/src/events.d.ts +2 -2
- package/lib/typescript/module/src/events.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +8 -8
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/types.d.ts +20 -15
- package/lib/typescript/module/src/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +2 -1
- package/src/types.ts +50 -23
|
@@ -10,7 +10,9 @@ import SwiftUI
|
|
|
10
10
|
|
|
11
11
|
private struct CheckoutRequestJSON: Decodable {
|
|
12
12
|
let source: String
|
|
13
|
-
|
|
13
|
+
// Required — the SDK can't price a trade without it. Decoding throws (→
|
|
14
|
+
// invalidRequest) if absent; the TS `CheckoutRequest.destination` guarantees it.
|
|
15
|
+
let destination: String
|
|
14
16
|
let amount: Double
|
|
15
17
|
let type: String
|
|
16
18
|
let country: String?
|
|
@@ -91,6 +91,43 @@ extension CheckoutPaymentType {
|
|
|
91
91
|
var jsValue: String { rawValue } // "applepay" | "revolutpay"
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
// MARK: - Requirements → flat dict
|
|
95
|
+
|
|
96
|
+
// The TS layer expects each requirement flattened to `{ type, ...fields }`.
|
|
97
|
+
// Swift's `Codable` would instead nest under `{ type, requirement: {...} }`, so
|
|
98
|
+
// we map explicitly here. Nested `items`/`fields` reuse `codableToJSArray` since
|
|
99
|
+
// `ToSItem`/`UserInfoField` already encode to the flat shape the TS expects.
|
|
100
|
+
func requirementToJSDict(_ requirement: CheckoutRequirement) -> [String: Any] {
|
|
101
|
+
switch requirement {
|
|
102
|
+
case .tos(let r):
|
|
103
|
+
return ["type": "tos", "providerId": r.providerId, "items": codableToJSArray(r.items)]
|
|
104
|
+
case .amountLimit(let r):
|
|
105
|
+
var dict: [String: Any] = [
|
|
106
|
+
"type": "amount_limit",
|
|
107
|
+
"providerId": r.providerId,
|
|
108
|
+
"amountLimitSatisfied": r.amountLimitSatisfied,
|
|
109
|
+
]
|
|
110
|
+
if let min = r.minAmountLimit { dict["minAmountLimit"] = min }
|
|
111
|
+
if let max = r.maxAmountLimit { dict["maxAmountLimit"] = max }
|
|
112
|
+
return dict
|
|
113
|
+
case .userInfo(let r):
|
|
114
|
+
return ["type": "user_info", "providerId": r.providerId, "fields": codableToJSArray(r.fields)]
|
|
115
|
+
case .reverification(let r):
|
|
116
|
+
var dict: [String: Any] = [
|
|
117
|
+
"type": "reverification",
|
|
118
|
+
"providerId": r.providerId,
|
|
119
|
+
"field": r.field.rawValue,
|
|
120
|
+
"requiredRecencyDays": r.requiredRecencyDays,
|
|
121
|
+
]
|
|
122
|
+
if let last = r.lastVerifiedAt { dict["lastVerifiedAt"] = last }
|
|
123
|
+
return dict
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
func requirementsToJSArray(_ requirements: [CheckoutRequirement]) -> [Any] {
|
|
128
|
+
requirements.map { requirementToJSDict($0) }
|
|
129
|
+
}
|
|
130
|
+
|
|
94
131
|
// MARK: - State → dict
|
|
95
132
|
|
|
96
133
|
extension OnramperState {
|
|
@@ -101,7 +138,7 @@ extension OnramperState {
|
|
|
101
138
|
case .ready: return ["kind": "ready"]
|
|
102
139
|
case .checkoutPreparing: return ["kind": "checkoutPreparing"]
|
|
103
140
|
case .requireLogin(let requirements):
|
|
104
|
-
return ["kind": "requireLogin", "requirements":
|
|
141
|
+
return ["kind": "requireLogin", "requirements": requirementsToJSArray(requirements)]
|
|
105
142
|
case .authenticating: return ["kind": "authenticating"]
|
|
106
143
|
case .readyToCheckout: return ["kind": "readyToCheckout"]
|
|
107
144
|
case .finalizing: return ["kind": "finalizing"]
|
|
@@ -129,7 +166,7 @@ extension CheckoutEvent {
|
|
|
129
166
|
case .checkoutStarted(let intentId):
|
|
130
167
|
return ["type": "checkoutStarted", "intentId": intentId]
|
|
131
168
|
case .loginRequired(let requirements):
|
|
132
|
-
return ["type": "loginRequired", "requirements":
|
|
169
|
+
return ["type": "loginRequired", "requirements": requirementsToJSArray(requirements)]
|
|
133
170
|
case .readyToCheckout:
|
|
134
171
|
return ["type": "readyToCheckout"]
|
|
135
172
|
case .requirementSatisfied(let kind):
|
|
@@ -4,6 +4,6 @@ export { OnramperCheckoutButtonView } from './OnramperCheckoutButtonView';
|
|
|
4
4
|
export type { OnramperCheckoutButtonViewProps } from './OnramperCheckoutButtonView';
|
|
5
5
|
export { OnramperError } from './errors';
|
|
6
6
|
export type { OnramperErrorCode, OnramperErrorPayload } from './errors';
|
|
7
|
-
export type { CheckoutButtonStyle, CheckoutFinalizeResponse, CheckoutRequest, CheckoutPaymentType, CheckoutRequirement, HeadlessCheckoutData, OnramperConfiguration, OnramperEnvironment, OnramperLogLevel, OnramperState, OnramperTheme,
|
|
7
|
+
export type { CheckoutButtonStyle, CheckoutFinalizeResponse, CheckoutRequest, CheckoutPaymentType, CheckoutRequirement, HeadlessCheckoutData, OnramperConfiguration, OnramperEnvironment, OnramperLogLevel, OnramperState, OnramperTheme, QuoteResponse, RenderType, ReverificationField, SessionCredentials, ToSItem, TransactionType, UserInfoField, UserInfoFieldType, WalletInfo, } from './types';
|
|
8
8
|
export type { CheckoutEvent, EventName, EventPayload } from './events';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,YAAY,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACxE,YAAY,EACV,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,YAAY,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACxE,YAAY,EACV,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,OAAO,EACP,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -30,7 +30,7 @@ export interface WalletInfo {
|
|
|
30
30
|
}
|
|
31
31
|
export interface CheckoutRequest {
|
|
32
32
|
source: string;
|
|
33
|
-
destination
|
|
33
|
+
destination: string;
|
|
34
34
|
amount: number;
|
|
35
35
|
type: TransactionType;
|
|
36
36
|
country?: string;
|
|
@@ -40,19 +40,14 @@ export interface CheckoutRequest {
|
|
|
40
40
|
onlyOnramps?: string[];
|
|
41
41
|
}
|
|
42
42
|
export interface QuoteResponse {
|
|
43
|
-
quoteId
|
|
44
|
-
ramp
|
|
45
|
-
rate
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
quoteId: string;
|
|
44
|
+
ramp: string;
|
|
45
|
+
rate: number;
|
|
46
|
+
payout: number;
|
|
47
|
+
paymentMethod: string;
|
|
48
|
+
networkFee: number;
|
|
49
|
+
transactionFee: number;
|
|
50
50
|
recommendations?: string[];
|
|
51
|
-
errors?: QuoteError[];
|
|
52
|
-
}
|
|
53
|
-
export interface QuoteError {
|
|
54
|
-
type: string;
|
|
55
|
-
message: string;
|
|
56
51
|
}
|
|
57
52
|
export interface CheckoutButtonStyle {
|
|
58
53
|
backgroundColor?: string;
|
|
@@ -79,10 +74,17 @@ export type CheckoutRequirement = {
|
|
|
79
74
|
providerId: string;
|
|
80
75
|
minAmountLimit?: number;
|
|
81
76
|
maxAmountLimit?: number;
|
|
77
|
+
amountLimitSatisfied: boolean;
|
|
82
78
|
} | {
|
|
83
79
|
type: 'user_info';
|
|
84
80
|
providerId: string;
|
|
85
81
|
fields: UserInfoField[];
|
|
82
|
+
} | {
|
|
83
|
+
type: 'reverification';
|
|
84
|
+
providerId: string;
|
|
85
|
+
field: ReverificationField;
|
|
86
|
+
requiredRecencyDays: number;
|
|
87
|
+
lastVerifiedAt?: string;
|
|
86
88
|
};
|
|
87
89
|
export interface ToSItem {
|
|
88
90
|
type: 'tos' | 'privacy_policy' | 'user_agreement';
|
|
@@ -91,10 +93,13 @@ export interface ToSItem {
|
|
|
91
93
|
url?: string;
|
|
92
94
|
content?: string;
|
|
93
95
|
}
|
|
96
|
+
export type UserInfoFieldType = 'first_name' | 'last_name' | 'email' | 'email_verification' | 'phone_number' | 'phone_verification' | 'ssn_last_four' | 'address';
|
|
94
97
|
export interface UserInfoField {
|
|
95
|
-
type:
|
|
98
|
+
type: UserInfoFieldType;
|
|
96
99
|
required: boolean;
|
|
100
|
+
satisfied: boolean;
|
|
97
101
|
}
|
|
102
|
+
export type ReverificationField = 'email' | 'phone';
|
|
98
103
|
export type OnramperState = {
|
|
99
104
|
kind: 'idle';
|
|
100
105
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,YAAY,CAAC;AAC/D,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAA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G,OAAO,CAAC;AAEpD,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,YAAY,EAAE,mBAAmB,EAAE,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAC3B;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,mBAAmB,CAAA;CAAE,GAC5F;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAEpD,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OnramperCheckoutButtonMethods, OnramperCheckoutButtonProps } from './specs/OnramperCheckoutButton.nitro';
|
|
1
|
+
import type { OnramperCheckoutButtonMethods, OnramperCheckoutButtonProps } from './specs/OnramperCheckoutButton.nitro.js';
|
|
2
2
|
export type { OnramperCheckoutButtonProps as OnramperCheckoutButtonViewProps };
|
|
3
3
|
/**
|
|
4
4
|
* Native checkout button. Renders the SwiftUI `OnramperCheckoutButton` that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnramperCheckoutButtonView.d.ts","sourceRoot":"","sources":["../../../../src/OnramperCheckoutButtonView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OnramperCheckoutButtonView.d.ts","sourceRoot":"","sources":["../../../../src/OnramperCheckoutButtonView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,MAAM,yCAAsC,CAAC;AAEvH,YAAY,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,CAAC;AAE/E;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,kHAGtC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
|
-
import { OnramperError } from './errors';
|
|
3
|
-
import type { EventName, EventPayload } from './events';
|
|
4
|
-
import type { CheckoutButtonStyle, CheckoutRequest, OnramperConfiguration, OnramperState, QuoteResponse, SessionCredentials } from './types';
|
|
2
|
+
import { OnramperError } from './errors.js';
|
|
3
|
+
import type { EventName, EventPayload } from './events.js';
|
|
4
|
+
import type { CheckoutButtonStyle, CheckoutRequest, OnramperConfiguration, OnramperState, QuoteResponse, SessionCredentials } from './types.js';
|
|
5
5
|
export interface GetCheckoutRequirementsResult {
|
|
6
6
|
/** A native checkout button element to render. Tapping it drives login, finalize, and the payment webview internally. */
|
|
7
7
|
button: ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnramperClient.d.ts","sourceRoot":"","sources":["../../../../src/OnramperClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,OAAO,CAAC;AAIzD,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OnramperClient.d.ts","sourceRoot":"","sources":["../../../../src/OnramperClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,OAAO,CAAC;AAIzD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAU,CAAC;AACzC,OAAO,KAAK,EAAiB,SAAS,EAAE,YAAY,EAAE,MAAM,aAAU,CAAC;AACvE,OA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;CAKhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OnramperNitro } from './specs/OnramperNitro.nitro';
|
|
1
|
+
import type { OnramperNitro } from './specs/OnramperNitro.nitro.js';
|
|
2
2
|
/**
|
|
3
3
|
* Creates a fresh native Onramper Nitro hybrid object. Each `OnramperClient`
|
|
4
4
|
* owns its own instance, so its listeners and the underlying SDK client are
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnramperNative.d.ts","sourceRoot":"","sources":["../../../../src/OnramperNative.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OnramperNative.d.ts","sourceRoot":"","sources":["../../../../src/OnramperNative.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAA6B,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,CAOpD;AAED,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OnramperErrorPayload } from './errors';
|
|
2
|
-
import type { CheckoutFinalizeResponse, CheckoutRequirement, OnramperState, RenderType } from './types';
|
|
1
|
+
import type { OnramperErrorPayload } from './errors.js';
|
|
2
|
+
import type { CheckoutFinalizeResponse, CheckoutRequirement, OnramperState, RenderType } from './types.js';
|
|
3
3
|
export type CheckoutEvent = {
|
|
4
4
|
type: 'stateChanged';
|
|
5
5
|
state: OnramperState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAU,CAAC;AACrD,OAAO,KA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AE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { OnramperClient } from './OnramperClient';
|
|
2
|
-
export type { GetCheckoutRequirementsResult } from './OnramperClient';
|
|
3
|
-
export { OnramperCheckoutButtonView } from './OnramperCheckoutButtonView';
|
|
4
|
-
export type { OnramperCheckoutButtonViewProps } from './OnramperCheckoutButtonView';
|
|
5
|
-
export { OnramperError } from './errors';
|
|
6
|
-
export type { OnramperErrorCode, OnramperErrorPayload } from './errors';
|
|
7
|
-
export type { CheckoutButtonStyle, CheckoutFinalizeResponse, CheckoutRequest, CheckoutPaymentType, CheckoutRequirement, HeadlessCheckoutData, OnramperConfiguration, OnramperEnvironment, OnramperLogLevel, OnramperState, OnramperTheme,
|
|
8
|
-
export type { CheckoutEvent, EventName, EventPayload } from './events';
|
|
1
|
+
export { OnramperClient } from './OnramperClient.js';
|
|
2
|
+
export type { GetCheckoutRequirementsResult } from './OnramperClient.js';
|
|
3
|
+
export { OnramperCheckoutButtonView } from './OnramperCheckoutButtonView.js';
|
|
4
|
+
export type { OnramperCheckoutButtonViewProps } from './OnramperCheckoutButtonView.js';
|
|
5
|
+
export { OnramperError } from './errors.js';
|
|
6
|
+
export type { OnramperErrorCode, OnramperErrorPayload } from './errors.js';
|
|
7
|
+
export type { CheckoutButtonStyle, CheckoutFinalizeResponse, CheckoutRequest, CheckoutPaymentType, CheckoutRequirement, HeadlessCheckoutData, OnramperConfiguration, OnramperEnvironment, OnramperLogLevel, OnramperState, OnramperTheme, QuoteResponse, RenderType, ReverificationField, SessionCredentials, ToSItem, TransactionType, UserInfoField, UserInfoFieldType, WalletInfo, } from './types.js';
|
|
8
|
+
export type { CheckoutEvent, EventName, EventPayload } from './events.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAkB,CAAC;AAClD,YAAY,EAAE,6BAA6B,EAAE,MAAM,qBAAkB,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAA8B,CAAC;AAC1E,YAAY,EAAE,+BAA+B,EAAE,MAAM,iCAA8B,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAU,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAU,CAAC;AACxE,YAAY,EACV,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,OAAO,EACP,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,UAAU,GACX,MAAM,YAAS,CAAC;AACjB,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OnramperErrorPayload } from './errors';
|
|
1
|
+
import type { OnramperErrorPayload } from './errors.js';
|
|
2
2
|
export type OnramperEnvironment = 'development' | 'production';
|
|
3
3
|
export type OnramperLogLevel = 'off' | 'error' | 'info' | 'debug';
|
|
4
4
|
export type OnramperTheme = 'system' | 'light' | 'dark';
|
|
@@ -30,7 +30,7 @@ export interface WalletInfo {
|
|
|
30
30
|
}
|
|
31
31
|
export interface CheckoutRequest {
|
|
32
32
|
source: string;
|
|
33
|
-
destination
|
|
33
|
+
destination: string;
|
|
34
34
|
amount: number;
|
|
35
35
|
type: TransactionType;
|
|
36
36
|
country?: string;
|
|
@@ -40,19 +40,14 @@ export interface CheckoutRequest {
|
|
|
40
40
|
onlyOnramps?: string[];
|
|
41
41
|
}
|
|
42
42
|
export interface QuoteResponse {
|
|
43
|
-
quoteId
|
|
44
|
-
ramp
|
|
45
|
-
rate
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
quoteId: string;
|
|
44
|
+
ramp: string;
|
|
45
|
+
rate: number;
|
|
46
|
+
payout: number;
|
|
47
|
+
paymentMethod: string;
|
|
48
|
+
networkFee: number;
|
|
49
|
+
transactionFee: number;
|
|
50
50
|
recommendations?: string[];
|
|
51
|
-
errors?: QuoteError[];
|
|
52
|
-
}
|
|
53
|
-
export interface QuoteError {
|
|
54
|
-
type: string;
|
|
55
|
-
message: string;
|
|
56
51
|
}
|
|
57
52
|
export interface CheckoutButtonStyle {
|
|
58
53
|
backgroundColor?: string;
|
|
@@ -79,10 +74,17 @@ export type CheckoutRequirement = {
|
|
|
79
74
|
providerId: string;
|
|
80
75
|
minAmountLimit?: number;
|
|
81
76
|
maxAmountLimit?: number;
|
|
77
|
+
amountLimitSatisfied: boolean;
|
|
82
78
|
} | {
|
|
83
79
|
type: 'user_info';
|
|
84
80
|
providerId: string;
|
|
85
81
|
fields: UserInfoField[];
|
|
82
|
+
} | {
|
|
83
|
+
type: 'reverification';
|
|
84
|
+
providerId: string;
|
|
85
|
+
field: ReverificationField;
|
|
86
|
+
requiredRecencyDays: number;
|
|
87
|
+
lastVerifiedAt?: string;
|
|
86
88
|
};
|
|
87
89
|
export interface ToSItem {
|
|
88
90
|
type: 'tos' | 'privacy_policy' | 'user_agreement';
|
|
@@ -91,10 +93,13 @@ export interface ToSItem {
|
|
|
91
93
|
url?: string;
|
|
92
94
|
content?: string;
|
|
93
95
|
}
|
|
96
|
+
export type UserInfoFieldType = 'first_name' | 'last_name' | 'email' | 'email_verification' | 'phone_number' | 'phone_verification' | 'ssn_last_four' | 'address';
|
|
94
97
|
export interface UserInfoField {
|
|
95
|
-
type:
|
|
98
|
+
type: UserInfoFieldType;
|
|
96
99
|
required: boolean;
|
|
100
|
+
satisfied: boolean;
|
|
97
101
|
}
|
|
102
|
+
export type ReverificationField = 'email' | 'phone';
|
|
98
103
|
export type OnramperState = {
|
|
99
104
|
kind: 'idle';
|
|
100
105
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAU,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,YAAY,CAAC;AAC/D,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC1E;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE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,CAAC;IAAC,YAAY,EAAE,mBAAmB,EAAE,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAC3B;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,mBAAmB,CAAA;CAAE,GAC5F;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAEpD,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onramper/onramper-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "React Native wrapper for the Onramper iOS SDK",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"license": "Apache-2.0",
|
|
65
65
|
"homepage": "https://github.com/onramper/onramper-react-native#readme",
|
|
66
66
|
"onramperSDK": {
|
|
67
|
-
"checksum": "
|
|
67
|
+
"checksum": "88235fa50561422ba3276f8008ff0a2229cff760f75f36f3f424ff5f26e2b2e2"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": ">=19.0.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"nitrogen": "^0.35.9",
|
|
81
81
|
"react": "19.2.3",
|
|
82
82
|
"react-native": "0.85.3",
|
|
83
|
-
"react-native-builder-bob": "^0.
|
|
83
|
+
"react-native-builder-bob": "^0.43.0",
|
|
84
84
|
"react-native-nitro-modules": "^0.35.9",
|
|
85
85
|
"ts-jest": "^29.4.10",
|
|
86
86
|
"typescript": "~5.8.3"
|
package/src/index.ts
CHANGED
|
@@ -18,13 +18,14 @@ export type {
|
|
|
18
18
|
OnramperLogLevel,
|
|
19
19
|
OnramperState,
|
|
20
20
|
OnramperTheme,
|
|
21
|
-
QuoteError,
|
|
22
21
|
QuoteResponse,
|
|
23
22
|
RenderType,
|
|
23
|
+
ReverificationField,
|
|
24
24
|
SessionCredentials,
|
|
25
25
|
ToSItem,
|
|
26
26
|
TransactionType,
|
|
27
27
|
UserInfoField,
|
|
28
|
+
UserInfoFieldType,
|
|
28
29
|
WalletInfo,
|
|
29
30
|
} from './types';
|
|
30
31
|
export type { CheckoutEvent, EventName, EventPayload } from './events';
|
package/src/types.ts
CHANGED
|
@@ -42,7 +42,7 @@ export interface WalletInfo {
|
|
|
42
42
|
// `country`, `subdivision`) are lowercased by the SDK; pass either case.
|
|
43
43
|
export interface CheckoutRequest {
|
|
44
44
|
source: string;
|
|
45
|
-
destination
|
|
45
|
+
destination: string;
|
|
46
46
|
amount: number;
|
|
47
47
|
type: TransactionType;
|
|
48
48
|
country?: string;
|
|
@@ -52,24 +52,21 @@ export interface CheckoutRequest {
|
|
|
52
52
|
onlyOnramps?: string[];
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
// Mirrors Swift QuoteResponse
|
|
56
|
-
//
|
|
57
|
-
//
|
|
55
|
+
// Mirrors Swift `QuoteResponse`. The Onramper backend only returns a
|
|
56
|
+
// *successful* quote: a request that can't be priced fails with an
|
|
57
|
+
// `OnramperError` (e.g. `quoteUnavailable`) rather than a partial quote. So the
|
|
58
|
+
// core pricing fields are always present — integrators don't null-check them.
|
|
59
|
+
// `networkFee` and `transactionFee` are present too; `recommendations` is
|
|
60
|
+
// optional metadata.
|
|
58
61
|
export interface QuoteResponse {
|
|
59
|
-
quoteId
|
|
60
|
-
ramp
|
|
61
|
-
rate
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
quoteId: string;
|
|
63
|
+
ramp: string;
|
|
64
|
+
rate: number;
|
|
65
|
+
payout: number;
|
|
66
|
+
paymentMethod: string;
|
|
67
|
+
networkFee: number;
|
|
68
|
+
transactionFee: number;
|
|
66
69
|
recommendations?: string[];
|
|
67
|
-
errors?: QuoteError[];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface QuoteError {
|
|
71
|
-
type: string;
|
|
72
|
-
message: string;
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
export interface CheckoutButtonStyle {
|
|
@@ -96,12 +93,27 @@ export interface CheckoutFinalizeResponse {
|
|
|
96
93
|
headlessCheckoutData: HeadlessCheckoutData;
|
|
97
94
|
}
|
|
98
95
|
|
|
99
|
-
// Checkout requirements surfaced by the
|
|
100
|
-
// Shape mirrors Sources/OnramperSDK/Models/CheckoutIntentResponse.swift.
|
|
96
|
+
// Checkout requirements surfaced by the Onramper backend and bridged through JSON.
|
|
97
|
+
// Shape mirrors Sources/OnramperSDK/Models/CheckoutIntentResponse.swift. The
|
|
98
|
+
// native bridge flattens each requirement to `{ type, ...fields }` (the Swift
|
|
99
|
+
// wire shape is `{ type, requirement: {...} }`).
|
|
101
100
|
export type CheckoutRequirement =
|
|
102
101
|
| { type: 'tos'; providerId: string; items: ToSItem[] }
|
|
103
|
-
| {
|
|
104
|
-
|
|
102
|
+
| {
|
|
103
|
+
type: 'amount_limit';
|
|
104
|
+
providerId: string;
|
|
105
|
+
minAmountLimit?: number;
|
|
106
|
+
maxAmountLimit?: number;
|
|
107
|
+
amountLimitSatisfied: boolean;
|
|
108
|
+
}
|
|
109
|
+
| { type: 'user_info'; providerId: string; fields: UserInfoField[] }
|
|
110
|
+
| {
|
|
111
|
+
type: 'reverification';
|
|
112
|
+
providerId: string;
|
|
113
|
+
field: ReverificationField;
|
|
114
|
+
requiredRecencyDays: number;
|
|
115
|
+
lastVerifiedAt?: string;
|
|
116
|
+
};
|
|
105
117
|
|
|
106
118
|
export interface ToSItem {
|
|
107
119
|
type: 'tos' | 'privacy_policy' | 'user_agreement';
|
|
@@ -111,12 +123,27 @@ export interface ToSItem {
|
|
|
111
123
|
content?: string;
|
|
112
124
|
}
|
|
113
125
|
|
|
126
|
+
// Mirrors Swift `UserInfoFieldType` raw values.
|
|
127
|
+
export type UserInfoFieldType =
|
|
128
|
+
| 'first_name'
|
|
129
|
+
| 'last_name'
|
|
130
|
+
| 'email'
|
|
131
|
+
| 'email_verification'
|
|
132
|
+
| 'phone_number'
|
|
133
|
+
| 'phone_verification'
|
|
134
|
+
| 'ssn_last_four'
|
|
135
|
+
| 'address';
|
|
136
|
+
|
|
114
137
|
export interface UserInfoField {
|
|
115
|
-
type:
|
|
138
|
+
type: UserInfoFieldType;
|
|
116
139
|
required: boolean;
|
|
117
|
-
|
|
140
|
+
satisfied: boolean;
|
|
118
141
|
}
|
|
119
142
|
|
|
143
|
+
// Mirrors Swift `ReverificationField`. The SDK only drives a client flow for
|
|
144
|
+
// `phone` today; `email` is decoded but has no re-verify UI.
|
|
145
|
+
export type ReverificationField = 'email' | 'phone';
|
|
146
|
+
|
|
120
147
|
export type OnramperState =
|
|
121
148
|
| { kind: 'idle' }
|
|
122
149
|
| { kind: 'initializing' }
|