@moonpay/platform-sdk-react-native 1.15.2 → 1.17.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/README.md +24 -1
- package/dist/index.cjs +100 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -14
- package/dist/index.d.ts +44 -14
- package/dist/index.js +102 -34
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -34,9 +34,9 @@ import { GetPaymentMethodsError, GetQuoteError, GetAssetsError, GetTransactionsE
|
|
|
34
34
|
import { UpdateIdentityRequestBody, IdentityFileUploadUrlRequestBody, IdentityFileUploadUrl, SubmitIdentityFilesRequestBody, CreateIdentityRequestBody, Identity, IdentityVerificationResponse } from '@moonpay/platform-protocol/api/identity';
|
|
35
35
|
import { ResetConnectionError } from '@moonpay/platform-protocol/sdks/reset';
|
|
36
36
|
import { ViewStyle } from 'react-native';
|
|
37
|
+
import WebView, { WebViewProps } from 'react-native-webview';
|
|
37
38
|
import { ProtocolMessage } from '@moonpay/platform-protocol/protocol';
|
|
38
39
|
import { RefObject, ReactNode } from 'react';
|
|
39
|
-
import WebView from 'react-native-webview';
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Transport surface the RN SDK passes around internally. `WebViewTransport`
|
|
@@ -318,9 +318,11 @@ interface MoonPayAddCardProps {
|
|
|
318
318
|
onEvent?: (event: AddCardSdk.Event) => void;
|
|
319
319
|
/** Container style. Defaults to flex: 1. */
|
|
320
320
|
style?: ViewStyle;
|
|
321
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
322
|
+
webViewProps?: Partial<WebViewProps>;
|
|
321
323
|
}
|
|
322
324
|
/** Inline add-card frame — embed card entry in your own layout/animation. */
|
|
323
|
-
declare function MoonPayAddCard({ onEvent, style }: MoonPayAddCardProps): JSX.Element;
|
|
325
|
+
declare function MoonPayAddCard({ onEvent, style, webViewProps }: MoonPayAddCardProps): JSX.Element;
|
|
324
326
|
|
|
325
327
|
interface MoonPayApplePayButtonProps {
|
|
326
328
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -331,22 +333,26 @@ interface MoonPayApplePayButtonProps {
|
|
|
331
333
|
onEvent?: (event: ApplePaySdk.Event) => void;
|
|
332
334
|
/** Container style. Defaults to height 48. */
|
|
333
335
|
style?: ViewStyle;
|
|
336
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
337
|
+
webViewProps?: Partial<WebViewProps>;
|
|
334
338
|
}
|
|
335
339
|
/** Inline Apple Pay button. Render it wherever it should appear in your layout. */
|
|
336
|
-
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
340
|
+
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
337
341
|
|
|
338
342
|
interface MoonPayAuthProps {
|
|
339
343
|
/** Callback for auth lifecycle events. */
|
|
340
344
|
onEvent?: (event: AuthSdk.Event) => void;
|
|
341
345
|
/** Container style. Defaults to flex: 1. */
|
|
342
346
|
style?: ViewStyle;
|
|
347
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
348
|
+
webViewProps?: Partial<WebViewProps>;
|
|
343
349
|
}
|
|
344
350
|
/**
|
|
345
351
|
* Inline auth frame for headless / Identity-API integrations. Requires a clientToken in context —
|
|
346
352
|
* call getConnection() (or render <MoonPayConnectionCheck>) first; if it resolves with
|
|
347
353
|
* `connectionRequired`, mount this component. Emits an error event otherwise.
|
|
348
354
|
*/
|
|
349
|
-
declare function MoonPayAuth({ onEvent, style }: MoonPayAuthProps): JSX.Element;
|
|
355
|
+
declare function MoonPayAuth({ onEvent, style, webViewProps }: MoonPayAuthProps): JSX.Element;
|
|
350
356
|
|
|
351
357
|
interface MoonPayBuyButtonProps {
|
|
352
358
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -357,9 +363,11 @@ interface MoonPayBuyButtonProps {
|
|
|
357
363
|
onEvent?: (event: BuyButtonSdk.Event) => void;
|
|
358
364
|
/** Container style. Defaults to height 48. */
|
|
359
365
|
style?: ViewStyle;
|
|
366
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
367
|
+
webViewProps?: Partial<WebViewProps>;
|
|
360
368
|
}
|
|
361
369
|
/** Inline card/buy button. Render it wherever it should appear in your layout. */
|
|
362
|
-
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, }: MoonPayBuyButtonProps): JSX.Element;
|
|
370
|
+
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
|
|
363
371
|
|
|
364
372
|
interface MoonPayBuyFrameProps {
|
|
365
373
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -368,9 +376,11 @@ interface MoonPayBuyFrameProps {
|
|
|
368
376
|
externalTransactionId?: string;
|
|
369
377
|
/** Callback for buy frame lifecycle events. */
|
|
370
378
|
onEvent?: (event: BuySdk.Event) => void;
|
|
379
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
380
|
+
webViewProps?: Partial<WebViewProps>;
|
|
371
381
|
}
|
|
372
382
|
/** Headless buy frame (renders nothing visible). The declarative alternative to client.setupBuy(). */
|
|
373
|
-
declare function MoonPayBuyFrame({ quote, externalTransactionId, onEvent, }: MoonPayBuyFrameProps): JSX.Element;
|
|
383
|
+
declare function MoonPayBuyFrame({ quote, externalTransactionId, onEvent, webViewProps, }: MoonPayBuyFrameProps): JSX.Element;
|
|
374
384
|
|
|
375
385
|
interface MoonPayChallengeProps {
|
|
376
386
|
/** Full challenge URL received from a frame's `challenge` event. Mount-time only. */
|
|
@@ -379,9 +389,11 @@ interface MoonPayChallengeProps {
|
|
|
379
389
|
onEvent?: (event: ChallengeSdk.Event) => void;
|
|
380
390
|
/** Container style. Defaults to flex: 1. */
|
|
381
391
|
style?: ViewStyle;
|
|
392
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
393
|
+
webViewProps?: Partial<WebViewProps>;
|
|
382
394
|
}
|
|
383
395
|
/** Inline 3DS/challenge frame. Mount it when a payment frame emits a `challenge` event. */
|
|
384
|
-
declare function MoonPayChallenge({ url, onEvent, style }: MoonPayChallengeProps): JSX.Element;
|
|
396
|
+
declare function MoonPayChallenge({ url, onEvent, style, webViewProps, }: MoonPayChallengeProps): JSX.Element;
|
|
385
397
|
|
|
386
398
|
interface MoonPayConnectProps {
|
|
387
399
|
/** Theme for this connect frame. Overrides the provider-level `theme`. Mount-time only. */
|
|
@@ -390,9 +402,11 @@ interface MoonPayConnectProps {
|
|
|
390
402
|
onEvent?: (event: ConnectSdk.Event) => void;
|
|
391
403
|
/** Container style. Defaults to flex: 1. */
|
|
392
404
|
style?: ViewStyle;
|
|
405
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
406
|
+
webViewProps?: Partial<WebViewProps>;
|
|
393
407
|
}
|
|
394
408
|
/** Inline connect frame. On an active completion, credentials are applied to the shared client automatically. */
|
|
395
|
-
declare function MoonPayConnect({ theme, onEvent, style }: MoonPayConnectProps): JSX.Element;
|
|
409
|
+
declare function MoonPayConnect({ theme, onEvent, style, webViewProps, }: MoonPayConnectProps): JSX.Element;
|
|
396
410
|
|
|
397
411
|
type ConnectionCheckEvent = {
|
|
398
412
|
kind: 'complete';
|
|
@@ -417,29 +431,35 @@ interface MoonPayConnectionCheckProps {
|
|
|
417
431
|
skipKyc?: boolean;
|
|
418
432
|
/** Emits `complete` with the Connection, or `error`. */
|
|
419
433
|
onEvent?: (event: ConnectionCheckEvent) => void;
|
|
434
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
435
|
+
webViewProps?: Partial<WebViewProps>;
|
|
420
436
|
}
|
|
421
437
|
/**
|
|
422
438
|
* Headless connection check (renders nothing visible). The declarative
|
|
423
439
|
* alternative to client.getConnection() — on an active connection,
|
|
424
440
|
* credentials are applied to the shared client automatically.
|
|
425
441
|
*/
|
|
426
|
-
declare function MoonPayConnectionCheck({ skipKyc, onEvent, }: MoonPayConnectionCheckProps): JSX.Element;
|
|
442
|
+
declare function MoonPayConnectionCheck({ skipKyc, onEvent, webViewProps, }: MoonPayConnectionCheckProps): JSX.Element;
|
|
427
443
|
|
|
428
444
|
interface MoonPayConnectionResetProps {
|
|
429
445
|
/** Callback for connection reset lifecycle events. */
|
|
430
446
|
onEvent?: (event: ConnectionResetEvent) => void;
|
|
447
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
448
|
+
webViewProps?: Partial<WebViewProps>;
|
|
431
449
|
}
|
|
432
450
|
/** Headless reset frame (renders nothing visible). The declarative alternative to client.resetConnection(). */
|
|
433
|
-
declare function MoonPayConnectionReset({ onEvent }: MoonPayConnectionResetProps): JSX.Element;
|
|
451
|
+
declare function MoonPayConnectionReset({ onEvent, webViewProps, }: MoonPayConnectionResetProps): JSX.Element;
|
|
434
452
|
|
|
435
453
|
interface MoonPayCustomerExportProps {
|
|
436
454
|
/** Callback for customer-export lifecycle events. */
|
|
437
455
|
onEvent?: (event: CustomerExportSdk.Event) => void;
|
|
438
456
|
/** Container style. Defaults to flex: 1. */
|
|
439
457
|
style?: ViewStyle;
|
|
458
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
459
|
+
webViewProps?: Partial<WebViewProps>;
|
|
440
460
|
}
|
|
441
461
|
/** Inline customer-export consent frame — embed export consent capture in your own layout. */
|
|
442
|
-
declare function MoonPayCustomerExport({ onEvent, style }: MoonPayCustomerExportProps): JSX.Element;
|
|
462
|
+
declare function MoonPayCustomerExport({ onEvent, style, webViewProps, }: MoonPayCustomerExportProps): JSX.Element;
|
|
443
463
|
|
|
444
464
|
interface MoonPayGooglePayButtonProps {
|
|
445
465
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -450,9 +470,11 @@ interface MoonPayGooglePayButtonProps {
|
|
|
450
470
|
onEvent?: (event: GooglePaySdk.Event) => void;
|
|
451
471
|
/** Container style. Defaults to height 48. */
|
|
452
472
|
style?: ViewStyle;
|
|
473
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
474
|
+
webViewProps?: Partial<WebViewProps>;
|
|
453
475
|
}
|
|
454
476
|
/** Inline Google Pay button. Render it wherever it should appear in your layout. */
|
|
455
|
-
declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, }: MoonPayGooglePayButtonProps): JSX.Element;
|
|
477
|
+
declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayGooglePayButtonProps): JSX.Element;
|
|
456
478
|
|
|
457
479
|
interface MoonPayWidgetProps {
|
|
458
480
|
/** Quote signature from getQuote(). Mount-time only — changing it reloads the widget. */
|
|
@@ -463,9 +485,11 @@ interface MoonPayWidgetProps {
|
|
|
463
485
|
onEvent?: (event: WidgetSdk.Event) => void;
|
|
464
486
|
/** Container style. Defaults to flex: 1. */
|
|
465
487
|
style?: ViewStyle;
|
|
488
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
489
|
+
webViewProps?: Partial<WebViewProps>;
|
|
466
490
|
}
|
|
467
491
|
/** Inline widget frame. Render it wherever it should appear in your layout. */
|
|
468
|
-
declare function MoonPayWidget({ quote, externalTransactionId, onEvent, style, }: MoonPayWidgetProps): JSX.Element;
|
|
492
|
+
declare function MoonPayWidget({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayWidgetProps): JSX.Element;
|
|
469
493
|
|
|
470
494
|
interface MoonPayFrameProps {
|
|
471
495
|
/** The transport instance managing this frame's communication. */
|
|
@@ -474,12 +498,18 @@ interface MoonPayFrameProps {
|
|
|
474
498
|
hidden?: boolean;
|
|
475
499
|
/** Optional style overrides for the container view. */
|
|
476
500
|
style?: ViewStyle;
|
|
501
|
+
/**
|
|
502
|
+
* Advanced: extra props forwarded to the underlying react-native-webview.
|
|
503
|
+
* `ref`, `source`, and `onMessage` are managed by the SDK and cannot be
|
|
504
|
+
* overridden; all other props (including `originWhitelist`) may be set here.
|
|
505
|
+
*/
|
|
506
|
+
webViewProps?: Partial<WebViewProps>;
|
|
477
507
|
}
|
|
478
508
|
/**
|
|
479
509
|
* Reusable React Native component that renders a MoonPay frame as a WebView.
|
|
480
510
|
* Bridges the WebViewTransport to the actual WebView instance.
|
|
481
511
|
*/
|
|
482
|
-
declare function MoonPayFrame({ transport, hidden, style }: MoonPayFrameProps): JSX.Element | null;
|
|
512
|
+
declare function MoonPayFrame({ transport, hidden, style, webViewProps, }: MoonPayFrameProps): JSX.Element | null;
|
|
483
513
|
|
|
484
514
|
interface MoonPayProviderProps {
|
|
485
515
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -34,9 +34,9 @@ import { GetPaymentMethodsError, GetQuoteError, GetAssetsError, GetTransactionsE
|
|
|
34
34
|
import { UpdateIdentityRequestBody, IdentityFileUploadUrlRequestBody, IdentityFileUploadUrl, SubmitIdentityFilesRequestBody, CreateIdentityRequestBody, Identity, IdentityVerificationResponse } from '@moonpay/platform-protocol/api/identity';
|
|
35
35
|
import { ResetConnectionError } from '@moonpay/platform-protocol/sdks/reset';
|
|
36
36
|
import { ViewStyle } from 'react-native';
|
|
37
|
+
import WebView, { WebViewProps } from 'react-native-webview';
|
|
37
38
|
import { ProtocolMessage } from '@moonpay/platform-protocol/protocol';
|
|
38
39
|
import { RefObject, ReactNode } from 'react';
|
|
39
|
-
import WebView from 'react-native-webview';
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Transport surface the RN SDK passes around internally. `WebViewTransport`
|
|
@@ -318,9 +318,11 @@ interface MoonPayAddCardProps {
|
|
|
318
318
|
onEvent?: (event: AddCardSdk.Event) => void;
|
|
319
319
|
/** Container style. Defaults to flex: 1. */
|
|
320
320
|
style?: ViewStyle;
|
|
321
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
322
|
+
webViewProps?: Partial<WebViewProps>;
|
|
321
323
|
}
|
|
322
324
|
/** Inline add-card frame — embed card entry in your own layout/animation. */
|
|
323
|
-
declare function MoonPayAddCard({ onEvent, style }: MoonPayAddCardProps): JSX.Element;
|
|
325
|
+
declare function MoonPayAddCard({ onEvent, style, webViewProps }: MoonPayAddCardProps): JSX.Element;
|
|
324
326
|
|
|
325
327
|
interface MoonPayApplePayButtonProps {
|
|
326
328
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -331,22 +333,26 @@ interface MoonPayApplePayButtonProps {
|
|
|
331
333
|
onEvent?: (event: ApplePaySdk.Event) => void;
|
|
332
334
|
/** Container style. Defaults to height 48. */
|
|
333
335
|
style?: ViewStyle;
|
|
336
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
337
|
+
webViewProps?: Partial<WebViewProps>;
|
|
334
338
|
}
|
|
335
339
|
/** Inline Apple Pay button. Render it wherever it should appear in your layout. */
|
|
336
|
-
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
340
|
+
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
337
341
|
|
|
338
342
|
interface MoonPayAuthProps {
|
|
339
343
|
/** Callback for auth lifecycle events. */
|
|
340
344
|
onEvent?: (event: AuthSdk.Event) => void;
|
|
341
345
|
/** Container style. Defaults to flex: 1. */
|
|
342
346
|
style?: ViewStyle;
|
|
347
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
348
|
+
webViewProps?: Partial<WebViewProps>;
|
|
343
349
|
}
|
|
344
350
|
/**
|
|
345
351
|
* Inline auth frame for headless / Identity-API integrations. Requires a clientToken in context —
|
|
346
352
|
* call getConnection() (or render <MoonPayConnectionCheck>) first; if it resolves with
|
|
347
353
|
* `connectionRequired`, mount this component. Emits an error event otherwise.
|
|
348
354
|
*/
|
|
349
|
-
declare function MoonPayAuth({ onEvent, style }: MoonPayAuthProps): JSX.Element;
|
|
355
|
+
declare function MoonPayAuth({ onEvent, style, webViewProps }: MoonPayAuthProps): JSX.Element;
|
|
350
356
|
|
|
351
357
|
interface MoonPayBuyButtonProps {
|
|
352
358
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -357,9 +363,11 @@ interface MoonPayBuyButtonProps {
|
|
|
357
363
|
onEvent?: (event: BuyButtonSdk.Event) => void;
|
|
358
364
|
/** Container style. Defaults to height 48. */
|
|
359
365
|
style?: ViewStyle;
|
|
366
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
367
|
+
webViewProps?: Partial<WebViewProps>;
|
|
360
368
|
}
|
|
361
369
|
/** Inline card/buy button. Render it wherever it should appear in your layout. */
|
|
362
|
-
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, }: MoonPayBuyButtonProps): JSX.Element;
|
|
370
|
+
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
|
|
363
371
|
|
|
364
372
|
interface MoonPayBuyFrameProps {
|
|
365
373
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -368,9 +376,11 @@ interface MoonPayBuyFrameProps {
|
|
|
368
376
|
externalTransactionId?: string;
|
|
369
377
|
/** Callback for buy frame lifecycle events. */
|
|
370
378
|
onEvent?: (event: BuySdk.Event) => void;
|
|
379
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
380
|
+
webViewProps?: Partial<WebViewProps>;
|
|
371
381
|
}
|
|
372
382
|
/** Headless buy frame (renders nothing visible). The declarative alternative to client.setupBuy(). */
|
|
373
|
-
declare function MoonPayBuyFrame({ quote, externalTransactionId, onEvent, }: MoonPayBuyFrameProps): JSX.Element;
|
|
383
|
+
declare function MoonPayBuyFrame({ quote, externalTransactionId, onEvent, webViewProps, }: MoonPayBuyFrameProps): JSX.Element;
|
|
374
384
|
|
|
375
385
|
interface MoonPayChallengeProps {
|
|
376
386
|
/** Full challenge URL received from a frame's `challenge` event. Mount-time only. */
|
|
@@ -379,9 +389,11 @@ interface MoonPayChallengeProps {
|
|
|
379
389
|
onEvent?: (event: ChallengeSdk.Event) => void;
|
|
380
390
|
/** Container style. Defaults to flex: 1. */
|
|
381
391
|
style?: ViewStyle;
|
|
392
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
393
|
+
webViewProps?: Partial<WebViewProps>;
|
|
382
394
|
}
|
|
383
395
|
/** Inline 3DS/challenge frame. Mount it when a payment frame emits a `challenge` event. */
|
|
384
|
-
declare function MoonPayChallenge({ url, onEvent, style }: MoonPayChallengeProps): JSX.Element;
|
|
396
|
+
declare function MoonPayChallenge({ url, onEvent, style, webViewProps, }: MoonPayChallengeProps): JSX.Element;
|
|
385
397
|
|
|
386
398
|
interface MoonPayConnectProps {
|
|
387
399
|
/** Theme for this connect frame. Overrides the provider-level `theme`. Mount-time only. */
|
|
@@ -390,9 +402,11 @@ interface MoonPayConnectProps {
|
|
|
390
402
|
onEvent?: (event: ConnectSdk.Event) => void;
|
|
391
403
|
/** Container style. Defaults to flex: 1. */
|
|
392
404
|
style?: ViewStyle;
|
|
405
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
406
|
+
webViewProps?: Partial<WebViewProps>;
|
|
393
407
|
}
|
|
394
408
|
/** Inline connect frame. On an active completion, credentials are applied to the shared client automatically. */
|
|
395
|
-
declare function MoonPayConnect({ theme, onEvent, style }: MoonPayConnectProps): JSX.Element;
|
|
409
|
+
declare function MoonPayConnect({ theme, onEvent, style, webViewProps, }: MoonPayConnectProps): JSX.Element;
|
|
396
410
|
|
|
397
411
|
type ConnectionCheckEvent = {
|
|
398
412
|
kind: 'complete';
|
|
@@ -417,29 +431,35 @@ interface MoonPayConnectionCheckProps {
|
|
|
417
431
|
skipKyc?: boolean;
|
|
418
432
|
/** Emits `complete` with the Connection, or `error`. */
|
|
419
433
|
onEvent?: (event: ConnectionCheckEvent) => void;
|
|
434
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
435
|
+
webViewProps?: Partial<WebViewProps>;
|
|
420
436
|
}
|
|
421
437
|
/**
|
|
422
438
|
* Headless connection check (renders nothing visible). The declarative
|
|
423
439
|
* alternative to client.getConnection() — on an active connection,
|
|
424
440
|
* credentials are applied to the shared client automatically.
|
|
425
441
|
*/
|
|
426
|
-
declare function MoonPayConnectionCheck({ skipKyc, onEvent, }: MoonPayConnectionCheckProps): JSX.Element;
|
|
442
|
+
declare function MoonPayConnectionCheck({ skipKyc, onEvent, webViewProps, }: MoonPayConnectionCheckProps): JSX.Element;
|
|
427
443
|
|
|
428
444
|
interface MoonPayConnectionResetProps {
|
|
429
445
|
/** Callback for connection reset lifecycle events. */
|
|
430
446
|
onEvent?: (event: ConnectionResetEvent) => void;
|
|
447
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
448
|
+
webViewProps?: Partial<WebViewProps>;
|
|
431
449
|
}
|
|
432
450
|
/** Headless reset frame (renders nothing visible). The declarative alternative to client.resetConnection(). */
|
|
433
|
-
declare function MoonPayConnectionReset({ onEvent }: MoonPayConnectionResetProps): JSX.Element;
|
|
451
|
+
declare function MoonPayConnectionReset({ onEvent, webViewProps, }: MoonPayConnectionResetProps): JSX.Element;
|
|
434
452
|
|
|
435
453
|
interface MoonPayCustomerExportProps {
|
|
436
454
|
/** Callback for customer-export lifecycle events. */
|
|
437
455
|
onEvent?: (event: CustomerExportSdk.Event) => void;
|
|
438
456
|
/** Container style. Defaults to flex: 1. */
|
|
439
457
|
style?: ViewStyle;
|
|
458
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
459
|
+
webViewProps?: Partial<WebViewProps>;
|
|
440
460
|
}
|
|
441
461
|
/** Inline customer-export consent frame — embed export consent capture in your own layout. */
|
|
442
|
-
declare function MoonPayCustomerExport({ onEvent, style }: MoonPayCustomerExportProps): JSX.Element;
|
|
462
|
+
declare function MoonPayCustomerExport({ onEvent, style, webViewProps, }: MoonPayCustomerExportProps): JSX.Element;
|
|
443
463
|
|
|
444
464
|
interface MoonPayGooglePayButtonProps {
|
|
445
465
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -450,9 +470,11 @@ interface MoonPayGooglePayButtonProps {
|
|
|
450
470
|
onEvent?: (event: GooglePaySdk.Event) => void;
|
|
451
471
|
/** Container style. Defaults to height 48. */
|
|
452
472
|
style?: ViewStyle;
|
|
473
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
474
|
+
webViewProps?: Partial<WebViewProps>;
|
|
453
475
|
}
|
|
454
476
|
/** Inline Google Pay button. Render it wherever it should appear in your layout. */
|
|
455
|
-
declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, }: MoonPayGooglePayButtonProps): JSX.Element;
|
|
477
|
+
declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayGooglePayButtonProps): JSX.Element;
|
|
456
478
|
|
|
457
479
|
interface MoonPayWidgetProps {
|
|
458
480
|
/** Quote signature from getQuote(). Mount-time only — changing it reloads the widget. */
|
|
@@ -463,9 +485,11 @@ interface MoonPayWidgetProps {
|
|
|
463
485
|
onEvent?: (event: WidgetSdk.Event) => void;
|
|
464
486
|
/** Container style. Defaults to flex: 1. */
|
|
465
487
|
style?: ViewStyle;
|
|
488
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
489
|
+
webViewProps?: Partial<WebViewProps>;
|
|
466
490
|
}
|
|
467
491
|
/** Inline widget frame. Render it wherever it should appear in your layout. */
|
|
468
|
-
declare function MoonPayWidget({ quote, externalTransactionId, onEvent, style, }: MoonPayWidgetProps): JSX.Element;
|
|
492
|
+
declare function MoonPayWidget({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayWidgetProps): JSX.Element;
|
|
469
493
|
|
|
470
494
|
interface MoonPayFrameProps {
|
|
471
495
|
/** The transport instance managing this frame's communication. */
|
|
@@ -474,12 +498,18 @@ interface MoonPayFrameProps {
|
|
|
474
498
|
hidden?: boolean;
|
|
475
499
|
/** Optional style overrides for the container view. */
|
|
476
500
|
style?: ViewStyle;
|
|
501
|
+
/**
|
|
502
|
+
* Advanced: extra props forwarded to the underlying react-native-webview.
|
|
503
|
+
* `ref`, `source`, and `onMessage` are managed by the SDK and cannot be
|
|
504
|
+
* overridden; all other props (including `originWhitelist`) may be set here.
|
|
505
|
+
*/
|
|
506
|
+
webViewProps?: Partial<WebViewProps>;
|
|
477
507
|
}
|
|
478
508
|
/**
|
|
479
509
|
* Reusable React Native component that renders a MoonPay frame as a WebView.
|
|
480
510
|
* Bridges the WebViewTransport to the actual WebView instance.
|
|
481
511
|
*/
|
|
482
|
-
declare function MoonPayFrame({ transport, hidden, style }: MoonPayFrameProps): JSX.Element | null;
|
|
512
|
+
declare function MoonPayFrame({ transport, hidden, style, webViewProps, }: MoonPayFrameProps): JSX.Element | null;
|
|
483
513
|
|
|
484
514
|
interface MoonPayProviderProps {
|
|
485
515
|
/**
|