@funkit/connect-rn 9.1.1 → 9.2.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 (143) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +5 -3
  3. package/dist/{chunk-RPYWTS42.js → chunk-5DJHIA7X.js} +97 -105
  4. package/dist/chunk-5DJHIA7X.js.map +7 -0
  5. package/dist/{chunk-5Y2EMQYX.js → chunk-AI6F43VP.js} +3 -3
  6. package/dist/{chunk-ZE77GVDW.js → chunk-KOJEF2II.js} +97 -29
  7. package/dist/chunk-KOJEF2II.js.map +7 -0
  8. package/dist/{chunk-OBY3O4LU.js → chunk-OW6L3UM7.js} +3 -1
  9. package/dist/chunk-OW6L3UM7.js.map +7 -0
  10. package/dist/clients/lighter.js +2 -2
  11. package/dist/clients/nado.js +3 -3
  12. package/dist/clients/solana.js +1 -1
  13. package/dist/index.js +5057 -3771
  14. package/dist/index.js.map +4 -4
  15. package/dist/preview.js +113 -6
  16. package/dist/preview.js.map +2 -2
  17. package/dist/src/components/AmountDisplay.d.ts +2 -2
  18. package/dist/src/components/AmountDisplay.d.ts.map +1 -1
  19. package/dist/src/components/AssetList.d.ts +27 -0
  20. package/dist/src/components/AssetList.d.ts.map +1 -0
  21. package/dist/src/components/DepositQrCard.d.ts +20 -0
  22. package/dist/src/components/DepositQrCard.d.ts.map +1 -0
  23. package/dist/src/components/PasteAddressPanel.d.ts +16 -0
  24. package/dist/src/components/PasteAddressPanel.d.ts.map +1 -0
  25. package/dist/src/components/SearchInput.d.ts +4 -1
  26. package/dist/src/components/SearchInput.d.ts.map +1 -1
  27. package/dist/src/components/SearchableAssetListSheet.d.ts +16 -0
  28. package/dist/src/components/SearchableAssetListSheet.d.ts.map +1 -0
  29. package/dist/src/components/TokenChainSelector.d.ts +15 -0
  30. package/dist/src/components/TokenChainSelector.d.ts.map +1 -0
  31. package/dist/src/components/WalletAddressInput.d.ts +23 -10
  32. package/dist/src/components/WalletAddressInput.d.ts.map +1 -1
  33. package/dist/src/components/WithdrawSourceCard.d.ts +13 -2
  34. package/dist/src/components/WithdrawSourceCard.d.ts.map +1 -1
  35. package/dist/src/fiat/FiatKycOptionRow.d.ts +4 -1
  36. package/dist/src/fiat/FiatKycOptionRow.d.ts.map +1 -1
  37. package/dist/src/fiat/FiatKycOutcomeScreen.d.ts +1 -4
  38. package/dist/src/fiat/FiatKycOutcomeScreen.d.ts.map +1 -1
  39. package/dist/src/fiat/FiatStatusScreen.d.ts +1 -0
  40. package/dist/src/fiat/FiatStatusScreen.d.ts.map +1 -1
  41. package/dist/src/fiat/FiatStepFailedScreen.d.ts.map +1 -1
  42. package/dist/src/fiat/closeFailure.d.ts +4 -1
  43. package/dist/src/fiat/closeFailure.d.ts.map +1 -1
  44. package/dist/src/fiat/kycFailover.d.ts +8 -4
  45. package/dist/src/fiat/kycFailover.d.ts.map +1 -1
  46. package/dist/src/fiat/kycOptionRows.d.ts +7 -3
  47. package/dist/src/fiat/kycOptionRows.d.ts.map +1 -1
  48. package/dist/src/fiat/providerFailover.d.ts +34 -0
  49. package/dist/src/fiat/providerFailover.d.ts.map +1 -0
  50. package/dist/src/fiat/providers/adapter.d.ts +8 -1
  51. package/dist/src/fiat/providers/adapter.d.ts.map +1 -1
  52. package/dist/src/fiat/providers/coinbase/CoinbaseCheckoutSurface.d.ts +3 -1
  53. package/dist/src/fiat/providers/coinbase/CoinbaseCheckoutSurface.d.ts.map +1 -1
  54. package/dist/src/fiat/providers/coinbase/coinbaseOnrampEvents.d.ts +9 -0
  55. package/dist/src/fiat/providers/coinbase/coinbaseOnrampEvents.d.ts.map +1 -1
  56. package/dist/src/fiat/providers/moonpay/moonpay.d.ts.map +1 -1
  57. package/dist/src/fiat/providers/stripe/StripeSessionAuthScreen.d.ts.map +1 -1
  58. package/dist/src/fiat/providers/stripe/stripeLinkWarmup.d.ts +29 -0
  59. package/dist/src/fiat/providers/stripe/stripeLinkWarmup.d.ts.map +1 -0
  60. package/dist/src/fiat/providers/stripe/stripePayment.d.ts +1 -1
  61. package/dist/src/fiat/providers/stripe/stripePayment.d.ts.map +1 -1
  62. package/dist/src/fiat/providers/stripe/stripePreparedPayment.d.ts +22 -0
  63. package/dist/src/fiat/providers/stripe/stripePreparedPayment.d.ts.map +1 -0
  64. package/dist/src/fiat/providers/stripe/stripeRoundPush.d.ts +6 -0
  65. package/dist/src/fiat/providers/stripe/stripeRoundPush.d.ts.map +1 -1
  66. package/dist/src/fiat/providers/stripe/useStripeOnrampClient.d.ts.map +1 -1
  67. package/dist/src/fiat/useKycCompletion.d.ts +17 -5
  68. package/dist/src/fiat/useKycCompletion.d.ts.map +1 -1
  69. package/dist/src/flow/DepositFlowContent.d.ts.map +1 -1
  70. package/dist/src/flow/Drawer.d.ts.map +1 -1
  71. package/dist/src/flow/FiatDepositAmountStep.d.ts.map +1 -1
  72. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  73. package/dist/src/flow/flowStepHeight.d.ts +4 -8
  74. package/dist/src/flow/flowStepHeight.d.ts.map +1 -1
  75. package/dist/src/flow/useDepositSelection.d.ts +38 -0
  76. package/dist/src/flow/useDepositSelection.d.ts.map +1 -0
  77. package/dist/src/hooks/useNestedSheet.d.ts +12 -0
  78. package/dist/src/hooks/useNestedSheet.d.ts.map +1 -1
  79. package/dist/src/icons/FigmaSystemIcons.d.ts +1 -0
  80. package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -1
  81. package/dist/src/icons/FunIcon.d.ts +2 -2
  82. package/dist/src/icons/FunIcon.d.ts.map +1 -1
  83. package/dist/src/icons/HandTapIcon.d.ts +4 -0
  84. package/dist/src/icons/HandTapIcon.d.ts.map +1 -0
  85. package/dist/src/icons/iconSvg.d.ts +10 -0
  86. package/dist/src/icons/iconSvg.d.ts.map +1 -0
  87. package/dist/src/logging/datadogHttpLogTransport.d.ts +20 -2
  88. package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
  89. package/dist/src/logging/logger.d.ts +5 -5
  90. package/dist/src/logging/logger.d.ts.map +1 -1
  91. package/dist/src/preview/flowPreview.d.ts +7 -1
  92. package/dist/src/preview/flowPreview.d.ts.map +1 -1
  93. package/dist/src/preview/previewFetch.d.ts.map +1 -1
  94. package/dist/src/preview/scenarioCatalog.d.ts +34 -1
  95. package/dist/src/preview/scenarioCatalog.d.ts.map +1 -1
  96. package/dist/src/preview/scenarios.d.ts +2 -0
  97. package/dist/src/preview/scenarios.d.ts.map +1 -1
  98. package/dist/src/providers/FunkitStatsigProvider.d.ts.map +1 -1
  99. package/dist/src/screens/LockedTransferCryptoScreen.d.ts +11 -6
  100. package/dist/src/screens/LockedTransferCryptoScreen.d.ts.map +1 -1
  101. package/dist/src/screens/SelectAvailableChainScreen.d.ts +12 -0
  102. package/dist/src/screens/SelectAvailableChainScreen.d.ts.map +1 -0
  103. package/dist/src/screens/SelectChainScreen.d.ts.map +1 -1
  104. package/dist/src/screens/SelectReceiveTokenScreen.d.ts.map +1 -1
  105. package/dist/src/screens/WithdrawAddressScreen.d.ts +6 -1
  106. package/dist/src/screens/WithdrawAddressScreen.d.ts.map +1 -1
  107. package/dist/src/screens/WithdrawAmountScreen.d.ts +6 -1
  108. package/dist/src/screens/WithdrawAmountScreen.d.ts.map +1 -1
  109. package/dist/src/screens/WithdrawCryptoSteps.d.ts.map +1 -1
  110. package/dist/src/transfer/DepositQrCode.d.ts +31 -0
  111. package/dist/src/transfer/DepositQrCode.d.ts.map +1 -0
  112. package/dist/src/transfer/DepositQrGlyph.d.ts +15 -0
  113. package/dist/src/transfer/DepositQrGlyph.d.ts.map +1 -0
  114. package/dist/src/transfer/depositQrCodeUri.d.ts +8 -0
  115. package/dist/src/transfer/depositQrCodeUri.d.ts.map +1 -0
  116. package/dist/src/transfer/depositSelection.d.ts +13 -0
  117. package/dist/src/transfer/depositSelection.d.ts.map +1 -0
  118. package/dist/src/transfer/hooks/useLockedTokenAmount.d.ts +2 -0
  119. package/dist/src/transfer/hooks/useLockedTokenAmount.d.ts.map +1 -1
  120. package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -1
  121. package/dist/src/transfer/lockedTokenAmount.d.ts +13 -0
  122. package/dist/src/transfer/lockedTokenAmount.d.ts.map +1 -1
  123. package/dist/src/transfer/monoChainLogo.d.ts +20 -0
  124. package/dist/src/transfer/monoChainLogo.d.ts.map +1 -0
  125. package/dist/src/transfer/qrModules.d.ts +20 -0
  126. package/dist/src/transfer/qrModules.d.ts.map +1 -0
  127. package/dist/src/utils/assetSearch.d.ts +5 -0
  128. package/dist/src/utils/assetSearch.d.ts.map +1 -0
  129. package/dist/src/utils/formatAmount.d.ts +4 -3
  130. package/dist/src/utils/formatAmount.d.ts.map +1 -1
  131. package/dist/src/utils/tokenAndChainPicker.d.ts +2 -0
  132. package/dist/src/utils/tokenAndChainPicker.d.ts.map +1 -1
  133. package/dist/src/utils/tokenOnChainJoiner.d.ts +12 -0
  134. package/dist/src/utils/tokenOnChainJoiner.d.ts.map +1 -0
  135. package/dist/src/withdrawal/useCryptoWithdrawalForm.d.ts +1 -0
  136. package/dist/src/withdrawal/useCryptoWithdrawalForm.d.ts.map +1 -1
  137. package/dist/src/withdrawal/useWithdrawalSourceTokenBalance.d.ts +11 -2
  138. package/dist/src/withdrawal/useWithdrawalSourceTokenBalance.d.ts.map +1 -1
  139. package/package.json +6 -4
  140. package/dist/chunk-OBY3O4LU.js.map +0 -7
  141. package/dist/chunk-RPYWTS42.js.map +0 -7
  142. package/dist/chunk-ZE77GVDW.js.map +0 -7
  143. /package/dist/{chunk-5Y2EMQYX.js.map → chunk-AI6F43VP.js.map} +0 -0
