@funkit/connect-rn 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +72 -0
  2. package/dist/index.d.ts +11 -8
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3595 -612
  5. package/dist/index.js.map +4 -4
  6. package/dist/src/flow/AddressCopiedToast.d.ts +18 -0
  7. package/dist/src/flow/AddressCopiedToast.d.ts.map +1 -0
  8. package/dist/src/flow/FlowSheet.d.ts +47 -0
  9. package/dist/src/flow/FlowSheet.d.ts.map +1 -0
  10. package/dist/src/flow/FunkitFlowProvider.d.ts +23 -0
  11. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -0
  12. package/dist/src/flow/depositFlowConfig.d.ts +101 -0
  13. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -0
  14. package/dist/src/flow/useKeyboardHeight.d.ts +21 -0
  15. package/dist/src/flow/useKeyboardHeight.d.ts.map +1 -0
  16. package/dist/src/geo/isCountryBlocked.d.ts +3 -0
  17. package/dist/src/geo/isCountryBlocked.d.ts.map +1 -0
  18. package/dist/src/geo/useCheckoutBlocked.d.ts +10 -0
  19. package/dist/src/geo/useCheckoutBlocked.d.ts.map +1 -0
  20. package/dist/src/geo/useUserIpInfo.d.ts +22 -0
  21. package/dist/src/geo/useUserIpInfo.d.ts.map +1 -0
  22. package/dist/src/icons/CopyAddressIcon.d.ts +9 -0
  23. package/dist/src/icons/CopyAddressIcon.d.ts.map +1 -0
  24. package/dist/src/icons/CryptoBitcoinIcon.d.ts +9 -0
  25. package/dist/src/icons/CryptoBitcoinIcon.d.ts.map +1 -0
  26. package/dist/src/icons/CryptoTransferQRIcon.d.ts +9 -0
  27. package/dist/src/icons/CryptoTransferQRIcon.d.ts.map +1 -0
  28. package/dist/src/icons/FigmaSystemIcons.d.ts +19 -0
  29. package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -0
  30. package/dist/src/icons/FunIcon.d.ts +18 -0
  31. package/dist/src/icons/FunIcon.d.ts.map +1 -0
  32. package/dist/src/icons/PaymentBrandIcons.d.ts +24 -0
  33. package/dist/src/icons/PaymentBrandIcons.d.ts.map +1 -0
  34. package/dist/src/icons/QrChainCluster.d.ts +22 -0
  35. package/dist/src/icons/QrChainCluster.d.ts.map +1 -0
  36. package/dist/src/icons/SourceTokenCluster.d.ts +31 -0
  37. package/dist/src/icons/SourceTokenCluster.d.ts.map +1 -0
  38. package/dist/src/icons/TokenChainIcon.d.ts +19 -0
  39. package/dist/src/icons/TokenChainIcon.d.ts.map +1 -0
  40. package/dist/src/icons/assetLogos.d.ts +12 -0
  41. package/dist/src/icons/assetLogos.d.ts.map +1 -0
  42. package/dist/src/icons/funIconUri.d.ts +16 -0
  43. package/dist/src/icons/funIconUri.d.ts.map +1 -0
  44. package/dist/src/identity/IdentityContext.d.ts +30 -1
  45. package/dist/src/identity/IdentityContext.d.ts.map +1 -1
  46. package/dist/src/logging/datadogHttpLogTransport.d.ts +0 -7
  47. package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
  48. package/dist/src/providers/FunkitProvider.d.ts +37 -6
  49. package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
  50. package/dist/src/providers/FunkitStatsigProvider.d.ts +6 -2
  51. package/dist/src/providers/FunkitStatsigProvider.d.ts.map +1 -1
  52. package/dist/src/providers/useFunkitCheckout.d.ts +14 -0
  53. package/dist/src/providers/useFunkitCheckout.d.ts.map +1 -0
  54. package/dist/src/screens/AddMoneyScreen.d.ts +57 -2
  55. package/dist/src/screens/AddMoneyScreen.d.ts.map +1 -1
  56. package/dist/src/screens/AvailableChainsScreen.d.ts +33 -0
  57. package/dist/src/screens/AvailableChainsScreen.d.ts.map +1 -0
  58. package/dist/src/screens/CheckoutBlockedScreen.d.ts +2 -0
  59. package/dist/src/screens/CheckoutBlockedScreen.d.ts.map +1 -0
  60. package/dist/src/screens/NetworkSelector.d.ts +31 -0
  61. package/dist/src/screens/NetworkSelector.d.ts.map +1 -0
  62. package/dist/src/screens/QrCodeScreen.d.ts +30 -14
  63. package/dist/src/screens/QrCodeScreen.d.ts.map +1 -1
  64. package/dist/src/screens/TransferCryptoScreen.d.ts +25 -12
  65. package/dist/src/screens/TransferCryptoScreen.d.ts.map +1 -1
  66. package/dist/src/statsig/statsigMetadata.d.ts.map +1 -1
  67. package/dist/src/swapped/SwappedScreen.d.ts +21 -0
  68. package/dist/src/swapped/SwappedScreen.d.ts.map +1 -0
  69. package/dist/src/swapped/SwappedWebView.d.ts +18 -0
  70. package/dist/src/swapped/SwappedWebView.d.ts.map +1 -0
  71. package/dist/src/swapped/buildSwappedTheme.d.ts +31 -0
  72. package/dist/src/swapped/buildSwappedTheme.d.ts.map +1 -0
  73. package/dist/src/swapped/webViewSwappedTransport.d.ts +74 -0
  74. package/dist/src/swapped/webViewSwappedTransport.d.ts.map +1 -0
  75. package/dist/src/theme/FunkitThemeProvider.d.ts +14 -2
  76. package/dist/src/theme/FunkitThemeProvider.d.ts.map +1 -1
  77. package/dist/src/theme/restyle.d.ts +1140 -513
  78. package/dist/src/theme/restyle.d.ts.map +1 -1
  79. package/dist/src/theme/toRestyleTheme.d.ts +90 -48
  80. package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
  81. package/dist/src/theme/tokens.d.ts +52 -8
  82. package/dist/src/theme/tokens.d.ts.map +1 -1
  83. package/dist/src/theme/useFunkitTheme.d.ts +4 -10
  84. package/dist/src/theme/useFunkitTheme.d.ts.map +1 -1
  85. package/dist/src/transfer/QrCode.d.ts +24 -0
  86. package/dist/src/transfer/QrCode.d.ts.map +1 -0
  87. package/dist/src/transfer/availableChains.d.ts +53 -0
  88. package/dist/src/transfer/availableChains.d.ts.map +1 -0
  89. package/dist/src/transfer/clipboard.d.ts +23 -0
  90. package/dist/src/transfer/clipboard.d.ts.map +1 -0
  91. package/dist/src/transfer/fops.d.ts +26 -0
  92. package/dist/src/transfer/fops.d.ts.map +1 -0
  93. package/dist/src/transfer/formatDepositAddress.d.ts +9 -0
  94. package/dist/src/transfer/formatDepositAddress.d.ts.map +1 -0
  95. package/dist/src/transfer/hooks/useFops.d.ts +47 -0
  96. package/dist/src/transfer/hooks/useFops.d.ts.map +1 -0
  97. package/dist/src/transfer/hooks/useSupportedTokens.d.ts +26 -0
  98. package/dist/src/transfer/hooks/useSupportedTokens.d.ts.map +1 -0
  99. package/dist/src/transfer/hooks/useTokenTransfer.d.ts +4 -2
  100. package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -1
  101. package/dist/src/transfer/hooks/useTransferInit.d.ts +1 -1
  102. package/dist/src/transfer/hooks/useTransferInit.d.ts.map +1 -1
  103. package/dist/src/transfer/hooks/useUDAParams.d.ts +1 -1
  104. package/dist/src/transfer/hooks/useUDAParams.d.ts.map +1 -1
  105. package/dist/src/transfer/supportedTokens.d.ts +34 -0
  106. package/dist/src/transfer/supportedTokens.d.ts.map +1 -0
  107. package/dist/src/version.d.ts +2 -0
  108. package/dist/src/version.d.ts.map +1 -0
  109. package/package.json +31 -4
  110. package/dist/src/icons/CopyIcon.d.ts +0 -3
  111. package/dist/src/icons/CopyIcon.d.ts.map +0 -1
  112. package/dist/src/icons/NetworkIconFallback.d.ts +0 -3
  113. package/dist/src/icons/NetworkIconFallback.d.ts.map +0 -1
  114. package/dist/src/icons/QrCodeIcon.d.ts +0 -3
  115. package/dist/src/icons/QrCodeIcon.d.ts.map +0 -1
  116. package/dist/src/theme/colorSchemeContext.d.ts +0 -22
  117. package/dist/src/theme/colorSchemeContext.d.ts.map +0 -1
