@coinflowlabs/vue 1.18.0 → 1.19.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.
- package/dist/coinflow-vue.js +7792 -7678
- package/dist/coinflow-vue.umd.cjs +16 -16
- package/dist/components/CoinflowIframe.vue.d.ts +1 -1
- package/dist/components/CoinflowPurchase.vue.d.ts +30 -1
- package/dist/components/CoinflowWithdraw.vue.d.ts +12 -1
- package/dist/components/mobile-wallet/MobileWalletButton.vue.d.ts +110 -2
- package/dist/lib/common/CoinflowLibMessageHandlers.d.ts +8 -3
- package/dist/lib/common/CoinflowTypes.d.ts +60 -4
- package/dist/lib/common/CoinflowUtils.d.ts +1 -1
- package/dist/lib/common/card-form/cardFieldValidationError.d.ts +50 -0
- package/dist/lib/common/index.d.ts +6 -0
- package/dist/lib/common/plaidLinkTokenCache.d.ts +34 -0
- package/dist/lib/common/types/flightTicketCartItem.d.ts +49 -0
- package/dist/lib/common/types/flightUpgradeCartItem.d.ts +49 -0
- package/dist/lib/common/types/lodgingCartItem.d.ts +37 -0
- package/dist/lib/common/types/travelCartItem.d.ts +212 -0
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
10
10
|
}, {
|
|
11
11
|
sendMessage(message: string): void;
|
|
12
12
|
handleIframeMessages({ data, origin }: {
|
|
13
|
-
data:
|
|
13
|
+
data: unknown;
|
|
14
14
|
origin: string;
|
|
15
15
|
}): void;
|
|
16
16
|
listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
|
|
@@ -24,10 +24,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
24
24
|
};
|
|
25
25
|
redemptionCheck?: boolean;
|
|
26
26
|
subtotal?: import('..').Subtotal;
|
|
27
|
+
useNativeSubtotal?: boolean;
|
|
27
28
|
presentment?: import('..').Currency;
|
|
28
29
|
onSuccess?: import('..').OnSuccessMethod;
|
|
29
30
|
sessionKey?: string;
|
|
30
31
|
onAuthDeclined?: import('..').OnAuthDeclinedMethod;
|
|
32
|
+
onInputError?: import('..').OnInputErrorMethod;
|
|
33
|
+
onInputValid?: import('..').OnInputValidMethod;
|
|
31
34
|
webhookInfo?: {
|
|
32
35
|
[key: string]: any;
|
|
33
36
|
};
|
|
@@ -63,9 +66,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
63
66
|
wallet?: undefined;
|
|
64
67
|
blockchain?: import('..').CoinflowBlockchain | undefined;
|
|
65
68
|
subtotal?: import('..').Subtotal;
|
|
69
|
+
useNativeSubtotal?: boolean;
|
|
66
70
|
presentment?: import('..').Currency;
|
|
67
71
|
onSuccess?: import('..').OnSuccessMethod;
|
|
68
72
|
onAuthDeclined?: import('..').OnAuthDeclinedMethod;
|
|
73
|
+
onInputError?: import('..').OnInputErrorMethod;
|
|
74
|
+
onInputValid?: import('..').OnInputValidMethod;
|
|
69
75
|
webhookInfo?: {
|
|
70
76
|
[key: string]: any;
|
|
71
77
|
};
|
|
@@ -100,10 +106,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
100
106
|
blockchain: "polygon";
|
|
101
107
|
wallet: import('..').EthWallet;
|
|
102
108
|
subtotal?: import('..').Subtotal;
|
|
109
|
+
useNativeSubtotal?: boolean;
|
|
103
110
|
presentment?: import('..').Currency;
|
|
104
111
|
onSuccess?: import('..').OnSuccessMethod;
|
|
105
112
|
sessionKey?: string;
|
|
106
113
|
onAuthDeclined?: import('..').OnAuthDeclinedMethod;
|
|
114
|
+
onInputError?: import('..').OnInputErrorMethod;
|
|
115
|
+
onInputValid?: import('..').OnInputValidMethod;
|
|
107
116
|
webhookInfo?: {
|
|
108
117
|
[key: string]: any;
|
|
109
118
|
};
|
|
@@ -138,10 +147,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
138
147
|
blockchain: "eth";
|
|
139
148
|
wallet: import('..').EthWallet;
|
|
140
149
|
subtotal?: import('..').Subtotal;
|
|
150
|
+
useNativeSubtotal?: boolean;
|
|
141
151
|
presentment?: import('..').Currency;
|
|
142
152
|
onSuccess?: import('..').OnSuccessMethod;
|
|
143
153
|
sessionKey?: string;
|
|
144
154
|
onAuthDeclined?: import('..').OnAuthDeclinedMethod;
|
|
155
|
+
onInputError?: import('..').OnInputErrorMethod;
|
|
156
|
+
onInputValid?: import('..').OnInputValidMethod;
|
|
145
157
|
webhookInfo?: {
|
|
146
158
|
[key: string]: any;
|
|
147
159
|
};
|
|
@@ -176,10 +188,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
176
188
|
blockchain: "base";
|
|
177
189
|
wallet: import('..').EthWallet;
|
|
178
190
|
subtotal?: import('..').Subtotal;
|
|
191
|
+
useNativeSubtotal?: boolean;
|
|
179
192
|
presentment?: import('..').Currency;
|
|
180
193
|
onSuccess?: import('..').OnSuccessMethod;
|
|
181
194
|
sessionKey?: string;
|
|
182
195
|
onAuthDeclined?: import('..').OnAuthDeclinedMethod;
|
|
196
|
+
onInputError?: import('..').OnInputErrorMethod;
|
|
197
|
+
onInputValid?: import('..').OnInputValidMethod;
|
|
183
198
|
webhookInfo?: {
|
|
184
199
|
[key: string]: any;
|
|
185
200
|
};
|
|
@@ -214,10 +229,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
214
229
|
blockchain: "arbitrum";
|
|
215
230
|
wallet: import('..').EthWallet;
|
|
216
231
|
subtotal?: import('..').Subtotal;
|
|
232
|
+
useNativeSubtotal?: boolean;
|
|
217
233
|
presentment?: import('..').Currency;
|
|
218
234
|
onSuccess?: import('..').OnSuccessMethod;
|
|
219
235
|
sessionKey?: string;
|
|
220
236
|
onAuthDeclined?: import('..').OnAuthDeclinedMethod;
|
|
237
|
+
onInputError?: import('..').OnInputErrorMethod;
|
|
238
|
+
onInputValid?: import('..').OnInputValidMethod;
|
|
221
239
|
webhookInfo?: {
|
|
222
240
|
[key: string]: any;
|
|
223
241
|
};
|
|
@@ -252,10 +270,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
252
270
|
wallet: import('..').StellarWallet;
|
|
253
271
|
blockchain: "stellar";
|
|
254
272
|
subtotal?: import('..').Subtotal;
|
|
273
|
+
useNativeSubtotal?: boolean;
|
|
255
274
|
presentment?: import('..').Currency;
|
|
256
275
|
onSuccess?: import('..').OnSuccessMethod;
|
|
257
276
|
sessionKey?: string;
|
|
258
277
|
onAuthDeclined?: import('..').OnAuthDeclinedMethod;
|
|
278
|
+
onInputError?: import('..').OnInputErrorMethod;
|
|
279
|
+
onInputValid?: import('..').OnInputValidMethod;
|
|
259
280
|
webhookInfo?: {
|
|
260
281
|
[key: string]: any;
|
|
261
282
|
};
|
|
@@ -290,10 +311,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
290
311
|
blockchain: "monad";
|
|
291
312
|
wallet: import('..').EthWallet;
|
|
292
313
|
subtotal?: import('..').Subtotal;
|
|
314
|
+
useNativeSubtotal?: boolean;
|
|
293
315
|
presentment?: import('..').Currency;
|
|
294
316
|
onSuccess?: import('..').OnSuccessMethod;
|
|
295
317
|
sessionKey?: string;
|
|
296
318
|
onAuthDeclined?: import('..').OnAuthDeclinedMethod;
|
|
319
|
+
onInputError?: import('..').OnInputErrorMethod;
|
|
320
|
+
onInputValid?: import('..').OnInputValidMethod;
|
|
297
321
|
webhookInfo?: {
|
|
298
322
|
[key: string]: any;
|
|
299
323
|
};
|
|
@@ -328,10 +352,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
328
352
|
blockchain: "tempo";
|
|
329
353
|
wallet: import('..').EthWallet;
|
|
330
354
|
subtotal?: import('..').Subtotal;
|
|
355
|
+
useNativeSubtotal?: boolean;
|
|
331
356
|
presentment?: import('..').Currency;
|
|
332
357
|
onSuccess?: import('..').OnSuccessMethod;
|
|
333
358
|
sessionKey?: string;
|
|
334
359
|
onAuthDeclined?: import('..').OnAuthDeclinedMethod;
|
|
360
|
+
onInputError?: import('..').OnInputErrorMethod;
|
|
361
|
+
onInputValid?: import('..').OnInputValidMethod;
|
|
335
362
|
webhookInfo?: {
|
|
336
363
|
[key: string]: any;
|
|
337
364
|
};
|
|
@@ -364,6 +391,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
364
391
|
handleHeightChange: ((height: string) => void) | undefined;
|
|
365
392
|
onSuccess: import('..').OnSuccessMethod | undefined;
|
|
366
393
|
onAuthDeclined: import('..').OnAuthDeclinedMethod | undefined;
|
|
394
|
+
onInputError?: import('..').OnInputErrorMethod | undefined;
|
|
395
|
+
onInputValid?: import('..').OnInputValidMethod | undefined;
|
|
367
396
|
handleSendTransaction: (transaction: string) => Promise<string>;
|
|
368
397
|
handleSignMessage?: ((message: string) => Promise<string>) | undefined;
|
|
369
398
|
handleSignTransaction?: ((transaction: string) => Promise<string>) | undefined;
|
|
@@ -385,7 +414,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
385
414
|
}, {
|
|
386
415
|
sendMessage(message: string): void;
|
|
387
416
|
handleIframeMessages({ data, origin }: {
|
|
388
|
-
data:
|
|
417
|
+
data: unknown;
|
|
389
418
|
origin: string;
|
|
390
419
|
}): void;
|
|
391
420
|
listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
|
|
@@ -30,6 +30,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
30
30
|
lat: number;
|
|
31
31
|
lng: number;
|
|
32
32
|
};
|
|
33
|
+
appReturnUrl?: string;
|
|
33
34
|
merchantId: string;
|
|
34
35
|
env?: import('..').CoinflowEnvs;
|
|
35
36
|
loaderBackground?: string;
|
|
@@ -38,6 +39,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
38
39
|
theme?: import('..').MerchantTheme;
|
|
39
40
|
wallet: import('..').SolanaWallet;
|
|
40
41
|
connection: import('@solana/web3.js').Connection;
|
|
42
|
+
ownerOverride?: string;
|
|
41
43
|
} | {
|
|
42
44
|
walletPubkey: string | null | undefined;
|
|
43
45
|
route: string;
|
|
@@ -61,6 +63,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
61
63
|
lat: number;
|
|
62
64
|
lng: number;
|
|
63
65
|
};
|
|
66
|
+
appReturnUrl?: string;
|
|
64
67
|
merchantId: string;
|
|
65
68
|
env?: import('..').CoinflowEnvs;
|
|
66
69
|
loaderBackground?: string;
|
|
@@ -92,6 +95,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
92
95
|
lat: number;
|
|
93
96
|
lng: number;
|
|
94
97
|
};
|
|
98
|
+
appReturnUrl?: string;
|
|
95
99
|
merchantId: string;
|
|
96
100
|
env?: import('..').CoinflowEnvs;
|
|
97
101
|
loaderBackground?: string;
|
|
@@ -123,6 +127,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
123
127
|
lat: number;
|
|
124
128
|
lng: number;
|
|
125
129
|
};
|
|
130
|
+
appReturnUrl?: string;
|
|
126
131
|
merchantId: string;
|
|
127
132
|
env?: import('..').CoinflowEnvs;
|
|
128
133
|
loaderBackground?: string;
|
|
@@ -154,6 +159,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
154
159
|
lat: number;
|
|
155
160
|
lng: number;
|
|
156
161
|
};
|
|
162
|
+
appReturnUrl?: string;
|
|
157
163
|
merchantId: string;
|
|
158
164
|
env?: import('..').CoinflowEnvs;
|
|
159
165
|
loaderBackground?: string;
|
|
@@ -185,6 +191,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
185
191
|
lat: number;
|
|
186
192
|
lng: number;
|
|
187
193
|
};
|
|
194
|
+
appReturnUrl?: string;
|
|
188
195
|
merchantId: string;
|
|
189
196
|
env?: import('..').CoinflowEnvs;
|
|
190
197
|
loaderBackground?: string;
|
|
@@ -215,6 +222,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
215
222
|
lat: number;
|
|
216
223
|
lng: number;
|
|
217
224
|
};
|
|
225
|
+
appReturnUrl?: string;
|
|
218
226
|
merchantId: string;
|
|
219
227
|
env?: import('..').CoinflowEnvs;
|
|
220
228
|
loaderBackground?: string;
|
|
@@ -246,6 +254,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
246
254
|
lat: number;
|
|
247
255
|
lng: number;
|
|
248
256
|
};
|
|
257
|
+
appReturnUrl?: string;
|
|
249
258
|
merchantId: string;
|
|
250
259
|
env?: import('..').CoinflowEnvs;
|
|
251
260
|
loaderBackground?: string;
|
|
@@ -259,6 +268,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
259
268
|
handleHeightChange: ((height: string) => void) | undefined;
|
|
260
269
|
onSuccess: import('..').OnSuccessMethod | undefined;
|
|
261
270
|
onAuthDeclined: import('..').OnAuthDeclinedMethod | undefined;
|
|
271
|
+
onInputError?: import('..').OnInputErrorMethod | undefined;
|
|
272
|
+
onInputValid?: import('..').OnInputValidMethod | undefined;
|
|
262
273
|
handleSendTransaction: (transaction: string) => Promise<string>;
|
|
263
274
|
handleSignMessage?: ((message: string) => Promise<string>) | undefined;
|
|
264
275
|
handleSignTransaction?: ((transaction: string) => Promise<string>) | undefined;
|
|
@@ -280,7 +291,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
280
291
|
}, {
|
|
281
292
|
sendMessage(message: string): void;
|
|
282
293
|
handleIframeMessages({ data, origin }: {
|
|
283
|
-
data:
|
|
294
|
+
data: unknown;
|
|
284
295
|
origin: string;
|
|
285
296
|
}): void;
|
|
286
297
|
listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
|
|
@@ -9,7 +9,61 @@ declare function __VLS_template(): {
|
|
|
9
9
|
slots: {
|
|
10
10
|
default?(_: {}): any;
|
|
11
11
|
};
|
|
12
|
-
refs: {
|
|
12
|
+
refs: {
|
|
13
|
+
iframeRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
14
|
+
args: {
|
|
15
|
+
type: PropType<import('../..').CoinflowIFrameProps & import('../..').IFrameMessageHandlers>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
}>> & Readonly<{
|
|
19
|
+
onOnMessage?: ((_data: {
|
|
20
|
+
data: string;
|
|
21
|
+
origin: string;
|
|
22
|
+
}) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {
|
|
24
|
+
url(): string;
|
|
25
|
+
}, {
|
|
26
|
+
sendMessage(message: string): void;
|
|
27
|
+
handleIframeMessages({ data, origin }: {
|
|
28
|
+
data: unknown;
|
|
29
|
+
origin: string;
|
|
30
|
+
}): void;
|
|
31
|
+
listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
|
|
32
|
+
sendAndReceiveMessage(message: string, isResponseValid: (response: string) => boolean): Promise<string>;
|
|
33
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
34
|
+
onMessage(_data: {
|
|
35
|
+
data: string;
|
|
36
|
+
origin: string;
|
|
37
|
+
}): true;
|
|
38
|
+
}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
39
|
+
P: {};
|
|
40
|
+
B: {};
|
|
41
|
+
D: {};
|
|
42
|
+
C: {};
|
|
43
|
+
M: {};
|
|
44
|
+
Defaults: {};
|
|
45
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
46
|
+
args: {
|
|
47
|
+
type: PropType<import('../..').CoinflowIFrameProps & import('../..').IFrameMessageHandlers>;
|
|
48
|
+
required: true;
|
|
49
|
+
};
|
|
50
|
+
}>> & Readonly<{
|
|
51
|
+
onOnMessage?: ((_data: {
|
|
52
|
+
data: string;
|
|
53
|
+
origin: string;
|
|
54
|
+
}) => any) | undefined;
|
|
55
|
+
}>, {}, {}, {
|
|
56
|
+
url(): string;
|
|
57
|
+
}, {
|
|
58
|
+
sendMessage(message: string): void;
|
|
59
|
+
handleIframeMessages({ data, origin }: {
|
|
60
|
+
data: unknown;
|
|
61
|
+
origin: string;
|
|
62
|
+
}): void;
|
|
63
|
+
listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
|
|
64
|
+
sendAndReceiveMessage(message: string, isResponseValid: (response: string) => boolean): Promise<string>;
|
|
65
|
+
}, {}> | null;
|
|
66
|
+
};
|
|
13
67
|
rootEl: HTMLDivElement;
|
|
14
68
|
};
|
|
15
69
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -47,7 +101,61 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
47
101
|
type: StringConstructor;
|
|
48
102
|
required: false;
|
|
49
103
|
};
|
|
50
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
104
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
105
|
+
iframeRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
106
|
+
args: {
|
|
107
|
+
type: PropType<import('../..').CoinflowIFrameProps & import('../..').IFrameMessageHandlers>;
|
|
108
|
+
required: true;
|
|
109
|
+
};
|
|
110
|
+
}>> & Readonly<{
|
|
111
|
+
onOnMessage?: ((_data: {
|
|
112
|
+
data: string;
|
|
113
|
+
origin: string;
|
|
114
|
+
}) => any) | undefined;
|
|
115
|
+
}>, {}, {}, {
|
|
116
|
+
url(): string;
|
|
117
|
+
}, {
|
|
118
|
+
sendMessage(message: string): void;
|
|
119
|
+
handleIframeMessages({ data, origin }: {
|
|
120
|
+
data: unknown;
|
|
121
|
+
origin: string;
|
|
122
|
+
}): void;
|
|
123
|
+
listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
|
|
124
|
+
sendAndReceiveMessage(message: string, isResponseValid: (response: string) => boolean): Promise<string>;
|
|
125
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
126
|
+
onMessage(_data: {
|
|
127
|
+
data: string;
|
|
128
|
+
origin: string;
|
|
129
|
+
}): true;
|
|
130
|
+
}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
131
|
+
P: {};
|
|
132
|
+
B: {};
|
|
133
|
+
D: {};
|
|
134
|
+
C: {};
|
|
135
|
+
M: {};
|
|
136
|
+
Defaults: {};
|
|
137
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
138
|
+
args: {
|
|
139
|
+
type: PropType<import('../..').CoinflowIFrameProps & import('../..').IFrameMessageHandlers>;
|
|
140
|
+
required: true;
|
|
141
|
+
};
|
|
142
|
+
}>> & Readonly<{
|
|
143
|
+
onOnMessage?: ((_data: {
|
|
144
|
+
data: string;
|
|
145
|
+
origin: string;
|
|
146
|
+
}) => any) | undefined;
|
|
147
|
+
}>, {}, {}, {
|
|
148
|
+
url(): string;
|
|
149
|
+
}, {
|
|
150
|
+
sendMessage(message: string): void;
|
|
151
|
+
handleIframeMessages({ data, origin }: {
|
|
152
|
+
data: unknown;
|
|
153
|
+
origin: string;
|
|
154
|
+
}): void;
|
|
155
|
+
listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
|
|
156
|
+
sendAndReceiveMessage(message: string, isResponseValid: (response: string) => boolean): Promise<string>;
|
|
157
|
+
}, {}> | null;
|
|
158
|
+
}, HTMLDivElement>;
|
|
51
159
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
52
160
|
export default _default;
|
|
53
161
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoinflowPurchaseProps, OnAuthDeclinedMethod, OnSuccessMethod } from './CoinflowTypes';
|
|
1
|
+
import { CoinflowPurchaseProps, OnAuthDeclinedMethod, OnInputErrorMethod, OnInputValidMethod, OnSuccessMethod } from './CoinflowTypes';
|
|
2
2
|
export type WalletCall = {
|
|
3
3
|
method: IFrameMessageMethods;
|
|
4
4
|
data: string;
|
|
@@ -18,6 +18,8 @@ export interface IFrameMessageHandlers {
|
|
|
18
18
|
handleHeightChange?: (height: string) => void;
|
|
19
19
|
onSuccess: OnSuccessMethod | undefined;
|
|
20
20
|
onAuthDeclined: OnAuthDeclinedMethod | undefined;
|
|
21
|
+
onInputError?: OnInputErrorMethod | undefined;
|
|
22
|
+
onInputValid?: OnInputValidMethod | undefined;
|
|
21
23
|
/**
|
|
22
24
|
* Called when the iframe opens/closes an in-page overlay (e.g. the PayPal
|
|
23
25
|
* approval modal). `state` is 'open' or 'close'.
|
|
@@ -31,12 +33,15 @@ export declare enum IFrameMessageMethods {
|
|
|
31
33
|
HeightChange = "heightChange",
|
|
32
34
|
Success = "success",
|
|
33
35
|
AuthDeclined = "authDeclined",
|
|
36
|
+
InputError = "inputError",
|
|
37
|
+
InputValid = "inputValid",
|
|
34
38
|
Loaded = "loaded",
|
|
35
39
|
AccountLinked = "accountLinked",
|
|
36
40
|
Redirect = "redirect",
|
|
37
|
-
Overlay = "overlay"
|
|
41
|
+
Overlay = "overlay",
|
|
42
|
+
UpdateSubtotal = "updateSubtotal"
|
|
38
43
|
}
|
|
39
44
|
export declare function getWalletPubkey(input: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain'>): string | null | undefined;
|
|
40
45
|
export declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers, handleHeightChangeId: string | number): Promise<string> | void;
|
|
41
|
-
export declare function getHandlers(props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess' | 'onAuthDeclined'>): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
|
|
46
|
+
export declare function getHandlers(props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess' | 'onAuthDeclined' | 'onInputError' | 'onInputValid'>): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
|
|
42
47
|
export {};
|
|
@@ -4,6 +4,11 @@ import { GiftCardCartItem } from './types/giftCardCartItem';
|
|
|
4
4
|
import { nftCartItem } from './types/nftCartItem';
|
|
5
5
|
import { CryptoCartItem } from './types/cryptoCartItem';
|
|
6
6
|
import { MoneyTopUpCartItem } from './types/moneyTopUpCartItem';
|
|
7
|
+
import { TravelCartItem } from './types/travelCartItem';
|
|
8
|
+
import { FlightTicketCartItem } from './types/flightTicketCartItem';
|
|
9
|
+
import { FlightUpgradeCartItem } from './types/flightUpgradeCartItem';
|
|
10
|
+
import { LodgingCartItem } from './types/lodgingCartItem';
|
|
11
|
+
import { InputErrorWalletCallInfo, InputValidWalletCallInfo } from './card-form/cardFieldValidationError';
|
|
7
12
|
export declare enum WithdrawCategory {
|
|
8
13
|
USER = "user",
|
|
9
14
|
BUSINESS = "business",
|
|
@@ -20,7 +25,8 @@ export declare enum WithdrawSpeed {
|
|
|
20
25
|
VENMO = "venmo",
|
|
21
26
|
PAYPAL = "paypal",
|
|
22
27
|
WIRE = "wire",
|
|
23
|
-
INTERAC = "interac"
|
|
28
|
+
INTERAC = "interac",
|
|
29
|
+
SWIFT = "swift"
|
|
24
30
|
}
|
|
25
31
|
export declare enum SettlementType {
|
|
26
32
|
Credits = "Credits",
|
|
@@ -155,6 +161,8 @@ export type AuthDeclinedWalletCallInfo = {
|
|
|
155
161
|
total: string;
|
|
156
162
|
};
|
|
157
163
|
export type OnAuthDeclinedMethod = (args: AuthDeclinedWalletCallInfo) => void | Promise<void>;
|
|
164
|
+
export type OnInputErrorMethod = (args: InputErrorWalletCallInfo) => void | Promise<void>;
|
|
165
|
+
export type OnInputValidMethod = (args: InputValidWalletCallInfo) => void | Promise<void>;
|
|
158
166
|
/** Wallets **/
|
|
159
167
|
export interface SolanaWallet {
|
|
160
168
|
publicKey: PublicKey | null;
|
|
@@ -244,11 +252,11 @@ export declare enum ChargebackProtectionAccountType {
|
|
|
244
252
|
PRIVATE = "private",
|
|
245
253
|
BUSINESS = "business"
|
|
246
254
|
}
|
|
247
|
-
export type CartItemClassOmitted = NftCartItemClassOmitted | Omit<GiftCardCartItem, 'listPrice'> | CryptoCartItem | MoneyTopUpCartItem;
|
|
255
|
+
export type CartItemClassOmitted = NftCartItemClassOmitted | Omit<GiftCardCartItem, 'listPrice'> | CryptoCartItem | MoneyTopUpCartItem | TravelCartItem | FlightTicketCartItem | FlightUpgradeCartItem | LodgingCartItem;
|
|
248
256
|
export type ChargebackProtectionItem = CartItemClassOmitted;
|
|
249
257
|
export type NftCartItemClassOmitted = Omit<nftCartItem, 'sellingPrice' | 'itemClass'>;
|
|
250
258
|
export type Cart = CartItem[];
|
|
251
|
-
export type CartItem = Omit<nftCartItem, 'listPrice' | 'sellingPrice'> | Omit<GiftCardCartItem, 'listPrice'> | CryptoCartItem | MoneyTopUpCartItem;
|
|
259
|
+
export type CartItem = Omit<nftCartItem, 'listPrice' | 'sellingPrice'> | Omit<GiftCardCartItem, 'listPrice'> | CryptoCartItem | MoneyTopUpCartItem | TravelCartItem | FlightTicketCartItem | FlightUpgradeCartItem | LodgingCartItem;
|
|
252
260
|
export declare enum ThreeDsChallengePreference {
|
|
253
261
|
NoPreference = "NoPreference",
|
|
254
262
|
Frictionless = "Frictionless",
|
|
@@ -277,6 +285,16 @@ export interface CoinflowCommonPaymentIntentProps extends Omit<CoinflowTypes, 'b
|
|
|
277
285
|
paymentIntentId: string;
|
|
278
286
|
onSuccess?: OnSuccessMethod;
|
|
279
287
|
onAuthDeclined?: OnAuthDeclinedMethod;
|
|
288
|
+
/**
|
|
289
|
+
* Called whenever a card field (card number, expiration, cvv) shows a
|
|
290
|
+
* validation error to the user, with the field name and the displayed message.
|
|
291
|
+
*/
|
|
292
|
+
onInputError?: OnInputErrorMethod;
|
|
293
|
+
/**
|
|
294
|
+
* Called when a card field that was showing a validation error stops showing
|
|
295
|
+
* it, with the field name.
|
|
296
|
+
*/
|
|
297
|
+
onInputValid?: OnInputValidMethod;
|
|
280
298
|
/**
|
|
281
299
|
* If true, pre-checks the partial USDC payment checkbox when USDC balance is available.
|
|
282
300
|
* If false or undefined, maintains default behavior (unchecked).
|
|
@@ -309,10 +327,25 @@ export interface CoinflowCommonPaymentIntentProps extends Omit<CoinflowTypes, 'b
|
|
|
309
327
|
}
|
|
310
328
|
export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
311
329
|
subtotal?: Subtotal;
|
|
330
|
+
/**
|
|
331
|
+
* When true, the Apple Pay button skips the totals (fee quote) fetch and
|
|
332
|
+
* charges exactly the `subtotal` passed to the component.
|
|
333
|
+
*/
|
|
334
|
+
useNativeSubtotal?: boolean;
|
|
312
335
|
presentment?: Currency;
|
|
313
336
|
onSuccess?: OnSuccessMethod;
|
|
314
337
|
sessionKey?: string;
|
|
315
338
|
onAuthDeclined?: OnAuthDeclinedMethod;
|
|
339
|
+
/**
|
|
340
|
+
* Called whenever a card field (card number, expiration, cvv) shows a
|
|
341
|
+
* validation error to the user, with the field name and the displayed message.
|
|
342
|
+
*/
|
|
343
|
+
onInputError?: OnInputErrorMethod;
|
|
344
|
+
/**
|
|
345
|
+
* Called when a card field that was showing a validation error stops showing
|
|
346
|
+
* it, with the field name.
|
|
347
|
+
*/
|
|
348
|
+
onInputValid?: OnInputValidMethod;
|
|
316
349
|
webhookInfo?: {
|
|
317
350
|
[key: string]: any;
|
|
318
351
|
};
|
|
@@ -382,6 +415,13 @@ export interface WithGeo {
|
|
|
382
415
|
lat: number;
|
|
383
416
|
lng: number;
|
|
384
417
|
};
|
|
418
|
+
/**
|
|
419
|
+
* Deep link (custom scheme or universal link) that reopens the host app.
|
|
420
|
+
* Used by browser-handoff checkouts (e.g. Venmo on React Native) so the
|
|
421
|
+
* standalone checkout page can route the customer back into the app after
|
|
422
|
+
* the payment app returns them to the browser.
|
|
423
|
+
*/
|
|
424
|
+
appReturnUrl?: string;
|
|
385
425
|
}
|
|
386
426
|
/**
|
|
387
427
|
* Used for Account Funding Transactions
|
|
@@ -483,12 +523,22 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
|
483
523
|
lat: number;
|
|
484
524
|
lng: number;
|
|
485
525
|
};
|
|
526
|
+
/**
|
|
527
|
+
* Deep link (custom scheme or universal link) that reopens the host app.
|
|
528
|
+
* Used by browser-handoff flows on React Native — Venmo checkout and the
|
|
529
|
+
* "Log in with PayPal" payout flow — so the standalone page routes the user
|
|
530
|
+
* back into the app after the payment/login app returns them to the browser.
|
|
531
|
+
* When omitted, PayPal linking still completes via polling but the user must
|
|
532
|
+
* switch back to the app manually.
|
|
533
|
+
*/
|
|
534
|
+
appReturnUrl?: string;
|
|
486
535
|
}
|
|
487
536
|
export type WalletTypes = SolanaWallet | EthWallet | StellarWallet;
|
|
488
537
|
export interface SolanaWalletProps {
|
|
489
538
|
wallet: SolanaWallet;
|
|
490
539
|
connection: Connection;
|
|
491
540
|
blockchain: 'solana';
|
|
541
|
+
ownerOverride?: string;
|
|
492
542
|
}
|
|
493
543
|
export type CoinflowSolanaWithdrawProps = CoinflowCommonWithdrawProps & SolanaWalletProps;
|
|
494
544
|
interface EvmWalletProps {
|
|
@@ -639,7 +689,7 @@ export interface DecentRedeem extends CommonEvmRedeem {
|
|
|
639
689
|
* Gas fees for the transaction will be automatically calculated and added to the total charged to the customer. Optionally the merchant can opt to pay for these gas fees.
|
|
640
690
|
*/
|
|
641
691
|
export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem | DecentRedeem;
|
|
642
|
-
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'chargebackProtectionAccountType' | 'webhookInfo' | 'subtotal' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail' | 'allowedPaymentMethods' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig' | 'depositAmounts'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey' | 'redemptionCheck'>, WithGeo {
|
|
692
|
+
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'chargebackProtectionAccountType' | 'webhookInfo' | 'subtotal' | 'useNativeSubtotal' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail' | 'allowedPaymentMethods' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig' | 'depositAmounts'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey' | 'redemptionCheck'>, WithGeo {
|
|
643
693
|
walletPubkey: string | null | undefined;
|
|
644
694
|
sessionKey?: string;
|
|
645
695
|
route: string;
|
|
@@ -652,7 +702,13 @@ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' |
|
|
|
652
702
|
disableGooglePay?: boolean;
|
|
653
703
|
theme?: MerchantTheme;
|
|
654
704
|
usePermit?: boolean;
|
|
705
|
+
ownerOverride?: string;
|
|
655
706
|
handleHeightChangeId: string | number;
|
|
707
|
+
/**
|
|
708
|
+
* Identifier linking a React Native Apple Pay WebView to its hidden bridge
|
|
709
|
+
* WebView for subtotal updates relayed through localStorage.
|
|
710
|
+
*/
|
|
711
|
+
bridgeId?: string;
|
|
656
712
|
}
|
|
657
713
|
export interface CoinflowIntentsIFrameProps {
|
|
658
714
|
theme?: MerchantTheme;
|
|
@@ -7,7 +7,7 @@ export declare class CoinflowUtils {
|
|
|
7
7
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
8
8
|
static getCoinflowAppBaseUrl(env?: CoinflowEnvs): string;
|
|
9
9
|
static getCoinflowApiUrl(env?: CoinflowEnvs): string;
|
|
10
|
-
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, depositAmounts, baseUrl, }: CoinflowIFrameProps & {
|
|
10
|
+
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, useNativeSubtotal, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, appReturnUrl, depositAmounts, ownerOverride, bridgeId, baseUrl, }: CoinflowIFrameProps & {
|
|
11
11
|
baseUrl?: string;
|
|
12
12
|
} & WithGeo): string;
|
|
13
13
|
static getCoinflowIntentsUrl({ baseUrl, route, color, theme, env, origins, deviceId, merchantCss, loaderBackground, handleHeightChangeId, }: CoinflowIntentsIFrameProps & {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CardEntryInputName } from './cardEntryLayout';
|
|
2
|
+
export type InputErrorWalletCallInfo = {
|
|
3
|
+
field: CardEntryInputName;
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
/** Emitted when a field that was showing an error stops showing it. */
|
|
7
|
+
export type InputValidWalletCallInfo = {
|
|
8
|
+
field: CardEntryInputName;
|
|
9
|
+
};
|
|
10
|
+
export declare const CARD_FIELD_ERROR_MESSAGES: {
|
|
11
|
+
readonly cardNumber: "Card number is invalid. Please double check information.";
|
|
12
|
+
readonly expiration: "Expiration is invalid. Please double check information.";
|
|
13
|
+
readonly cvv: "CVV is invalid. Please double check information.";
|
|
14
|
+
readonly cvvEmpty: "Please enter your CVV to proceed.";
|
|
15
|
+
};
|
|
16
|
+
export declare function getCardFieldValidationError({ cardError, expirationError, cvvError, cvvEmpty, isCvvOnly, }: {
|
|
17
|
+
cardError: boolean;
|
|
18
|
+
expirationError: boolean;
|
|
19
|
+
cvvError: boolean;
|
|
20
|
+
cvvEmpty: boolean;
|
|
21
|
+
isCvvOnly: boolean;
|
|
22
|
+
}): InputErrorWalletCallInfo | null;
|
|
23
|
+
/**
|
|
24
|
+
* An iframe message the card entry should emit for a change in validation
|
|
25
|
+
* state. `kind` rather than IFrameMessageMethods keeps this module free of a
|
|
26
|
+
* circular import (CoinflowLibMessageHandlers imports the payload types here).
|
|
27
|
+
*/
|
|
28
|
+
export type CardFieldInputEvent = {
|
|
29
|
+
kind: 'error';
|
|
30
|
+
info: InputErrorWalletCallInfo;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'valid';
|
|
33
|
+
info: InputValidWalletCallInfo;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Derives which messages to emit for a transition between two validation
|
|
37
|
+
* states, so the parent hears about each change exactly once.
|
|
38
|
+
*
|
|
39
|
+
* Nothing is emitted while the state is unchanged (including the pristine
|
|
40
|
+
* state, where both sides are null), so a field that is never invalid stays
|
|
41
|
+
* silent and a visible error is not re-sent on every render.
|
|
42
|
+
*
|
|
43
|
+
* Only one error is displayed at a time (see getCardFieldValidationError's
|
|
44
|
+
* precedence), so when the displayed error moves to a different field the
|
|
45
|
+
* previous field has necessarily become valid and gets its own clear event.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getCardFieldInputEvents({ previous, current, }: {
|
|
48
|
+
previous: InputErrorWalletCallInfo | null;
|
|
49
|
+
current: InputErrorWalletCallInfo | null;
|
|
50
|
+
}): CardFieldInputEvent[];
|
|
@@ -6,11 +6,17 @@ export * from './card-form/TokenEx';
|
|
|
6
6
|
export * from './card-form/tokenexHelpers';
|
|
7
7
|
export * from './card-form/cardEntryLayout';
|
|
8
8
|
export * from './card-form/cardFormSkeleton';
|
|
9
|
+
export * from './card-form/cardFieldValidationError';
|
|
9
10
|
export * from './types/Subtotal';
|
|
10
11
|
export * from './types/AnyObject';
|
|
11
12
|
export * from './types/giftCardCartItem';
|
|
12
13
|
export * from './types/nftCartItem';
|
|
13
14
|
export * from './types/cryptoCartItem';
|
|
15
|
+
export * from './types/travelCartItem';
|
|
16
|
+
export * from './types/flightTicketCartItem';
|
|
17
|
+
export * from './types/flightUpgradeCartItem';
|
|
18
|
+
export * from './types/lodgingCartItem';
|
|
14
19
|
export * from './CoinflowPurchaseProtectionHeaders';
|
|
15
20
|
export * from './CoinflowProtectionInit';
|
|
16
21
|
export { default as getForterToken, captureForterToken, awaitForterToken, } from './Forter';
|
|
22
|
+
export * from './plaidLinkTokenCache';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Plaid link token is scoped to exactly one country at mint time, and the
|
|
3
|
+
* OAuth leg of Plaid Link requires the *same* token the session started with.
|
|
4
|
+
* So the token has to be cached, which makes it easy to hand a session a token
|
|
5
|
+
* minted for the wrong rail — a US-scoped token opens the US institution list
|
|
6
|
+
* no matter which country the caller asked for.
|
|
7
|
+
*
|
|
8
|
+
* Caching the country alongside the token lets a reader refuse a token that was
|
|
9
|
+
* not minted for the rail it needs.
|
|
10
|
+
*/
|
|
11
|
+
export interface CachedLinkToken {
|
|
12
|
+
token: string;
|
|
13
|
+
/** Absent for flows that do not choose a rail, and for legacy cache entries. */
|
|
14
|
+
country?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function serializeCachedLinkToken(cached: CachedLinkToken): string;
|
|
17
|
+
/**
|
|
18
|
+
* Reads a cache entry, tolerating the bare-token strings written before the
|
|
19
|
+
* country was recorded. Those have unknown provenance, so they come back with
|
|
20
|
+
* no country and `canReuseLinkToken` will refuse them for a specific rail.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseCachedLinkToken(raw: string | null | undefined): CachedLinkToken | null;
|
|
23
|
+
/**
|
|
24
|
+
* True when a cached token may be handed to a session for `country`.
|
|
25
|
+
*
|
|
26
|
+
* A caller that names a country needs a token minted for that same country;
|
|
27
|
+
* anything else (a different rail, or an entry whose rail we never recorded)
|
|
28
|
+
* has to be re-minted. A caller that names no country takes what is cached,
|
|
29
|
+
* which is what the OAuth leg does when resuming a session already in flight.
|
|
30
|
+
*/
|
|
31
|
+
export declare function canReuseLinkToken({ cached, country, }: {
|
|
32
|
+
cached: CachedLinkToken | null;
|
|
33
|
+
country?: string;
|
|
34
|
+
}): boolean;
|