@@ -31,6 +31,11 @@ export interface WithdrawAmountScreenProps {
31
31
  sourceDecimals?: number;
32
32
  /** Spendable balance in source-token units, displayed on the source card. */
33
33
  balance?: string;
34
+ /**
35
+ * The balance in fiat units, already formatted. Shown on the omnibus
36
+ * layout's "Available balance" card; `undefined` while it is still unknown.
37
+ */
38
+ balanceFiatLabel?: string;
34
39
  /** Pre-resolved source-token amount picked by Use Max. */
35
40
  maxAmount?: string;
36
41
  /** The amount exceeds the balance or a configured withdrawal ceiling. */
@@ -57,5 +62,5 @@ export interface WithdrawAmountScreenProps {
57
62
  * The amount is driven by an in-app numpad rather than the system keyboard, so
58
63
  * the sheet never has to move out from under it.
59
64
  */
60
- export declare function WithdrawAmountScreen({ title, amount, onChangeAmount, input, onChangeInput, inFiat, fiatLabel, displayCurrency, onSwapDenomination, sourceDecimals, balance, maxAmount, isAboveMaximum, statusText, onRetryMaximum, isMaximumLoading, source, onPressSource, errorText, canContinue, onContinue, onBack, onClose, }: WithdrawAmountScreenProps): import("react").JSX.Element;
65
+ export declare function WithdrawAmountScreen({ title, amount, onChangeAmount, input, onChangeInput, inFiat, fiatLabel, displayCurrency, onSwapDenomination, sourceDecimals, balance, balanceFiatLabel, maxAmount, isAboveMaximum, statusText, onRetryMaximum, isMaximumLoading, source, onPressSource, errorText, canContinue, onContinue, onBack, onClose, }: WithdrawAmountScreenProps): import("react").JSX.Element;
61
66
  //# sourceMappingURL=WithdrawAmountScreen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WithdrawAmountScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/WithdrawAmountScreen.tsx"],"names":[],"mappings":"AA6CA,MAAM,WAAW,oBAAoB;IACnC,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAA;IACd,iEAAiE;IACjE,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,KAAK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AA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,MAAM,EACN,cAAc,EACd,KAAK,EACL,aAAa,EACb,MAAM,EACN,SAAS,EACT,eAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,cAAsB,EACtB,UAAU,EACV,cAAc,EACd,gBAAwB,EACxB,MAAM,EACN,aAAa,EACb,SAAS,EACT,WAAW,EACX,UAAU,EACV,MAAM,EACN,OAAO,GACR,EAAE,yBAAyB,+BAwL3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"WithdrawCryptoSteps.d.ts","sourceRoot":"","sources":["../../../src/screens/WithdrawCryptoSteps.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,8BAA8B,CAAA;AAKrC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAOhE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AAWtF;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,SAAS,EACT,OAAO,EACP,GAAG,EACH,mBAAmB,EACnB,oBAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,GACZ,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,SAAS,EAAE,uBAAuB,CAAA;IAClC,OAAO,EAAE,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OAAO,CAAA;IAC9B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IACzB,sEAAsE;IACtE,kBAAkB,EAAE,mBAAmB,CAAA;IACvC,WAAW,EAAE,CAAC,MAAM,EAAE;QACpB,oBAAoB,EAAE,oBAAoB,CAAA;QAC1C,WAAW,EAAE,MAAM,CAAA;QACnB,2EAA2E;QAC3E,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;QAC5B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;KAC/B,KAAK,IAAI,CAAA;CACX,+BA0PA"}
@@ -0,0 +1,31 @@
1
+ import { type QrErrorCorrection } from './qrModules';
2
+ export declare const DEPOSIT_QR_SIZE = 221;
3
+ /** The icon that fits the center tile of a {@link DepositQrCode} of `size`. */
4
+ export declare function depositQrIconSize(size?: number): number;
5
+ /** The center tile's side in a {@link DepositQrCode} of `size`. */
6
+ export declare function depositQrTileSize(size?: number): number;
7
+ export interface DepositQrCodeProps {
8
+ /** The value to encode, e.g. the EIP-681 URI from `depositQrCodeUri`. */
9
+ value: string;
10
+ size?: number;
11
+ /** `'H'` by default: the cleared center costs modules the code must recover. */
12
+ ecl?: QrErrorCorrection;
13
+ }
14
+ /**
15
+ * The locked deposit screen's QR (Figma: one-time deposit): merged, rounded
16
+ * modules with no backing of their own, so they sit straight on the card, and
17
+ * a center tile, cleared of modules, for the chain icon to sit on.
18
+ *
19
+ * Modules and tile take `content/elements/primary`, Figma's white in dark mode:
20
+ * in a light theme the card turns light and the code turns dark with it.
21
+ */
22
+ export declare function DepositQrCode({ value, size, ecl, }: DepositQrCodeProps): import("react").JSX.Element;
23
+ /**
24
+ * What {@link DepositQrCode} draws for `value`, in module units: the module
25
+ * count (the viewBox side) and the modules as one SVG path.
26
+ */
27
+ export declare function depositQrShape(value: string, ecl?: QrErrorCorrection): {
28
+ count: number;
29
+ modules: string;
30
+ };
31
+ //# sourceMappingURL=DepositQrCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DepositQrCode.d.ts","sourceRoot":"","sources":["../../../src/transfer/DepositQrCode.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,iBAAiB,EAIvB,MAAM,aAAa,CAAA;AAUpB,eAAO,MAAM,eAAe,MAAQ,CAAA;AAEpC,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,MAAwB,GAAG,MAAM,CAExE;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,MAAwB,GAAG,MAAM,CAExE;AAED,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gFAAgF;IAChF,GAAG,CAAC,EAAE,iBAAiB,CAAA;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAsB,EACtB,GAAS,GACV,EAAE,kBAAkB,+BAwBpB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,iBAAuB,GAC3B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAMpC"}
@@ -0,0 +1,15 @@
1
+ export interface DepositQrGlyphProps {
2
+ chainId: string;
3
+ /** The chain's CDN logo, used when it has no glyph of its own. */
4
+ iconUri: string;
5
+ /** The QR's size, which the glyph scales with. */
6
+ qrSize?: number;
7
+ }
8
+ /**
9
+ * The chain mark on a {@link DepositQrCode}'s center tile, in one dark color
10
+ * (Figma: one-time deposit). A chain with no bundled glyph falls back to its
11
+ * filtered CDN logo, drawn as wide as the tile so its mark, once the disc is
12
+ * dropped, lands near Figma's glyph size.
13
+ */
14
+ export declare function DepositQrGlyph({ chainId, iconUri, qrSize, }: DepositQrGlyphProps): import("react").JSX.Element;
15
+ //# sourceMappingURL=DepositQrGlyph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DepositQrGlyph.d.ts","sourceRoot":"","sources":["../../../src/transfer/DepositQrGlyph.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAA;IACf,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,MAAM,GACP,EAAE,mBAAmB,+BAqBrB"}
@@ -0,0 +1,8 @@
1
+ import { type QRCodeUri, type TransferTokenQrCodeType } from '@funkit/connect-core';
2
+ export declare function resolveBlockchain(chainId: number | undefined): TransferTokenQrCodeType;
3
+ /**
4
+ * The wallet-scannable URI for sending to `depositAddress` on `chainId`. Takes
5
+ * a plain string because a host-supplied address is one; the URI only embeds it.
6
+ */
7
+ export declare function depositQrCodeUri(depositAddress: string, chainId: number | undefined): QRCodeUri;
8
+ //# sourceMappingURL=depositQrCodeUri.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depositQrCodeUri.d.ts","sourceRoot":"","sources":["../../../src/transfer/depositQrCodeUri.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,uBAAuB,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,uBAAuB,CAWzB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,SAAS,CAMX"}
@@ -0,0 +1,13 @@
1
+ import type { AvailableChain } from './availableChains';
2
+ import { type DepositAsset, type DepositSourceToken, type ResolvedDepositSelection } from './depositAssets';
3
+ /** The chains that carry `symbol`, in display order. */
4
+ export declare function depositChainsForToken(assets: DepositAsset[], chains: AvailableChain[], symbol: string): AvailableChain[];
5
+ /**
6
+ * The token as `symbol`, on `preferredChainId` when that chain carries it and
7
+ * otherwise on the first chain that does — the same rule as the token & chain
8
+ * grid.
9
+ */
10
+ export declare function selectDepositToken(assets: DepositAsset[], chains: AvailableChain[], symbol: string, preferredChainId?: number): ResolvedDepositSelection | undefined;
11
+ /** The token as `symbol` on `chain`; undefined when the chain doesn't carry it. */
12
+ export declare function depositTokenOnChain(assets: DepositAsset[], chains: AvailableChain[], symbol: string, chain: AvailableChain): DepositSourceToken | undefined;
13
+ //# sourceMappingURL=depositSelection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depositSelection.d.ts","sourceRoot":"","sources":["../../../src/transfer/depositSelection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAG9B,MAAM,iBAAiB,CAAA;AASxB,wDAAwD;AACxD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EAAE,EACtB,MAAM,EAAE,cAAc,EAAE,EACxB,MAAM,EAAE,MAAM,GACb,cAAc,EAAE,CAElB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EAAE,EACtB,MAAM,EAAE,cAAc,EAAE,EACxB,MAAM,EAAE,MAAM,EACd,gBAAgB,CAAC,EAAE,MAAM,GACxB,wBAAwB,GAAG,SAAS,CAWtC;AAED,mFAAmF;AACnF,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EAAE,EACtB,MAAM,EAAE,cAAc,EAAE,EACxB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,GACpB,kBAAkB,GAAG,SAAS,CAKhC"}
@@ -12,6 +12,8 @@ export interface LockedDepositQuoteContext {
12
12
  target: {
13
13
  chainId: string;
14
14
  tokenAddress: Address;
15
+ symbol?: string;
16
+ decimals?: number;
15
17
  } | undefined;
16
18
  /** Target base units the deposit must deliver (`clientMetadata.authorizedAmountBaseUnit`). */
17
19
  capBaseUnit: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useLockedTokenAmount.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useLockedTokenAmount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,kBAAkB,CAAA;AAItE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAGnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAIxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAY1D,4EAA4E;AAC5E,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,0EAA0E;IAC1E,cAAc,EAAE,UAAU,GAAG,SAAS,CAAA;IACtC,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAA;IAC9D,8FAA8F;IAC9F,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,2FAA2F;IAC3F,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAiGD,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,oBAAoB,GAAG,SAAS,EAC/C,KAAK,EAAE,kBAAkB,GAAG,SAAS,EACrC,OAAO,EAAE,OAAO,EAChB,YAAY,CAAC,EAAE,yBAAyB;;;;;;EAwMzC"}
1
+ {"version":3,"file":"useLockedTokenAmount.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useLockedTokenAmount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,kBAAkB,CAAA;AAItE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAGnC,O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AAE,MAAM,CAAA;IACzB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mEAAmE;IACnE,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACpC,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,0CAA0C;IAC1C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,uBAAuB,CAAA;IACnC,SAAS,EAAE,OAAO,CAAA;IAClB,8EAA8E;IAC9E,mBAAmB,EAAE,KAAK,GAAG,SAAS,CAAA;IACtC,0CAA0C;IAC1C,mBAAmB,EAAE,MAAM,IAAI,CAAA;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,OAAO,GACR,EAAE,sBAAsB,GAAG,sBAAsB,CAoCjD"}
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;AACzB,OAAO,EACL,KAAK,SAAS,EACd,KAAK,uBAAuB,EAE7B,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAMnE,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,mBAAmB,GAAG,SAAS,CAAA;IAC/C,8CAA8C;IAC9C,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mEAAmE;IACnE,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACpC,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,0CAA0C;IAC1C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,uBAAuB,CAAA;IACnC,SAAS,EAAE,OAAO,CAAA;IAClB,8EAA8E;IAC9E,mBAAmB,EAAE,KAAK,GAAG,SAAS,CAAA;IACtC,0CAA0C;IAC1C,mBAAmB,EAAE,MAAM,IAAI,CAAA;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,OAAO,GACR,EAAE,sBAAsB,GAAG,sBAAsB,CAgCjD"}
@@ -31,4 +31,17 @@ export interface QuoteScaledLockedTokenAmountInput {
31
31
  * buffer. Undefined when the quote or cap cannot anchor the scale.
32
32
  */
33
33
  export declare function quoteScaledLockedTokenAmount({ estimate, quotedToAmountBaseUnit, capBaseUnit, bufferBps, decimals, }: QuoteScaledLockedTokenAmountInput): string | undefined;
34
+ export interface QuoteAsset {
35
+ chainId: number | string;
36
+ address: string;
37
+ symbol?: string;
38
+ decimals?: number;
39
+ }
40
+ /**
41
+ * True when a quoted route returns at least what was sent in the same asset.
42
+ * - These routes are fee-sponsored with no swap, so a buffer only over-sends.
43
+ * - Cross-chain matches need an exact symbol (`USDC` is not `USDC.e`) and known
44
+ * decimals, since they differ by chain (USDC is 18 on BNB Chain).
45
+ */
46
+ export declare function isFeelessSameAssetQuote(from: QuoteAsset, to: QuoteAsset, sentBaseUnit: string | undefined, quotedBaseUnit: string | undefined): boolean;
34
47
  //# sourceMappingURL=lockedTokenAmount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lockedTokenAmount.d.ts","sourceRoot":"","sources":["../../../src/transfer/lockedTokenAmount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAErE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEhE;AAED,wBAAgB,eAAe,CAC7B,aAAa,EAAE,oBAAoB,EACnC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,MAAM,GAAG,SAAS,CAMpB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,oBAAoB,EACnC,aAAa,EAAE,MAAM,EACrB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,QAAQ,SAAI,GACX,MAAM,GAAG,SAAS,CAQpB;AAED,2EAA2E;AAC3E,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,eAAO,MAAM,iCAAiC,KAAK,CAAA;AAGnD,uFAAuF;AACvF,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,CAOzE;AAwBD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CAapB;AAED,MAAM,WAAW,iCAAiC;IAChD,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,2DAA2D;IAC3D,sBAAsB,EAAE,MAAM,GAAG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CAAiC;IAChD,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,2DAA2D;IAC3D,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1C,kDAAkD;IAClD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,QAAQ,EACR,sBAAsB,EACtB,WAAW,EACX,SAAS,EACT,QAAQ,GACT,EAAE,iCAAiC,GAAG,MAAM,GAAG,SAAS,CAmBxD;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,UAAU,EAChB,EAAE,EAAE,UAAU,EACd,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,OAAO,CAwBT"}
@@ -0,0 +1,20 @@
1
+ export interface MonoGlyph {
2
+ /** Square and tight around the mark, so it fills {@link depositQrIconSize} like Figma's. */
3
+ viewBox: string;
4
+ d: string;
5
+ fillRule?: 'evenodd';
6
+ }
7
+ /**
8
+ * One-color glyphs, keyed by chain id. The filter's result hinges on each
9
+ * logo's colors and on how each platform runs filters, so every chain we
10
+ * deposit on gets a fixed glyph; the filter only covers chains added later.
11
+ * Unless noted, each is the white mark of the chain's CDN logo.
12
+ */
13
+ export declare const MONO_CHAIN_GLYPHS: Record<string, MonoGlyph>;
14
+ /**
15
+ * A chain logo's markup redrawn in one `color`: its white mark kept, its colored
16
+ * disc dropped (Figma's black-and-white QR center). Returns `xml` untouched if
17
+ * it has no `<svg>` root or `color` doesn't parse, so the logo stays in color.
18
+ */
19
+ export declare function monochromeLogoXml(xml: string, color: string): string;
20
+ //# sourceMappingURL=monoChainLogo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monoChainLogo.d.ts","sourceRoot":"","sources":["../../../src/transfer/monoChainLogo.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,SAAS;IACxB,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAA;IACf,CAAC,EAAE,MAAM,CAAA;IACT,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAuDvD,CAAA;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAiBpE"}
@@ -0,0 +1,20 @@
1
+ export type QrErrorCorrection = 'L' | 'M' | 'Q' | 'H';
2
+ /** The QR's modules, row by row; `true` is a dark module. */
3
+ export type QrMatrix = boolean[][];
4
+ export declare function qrMatrix(value: string, ecl: QrErrorCorrection): QrMatrix;
5
+ /**
6
+ * Light the modules a centered square of `ratio` × the QR's width covers,
7
+ * plus a one-module margin, so the center icon sits in a clean, grid-aligned
8
+ * hole (Figma's tile: 53.22 of 221, with a module of room on every side).
9
+ */
10
+ export declare function clearCenter(matrix: QrMatrix, ratio: number): QrMatrix;
11
+ /**
12
+ * One SVG path for every dark module, drawn as a single merged shape: a corner
13
+ * rounds where both its sides are open, and an inner corner, where three
14
+ * modules meet, gets a fillet of the same radius (Figma: 0.36 of a module).
15
+ *
16
+ * Drawn in module units (a `0 0 N N` viewBox), so the path doesn't depend on
17
+ * the size the code is shown at.
18
+ */
19
+ export declare function qrModulesPath(matrix: QrMatrix, radius: number): string;
20
+ //# sourceMappingURL=qrModules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qrModules.d.ts","sourceRoot":"","sources":["../../../src/transfer/qrModules.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAErD,6DAA6D;AAC7D,MAAM,MAAM,QAAQ,GAAG,OAAO,EAAE,EAAE,CAAA;AAElC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,QAAQ,CAOxE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAUrE;AAMD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAwBtE"}
@@ -0,0 +1,5 @@
1
+ /** The entries whose name contains `query`, ignoring case and outer spaces. */
2
+ export declare function filterByName<Item extends {
3
+ name: string;
4
+ }>(items: Item[], query: string): Item[];
5
+ //# sourceMappingURL=assetSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetSearch.d.ts","sourceRoot":"","sources":["../../../src/utils/assetSearch.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,IAAI,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACxD,KAAK,EAAE,IAAI,EAAE,EACb,KAAK,EAAE,MAAM,GACZ,IAAI,EAAE,CAGR"}
@@ -33,9 +33,10 @@ export declare function formatFiat(value: number, currency: string): string;
33
33
  /**
34
34
  * `2, 'USD'` → `$2`, `2.5, 'USD'` → `$2.50`.
35
35
  *
36
- * For the deposit limit disclaimers only: a threshold reads the way the rail
37
- * states it ("the minimum for this purchase is 2 USD"), and cents the user
38
- * never has to think about are noise. Amounts they pay keep {@link formatFiat}.
36
+ * For the deposit limit disclaimers and the withdrawal title: a
37
+ * threshold reads the way the rail states it ("the minimum for this purchase is
38
+ * 2 USD"), and cents the user never has to think about are noise. Amounts they
39
+ * pay keep {@link formatFiat}.
39
40
  */
40
41
  export declare function formatFiatWhole(value: number, currency: string): string;
41
42
  //# sourceMappingURL=formatAmount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatAmount.d.ts","sourceRoot":"","sources":["../../../src/utils/formatAmount.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIrD;AAKD,eAAO,MAAM,gBAAgB,IAAI,CAAA;AAIjC;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOlD;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,WAAW,GAAE,MAAuB,GACnC,MAAM,CAKR;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAcD,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD;AAOD,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGvE"}
1
+ {"version":3,"file":"formatAmount.d.ts","sourceRoot":"","sources":["../../../src/utils/formatAmount.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIrD;AAKD,eAAO,MAAM,gBAAgB,IAAI,CAAA;AAIjC;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOlD;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,WAAW,GAAE,MAAuB,GACnC,MAAM,CAKR;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAcD,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD;AAOD,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGvE"}
@@ -11,5 +11,7 @@ export interface PickerSelection {
11
11
  symbol: string;
12
12
  chainId: number;
13
13
  }
14
+ /** The chains, in display order, that can carry `symbol`. */
15
+ export declare function pickerChainsForToken<Chain extends PickerChain>(tokens: PickerToken[], chains: Chain[], symbol: string): Chain[];
14
16
  export declare function pickerChainForToken(tokens: PickerToken[], chains: PickerChain[], symbol: string, preferred?: number): number | undefined;
15
17
  //# sourceMappingURL=tokenAndChainPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokenAndChainPicker.d.ts","sourceRoot":"","sources":["../../../src/utils/tokenAndChainPicker.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EAAE,EACrB,MAAM,EAAE,WAAW,EAAE,EACrB,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CASpB"}
1
+ {"version":3,"file":"tokenAndChainPicker.d.ts","sourceRoot":"","sources":["../../../src/utils/tokenAndChainPicker.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAAC,KAAK,SAAS,WAAW,EAC5D,MAAM,EAAE,WAAW,EAAE,EACrB,MAAM,EAAE,KAAK,EAAE,EACf,MAAM,EAAE,MAAM,GACb,KAAK,EAAE,CAIT;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EAAE,EACrB,MAAM,EAAE,WAAW,EAAE,EACrB,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAKpB"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The words between the token and chain selectors, e.g. "on", "·", taken from
3
+ * the translated "{{token}} on {{chain}}" sentence. The selectors always read
4
+ * token first, so the dropdowns sit in the same place in every locale; locales
5
+ * whose grammar puts the chain first use a neutral "·" instead.
6
+ * `format` renders the sentence with the given placeholders.
7
+ */
8
+ export declare function tokenOnChainJoiner(format: (values: {
9
+ token: string;
10
+ chain: string;
11
+ }) => string): string;
12
+ //# sourceMappingURL=tokenOnChainJoiner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenOnChainJoiner.d.ts","sourceRoot":"","sources":["../../../src/utils/tokenOnChainJoiner.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,GAC3D,MAAM,CAYR"}
@@ -31,6 +31,7 @@ export declare function useCryptoWithdrawalForm({ config, quoteInputFeeTokens, q
31
31
  sourceLabel: string;
32
32
  sourceDecimals: number | undefined;
33
33
  balance: string | undefined;
34
+ balanceFiat: number | undefined;
34
35
  maxAmount: string | undefined;
35
36
  retryMaximum: (() => void) | undefined;
36
37
  isMaximumLoading: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useCryptoWithdrawalForm.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAIhC,MAAM,sBAAsB,CAAA;AAK7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAexE,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,cAAc,CAAA;AAqB7E,2DAA2D;AAC3D,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,mBAAmB,EACnB,oBAA2B,GAC5B,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAA;IAC3B,uDAAuD;IACvD,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;;;;;;;;;;;;;;IAuLG;;;;OAIG;0BACmB,MAAM;;;;;;;;;IA0B5B;;;;OAIG;;IAGH,qDAAqD;;IAErD,qEAAqE;;IAIrE,kFAAkF;;IAElF;;;;OAIG;;;;IAWH,6EAA6E;;IAE7E,6EAA6E;;;;;;;IAQ7E;;;OAGG;;;;;;;;;;;;EA0BN"}
1
+ {"version":3,"file":"useCryptoWithdrawalForm.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAIhC,MAAM,sBAAsB,CAAA;AAK7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAexE,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,cAAc,CAAA;AAqB7E,2DAA2D;AAC3D,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,mBAAmB,EACnB,oBAA2B,GAC5B,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAA;IAC3B,uDAAuD;IACvD,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;;;;;;;;;;;;;;;IAqMG;;;;OAIG;0BACmB,MAAM;;;;;;;;;IA0B5B;;;;OAIG;;IAGH,qDAAqD;;IAErD,qEAAqE;;IAIrE,kFAAkF;;IAElF;;;;OAIG;;;;IAWH,6EAA6E;;IAE7E,6EAA6E;;;;;;;IAQ7E;;;OAGG;;;;;;;;;;;;EA0BN"}
@@ -1,11 +1,20 @@
1
1
  import type { WithdrawalFlowConfig, WithdrawalSourceTokenParams } from '../flow/withdrawalFlowConfig';
2
2
  type BalanceCallback = NonNullable<WithdrawalFlowConfig['withdrawalSourceTokenBalance']>;
3
+ interface SourceTokenBalance {
4
+ /** Zero while loading or after a failed read; undefined with no callback. */
5
+ value: string | undefined;
6
+ /** True until the host's promise lands, so zero here is not yet a balance. */
7
+ isLoading: boolean;
8
+ /** Set when reading or validating the balance failed. */
9
+ error: Error | undefined;
10
+ }
3
11
  /**
4
12
  * The host's source balance, whichever way it answers. A plain value is read
5
13
  * on render as before. A promise is awaited once per source token and the
6
14
  * balance reads as zero until it lands: the form must not offer a Max the
7
- * host has not confirmed. Undefined only when the host gave no callback.
15
+ * host has not confirmed; `isLoading` and `error` tell that zero apart from a
16
+ * real one. `value` is undefined only when the host gave no callback.
8
17
  */
9
- export declare function useWithdrawalSourceTokenBalance(callback: BalanceCallback | undefined, params: WithdrawalSourceTokenParams): string | undefined;
18
+ export declare function useWithdrawalSourceTokenBalance(callback: BalanceCallback | undefined, params: WithdrawalSourceTokenParams): SourceTokenBalance;
10
19
  export {};
11
20
  //# sourceMappingURL=useWithdrawalSourceTokenBalance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWithdrawalSourceTokenBalance.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalSourceTokenBalance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,8BAA8B,CAAA;AAGrC,KAAK,eAAe,GAAG,WAAW,CAChC,oBAAoB,CAAC,8BAA8B,CAAC,CACrD,CAAA;AAeD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,eAAe,GAAG,SAAS,EACrC,MAAM,EAAE,2BAA2B,GAClC,MAAM,GAAG,SAAS,CA+EpB"}
1
+ {"version":3,"file":"useWithdrawalSourceTokenBalance.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalSourceTokenBalance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,8BAA8B,CAAA;AAGrC,KAAK,eAAe,GAAG,WAAW,CAChC,oBAAoB,CAAC,8BAA8B,CAAC,CACrD,CAAA;AAUD,UAAU,kBAAkB;IAC1B,6EAA6E;IAC7E,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,8EAA8E;IAC9E,SAAS,EAAE,OAAO,CAAA;IAClB,yDAAyD;IACzD,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;CACzB;AAUD;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,eAAe,GAAG,SAAS,EACrC,MAAM,EAAE,2BAA2B,GAClC,kBAAkB,CA0EpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect-rn",
3
- "version": "9.1.1",
3
+ "version": "9.2.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",
@@ -52,11 +52,12 @@
52
52
  "colord": "2.10.0",
53
53
  "iso-3166-2": "1.0.0",
54
54
  "libphonenumber-js": "1.13.6",
55
+ "qrcode": "1.5.4",
55
56
  "react-i18next": "12.3.1",
56
- "@funkit/api-base": "9.0.0",
57
+ "@funkit/api-base": "9.0.1",
57
58
  "@funkit/chains": "2.5.0",
58
- "@funkit/utils": "5.0.2",
59
- "@funkit/connect-core": "9.0.0"
59
+ "@funkit/connect-core": "9.2.0",
60
+ "@funkit/utils": "5.0.2"
60
61
  },
61
62
  "peerDependencies": {
62
63
  "@gorhom/bottom-sheet": ">=5",
@@ -92,6 +93,7 @@
92
93
  "@sumsub/react-native-mobilesdk-module": "1.46.1",
93
94
  "@tanstack/react-query": "5.76.1",
94
95
  "@types/iso-3166-2": "1.0.4",
96
+ "@types/qrcode": "^1.5.5",
95
97
  "@types/react": "^19.2.2",
96
98
  "@types/react-dom": "^19.0.0",
97
99
  "expo": "~57.0.21",
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/preview/flowPreview.tsx", "../src/fiat/legalLinks.ts", "../src/fiat/formLayout.ts", "../src/fiat/keyboardReturnKey.ts", "../src/fiat/postalCodeCountries.ts"],
4
- "sourcesContent": ["import type { FiatStepResponse } from '@funkit/connect-core'\nimport {\n type Dispatch,\n type ReactNode,\n type SetStateAction,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react'\n\nimport type { KycCompletion } from '../fiat/useKycCompletion'\nimport type { KycSection } from '../fiat/formLayout'\nimport type { FlowScreen } from '../flow/FunkitFlowProvider'\nimport type { DepositMatchTerms } from '../flow/depositFlowConfig'\n\n/**\n * Where the fiat session opens. Each field seeds one piece of state a user would otherwise reach\n * by tapping through, so any screen of the rail is one seed away.\n */\nexport interface FiatPreviewSeed {\n /** The step response the session opens on, as if the backend had just sent it. */\n step?: FiatStepResponse\n /** The amount entry's value. */\n amount?: string\n /** Presses the entry CTA once it is ready: opens the contact round, or the KYC options card. */\n pressEntry?: boolean\n /** An identity round's consent intro, or its form open at a section. */\n identity?: { page: 'consent' } | { page: 'form'; section?: KycSection }\n /** Past the document-capture intro, onto the provider's own surface. */\n documentStarted?: boolean\n /** The provider asked for its capture again after the buyer finished one. */\n captureReissued?: boolean\n /** The acknowledgement a finished identity form shows before its verdict. */\n kycCompletion?: KycCompletion\n /** A provider surface that failed, as the adapter reports it. */\n surfaceFailure?: { code: string; detail?: string }\n /** Submits the seeded step's CTA with this id on open \u2014 how a failed send is reached. */\n submitOnOpen?: string\n /** The host's identity minter refused this account. */\n accountIneligible?: boolean\n /** Turns the deposit-match preview on, as the host's internal flag does. */\n depositMatch?: DepositMatchTerms\n}\n\nexport interface DepositPreviewSeed {\n /** The screen the flow opens on; defaults to the root `beginDeposit` picks. Transfer opens above it. */\n screen?: Extract<FlowScreen, 'depositAmount' | 'addMoney' | 'transfer'>\n fiat?: FiatPreviewSeed\n /** The deposit chain, by id, as if picked from the Crypto row \u2014 Transfer needs one. */\n chainId?: string\n}\n\ntype WithdrawalStackScreen = Extract<\n FlowScreen,\n | 'withdrawMethod'\n | 'withdrawAmount'\n | 'withdrawAddress'\n | 'withdrawReceiveToken'\n>\n\n/** The submitted withdrawal the completion screen reports on. */\nexport interface WithdrawalPreviewCompletion {\n txHash: `0x${string}`\n amountLabel: string\n usdLabel?: string\n tokenLabel?: string\n}\n\ninterface WithdrawalPreviewFields {\n /** The payout method picked on the list, by `WithdrawalMethodOption.id`. */\n methodId?: string\n amount?: string\n recipient?: string\n /** The retryable error that replaces every screen after a failed execution. */\n executionError?: boolean\n}\n\n/**\n * The withdrawal flow's opening state. The type rules out the stacks that render nothing: an\n * empty one, and a completion screen with no withdrawal to report.\n */\nexport type WithdrawalPreviewSeed = WithdrawalPreviewFields &\n (\n | {\n /** The screens on the stack, root first; defaults to the payout-method list. */\n stack?: [WithdrawalStackScreen, ...WithdrawalStackScreen[]]\n complete?: undefined\n }\n | { stack: ['withdrawComplete']; complete: WithdrawalPreviewCompletion }\n )\n\n/**\n * A state to open the SDK's flow at, for hosted previews and QA builds.\n * - Consumed by the next matching `begin*` only; closing and reopening starts clean.\n * - Never set in production: every read falls back to the flow's own start.\n */\nexport interface FlowPreviewSeed {\n deposit?: DepositPreviewSeed\n withdrawal?: WithdrawalPreviewSeed\n}\n\nconst HostPreviewContext = createContext<FlowPreviewSeed | undefined>(undefined)\n\n/**\n * Opens the next `beginDeposit` / `beginWithdrawal` below it at `seed`.\n * - Mount it above `<FunkitProvider>`.\n * - Memoize `seed`: a new object is a new preview, so one built inline reopens every flow seeded.\n */\nexport function FunkitFlowPreview({\n seed,\n children,\n}: {\n seed: FlowPreviewSeed | undefined\n children: ReactNode\n}) {\n return (\n <HostPreviewContext.Provider value={seed}>\n {children}\n </HostPreviewContext.Provider>\n )\n}\n\n/** The seed a host mounted; read by the flow provider when a flow opens. */\nexport function useHostFlowPreview(): FlowPreviewSeed | undefined {\n return useContext(HostPreviewContext)\n}\n\n/** The seeds of the flow session a host preview opened; empty everywhere else. */\nexport interface ActivePreview {\n deposit?: DepositPreviewSeed\n withdrawal?: WithdrawalPreviewSeed\n}\n\nconst NO_PREVIEW: ActivePreview = {}\nconst ActivePreviewContext = createContext<ActivePreview>(NO_PREVIEW)\n\n/** Scopes a consumed seed to the one flow session it opened. */\nexport function ActiveFlowPreview({\n deposit,\n withdrawal,\n children,\n}: {\n deposit?: DepositPreviewSeed\n withdrawal?: WithdrawalPreviewSeed\n children: ReactNode\n}) {\n // The value names the session: readers are tracked against it.\n const preview = useMemo(\n () =>\n deposit === undefined && withdrawal === undefined\n ? NO_PREVIEW\n : { deposit, withdrawal },\n [deposit, withdrawal],\n )\n return (\n <ActivePreviewContext.Provider value={preview}>\n {children}\n </ActivePreviewContext.Provider>\n )\n}\n\n/** Reads one seed value out of the session's preview. */\nexport type PreviewPick<T> = (preview: ActivePreview) => T | undefined\n\n/**\n * Every seed value a flow reads, one reader each. Readers are tracked by identity, so each is\n * declared once here rather than inline where it is read.\n */\nexport const SEED = {\n fiatAmount: (p) => p.deposit?.fiat?.amount,\n fiatStep: (p) => p.deposit?.fiat?.step,\n fiatPressEntry: (p) => p.deposit?.fiat?.pressEntry,\n fiatSubmitOnOpen: (p) => p.deposit?.fiat?.submitOnOpen,\n fiatSurfaceFailure: (p) => p.deposit?.fiat?.surfaceFailure,\n fiatAccountIneligible: (p) => p.deposit?.fiat?.accountIneligible,\n fiatDepositMatch: (p) => p.deposit?.fiat?.depositMatch,\n kycCompletion: (p) => p.deposit?.fiat?.kycCompletion,\n identityPage: (p) => p.deposit?.fiat?.identity?.page,\n identitySection: (p) => {\n const identity = p.deposit?.fiat?.identity\n return identity?.page === 'form' ? identity.section : undefined\n },\n documentStarted: (p) => p.deposit?.fiat?.documentStarted,\n fiatCaptureReissued: (p) => p.deposit?.fiat?.captureReissued,\n depositChainId: (p) => p.deposit?.chainId,\n withdrawalMethodId: (p) => p.withdrawal?.methodId,\n withdrawalAmount: (p) => p.withdrawal?.amount,\n withdrawalRecipient: (p) => p.withdrawal?.recipient,\n withdrawalComplete: (p) => p.withdrawal?.complete,\n withdrawalExecutionError: (p) => p.withdrawal?.executionError,\n} satisfies Record<string, PreviewPick<unknown>>\n\nconst readers = new WeakMap<ActivePreview, Set<PreviewPick<unknown>>>()\n\n/**\n * The seed value for the first mount that reads it; `undefined` for every mount after.\n * - A later mount of the same reader is the user moving on (a new round, a return to the entry),\n * so a seed never re-applies after the state it describes.\n * - Marked read on commit, so Strict Mode's double render still sees it.\n */\nexport function useSeed<T>(pick: PreviewPick<T>): T | undefined {\n const preview = useContext(ActivePreviewContext)\n const [seed] = useState(() =>\n readers.get(preview)?.has(pick) === true ? undefined : pick(preview),\n )\n useEffect(() => {\n if (preview === NO_PREVIEW) {\n return\n }\n const read = readers.get(preview) ?? new Set()\n read.add(pick)\n readers.set(preview, read)\n }, [preview, pick])\n return seed\n}\n\n/**\n * `useState` whose initial value a host preview may seed; production always starts at `initial`.\n * `fromSeed` shapes a seed value into the state when the two differ.\n */\nexport function useSeededState<T>(\n pick: PreviewPick<T>,\n initial: T,\n): [T, Dispatch<SetStateAction<T>>]\nexport function useSeededState<S, T>(\n pick: PreviewPick<S>,\n initial: T,\n fromSeed: (seed: S) => T,\n): [T, Dispatch<SetStateAction<T>>]\nexport function useSeededState<S, T>(\n pick: PreviewPick<S>,\n initial: T,\n fromSeed?: (seed: S) => T,\n): [T, Dispatch<SetStateAction<T>>] {\n const seed = useSeed(pick)\n return useState<T>(() => {\n if (seed === undefined) {\n return initial\n }\n return fromSeed === undefined ? (seed as unknown as T) : fromSeed(seed)\n })\n}\n", "import type { FiatProvider, KYCProvider } from '@funkit/connect-core'\n\n/**\n * The documents the identity step points at.\n *\n * Held together because two screens link them, and a provider change is one\n * edit rather than a hunt through the copy.\n */\n\n/** Fun's own policy, linked from the consent the buyer has to give. */\nexport const PRIVACY_POLICY_URL = 'https://fun.xyz/privacy'\n\n/**\n * Bumped whenever the consent copy changes, and logged and recorded with every\n * consent, so a record can be matched to the words the buyer actually read.\n * The backend must publish the same revision (`FUN_KYC_CONSENT_TERMS`).\n */\nexport const CONSENT_COPY_VERSION = 'fun-kyc-consent-2026-09-11'\n\n/** Persona's policy, linked from MoonPay's sharing disclosure (`MOONPAY_SHARING_CONSENT_VERSION`). */\nexport const PERSONA_PRIVACY_POLICY_URL =\n 'https://withpersona.com/legal/privacy-policy'\n\n/**\n * The terms of the provider that settles the order, keyed by the provider the\n * round names.\n *\n * Only verified URLs belong here. A provider absent from the map is named in\n * the copy without a link and logged (`kyc_provider_terms_url_missing`) \u2014 it\n * is never guessed, and never falls back to another provider's terms.\n */\nconst PROVIDER_TERMS_URLS: Partial<Record<FiatProvider, string>> = {\n BANXA: 'https://banxa.com/terms-of-use/',\n}\n\n/** How each provider writes its own name; the enum is upper-case. */\nconst PROVIDER_NAMES: Partial<Record<FiatProvider, string>> = {\n BANXA: 'Banxa',\n TRANSAK: 'Transak',\n}\n\n/** The identity vendors, which settle no orders and so are kept apart. */\nconst KYC_PROVIDER_NAMES: Partial<Record<KYCProvider, string>> = {\n SUMSUB: 'Sumsub',\n}\n\n/** Title-cases an upper-case enum member for a provider with no name on record. */\nconst titleCase = (value: string) =>\n value.charAt(0) + value.slice(1).toLowerCase()\n\n/** The provider's terms, or `undefined` when none is on record for it. */\nexport function providerTermsUrl(\n provider: FiatProvider | undefined,\n): string | undefined {\n return provider === undefined ? undefined : PROVIDER_TERMS_URLS[provider]\n}\n\n/**\n * The provider's name as the copy should print it. `fallback` is what a\n * screen drawn with no round to name one says instead.\n */\nexport function providerDisplayName(\n provider: FiatProvider | undefined,\n fallback: string,\n): string {\n if (provider === undefined) {\n return fallback\n }\n return PROVIDER_NAMES[provider] ?? titleCase(provider)\n}\n\n/**\n * The identity vendor's name as the copy should print it. Separate from the\n * settling provider: the two enums name different things and never mix.\n */\nexport function kycProviderDisplayName(\n provider: KYCProvider | undefined,\n fallback: string,\n): string {\n if (provider === undefined) {\n return fallback\n }\n return KYC_PROVIDER_NAMES[provider] ?? titleCase(provider)\n}\n", "import type { FormField, KycFieldId } from '@funkit/connect-core'\nimport { isValueField } from '@funkit/connect-core'\nimport { Platform, type TextInputProps } from 'react-native'\n\nimport { PADS_WITHOUT_RETURN_KEY } from './keyboardReturnKey'\nimport { type PostalCodeForm, postalCodeForm } from './postalCodeCountries'\n\n/**\n * The pages the US form is drawn as, in the order the design steps them.\n *\n * Figma \"EDIT: KYC Enhancements\": 1508:2616 (name), 1844:17471 (date of\n * birth), 1631:7256 (address), 1631:7883 (SSN). `DETAILS` is not a frame \u2014 it\n * is where a field the design never drew goes, so a form the server words its\n * own way still renders.\n */\nexport type KycSection =\n | 'NAME'\n | 'DOB'\n | 'NATIONALITY'\n | 'COUNTRY'\n | 'ADDRESS'\n | 'SSN'\n | 'PHONE'\n | 'OCCUPATION'\n | 'EMPLOYMENT'\n | 'PURPOSE'\n | 'SOURCE_OF_WEALTH'\n | 'INCOME'\n | 'NET_WORTH'\n | 'ACTIVITY'\n | 'DETAILS'\n\nexport interface KycSectionPage {\n section: KycSection\n /** Drawn as one card with a rule between rows, rather than loose boxes. */\n grouped: boolean\n /** Fields sharing a row sit side by side, as the design pairs them. */\n rows: FormField[][]\n}\n\n/**\n * The questionnaire answers this build draws a page for. The contract types a\n * questionnaire id as a template; any other lands in `DETAILS`.\n */\nexport const GROSS_ANNUAL_INCOME =\n 'QUESTIONNAIRE_RESPONSE:customerDueDiligence:grossAnnualIncome'\nexport const EXPECTED_AMOUNT_PER_MONTH =\n 'QUESTIONNAIRE_RESPONSE:customerDueDiligence:expectedTransactionAmountPerMonth'\nexport const TRANSACTIONS_PER_MONTH =\n 'QUESTIONNAIRE_RESPONSE:customerDueDiligence:transactionFrequencyPerMonth'\nexport const NET_WORTH = 'QUESTIONNAIRE_RESPONSE:enhancedDueDiligence:netWorth'\n\n/**\n * - `FormField` has no currency key, so a figure's reporting currency rides its\n * label as a trailing \" (XXX)\".\n * - Any other label names no currency.\n */\nconst LABELLED_CURRENCY = / \\(([A-Z]{3})\\)$/\n\nexport function fieldCurrency(field: FormField): string | undefined {\n return LABELLED_CURRENCY.exec(field.labelFallback)?.[1]\n}\n\n/** The label without its currency, for a field whose caption already names it. */\nexport function withoutLabelledCurrency(field: FormField): FormField {\n return {\n ...field,\n labelFallback: field.labelFallback.replace(LABELLED_CURRENCY, ''),\n }\n}\n\n/**\n * Which page a field belongs to, by id.\n *\n * The contract closes the id set, so these are the canonical names and there\n * is no second spelling to carry. An id with no page here lands in `DETAILS`\n * rather than being refused: the server owns the list, and a form is not\n * undrawable just because it asks for something the frames do not group.\n */\nconst SECTION_BY_ID: Readonly<Partial<Record<KycFieldId, KycSection>>> = {\n // 1508:2616 \u2014 \"First name\", \"M.I.\", \"Last Name\".\n LEGAL_FIRST_NAME: 'NAME',\n LEGAL_MIDDLE_NAME: 'NAME',\n LEGAL_LAST_NAME: 'NAME',\n // 1844:17471 \u2014 its own page, asked for on its own over the date picker.\n DATE_OF_BIRTH: 'DOB',\n NATIONALITY: 'NATIONALITY',\n // 1631:7256 \u2014 \"Address\", \"Apartment, suite, etc.\", \"City\", \"State\", \"ZIP code\".\n RESIDENTIAL_ADDRESS_LINE_1: 'ADDRESS',\n RESIDENTIAL_ADDRESS_LINE_2: 'ADDRESS',\n RESIDENTIAL_ADDRESS_CITY: 'ADDRESS',\n RESIDENTIAL_ADDRESS_REGION: 'ADDRESS',\n RESIDENTIAL_ADDRESS_POSTAL_CODE: 'ADDRESS',\n RESIDENTIAL_ADDRESS_COUNTRY: 'COUNTRY',\n // 1631:7883 \u2014 \"SSN\".\n TAX_IDENTIFIER: 'SSN',\n TAX_RESIDENCE_COUNTRY: 'COUNTRY',\n OCCUPATION_TITLE: 'OCCUPATION',\n OCCUPATION_INDUSTRY: 'OCCUPATION',\n PURPOSE_OF_TRANSACTION: 'PURPOSE',\n PURPOSE_OF_SERVICE: 'PURPOSE',\n // MoonPay's customer due diligence round, asked after the SSN.\n PHONE_NUMBER: 'PHONE',\n EMPLOYMENT_STATUS: 'EMPLOYMENT',\n SOURCE_OF_WEALTH_DECLARATION: 'SOURCE_OF_WEALTH',\n [GROSS_ANNUAL_INCOME]: 'INCOME',\n [EXPECTED_AMOUNT_PER_MONTH]: 'ACTIVITY',\n [TRANSACTIONS_PER_MONTH]: 'ACTIVITY',\n [NET_WORTH]: 'NET_WORTH',\n}\n\n/**\n * The keyboard a typed field raises. The SSN page is drawn over a number pad\n * (1631:7883) and the due-diligence figures over the pads that fit them;\n * every other page in the form is drawn over letters.\n */\nconst KEYBOARD_BY_ID: Readonly<\n Partial<Record<KycFieldId, TextInputProps['keyboardType']>>\n> = {\n PHONE_NUMBER: 'phone-pad',\n [GROSS_ANNUAL_INCOME]: 'decimal-pad',\n [EXPECTED_AMOUNT_PER_MONTH]: 'decimal-pad',\n [TRANSACTIONS_PER_MONTH]: 'number-pad',\n [NET_WORTH]: 'decimal-pad',\n}\n\n/**\n * Field types a page can draw. A date and a country are typed into the same\n * filled box as any other answer; a hosted step is an errand the user runs\n * elsewhere and a document streams to an endpoint this build has not\n * installed, so neither has a box to draw.\n */\nconst DRAWN_TYPES = new Set(['TEXT', 'SELECT', 'DATE', 'COUNTRY'])\n\n/** One card ruled between its rows (1631:7256, \"address\"). */\nconst GROUPED_SECTIONS = new Set<KycSection>(['ADDRESS'])\n\n/**\n * The order 1508:2616 \u2192 1844:17471 \u2192 1631:7256 \u2192 1631:7883 walks, anything\n * else trailing.\n */\nconst SECTION_ORDER: readonly KycSection[] = [\n 'NAME',\n 'DOB',\n 'NATIONALITY',\n 'COUNTRY',\n 'ADDRESS',\n 'SSN',\n 'PHONE',\n 'OCCUPATION',\n 'EMPLOYMENT',\n 'PURPOSE',\n 'SOURCE_OF_WEALTH',\n 'INCOME',\n 'NET_WORTH',\n 'ACTIVITY',\n 'DETAILS',\n]\n\n/**\n * The page's field a date picker can answer, when that is the whole page.\n *\n * A picker takes the keyboard's slot, so it can only be offered on a page\n * with nothing else to type: a date beside two names would leave one of the\n * two controls covering the other. Anywhere else the date is typed.\n */\nconst IDENTITY_SECTIONS: ReadonlySet<KycSection> = new Set<KycSection>([\n 'NAME',\n 'DOB',\n 'NATIONALITY',\n 'COUNTRY',\n 'ADDRESS',\n 'SSN',\n])\n\n/**\n * The server owns the field list, so an id this build does not know is not\n * identity: only the frames that collect who someone is qualify.\n */\nexport function isIdentityField(field: FormField): boolean {\n const section = SECTION_BY_ID[field.id]\n return section !== undefined && IDENTITY_SECTIONS.has(section)\n}\n\n/**\n * The pages that draw their answers on the page rather than behind a chooser\n * (2475:8992).\n *\n * Named, not inferred from the field's type: `DETAILS` also collects a\n * `SELECT`, but it holds whatever the server asks for that no frame drew, and\n * a list of unknown length is what the chooser's sheet is for.\n */\nconst INLINE_CHOICE_SECTIONS: ReadonlySet<KycSection> = new Set<KycSection>([\n 'OCCUPATION',\n 'EMPLOYMENT',\n 'PURPOSE',\n 'SOURCE_OF_WEALTH',\n])\n\nexport function isInlineChoiceSection(section: KycSection): boolean {\n return INLINE_CHOICE_SECTIONS.has(section)\n}\n\nexport function pickedDateField(page: KycSectionPage): FormField | undefined {\n const fields = page.rows.flat()\n const only = fields.length === 1 ? fields[0] : undefined\n return only?.type === 'DATE' ? only : undefined\n}\n\n/**\n * Whether the field is typed into, and so takes a turn in the return-key\n * chain. A choice is not.\n */\nexport function isFocusableField(field: FormField): boolean {\n return field.type === 'TEXT' || field.type === 'DATE'\n}\n\n/** Pages whose keyboards read \"next\" on the field that tries the page too (1950:2055, 1951:9265). */\nconst NEXT_TO_TRY_SECTIONS: ReadonlySet<KycSection> = new Set<KycSection>([\n 'NAME',\n 'ADDRESS',\n])\n\nexport interface ReturnHop {\n label: 'next' | 'done'\n /** Absent where the return key tries the page instead. */\n to?: FormField\n}\n\n/**\n * Where a typed field's return key goes: the next required typed field.\n *\n * - An optional line is stepped over (2334:7164) but still hands on when the\n * user taps into it.\n */\nexport function returnHop(\n section: KycSection,\n typedFields: readonly FormField[],\n fieldId: string,\n): ReturnHop | undefined {\n const at = typedFields.findIndex((field) => field.id === fieldId)\n if (at < 0) {\n return undefined\n }\n const to = typedFields.slice(at + 1).find((field) => field.required)\n if (to !== undefined) {\n return { label: 'next', to }\n }\n return { label: NEXT_TO_TRY_SECTIONS.has(section) ? 'next' : 'done' }\n}\n\n/**\n * - Digits alone take the number pad, whose missing return key the page\n * answers with Continue (`isDigitsField`).\n * - A hyphen or space needs iOS's digits-first keyboard, which can type it;\n * Android has none, so it keeps letters.\n */\nconst POSTAL_CODE_KEYBOARD: Readonly<\n Record<PostalCodeForm, TextInputProps['keyboardType']>\n> = {\n digits: 'number-pad',\n separated: Platform.OS === 'ios' ? 'numbers-and-punctuation' : undefined,\n}\n\n/**\n * The country a field's keyboard and choices follow.\n *\n * - The tax ID takes the tax residence's, which also names it in the heading.\n * - Every other field takes the address's.\n */\nexport function fieldCountry(\n field: FormField,\n countries: { address?: string; taxResidence?: string },\n): string | undefined {\n return field.id === 'TAX_IDENTIFIER'\n ? countries.taxResidence\n : countries.address\n}\n\n/** `country` is the field's own, from `fieldCountry`. */\nexport function fieldKeyboardType(\n field: FormField,\n country?: string,\n): TextInputProps['keyboardType'] | undefined {\n if (field.type !== 'TEXT') {\n return undefined\n }\n if (field.id === 'RESIDENTIAL_ADDRESS_POSTAL_CODE') {\n const form = postalCodeForm(country)\n return form === undefined ? undefined : POSTAL_CODE_KEYBOARD[form]\n }\n if (field.id === 'TAX_IDENTIFIER') {\n return taxIdentifierKeyboard(country)\n }\n return KEYBOARD_BY_ID[field.id]\n}\n\nconst DIGIT_TAX_IDENTIFIER_COUNTRIES: ReadonlySet<string> = new Set([\n 'US',\n 'BR',\n])\n\nfunction taxIdentifierKeyboard(\n country: string | undefined,\n): TextInputProps['keyboardType'] | undefined {\n if (\n country === undefined ||\n DIGIT_TAX_IDENTIFIER_COUNTRIES.has(country.toUpperCase())\n ) {\n return 'number-pad'\n }\n return undefined\n}\n\n/** Whether the field raises a pad rather than letters, and so has no return key. */\nexport function isDigitsField(field: FormField, country?: string): boolean {\n const keyboardType = fieldKeyboardType(field, country)\n return keyboardType !== undefined && PADS_WITHOUT_RETURN_KEY.has(keyboardType)\n}\n\n/** Whether the field is drawn at a fixed width rather than growing to fill. */\nexport function isFixedWidthField(field: FormField): boolean {\n return field.id === 'LEGAL_MIDDLE_NAME'\n}\n\n/**\n * The form's fields that no page draws.\n *\n * Type only: an unknown id has a page (`DETAILS`), so refusing one would\n * reject a whole form over a field the screens can draw perfectly well. A\n * form with any of these cannot be completed here, so the caller shows its\n * unsupported state rather than a form missing a field the server requires.\n */\nexport function unsupportedFields(fields: readonly FormField[]): FormField[] {\n return fields.filter((field) => !DRAWN_TYPES.has(field.type))\n}\n\n/**\n * Splits a form into the pages the design steps through.\n *\n * Pages keep the design's order; fields keep the server's, so a page that\n * gains a field it already draws renders it without a client release. A page\n * with no fields is not a page.\n */\nexport function sectionPages(fields: readonly FormField[]): KycSectionPage[] {\n const bySection = new Map<KycSection, FormField[]>()\n for (const field of fields) {\n if (!DRAWN_TYPES.has(field.type)) {\n continue\n }\n // A state the provider does not require is not asked: European\n // addresses have none, and the design draws no row for it.\n if (field.id === 'RESIDENTIAL_ADDRESS_REGION' && !field.required) {\n continue\n }\n const section = SECTION_BY_ID[field.id] ?? 'DETAILS'\n const collected = bySection.get(section) ?? []\n collected.push(field)\n bySection.set(section, collected)\n }\n\n return SECTION_ORDER.flatMap<KycSectionPage>((section) => {\n const collected = bySection.get(section)\n if (collected === undefined) {\n return []\n }\n if (isInlineChoiceSection(section) || section === 'DETAILS') {\n return collected.map((field) => ({\n section,\n grouped: false,\n rows: [[field]],\n }))\n }\n return [\n {\n section,\n grouped: GROUPED_SECTIONS.has(section),\n rows:\n section === 'ADDRESS'\n ? addressRows(collected)\n : collected.map((field) => [field]),\n },\n ]\n })\n}\n\n/**\n * The address card as the design lays it out for the country (1631:7256):\n * the street, the apartment line, then the city with the state and ZIP paired\n * under it \u2014 or, where the provider asks for no state, the postal code paired\n * before the city, as a European address reads. A field the design does not\n * place trails on its own row.\n */\nfunction addressRows(fields: readonly FormField[]): FormField[][] {\n const byId = new Map(fields.map((field) => [field.id, field]))\n const take = (id: KycFieldId) => {\n const field = byId.get(id)\n byId.delete(id)\n return field\n }\n const line1 = take('RESIDENTIAL_ADDRESS_LINE_1')\n const line2 = take('RESIDENTIAL_ADDRESS_LINE_2')\n const city = take('RESIDENTIAL_ADDRESS_CITY')\n const region = take('RESIDENTIAL_ADDRESS_REGION')\n const postal = take('RESIDENTIAL_ADDRESS_POSTAL_CODE')\n const rows: (FormField | undefined)[][] = [[line1], [line2]]\n if (region === undefined) {\n rows.push([postal, city])\n } else {\n rows.push([city], [region, postal])\n }\n return [...rows, ...[...byId.values()].map((field) => [field])]\n .map((row) => row.filter((field) => field !== undefined))\n .filter((row) => row.length > 0)\n}\n", "import type { TextInputProps } from 'react-native'\n\n/**\n * Keyboards with no return key. iOS draws a floating button of its own when\n * one of these is asked for a return key, and it lands over the screen's\n * bottom-right \u2014 where the advance control already is.\n */\nexport const PADS_WITHOUT_RETURN_KEY = new Set<TextInputProps['keyboardType']>([\n 'number-pad',\n 'numeric',\n 'decimal-pad',\n 'phone-pad',\n])\n", "/**\n * How a country writes its postal codes, where Google's address metadata\n * (libaddressinput, chromium-i18n.appspot.com/ssl-address/data) and\n * `postcode-validator` agree. Anywhere they disagree is on neither list, so\n * the keyboard stays letters (`postalCodeCountries.drift.test.ts`).\n *\n * - `digits`: codes are written as digits alone. The US ZIP+4 extension and\n * FR's space are optional, and neither is how the post office writes them.\n * - `separated`: digits the country writes split by a hyphen or space\n * (`12345-678`, `123 45`), which a number pad cannot type.\n * - A country whose codes carry any letter (GB, CA, NL, IE, AR, MT, LV\u2026), or\n * that has no postal code, is on neither list.\n */\nexport type PostalCodeForm = 'digits' | 'separated'\n\nconst codes = (list: string): ReadonlySet<string> =>\n new Set(list.trim().split(/\\s+/))\n\nconst DIGIT_COUNTRIES = codes(`\n AF AL AM AS AT AU AX AZ BA BD BE BG BH BL BT BY CC CH CL CN CO CU CV\n CX CY DE DK DO DZ EC EE EG EH ES ET FI FM FO FR GE GF GL GN GP GT GU\n GW HM HN HR HT HU ID IL IN IQ IS IT JO KE KG KH KR KW KZ LA LI LK LR\n LS LT LU MA MC MD ME MF MG MH MK MM MN MP MQ MV MX MY MZ NA NC NE NF\n NG NO NP NZ PF PG PH PK PM PR PW PY RE RO RS RU SA SD SG SI SJ SM SN\n TH TJ TM TN TR TW TZ UA UM US UY UZ VA VE VI VN WF XK YT ZA ZM\n`)\n\nconst SEPARATED_COUNTRIES = codes(`\n BR CR CZ GR IR JP LB PL PT SE SK\n`)\n\nexport function postalCodeForm(\n alpha2: string | undefined,\n): PostalCodeForm | undefined {\n const code = alpha2?.toUpperCase()\n if (code === undefined) {\n return undefined\n }\n if (DIGIT_COUNTRIES.has(code)) {\n return 'digits'\n }\n return SEPARATED_COUNTRIES.has(code) ? 'separated' : undefined\n}\n"],
5
- "mappings": ";AACA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA4GH;AAfJ,IAAM,qBAAqB,cAA2C,MAAS;AAOxE,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AACF,GAGG;AACD,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,MACjC,UACH;AAEJ;AAGO,SAAS,qBAAkD;AAChE,SAAO,WAAW,kBAAkB;AACtC;AAQA,IAAM,aAA4B,CAAC;AACnC,IAAM,uBAAuB,cAA6B,UAAU;AAG7D,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AAED,QAAM,UAAU;AAAA,IACd,MACE,YAAY,UAAa,eAAe,SACpC,aACA,EAAE,SAAS,WAAW;AAAA,IAC5B,CAAC,SAAS,UAAU;AAAA,EACtB;AACA,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,SACnC,UACH;AAEJ;AASO,IAAM,OAAO;AAAA,EAClB,YAAY,CAAC,MAAM,EAAE,SAAS,MAAM;AAAA,EACpC,UAAU,CAAC,MAAM,EAAE,SAAS,MAAM;AAAA,EAClC,gBAAgB,CAAC,MAAM,EAAE,SAAS,MAAM;AAAA,EACxC,kBAAkB,CAAC,MAAM,EAAE,SAAS,MAAM;AAAA,EAC1C,oBAAoB,CAAC,MAAM,EAAE,SAAS,MAA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