@@ -0,0 +1,47 @@
1
+ import { type SwappedFormOfPayment } from '@funkit/api-base';
2
+ import { type CheckoutTokenTransferConfig } from '@funkit/connect-core';
3
+ export interface UseFopsParams {
4
+ /** Destination chain/asset — drives the deposit recipient + FOP query. */
5
+ checkoutConfig: CheckoutTokenTransferConfig | undefined;
6
+ dynamicRoutingId?: string;
7
+ enabled?: boolean;
8
+ }
9
+ export interface UseFopsResult {
10
+ /**
11
+ * The user's saved forms of payment (e.g. "Mastercard (…3869)"). Rendered at
12
+ * the top of the Add money list, above the Crypto row — mirroring web, where
13
+ * saved FOPs sort first.
14
+ */
15
+ savedFops: SwappedFormOfPayment[];
16
+ /** Generic forms of payment (Card / Apple Pay / Revolut Pay / Bank Transfer). */
17
+ genericFops: SwappedFormOfPayment[];
18
+ isLoading: boolean;
19
+ isFetching: boolean;
20
+ /** The FOPs fetch failed (network / API). Drives the Add money error state. */
21
+ isError: boolean;
22
+ /** Re-run the FOPs fetch (the Add money "Try again" action). */
23
+ refetch: () => void;
24
+ /** Whether Swapped (cash) methods are offered at all. */
25
+ isSwappedEnabled: boolean;
26
+ }
27
+ /**
28
+ * Thin RN port of `@funkit/connect`'s `useFops`: fetches the Swapped forms of
29
+ * payment (`getFops`) that populate the "Use Cash" tab. Identity comes from
30
+ * {@link useFunkitIdentity}; the deposit recipient is derived from
31
+ * {@link useTransferInit} + the core `getDepositAddressForChain`.
32
+ *
33
+ * The active theme is forwarded as Swapped theme query params
34
+ * ({@link buildSwappedThemeQueryParamsRN}); the API bakes them into each
35
+ * returned `embeddedFlowUrl` so the widget's boot spinner/skeleton are themed
36
+ * before its message listener (and the `SWAPPED_THEME` postMessage) is up.
37
+ *
38
+ * Adaptations vs. web (per the connect-rn V1 scope):
39
+ * - **No geo-fencing.** Web gates the query on `useFunkitUserIp` and passes the
40
+ * user's `countryCode`; RN omits both (`countryCode` is optional on
41
+ * `GetFopsParams`), so FOPs are fetched regardless of region.
42
+ * - The EUR min-amount (`checkoutLimitsCriteria`) and `validateFops` are
43
+ * dropped for V1 (see TODOs). The fiat currency is resolved from the user's
44
+ * region via the shared `useSwappedDefaultCurrencyQuery` (web parity).
45
+ */
46
+ export declare function useFops({ checkoutConfig, dynamicRoutingId, enabled, }: UseFopsParams): UseFopsResult;
47
+ //# sourceMappingURL=useFops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFops.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useFops.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAA;AAKzB,OAAO,EACL,KAAK,2BAA2B,EAOjC,MAAM,sBAAsB,CAAA;AAwB7B,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,SAAS,EAAE,oBAAoB,EAAE,CAAA;IACjC,iFAAiF;IACjF,WAAW,EAAE,oBAAoB,EAAE,CAAA;IACnC,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,yDAAyD;IACzD,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,EACtB,cAAc,EACd,gBAAgB,EAChB,OAAc,GACf,EAAE,aAAa,GAAG,aAAa,CAgI/B"}
@@ -0,0 +1,26 @@
1
+ import type { CheckoutInitTokenTransferResponse } from '@funkit/api-base';
2
+ import { type SupportedToken, type TokenChainFilter } from '../supportedTokens';
3
+ export interface UseSupportedTokensResult {
4
+ /** Curated deposit tokens (no icons attached), priority symbols first. */
5
+ tokens: SupportedToken[];
6
+ /** `All` + one chip per configured chain. */
7
+ chainFilters: TokenChainFilter[];
8
+ isLoading: boolean;
9
+ }
10
+ /**
11
+ * Fetch + resolve the deposit token list the same way the web SDK does: the
12
+ * curated Statsig `tokentransferconfig` (chains + asset addresses), filtered by
13
+ * the disabled list and merged with `@funkit/api-base`'s `getSupportedAssets`
14
+ * metadata (`resolveTokenTransferConfig`, shared via connect-core) — NOT the raw
15
+ * allow-list. Identity (apiKey) comes from {@link useFunkitIdentity}; the query
16
+ * is disabled until an apiKey is present.
17
+ *
18
+ * `transferInit` gates which chains are offered: Solana / Bitcoin / Tron only
19
+ * appear once the deposit-init response carries their address (mirrors web's
20
+ * `useEnabledTokenTransferChainTokens` via the shared `isTransferChainEnabled`).
21
+ */
22
+ export declare function useSupportedTokens({ enabled, transferInit, }?: {
23
+ enabled?: boolean;
24
+ transferInit?: CheckoutInitTokenTransferResponse;
25
+ }): UseSupportedTokensResult;
26
+ //# sourceMappingURL=useSupportedTokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSupportedTokens.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useSupportedTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,kBAAkB,CAAA;AAYzE,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAA;AAE3B,MAAM,WAAW,wBAAwB;IACvC,0EAA0E;IAC1E,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,6CAA6C;IAC7C,YAAY,EAAE,gBAAgB,EAAE,CAAA;IAChC,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAc,EACd,YAAY,GACb,GAAE;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,iCAAiC,CAAA;CAC5C,GAAG,wBAAwB,CA0ChC"}
@@ -1,15 +1,17 @@
1
- import type { FunAddress } from '@funkit/api-base';
1
+ import type { CheckoutInitTokenTransferResponse, FunAddress } from '@funkit/api-base';
2
2
  import { type CheckoutTokenTransferConfig, type QRCodeUri, type TransferTokenQrCodeType } from '@funkit/connect-core';
3
3
  export interface UseTokenTransferParams {
4
4
  checkoutConfig: CheckoutTokenTransferConfig | undefined;
5
5
  /** Chain the user picked to send funds on. */
6
6
  selectedChainId: number | undefined;
7
- dynamicRoutingId: string | null;
7
+ dynamicRoutingId?: string;
8
8
  enabled?: boolean;
9
9
  }
10
10
  export interface UseTokenTransferResult {
11
11
  /** Where the user sends funds first. */
12
12
  depositAddress: FunAddress | undefined;
13
+ /** Raw deposit-init response (per-chain addresses); gates which chains show. */
14
+ transferInit: CheckoutInitTokenTransferResponse | undefined;
13
15
  /** Final destination of the funds. */
14
16
  recipientAddr: string;
15
17
  /** Minimum transfer value (USD) for the selected chain, rounded up. */
@@ -1 +1 @@
1
- {"version":3,"file":"useTokenTransfer.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useTokenTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACd,KAAK,uBAAuB,EAK7B,MAAM,sBAAsB,CAAA;AAuB7B,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,8CAA8C;IAC9C,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,cAAc,EAAE,UAAU,GAAG,SAAS,CAAA;IACtC,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAA;IACrB,uEAAuE;IACvE,cAAc,EAAE,MAAM,CAAA;IACtB,0CAA0C;IAC1C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,uBAAuB,CAAA;IACnC,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,OAAO,GACR,EAAE,sBAAsB,GAAG,sBAAsB,CAmCjD"}
1
+ {"version":3,"file":"useTokenTransfer.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useTokenTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,UAAU,EACX,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACd,KAAK,uBAAuB,EAK7B,MAAM,sBAAsB,CAAA;AAuB7B,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,8CAA8C;IAC9C,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,cAAc,EAAE,UAAU,GAAG,SAAS,CAAA;IACtC,gFAAgF;IAChF,YAAY,EAAE,iCAAiC,GAAG,SAAS,CAAA;IAC3D,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAA;IACrB,uEAAuE;IACvE,cAAc,EAAE,MAAM,CAAA;IACtB,0CAA0C;IAC1C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,uBAAuB,CAAA;IACnC,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,OAAO,GACR,EAAE,sBAAsB,GAAG,sBAAsB,CAoCjD"}
@@ -6,7 +6,7 @@ export interface UseTransferInitParams {
6
6
  /** Final recipient. Defaults to the identity's wallet address. */
7
7
  recipientAddr?: FunAddress;
8
8
  /** Dynamic-routing id used to resolve UDA params. */
9
- dynamicRoutingId: string | null;
9
+ dynamicRoutingId?: string;
10
10
  /** Gate the network call (e.g. only when the screen is visible). */
11
11
  enabled?: boolean;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useTransferInit.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useTransferInit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iCAAiC,EACtC,KAAK,UAAU,EAEhB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,2BAA2B,EAGjC,MAAM,sBAAsB,CAAA;AAmC7B,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,kEAAkE;IAClE,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,qDAAqD;IACrD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,iCAAiC,GAAG,SAAS,CAAA;IAC3D,aAAa,EAAE,UAAU,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,OAAc,GACf,EAAE,qBAAqB,GAAG,qBAAqB,CAsC/C"}
1
+ {"version":3,"file":"useTransferInit.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useTransferInit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iCAAiC,EACtC,KAAK,UAAU,EAEhB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,sBAAsB,CAAA;AAa7B,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,kEAAkE;IAClE,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,iCAAiC,GAAG,SAAS,CAAA;IAC3D,aAAa,EAAE,UAAU,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,OAAc,GACf,EAAE,qBAAqB,GAAG,qBAAqB,CAsC/C"}
@@ -5,5 +5,5 @@ import { type UDAConfig } from '@funkit/connect-core';
5
5
  * `uda_params` Statsig dynamic config. Unlike web, the routing id is passed in
6
6
  * (web reads it from the checkout context, which RN doesn't have).
7
7
  */
8
- export declare function useUDAParams(dynamicRoutingId: string | null): UDAConfig | undefined;
8
+ export declare function useUDAParams(dynamicRoutingId?: string): UDAConfig | undefined;
9
9
  //# sourceMappingURL=useUDAParams.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useUDAParams.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useUDAParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,sBAAsB,CAAA;AAGvE;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAC9B,SAAS,GAAG,SAAS,CAUvB"}
1
+ {"version":3,"file":"useUDAParams.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useUDAParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,sBAAsB,CAAA;AAGvE;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAQ7E"}
@@ -0,0 +1,34 @@
1
+ import type { TokenTransferConfigResult } from '@funkit/connect-core';
2
+ /**
3
+ * One curated deposit token (chain + asset), produced from the resolved
4
+ * `tokentransferconfig`. Consumed by the deposit flow (its chains drive the
5
+ * "Available chains" list).
6
+ */
7
+ export interface SupportedToken {
8
+ id: string;
9
+ symbol: string;
10
+ /** Chain shown on the trailing side, e.g. "Ethereum". */
11
+ chainLabel: string;
12
+ /** Numeric chain id — used to derive the available-chains list + re-target. */
13
+ chainId?: number;
14
+ /** Token contract address. */
15
+ address?: string;
16
+ }
17
+ /** A curated chain entry. The first is usually `{ id: 'all', label: 'All' }`. */
18
+ export interface TokenChainFilter {
19
+ id: string;
20
+ label: string;
21
+ }
22
+ /**
23
+ * Flatten a resolved token-transfer config (the curated Statsig
24
+ * `tokentransferconfig` merged with `/assets/supported` metadata — see
25
+ * `resolveTokenTransferConfig`) into the supported-tokens screen's token rows +
26
+ * chain-filter chips. One row per curated (chain, asset); chains keep their
27
+ * config order; priority symbols float to the top. NOT the raw allow-list, so
28
+ * no meme coins — only the customer's configured deposit tokens.
29
+ */
30
+ export declare function buildSupportedTokenList(resolved: TokenTransferConfigResult): {
31
+ tokens: SupportedToken[];
32
+ chainFilters: TokenChainFilter[];
33
+ };
34
+ //# sourceMappingURL=supportedTokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supportedTokens.d.ts","sourceRoot":"","sources":["../../../src/transfer/supportedTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAErE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAA;IAClB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,yBAAyB,GAAG;IAC5E,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,YAAY,EAAE,gBAAgB,EAAE,CAAA;CACjC,CAgCA"}
@@ -0,0 +1,2 @@
1
+ export declare const CONNECT_RN_VERSION: string;
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,EAAE,MAGhB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect-rn",
3
- "version": "0.2.0",
3
+ "version": "1.0.0",
4
4
  "description": "React Native bindings for @funkit/connect. Re-exports the headless @funkit/connect-core logic; the RN platform halves (Restyle theme, WebView Swapped transport, Transfer/Swapped screens, logging) land in later releases.",
5
5
  "files": [
6
6
  "dist"
@@ -25,30 +25,50 @@
25
25
  "dependencies": {
26
26
  "@shopify/restyle": "^2.4.5",
27
27
  "@funkit/api-base": "4.5.1",
28
- "@funkit/chains": "2.1.0",
29
- "@funkit/connect-core": "1.0.0"
28
+ "@funkit/chains": "2.1.1",
29
+ "@funkit/connect-core": "1.1.0"
30
30
  },
31
31
  "peerDependencies": {
32
+ "@gorhom/bottom-sheet": ">=5",
32
33
  "@react-native-async-storage/async-storage": ">=1.23.1",
34
+ "@react-native-clipboard/clipboard": ">=1.13.0",
33
35
  "@statsig/react-bindings": ">=3.25",
34
36
  "@tanstack/react-query": ">=5.0.0",
35
37
  "i18next": ">=23",
36
38
  "react": ">=18",
37
39
  "react-native": ">=0.74",
40
+ "react-native-gesture-handler": ">=2.0.0",
41
+ "react-native-qrcode-svg": ">=6.3.0",
42
+ "react-native-reanimated": ">=3.0.0",
43
+ "react-native-svg": ">=15.0.0",
44
+ "react-native-webview": ">=13.0.0",
38
45
  "viem": ">=2.22.14"
39
46
  },
40
47
  "devDependencies": {
48
+ "@gorhom/bottom-sheet": "5.2.14",
41
49
  "@react-native-async-storage/async-storage": "2.2.0",
50
+ "@react-native-clipboard/clipboard": "1.16.3",
42
51
  "@statsig/react-bindings": "3.25.4",
52
+ "@storybook/react-native-web-vite": "^10.4.6",
43
53
  "@tanstack/react-query": "5.76.1",
44
54
  "@types/react": "^19.2.2",
55
+ "@types/react-dom": "^19.0.0",
45
56
  "@types/react-test-renderer": "^19.1.0",
46
57
  "i18next": "25.6.2",
47
58
  "react": "^19.0.0",
59
+ "react-dom": "^19.0.0",
48
60
  "react-native": "0.85.3",
61
+ "react-native-gesture-handler": "2.31.2",
62
+ "react-native-qrcode-svg": "6.3.21",
63
+ "react-native-reanimated": "4.3.1",
64
+ "react-native-svg": "15.15.5",
65
+ "react-native-web": "^0.21.2",
66
+ "react-native-webview": "13.16.0",
49
67
  "react-test-renderer": "19.2.4",
68
+ "storybook": "^10.4.6",
50
69
  "tsc-alias": "1.8.16",
51
70
  "viem": ">=2.22.14",
71
+ "vite": "^6.4.2",
52
72
  "vitest": "^4.1.6"
53
73
  },
54
74
  "repository": {
@@ -57,6 +77,11 @@
57
77
  "directory": "packages/connect-rn"
58
78
  },
59
79
  "homepage": "https://github.com/fun-xyz/funkit/tree/main/packages/connect-rn",
80
+ "peerDependenciesMeta": {
81
+ "@react-native-clipboard/clipboard": {
82
+ "optional": true
83
+ }
84
+ },
60
85
  "scripts": {
61
86
  "build": "node build.js && pnpm typecheck",
62
87
  "build:watch": "node build.js --watch",
@@ -67,6 +92,8 @@
67
92
  "typegen:watch": "tsc --project tsconfig.build.json --emitDeclarationOnly --watch",
68
93
  "lint": "oxlint",
69
94
  "lint:fix": "oxlint --fix",
70
- "test": "vitest"
95
+ "test": "vitest",
96
+ "storybook": "storybook dev -p 7007",
97
+ "build-storybook": "storybook build"
71
98
  }
72
99
  }
@@ -1,3 +0,0 @@
1
- /** Two overlapping rounded squares = copy icon. */
2
- export declare function CopyIcon(): import("react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=CopyIcon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CopyIcon.d.ts","sourceRoot":"","sources":["../../../src/icons/CopyIcon.tsx"],"names":[],"mappings":"AAIA,mDAAmD;AACnD,wBAAgB,QAAQ,4CAYvB"}
@@ -1,3 +0,0 @@
1
- /** Themed circle placeholder for a host-supplied chain cluster. */
2
- export declare function NetworkIconFallback(): import("react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=NetworkIconFallback.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NetworkIconFallback.d.ts","sourceRoot":"","sources":["../../../src/icons/NetworkIconFallback.tsx"],"names":[],"mappings":"AAEA,mEAAmE;AACnE,wBAAgB,mBAAmB,4CASlC"}
@@ -1,3 +0,0 @@
1
- /** Minimal 2×2 QR placeholder built from theme-colored boxes. */
2
- export declare function QrCodeIcon(): import("react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=QrCodeIcon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QrCodeIcon.d.ts","sourceRoot":"","sources":["../../../src/icons/QrCodeIcon.tsx"],"names":[],"mappings":"AAIA,iEAAiE;AACjE,wBAAgB,UAAU,4CAoBzB"}
@@ -1,22 +0,0 @@
1
- import type { ColorScheme } from './useColorScheme';
2
- /**
3
- * The active color scheme + manual toggle published by `FunkitThemeProvider`.
4
- * Lives in its own module so both the provider and the standalone
5
- * `useFunkitTheme` hook can read it without importing each other (which would
6
- * create a circular dependency).
7
- */
8
- export interface FunkitColorSchemeValue {
9
- /** The active, resolved color scheme. */
10
- colorScheme: ColorScheme;
11
- /**
12
- * Flip light↔dark, or set a specific scheme when an argument is given.
13
- * **No-op when the provider's `colorScheme` prop is set** (controlled mode) —
14
- * the host owns the scheme in that case.
15
- */
16
- toggleColorScheme: (next?: ColorScheme) => void;
17
- /** True when the scheme is forced by the `colorScheme` prop (uncontrolled toggle disabled). */
18
- isControlled: boolean;
19
- }
20
- /** `null` when read outside a `FunkitProvider`. */
21
- export declare const FunkitColorSchemeContext: import("react").Context<FunkitColorSchemeValue | null>;
22
- //# sourceMappingURL=colorSchemeContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"colorSchemeContext.d.ts","sourceRoot":"","sources":["../../../src/theme/colorSchemeContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,WAAW,EAAE,WAAW,CAAA;IACxB;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC/C,+FAA+F;IAC/F,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,mDAAmD;AACnD,eAAO,MAAM,wBAAwB,wDACe,CAAA"}